@justsilver/opencode-team 0.0.0-stage → 0.2.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/CHANGELOG.md +126 -0
- package/LICENSE +21 -0
- package/README.md +116 -3
- package/package.json +48 -4
- package/plugin/opencode-team/index.ts +41 -0
- package/plugin/opencode-team/legacy.ts +48 -0
- package/plugin/opencode-team/model-ref.ts +28 -0
- package/plugin/opencode-team/policy.ts +638 -0
- package/plugin/opencode-team/prompts.ts +138 -0
- package/plugin/opencode-team/rpc.ts +90 -0
- package/plugin/opencode-team/team-agents.ts +104 -0
- package/plugin/opencode-team/team-ids.ts +2 -0
- package/plugin/opencode-team/tui.ts +22 -0
- package/plugin/opencode-team/view/configure.tsx +71 -0
- package/plugin/opencode-team/view/dashboard.tsx +889 -0
- package/plugin/opencode-team/view/model-config.tsx +976 -0
- package/plugin/opencode-team/view/model.ts +502 -0
- package/plugin/opencode-team/view/team.ts +267 -0
- package/plugin/opencode-team/view/ui.tsx +165 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role prompts live here so responsibility boundaries can be refined without touching agent
|
|
3
|
+
* registration or the model policy.
|
|
4
|
+
*/
|
|
5
|
+
export const ORCHESTRATOR_PROMPT = `# Orchestrator — 主编排代理
|
|
6
|
+
|
|
7
|
+
你是软件工程团队的主编排代理(Orchestrator),负责从需求理解到最终交付的完整任务生命周期。
|
|
8
|
+
|
|
9
|
+
## 核心职责
|
|
10
|
+
|
|
11
|
+
- 理解用户目标,识别需求边界、技术约束和潜在风险。
|
|
12
|
+
- 根据任务复杂度自主决定执行策略、代理分工及并行程度。
|
|
13
|
+
- 协调任务依赖、执行进度、质量验证和问题修复。
|
|
14
|
+
- 整合各代理的发现与验证证据,识别矛盾、遗漏和未解决的问题。
|
|
15
|
+
- 对任务分解、结果采纳、质量判断及最终交付承担最终责任。
|
|
16
|
+
|
|
17
|
+
## 团队分工
|
|
18
|
+
|
|
19
|
+
- **Explore**:源码探索、依赖分析、问题定位和事实收集。
|
|
20
|
+
- **General**:功能实现、缺陷修复、重构及其他开发任务。
|
|
21
|
+
- **QA**:独立验收设计、测试执行、缺陷复现和回归验证。
|
|
22
|
+
- **Reviewer**:独立审查实现正确性、代码质量和潜在风险。
|
|
23
|
+
|
|
24
|
+
## 执行策略
|
|
25
|
+
|
|
26
|
+
1. 根据任务目标、复杂度、不确定性和风险自主决定工作方式。
|
|
27
|
+
2. 简单、明确的任务可以直接完成;复杂任务优先委派给合适的代理。
|
|
28
|
+
3. 不强制固定流程,不因角色存在而进行无意义的代理调用。
|
|
29
|
+
4. 优先并行处理相互独立的任务;存在依赖或共享文件冲突时协调执行。
|
|
30
|
+
5. 委派任务时明确目标、范围、已知约束和预期结果,避免传递无关上下文。
|
|
31
|
+
6. 对复杂功能或高风险修改,优先在实现前确定可验证的验收条件。
|
|
32
|
+
7. 根据实际风险安排 QA 和 Reviewer,不以测试通过代替独立审查。
|
|
33
|
+
8. 任务失败或验证不通过时,先分析原因,再决定修复、重新调查或调整分工;没有新证据或新策略时不重复无效尝试。
|
|
34
|
+
|
|
35
|
+
## 协作原则
|
|
36
|
+
|
|
37
|
+
- 保持各代理职责清晰,同时允许根据任务需要灵活调整。
|
|
38
|
+
- QA 应基于需求独立验收;Reviewer 应独立审查实现,不预设开发结果正确。
|
|
39
|
+
- 区分已验证事实、合理推断与待确认假设,不将子代理的自我声明视为事实。
|
|
40
|
+
- 综合各代理结论,发现冲突时依据原始需求、源码和验证证据主动核实,不以代理数量或角色权威判断正确性。
|
|
41
|
+
- 不将决策责任转移给子代理;无法可靠判断时说明不确定性,必要时交由用户决策。
|
|
42
|
+
|
|
43
|
+
## 交付标准
|
|
44
|
+
|
|
45
|
+
- 实际处理任务目标,避免仅输出计划而不执行。
|
|
46
|
+
- 根据项目条件完成必要的构建、测试或其他验证。
|
|
47
|
+
- 区分工作已执行、目标已达成和结果已验证,不将代理报告完成等同于任务通过验收。
|
|
48
|
+
- 明确已验证结果、未验证内容、剩余风险及需要用户决策的问题。
|
|
49
|
+
- 交付说明简洁,突出实际变更与验证结论。`
|
|
50
|
+
|
|
51
|
+
export const QA_PROMPT = `# QA — 独立质量保证代理
|
|
52
|
+
|
|
53
|
+
你是独立质量保证代理(QA),负责从需求和可观察行为出发验证软件的正确性与可靠性。
|
|
54
|
+
|
|
55
|
+
## 核心职责
|
|
56
|
+
|
|
57
|
+
- 根据用户需求、接口契约和项目既有约束制定验收标准。
|
|
58
|
+
- 设计并执行正常、异常、边界及回归测试。
|
|
59
|
+
- 识别未覆盖场景、错误假设和潜在缺陷。
|
|
60
|
+
- 复现问题、调查失败原因并验证修复结果。
|
|
61
|
+
- 根据需要编写或维护自动化测试。
|
|
62
|
+
|
|
63
|
+
## 工作原则
|
|
64
|
+
|
|
65
|
+
1. 以原始需求和预期行为为验收依据;现有行为可作为兼容性参考,但不默认其正确。
|
|
66
|
+
2. 优先确定预期行为,再验证实际结果;可阅读源码理解系统约束,但不得根据待验证实现反向定义正确性。
|
|
67
|
+
3. 优先复用已有测试框架和基础设施,不重复建设。
|
|
68
|
+
4. 测试应具有明确目标和有效断言,不为提高覆盖率而增加无意义测试。
|
|
69
|
+
5. 不为使测试通过而削弱断言、删除有效失败用例或擅自改变验收标准。
|
|
70
|
+
6. 以独立验证为主要职责;生产代码修复原则上交由实现代理,确需参与修复时应明确区分修复工作与独立验收。
|
|
71
|
+
7. 区分代码缺陷、测试缺陷、环境问题和需求歧义,不将所有失败归因于实现。
|
|
72
|
+
8. 无法自动化验证时,说明原因并选择适当的替代验证方式。
|
|
73
|
+
|
|
74
|
+
## 验证要求
|
|
75
|
+
|
|
76
|
+
- 根据任务风险和修改范围选择必要测试,不机械执行全部测试。
|
|
77
|
+
- 关注功能正确性、异常处理、边界条件、兼容性及回归风险。
|
|
78
|
+
- 对关键缺陷提供可复现条件、预期结果、实际结果及相关证据。
|
|
79
|
+
- 对失败进行必要的根因调查,避免仅报告表面症状。
|
|
80
|
+
- 区分已执行测试、未执行测试及未覆盖风险,不将测试通过等同于需求完全满足。
|
|
81
|
+
- 对自身参与修复的实现,不以自身修复后的测试结果代替独立验收。
|
|
82
|
+
|
|
83
|
+
## 输出要求
|
|
84
|
+
|
|
85
|
+
- 明确验收结论、实际执行结果、发现的缺陷和未覆盖风险。
|
|
86
|
+
- 问题报告应包含足够的证据与复现信息。
|
|
87
|
+
- 区分已确认缺陷、合理推断和待验证问题,不输出无依据的结论。`
|
|
88
|
+
|
|
89
|
+
export const REVIEWER_PROMPT = `# Reviewer — 独立代码审查代理
|
|
90
|
+
|
|
91
|
+
你是独立代码审查代理(Reviewer),负责从正确性、可靠性和工程质量角度评估实现。
|
|
92
|
+
|
|
93
|
+
## 核心职责
|
|
94
|
+
|
|
95
|
+
- 对照原始需求审查实际实现是否完整、正确。
|
|
96
|
+
- 通过源码、调用链和数据流分析识别逻辑错误、边界缺陷及潜在回归。
|
|
97
|
+
- 审查架构合理性、接口兼容性、性能风险与可维护性。
|
|
98
|
+
- 检查测试是否有效覆盖关键行为,识别测试设计盲区。
|
|
99
|
+
- 对发现的问题提供明确证据、影响分析和修复建议。
|
|
100
|
+
|
|
101
|
+
## 审查原则
|
|
102
|
+
|
|
103
|
+
1. 以独立源码审查为主要手段,不预设实现正确,也不为寻找问题而制造问题。
|
|
104
|
+
2. 以正确性和实际风险为优先级,不将个人风格偏好当成缺陷。
|
|
105
|
+
3. 关注修改涉及的完整调用链及必要的上下游影响,不局限于变更行。
|
|
106
|
+
4. 区分已确认缺陷、潜在风险和改进建议,不将推测包装成事实。
|
|
107
|
+
5. 不仅检查测试是否通过,还应判断测试是否有效验证关键需求。
|
|
108
|
+
6. 必要时可运行针对性验证,但不替代 QA 对软件行为的独立验收。
|
|
109
|
+
7. 尊重项目既有架构和编码约定,不无理由要求重构或扩大修改范围。
|
|
110
|
+
8. 默认保持审查独立性,优先报告问题;确需修改代码时,明确区分审查结果与后续修复。
|
|
111
|
+
|
|
112
|
+
## 审查重点
|
|
113
|
+
|
|
114
|
+
根据任务性质选择相关维度,不机械检查全部项目:
|
|
115
|
+
|
|
116
|
+
- 业务逻辑与需求一致性
|
|
117
|
+
- 数据正确性和边界条件
|
|
118
|
+
- 错误处理与异常恢复
|
|
119
|
+
- 并发、状态管理与资源生命周期
|
|
120
|
+
- 安全性与输入处理
|
|
121
|
+
- 性能及资源使用
|
|
122
|
+
- 接口兼容性与回归风险
|
|
123
|
+
- 测试有效性与可维护性
|
|
124
|
+
|
|
125
|
+
## 结论要求
|
|
126
|
+
|
|
127
|
+
对每个实质性问题说明:
|
|
128
|
+
|
|
129
|
+
- 问题位置及证据
|
|
130
|
+
- 触发条件或错误原因
|
|
131
|
+
- 实际影响与严重程度
|
|
132
|
+
- 可执行的修复方向
|
|
133
|
+
|
|
134
|
+
按严重程度排序,优先报告影响正确性、安全性或稳定性的问题。
|
|
135
|
+
|
|
136
|
+
区分已确认问题与待验证风险;没有充分证据时不得断言存在缺陷。
|
|
137
|
+
|
|
138
|
+
没有发现实质性问题时直接说明,不输出凑数建议,也不将未发现问题等同于实现已被全面验证。`
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const emptyInput = { type: "object", properties: {}, additionalProperties: false } as const
|
|
2
|
+
|
|
3
|
+
const agentModels = {
|
|
4
|
+
type: "object",
|
|
5
|
+
additionalProperties: { type: "string" },
|
|
6
|
+
} as const
|
|
7
|
+
|
|
8
|
+
const conflict = {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
pluginID: { type: "string" },
|
|
12
|
+
source: { type: "string" },
|
|
13
|
+
},
|
|
14
|
+
required: ["pluginID"],
|
|
15
|
+
additionalProperties: false,
|
|
16
|
+
} as const
|
|
17
|
+
|
|
18
|
+
const migration = {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
from: { type: "string" },
|
|
22
|
+
status: { type: "string" },
|
|
23
|
+
agents: { type: "array", items: { type: "string" } },
|
|
24
|
+
errors: { type: "array", items: { type: "string" } },
|
|
25
|
+
},
|
|
26
|
+
required: ["from", "status"],
|
|
27
|
+
additionalProperties: false,
|
|
28
|
+
} as const
|
|
29
|
+
|
|
30
|
+
const stateOutput = {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
ok: { type: "boolean" },
|
|
34
|
+
supported: { type: "boolean" },
|
|
35
|
+
agentsSupported: { type: "boolean" },
|
|
36
|
+
agentsError: { type: "string" },
|
|
37
|
+
models: agentModels,
|
|
38
|
+
errors: { type: "array", items: { type: "string" } },
|
|
39
|
+
conflict,
|
|
40
|
+
migration,
|
|
41
|
+
},
|
|
42
|
+
required: ["ok", "supported"],
|
|
43
|
+
additionalProperties: false,
|
|
44
|
+
} as const
|
|
45
|
+
|
|
46
|
+
export const teamRpc = {
|
|
47
|
+
id: "opencode-team",
|
|
48
|
+
methods: {
|
|
49
|
+
getTeamPolicy: {
|
|
50
|
+
input: emptyInput,
|
|
51
|
+
output: stateOutput,
|
|
52
|
+
},
|
|
53
|
+
setAgentModel: {
|
|
54
|
+
input: {
|
|
55
|
+
type: "object",
|
|
56
|
+
properties: {
|
|
57
|
+
agentID: { type: "string", minLength: 1 },
|
|
58
|
+
model: { type: ["string", "null"] },
|
|
59
|
+
},
|
|
60
|
+
required: ["agentID", "model"],
|
|
61
|
+
additionalProperties: false,
|
|
62
|
+
},
|
|
63
|
+
output: stateOutput,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
events: {},
|
|
67
|
+
} as const
|
|
68
|
+
|
|
69
|
+
export interface TeamConflict {
|
|
70
|
+
readonly pluginID: string
|
|
71
|
+
readonly source?: string
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface TeamMigration {
|
|
75
|
+
readonly from: string
|
|
76
|
+
readonly status: "applied" | "empty" | "unavailable" | "failed"
|
|
77
|
+
readonly agents?: readonly string[]
|
|
78
|
+
readonly errors?: readonly string[]
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface TeamPolicySummary {
|
|
82
|
+
readonly ok: boolean
|
|
83
|
+
readonly supported: boolean
|
|
84
|
+
readonly agentsSupported?: boolean
|
|
85
|
+
readonly agentsError?: string
|
|
86
|
+
readonly models?: Readonly<Record<string, string>>
|
|
87
|
+
readonly errors?: readonly string[]
|
|
88
|
+
readonly conflict?: TeamConflict
|
|
89
|
+
readonly migration?: TeamMigration
|
|
90
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ORCHESTRATOR_PROMPT, QA_PROMPT, REVIEWER_PROMPT } from "./prompts.ts"
|
|
2
|
+
|
|
3
|
+
export { TEAM_SUBAGENT_IDS } from "./team-ids.ts"
|
|
4
|
+
|
|
5
|
+
export interface PermissionRule {
|
|
6
|
+
readonly action: string
|
|
7
|
+
readonly resource: string
|
|
8
|
+
readonly effect: "allow" | "deny" | "ask"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface TeamAgentDefinition {
|
|
12
|
+
readonly id: string
|
|
13
|
+
readonly name: string
|
|
14
|
+
readonly description: string
|
|
15
|
+
readonly mode: "primary" | "subagent"
|
|
16
|
+
readonly system: string
|
|
17
|
+
readonly permissions: readonly PermissionRule[]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Subagents must not ask the user directly; the primary Orchestrator owns user interaction.
|
|
21
|
+
const QUESTION_DENY: readonly PermissionRule[] = [{ action: "question", resource: "*", effect: "deny" }]
|
|
22
|
+
|
|
23
|
+
export const TEAM_AGENTS: readonly TeamAgentDefinition[] = [
|
|
24
|
+
{
|
|
25
|
+
id: "orchestrator",
|
|
26
|
+
name: "Orchestrator",
|
|
27
|
+
description:
|
|
28
|
+
"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.",
|
|
29
|
+
mode: "primary",
|
|
30
|
+
system: ORCHESTRATOR_PROMPT,
|
|
31
|
+
permissions: [],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "qa",
|
|
35
|
+
name: "QA",
|
|
36
|
+
description:
|
|
37
|
+
"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
|
+
mode: "subagent",
|
|
39
|
+
system: QA_PROMPT,
|
|
40
|
+
permissions: QUESTION_DENY,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "reviewer",
|
|
44
|
+
name: "Reviewer",
|
|
45
|
+
description:
|
|
46
|
+
"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.",
|
|
47
|
+
mode: "subagent",
|
|
48
|
+
system: REVIEWER_PROMPT,
|
|
49
|
+
permissions: QUESTION_DENY,
|
|
50
|
+
},
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
export interface TeamAgentEditor {
|
|
54
|
+
get(id: string): { readonly id: string } | undefined
|
|
55
|
+
update(
|
|
56
|
+
id: string,
|
|
57
|
+
update: (agent: {
|
|
58
|
+
name: string
|
|
59
|
+
description?: string
|
|
60
|
+
mode: "primary" | "subagent" | "all"
|
|
61
|
+
system?: string
|
|
62
|
+
hidden: boolean
|
|
63
|
+
permissions: PermissionRule[]
|
|
64
|
+
}) => void,
|
|
65
|
+
): void
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface TeamAgentContext {
|
|
69
|
+
readonly agent?: {
|
|
70
|
+
transform(callback: (editor: TeamAgentEditor) => void): Promise<{ dispose(): Promise<void> }>
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface TeamAgentRegistration {
|
|
75
|
+
readonly supported: boolean
|
|
76
|
+
readonly error?: string
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export async function registerTeamAgents(ctx: TeamAgentContext): Promise<TeamAgentRegistration> {
|
|
80
|
+
const transform = ctx.agent?.transform
|
|
81
|
+
if (typeof transform !== "function") {
|
|
82
|
+
return { supported: false, error: "This host cannot register agents at runtime." }
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
await transform((editor) => {
|
|
86
|
+
for (const definition of TEAM_AGENTS) {
|
|
87
|
+
editor.update(definition.id, (agent) => {
|
|
88
|
+
agent.name = definition.name
|
|
89
|
+
agent.description = definition.description
|
|
90
|
+
agent.mode = definition.mode
|
|
91
|
+
agent.system = definition.system
|
|
92
|
+
agent.hidden = false
|
|
93
|
+
agent.permissions.push(...definition.permissions)
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
} catch (error) {
|
|
98
|
+
return {
|
|
99
|
+
supported: false,
|
|
100
|
+
error: `Team agent registration failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return { supported: true }
|
|
104
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Plugin } from "@opencode/plugin/tui"
|
|
2
|
+
import { teamRpc } from "./rpc.ts"
|
|
3
|
+
import { configureTeam } from "./view/configure.tsx"
|
|
4
|
+
|
|
5
|
+
export default Plugin.define({
|
|
6
|
+
id: teamRpc.id,
|
|
7
|
+
setup(context) {
|
|
8
|
+
context.keymap.layer(() => ({
|
|
9
|
+
mode: "global",
|
|
10
|
+
commands: [
|
|
11
|
+
{
|
|
12
|
+
id: `${teamRpc.id}.configure`,
|
|
13
|
+
title: "Agent 团队与模型",
|
|
14
|
+
group: "Model",
|
|
15
|
+
slash: { name: "team" },
|
|
16
|
+
palette: true,
|
|
17
|
+
run: () => configureTeam(context),
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
}))
|
|
21
|
+
},
|
|
22
|
+
})
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/solid */
|
|
2
|
+
import type { Plugin } from "@opencode/plugin/tui"
|
|
3
|
+
|
|
4
|
+
import { TeamDashboard } from "./dashboard.tsx"
|
|
5
|
+
import type { DashboardAgent } from "./model.ts"
|
|
6
|
+
import {
|
|
7
|
+
currentLocation,
|
|
8
|
+
loadTeamDashboard,
|
|
9
|
+
refreshModels,
|
|
10
|
+
restoreAgentModel,
|
|
11
|
+
saveAgentModel,
|
|
12
|
+
} from "./team.ts"
|
|
13
|
+
|
|
14
|
+
// A second /team while a model picker is open replaces the first flow; the old continuation
|
|
15
|
+
// must not reopen its dashboard on top of the newer one.
|
|
16
|
+
let latest = 0
|
|
17
|
+
|
|
18
|
+
export async function configureTeam(ctx: Plugin.Context): Promise<void> {
|
|
19
|
+
const token = ++latest
|
|
20
|
+
const location = currentLocation(ctx)
|
|
21
|
+
const result = await loadTeamDashboard(ctx, location)
|
|
22
|
+
if (token !== latest) return
|
|
23
|
+
if (result.kind === "blocked") {
|
|
24
|
+
ctx.ui.toast.show({ variant: "error", message: result.message })
|
|
25
|
+
return
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const data = result.data
|
|
29
|
+
let overrides: Readonly<Record<string, string>> = data.overrides
|
|
30
|
+
let closed = false
|
|
31
|
+
|
|
32
|
+
const open = (): void => {
|
|
33
|
+
if (token !== latest || closed) return
|
|
34
|
+
ctx.ui.dialog.show(
|
|
35
|
+
() => (
|
|
36
|
+
<TeamDashboard
|
|
37
|
+
agents={data.agents}
|
|
38
|
+
overrides={overrides}
|
|
39
|
+
models={data.models}
|
|
40
|
+
providers={data.providers}
|
|
41
|
+
{...(data.modelError === undefined ? {} : { modelError: data.modelError })}
|
|
42
|
+
{...(data.warning === undefined ? {} : { warning: data.warning })}
|
|
43
|
+
agentsSupported={data.agentsSupported}
|
|
44
|
+
{...(data.agentsError === undefined ? {} : { agentsError: data.agentsError })}
|
|
45
|
+
refreshModels={() => refreshModels(ctx, location)}
|
|
46
|
+
theme={ctx.theme}
|
|
47
|
+
layer={(factory) => ctx.keymap.layer(factory)}
|
|
48
|
+
clearDialog={() => ctx.ui.dialog.clear()}
|
|
49
|
+
saveModel={async (agent: DashboardAgent, model: string | null) => {
|
|
50
|
+
const saved = await saveAgentModel(ctx, location, agent, model)
|
|
51
|
+
if (saved.saved && saved.models !== undefined) overrides = saved.models
|
|
52
|
+
return saved
|
|
53
|
+
}}
|
|
54
|
+
restoreModel={async (agent: DashboardAgent) => {
|
|
55
|
+
const restored = await restoreAgentModel(ctx, location, agent)
|
|
56
|
+
if (restored.saved && restored.models !== undefined) overrides = restored.models
|
|
57
|
+
return restored
|
|
58
|
+
}}
|
|
59
|
+
close={() => {
|
|
60
|
+
closed = true
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
63
|
+
),
|
|
64
|
+
() => {},
|
|
65
|
+
)
|
|
66
|
+
// show() resets the dialog to medium; set the dashboard presentation after it is mounted.
|
|
67
|
+
ctx.ui.dialog.set({ size: "xlarge", centered: true })
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
open()
|
|
71
|
+
}
|