opencode-tui-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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 aifcoding
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,29 @@
1
+ # opencode-tui-stats
2
+
3
+ A TUI plugin for OpenCode 1.x (v1) that shows a single line — `TPS | AVG | TTFT` — on the right side of the session prompt.
4
+
5
+ ## Demo
6
+
7
+ ![Demo](./assets/demo.gif)
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ opencode plugin opencode-tui-stats --global
13
+ ```
14
+
15
+ This command writes the plugin into opencode's TUI config. You can also install the `opencode-tui-stats` package from npm.
16
+
17
+ ## Requirements
18
+
19
+ - opencode ≥ 1.3.14
20
+
21
+ ## Metrics
22
+
23
+ - `TPS`: live generation rate within the most recent ~5-second streaming window (tokens/sec); shows `-` when the session is idle or data is stale.
24
+ - `AVG`: average generation rate of completed messages in this session (tokens/sec).
25
+ - `TTFT`: average time to first token of completed messages in this session (seconds).
26
+
27
+ ## License
28
+
29
+ MIT — see [LICENSE](./LICENSE) in the repository root.
package/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # opencode-tui-stats
2
2
 
3
- OpenCode v1 TUI 插件:在会话提示区右侧显示 `TPS | AVG | TTFT`,即实时流式输出速度(TPS)、本次会话平均生成速度(AVG)以及平均首字延迟(TTFT)。
3
+ OpenCode 1.x(v1)的 TUI 插件,在会话提示区右侧显示一行 `TPS | AVG | TTFT`。
4
+
5
+ ## 演示
6
+
7
+ ![Demo](./assets/demo.gif)
4
8
 
5
9
  ## 安装
6
10
 
@@ -8,10 +12,18 @@ OpenCode v1 TUI 插件:在会话提示区右侧显示 `TPS | AVG | TTFT`,即
8
12
  opencode plugin opencode-tui-stats --global
9
13
  ```
10
14
 
11
- 要求宿主 opencode ≥ 1.3.14。
15
+ 该命令会把插件写入 opencode 的 tui 配置。也可以从 npm 安装 `opencode-tui-stats` 包。
16
+
17
+ ## 环境要求
18
+
19
+ - opencode ≥ 1.3.14
20
+
21
+ ## 指标说明
22
+
23
+ - `TPS`:最近约 5 秒流式窗口内的实时生成速度(token/秒);会话空闲或数据过期时显示 `-`。
24
+ - `AVG`:本会话已完成消息的平均生成速度(token/秒)。
25
+ - `TTFT`:本会话已完成消息的平均首字延迟(秒)。
12
26
 
13
- ## 显示项
27
+ ## License
14
28
 
15
- - `TPS`:最近 5 秒流式窗口内的实时 token/秒,空闲或数据过期时显示 `-`。
16
- - `AVG`:本次会话已完成消息的平均 token/秒。
17
- - `TTFT`:本次会话已完成消息的平均首字延迟(秒)。
29
+ MIT,详见仓库根目录的 [LICENSE](./LICENSE)。
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "opencode-tui-stats",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "description": "OpenCode 1 TUI plugin that shows live TPS, average TPS, and average time to first token in the session prompt.",
6
6
  "type": "module",
7
7
  "exports": {
@@ -33,6 +33,7 @@
33
33
  },
34
34
  "files": [
35
35
  "tui.tsx",
36
- "README.md"
36
+ "README.md",
37
+ "assets/"
37
38
  ]
38
39
  }