@marshal/pi-turn-stats 0.1.0 → 0.1.1

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 +26 -15
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,37 +1,48 @@
1
1
  # @marshal/pi-turn-stats
2
2
 
3
- pi extension: conversation statistics (对话统计). For every exchange, records duration, token usage (input / output / cache read / cache write), and cost.
3
+ pi 扩展:对话统计(Turn Stats)。每次对话交换后,自动记录耗时、token 用量(input / output / cache read / cache write)和费用。
4
4
 
5
- ## Features
5
+ ## 功能特性
6
6
 
7
- - **对话流统计卡片** — after each reply, appends a stats card to the conversation stream (not sent to the LLM context).
8
- - **状态栏实时显示** — bottom status bar shows the previous exchange's duration / output speed / tokens / cost.
9
- - **`/turnstats` 命令** — appends a session-cumulative stats card (total exchanges, turns, tokens, cost).
7
+ - **对话流统计卡片** — 每次回复后,在对话流中追加统计卡片(不会进入 LLM 上下文)。
8
+ - **状态栏实时显示** — 底部状态栏显示上一轮对话的耗时 / 输出速度 / token / 费用。
9
+ - **`/turnstats` 命令** — 追加会话累计统计卡片(总交换次数、总轮次、总 token、总费用)。
10
10
 
11
- ## Installation
11
+ ## 效果截图
12
12
 
13
- Install project-locally (recommended, supports per-project version pinning):
13
+ ![Turn Stats](turn-stats.jpg)
14
+
15
+ ## 安装
16
+
17
+ 推荐项目本地安装(支持按项目锁定版本):
14
18
 
15
19
  ```bash
16
- # From the GitHub repo, pinned to a git tag (SSH)
20
+ # GitHub 仓库安装,指定 tagSSH
17
21
  pi install -l git:git@github.com:MarshalW/pi-turn-stats@v0.1.0
18
22
  ```
19
23
 
20
- ## Note
24
+ 也可以从 npm 直接安装:
21
25
 
22
- Generated stats are **local-only** — nothing is uploaded anywhere. Reads `turn_end` event usage data and wall-clock timing inside the running pi process.
26
+ ```bash
27
+ npm install @marshal/pi-turn-stats
28
+ ```
23
29
 
24
- ## Development
30
+ ## 说明
31
+
32
+ 生成的统计数据**仅本地存储**,不会上传到任何服务器。读取运行中 pi 进程内的 `turn_end` 事件数据和实际耗时。
33
+
34
+ ## 开发
25
35
 
26
36
  ```bash
27
37
  git clone git@github.com:MarshalW/pi-turn-stats.git
28
38
  cd pi-turn-stats
29
- pi install ./ # local install for testing
39
+ pi install ./ # 本地安装,用于测试
30
40
  ```
31
41
 
32
- ## Release flow
42
+ ## 发布流程
33
43
 
34
44
  ```bash
35
45
  git tag vX.Y.Z && git push origin main --tags
36
- # then on each consumer machine: pi install -l git:...@vX.Y.Z
37
- ```
46
+ # 发布到 npm:npm version patch && npm publish --access public
47
+ # 消费端安装:pi install -l git:git@github.com:MarshalW/pi-turn-stats@vX.Y.Z
48
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marshal/pi-turn-stats",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "pi extension: per-exchange duration, token & cost stats for conversations (stream card + status bar + /turnstats command)",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -16,4 +16,4 @@
16
16
  "./extensions/turn-stats.ts"
17
17
  ]
18
18
  }
19
- }
19
+ }