@henryqw/pi-auto-compact 1.1.8 → 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.
Files changed (2) hide show
  1. package/README.md +20 -20
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # `@henryqw/pi-auto-compact`
2
2
 
3
- Compact context before it hits the configured threshold, then resume the current task.
3
+ Compact context before it reaches the configured threshold. Then resume the current task.
4
4
 
5
5
  ## Why
6
6
 
7
- - **Created for**: Compacting session context automatically before it reaches the configured threshold.
8
- - **Advantage**: Triggers early, uses a dedicated model, and resumes the interrupted task without manual intervention.
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.3+.
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
- | Surface | Type | Purpose |
40
- | --- | --- | --- |
41
- | `/auto-compact` | command | Set the compaction threshold. |
39
+ Use `/auto-compact` to set the compaction threshold.
42
40
 
43
- Refuses to activate unless effective `compaction.enabled` is `false`. Checks `turn_start`, tool-call `turn_end`, `agent_end`, `context`, and resumed or forked `session_start`. Its consumer-owned `pi-auto-compact/autoCompact` task defaults to `fast`. Tries the effective profile primary, then fallback; if neither route works, the current session model still compacts. After mid-task compaction, a follow-up message continues the current task.
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
- | Field | Required | Possible values | Default |
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 (legacy model fields are obsolete). `/auto-compact` writes this file. A missing file uses the default; a malformed or invalid file fails visibly at session start, falls back to 50%, and stays unchanged.
59
+ Unknown fields are ignored. Legacy model fields are obsolete. `/auto-compact` writes this file.
60
60
 
61
- Shared: `~/.pi/agent/config/pi-task-models.json`, owned by `@henryqw/pi-task-models`. The local `pi-auto-compact/autoCompact` declaration defaults to `fast`; a task entry is an explicit user override. Malformed shared task-model config is reported and left unchanged; compaction then uses the current session model.
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.8",
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",
@@ -25,7 +25,7 @@
25
25
  "pack:check": "npm pack --dry-run"
26
26
  },
27
27
  "peerDependencies": {
28
- "@earendil-works/pi-coding-agent": "^0.84.3"
28
+ "@earendil-works/pi-coding-agent": "^0.84.4"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",