@komeijireimu/tokpulse 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 (3) hide show
  1. package/README.md +18 -16
  2. package/README.zh-CN.md +15 -14
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -15,7 +15,22 @@ Requires **OpenCode V2, 2.0.27 or later**.
15
15
 
16
16
  ## Install
17
17
 
18
- Build from source with Git and Bun:
18
+ Add the npm package to `plugins` in `opencode.json` or `opencode.jsonc`:
19
+
20
+ ```json
21
+ {
22
+ "plugins": ["@komeijireimu/tokpulse"]
23
+ }
24
+ ```
25
+
26
+ Use `~/.config/opencode/opencode.json` for all projects, or put the file in a
27
+ project for that project only. Add Token Pulse to the existing `plugins` list
28
+ alongside any other plugins.
29
+
30
+ Open or reload OpenCode. It installs the package and loads both the usage
31
+ collector and the **Token Pulse** sidebar.
32
+
33
+ ### Build from source
19
34
 
20
35
  ```sh
21
36
  git clone https://github.com/KomeijiReimu/tokpulse.git
@@ -24,21 +39,8 @@ bun install --frozen-lockfile
24
39
  bun run build
25
40
  ```
26
41
 
27
- Add the checkout's absolute path to `plugins` in `opencode.json` or
28
- `opencode.jsonc`:
29
-
30
- ```json
31
- {
32
- "plugins": [
33
- {
34
- "package": "/absolute/path/to/tokpulse"
35
- }
36
- ]
37
- }
38
- ```
39
-
40
- Start OpenCode in your working project. OpenCode loads the usage collector and
41
- the **Token Pulse** sidebar together.
42
+ Use the checkout's absolute build path, such as `/absolute/path/to/tokpulse/dist`,
43
+ in place of the npm package name in `plugins`.
42
44
 
43
45
  ## Usage
44
46
 
package/README.zh-CN.md CHANGED
@@ -14,7 +14,20 @@ Token Pulse 在 OpenCode 侧栏显示会话 token 用量、缓存命中率、费
14
14
 
15
15
  ## 安装
16
16
 
17
- 使用 Git 和 Bun 从源码构建:
17
+ 在 `opencode.json` 或 `opencode.jsonc` 的 `plugins` 中加入 npm 包名:
18
+
19
+ ```json
20
+ {
21
+ "plugins": ["@komeijireimu/tokpulse"]
22
+ }
23
+ ```
24
+
25
+ 要在所有项目中启用,编辑 `~/.config/opencode/opencode.json`;只在单个项目中启用,
26
+ 就把配置写在该项目下。已有 `plugins` 列表时,把 Token Pulse 追加到列表中。
27
+
28
+ 打开或重新加载 OpenCode。OpenCode 会安装该包,同时启用统计采集和 **Token Pulse** 侧栏。
29
+
30
+ ### 从源码构建
18
31
 
19
32
  ```sh
20
33
  git clone https://github.com/KomeijiReimu/tokpulse.git
@@ -23,19 +36,7 @@ bun install --frozen-lockfile
23
36
  bun run build
24
37
  ```
25
38
 
26
- 在 `opencode.json` 或 `opencode.jsonc` 的 `plugins` 中加入仓库的绝对路径:
27
-
28
- ```json
29
- {
30
- "plugins": [
31
- {
32
- "package": "/absolute/path/to/tokpulse"
33
- }
34
- ]
35
- }
36
- ```
37
-
38
- 在要工作的项目中启动 OpenCode,统计采集与 **Token Pulse** 侧栏会一并加载。
39
+ 在 `plugins` 中用构建产物的绝对路径替换 npm 包名,例如 `/absolute/path/to/tokpulse/dist`。
39
40
 
40
41
  ## 使用
41
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@komeijireimu/tokpulse",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Token Pulse — session token totals, cache, and task time for OpenCode",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "author": "KomeijiReimu",
@@ -46,7 +46,7 @@
46
46
  "@opentui/core": ">=0.5.8",
47
47
  "@opentui/keymap": ">=0.5.8",
48
48
  "@opentui/solid": ">=0.5.8",
49
- "solid-js": ">=1.9.0"
49
+ "solid-js": ">=1.9.0 <2"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@babel/core": "^7.26.9",