afucontext 0.1.17 → 0.1.18
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
CHANGED
|
@@ -20,13 +20,13 @@ Install and sign in to your host first. You need npm, Node.js **22.19+ (22.x) or
|
|
|
20
20
|
|
|
21
21
|
| Host | System | Install | Launch after installation | Tested version |
|
|
22
22
|
| --- | --- | --- | --- | --- |
|
|
23
|
-
| <a id="afu-claude"></a>Claude Code | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
24
|
-
| <a id="afu-codex"></a>Codex CLI | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
25
|
-
| <a id="afu-pi"></a>Pi | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
26
|
-
| <a id="afu-dsh"></a>DSH | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
27
|
-
| Codex CLI | Windows 10/11¹ | `npx.cmd --yes --registry=https://registry.npmjs.org "afucontext@0.1.
|
|
28
|
-
| Pi | Windows 10/11¹ | `npx.cmd --yes --registry=https://registry.npmjs.org "afucontext@0.1.
|
|
29
|
-
| DSH | Windows 10/11¹ | `npx.cmd --yes --registry=https://registry.npmjs.org "afucontext@0.1.
|
|
23
|
+
| <a id="afu-claude"></a>Claude Code | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 install claude` | `claude` | 2.1.293 |
|
|
24
|
+
| <a id="afu-codex"></a>Codex CLI | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 install codex` | `codex` | 0.153.4 |
|
|
25
|
+
| <a id="afu-pi"></a>Pi | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 install pi` | `pi` | 0.84.4, 1.5.0 |
|
|
26
|
+
| <a id="afu-dsh"></a>DSH | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 install dsh --profile YOUR_PROFILE` | `dsh --profile YOUR_PROFILE` | 0.2.2-rc.1 |
|
|
27
|
+
| Codex CLI | Windows 10/11¹ | `npx.cmd --yes --registry=https://registry.npmjs.org "afucontext@0.1.18" install codex` | `codex` | preview, not yet tested; official in the next release |
|
|
28
|
+
| Pi | Windows 10/11¹ | `npx.cmd --yes --registry=https://registry.npmjs.org "afucontext@0.1.18" install pi` | `pi` | preview, not yet tested; official in the next release |
|
|
29
|
+
| DSH | Windows 10/11¹ | `npx.cmd --yes --registry=https://registry.npmjs.org "afucontext@0.1.18" install dsh --profile YOUR_PROFILE` | `dsh --profile YOUR_PROFILE` | preview, not yet tested; official in the next release |
|
|
30
30
|
|
|
31
31
|
Supported on macOS (Apple Silicon) and Linux x64. Start a new session after installing.
|
|
32
32
|
|
|
@@ -36,6 +36,30 @@ Supported on macOS (Apple Silicon) and Linux x64. Start a new session after inst
|
|
|
36
36
|
|
|
37
37
|
<a id="results"></a>
|
|
38
38
|
|
|
39
|
+
## Commands
|
|
40
|
+
|
|
41
|
+
The terminal commands (`afuctx …`) are placed in `~/.local/bin` by the first install; if that folder is not on `PATH`, use `npx --yes --registry=https://registry.npmjs.org afucontext@latest` in place of `afuctx`. Install, upgrade and remove replace the runtime itself, so they always run through npx.
|
|
42
|
+
|
|
43
|
+
| Command | What it does |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `npx --yes --registry=https://registry.npmjs.org afucontext@latest install claude\|codex\|pi\|dsh` | Install for a host; for DSH add `--profile NAME` |
|
|
46
|
+
| `npx --yes --registry=https://registry.npmjs.org afucontext@latest install dsh --runtime-only` | Prepare only the runtime, for use with `dsh plugin --profile NAME add afucontext-dsh-plugin` |
|
|
47
|
+
| `npx --yes --registry=https://registry.npmjs.org afucontext@latest update` | Upgrade every host installed on this machine to this version |
|
|
48
|
+
| `npx --yes --registry=https://registry.npmjs.org afucontext@latest remove HOST` | Remove; host settings return to their state before installation. For DSH, `--profile NAME` removes one profile |
|
|
49
|
+
| `afuctx status` | Whether each host is connected, how far the context is from the trigger, compactions applied; `--json` for the full record |
|
|
50
|
+
| `afuctx dashboard` | Open the local dashboard (same as `afuctx-admin`); `--prices FILE` estimates costs with your prices |
|
|
51
|
+
| `afuctx repair codex --network` | Find and verify the proxy route to the model again (`repair claude` for Claude Code) |
|
|
52
|
+
| `afuctx gc --dry-run` | List old runtimes and logs that can be removed; without `--dry-run` it removes them |
|
|
53
|
+
| `afuctx --version` / `afuctx --help` | Version / help |
|
|
54
|
+
|
|
55
|
+
Inside a host session:
|
|
56
|
+
|
|
57
|
+
| Host | Status | Dashboard |
|
|
58
|
+
| --- | --- | --- |
|
|
59
|
+
| Claude Code | `/afuctx:status` | `/afuctx:dashboard` |
|
|
60
|
+
| Codex | `$afuctx-status` | `$afuctx-dashboard` |
|
|
61
|
+
| Pi / DSH | `/afuctx-status` | `/afuctx-dashboard` |
|
|
62
|
+
|
|
39
63
|
## Benchmark results
|
|
40
64
|
|
|
41
65
|
In a LongBench V2 replay of 39 history questions (20 agent histories and 19 dialogue histories), AFU’s asynchronous strategy answered **23 correctly** with an average context of **15.9k tokens**.
|
|
@@ -74,8 +98,8 @@ Type `/afuctx:status` in Claude Code, `$afuctx-status` in Codex, `/afuctx-status
|
|
|
74
98
|
Without the terminal commands (for example when `~/.local/bin` is not on `PATH`), use the full npx commands. For Codex; for another host replace `codex` with `claude`, `pi` or `dsh`:
|
|
75
99
|
|
|
76
100
|
```sh
|
|
77
|
-
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
78
|
-
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
101
|
+
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 status codex --brief
|
|
102
|
+
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 ui
|
|
79
103
|
```
|
|
80
104
|
|
|
81
105
|
### What the dashboard shows
|
|
@@ -121,12 +145,12 @@ Run the same install command with options, then start a new session. For Codex;
|
|
|
121
145
|
|
|
122
146
|
```sh
|
|
123
147
|
# Trigger at 30% of a manually set 200,000-token window (60,000 tokens)
|
|
124
|
-
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
148
|
+
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 install codex --context-window 200000 --ratio 0.3
|
|
125
149
|
# Restore automatic settings
|
|
126
|
-
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
150
|
+
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 install codex --context-window auto --ratio auto
|
|
127
151
|
```
|
|
128
152
|
|
|
129
|
-
For frequent use, run `npm install -g --registry=https://registry.npmjs.org afucontext@0.1.
|
|
153
|
+
For frequent use, run `npm install -g --registry=https://registry.npmjs.org afucontext@0.1.18` and use `afuctx` in place of the full `npx` invocation. For example, `afuctx dashboard --prices ./afu-prices.json` opens the dashboard with your price file to estimate costs.
|
|
130
154
|
|
|
131
155
|
## Upgrade and remove
|
|
132
156
|
|
|
@@ -148,8 +172,8 @@ npx --yes --registry=https://registry.npmjs.org afucontext@latest status --brief
|
|
|
148
172
|
To upgrade or remove one host:
|
|
149
173
|
|
|
150
174
|
```sh
|
|
151
|
-
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
152
|
-
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
175
|
+
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 upgrade codex
|
|
176
|
+
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 remove codex
|
|
153
177
|
```
|
|
154
178
|
|
|
155
179
|
Use `remove pi` or `remove dsh` for those integrations. In Windows PowerShell, use `npx.cmd` and double-quote the package name.
|
package/README.zh-CN.md
CHANGED
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
|
|
21
21
|
| 宿主 | 系统 | 一键安装 | 安装后启动 | 实测版本 |
|
|
22
22
|
| --- | --- | --- | --- | --- |
|
|
23
|
-
| <a id="afu-claude"></a>Claude Code | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
24
|
-
| <a id="afu-codex"></a>Codex CLI | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
25
|
-
| <a id="afu-pi"></a>Pi | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
26
|
-
| <a id="afu-dsh"></a>DSH | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
27
|
-
| Codex CLI | Windows 10/11¹ | `npx.cmd --yes --registry=https://registry.npmjs.org "afucontext@0.1.
|
|
28
|
-
| Pi | Windows 10/11¹ | `npx.cmd --yes --registry=https://registry.npmjs.org "afucontext@0.1.
|
|
29
|
-
| DSH | Windows 10/11¹ | `npx.cmd --yes --registry=https://registry.npmjs.org "afucontext@0.1.
|
|
23
|
+
| <a id="afu-claude"></a>Claude Code | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 install claude` | `claude` | 2.1.293 |
|
|
24
|
+
| <a id="afu-codex"></a>Codex CLI | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 install codex` | `codex` | 0.153.4 |
|
|
25
|
+
| <a id="afu-pi"></a>Pi | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 install pi` | `pi` | 0.84.4、1.5.0 |
|
|
26
|
+
| <a id="afu-dsh"></a>DSH | macOS / Linux | `npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 install dsh --profile YOUR_PROFILE` | `dsh --profile YOUR_PROFILE` | 0.2.2-rc.1 |
|
|
27
|
+
| Codex CLI | Windows 10/11¹ | `npx.cmd --yes --registry=https://registry.npmjs.org "afucontext@0.1.18" install codex` | `codex` | 预览,未实测,下一版本正式提供 |
|
|
28
|
+
| Pi | Windows 10/11¹ | `npx.cmd --yes --registry=https://registry.npmjs.org "afucontext@0.1.18" install pi` | `pi` | 预览,未实测,下一版本正式提供 |
|
|
29
|
+
| DSH | Windows 10/11¹ | `npx.cmd --yes --registry=https://registry.npmjs.org "afucontext@0.1.18" install dsh --profile YOUR_PROFILE` | `dsh --profile YOUR_PROFILE` | 预览,未实测,下一版本正式提供 |
|
|
30
30
|
|
|
31
31
|
支持 macOS(Apple Silicon)和 x64 Linux;安装后新开会话即可。
|
|
32
32
|
|
|
@@ -36,6 +36,30 @@
|
|
|
36
36
|
|
|
37
37
|
<a id="results"></a>
|
|
38
38
|
|
|
39
|
+
## 命令一览
|
|
40
|
+
|
|
41
|
+
终端命令(`afuctx …`)在首次安装后放到 `~/.local/bin`;该目录不在 `PATH` 时,把 `afuctx` 换成 `npx --yes --registry=https://registry.npmjs.org afucontext@latest`。安装、升级、移除这类会替换运行时本身的命令,始终用 npx 执行。
|
|
42
|
+
|
|
43
|
+
| 命令 | 作用 |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `npx --yes --registry=https://registry.npmjs.org afucontext@latest install claude\|codex\|pi\|dsh` | 安装到指定宿主;DSH 加 `--profile 名称` |
|
|
46
|
+
| `npx --yes --registry=https://registry.npmjs.org afucontext@latest install dsh --runtime-only` | 只准备运行时,配合 `dsh plugin --profile 名称 add afucontext-dsh-plugin` 使用 |
|
|
47
|
+
| `npx --yes --registry=https://registry.npmjs.org afucontext@latest update` | 把本机已装的所有宿主一次升级到这个版本 |
|
|
48
|
+
| `npx --yes --registry=https://registry.npmjs.org afucontext@latest remove 宿主` | 移除,宿主配置恢复成安装前的样子;DSH 可加 `--profile 名称` 只移除一个 profile |
|
|
49
|
+
| `afuctx status` | 各宿主是否接入、当前上下文离触发线多远、已压缩几次;加 `--json` 输出完整信息 |
|
|
50
|
+
| `afuctx dashboard` | 打开本地面板(同 `afuctx-admin`);`--prices 文件` 用自己的单价估算费用 |
|
|
51
|
+
| `afuctx repair codex --network` | 重新查找并验证连到模型服务的代理(Claude Code 用 `repair claude`) |
|
|
52
|
+
| `afuctx gc --dry-run` | 查看可清理的旧版本运行时和日志;去掉 `--dry-run` 才会真正清理 |
|
|
53
|
+
| `afuctx --version` / `afuctx --help` | 版本号 / 帮助 |
|
|
54
|
+
|
|
55
|
+
宿主会话里也可以直接用:
|
|
56
|
+
|
|
57
|
+
| 宿主 | 查看状态 | 打开面板 |
|
|
58
|
+
| --- | --- | --- |
|
|
59
|
+
| Claude Code | `/afuctx:status` | `/afuctx:dashboard` |
|
|
60
|
+
| Codex | `$afuctx-status` | `$afuctx-dashboard` |
|
|
61
|
+
| Pi / DSH | `/afuctx-status` | `/afuctx-dashboard` |
|
|
62
|
+
|
|
39
63
|
## 评测效果
|
|
40
64
|
|
|
41
65
|
在 LongBench V2 的 39 道历史问答回放中(20 道 Agent 历史、19 道对话历史),AFU 异步压缩答对 **23 道**,平均上下文为 **15.9k tokens**。
|
|
@@ -74,8 +98,8 @@ Claude Code 输入 `/afuctx:status`,Codex 输入 `$afuctx-status`,Pi 和 DSH
|
|
|
74
98
|
没有上面的终端命令时(例如 `~/.local/bin` 不在 `PATH` 中),可以用完整的 npx 命令。以 Codex 为例,其它宿主将 `codex` 换成 `claude`、`pi` 或 `dsh`:
|
|
75
99
|
|
|
76
100
|
```sh
|
|
77
|
-
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
78
|
-
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
101
|
+
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 status codex --brief
|
|
102
|
+
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 ui
|
|
79
103
|
```
|
|
80
104
|
|
|
81
105
|
### 面板内容
|
|
@@ -121,12 +145,12 @@ npx --yes --registry=https://registry.npmjs.org afucontext@0.1.17 ui
|
|
|
121
145
|
|
|
122
146
|
```sh
|
|
123
147
|
# 在 30% 触发,并手动指定 200,000 的窗口(即 60,000 触发)
|
|
124
|
-
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
148
|
+
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 install codex --context-window 200000 --ratio 0.3
|
|
125
149
|
# 恢复自动设置
|
|
126
|
-
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
150
|
+
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 install codex --context-window auto --ratio auto
|
|
127
151
|
```
|
|
128
152
|
|
|
129
|
-
如果经常使用 AFU,可运行 `npm install -g --registry=https://registry.npmjs.org afucontext@0.1.
|
|
153
|
+
如果经常使用 AFU,可运行 `npm install -g --registry=https://registry.npmjs.org afucontext@0.1.18`,以后用 `afuctx` 代替完整的 `npx` 命令。例如,`afuctx dashboard --prices ./afu-prices.json` 用自己的单价文件打开面板估算费用。
|
|
130
154
|
|
|
131
155
|
## 升级与移除
|
|
132
156
|
|
|
@@ -148,8 +172,8 @@ npx --yes --registry=https://registry.npmjs.org afucontext@latest status --brief
|
|
|
148
172
|
只升级或移除某一个宿主:
|
|
149
173
|
|
|
150
174
|
```sh
|
|
151
|
-
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
152
|
-
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.
|
|
175
|
+
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 upgrade codex
|
|
176
|
+
npx --yes --registry=https://registry.npmjs.org afucontext@0.1.18 remove codex
|
|
153
177
|
```
|
|
154
178
|
|
|
155
179
|
Pi 和 DSH 可分别用 `remove pi` 或 `remove dsh` 撤销。Windows PowerShell 请使用 `npx.cmd` 并将包名放在双引号中。
|
package/bin/afu.mjs
CHANGED
|
@@ -13,7 +13,7 @@ const root=resolve(dirname(fileURLToPath(import.meta.url)),'..');
|
|
|
13
13
|
const manifest=JSON.parse(readFileSync(join(root,'release.json'),'utf8'));
|
|
14
14
|
const env={...process.env,AFU_INSTALL_ROOT:root};
|
|
15
15
|
let args=process.argv.slice(2);
|
|
16
|
-
if(['install','upgrade','status','remove','gc','native'].includes(args[0])){
|
|
16
|
+
if(['install','upgrade','status','remove','gc','native','repair'].includes(args[0])){
|
|
17
17
|
const at=args.indexOf('--state');if(at>=0&&args[at+1])env.AFU_STATE_DIR=resolve(args[at+1]);
|
|
18
18
|
const inline=args.find(a=>a.startsWith('--state='));if(inline&&inline.length>8)env.AFU_STATE_DIR=resolve(inline.slice(8));
|
|
19
19
|
}
|
package/package.json
CHANGED
|
Binary file
|
package/release.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.18",
|
|
3
3
|
"name": "afucontext",
|
|
4
|
-
"build": "
|
|
5
|
-
"wheel": "afu_context_local-0.1.
|
|
4
|
+
"build": "238e9b3dd5de64befa91b526eb807222ca9a3d5562d66f9c2bbe750dfd5cd1e5",
|
|
5
|
+
"wheel": "afu_context_local-0.1.18-py3-none-any.whl",
|
|
6
6
|
"prebuilt": false
|
|
7
7
|
}
|