@kairyou/agent-tools 0.7.1 → 0.7.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 CHANGED
@@ -95,10 +95,14 @@ output is:
95
95
 
96
96
  ```text
97
97
  ⎇ main | Opus 4.8 | 5h 7% ⟳2h54m | w 41% ⟳3d1h
98
+
99
+ # With a compatible API relay, its quota info is shown instead, e.g.:
100
+ ⎇ main | Opus 4.8 | API | balance $362 | today $61.7 | 30d $566
98
101
  ```
99
102
 
100
- Here `5h` and `w` are Claude's rolling usage windows; `⟳` is the reset countdown.
101
- When a compatible API relay is active, the statusline also appends provider usage.
103
+ Here `5h` and `w` are Claude's rolling usage windows and `⟳` is the reset
104
+ countdown; see [Provider usage](#provider-usage) below for relay quota
105
+ compatibility and configuration.
102
106
 
103
107
  To choose what appears, edit `statusline.fields` in
104
108
  `~/.agent-tools/config.jsonc`. Installer updates only add missing default keys
@@ -149,6 +153,19 @@ Keep `preset` set to `auto` for automatic detection. Select a specific protocol
149
153
  only when you know which usage endpoint the gateway exposes; a configured
150
154
  custom route id is also accepted.
151
155
 
156
+ Output examples:
157
+
158
+ ```text
159
+ # Relay plan quota.
160
+ API | D $0.0/$100 | W $0.0/$300 | Exp 07-08
161
+
162
+ # Wallet balance.
163
+ API | balance $362 | today $61.7 | 30d $566
164
+ ```
165
+
166
+ Fields: `D/W/M` are daily/weekly/monthly spend against plan limits; `Exp` is
167
+ the plan expiry; `balance` is wallet credit; `today` and `30d` are API spend.
168
+
152
169
  #### Custom gateway routes
153
170
 
154
171
  For gateways the built-in probes cannot reach (e.g. cookie-authenticated
@@ -198,19 +215,6 @@ export async function run(context, { requestJson, agentConfig }) {
198
215
  through to the next route (with `providerUsage.debug` enabled, failures are
199
216
  logged to `~/.agent-tools/logs/usage-debug.log`).
200
217
 
201
- Output examples:
202
-
203
- ```text
204
- # Relay plan quota.
205
- API | D $0.0/$100 | W $0.0/$300 | Exp 07-08
206
-
207
- # Wallet balance.
208
- API | balance $362 | today $61.7 | 30d $566
209
- ```
210
-
211
- Fields: `D/W/M` are daily/weekly/monthly spend against plan limits; `Exp` is
212
- the plan expiry; `balance` is wallet credit; `today` and `30d` are API spend.
213
-
214
218
  ### Vision (cross-model image understanding)
215
219
 
216
220
  Lets a main model that cannot see images ask a multimodal model specific questions about an image (local path or http(s) URL) and reason on from the answers. Typical uses: reading error screenshots, implementing UI from design mockups, locating the glitch in a bug-report screenshot. One installer capability bundling three parts: the `inspect_image` MCP stdio server, the `at-vision` policy skill, and a human diagnostic CLI.
package/README.zh-CN.md CHANGED
@@ -90,10 +90,13 @@ npx -y @kairyou/agent-tools@latest statusline -a claude
90
90
 
91
91
  ```text
92
92
  ⎇ main | Opus 4.8 | 5h 7% ⟳2h54m | w 41% ⟳3d1h
93
+
94
+ # 使用兼容的 API 中转时, 显示中转的额度信息, 比如:
95
+ ⎇ main | Opus 4.8 | API | balance $362 | today $61.7 | 30d $566
93
96
  ```
94
97
 
95
- 其中 `5h` / `w` 是 Claude 的滚动用量窗口, `⟳` 后面是重置倒计时.
96
- 使用兼容的 API 中转时, statusline 还会追加 provider usage.
98
+ 其中 `5h` / `w` 是 Claude 的滚动用量窗口, `⟳` 后面是重置倒计时;
99
+ 中转额度信息的兼容性与配置见下方 [Provider usage](#provider-usage).
97
100
 
98
101
  如需控制显示项, 修改 `~/.agent-tools/config.jsonc` 里的
99
102
  `statusline.fields`. 安装器更新时只会补充缺失的默认键, 不会动你的修改和注释.
@@ -138,6 +141,19 @@ provider 的 `base_url` 和密钥; Claude Code: 读取 `ANTHROPIC_BASE_URL` 与
138
141
  保持 `preset: "auto"` 即可自动探测. 只有明确知道网关开放的是哪种用量协议时,
139
142
  才指定相应的内置 preset 或已配置的自定义 route id.
140
143
 
144
+ 显示效果示例:
145
+
146
+ ```text
147
+ # 中转套餐额度.
148
+ API | D $0.0/$100 | W $0.0/$300 | Exp 07-08
149
+
150
+ # 钱包余额.
151
+ API | balance $362 | today $61.7 | 30d $566
152
+ ```
153
+
154
+ 字段含义: `D/W/M` 是日/周/月套餐消耗与上限, `Exp` 是套餐到期日,
155
+ `balance` 是钱包余额, `today` / `30d` 是今日与近 30 天 API 消耗.
156
+
141
157
  #### 自定义网关路由
142
158
 
143
159
  内置探测覆盖不到的网关(比如 cookie 认证的中转), 可以自己写路由模块并在
@@ -184,19 +200,6 @@ export async function run(context, { requestJson, agentConfig }) {
184
200
  `text` 是自由字符串; 成功返回 `{ text }`, 抛错则回落到下一条路由
185
201
  (开启 `providerUsage.debug` 后, 失败会记录到 `~/.agent-tools/logs/usage-debug.log`).
186
202
 
187
- 显示效果示例:
188
-
189
- ```text
190
- # 中转套餐额度.
191
- API | D $0.0/$100 | W $0.0/$300 | Exp 07-08
192
-
193
- # 钱包余额.
194
- API | balance $362 | today $61.7 | 30d $566
195
- ```
196
-
197
- 字段含义: `D/W/M` 是日/周/月套餐消耗与上限, `Exp` 是套餐到期日,
198
- `balance` 是钱包余额, `today` / `30d` 是今日与近 30 天 API 消耗.
199
-
200
203
  ### Vision(跨模型识图)
201
204
 
202
205
  让不支持图片的主模型借助多模态模型识图: 针对图片(本地路径或 http(s) URL)提出具体问题, 拿到答案后继续自己的推理. 常见场景: 读取报错截图, 按设计稿还原 UI, 定位测试反馈截图里的界面问题. 一个安装器 capability 包含三部分: `inspect_image` MCP stdio server, `at-vision` 策略 skill, 以及人工诊断 CLI.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kairyou/agent-tools",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Reusable Agent Skills and installable integrations (statusline, provider usage, vision) for Codex, Claude Code, and opencode.",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -242,7 +242,9 @@ function installRuntimeAssets(opts) {
242
242
  }
243
243
  console.log(`runtime: ${INSTALL_ROOT}`);
244
244
  for (const [src, dest, options] of files) copyRuntimeFile(src, dest, opts.dryRun, options);
245
- if (wants(opts, "usage")) syncUsageRoutesDir(opts.dryRun);
245
+ // The statusline refreshes via the usage engine, so it needs packaged
246
+ // routes too.
247
+ if (wants(opts, "usage") || wants(opts, "statusline")) syncUsageRoutesDir(opts.dryRun);
246
248
  }
247
249
 
248
250
  // Repo-shipped usage routes are replaced wholesale so routes removed from the