@justsilver/opencode-team 0.2.2-beta.1 → 0.2.2-beta.3
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/CHANGELOG.md +18 -0
- package/dist/model-ref.js +27 -0
- package/dist/rpc.js +104 -0
- package/dist/team-ids.js +2 -0
- package/dist/tui.js +21 -0
- package/dist/view/configure.js +77 -0
- package/dist/view/dashboard.js +1206 -0
- package/dist/view/model-config.js +1267 -0
- package/dist/view/model.js +335 -0
- package/dist/view/team.js +227 -0
- package/dist/view/ui.js +222 -0
- package/package.json +16 -4
- package/plugin/opencode-team/{prompts.ts → prompts.generated.ts} +23 -10
- package/plugin/opencode-team/team-agents.ts +7 -10
package/dist/view/ui.js
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { createTextNode as _$createTextNode } from "@opentui/solid";
|
|
2
|
+
import { createComponent as _$createComponent } from "@opentui/solid";
|
|
3
|
+
import { insertNode as _$insertNode } from "@opentui/solid";
|
|
4
|
+
import { insert as _$insert } from "@opentui/solid";
|
|
5
|
+
import { effect as _$effect } from "@opentui/solid";
|
|
6
|
+
import { setProp as _$setProp } from "@opentui/solid";
|
|
7
|
+
import { createElement as _$createElement } from "@opentui/solid";
|
|
8
|
+
/** @jsxImportSource @opentui/solid */
|
|
9
|
+
import { TextAttributes } from "@opentui/core";
|
|
10
|
+
import { For } from "solid-js";
|
|
11
|
+
export { effectTone, statusTone } from "./model.js";
|
|
12
|
+
export function toneColor(theme, tone) {
|
|
13
|
+
if (tone === "neutral") return theme.text.muted;
|
|
14
|
+
if (tone === "accent") return theme.text.action.primary.selected;
|
|
15
|
+
return theme.text.feedback[tone].base;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 原生选择器用 accent 色阶做分组标题(默认主题是紫色),这里沿用同一来源,
|
|
20
|
+
* 不另造强调色,浅色/深色都由主题解析。
|
|
21
|
+
*/
|
|
22
|
+
export function providerTitleColor(theme) {
|
|
23
|
+
return theme.hue.accent[200];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 选中行统一使用抬升表面和强调色指示条,不再用整行主操作色填充;
|
|
28
|
+
* 当前操作区域由面板边框或标题表示,避免多个区域同时高饱和。
|
|
29
|
+
*/
|
|
30
|
+
export function rowBackground(theme, selected) {
|
|
31
|
+
return selected ? theme.background.raised.high : undefined;
|
|
32
|
+
}
|
|
33
|
+
export function rowForeground(theme) {
|
|
34
|
+
return theme.text.base;
|
|
35
|
+
}
|
|
36
|
+
export function rowSecondary(theme, selected) {
|
|
37
|
+
return selected ? theme.text.base : theme.text.muted;
|
|
38
|
+
}
|
|
39
|
+
export function rowMarker(theme, selected) {
|
|
40
|
+
// 指示条统一使用宿主选中强调色;强选中背景本身就是该强调色时自然融入原生选中态。
|
|
41
|
+
return selected ? theme.text.action.primary.selected : theme.text.faint;
|
|
42
|
+
}
|
|
43
|
+
export function selectedRowAccent(theme) {
|
|
44
|
+
return theme.text.action.primary.selected;
|
|
45
|
+
}
|
|
46
|
+
export function Divider(props) {
|
|
47
|
+
return (() => {
|
|
48
|
+
var _el$ = _$createElement("box");
|
|
49
|
+
_$setProp(_el$, "height", 1);
|
|
50
|
+
_$setProp(_el$, "flexShrink", 0);
|
|
51
|
+
_$setProp(_el$, "border", ["bottom"]);
|
|
52
|
+
_$effect(_$p => _$setProp(_el$, "borderColor", props.theme.border.base, _$p));
|
|
53
|
+
return _el$;
|
|
54
|
+
})();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 面板内滚动条放在右侧预留列,使用主题 scrollbar 色,常驻显示以提示内容可滚动。
|
|
59
|
+
* 绝对定位避免出现/消失时改变内容宽度。
|
|
60
|
+
*/
|
|
61
|
+
export function scrollbarOptions(theme) {
|
|
62
|
+
return {
|
|
63
|
+
position: "absolute",
|
|
64
|
+
right: 0,
|
|
65
|
+
top: 0,
|
|
66
|
+
width: 1,
|
|
67
|
+
height: "100%",
|
|
68
|
+
trackOptions: {
|
|
69
|
+
backgroundColor: theme.background.raised.base,
|
|
70
|
+
foregroundColor: theme.scrollbar.base
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function Section(props) {
|
|
75
|
+
return (() => {
|
|
76
|
+
var _el$2 = _$createElement("box"),
|
|
77
|
+
_el$3 = _$createElement("text");
|
|
78
|
+
_$insertNode(_el$2, _el$3);
|
|
79
|
+
_$setProp(_el$2, "flexDirection", "column");
|
|
80
|
+
_$insert(_el$3, () => props.title);
|
|
81
|
+
_$insert(_el$2, () => props.children, null);
|
|
82
|
+
_$effect(_p$ => {
|
|
83
|
+
var _v$ = props.theme.text.muted,
|
|
84
|
+
_v$2 = TextAttributes.BOLD;
|
|
85
|
+
_v$ !== _p$.e && (_p$.e = _$setProp(_el$3, "fg", _v$, _p$.e));
|
|
86
|
+
_v$2 !== _p$.t && (_p$.t = _$setProp(_el$3, "attributes", _v$2, _p$.t));
|
|
87
|
+
return _p$;
|
|
88
|
+
}, {
|
|
89
|
+
e: undefined,
|
|
90
|
+
t: undefined
|
|
91
|
+
});
|
|
92
|
+
return _el$2;
|
|
93
|
+
})();
|
|
94
|
+
}
|
|
95
|
+
export function Badge(props) {
|
|
96
|
+
return (() => {
|
|
97
|
+
var _el$4 = _$createElement("box"),
|
|
98
|
+
_el$5 = _$createElement("text");
|
|
99
|
+
_$insertNode(_el$4, _el$5);
|
|
100
|
+
_$setProp(_el$4, "paddingLeft", 1);
|
|
101
|
+
_$setProp(_el$4, "paddingRight", 1);
|
|
102
|
+
_$setProp(_el$4, "flexShrink", 0);
|
|
103
|
+
_$insert(_el$5, () => props.text);
|
|
104
|
+
_$effect(_p$ => {
|
|
105
|
+
var _v$3 = props.theme.decrease(props.theme.background.base),
|
|
106
|
+
_v$4 = toneColor(props.theme, props.tone);
|
|
107
|
+
_v$3 !== _p$.e && (_p$.e = _$setProp(_el$4, "backgroundColor", _v$3, _p$.e));
|
|
108
|
+
_v$4 !== _p$.t && (_p$.t = _$setProp(_el$5, "fg", _v$4, _p$.t));
|
|
109
|
+
return _p$;
|
|
110
|
+
}, {
|
|
111
|
+
e: undefined,
|
|
112
|
+
t: undefined
|
|
113
|
+
});
|
|
114
|
+
return _el$4;
|
|
115
|
+
})();
|
|
116
|
+
}
|
|
117
|
+
export function Hints(props) {
|
|
118
|
+
return (() => {
|
|
119
|
+
var _el$6 = _$createElement("box");
|
|
120
|
+
_$setProp(_el$6, "flexDirection", "row");
|
|
121
|
+
_$setProp(_el$6, "gap", 2);
|
|
122
|
+
_$setProp(_el$6, "flexWrap", "wrap");
|
|
123
|
+
_$insert(_el$6, _$createComponent(For, {
|
|
124
|
+
get each() {
|
|
125
|
+
return props.hints;
|
|
126
|
+
},
|
|
127
|
+
children: hint => (() => {
|
|
128
|
+
var _el$7 = _$createElement("text"),
|
|
129
|
+
_el$8 = _$createElement("span"),
|
|
130
|
+
_el$9 = _$createTextNode(` `);
|
|
131
|
+
_$insertNode(_el$7, _el$8);
|
|
132
|
+
_$insertNode(_el$7, _el$9);
|
|
133
|
+
_$insert(_el$8, () => hint.key);
|
|
134
|
+
_$insert(_el$7, () => hint.label, null);
|
|
135
|
+
_$effect(_p$ => {
|
|
136
|
+
var _v$5 = props.theme.text.muted,
|
|
137
|
+
_v$6 = {
|
|
138
|
+
fg: props.theme.text.base
|
|
139
|
+
};
|
|
140
|
+
_v$5 !== _p$.e && (_p$.e = _$setProp(_el$7, "fg", _v$5, _p$.e));
|
|
141
|
+
_v$6 !== _p$.t && (_p$.t = _$setProp(_el$8, "style", _v$6, _p$.t));
|
|
142
|
+
return _p$;
|
|
143
|
+
}, {
|
|
144
|
+
e: undefined,
|
|
145
|
+
t: undefined
|
|
146
|
+
});
|
|
147
|
+
return _el$7;
|
|
148
|
+
})()
|
|
149
|
+
}));
|
|
150
|
+
return _el$6;
|
|
151
|
+
})();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Modal 内状态栏:普通状态紧凑一行,错误可换行展示完整内容。
|
|
156
|
+
* 作为独立布局行放在快捷键栏上方,不覆盖模型列表、搜索或 Variant。
|
|
157
|
+
*/
|
|
158
|
+
export function FeedbackBar(props) {
|
|
159
|
+
const color = () => toneColor(props.theme, props.feedback.tone);
|
|
160
|
+
const marker = () => {
|
|
161
|
+
if (props.feedback.tone === "success") return "✓";
|
|
162
|
+
if (props.feedback.tone === "info") return "·";
|
|
163
|
+
return "!";
|
|
164
|
+
};
|
|
165
|
+
return (() => {
|
|
166
|
+
var _el$0 = _$createElement("box"),
|
|
167
|
+
_el$1 = _$createElement("text"),
|
|
168
|
+
_el$10 = _$createElement("text");
|
|
169
|
+
_$insertNode(_el$0, _el$1);
|
|
170
|
+
_$insertNode(_el$0, _el$10);
|
|
171
|
+
_$setProp(_el$0, "flexShrink", 0);
|
|
172
|
+
_$setProp(_el$0, "flexDirection", "row");
|
|
173
|
+
_$setProp(_el$0, "gap", 1);
|
|
174
|
+
_$setProp(_el$0, "border", ["top"]);
|
|
175
|
+
_$setProp(_el$1, "flexShrink", 0);
|
|
176
|
+
_$insert(_el$1, marker);
|
|
177
|
+
_$setProp(_el$10, "flexGrow", 1);
|
|
178
|
+
_$setProp(_el$10, "wrapMode", "word");
|
|
179
|
+
_$insert(_el$10, () => props.feedback.message);
|
|
180
|
+
_$effect(_p$ => {
|
|
181
|
+
var _v$7 = color(),
|
|
182
|
+
_v$8 = color(),
|
|
183
|
+
_v$9 = TextAttributes.BOLD,
|
|
184
|
+
_v$0 = color();
|
|
185
|
+
_v$7 !== _p$.e && (_p$.e = _$setProp(_el$0, "borderColor", _v$7, _p$.e));
|
|
186
|
+
_v$8 !== _p$.t && (_p$.t = _$setProp(_el$1, "fg", _v$8, _p$.t));
|
|
187
|
+
_v$9 !== _p$.a && (_p$.a = _$setProp(_el$1, "attributes", _v$9, _p$.a));
|
|
188
|
+
_v$0 !== _p$.o && (_p$.o = _$setProp(_el$10, "fg", _v$0, _p$.o));
|
|
189
|
+
return _p$;
|
|
190
|
+
}, {
|
|
191
|
+
e: undefined,
|
|
192
|
+
t: undefined,
|
|
193
|
+
a: undefined,
|
|
194
|
+
o: undefined
|
|
195
|
+
});
|
|
196
|
+
return _el$0;
|
|
197
|
+
})();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** 需要确认的破坏性操作留在当前 Modal,不打开第二个宿主弹窗。 */
|
|
201
|
+
export function ConfirmBar(props) {
|
|
202
|
+
return (() => {
|
|
203
|
+
var _el$11 = _$createElement("box"),
|
|
204
|
+
_el$12 = _$createElement("text");
|
|
205
|
+
_$insertNode(_el$11, _el$12);
|
|
206
|
+
_$setProp(_el$11, "flexShrink", 0);
|
|
207
|
+
_$setProp(_el$11, "border", ["top"]);
|
|
208
|
+
_$setProp(_el$12, "wrapMode", "word");
|
|
209
|
+
_$insert(_el$12, () => props.message);
|
|
210
|
+
_$effect(_p$ => {
|
|
211
|
+
var _v$1 = props.theme.text.feedback.warning.base,
|
|
212
|
+
_v$10 = props.theme.text.feedback.warning.base;
|
|
213
|
+
_v$1 !== _p$.e && (_p$.e = _$setProp(_el$11, "borderColor", _v$1, _p$.e));
|
|
214
|
+
_v$10 !== _p$.t && (_p$.t = _$setProp(_el$12, "fg", _v$10, _p$.t));
|
|
215
|
+
return _p$;
|
|
216
|
+
}, {
|
|
217
|
+
e: undefined,
|
|
218
|
+
t: undefined
|
|
219
|
+
});
|
|
220
|
+
return _el$11;
|
|
221
|
+
})();
|
|
222
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justsilver/opencode-team",
|
|
3
|
-
"version": "0.2.2-beta.
|
|
3
|
+
"version": "0.2.2-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Zero-config multi-agent team for OpenCode V2: Orchestrator, QA, Reviewer, and per-agent subagent model/variant policy",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"exports": {
|
|
19
19
|
".": "./plugin/opencode-team/index.ts",
|
|
20
20
|
"./server": "./plugin/opencode-team/index.ts",
|
|
21
|
-
"./tui": "./
|
|
21
|
+
"./tui": "./dist/tui.js",
|
|
22
22
|
"./rpc": "./plugin/opencode-team/rpc.ts"
|
|
23
23
|
},
|
|
24
|
-
"files": ["plugin/**/*.ts", "plugin/**/*.tsx", "CHANGELOG.md"],
|
|
24
|
+
"files": ["plugin/**/*.ts", "plugin/**/*.tsx", "dist/**/*.js", "CHANGELOG.md"],
|
|
25
25
|
"publishConfig": {
|
|
26
26
|
"access": "public",
|
|
27
27
|
"tag": "next"
|
|
@@ -31,19 +31,31 @@
|
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"test": "node --test",
|
|
34
|
-
"typecheck": "tsc --noEmit"
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"build:prompts": "node scripts/build-prompts.mjs gen",
|
|
36
|
+
"check:prompts": "node scripts/build-prompts.mjs check",
|
|
37
|
+
"build:tui": "node scripts/build-tui.mjs",
|
|
38
|
+
"prepack": "node scripts/build-prompts.mjs check && node scripts/build-tui.mjs"
|
|
35
39
|
},
|
|
36
40
|
"peerDependencies": {
|
|
37
41
|
"@opentui/core": ">=0.8.4 <0.9.0",
|
|
38
42
|
"@opentui/solid": ">=0.8.4 <0.9.0",
|
|
39
43
|
"solid-js": ">=1.9.12 <2"
|
|
40
44
|
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"@opentui/core": { "optional": true },
|
|
47
|
+
"@opentui/solid": { "optional": true },
|
|
48
|
+
"solid-js": { "optional": true }
|
|
49
|
+
},
|
|
41
50
|
"devDependencies": {
|
|
51
|
+
"@babel/core": "^7.29.0",
|
|
52
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
42
53
|
"@opencode/client": "^2.3.0",
|
|
43
54
|
"@opencode/plugin": "^2.3.0",
|
|
44
55
|
"@opencode/theme": "^2.3.0",
|
|
45
56
|
"@opentui/core": "^0.8.4",
|
|
46
57
|
"@opentui/solid": "^0.8.4",
|
|
58
|
+
"babel-preset-solid": "^1.9.16",
|
|
47
59
|
"solid-js": "^1.9.17",
|
|
48
60
|
"typescript": "^5.9.3"
|
|
49
61
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
// 由 scripts/build-prompts.mjs 从 prompts/*.md 生成,请勿手改;修改内容请改 Markdown 后运行 npm run build:prompts。
|
|
2
|
+
|
|
3
|
+
export interface GeneratedTeamPrompt {
|
|
4
|
+
readonly description: string
|
|
5
|
+
readonly system: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const ORCHESTRATOR_PROMPT: GeneratedTeamPrompt = {
|
|
9
|
+
description: "Primary team lead responsible for end-to-end delivery. Dynamically delegates or executes tasks, coordinates parallel work and Git operations, reconciles agent findings, and owns final decisions and verification.",
|
|
10
|
+
system: `# Orchestrator — 主编排代理
|
|
6
11
|
|
|
7
12
|
你是软件工程团队的主编排代理(Orchestrator),负责从需求理解到最终交付的完整任务生命周期。
|
|
8
13
|
|
|
@@ -46,9 +51,12 @@ export const ORCHESTRATOR_PROMPT = `# Orchestrator — 主编排代理
|
|
|
46
51
|
- 根据项目条件完成必要的构建、测试或其他验证。
|
|
47
52
|
- 区分工作已执行、目标已达成和结果已验证,不将代理报告完成等同于任务通过验收。
|
|
48
53
|
- 明确已验证结果、未验证内容、剩余风险及需要用户决策的问题。
|
|
49
|
-
-
|
|
54
|
+
- 交付说明简洁,突出实际变更与验证结论。`,
|
|
55
|
+
}
|
|
50
56
|
|
|
51
|
-
export const QA_PROMPT =
|
|
57
|
+
export const QA_PROMPT: GeneratedTeamPrompt = {
|
|
58
|
+
description: "Independent quality assurance agent. Designs and executes acceptance and regression tests against requirements and contracts, investigates failures, and independently verifies fixes. Production code changes require explicit authorization.",
|
|
59
|
+
system: `# QA — 独立质量保证代理
|
|
52
60
|
|
|
53
61
|
你是独立质量保证代理(QA),负责从需求和可观察行为出发验证软件的正确性与可靠性。
|
|
54
62
|
|
|
@@ -84,9 +92,12 @@ export const QA_PROMPT = `# QA — 独立质量保证代理
|
|
|
84
92
|
|
|
85
93
|
- 明确验收结论、实际执行结果、发现的缺陷和未覆盖风险。
|
|
86
94
|
- 问题报告应包含足够的证据与复现信息。
|
|
87
|
-
-
|
|
95
|
+
- 区分已确认缺陷、合理推断和待验证问题,不输出无依据的结论。`,
|
|
96
|
+
}
|
|
88
97
|
|
|
89
|
-
export const REVIEWER_PROMPT =
|
|
98
|
+
export const REVIEWER_PROMPT: GeneratedTeamPrompt = {
|
|
99
|
+
description: "Independent code reviewer. Primarily reviews source code for correctness, architecture, and risks, using targeted verification when needed. Reports evidence-based findings without replacing QA acceptance testing. Production code changes require explicit authorization.",
|
|
100
|
+
system: `# Reviewer — 独立代码审查代理
|
|
90
101
|
|
|
91
102
|
你是独立代码审查代理(Reviewer),负责从正确性、可靠性和工程质量角度评估实现。
|
|
92
103
|
|
|
@@ -135,4 +146,6 @@ export const REVIEWER_PROMPT = `# Reviewer — 独立代码审查代理
|
|
|
135
146
|
|
|
136
147
|
区分已确认问题与待验证风险;没有充分证据时不得断言存在缺陷。
|
|
137
148
|
|
|
138
|
-
|
|
149
|
+
没有发现实质性问题时直接说明,不输出凑数建议,也不将未发现问题等同于实现已被全面验证。`,
|
|
150
|
+
}
|
|
151
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ORCHESTRATOR_PROMPT, QA_PROMPT, REVIEWER_PROMPT } from "./prompts.ts"
|
|
1
|
+
import { ORCHESTRATOR_PROMPT, QA_PROMPT, REVIEWER_PROMPT } from "./prompts.generated.ts"
|
|
2
2
|
|
|
3
3
|
export { TEAM_SUBAGENT_IDS } from "./team-ids.ts"
|
|
4
4
|
|
|
@@ -27,28 +27,25 @@ export const TEAM_AGENTS: readonly TeamAgentDefinition[] = [
|
|
|
27
27
|
{
|
|
28
28
|
id: "orchestrator",
|
|
29
29
|
name: "Orchestrator",
|
|
30
|
-
description:
|
|
31
|
-
"Primary team lead responsible for end-to-end delivery. Dynamically delegates or executes tasks, coordinates parallel work and Git operations, reconciles agent findings, and owns final decisions and verification.",
|
|
30
|
+
description: ORCHESTRATOR_PROMPT.description,
|
|
32
31
|
mode: "primary",
|
|
33
|
-
system: ORCHESTRATOR_PROMPT,
|
|
32
|
+
system: ORCHESTRATOR_PROMPT.system,
|
|
34
33
|
permissions: [],
|
|
35
34
|
},
|
|
36
35
|
{
|
|
37
36
|
id: "qa",
|
|
38
37
|
name: "QA",
|
|
39
|
-
description:
|
|
40
|
-
"Independent quality assurance agent. Designs and executes acceptance and regression tests against requirements and contracts, investigates failures, and independently verifies fixes. Production code changes require explicit authorization.",
|
|
38
|
+
description: QA_PROMPT.description,
|
|
41
39
|
mode: "subagent",
|
|
42
|
-
system: QA_PROMPT,
|
|
40
|
+
system: QA_PROMPT.system,
|
|
43
41
|
permissions: LEAF_SUBAGENT_PERMISSIONS,
|
|
44
42
|
},
|
|
45
43
|
{
|
|
46
44
|
id: "reviewer",
|
|
47
45
|
name: "Reviewer",
|
|
48
|
-
description:
|
|
49
|
-
"Independent code reviewer. Primarily reviews source code for correctness, architecture, and risks, using targeted verification when needed. Reports evidence-based findings without replacing QA acceptance testing. Production code changes require explicit authorization.",
|
|
46
|
+
description: REVIEWER_PROMPT.description,
|
|
50
47
|
mode: "subagent",
|
|
51
|
-
system: REVIEWER_PROMPT,
|
|
48
|
+
system: REVIEWER_PROMPT.system,
|
|
52
49
|
permissions: LEAF_SUBAGENT_PERMISSIONS,
|
|
53
50
|
},
|
|
54
51
|
]
|