opencode-subagent-magazine 1.2.1-beta.0 → 1.2.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 +21 -21
- package/README.md +187 -187
- package/dist/_version.d.ts +1 -1
- package/dist/_version.js +1 -1
- package/dist/tui.js +1 -1
- package/install.mjs +103 -103
- package/package.json +62 -62
- package/src/_version.ts +1 -1
- package/src/index.tsx +1782 -1782
package/LICENSE
CHANGED
|
@@ -1,21 +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.
|
|
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
CHANGED
|
@@ -1,187 +1,187 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<strong>
|
|
3
|
-
<h1>OpenCode SubAgent Magazine</h1>
|
|
4
|
-
像弹匣一样装填!发射!<br><br>
|
|
5
|
-
实时子代理监控 · TUI 侧边栏可视化<br>
|
|
6
|
-
自适应主题色 · 低饱和设计语言 · 中/英双语 · 数据持久化
|
|
7
|
-
</strong>
|
|
8
|
-
<br>
|
|
9
|
-
<br>
|
|
10
|
-
如果你觉得这个插件不错的话,可以帮我点点小星星 ⭐,谢谢!<br>
|
|
11
|
-
<br>
|
|
12
|
-
|
|
13
|
-
[](https://github.com/Hotakus/opencode-subagent-magazine)
|
|
14
|
-
[](https://github.com/Hotakus/opencode-subagent-magazine/stargazers)
|
|
15
|
-
[](LICENSE)
|
|
16
|
-
[](https://github.com/Hotakus/opencode-subagent-magazine/blob/master/README_EN.md)
|
|
17
|
-

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

|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
对 Token 缓存可视化感兴趣吗?可以试试 [opencode-visual-cache](https://github.com/Hotakus/opencode-visual-cache) 这个插件!
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 1. 图片展示
|
|
28
|
+
|
|
29
|
+
<div align="center">
|
|
30
|
+
<strong>折叠态 · 简洁概览👇</strong> <br>
|
|
31
|
+
<img src="https://raw.githubusercontent.com/Hotakus/opencode-subagent-magazine/master/assets/collapse.png"></img>
|
|
32
|
+
<img src="https://raw.githubusercontent.com/Hotakus/opencode-subagent-magazine/master/assets/collapse_en.png"></img>
|
|
33
|
+
</div>
|
|
34
|
+
<div align="center">
|
|
35
|
+
<strong>展开态 · 详细信息👇</strong> <br>
|
|
36
|
+
<img src="https://raw.githubusercontent.com/Hotakus/opencode-subagent-magazine/master/assets/expand.png"></img>
|
|
37
|
+
<img src="https://raw.githubusercontent.com/Hotakus/opencode-subagent-magazine/master/assets/expand_en.png"></img>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 2. 功能
|
|
44
|
+
|
|
45
|
+
- **实时状态**:运行中(呼吸动画)、已完成、错误,彩色圆点一目了然
|
|
46
|
+
- **Token & 费用追踪**:每个子代理的 Token 消耗和费用汇总,标题栏全局显示
|
|
47
|
+
- **展开详情**:点击展开查看 agent 类型、状态、耗时、Token、费用、模型、进度,字段值右对齐
|
|
48
|
+
- **一键进入会话**:展开后点 `→ 进入会话` 跳转子代理的完整对话
|
|
49
|
+
- **手动标记完成**:展开区右侧 `- 标记完成` 按钮可手动终结卡住的僵尸条目;`/subagent-clear-running` 批量清理
|
|
50
|
+
- **状态字段显示**:展开区 `状态: 运行中/已完成/错误`,颜色与圆点一致,一目了然
|
|
51
|
+
- **折叠面板**:标题栏点击折叠/展开,状态持久化,重启后保持
|
|
52
|
+
- **滚动回顶/回底**:列表底部 `↑ 回顶` / `↓ 回底` 按钮一键跳转到最新条目位置,方向随排序自适应
|
|
53
|
+
- **可配置排序**:`/subagent-order` 支持「降序(最新在前)」和「升序(最早在前)」两种排列方式
|
|
54
|
+
- **翻页模式切换**:`/subagent-scroll` 可选「滚轮翻页」或「点击 more 翻页」,解决侧边栏与全局滚动冲突
|
|
55
|
+
- **TTL 自动清理**:超过 3 天的旧数据自动从 KV 中清除
|
|
56
|
+
- **语言适配**:支持 `/subagent-lang` 运行时切换中/英文,偏好持久化
|
|
57
|
+
- **斜杠命令**:`/subagent-lang` `/subagent-max` `/subagent-order` `/subagent-scroll` `/subagent-session` `/subagent-version` `/subagent-clear-running` 动态配置
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 3. 安装
|
|
62
|
+
|
|
63
|
+
### 3.1 方式一:OpenCode 命令安装(推荐)
|
|
64
|
+
|
|
65
|
+
在 OpenCode 中按 **`Ctrl + P`** 打开命令面板,搜索 **`install plugin`**,输入:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
opencode-subagent-magazine@latest
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
回车即可完成安装与配置。
|
|
72
|
+
|
|
73
|
+
### 3.2 方式二:手动安装
|
|
74
|
+
|
|
75
|
+
**1. 安装插件**
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npm install -g opencode-subagent-magazine@latest
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**2. 配置 TUI 插件**
|
|
82
|
+
|
|
83
|
+
创建或编辑 `~/.config/opencode/tui.jsonc`:
|
|
84
|
+
|
|
85
|
+
```jsonc
|
|
86
|
+
{
|
|
87
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
88
|
+
"plugin": ["opencode-subagent-magazine@latest"]
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 3.3 重启 OpenCode
|
|
93
|
+
|
|
94
|
+
进入任意 session,侧边栏即可看到子代理监控面板。
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 4. 使用指南
|
|
99
|
+
|
|
100
|
+
### 4.1 斜杠命令
|
|
101
|
+
|
|
102
|
+
插件支持通过斜杠命令或命令面板(`Ctrl + P`)动态调整配置,所有设置即时生效并持久化:
|
|
103
|
+
|
|
104
|
+
| 命令 | 功能 | 使用方式 |
|
|
105
|
+
|------|------|---------|
|
|
106
|
+
| `/subagent-lang` | 切换显示语言 | 从列表选择中文或 English,界面即时切换,无需重启 |
|
|
107
|
+
| `/subagent-max` | 调整最大可见条目数 | 输入数字(默认 10),控制面板最多显示多少个子代理条目 |
|
|
108
|
+
| `/subagent-order` | 切换排序方式 | 选择「降序(最新在前)」或「升序(最早在前)」,即时重排并跳转到最新条目 |
|
|
109
|
+
| `/subagent-scroll` | 切换翻页模式 | 选择「滚轮翻页」或「点击 more 翻页」,解决与全局滚动冲突 |
|
|
110
|
+
| `/subagent-session` | 查看当前会话 ID | 弹出当前 OpenCode 会话 ID |
|
|
111
|
+
| `/subagent-version` | 查看插件版本 | 弹出当前插件版本号 |
|
|
112
|
+
| `/subagent-clear-running` | 批量清理僵尸条目 | 一键将所有运行中的条目标记为完成,清理卡住的旧数据 |
|
|
113
|
+
|
|
114
|
+
<div align="center">
|
|
115
|
+
<img src="https://raw.githubusercontent.com/Hotakus/opencode-subagent-magazine/master/assets/slash_cmds.png" alt="斜杠命令" width="49%"></img>
|
|
116
|
+
<img src="https://raw.githubusercontent.com/Hotakus/opencode-subagent-magazine/master/assets/ctrlP_cmds.png" alt="Ctrl+P 命令面板" width="49%"></img>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
### 4.2 键盘 & 鼠标
|
|
120
|
+
|
|
121
|
+
| 操作 | 说明 |
|
|
122
|
+
|------|------|
|
|
123
|
+
| 点击标题栏 | 折叠 / 展开面板 |
|
|
124
|
+
| 点击条目行 | 展开 / 收起详情 |
|
|
125
|
+
| 滚轮 / 点击 `↑ more` `↓ more` | 翻页查看更多子代理(`/subagent-scroll` 切换翻页模式) |
|
|
126
|
+
| 点击 `↑ 回顶` / `↓ 回底` | 跳转到最新条目位置(方向随排序自适应) |
|
|
127
|
+
| 点击 `→ 进入会话` | 跳转子代理完整对话 |
|
|
128
|
+
| 点击 `- 标记完成` | 手动终结该条目(仅运行中时显示) |
|
|
129
|
+
|
|
130
|
+
### 4.3 状态颜色
|
|
131
|
+
|
|
132
|
+
| 颜色 | 含义 |
|
|
133
|
+
|------|------|
|
|
134
|
+
| 🟢 绿色 | 已完成 |
|
|
135
|
+
| 🟡 黄色(呼吸动画) | 运行中 |
|
|
136
|
+
| 🔴 红色 | 错误 |
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 5. 更新
|
|
141
|
+
|
|
142
|
+
由于 [OpenCode 已知问题 #6774](https://github.com/anomalyco/opencode/issues/6774),插件缓存会锁死在首次安装时的版本,不会自动检测 npm 上的新版本。
|
|
143
|
+
|
|
144
|
+
更新步骤:
|
|
145
|
+
|
|
146
|
+
**1. 清除 OpenCode 插件缓存**
|
|
147
|
+
|
|
148
|
+
```powershell
|
|
149
|
+
# Windows
|
|
150
|
+
Remove-Item -Recurse -Force "$env:USERPROFILE\.cache\opencode\packages\opencode-subagent-magazine@latest"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# macOS / Linux
|
|
155
|
+
rm -rf ~/.cache/opencode/packages/opencode-subagent-magazine@latest
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**2. 重新安装插件**
|
|
159
|
+
|
|
160
|
+
在 OpenCode 中按 **`Ctrl + P`** → `install plugin` → `opencode-subagent-magazine@latest` → 回车
|
|
161
|
+
|
|
162
|
+
**3. 重启 OpenCode**
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 6. 语言设置
|
|
167
|
+
|
|
168
|
+
### 6.1 运行时切换(推荐)
|
|
169
|
+
|
|
170
|
+
在 TUI 中输入 `/subagent-lang`,从弹窗选择「中文」或「English」即可即时切换,无需重启。偏好会自动持久化,下次启动自动恢复。
|
|
171
|
+
|
|
172
|
+
### 6.2 自动检测
|
|
173
|
+
|
|
174
|
+
默认自动检测系统语言。若不符合预期,用 `/subagent-lang` 手动切换一次即可,偏好会被记住。
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 7. 兼容性
|
|
179
|
+
|
|
180
|
+
代码完全模型无关,支持所有 OpenCode 兼容的 AI 模型(DeepSeek / Claude / GPT 等)。
|
|
181
|
+
Token 数据和子代理信息均通过 OpenCode SDK 标准接口获取。
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 8. License
|
|
186
|
+
|
|
187
|
+
MIT
|
package/dist/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PLUGIN_VERSION = "1.2.1
|
|
1
|
+
export declare const PLUGIN_VERSION = "1.2.1";
|
package/dist/_version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// auto-generated
|
|
2
|
-
export const PLUGIN_VERSION = "1.2.1
|
|
2
|
+
export const PLUGIN_VERSION = "1.2.1";
|
package/dist/tui.js
CHANGED
|
@@ -11,7 +11,7 @@ import { createElement as _$createElement } from "@opentui/solid";
|
|
|
11
11
|
import { createMemo, createSignal, createEffect, onMount, onCleanup, untrack, Show, For } from "solid-js";
|
|
12
12
|
|
|
13
13
|
// src/_version.ts
|
|
14
|
-
var PLUGIN_VERSION = "1.2.1
|
|
14
|
+
var PLUGIN_VERSION = "1.2.1";
|
|
15
15
|
|
|
16
16
|
// src/index.tsx
|
|
17
17
|
var SUBAGENT_TOOLS = /* @__PURE__ */ new Set(["task", "delegate", "call_omo_agent"]);
|
package/install.mjs
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Install script for opencode-subagent-magazine.
|
|
5
|
-
*
|
|
6
|
-
* Creates or updates `~/.config/opencode/tui.jsonc` so OpenCode loads
|
|
7
|
-
* the TUI sidebar plugin.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* node install.mjs
|
|
11
|
-
* npm explore opencode-subagent-magazine -- node install.mjs
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { readFile, writeFile, mkdir, access } from "node:fs/promises"
|
|
15
|
-
import { constants } from "node:fs"
|
|
16
|
-
import { homedir, platform } from "node:os"
|
|
17
|
-
import { join, dirname } from "node:path"
|
|
18
|
-
|
|
19
|
-
const PLUGIN_SPEC = "opencode-subagent-magazine"
|
|
20
|
-
|
|
21
|
-
function configDir() {
|
|
22
|
-
if (platform() === "win32") {
|
|
23
|
-
return join(process.env.APPDATA ?? join(homedir(), "AppData", "Roaming"), "opencode")
|
|
24
|
-
}
|
|
25
|
-
return join(process.env.XDG_CONFIG_HOME ?? join(homedir(), ".config"), "opencode")
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async function exists(p) {
|
|
29
|
-
try { await access(p, constants.F_OK); return true }
|
|
30
|
-
catch { return false }
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async function readJSONC(p) {
|
|
34
|
-
const raw = await readFile(p, "utf-8")
|
|
35
|
-
const stripped = raw.replace(/^\s*\/\/.*$/gm, "")
|
|
36
|
-
return JSON.parse(stripped)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function formatJSONC(obj) {
|
|
40
|
-
return JSON.stringify(obj, null, 2) + "\n"
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function mergePlugin(existing, spec) {
|
|
44
|
-
const plugins = existing.plugin ?? []
|
|
45
|
-
if (plugins.some((p) => (typeof p === "string" ? p : p[0]) === spec)) {
|
|
46
|
-
return false
|
|
47
|
-
}
|
|
48
|
-
existing.plugin = [...plugins, spec]
|
|
49
|
-
return true
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async function main() {
|
|
53
|
-
const dir = configDir()
|
|
54
|
-
await mkdir(dir, { recursive: true })
|
|
55
|
-
|
|
56
|
-
// ---- tui.jsonc ----
|
|
57
|
-
const tuiPath = join(dir, "tui.jsonc")
|
|
58
|
-
let tuiChanged = false
|
|
59
|
-
|
|
60
|
-
if (await exists(tuiPath)) {
|
|
61
|
-
const cfg = await readJSONC(tuiPath)
|
|
62
|
-
tuiChanged = mergePlugin(cfg, PLUGIN_SPEC)
|
|
63
|
-
if (tuiChanged) {
|
|
64
|
-
await writeFile(tuiPath, formatJSONC(cfg))
|
|
65
|
-
console.log(`[opencode-subagent-magazine] Added to ${tuiPath}`)
|
|
66
|
-
} else {
|
|
67
|
-
console.log(`[opencode-subagent-magazine] Already in ${tuiPath}`)
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
70
|
-
const cfg = {
|
|
71
|
-
$schema: "https://opencode.ai/tui.json",
|
|
72
|
-
plugin: [PLUGIN_SPEC],
|
|
73
|
-
}
|
|
74
|
-
await writeFile(tuiPath, formatJSONC(cfg))
|
|
75
|
-
console.log(`[opencode-subagent-magazine] Created ${tuiPath}`)
|
|
76
|
-
tuiChanged = true
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// ---- opencode.jsonc (forward compat) ----
|
|
80
|
-
const ocPath = join(dir, "opencode.jsonc")
|
|
81
|
-
let ocChanged = false
|
|
82
|
-
|
|
83
|
-
if (await exists(ocPath)) {
|
|
84
|
-
const cfg = await readJSONC(ocPath)
|
|
85
|
-
ocChanged = mergePlugin(cfg, PLUGIN_SPEC)
|
|
86
|
-
if (ocChanged) {
|
|
87
|
-
await writeFile(ocPath, formatJSONC(cfg))
|
|
88
|
-
console.log(`[opencode-subagent-magazine] Also added to ${ocPath}`)
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// ---- done ----
|
|
93
|
-
if (tuiChanged || ocChanged) {
|
|
94
|
-
console.log("\nDone! Restart OpenCode to see the SubAgent Monitor sidebar panel.")
|
|
95
|
-
} else {
|
|
96
|
-
console.log("\nAlready installed. Restart OpenCode if you haven't yet.")
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
main().catch((err) => {
|
|
101
|
-
console.error("Install failed:", err.message)
|
|
102
|
-
process.exit(1)
|
|
103
|
-
})
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Install script for opencode-subagent-magazine.
|
|
5
|
+
*
|
|
6
|
+
* Creates or updates `~/.config/opencode/tui.jsonc` so OpenCode loads
|
|
7
|
+
* the TUI sidebar plugin.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* node install.mjs
|
|
11
|
+
* npm explore opencode-subagent-magazine -- node install.mjs
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { readFile, writeFile, mkdir, access } from "node:fs/promises"
|
|
15
|
+
import { constants } from "node:fs"
|
|
16
|
+
import { homedir, platform } from "node:os"
|
|
17
|
+
import { join, dirname } from "node:path"
|
|
18
|
+
|
|
19
|
+
const PLUGIN_SPEC = "opencode-subagent-magazine"
|
|
20
|
+
|
|
21
|
+
function configDir() {
|
|
22
|
+
if (platform() === "win32") {
|
|
23
|
+
return join(process.env.APPDATA ?? join(homedir(), "AppData", "Roaming"), "opencode")
|
|
24
|
+
}
|
|
25
|
+
return join(process.env.XDG_CONFIG_HOME ?? join(homedir(), ".config"), "opencode")
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function exists(p) {
|
|
29
|
+
try { await access(p, constants.F_OK); return true }
|
|
30
|
+
catch { return false }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function readJSONC(p) {
|
|
34
|
+
const raw = await readFile(p, "utf-8")
|
|
35
|
+
const stripped = raw.replace(/^\s*\/\/.*$/gm, "")
|
|
36
|
+
return JSON.parse(stripped)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function formatJSONC(obj) {
|
|
40
|
+
return JSON.stringify(obj, null, 2) + "\n"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function mergePlugin(existing, spec) {
|
|
44
|
+
const plugins = existing.plugin ?? []
|
|
45
|
+
if (plugins.some((p) => (typeof p === "string" ? p : p[0]) === spec)) {
|
|
46
|
+
return false
|
|
47
|
+
}
|
|
48
|
+
existing.plugin = [...plugins, spec]
|
|
49
|
+
return true
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function main() {
|
|
53
|
+
const dir = configDir()
|
|
54
|
+
await mkdir(dir, { recursive: true })
|
|
55
|
+
|
|
56
|
+
// ---- tui.jsonc ----
|
|
57
|
+
const tuiPath = join(dir, "tui.jsonc")
|
|
58
|
+
let tuiChanged = false
|
|
59
|
+
|
|
60
|
+
if (await exists(tuiPath)) {
|
|
61
|
+
const cfg = await readJSONC(tuiPath)
|
|
62
|
+
tuiChanged = mergePlugin(cfg, PLUGIN_SPEC)
|
|
63
|
+
if (tuiChanged) {
|
|
64
|
+
await writeFile(tuiPath, formatJSONC(cfg))
|
|
65
|
+
console.log(`[opencode-subagent-magazine] Added to ${tuiPath}`)
|
|
66
|
+
} else {
|
|
67
|
+
console.log(`[opencode-subagent-magazine] Already in ${tuiPath}`)
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
const cfg = {
|
|
71
|
+
$schema: "https://opencode.ai/tui.json",
|
|
72
|
+
plugin: [PLUGIN_SPEC],
|
|
73
|
+
}
|
|
74
|
+
await writeFile(tuiPath, formatJSONC(cfg))
|
|
75
|
+
console.log(`[opencode-subagent-magazine] Created ${tuiPath}`)
|
|
76
|
+
tuiChanged = true
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// ---- opencode.jsonc (forward compat) ----
|
|
80
|
+
const ocPath = join(dir, "opencode.jsonc")
|
|
81
|
+
let ocChanged = false
|
|
82
|
+
|
|
83
|
+
if (await exists(ocPath)) {
|
|
84
|
+
const cfg = await readJSONC(ocPath)
|
|
85
|
+
ocChanged = mergePlugin(cfg, PLUGIN_SPEC)
|
|
86
|
+
if (ocChanged) {
|
|
87
|
+
await writeFile(ocPath, formatJSONC(cfg))
|
|
88
|
+
console.log(`[opencode-subagent-magazine] Also added to ${ocPath}`)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ---- done ----
|
|
93
|
+
if (tuiChanged || ocChanged) {
|
|
94
|
+
console.log("\nDone! Restart OpenCode to see the SubAgent Monitor sidebar panel.")
|
|
95
|
+
} else {
|
|
96
|
+
console.log("\nAlready installed. Restart OpenCode if you haven't yet.")
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
main().catch((err) => {
|
|
101
|
+
console.error("Install failed:", err.message)
|
|
102
|
+
process.exit(1)
|
|
103
|
+
})
|