@wentianen/opencode-viewer 0.1.0
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 +21 -0
- package/README.md +60 -0
- package/dist/index.js +7460 -0
- package/dist/web/assets/index-BsxobLm1.js +40 -0
- package/dist/web/assets/index-Cayn5Wq7.css +1 -0
- package/dist/web/index.html +13 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tianen
|
|
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.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# OpenCode Activity Viewer
|
|
2
|
+
|
|
3
|
+
本地浏览器版 OpenCode 活动查看器。
|
|
4
|
+
|
|
5
|
+
## 使用方式
|
|
6
|
+
|
|
7
|
+
OpenCode 官方文档支持两种插件加载方式:
|
|
8
|
+
|
|
9
|
+
- 从 `opencode.json` 加载 npm 插件
|
|
10
|
+
- 从 `.opencode/plugins/` 或 `~/.config/opencode/plugins/` 加载本地插件文件
|
|
11
|
+
|
|
12
|
+
### 推荐方式:通过 OpenCode 配置加载 npm 插件
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"$schema": "https://opencode.ai/config.json",
|
|
17
|
+
"plugin": ["@wentianen/opencode-viewer"]
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
你可以把这段写到:
|
|
22
|
+
|
|
23
|
+
- `~/.config/opencode/opencode.json`
|
|
24
|
+
- 或项目根的 `opencode.json`
|
|
25
|
+
|
|
26
|
+
按官方文档,npm 插件会在启动时由 OpenCode 自动安装,依赖会缓存到 `~/.cache/opencode/node_modules/`
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### 启动方式
|
|
30
|
+
|
|
31
|
+
安装到 OpenCode 后,正常启动 OpenCode 即可。插件初始化时会自动探测并尝试拉起本地 Viewer service。
|
|
32
|
+
|
|
33
|
+
### 发布到 npm
|
|
34
|
+
|
|
35
|
+
如果你准备把这个插件作为 npm 包给其他人使用,建议按下面的顺序:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm test
|
|
39
|
+
npm run build
|
|
40
|
+
npm publish
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 当前状态
|
|
44
|
+
|
|
45
|
+
当前已接入的事件包括:
|
|
46
|
+
|
|
47
|
+
- `session.*`
|
|
48
|
+
- `message.updated`
|
|
49
|
+
- `message.part.updated`
|
|
50
|
+
- `message.part.removed`
|
|
51
|
+
- `tool.execute.before`
|
|
52
|
+
- `tool.execute.after`
|
|
53
|
+
- `chat.message`
|
|
54
|
+
|
|
55
|
+
## 本地开发
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm test
|
|
59
|
+
npm run build
|
|
60
|
+
```
|