opencode-subagent-magazine 1.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 +174 -0
- package/dist/_version.d.ts +1 -0
- package/dist/_version.js +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1128 -0
- package/install.mjs +103 -0
- package/package.json +56 -0
- package/src/_version.ts +2 -0
- package/src/index.tsx +1380 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hotakus
|
|
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,174 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<strong>
|
|
3
|
+
<h1>OpenCode SubAgent Magazine</h1>
|
|
4
|
+
实时子代理监控 · TUI 侧边栏可视化<br>
|
|
5
|
+
自适应主题色 · 中/英双语 · 数据持久化
|
|
6
|
+
</strong>
|
|
7
|
+
<br>
|
|
8
|
+
<br>
|
|
9
|
+
如果你觉得这个插件不错的话,可以帮我点点小星星 ⭐,谢谢!<br>
|
|
10
|
+
<br>
|
|
11
|
+
|
|
12
|
+
[](https://github.com/Hotakus/opencode-subagent-magazine)
|
|
13
|
+
[](https://github.com/Hotakus/opencode-subagent-magazine/stargazers)
|
|
14
|
+
[](LICENSE)
|
|
15
|
+
[](https://github.com/Hotakus/opencode-subagent-magazine/blob/master/README_EN.md)
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. 图片展示
|
|
23
|
+
|
|
24
|
+
<div align="center">
|
|
25
|
+
<strong>折叠态 · 简洁概览👇</strong> <br>
|
|
26
|
+
<img src="https://raw.githubusercontent.com/Hotakus/opencode-subagent-magazine/master/assets/collapse.png"></img>
|
|
27
|
+
<img src="https://raw.githubusercontent.com/Hotakus/opencode-subagent-magazine/master/assets/collapse_en.png"></img>
|
|
28
|
+
</div>
|
|
29
|
+
<div align="center">
|
|
30
|
+
<strong>展开态 · 详细信息👇</strong> <br>
|
|
31
|
+
<img src="https://raw.githubusercontent.com/Hotakus/opencode-subagent-magazine/master/assets/expand.png"></img>
|
|
32
|
+
<img src="https://raw.githubusercontent.com/Hotakus/opencode-subagent-magazine/master/assets/expand_en.png"></img>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 2. 功能
|
|
39
|
+
|
|
40
|
+
- **实时状态**:运行中(呼吸动画)、已完成、错误,彩色圆点一目了然
|
|
41
|
+
- **Token & 费用追踪**:每个子代理的 Token 消耗和费用汇总,标题栏全局显示
|
|
42
|
+
- **展开详情**:点击展开查看 agent 类型、耗时、Token、费用、模型、进度,字段值右对齐
|
|
43
|
+
- **一键进入会话**:展开后点 `→ 进入会话` 跳转子代理的完整对话
|
|
44
|
+
- **折叠面板**:标题栏点击折叠/展开,状态持久化,重启后保持
|
|
45
|
+
- **滚动回顶**:列表底部 `↑ 回顶` 按钮一键回到顶部
|
|
46
|
+
- **TTL 自动清理**:超过 3 天的旧数据自动从 KV 中清除
|
|
47
|
+
- **语言适配**:支持 `/subagent-lang` 运行时切换中/英文,偏好持久化
|
|
48
|
+
- **斜杠命令**:`/subagent-lang` `/subagent-max` `/subagent-session` `/subagent-version` 动态配置
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 3. 安装
|
|
53
|
+
|
|
54
|
+
### 3.1 方式一:OpenCode 命令安装(推荐)
|
|
55
|
+
|
|
56
|
+
在 OpenCode 中按 **`Ctrl + P`** 打开命令面板,搜索 **`install plugin`**,输入:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
opencode-subagent-magazine@latest
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
回车即可完成安装与配置。
|
|
63
|
+
|
|
64
|
+
### 3.2 方式二:手动安装
|
|
65
|
+
|
|
66
|
+
**1. 安装插件**
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm install -g opencode-subagent-magazine@latest
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**2. 配置 TUI 插件**
|
|
73
|
+
|
|
74
|
+
创建或编辑 `~/.config/opencode/tui.jsonc`:
|
|
75
|
+
|
|
76
|
+
```jsonc
|
|
77
|
+
{
|
|
78
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
79
|
+
"plugin": ["opencode-subagent-magazine@latest"]
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 3.3 重启 OpenCode
|
|
84
|
+
|
|
85
|
+
进入任意 session,侧边栏即可看到子代理监控面板。
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 4. 使用指南
|
|
90
|
+
|
|
91
|
+
### 4.1 斜杠命令
|
|
92
|
+
|
|
93
|
+
插件支持通过斜杠命令或命令面板(`Ctrl + P`)动态调整配置,所有设置即时生效并持久化:
|
|
94
|
+
|
|
95
|
+
| 命令 | 功能 | 使用方式 |
|
|
96
|
+
|------|------|---------|
|
|
97
|
+
| `/subagent-lang` | 切换显示语言 | 从列表选择中文或 English,界面即时切换,无需重启 |
|
|
98
|
+
| `/subagent-max` | 调整最大可见条目数 | 输入数字(默认 10),控制面板最多显示多少个子代理条目 |
|
|
99
|
+
| `/subagent-session` | 查看当前会话 ID | 弹出当前 OpenCode 会话 ID |
|
|
100
|
+
| `/subagent-version` | 查看插件版本 | 弹出当前插件版本号 |
|
|
101
|
+
|
|
102
|
+
<div align="center">
|
|
103
|
+
<img src="https://raw.githubusercontent.com/Hotakus/opencode-subagent-magazine/master/assets/slash_cmds.png" alt="斜杠命令" width="49%"></img>
|
|
104
|
+
<img src="https://raw.githubusercontent.com/Hotakus/opencode-subagent-magazine/master/assets/ctrlP_cmds.png" alt="Ctrl+P 命令面板" width="49%"></img>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
### 4.2 键盘 & 鼠标
|
|
108
|
+
|
|
109
|
+
| 操作 | 说明 |
|
|
110
|
+
|------|------|
|
|
111
|
+
| 点击标题栏 | 折叠 / 展开面板 |
|
|
112
|
+
| 点击条目行 | 展开 / 收起详情 |
|
|
113
|
+
| 滚动列表 | 翻页查看更多子代理 |
|
|
114
|
+
| 点击 `↑ 回顶` | 跳转到列表顶部 |
|
|
115
|
+
| 点击 `→ 进入会话` | 跳转子代理完整对话 |
|
|
116
|
+
|
|
117
|
+
### 4.3 状态颜色
|
|
118
|
+
|
|
119
|
+
| 颜色 | 含义 |
|
|
120
|
+
|------|------|
|
|
121
|
+
| 🟢 绿色 | 已完成 |
|
|
122
|
+
| 🟡 黄色(呼吸动画) | 运行中 |
|
|
123
|
+
| 🔴 红色 | 错误 |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 5. 更新
|
|
128
|
+
|
|
129
|
+
由于 [OpenCode 已知问题 #6774](https://github.com/anomalyco/opencode/issues/6774),插件缓存会锁死在首次安装时的版本,不会自动检测 npm 上的新版本。
|
|
130
|
+
|
|
131
|
+
更新步骤:
|
|
132
|
+
|
|
133
|
+
**1. 清除 OpenCode 插件缓存**
|
|
134
|
+
|
|
135
|
+
```powershell
|
|
136
|
+
# Windows
|
|
137
|
+
Remove-Item -Recurse -Force "$env:USERPROFILE\.cache\opencode\packages\opencode-subagent-magazine@latest"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# macOS / Linux
|
|
142
|
+
rm -rf ~/.cache/opencode/packages/opencode-subagent-magazine@latest
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**2. 重新安装插件**
|
|
146
|
+
|
|
147
|
+
在 OpenCode 中按 **`Ctrl + P`** → `install plugin` → `opencode-subagent-magazine@latest` → 回车
|
|
148
|
+
|
|
149
|
+
**3. 重启 OpenCode**
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 6. 语言设置
|
|
154
|
+
|
|
155
|
+
### 6.1 运行时切换(推荐)
|
|
156
|
+
|
|
157
|
+
在 TUI 中输入 `/subagent-lang`,从弹窗选择「中文」或「English」即可即时切换,无需重启。偏好会自动持久化,下次启动自动恢复。
|
|
158
|
+
|
|
159
|
+
### 6.2 自动检测
|
|
160
|
+
|
|
161
|
+
默认自动检测系统语言。若不符合预期,用 `/subagent-lang` 手动切换一次即可,偏好会被记住。
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 7. 兼容性
|
|
166
|
+
|
|
167
|
+
代码完全模型无关,支持所有 OpenCode 兼容的 AI 模型(DeepSeek / Claude / GPT 等)。
|
|
168
|
+
Token 数据和子代理信息均通过 OpenCode SDK 标准接口获取。
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 8. License
|
|
173
|
+
|
|
174
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PLUGIN_VERSION = "1.1.0";
|
package/dist/_version.js
ADDED