opencode-subagent-magazine 1.5.0 → 1.5.2

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/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.5.0";
14
+ var PLUGIN_VERSION = "1.5.2";
15
15
 
16
16
  // src/clipboard.ts
17
17
  import { spawn } from "node:child_process";
@@ -109,117 +109,242 @@ async function copyText(text) {
109
109
  return { copied: false, method: "none", error: "clipboard_unavailable" };
110
110
  }
111
111
 
112
- // src/index.tsx
113
- var SUBAGENT_TOOLS = /* @__PURE__ */ new Set(["task", "delegate", "call_omo_agent"]);
114
- var I18N = {
115
- zh: {
116
- "panel.title": "\u5B50\u4EE3\u7406",
117
- "status.none": "\u6682\u65E0\u5B50\u4EE3\u7406",
118
- "agent.label": "\u4EE3\u7406",
119
- "status.label": "\u72B6\u6001",
120
- "time.label": "\u8017\u65F6",
121
- "tokens.label": "\u4E0A\u4E0B\u6587",
122
- "error.label": "\u9519\u8BEF",
123
- "model.label": "\u6A21\u578B",
124
- "todo.label": "\u8FDB\u5EA6",
125
- "session.label": "\u4F1A\u8BDD ID",
126
- "session.toast.copy": "\u53EF\u624B\u52A8\u590D\u5236\u4E0A\u65B9 ID",
127
- "session.toast.copied": "\u4F1A\u8BDD ID \u5DF2\u590D\u5236",
128
- "session.toast.copy_failed": "\u65E0\u6CD5\u8BBF\u95EE\u7CFB\u7EDF\u526A\u8D34\u677F\uFF0C\u8BF7\u624B\u52A8\u590D\u5236\u4E0A\u65B9 ID",
129
- "open.label": "\u8FDB\u5165\u4F1A\u8BDD",
130
- "cost.label": "\u8D39\u7528",
131
- "scroll.more": "\u66F4\u591A",
132
- "scroll.top": "\u56DE\u9876",
133
- "scroll.bottom": "\u56DE\u5E95",
134
- "dismiss.label": "\u6807\u8BB0\u5B8C\u6210",
135
- "cancel.label": "\u53D6\u6D88",
136
- "status.running": "\u8FD0\u884C\u4E2D",
137
- "status.done": "\u5DF2\u5B8C\u6210",
138
- "status.cancelled": "\u5DF2\u53D6\u6D88",
139
- "status.error": "\u9519\u8BEF",
140
- "order.desc": "\u964D\u5E8F\uFF08\u6700\u65B0\u5728\u524D\uFF09",
141
- "order.asc": "\u5347\u5E8F\uFF08\u6700\u65E9\u5728\u524D\uFF09",
142
- "scroll.wheel": "\u6EDA\u8F6E\u7FFB\u9875",
143
- "scroll.click": "\u70B9\u51FB\u7FFB\u9875",
144
- "ttl.label": "\u6E05\u7406\u5468\u671F",
145
- "ttl.3d": "3 \u5929",
146
- "ttl.7d": "7 \u5929",
147
- "ttl.14d": "14 \u5929",
148
- "ttl.30d": "30 \u5929",
149
- "ttl.unlimited": "\u65E0\u671F\u9650",
150
- "ttl.toast": "\u6E05\u7406\u5468\u671F\u5DF2\u8BBE\u4E3A {n} \u5929",
151
- "ttl.toast_unlimited": "\u6E05\u7406\u5468\u671F\u5DF2\u8BBE\u4E3A\u65E0\u671F\u9650",
152
- "clear.title": "\u786E\u8BA4\u6E05\u9664",
153
- "clear.prompt": "\u786E\u5B9A\u6E05\u9664\u5F53\u524D\u4F1A\u8BDD\u6240\u6709\u5B50\u4EE3\u7406\u8BB0\u5F55\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002",
154
- "clear.prompt_running": "\u5F53\u524D\u6709 {n} \u4E2A\u8FD0\u884C\u4E2D\u7684\u5B50\u4EE3\u7406\uFF0C\u6E05\u9664\u540E\u5C06\u4E0D\u53EF\u6062\u590D\u3002\u786E\u5B9A\u7EE7\u7EED\uFF1F",
155
- "clear.done": "\u5DF2\u6E05\u9664 {n} \u6761\u5B50\u4EE3\u7406\u8BB0\u5F55",
156
- "clear.empty": "\u5F53\u524D\u4F1A\u8BDD\u65E0\u5B50\u4EE3\u7406\u8BB0\u5F55",
157
- "cancel.no_session": "\u5B50\u4F1A\u8BDD ID \u4E0D\u53EF\u7528",
158
- "cancel.not_child": "\u76EE\u6807\u4E0D\u662F\u5B50\u4F1A\u8BDD",
159
- "cancel.read_error": "\u65E0\u6CD5\u8BFB\u53D6\u4F1A\u8BDD\u4FE1\u606F",
160
- "cancel.outside_tree": "\u76EE\u6807\u4E0D\u5728\u5F53\u524D\u76D1\u63A7\u4F1A\u8BDD\u6811\u4E2D",
161
- "cancel.already_ended": "\u4F1A\u8BDD\u5DF2\u7ED3\u675F\uFF0C\u65E0\u9700\u53D6\u6D88",
162
- "cancel.status_error": "\u65E0\u6CD5\u67E5\u8BE2\u4F1A\u8BDD\u72B6\u6001",
163
- "cancel.sent": "\u5DF2\u53D1\u9001\u53D6\u6D88\u6307\u4EE4",
164
- "cancel.failed": "\u53D6\u6D88\u5931\u8D25"
165
- },
166
- en: {
167
- "panel.title": "SubAgent",
168
- "status.none": "No sub-agents yet",
169
- "agent.label": "agent",
170
- "status.label": "status",
171
- "time.label": "time",
172
- "tokens.label": "tokens",
173
- "error.label": "error",
174
- "model.label": "model",
175
- "todo.label": "todo",
176
- "session.label": "session ID",
177
- "session.toast.copy": "Copy the ID above manually",
178
- "session.toast.copied": "Session ID copied",
179
- "session.toast.copy_failed": "Cannot access the system clipboard; copy the ID above manually",
180
- "open.label": "Open session",
181
- "cost.label": "cost",
182
- "scroll.more": "more",
183
- "scroll.top": "Top",
184
- "scroll.bottom": "Bottom",
185
- "dismiss.label": "dismiss",
186
- "cancel.label": "Cancel",
187
- "status.running": "running",
188
- "status.done": "done",
189
- "status.cancelled": "cancelled",
190
- "status.error": "error",
191
- "order.desc": "Desc (newest first)",
192
- "order.asc": "Asc (oldest first)",
193
- "scroll.wheel": "Wheel Scroll",
194
- "scroll.click": "Click Scroll",
195
- "ttl.label": "TTL (Time to Live)",
196
- "ttl.3d": "3 days",
197
- "ttl.7d": "7 days",
198
- "ttl.14d": "14 days",
199
- "ttl.30d": "30 days",
200
- "ttl.unlimited": "Never",
201
- "ttl.toast": "TTL set to {n} days",
202
- "ttl.toast_unlimited": "TTL set to Never",
203
- "clear.title": "Confirm",
204
- "clear.prompt": "Clear all sub-agent records for this session? This cannot be undone.",
205
- "clear.prompt_running": "{n} sub-agent(s) are still running. Clearing will discard them permanently. Continue?",
206
- "clear.done": "Cleared {n} sub-agent record(s)",
207
- "clear.empty": "No sub-agent records in this session",
208
- "cancel.no_session": "Child session ID is unavailable",
209
- "cancel.not_child": "Target is not a child session",
210
- "cancel.read_error": "Cannot read session info",
211
- "cancel.outside_tree": "Target is outside the monitored session tree",
212
- "cancel.already_ended": "Session already ended, no need to cancel",
213
- "cancel.status_error": "Cannot query session status",
214
- "cancel.sent": "Cancel instruction sent",
215
- "cancel.failed": "Cancellation failed"
216
- }
112
+ // src/i18n.ts
113
+ var ZH_T = {
114
+ "panel.title": "\u5B50\u4EE3\u7406",
115
+ "status.none": "\u6682\u65E0\u5B50\u4EE3\u7406",
116
+ "agent.label": "\u4EE3\u7406",
117
+ "status.label": "\u72B6\u6001",
118
+ "time.label": "\u8017\u65F6",
119
+ "tokens.label": "\u4E0A\u4E0B\u6587",
120
+ "error.label": "\u9519\u8BEF",
121
+ "model.label": "\u6A21\u578B",
122
+ "todo.label": "\u8FDB\u5EA6",
123
+ "session.label": "\u4F1A\u8BDD ID",
124
+ "session.toast.copy": "\u53EF\u624B\u52A8\u590D\u5236\u4E0A\u65B9 ID",
125
+ "session.toast.copied": "\u4F1A\u8BDD ID \u5DF2\u590D\u5236",
126
+ "session.toast.copy_failed": "\u65E0\u6CD5\u8BBF\u95EE\u7CFB\u7EDF\u526A\u8D34\u677F\uFF0C\u8BF7\u624B\u52A8\u590D\u5236\u4E0A\u65B9 ID",
127
+ "open.label": "\u8FDB\u5165\u4F1A\u8BDD",
128
+ "cost.label": "\u8D39\u7528",
129
+ "scroll.more": "\u66F4\u591A",
130
+ "scroll.top": "\u56DE\u9876",
131
+ "scroll.bottom": "\u56DE\u5E95",
132
+ "dismiss.label": "\u6807\u8BB0\u5B8C\u6210",
133
+ "cancel.label": "\u53D6\u6D88",
134
+ "status.running": "\u8FD0\u884C\u4E2D",
135
+ "status.done": "\u5DF2\u5B8C\u6210",
136
+ "status.cancelled": "\u5DF2\u53D6\u6D88",
137
+ "status.error": "\u9519\u8BEF",
138
+ "order.desc": "\u964D\u5E8F\uFF08\u6700\u65B0\u5728\u524D\uFF09",
139
+ "order.asc": "\u5347\u5E8F\uFF08\u6700\u65E9\u5728\u524D\uFF09",
140
+ "scroll.wheel": "\u6EDA\u8F6E\u7FFB\u9875",
141
+ "scroll.click": "\u70B9\u51FB\u7FFB\u9875",
142
+ "ttl.label": "\u6E05\u7406\u5468\u671F",
143
+ "ttl.3d": "3 \u5929",
144
+ "ttl.7d": "7 \u5929",
145
+ "ttl.14d": "14 \u5929",
146
+ "ttl.30d": "30 \u5929",
147
+ "ttl.unlimited": "\u65E0\u671F\u9650",
148
+ "ttl.toast": "\u6E05\u7406\u5468\u671F\u5DF2\u8BBE\u4E3A {n} \u5929",
149
+ "ttl.toast_unlimited": "\u6E05\u7406\u5468\u671F\u5DF2\u8BBE\u4E3A\u65E0\u671F\u9650",
150
+ "clear.title": "\u786E\u8BA4\u6E05\u9664",
151
+ "clear.prompt": "\u786E\u5B9A\u6E05\u9664\u5F53\u524D\u4F1A\u8BDD\u6240\u6709\u5B50\u4EE3\u7406\u8BB0\u5F55\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002",
152
+ "clear.prompt_running": "\u5F53\u524D\u6709 {n} \u4E2A\u8FD0\u884C\u4E2D\u7684\u5B50\u4EE3\u7406\uFF0C\u6E05\u9664\u540E\u5C06\u4E0D\u53EF\u6062\u590D\u3002\u786E\u5B9A\u7EE7\u7EED\uFF1F",
153
+ "clear.done": "\u5DF2\u6E05\u9664 {n} \u6761\u5B50\u4EE3\u7406\u8BB0\u5F55",
154
+ "clear.empty": "\u5F53\u524D\u4F1A\u8BDD\u65E0\u5B50\u4EE3\u7406\u8BB0\u5F55",
155
+ "cancel.no_session": "\u5B50\u4F1A\u8BDD ID \u4E0D\u53EF\u7528",
156
+ "cancel.not_child": "\u76EE\u6807\u4E0D\u662F\u5B50\u4F1A\u8BDD",
157
+ "cancel.read_error": "\u65E0\u6CD5\u8BFB\u53D6\u4F1A\u8BDD\u4FE1\u606F",
158
+ "cancel.outside_tree": "\u76EE\u6807\u4E0D\u5728\u5F53\u524D\u76D1\u63A7\u4F1A\u8BDD\u6811\u4E2D",
159
+ "cancel.already_ended": "\u4F1A\u8BDD\u5DF2\u7ED3\u675F\uFF0C\u65E0\u9700\u53D6\u6D88",
160
+ "cancel.status_error": "\u65E0\u6CD5\u67E5\u8BE2\u4F1A\u8BDD\u72B6\u6001",
161
+ "cancel.sent": "\u5DF2\u53D1\u9001\u53D6\u6D88\u6307\u4EE4",
162
+ "cancel.failed": "\u53D6\u6D88\u5931\u8D25"
163
+ };
164
+ var EN_T = {
165
+ "panel.title": "SubAgent",
166
+ "status.none": "No sub-agents yet",
167
+ "agent.label": "agent",
168
+ "status.label": "status",
169
+ "time.label": "time",
170
+ "tokens.label": "tokens",
171
+ "error.label": "error",
172
+ "model.label": "model",
173
+ "todo.label": "todo",
174
+ "session.label": "session ID",
175
+ "session.toast.copy": "Copy the ID above manually",
176
+ "session.toast.copied": "Session ID copied",
177
+ "session.toast.copy_failed": "Cannot access the system clipboard; copy the ID above manually",
178
+ "open.label": "Open session",
179
+ "cost.label": "cost",
180
+ "scroll.more": "more",
181
+ "scroll.top": "Top",
182
+ "scroll.bottom": "Bottom",
183
+ "dismiss.label": "dismiss",
184
+ "cancel.label": "Cancel",
185
+ "status.running": "running",
186
+ "status.done": "done",
187
+ "status.cancelled": "cancelled",
188
+ "status.error": "error",
189
+ "order.desc": "Desc (newest first)",
190
+ "order.asc": "Asc (oldest first)",
191
+ "scroll.wheel": "Wheel Scroll",
192
+ "scroll.click": "Click Scroll",
193
+ "ttl.label": "TTL (Time to Live)",
194
+ "ttl.3d": "3 days",
195
+ "ttl.7d": "7 days",
196
+ "ttl.14d": "14 days",
197
+ "ttl.30d": "30 days",
198
+ "ttl.unlimited": "Never",
199
+ "ttl.toast": "TTL set to {n} days",
200
+ "ttl.toast_unlimited": "TTL set to Never",
201
+ "clear.title": "Confirm",
202
+ "clear.prompt": "Clear all sub-agent records for this session? This cannot be undone.",
203
+ "clear.prompt_running": "{n} sub-agent(s) are still running. Clearing will discard them permanently. Continue?",
204
+ "clear.done": "Cleared {n} sub-agent record(s)",
205
+ "clear.empty": "No sub-agent records in this session",
206
+ "cancel.no_session": "Child session ID is unavailable",
207
+ "cancel.not_child": "Target is not a child session",
208
+ "cancel.read_error": "Cannot read session info",
209
+ "cancel.outside_tree": "Target is outside the monitored session tree",
210
+ "cancel.already_ended": "Session already ended, no need to cancel",
211
+ "cancel.status_error": "Cannot query session status",
212
+ "cancel.sent": "Cancel instruction sent",
213
+ "cancel.failed": "Cancellation failed"
214
+ };
215
+ var JA_T = {
216
+ "panel.title": "\u30B5\u30D6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8",
217
+ "status.none": "\u30B5\u30D6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306A\u3057",
218
+ "agent.label": "\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8",
219
+ "status.label": "\u72B6\u614B",
220
+ "time.label": "\u6642\u9593",
221
+ "tokens.label": "\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8",
222
+ "error.label": "\u30A8\u30E9\u30FC",
223
+ "model.label": "\u30E2\u30C7\u30EB",
224
+ "todo.label": "\u9032\u6357",
225
+ "session.label": "\u30BB\u30C3\u30B7\u30E7\u30F3 ID",
226
+ "session.toast.copy": "\u4E0A\u306E ID \u3092\u624B\u52D5\u3067\u30B3\u30D4\u30FC\u3057\u3066\u304F\u3060\u3055\u3044",
227
+ "session.toast.copied": "\u30BB\u30C3\u30B7\u30E7\u30F3 ID \u3092\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",
228
+ "session.toast.copy_failed": "\u30B7\u30B9\u30C6\u30E0\u306E\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u4E0A\u306E ID \u3092\u624B\u52D5\u3067\u30B3\u30D4\u30FC\u3057\u3066\u304F\u3060\u3055\u3044",
229
+ "open.label": "\u30BB\u30C3\u30B7\u30E7\u30F3\u3092\u958B\u304F",
230
+ "cost.label": "\u8CBB\u7528",
231
+ "scroll.more": "\u3082\u3063\u3068",
232
+ "scroll.top": "\u5148\u982D\u3078",
233
+ "scroll.bottom": "\u672B\u5C3E\u3078",
234
+ "dismiss.label": "\u5B8C\u4E86\u306B\u3059\u308B",
235
+ "cancel.label": "\u30AD\u30E3\u30F3\u30BB\u30EB",
236
+ "status.running": "\u5B9F\u884C\u4E2D",
237
+ "status.done": "\u5B8C\u4E86",
238
+ "status.cancelled": "\u30AD\u30E3\u30F3\u30BB\u30EB\u6E08\u307F",
239
+ "status.error": "\u30A8\u30E9\u30FC",
240
+ "order.desc": "\u964D\u9806\uFF08\u65B0\u3057\u3044\u9806\uFF09",
241
+ "order.asc": "\u6607\u9806\uFF08\u53E4\u3044\u9806\uFF09",
242
+ "scroll.wheel": "\u30DB\u30A4\u30FC\u30EB\u30B9\u30AF\u30ED\u30FC\u30EB",
243
+ "scroll.click": "\u30AF\u30EA\u30C3\u30AF\u30B9\u30AF\u30ED\u30FC\u30EB",
244
+ "ttl.label": "\u4FDD\u6301\u671F\u9593",
245
+ "ttl.3d": "3 \u65E5",
246
+ "ttl.7d": "7 \u65E5",
247
+ "ttl.14d": "14 \u65E5",
248
+ "ttl.30d": "30 \u65E5",
249
+ "ttl.unlimited": "\u7121\u671F\u9650",
250
+ "ttl.toast": "\u4FDD\u6301\u671F\u9593\u3092 {n} \u65E5\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F",
251
+ "ttl.toast_unlimited": "\u4FDD\u6301\u671F\u9593\u3092\u7121\u671F\u9650\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F",
252
+ "clear.title": "\u524A\u9664\u306E\u78BA\u8A8D",
253
+ "clear.prompt": "\u3053\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u5168\u30B5\u30D6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u8A18\u9332\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F\u3053\u306E\u64CD\u4F5C\u306F\u5143\u306B\u623B\u305B\u307E\u305B\u3093\u3002",
254
+ "clear.prompt_running": "\u5B9F\u884C\u4E2D\u306E\u30B5\u30D6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304C {n} \u500B\u3042\u308A\u307E\u3059\u3002\u524A\u9664\u3059\u308B\u3068\u5FA9\u5143\u3067\u304D\u307E\u305B\u3093\u3002\u7D9A\u884C\u3057\u307E\u3059\u304B\uFF1F",
255
+ "clear.done": "{n} \u4EF6\u306E\u30B5\u30D6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u8A18\u9332\u3092\u524A\u9664\u3057\u307E\u3057\u305F",
256
+ "clear.empty": "\u3053\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u30B5\u30D6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u8A18\u9332\u306F\u3042\u308A\u307E\u305B\u3093",
257
+ "cancel.no_session": "\u5B50\u30BB\u30C3\u30B7\u30E7\u30F3 ID \u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093",
258
+ "cancel.not_child": "\u5BFE\u8C61\u306F\u5B50\u30BB\u30C3\u30B7\u30E7\u30F3\u3067\u306F\u3042\u308A\u307E\u305B\u3093",
259
+ "cancel.read_error": "\u30BB\u30C3\u30B7\u30E7\u30F3\u60C5\u5831\u3092\u8AAD\u307F\u53D6\u308C\u307E\u305B\u3093",
260
+ "cancel.outside_tree": "\u5BFE\u8C61\u306F\u76E3\u8996\u5BFE\u8C61\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u30C4\u30EA\u30FC\u5916\u3067\u3059",
261
+ "cancel.already_ended": "\u30BB\u30C3\u30B7\u30E7\u30F3\u306F\u65E2\u306B\u7D42\u4E86\u3057\u3066\u3044\u307E\u3059",
262
+ "cancel.status_error": "\u30BB\u30C3\u30B7\u30E7\u30F3\u72B6\u614B\u3092\u7167\u4F1A\u3067\u304D\u307E\u305B\u3093",
263
+ "cancel.sent": "\u30AD\u30E3\u30F3\u30BB\u30EB\u6307\u793A\u3092\u9001\u4FE1\u3057\u307E\u3057\u305F",
264
+ "cancel.failed": "\u30AD\u30E3\u30F3\u30BB\u30EB\u306B\u5931\u6557\u3057\u307E\u3057\u305F"
217
265
  };
266
+ var KO_T = {
267
+ "panel.title": "\uC11C\uBE0C \uC5D0\uC774\uC804\uD2B8",
268
+ "status.none": "\uC11C\uBE0C \uC5D0\uC774\uC804\uD2B8 \uC5C6\uC74C",
269
+ "agent.label": "\uC5D0\uC774\uC804\uD2B8",
270
+ "status.label": "\uC0C1\uD0DC",
271
+ "time.label": "\uC2DC\uAC04",
272
+ "tokens.label": "\uCEE8\uD14D\uC2A4\uD2B8",
273
+ "error.label": "\uC624\uB958",
274
+ "model.label": "\uBAA8\uB378",
275
+ "todo.label": "\uC9C4\uD589\uB3C4",
276
+ "session.label": "\uC138\uC158 ID",
277
+ "session.toast.copy": "\uC704 ID\uB97C \uC218\uB3D9\uC73C\uB85C \uBCF5\uC0AC\uD558\uC138\uC694",
278
+ "session.toast.copied": "\uC138\uC158 ID\uAC00 \uBCF5\uC0AC\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
279
+ "session.toast.copy_failed": "\uC2DC\uC2A4\uD15C \uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uC811\uADFC\uD560 \uC218 \uC5C6\uC5B4 \uC704 ID\uB97C \uC218\uB3D9\uC73C\uB85C \uBCF5\uC0AC\uD558\uC138\uC694",
280
+ "open.label": "\uC138\uC158 \uC5F4\uAE30",
281
+ "cost.label": "\uBE44\uC6A9",
282
+ "scroll.more": "\uB354 \uBCF4\uAE30",
283
+ "scroll.top": "\uB9E8 \uC704\uB85C",
284
+ "scroll.bottom": "\uB9E8 \uC544\uB798\uB85C",
285
+ "dismiss.label": "\uC644\uB8CC \uD45C\uC2DC",
286
+ "cancel.label": "\uCDE8\uC18C",
287
+ "status.running": "\uC2E4\uD589 \uC911",
288
+ "status.done": "\uC644\uB8CC",
289
+ "status.cancelled": "\uCDE8\uC18C\uB428",
290
+ "status.error": "\uC624\uB958",
291
+ "order.desc": "\uB0B4\uB9BC\uCC28\uC21C(\uCD5C\uC2E0\uC21C)",
292
+ "order.asc": "\uC624\uB984\uCC28\uC21C(\uC624\uB798\uB41C\uC21C)",
293
+ "scroll.wheel": "\uD720 \uC2A4\uD06C\uB864",
294
+ "scroll.click": "\uD074\uB9AD \uC2A4\uD06C\uB864",
295
+ "ttl.label": "\uBCF4\uC874 \uAE30\uAC04",
296
+ "ttl.3d": "3\uC77C",
297
+ "ttl.7d": "7\uC77C",
298
+ "ttl.14d": "14\uC77C",
299
+ "ttl.30d": "30\uC77C",
300
+ "ttl.unlimited": "\uBB34\uAE30\uD55C",
301
+ "ttl.toast": "\uBCF4\uC874 \uAE30\uAC04\uC744 {n}\uC77C\uB85C \uC124\uC815\uD588\uC2B5\uB2C8\uB2E4",
302
+ "ttl.toast_unlimited": "\uBCF4\uC874 \uAE30\uAC04\uC744 \uBB34\uAE30\uD55C\uC73C\uB85C \uC124\uC815\uD588\uC2B5\uB2C8\uB2E4",
303
+ "clear.title": "\uC0AD\uC81C \uD655\uC778",
304
+ "clear.prompt": "\uC774 \uC138\uC158\uC758 \uBAA8\uB4E0 \uC11C\uBE0C \uC5D0\uC774\uC804\uD2B8 \uAE30\uB85D\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C? \uC774 \uC791\uC5C5\uC740 \uB418\uB3CC\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
305
+ "clear.prompt_running": "\uC2E4\uD589 \uC911\uC778 \uC11C\uBE0C \uC5D0\uC774\uC804\uD2B8\uAC00 {n}\uAC1C \uC788\uC2B5\uB2C8\uB2E4. \uC0AD\uC81C\uD558\uBA74 \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uACC4\uC18D\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",
306
+ "clear.done": "\uC11C\uBE0C \uC5D0\uC774\uC804\uD2B8 \uAE30\uB85D {n}\uAC1C\uB97C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4",
307
+ "clear.empty": "\uC774 \uC138\uC158\uC5D0 \uC11C\uBE0C \uC5D0\uC774\uC804\uD2B8 \uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
308
+ "cancel.no_session": "\uD558\uC704 \uC138\uC158 ID\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4",
309
+ "cancel.not_child": "\uB300\uC0C1\uC774 \uD558\uC704 \uC138\uC158\uC774 \uC544\uB2D9\uB2C8\uB2E4",
310
+ "cancel.read_error": "\uC138\uC158 \uC815\uBCF4\uB97C \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4",
311
+ "cancel.outside_tree": "\uB300\uC0C1\uC774 \uBAA8\uB2C8\uD130\uB9C1 \uC138\uC158 \uD2B8\uB9AC \uBC16\uC5D0 \uC788\uC2B5\uB2C8\uB2E4",
312
+ "cancel.already_ended": "\uC138\uC158\uC774 \uC774\uBBF8 \uC885\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
313
+ "cancel.status_error": "\uC138\uC158 \uC0C1\uD0DC\uB97C \uC870\uD68C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4",
314
+ "cancel.sent": "\uCDE8\uC18C \uC9C0\uC2DC\uB97C \uBCF4\uB0C8\uC2B5\uB2C8\uB2E4",
315
+ "cancel.failed": "\uCDE8\uC18C\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4"
316
+ };
317
+ var LANGS = { zh: ZH_T, en: EN_T, ja: JA_T, ko: KO_T };
318
+ var LANG_META = [
319
+ { code: "zh", label: "\u4E2D\u6587" },
320
+ { code: "en", label: "English" },
321
+ { code: "ja", label: "\u65E5\u672C\u8A9E" },
322
+ { code: "ko", label: "\uD55C\uAD6D\uC5B4" }
323
+ ];
324
+ function applyParams(tpl, params) {
325
+ if (!params) return tpl;
326
+ return tpl.replace(
327
+ /\{(\w+)\}/g,
328
+ (m, k) => k in params ? String(params[k]) : m
329
+ );
330
+ }
331
+ function createT(getCode) {
332
+ return (key, params) => applyParams(LANGS[getCode()][key] ?? key, params);
333
+ }
218
334
  function detectLang() {
219
- const env = process?.env?.OPENCODE_LANG ?? process?.env?.LANG ?? "";
220
- if (env.startsWith("zh")) return "zh";
221
- return "en";
335
+ try {
336
+ const loc = Intl.DateTimeFormat().resolvedOptions().locale.toLowerCase();
337
+ if (loc.startsWith("zh")) return "zh";
338
+ if (loc.startsWith("ja")) return "ja";
339
+ if (loc.startsWith("ko")) return "ko";
340
+ return "en";
341
+ } catch {
342
+ return "en";
343
+ }
222
344
  }
345
+
346
+ // src/index.tsx
347
+ var SUBAGENT_TOOLS = /* @__PURE__ */ new Set(["task", "delegate", "call_omo_agent"]);
223
348
  function charColumns(c) {
224
349
  const code = c.codePointAt(0) ?? 0;
225
350
  if (code < 32) return 0;
@@ -339,7 +464,7 @@ function safeErrorMsg(err) {
339
464
  var globalEntryCache = /* @__PURE__ */ new Map();
340
465
  var [clearTick, setClearTick] = createSignal(0);
341
466
  function SubAgentPanel(props) {
342
- const t = (key) => I18N[props.lang()][key] ?? key;
467
+ const t = createT(() => props.lang());
343
468
  const SESSION_DATA_KEY = `${KV_PREFIX}.session_data`;
344
469
  const ttlDaysRaw = parseInt(String(props.api.kv.get(`${KV_PREFIX}.ttl_days`, "3")), 10);
345
470
  const ttlDays = Number.isNaN(ttlDaysRaw) ? 3 : ttlDaysRaw;
@@ -630,9 +755,8 @@ function SubAgentPanel(props) {
630
755
  const m = msgs[i];
631
756
  if (m.role !== "assistant") continue;
632
757
  const t2 = m.tokens;
633
- if (!t2) continue;
634
- const cache = t2.cache;
635
- const ctx = (Number(t2.input) || 0) + (cache?.read ?? 0);
758
+ if (!t2 || !(Number(t2.output) > 0)) continue;
759
+ const ctx = (Number(t2.input) || 0) + (Number(t2.output) || 0) + (Number(t2.reasoning) || 0) + (Number(t2.cache?.read) || 0) + (Number(t2.cache?.write) || 0);
636
760
  if (ctx > 0) return ctx;
637
761
  }
638
762
  }
@@ -730,7 +854,7 @@ function SubAgentPanel(props) {
730
854
  if (!childId) {
731
855
  props.api.ui.toast({
732
856
  title: entry.title || entry.agent,
733
- message: t("cancel.label") + ": " + (I18N[props.lang()]["cancel.no_session"] ?? "Child session ID is unavailable")
857
+ message: t("cancel.label") + ": " + t("cancel.no_session")
734
858
  });
735
859
  return;
736
860
  }
@@ -739,21 +863,21 @@ function SubAgentPanel(props) {
739
863
  if (!child?.parentID) {
740
864
  props.api.ui.toast({
741
865
  title: entry.title || entry.agent,
742
- message: t("cancel.label") + ": " + (I18N[props.lang()]["cancel.not_child"] ?? "Target is not a child session")
866
+ message: t("cancel.label") + ": " + t("cancel.not_child")
743
867
  });
744
868
  return;
745
869
  }
746
870
  } catch {
747
871
  props.api.ui.toast({
748
872
  title: entry.title || entry.agent,
749
- message: t("cancel.label") + ": " + (I18N[props.lang()]["cancel.read_error"] ?? "Cannot read session info")
873
+ message: t("cancel.label") + ": " + t("cancel.read_error")
750
874
  });
751
875
  return;
752
876
  }
753
877
  if (!isDescendantOf(childId, props.sessionId)) {
754
878
  props.api.ui.toast({
755
879
  title: entry.title || entry.agent,
756
- message: t("cancel.label") + ": " + (I18N[props.lang()]["cancel.outside_tree"] ?? "Target is outside the monitored session tree")
880
+ message: t("cancel.label") + ": " + t("cancel.outside_tree")
757
881
  });
758
882
  return;
759
883
  }
@@ -777,7 +901,7 @@ function SubAgentPanel(props) {
777
901
  } catch {
778
902
  props.api.ui.toast({
779
903
  title: entry.title || entry.agent,
780
- message: t("cancel.label") + ": " + (I18N[props.lang()]["cancel.status_error"] ?? "Cannot query session status")
904
+ message: t("cancel.label") + ": " + t("cancel.status_error")
781
905
  });
782
906
  return;
783
907
  }
@@ -806,7 +930,7 @@ function SubAgentPanel(props) {
806
930
  abortAccepted: true
807
931
  });
808
932
  props.api.ui.toast({
809
- message: t("cancel.label") + ": " + (I18N[props.lang()]["cancel.sent"] ?? "Cancel instruction sent")
933
+ message: t("cancel.label") + ": " + t("cancel.sent")
810
934
  });
811
935
  } catch (err) {
812
936
  upsertEntry({
@@ -820,7 +944,7 @@ function SubAgentPanel(props) {
820
944
  });
821
945
  props.api.ui.toast({
822
946
  title: entry.title || entry.agent,
823
- message: t("cancel.label") + ": " + (I18N[props.lang()]["cancel.failed"] ?? "Cancellation failed")
947
+ message: t("cancel.label") + ": " + t("cancel.failed")
824
948
  });
825
949
  }
826
950
  };
@@ -2318,7 +2442,7 @@ function createSidebarSlot(api, sig) {
2318
2442
  var KV_PREFIX = "subagent_magazine";
2319
2443
  var tui = async (api) => {
2320
2444
  const stored = String(api.kv.get(`${KV_PREFIX}.lang`, ""));
2321
- const initialLang = stored === "zh" || stored === "en" ? stored : detectLang();
2445
+ const initialLang = LANG_META.some((m) => m.code === stored) ? stored : detectLang();
2322
2446
  const [lang, setLang] = createSignal(initialLang);
2323
2447
  const [maxEntries, setMaxEntries] = createSignal(parseInt(String(api.kv.get(`${KV_PREFIX}.max_entries`, "10")), 10) || 10);
2324
2448
  const [sortOrder, setSortOrder] = createSignal(String(api.kv.get(`${KV_PREFIX}.order`, "desc")) === "asc" ? "asc" : "desc");
@@ -2345,19 +2469,18 @@ var tui = async (api) => {
2345
2469
  onSelect: (dialog) => {
2346
2470
  dialog?.replace(() => _$createComponent(api.ui.DialogSelect, {
2347
2471
  title: "Language / \u8BED\u8A00",
2348
- options: [{
2349
- title: "\u4E2D\u6587",
2350
- value: "zh"
2351
- }, {
2352
- title: "English",
2353
- value: "en"
2354
- }],
2472
+ get options() {
2473
+ return LANG_META.map((m) => ({
2474
+ title: m.label,
2475
+ value: m.code
2476
+ }));
2477
+ },
2355
2478
  onSelect: (opt) => {
2356
2479
  const l = opt.value;
2357
2480
  setLang(l);
2358
2481
  api.kv.set(`${KV_PREFIX}.lang`, l);
2359
2482
  api.ui.toast({
2360
- message: l === "zh" ? "\u8BED\u8A00: \u4E2D\u6587" : "Language: English"
2483
+ message: "Language: " + (LANG_META.find((m) => m.code === l)?.label ?? l)
2361
2484
  });
2362
2485
  dialog?.clear();
2363
2486
  }
@@ -2371,7 +2494,7 @@ var tui = async (api) => {
2371
2494
  name: "subagent-order"
2372
2495
  },
2373
2496
  onSelect: (dialog) => {
2374
- const t = (k) => I18N[lang()][k] ?? k;
2497
+ const t = createT(() => lang());
2375
2498
  dialog?.replace(() => _$createComponent(api.ui.DialogSelect, {
2376
2499
  title: "Sort Order / \u6392\u5E8F\u65B9\u5F0F",
2377
2500
  get options() {
@@ -2402,7 +2525,7 @@ var tui = async (api) => {
2402
2525
  name: "subagent-scroll"
2403
2526
  },
2404
2527
  onSelect: (dialog) => {
2405
- const t = (k) => I18N[lang()][k] ?? k;
2528
+ const t = createT(() => lang());
2406
2529
  dialog?.replace(() => _$createComponent(api.ui.DialogSelect, {
2407
2530
  title: "Scroll Mode / \u6EDA\u52A8\u6A21\u5F0F",
2408
2531
  get options() {
@@ -2561,7 +2684,7 @@ var tui = async (api) => {
2561
2684
  name: "subagent-ttl"
2562
2685
  },
2563
2686
  onSelect: (dialog) => {
2564
- const t = (k) => I18N[signals.lang()][k] ?? k;
2687
+ const t = createT(() => signals.lang());
2565
2688
  const curRaw = parseInt(String(api.kv.get(`${KV_PREFIX}.ttl_days`, "3")), 10);
2566
2689
  const curDays = Number.isNaN(curRaw) ? 3 : curRaw;
2567
2690
  const curLabel = curDays === 0 ? t("ttl.unlimited") : `${curDays}d`;
@@ -2590,7 +2713,9 @@ var tui = async (api) => {
2590
2713
  onSelect: (opt) => {
2591
2714
  const days = parseInt(opt.value, 10);
2592
2715
  api.kv.set(`${KV_PREFIX}.ttl_days`, String(days));
2593
- const msg = days === 0 ? t("ttl.toast_unlimited") : t("ttl.toast").replace("{n}", String(days));
2716
+ const msg = days === 0 ? t("ttl.toast_unlimited") : t("ttl.toast", {
2717
+ n: days
2718
+ });
2594
2719
  api.ui.toast({
2595
2720
  message: msg
2596
2721
  });
@@ -2606,7 +2731,7 @@ var tui = async (api) => {
2606
2731
  name: "subagent-clear-entries"
2607
2732
  },
2608
2733
  onSelect: (dialog) => {
2609
- const t = (k) => I18N[signals.lang()][k] ?? k;
2734
+ const t = createT(() => signals.lang());
2610
2735
  const sid = signals.sessionId;
2611
2736
  const sessionObj = api.state.session.get(sid);
2612
2737
  const parentID = sessionObj?.parentID;
@@ -2617,7 +2742,9 @@ var tui = async (api) => {
2617
2742
  if (e.status === "running") runningCount++;
2618
2743
  }
2619
2744
  }
2620
- const msg = runningCount > 0 ? t("clear.prompt_running").replace("{n}", String(runningCount)) : t("clear.prompt");
2745
+ const msg = runningCount > 0 ? t("clear.prompt_running", {
2746
+ n: runningCount
2747
+ }) : t("clear.prompt");
2621
2748
  dialog?.replace(() => _$createComponent(api.ui.DialogConfirm, {
2622
2749
  get title() {
2623
2750
  return t("clear.title");
@@ -2650,7 +2777,9 @@ var tui = async (api) => {
2650
2777
  api.kv.set(`${KV_PREFIX}.session_data`, JSON.stringify(data));
2651
2778
  globalEntryCache.delete(sid);
2652
2779
  setClearTick((v) => v + 1);
2653
- const msg2 = t("clear.done").replace("{n}", String(count));
2780
+ const msg2 = t("clear.done", {
2781
+ n: count
2782
+ });
2654
2783
  api.ui.toast({
2655
2784
  message: msg2
2656
2785
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-subagent-magazine",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "OpenCode TUI plugin monitoring sub-agent invocation status in real time",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
package/src/_version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // auto-generated
2
- export const PLUGIN_VERSION="1.5.0";
2
+ export const PLUGIN_VERSION="1.5.2";