smartcompact 0.1.0 → 0.1.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 +61 -58
- package/README.zh-CN.md +112 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,61 +1,57 @@
|
|
|
1
1
|
# SmartCompact
|
|
2
2
|
|
|
3
|
-
**English
|
|
3
|
+
**English** · [中文](https://github.com/coffeecoproject/SmartCompact/blob/main/README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/smartcompact)
|
|
6
|
+
[](https://github.com/coffeecoproject/SmartCompact/stargazers)
|
|
7
|
+
[](https://github.com/coffeecoproject/SmartCompact/blob/main/LICENSE)
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
<p align="center"><a href="https://github.com/coffeecoproject/SmartCompact/raw/main/docs/media/smartcompact-en.mp4"><img src="https://raw.githubusercontent.com/coffeecoproject/SmartCompact/main/docs/media/cover-en.jpg" alt="SmartCompact in 90 seconds (video)" width="100%"></a></p>
|
|
10
|
+
<p align="center"><sub>▶ Watch the 90-second explainer (click the image to play)</sub></p>
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
**SmartCompact lets long coding-agent sessions compact earlier, at a pause after a piece of work is finished.** On 18–60 consecutive coding tasks it cut cost by **7–44%** with no loss in hidden acceptance tests; the longer the session, the more it saves. In the longest runs (60 tasks, native sessions reaching 820k–960k tokens) the model missed 6 of 180 recall questions about details mentioned in passing much earlier ([test report](https://github.com/coffeecoproject/SmartCompact/blob/main/docs/TEST-REPORT.md), in Chinese).
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
Every request re-reads the whole context, so a long context makes every step expensive. Native auto-compaction waits until the context is nearly full (close to 1M tokens in Claude Code, up to 800k in Codex if configured), and it ignores timing, so it often lands in the middle of a task. SmartCompact works with Claude Code (CLI and desktop app), [Pi](https://github.com/earendil-works/pi) and the Codex CLI:
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
- **Compact at a good moment.** Once the context passes the **allow line** (200k tokens by default), it compacts when a turn ends, if a piece of work has been finished since the last compaction (a commit, tests passing, a task completed).
|
|
17
|
+
- **Never in the middle of work.** It only decides when a turn ends, never mid-turn, and it waits while tests or the build are failing, errors keep repeating, or a background job is running.
|
|
18
|
+
- **A fallback.** If no good moment comes and the context passes the **grace line** (allow line × 1.3), it compacts at the end of a turn.
|
|
19
|
+
- **A progress ledger bridges the gap.** Files changed, the latest commit and test result, and decisions the agent recorded are handed back to the model after compaction.
|
|
20
|
+
- **No pointless compactions.** It skips compaction when it would not free enough space.
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
- 不在一件事做到一半时主动压缩;测试失败、构建失败、连续报错或后台任务还在跑时也不压缩。
|
|
17
|
-
- 一直等不到合适时机、上下文超过**宽限线**(允许压缩线 × 1.3)时,在一轮结束时压缩,作为兜底。
|
|
18
|
-
- 压缩前后用一份**进度笔记**接上:改过的文件、最近的提交和测试结果、记下的决定,压缩后补回给模型。
|
|
19
|
-
- 预计腾不出足够空间时不压缩,避免刚压缩完又压缩。
|
|
22
|
+
## Results
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
The same codebase and 18–30 consecutive development tasks, where later tasks change the results of earlier ones; each platform run 3 times with and 3 times without SmartCompact. Acceptance is graded by hidden tests the model never sees; after each round the model answers recall questions, including details mentioned in passing much earlier.
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
| 平台(模型) | 原生压缩点 | 成本 | 任务验收 | 记忆题 |
|
|
26
|
+
| Platform (model) | Native compaction | Cost | Tasks accepted | Recall |
|
|
26
27
|
|---|---|---|---|---|
|
|
27
|
-
| Codex
|
|
28
|
-
|
|
|
29
|
-
| Claude Code
|
|
30
|
-
|
|
31
|
-
成本按各家价格比例折算成"缓存读取 token 当量"。规律:原生压缩得越晚、会话涨得越快,省得越多;会话没超过 20 万时插件不起作用,也没有坏处。完整方法、数据、代价和局限见 [docs/TEST-REPORT.md](docs/TEST-REPORT.md)。
|
|
28
|
+
| Codex (gpt-6-astra) | 800k | **−19%** | 18/18 both | 54/54 both |
|
|
29
|
+
| Pi (gpt-5.5) | about 256k | −11% to −22% | 18/18 both | native 51/54, SmartCompact 53/54 |
|
|
30
|
+
| Claude Code (Haiku 5.5, 30 tasks) | close to 1M | −7% (noisy) | 30/30 both | 90/90 both |
|
|
31
|
+
| Claude Code (Haiku 5.5, 60 tasks) | close to 1M | **−44%** | native 59–60/60, SmartCompact 60/60 | native 180/180, SmartCompact 174/180 |
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Cost is converted to cached-input-token equivalents using each provider's price ratios. The later native compaction kicks in and the faster a session grows, the more it saves. Below 200k SmartCompact does nothing, so it costs nothing either. After a compaction the model spends extra requests getting familiar with the code again; that is included in the cost above. These are small samples on one codebase and one kind of task; the [report](https://github.com/coffeecoproject/SmartCompact/blob/main/docs/TEST-REPORT.md) has the method, the data and the limitations.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
## Install
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
**Claude Code** (2.1.295 or later)
|
|
38
38
|
|
|
39
39
|
```
|
|
40
40
|
/plugin marketplace add coffeecoproject/SmartCompact
|
|
41
41
|
/plugin install smartcompact@smartcompact
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
It takes effect in new sessions. The plugin moves the native auto-compaction to about the grace line; `/smartcompact pause` returns the current session to native behavior.
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
**Pi**
|
|
47
47
|
|
|
48
|
-
```
|
|
48
|
+
```
|
|
49
49
|
pi install npm:smartcompact
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
pi 默认配置下,插件在一轮结束(`agent_settled`)时挑阶段节点主动压缩。如果你把 `reserveTokens` 调大、让 pi 的原生压缩提前,插件会在那个点按工作状态决定是否推迟。
|
|
52
|
+
With Pi's default settings, SmartCompact compacts at a finished piece of work when a turn ends (`agent_settled`). If you raise `reserveTokens` so that Pi's native compaction comes earlier, SmartCompact decides at that point whether to postpone it, based on the state of the work.
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
需要 Node ≥ 22.18(直接运行 TypeScript)和 Codex CLI ≥ 0.162。
|
|
54
|
+
**Codex CLI** (0.162 or later, Node.js 22.18 or later)
|
|
59
55
|
|
|
60
56
|
```bash
|
|
61
57
|
git clone https://github.com/coffeecoproject/SmartCompact.git
|
|
@@ -63,47 +59,54 @@ cd SmartCompact
|
|
|
63
59
|
node scripts/codex.ts install
|
|
64
60
|
```
|
|
65
61
|
|
|
66
|
-
|
|
62
|
+
The script only appends one marked block of hooks to `~/.codex/config.toml` (or `$CODEX_HOME/config.toml`), backing up the file first. Trust the 4 hooks when Codex asks on its next start. Run install again after upgrading Node or moving the repository.
|
|
67
63
|
|
|
68
|
-
Codex
|
|
64
|
+
Codex hooks cannot postpone a compaction in the middle of a turn, so SmartCompact decides when a turn ends and, if it should compact, starts the compaction through Codex's shared background server once the session is idle (the interactive UI uses it by default). `codex exec` does not use the shared server by default, and the Codex App (ChatGPT.app) currently cannot; there SmartCompact only hands back the progress ledger, and compaction follows Codex's native rules. For a fallback there, add Codex's own `model_post_turn_compact_threshold_percent` at the top of `config.toml`: it compacts after a turn ends once the context passes that percentage of the usable window (31 is about 260k for an 872k window; see the test report).
|
|
69
65
|
|
|
70
|
-
##
|
|
66
|
+
## Settings
|
|
71
67
|
|
|
72
|
-
|
|
|
68
|
+
| Setting | Default | Meaning |
|
|
73
69
|
|---|---|---|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
70
|
+
| Allow line | 200000 | Above it, compact when a turn ends once a piece of work has been finished |
|
|
71
|
+
| Grace factor | 1.3 | Above allow line × factor, stop waiting for a finished piece of work |
|
|
72
|
+
| Minimum freed | 60000 | Skip compaction if it is expected to free less than this |
|
|
73
|
+
|
|
74
|
+
- Claude Code: the plugin options `allowLineTokens`, `graceFactor` and `minFreedTokens`; leave them empty for the defaults.
|
|
75
|
+
- Pi: the flags `--smartcompact-allow-line`, `--smartcompact-grace` and `--smartcompact-min-freed`.
|
|
76
|
+
- Codex: the environment variables `SMARTCOMPACT_ALLOW_LINE`, `SMARTCOMPACT_GRACE` and `SMARTCOMPACT_MIN_FREED`.
|
|
77
|
+
|
|
78
|
+
## Seeing what it did
|
|
79
|
+
|
|
80
|
+
- Claude Code and Pi: `/smartcompact` (or `/smartcompact report`) shows the three lines, the finished-work signals it saw and a cost estimate; `/smartcompact pause` and `resume` turn it off and on for the session. The model can also call a `checkpoint` tool to record decisions, which come back with the ledger after compaction.
|
|
81
|
+
- Codex: `node adapters/codex/report.ts <session ID>`; records are kept in `~/.codex/smartcompact/`.
|
|
82
|
+
|
|
83
|
+
## FAQ
|
|
77
84
|
|
|
78
|
-
|
|
79
|
-
- pi:命令行开关 `--smartcompact-allow-line`、`--smartcompact-grace`、`--smartcompact-min-freed`。
|
|
80
|
-
- Codex:环境变量 `SMARTCOMPACT_ALLOW_LINE`、`SMARTCOMPACT_GRACE`、`SMARTCOMPACT_MIN_FREED`。
|
|
85
|
+
**How does it know a piece of work is finished?** From the commands the agent runs. Any finished piece of work since the last compaction counts, not only one in the current turn: the end of a turn is already a pause, so waiting for the next commit would mostly just cost more. A commit counts if `git commit` actually ran and the tool call did not fail. A test command piped into something else (`| tail`) without `pipefail` does not count, since its exit code cannot be trusted.
|
|
81
86
|
|
|
82
|
-
|
|
87
|
+
**Will the model forget things after compaction?** Sometimes, for details mentioned in passing. The ledger only records files, commits, tests and decisions the model chose to record. Details the user mentions in passing are kept by asking the compaction summary to keep every specific fact the user stated. On Pi this clearly reduced losses, but it is not a guarantee.
|
|
83
88
|
|
|
84
|
-
|
|
85
|
-
- Codex:`node adapters/codex/report.ts <会话 ID>`,记录在 `~/.codex/smartcompact/`。
|
|
89
|
+
**Anything specific to Claude Code?** SmartCompact's fallback point is close to the native compaction point it moves. If it cannot recognize a finished piece of work for a long time, native compaction may still fire mid-turn. SmartCompact moves the native compaction point by setting `CLAUDE_CODE_AUTO_COMPACT_WINDOW` in the session, and processes started from that session inherit it: a `claude -p` or script the agent runs will compact at about 260k as well. Unset the variable for such processes if that matters.
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
**How do I remove it?**
|
|
88
92
|
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
- 评测只用了一个代码库和一种任务类型,Claude 只测了 Haiku。
|
|
93
|
+
- Claude Code: `/plugin uninstall smartcompact@smartcompact`.
|
|
94
|
+
- Pi: `pi remove npm:smartcompact`.
|
|
95
|
+
- Codex: `node scripts/codex.ts uninstall` in the repository.
|
|
93
96
|
|
|
94
|
-
##
|
|
97
|
+
## Development
|
|
95
98
|
|
|
96
99
|
```bash
|
|
97
100
|
sh scripts/check.sh
|
|
98
101
|
```
|
|
99
102
|
|
|
100
|
-
|
|
103
|
+
This runs the structure checks, the core dependency boundary check and all tests. Layout:
|
|
101
104
|
|
|
102
|
-
- `plugin
|
|
103
|
-
- `adapters/pi
|
|
104
|
-
- `eval
|
|
105
|
-
- `DESIGN.md
|
|
105
|
+
- `plugin/`: the Claude Code plugin. `plugin/src/core/` holds the platform-independent decisions, signals, ledger and cost estimate that every adapter reuses.
|
|
106
|
+
- `adapters/pi/`, `adapters/codex/`: the Pi and Codex adapters.
|
|
107
|
+
- `eval/`: the A/B evaluation scripts (one each for Claude, Pi and Codex); the task format is described in `eval/day.py`. The tasks and hidden tests come from an internal project and are not published.
|
|
108
|
+
- `DESIGN.md`: design notes; `docs/TEST-REPORT.md`: the test report (both in Chinese).
|
|
106
109
|
|
|
107
|
-
##
|
|
110
|
+
## License
|
|
108
111
|
|
|
109
|
-
[
|
|
112
|
+
MIT. See [LICENSE](https://github.com/coffeecoproject/SmartCompact/blob/main/LICENSE).
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# SmartCompact
|
|
2
|
+
|
|
3
|
+
[English](https://github.com/coffeecoproject/SmartCompact/blob/main/README.md) · **中文**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/smartcompact)
|
|
6
|
+
[](https://github.com/coffeecoproject/SmartCompact/stargazers)
|
|
7
|
+
[](https://github.com/coffeecoproject/SmartCompact/blob/main/LICENSE)
|
|
8
|
+
|
|
9
|
+
<p align="center"><a href="https://github.com/coffeecoproject/SmartCompact/raw/main/docs/media/smartcompact-zh.mp4"><img src="https://raw.githubusercontent.com/coffeecoproject/SmartCompact/main/docs/media/cover-zh.jpg" alt="90 秒看懂 SmartCompact(视频)" width="100%"></a></p>
|
|
10
|
+
<p align="center"><sub>▶ 90 秒动画介绍(点击图片播放)</sub></p>
|
|
11
|
+
|
|
12
|
+
**SmartCompact 让编程 agent 的长会话早点压缩,挑在做完一件事之后的停顿处。** 在 18~60 个连续开发任务上,成本降低 **7%~44%**,隐藏验收测试没有损失,会话越长省得越多。最长的一组(60 个任务,原生组上下文到 82 万~96 万)里,很早之前随口提到的细节,180 道记忆题少答对 6 道([测试报告](https://github.com/coffeecoproject/SmartCompact/blob/main/docs/TEST-REPORT.md))。
|
|
13
|
+
|
|
14
|
+
agent 每发一次请求,都要把整段上下文重新读一遍,上下文越长,每一步越贵。原生的自动压缩要等到快满了才触发(Claude Code 接近 100 万,Codex 可以配到 80 万),而且不看时机,常常发生在一件事做到一半的时候。SmartCompact 支持 Claude Code(终端和桌面 App)、[Pi](https://github.com/earendil-works/pi) 和 Codex 命令行:
|
|
15
|
+
|
|
16
|
+
- **挑对时机压缩。** 上下文超过**允许压缩线**(默认 20 万)以后,只要上次压缩以来做完过一件事(一次提交、测试通过、任务完成),就在这一轮结束时压缩。
|
|
17
|
+
- **不在做到一半时压缩。** 只在一轮结束时判断,从不在一轮中间主动压缩;测试失败、构建失败、连续报错或后台任务还在跑时先等着。
|
|
18
|
+
- **有兜底。** 一直等不到合适时机、上下文超过**宽限线**(允许压缩线 × 1.3)时,在一轮结束时压缩。
|
|
19
|
+
- **用进度笔记接上。** 改过的文件、最近的提交和测试结果、记下的决定,压缩后补回给模型。
|
|
20
|
+
- **不做白费的压缩。** 预计腾不出足够空间时不压缩,避免刚压缩完又压缩。
|
|
21
|
+
|
|
22
|
+
## 实验结果
|
|
23
|
+
|
|
24
|
+
同一个代码库、连续 18~30 个开发任务(后面的任务会修改前面任务的结果),每个平台装与不装各跑 3 次。验收由脚本跑模型看不到的隐藏测试;每轮结束问几道记忆题,包括很早之前随口提到的细节。
|
|
25
|
+
|
|
26
|
+
| 平台(模型) | 原生压缩点 | 成本 | 任务验收 | 记忆题 |
|
|
27
|
+
|---|---|---|---|---|
|
|
28
|
+
| Codex(gpt-6-astra) | 80 万 | **−19%** | 两组都 18/18 | 两组都 54/54 |
|
|
29
|
+
| Pi(gpt-5.5) | 约 25.6 万 | −11%~−22% | 两组都 18/18 | 原生 51/54,插件 53/54 |
|
|
30
|
+
| Claude Code(Haiku 5.5,30 个任务) | 接近 100 万 | −7%(波动较大) | 两组都 30/30 | 两组都 90/90 |
|
|
31
|
+
| Claude Code(Haiku 5.5,60 个任务) | 接近 100 万 | **−44%** | 原生 59~60/60,插件 60/60 | 原生 180/180,插件 174/180 |
|
|
32
|
+
|
|
33
|
+
成本按各家价格比例折算成"缓存读取 token 当量"。原生压缩得越晚、会话涨得越快,省得越多;会话没超过 20 万时插件不起作用,也没有额外开销。压缩后模型要多花一些请求重新熟悉代码,这部分已计入上面的成本。样本小,只用了一个代码库和一种任务类型;方法、数据和局限见[测试报告](https://github.com/coffeecoproject/SmartCompact/blob/main/docs/TEST-REPORT.md)。
|
|
34
|
+
|
|
35
|
+
## 安装
|
|
36
|
+
|
|
37
|
+
**Claude Code**(2.1.295 及以上)
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
/plugin marketplace add coffeecoproject/SmartCompact
|
|
41
|
+
/plugin install smartcompact@smartcompact
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
装好后新开会话生效。插件会把原生自动压缩线调到宽限线附近,`/smartcompact pause` 可以让当前会话恢复原生行为。
|
|
45
|
+
|
|
46
|
+
**Pi**
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
pi install npm:smartcompact
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Pi 默认配置下,插件在一轮结束(`agent_settled`)时挑刚做完一件事的时机压缩。如果你把 `reserveTokens` 调大、让 Pi 的原生压缩提前,插件会在那个点按工作状态决定是否推迟。
|
|
53
|
+
|
|
54
|
+
**Codex 命令行**(0.162 及以上,Node.js 22.18 及以上)
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
git clone https://github.com/coffeecoproject/SmartCompact.git
|
|
58
|
+
cd SmartCompact
|
|
59
|
+
node scripts/codex.ts install
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
安装脚本只在 `~/.codex/config.toml`(或 `$CODEX_HOME/config.toml`)末尾写入一段带标记的 hook 配置,改之前备份原文件。下次启动 Codex 时按提示信任这 4 个 hook。升级 Node 或移动仓库后重新运行一次 install。
|
|
63
|
+
|
|
64
|
+
Codex 的 hook 不能推迟一轮中间的压缩,所以插件在一轮结束时判断,需要压缩就通过 Codex 的共享后台服务(交互界面默认会用它)在会话空闲时发起。`codex exec` 默认不走共享后台服务,Codex App(ChatGPT.app)目前走不了,这时插件只补回进度笔记,压缩仍按 Codex 原生规则。想给它们也加个兜底,可以在 `config.toml` 顶部加上 Codex 自带的 `model_post_turn_compact_threshold_percent`:上下文超过可用窗口的这个百分比时,在一轮结束后压缩(窗口 87.2 万时设 31,约 26 万;详见测试报告)。
|
|
65
|
+
|
|
66
|
+
## 参数
|
|
67
|
+
|
|
68
|
+
| 参数 | 默认 | 含义 |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| 允许压缩线 | 200000 | 超过它、做完过一件事后,在一轮结束时压缩 |
|
|
71
|
+
| 宽限倍数 | 1.3 | 超过 允许压缩线 × 倍数 时不再等刚做完一件事 |
|
|
72
|
+
| 最少腾出空间 | 60000 | 预计腾出的空间少于它时不压缩 |
|
|
73
|
+
|
|
74
|
+
- Claude Code:插件配置项 `allowLineTokens`、`graceFactor`、`minFreedTokens`,留空用默认值。
|
|
75
|
+
- Pi:命令行开关 `--smartcompact-allow-line`、`--smartcompact-grace`、`--smartcompact-min-freed`。
|
|
76
|
+
- Codex:环境变量 `SMARTCOMPACT_ALLOW_LINE`、`SMARTCOMPACT_GRACE`、`SMARTCOMPACT_MIN_FREED`。
|
|
77
|
+
|
|
78
|
+
## 查看效果
|
|
79
|
+
|
|
80
|
+
- Claude Code 和 Pi:`/smartcompact`(或 `/smartcompact report`)查看三条线、识别到的阶段节点和成本估算;`/smartcompact pause` / `resume` 暂停或恢复当前会话。模型还可以调用 `checkpoint` 工具记下决定,压缩后和进度笔记一起补回。
|
|
81
|
+
- Codex:`node adapters/codex/report.ts <会话 ID>`,记录在 `~/.codex/smartcompact/`。
|
|
82
|
+
|
|
83
|
+
## 常见问题
|
|
84
|
+
|
|
85
|
+
**怎么判断"做完一件事"?** 靠识别 agent 执行的命令。看的是上次压缩以来有没有做完过一件事,不要求正好在这一轮:一轮结束本身就是停顿点,非要等下一次提交,多半只是多花钱。提交只要真的执行了 `git commit` 且工具调用没报错就算;测试命令接了管道(`| tail`)又没开 `pipefail` 时退出码不可信,不算测试结果。
|
|
86
|
+
|
|
87
|
+
**压缩后模型会不会忘事?** 随口提到的细节有时会丢。进度笔记只记文件、提交、测试和模型主动记下的决定。用户在对话里随口交代的细节,靠压缩时要求摘要原样保留用户说过的具体信息。Pi 上这样做明显减少了丢失,但不能保证不丢。
|
|
88
|
+
|
|
89
|
+
**Claude Code 上有什么要注意的?** 插件的兜底压缩点和它调整后的原生压缩点接近;长时间认不出刚做完一件事时,原生压缩仍可能在一轮中间触发。插件是通过在会话里设置 `CLAUDE_CODE_AUTO_COMPACT_WINDOW` 来调整原生压缩点的,从这个会话里启动的进程会继承它:agent 运行的 `claude -p` 或脚本里启动的 Claude,也会在 26 万左右压缩。需要的话,启动这类进程前去掉这个变量。
|
|
90
|
+
|
|
91
|
+
**怎么卸载?**
|
|
92
|
+
|
|
93
|
+
- Claude Code:`/plugin uninstall smartcompact@smartcompact`。
|
|
94
|
+
- Pi:`pi remove npm:smartcompact`。
|
|
95
|
+
- Codex:在仓库目录里运行 `node scripts/codex.ts uninstall`。
|
|
96
|
+
|
|
97
|
+
## 开发
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
sh scripts/check.sh
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
运行结构校验、core 依赖边界检查和全部测试。目录:
|
|
104
|
+
|
|
105
|
+
- `plugin/`:Claude Code 插件;`plugin/src/core/` 是和平台无关的决策、信号、进度笔记和成本估算,其他适配都复用它。
|
|
106
|
+
- `adapters/pi/`、`adapters/codex/`:Pi 和 Codex 的适配。
|
|
107
|
+
- `eval/`:对照评测脚本(Claude、Pi、Codex 各一个),任务格式见 `eval/day.py`;评测用的题目和隐藏测试来自内部项目,没有放进仓库。
|
|
108
|
+
- `DESIGN.md`:设计说明;`docs/TEST-REPORT.md`:测试报告。
|
|
109
|
+
|
|
110
|
+
## 许可证
|
|
111
|
+
|
|
112
|
+
MIT,见 [LICENSE](https://github.com/coffeecoproject/SmartCompact/blob/main/LICENSE)。
|
package/package.json
CHANGED