dsh-my-go 0.1.3 → 0.1.5
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/client.core.js +107 -7
- package/dist/client.js +107 -7
- package/package.json +1 -1
- package/src/client.js +94 -7
package/dist/client.core.js
CHANGED
|
@@ -37,7 +37,9 @@ __export(client_exports, {
|
|
|
37
37
|
module.exports = __toCommonJS(client_exports);
|
|
38
38
|
var React = __toESM(require("react"), 1);
|
|
39
39
|
var name = "dsh-my-go";
|
|
40
|
-
var inject = ["slots"];
|
|
40
|
+
var inject = ["slots", "settingsScope"];
|
|
41
|
+
var AGENT_TYPES = ["sisyphus", "hermes", "explore", "librarian", "looker", "hephaestus", "prometheus", "oracle"];
|
|
42
|
+
var AGENT_LABELS = { sisyphus: "Sisyphus", hermes: "Hermes", explore: "Explore", librarian: "Librarian", looker: "Looker", hephaestus: "Hephaestus", prometheus: "Prometheus", oracle: "Oracle" };
|
|
41
43
|
function apply(ctx) {
|
|
42
44
|
const client = ctx;
|
|
43
45
|
const slots = client.get("slots");
|
|
@@ -182,17 +184,115 @@ function apply(ctx) {
|
|
|
182
184
|
style: { width: props && props.wide ? "100%" : 32, height: 32, border: "none", background: "transparent", cursor: "pointer" }
|
|
183
185
|
}, "\u{1F9ED}")
|
|
184
186
|
));
|
|
187
|
+
const scope = client.get("settingsScope") ? client.get("settingsScope").bind({ namespace: "dsh-my-go" }) : null;
|
|
185
188
|
slots.inject("settings.section", () => slots.register(
|
|
186
189
|
{ name: "settings.section", id: "dsh-my-go", order: 30, label: "MyGO \u7F16\u6392" },
|
|
187
|
-
(props) => React.createElement(SettingsPage, props)
|
|
190
|
+
(props) => React.createElement(SettingsPage, { ...props, scope })
|
|
188
191
|
));
|
|
189
|
-
function SettingsPage(
|
|
192
|
+
function SettingsPage({ scope: sp, close }) {
|
|
193
|
+
const [draft, setDraft] = React.useState(null);
|
|
194
|
+
const [saving, setSaving] = React.useState(false);
|
|
195
|
+
const [msg, setMsg] = React.useState(null);
|
|
196
|
+
React.useEffect(() => {
|
|
197
|
+
if (!sp) return;
|
|
198
|
+
try {
|
|
199
|
+
setDraft(sp.read());
|
|
200
|
+
} catch {
|
|
201
|
+
setDraft({});
|
|
202
|
+
}
|
|
203
|
+
}, [sp]);
|
|
204
|
+
if (!sp) return React.createElement("div", { style: { padding: 16, color: "#888" } }, "\u8BBE\u7F6E\u670D\u52A1\u4E0D\u53EF\u7528");
|
|
205
|
+
const set = (type, field, value) => {
|
|
206
|
+
setDraft((prev) => ({ ...prev, [type]: { ...prev?.[type], [field]: value } }));
|
|
207
|
+
};
|
|
208
|
+
const save = async () => {
|
|
209
|
+
setSaving(true);
|
|
210
|
+
setMsg(null);
|
|
211
|
+
try {
|
|
212
|
+
await sp.update(draft);
|
|
213
|
+
setMsg("\u5DF2\u4FDD\u5B58");
|
|
214
|
+
} catch (e) {
|
|
215
|
+
setMsg("\u4FDD\u5B58\u5931\u8D25: " + String(e));
|
|
216
|
+
} finally {
|
|
217
|
+
setSaving(false);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const selectStyle = { background: "var(--surface, #1e1e1e)", color: "var(--text, #e0e0e0)", border: "1px solid var(--separator, #333)", borderRadius: 4, padding: "4px 8px", fontSize: 13, width: "100%", boxSizing: "border-box" };
|
|
221
|
+
const labelStyle = { fontSize: 12, color: "var(--text-secondary, #888)", marginBottom: 2 };
|
|
222
|
+
const cardStyle = { border: "1px solid var(--separator, #333)", borderRadius: 8, padding: 12, marginBottom: 12 };
|
|
223
|
+
const rowStyle = { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 8, marginBottom: 8 };
|
|
224
|
+
const PROVIDERS = ["", "octopus", "deepseek"];
|
|
225
|
+
const MODELS = ["", "mimo-v2.5", "deepseek-v4-flash", "deepseek-v4-pro", "deepseek-v3"];
|
|
226
|
+
const EFFORTS = ["", "low", "high", "max"];
|
|
227
|
+
const providerLabel = (v) => v === "" ? "\u8DDF\u968F Sisyphus" : v;
|
|
228
|
+
const modelLabel = (v) => v === "" ? "\u8DDF\u968F Sisyphus" : v;
|
|
229
|
+
const effortLabel = (v) => v === "" ? "\u8DDF\u968F\u6A21\u578B\u9ED8\u8BA4" : v;
|
|
230
|
+
const makeSelect = (value, options, labelFn, onChange) => React.createElement(
|
|
231
|
+
"select",
|
|
232
|
+
{ style: selectStyle, value: value ?? "", onChange: (e) => onChange(e.target.value) },
|
|
233
|
+
...options.map(
|
|
234
|
+
(opt) => React.createElement("option", { key: opt, value: opt }, labelFn(opt))
|
|
235
|
+
)
|
|
236
|
+
);
|
|
190
237
|
return React.createElement(
|
|
191
238
|
"div",
|
|
192
|
-
{ style: { padding: 16 } },
|
|
193
|
-
React.createElement("h2",
|
|
194
|
-
React.createElement("p",
|
|
195
|
-
|
|
239
|
+
{ style: { padding: 16, maxWidth: 600 } },
|
|
240
|
+
React.createElement("h2", { style: { margin: "0 0 4px" } }, "MyGO \u7F16\u6392\u914D\u7F6E"),
|
|
241
|
+
React.createElement("p", { style: { margin: "0 0 16px", fontSize: 13, color: "var(--text-secondary, #888)" } }, "\u6BCF\u4E2A\u5B50\u667A\u80FD\u4F53\u7684\u6A21\u578B / Provider / \u601D\u8003\u7A0B\u5EA6 / DSV4P0813 \u8865\u4E01\u5F00\u5173\u3002\u4FEE\u6539\u540E\u70B9\u4FDD\u5B58\uFF0C\u4E0B\u6B21\u6D3E\u53D1\u751F\u6548\u3002"),
|
|
242
|
+
...AGENT_TYPES.map((type) => {
|
|
243
|
+
const cfg = draft?.[type] || {};
|
|
244
|
+
return React.createElement(
|
|
245
|
+
"div",
|
|
246
|
+
{ key: type, style: cardStyle },
|
|
247
|
+
React.createElement("div", { style: { fontWeight: 600, marginBottom: 8 } }, AGENT_LABELS[type] || type),
|
|
248
|
+
React.createElement(
|
|
249
|
+
"div",
|
|
250
|
+
{ style: rowStyle },
|
|
251
|
+
React.createElement(
|
|
252
|
+
"div",
|
|
253
|
+
null,
|
|
254
|
+
React.createElement("div", { style: labelStyle }, "Provider"),
|
|
255
|
+
makeSelect(cfg.provider ?? "", PROVIDERS, providerLabel, (v) => set(type, "provider", v))
|
|
256
|
+
),
|
|
257
|
+
React.createElement(
|
|
258
|
+
"div",
|
|
259
|
+
null,
|
|
260
|
+
React.createElement("div", { style: labelStyle }, "Model"),
|
|
261
|
+
makeSelect(cfg.model ?? "", MODELS, modelLabel, (v) => set(type, "model", v))
|
|
262
|
+
)
|
|
263
|
+
),
|
|
264
|
+
React.createElement(
|
|
265
|
+
"div",
|
|
266
|
+
{ style: rowStyle },
|
|
267
|
+
React.createElement(
|
|
268
|
+
"div",
|
|
269
|
+
null,
|
|
270
|
+
React.createElement("div", { style: labelStyle }, "Reasoning Effort"),
|
|
271
|
+
makeSelect(cfg.reasoningEffort ?? "", EFFORTS, effortLabel, (v) => set(type, "reasoningEffort", v))
|
|
272
|
+
),
|
|
273
|
+
React.createElement(
|
|
274
|
+
"div",
|
|
275
|
+
{ style: { display: "flex", alignItems: "flex-end", gap: 8 } },
|
|
276
|
+
React.createElement(
|
|
277
|
+
"label",
|
|
278
|
+
{ style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13, paddingTop: 18 } },
|
|
279
|
+
React.createElement("input", { type: "checkbox", checked: cfg.dsv4p0813 === true, onChange: (e) => set(type, "dsv4p0813", e.target.checked) }),
|
|
280
|
+
"DSV4P0813"
|
|
281
|
+
)
|
|
282
|
+
)
|
|
283
|
+
)
|
|
284
|
+
);
|
|
285
|
+
}),
|
|
286
|
+
React.createElement(
|
|
287
|
+
"div",
|
|
288
|
+
{ style: { display: "flex", alignItems: "center", gap: 12, marginTop: 8 } },
|
|
289
|
+
React.createElement("button", {
|
|
290
|
+
onClick: save,
|
|
291
|
+
disabled: saving,
|
|
292
|
+
style: { padding: "6px 20px", borderRadius: 6, border: "none", background: "var(--brand, #0066ff)", color: "#fff", cursor: saving ? "wait" : "pointer", fontSize: 14 }
|
|
293
|
+
}, saving ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58"),
|
|
294
|
+
msg ? React.createElement("span", { style: { fontSize: 13, color: msg.startsWith("\u5DF2") ? "#4caf50" : "#f44336" } }, msg) : null
|
|
295
|
+
)
|
|
196
296
|
);
|
|
197
297
|
}
|
|
198
298
|
let lastJumpedTo = null;
|
package/dist/client.js
CHANGED
|
@@ -42,7 +42,9 @@ __export(client_exports, {
|
|
|
42
42
|
module.exports = __toCommonJS(client_exports);
|
|
43
43
|
var React = __toESM(require("react"), 1);
|
|
44
44
|
var name = "dsh-my-go";
|
|
45
|
-
var inject = ["slots"];
|
|
45
|
+
var inject = ["slots", "settingsScope"];
|
|
46
|
+
var AGENT_TYPES = ["sisyphus", "hermes", "explore", "librarian", "looker", "hephaestus", "prometheus", "oracle"];
|
|
47
|
+
var AGENT_LABELS = { sisyphus: "Sisyphus", hermes: "Hermes", explore: "Explore", librarian: "Librarian", looker: "Looker", hephaestus: "Hephaestus", prometheus: "Prometheus", oracle: "Oracle" };
|
|
46
48
|
function apply(ctx) {
|
|
47
49
|
const client = ctx;
|
|
48
50
|
const slots = client.get("slots");
|
|
@@ -187,17 +189,115 @@ function apply(ctx) {
|
|
|
187
189
|
style: { width: props && props.wide ? "100%" : 32, height: 32, border: "none", background: "transparent", cursor: "pointer" }
|
|
188
190
|
}, "\u{1F9ED}")
|
|
189
191
|
));
|
|
192
|
+
const scope = client.get("settingsScope") ? client.get("settingsScope").bind({ namespace: "dsh-my-go" }) : null;
|
|
190
193
|
slots.inject("settings.section", () => slots.register(
|
|
191
194
|
{ name: "settings.section", id: "dsh-my-go", order: 30, label: "MyGO \u7F16\u6392" },
|
|
192
|
-
(props) => React.createElement(SettingsPage, props)
|
|
195
|
+
(props) => React.createElement(SettingsPage, { ...props, scope })
|
|
193
196
|
));
|
|
194
|
-
function SettingsPage(
|
|
197
|
+
function SettingsPage({ scope: sp, close }) {
|
|
198
|
+
const [draft, setDraft] = React.useState(null);
|
|
199
|
+
const [saving, setSaving] = React.useState(false);
|
|
200
|
+
const [msg, setMsg] = React.useState(null);
|
|
201
|
+
React.useEffect(() => {
|
|
202
|
+
if (!sp) return;
|
|
203
|
+
try {
|
|
204
|
+
setDraft(sp.read());
|
|
205
|
+
} catch {
|
|
206
|
+
setDraft({});
|
|
207
|
+
}
|
|
208
|
+
}, [sp]);
|
|
209
|
+
if (!sp) return React.createElement("div", { style: { padding: 16, color: "#888" } }, "\u8BBE\u7F6E\u670D\u52A1\u4E0D\u53EF\u7528");
|
|
210
|
+
const set = (type, field, value) => {
|
|
211
|
+
setDraft((prev) => ({ ...prev, [type]: { ...prev?.[type], [field]: value } }));
|
|
212
|
+
};
|
|
213
|
+
const save = async () => {
|
|
214
|
+
setSaving(true);
|
|
215
|
+
setMsg(null);
|
|
216
|
+
try {
|
|
217
|
+
await sp.update(draft);
|
|
218
|
+
setMsg("\u5DF2\u4FDD\u5B58");
|
|
219
|
+
} catch (e) {
|
|
220
|
+
setMsg("\u4FDD\u5B58\u5931\u8D25: " + String(e));
|
|
221
|
+
} finally {
|
|
222
|
+
setSaving(false);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
const selectStyle = { background: "var(--surface, #1e1e1e)", color: "var(--text, #e0e0e0)", border: "1px solid var(--separator, #333)", borderRadius: 4, padding: "4px 8px", fontSize: 13, width: "100%", boxSizing: "border-box" };
|
|
226
|
+
const labelStyle = { fontSize: 12, color: "var(--text-secondary, #888)", marginBottom: 2 };
|
|
227
|
+
const cardStyle = { border: "1px solid var(--separator, #333)", borderRadius: 8, padding: 12, marginBottom: 12 };
|
|
228
|
+
const rowStyle = { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 8, marginBottom: 8 };
|
|
229
|
+
const PROVIDERS = ["", "octopus", "deepseek"];
|
|
230
|
+
const MODELS = ["", "mimo-v2.5", "deepseek-v4-flash", "deepseek-v4-pro", "deepseek-v3"];
|
|
231
|
+
const EFFORTS = ["", "low", "high", "max"];
|
|
232
|
+
const providerLabel = (v) => v === "" ? "\u8DDF\u968F Sisyphus" : v;
|
|
233
|
+
const modelLabel = (v) => v === "" ? "\u8DDF\u968F Sisyphus" : v;
|
|
234
|
+
const effortLabel = (v) => v === "" ? "\u8DDF\u968F\u6A21\u578B\u9ED8\u8BA4" : v;
|
|
235
|
+
const makeSelect = (value, options, labelFn, onChange) => React.createElement(
|
|
236
|
+
"select",
|
|
237
|
+
{ style: selectStyle, value: value ?? "", onChange: (e) => onChange(e.target.value) },
|
|
238
|
+
...options.map(
|
|
239
|
+
(opt) => React.createElement("option", { key: opt, value: opt }, labelFn(opt))
|
|
240
|
+
)
|
|
241
|
+
);
|
|
195
242
|
return React.createElement(
|
|
196
243
|
"div",
|
|
197
|
-
{ style: { padding: 16 } },
|
|
198
|
-
React.createElement("h2",
|
|
199
|
-
React.createElement("p",
|
|
200
|
-
|
|
244
|
+
{ style: { padding: 16, maxWidth: 600 } },
|
|
245
|
+
React.createElement("h2", { style: { margin: "0 0 4px" } }, "MyGO \u7F16\u6392\u914D\u7F6E"),
|
|
246
|
+
React.createElement("p", { style: { margin: "0 0 16px", fontSize: 13, color: "var(--text-secondary, #888)" } }, "\u6BCF\u4E2A\u5B50\u667A\u80FD\u4F53\u7684\u6A21\u578B / Provider / \u601D\u8003\u7A0B\u5EA6 / DSV4P0813 \u8865\u4E01\u5F00\u5173\u3002\u4FEE\u6539\u540E\u70B9\u4FDD\u5B58\uFF0C\u4E0B\u6B21\u6D3E\u53D1\u751F\u6548\u3002"),
|
|
247
|
+
...AGENT_TYPES.map((type) => {
|
|
248
|
+
const cfg = draft?.[type] || {};
|
|
249
|
+
return React.createElement(
|
|
250
|
+
"div",
|
|
251
|
+
{ key: type, style: cardStyle },
|
|
252
|
+
React.createElement("div", { style: { fontWeight: 600, marginBottom: 8 } }, AGENT_LABELS[type] || type),
|
|
253
|
+
React.createElement(
|
|
254
|
+
"div",
|
|
255
|
+
{ style: rowStyle },
|
|
256
|
+
React.createElement(
|
|
257
|
+
"div",
|
|
258
|
+
null,
|
|
259
|
+
React.createElement("div", { style: labelStyle }, "Provider"),
|
|
260
|
+
makeSelect(cfg.provider ?? "", PROVIDERS, providerLabel, (v) => set(type, "provider", v))
|
|
261
|
+
),
|
|
262
|
+
React.createElement(
|
|
263
|
+
"div",
|
|
264
|
+
null,
|
|
265
|
+
React.createElement("div", { style: labelStyle }, "Model"),
|
|
266
|
+
makeSelect(cfg.model ?? "", MODELS, modelLabel, (v) => set(type, "model", v))
|
|
267
|
+
)
|
|
268
|
+
),
|
|
269
|
+
React.createElement(
|
|
270
|
+
"div",
|
|
271
|
+
{ style: rowStyle },
|
|
272
|
+
React.createElement(
|
|
273
|
+
"div",
|
|
274
|
+
null,
|
|
275
|
+
React.createElement("div", { style: labelStyle }, "Reasoning Effort"),
|
|
276
|
+
makeSelect(cfg.reasoningEffort ?? "", EFFORTS, effortLabel, (v) => set(type, "reasoningEffort", v))
|
|
277
|
+
),
|
|
278
|
+
React.createElement(
|
|
279
|
+
"div",
|
|
280
|
+
{ style: { display: "flex", alignItems: "flex-end", gap: 8 } },
|
|
281
|
+
React.createElement(
|
|
282
|
+
"label",
|
|
283
|
+
{ style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13, paddingTop: 18 } },
|
|
284
|
+
React.createElement("input", { type: "checkbox", checked: cfg.dsv4p0813 === true, onChange: (e) => set(type, "dsv4p0813", e.target.checked) }),
|
|
285
|
+
"DSV4P0813"
|
|
286
|
+
)
|
|
287
|
+
)
|
|
288
|
+
)
|
|
289
|
+
);
|
|
290
|
+
}),
|
|
291
|
+
React.createElement(
|
|
292
|
+
"div",
|
|
293
|
+
{ style: { display: "flex", alignItems: "center", gap: 12, marginTop: 8 } },
|
|
294
|
+
React.createElement("button", {
|
|
295
|
+
onClick: save,
|
|
296
|
+
disabled: saving,
|
|
297
|
+
style: { padding: "6px 20px", borderRadius: 6, border: "none", background: "var(--brand, #0066ff)", color: "#fff", cursor: saving ? "wait" : "pointer", fontSize: 14 }
|
|
298
|
+
}, saving ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58"),
|
|
299
|
+
msg ? React.createElement("span", { style: { fontSize: 13, color: msg.startsWith("\u5DF2") ? "#4caf50" : "#f44336" } }, msg) : null
|
|
300
|
+
)
|
|
201
301
|
);
|
|
202
302
|
}
|
|
203
303
|
let lastJumpedTo = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-my-go",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "DSH plugin: Sisyphus agent orchestration — star topology, single-line blocking, 7 specialist sub-agents (Hermes/Explore/Librarian/Looker/Hephaestus/Prometheus/Oracle) with per-type model binding, go_work/continue/need_help/forward communication tools, Web UI tree panel and settings.",
|
|
5
5
|
"author": "daizihan233",
|
|
6
6
|
"license": "MIT",
|
package/src/client.js
CHANGED
|
@@ -20,7 +20,10 @@ import * as React from 'react'
|
|
|
20
20
|
|
|
21
21
|
export const name = 'dsh-my-go'
|
|
22
22
|
|
|
23
|
-
export const inject = ['slots']
|
|
23
|
+
export const inject = ['slots', 'settingsScope']
|
|
24
|
+
|
|
25
|
+
const AGENT_TYPES = ['sisyphus', 'hermes', 'explore', 'librarian', 'looker', 'hephaestus', 'prometheus', 'oracle']
|
|
26
|
+
const AGENT_LABELS = { sisyphus: 'Sisyphus', hermes: 'Hermes', explore: 'Explore', librarian: 'Librarian', looker: 'Looker', hephaestus: 'Hephaestus', prometheus: 'Prometheus', oracle: 'Oracle' }
|
|
24
27
|
|
|
25
28
|
export function apply(ctx) {
|
|
26
29
|
const client = ctx
|
|
@@ -164,16 +167,100 @@ export function apply(ctx) {
|
|
|
164
167
|
))
|
|
165
168
|
|
|
166
169
|
// ── settings page ───────────────────────────────────────────────────────
|
|
170
|
+
const scope = client.get('settingsScope')
|
|
171
|
+
? client.get('settingsScope').bind({ namespace: 'dsh-my-go' })
|
|
172
|
+
: null
|
|
173
|
+
|
|
167
174
|
slots.inject('settings.section', () => slots.register(
|
|
168
175
|
{ name: 'settings.section', id: 'dsh-my-go', order: 30, label: 'MyGO 编排' },
|
|
169
|
-
(props) => React.createElement(SettingsPage, props),
|
|
176
|
+
(props) => React.createElement(SettingsPage, { ...props, scope }),
|
|
170
177
|
))
|
|
171
178
|
|
|
172
|
-
function SettingsPage(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
179
|
+
function SettingsPage({ scope: sp, close }) {
|
|
180
|
+
const [draft, setDraft] = React.useState(null)
|
|
181
|
+
const [saving, setSaving] = React.useState(false)
|
|
182
|
+
const [msg, setMsg] = React.useState(null)
|
|
183
|
+
|
|
184
|
+
React.useEffect(() => {
|
|
185
|
+
if (!sp) return
|
|
186
|
+
try { setDraft(sp.read()) } catch { setDraft({}) }
|
|
187
|
+
}, [sp])
|
|
188
|
+
|
|
189
|
+
if (!sp) return React.createElement('div', { style: { padding: 16, color: '#888' } }, '设置服务不可用')
|
|
190
|
+
|
|
191
|
+
const set = (type, field, value) => {
|
|
192
|
+
setDraft((prev) => ({ ...prev, [type]: { ...prev?.[type], [field]: value } }))
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const save = async () => {
|
|
196
|
+
setSaving(true); setMsg(null)
|
|
197
|
+
try {
|
|
198
|
+
await sp.update(draft)
|
|
199
|
+
setMsg('已保存')
|
|
200
|
+
} catch (e) {
|
|
201
|
+
setMsg('保存失败: ' + String(e))
|
|
202
|
+
} finally { setSaving(false) }
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const selectStyle = { background: 'var(--surface, #1e1e1e)', color: 'var(--text, #e0e0e0)', border: '1px solid var(--separator, #333)', borderRadius: 4, padding: '4px 8px', fontSize: 13, width: '100%', boxSizing: 'border-box' }
|
|
206
|
+
const labelStyle = { fontSize: 12, color: 'var(--text-secondary, #888)', marginBottom: 2 }
|
|
207
|
+
const cardStyle = { border: '1px solid var(--separator, #333)', borderRadius: 8, padding: 12, marginBottom: 12 }
|
|
208
|
+
const rowStyle = { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8, marginBottom: 8 }
|
|
209
|
+
|
|
210
|
+
const PROVIDERS = ['', 'octopus', 'deepseek']
|
|
211
|
+
const MODELS = ['', 'mimo-v2.5', 'deepseek-v4-flash', 'deepseek-v4-pro', 'deepseek-v3']
|
|
212
|
+
const EFFORTS = ['', 'low', 'high', 'max']
|
|
213
|
+
|
|
214
|
+
const providerLabel = (v) => v === '' ? '跟随 Sisyphus' : v
|
|
215
|
+
const modelLabel = (v) => v === '' ? '跟随 Sisyphus' : v
|
|
216
|
+
const effortLabel = (v) => v === '' ? '跟随模型默认' : v
|
|
217
|
+
|
|
218
|
+
const makeSelect = (value, options, labelFn, onChange) =>
|
|
219
|
+
React.createElement('select', { style: selectStyle, value: value ?? '', onChange: (e) => onChange(e.target.value) },
|
|
220
|
+
...options.map((opt) =>
|
|
221
|
+
React.createElement('option', { key: opt, value: opt }, labelFn(opt))
|
|
222
|
+
)
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
return React.createElement('div', { style: { padding: 16, maxWidth: 600 } },
|
|
226
|
+
React.createElement('h2', { style: { margin: '0 0 4px' } }, 'MyGO 编排配置'),
|
|
227
|
+
React.createElement('p', { style: { margin: '0 0 16px', fontSize: 13, color: 'var(--text-secondary, #888)' } }, '每个子智能体的模型 / Provider / 思考程度 / DSV4P0813 补丁开关。修改后点保存,下次派发生效。'),
|
|
228
|
+
...AGENT_TYPES.map((type) => {
|
|
229
|
+
const cfg = draft?.[type] || {}
|
|
230
|
+
return React.createElement('div', { key: type, style: cardStyle },
|
|
231
|
+
React.createElement('div', { style: { fontWeight: 600, marginBottom: 8 } }, AGENT_LABELS[type] || type),
|
|
232
|
+
React.createElement('div', { style: rowStyle },
|
|
233
|
+
React.createElement('div', null,
|
|
234
|
+
React.createElement('div', { style: labelStyle }, 'Provider'),
|
|
235
|
+
makeSelect(cfg.provider ?? '', PROVIDERS, providerLabel, (v) => set(type, 'provider', v)),
|
|
236
|
+
),
|
|
237
|
+
React.createElement('div', null,
|
|
238
|
+
React.createElement('div', { style: labelStyle }, 'Model'),
|
|
239
|
+
makeSelect(cfg.model ?? '', MODELS, modelLabel, (v) => set(type, 'model', v)),
|
|
240
|
+
),
|
|
241
|
+
),
|
|
242
|
+
React.createElement('div', { style: rowStyle },
|
|
243
|
+
React.createElement('div', null,
|
|
244
|
+
React.createElement('div', { style: labelStyle }, 'Reasoning Effort'),
|
|
245
|
+
makeSelect(cfg.reasoningEffort ?? '', EFFORTS, effortLabel, (v) => set(type, 'reasoningEffort', v)),
|
|
246
|
+
),
|
|
247
|
+
React.createElement('div', { style: { display: 'flex', alignItems: 'flex-end', gap: 8 } },
|
|
248
|
+
React.createElement('label', { style: { display: 'flex', alignItems: 'center', gap: 6, cursor: 'pointer', fontSize: 13, paddingTop: 18 } },
|
|
249
|
+
React.createElement('input', { type: 'checkbox', checked: cfg.dsv4p0813 === true, onChange: (e) => set(type, 'dsv4p0813', e.target.checked) }),
|
|
250
|
+
'DSV4P0813',
|
|
251
|
+
),
|
|
252
|
+
),
|
|
253
|
+
),
|
|
254
|
+
)
|
|
255
|
+
}),
|
|
256
|
+
React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 12, marginTop: 8 } },
|
|
257
|
+
React.createElement('button', {
|
|
258
|
+
onClick: save,
|
|
259
|
+
disabled: saving,
|
|
260
|
+
style: { padding: '6px 20px', borderRadius: 6, border: 'none', background: 'var(--brand, #0066ff)', color: '#fff', cursor: saving ? 'wait' : 'pointer', fontSize: 14 },
|
|
261
|
+
}, saving ? '保存中…' : '保存'),
|
|
262
|
+
msg ? React.createElement('span', { style: { fontSize: 13, color: msg.startsWith('已') ? '#4caf50' : '#f44336' } }, msg) : null,
|
|
263
|
+
),
|
|
177
264
|
)
|
|
178
265
|
}
|
|
179
266
|
|