@ceasarxuu/dsh-agent-team 0.0.0-stage → 0.2.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/LICENSE +22 -0
- package/README.md +64 -2
- package/cordis.patch.yml +3 -0
- package/lib/client.js +1444 -0
- package/lib/index.js +751 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +479 -0
- package/lib/typert.remote-client.d.ts +43 -0
- package/lib/typert.remote-client.d.ts.map +1 -0
- package/lib/typert.remote-client.js +468 -0
- package/lib/types/client/RoleEditor.d.ts +14 -0
- package/lib/types/client/SessionTemplatePicker.d.ts +20 -0
- package/lib/types/client/TeamSettings.d.ts +15 -0
- package/lib/types/client/copy.d.ts +53 -0
- package/lib/types/client/index.d.ts +3 -0
- package/lib/types/client/styles.d.ts +1 -0
- package/lib/types/host/admission.d.ts +10 -0
- package/lib/types/host/runtime.d.ts +28 -0
- package/lib/types/host/store.d.ts +48 -0
- package/lib/types/host/tool-policy.d.ts +3 -0
- package/lib/types/index.d.ts +16 -0
- package/lib/types/remote.d.ts +32 -0
- package/lib/types/shared/config.d.ts +5 -0
- package/lib/types/shared/prompts.d.ts +3 -0
- package/lib/types/shared/types.d.ts +42 -0
- package/lib/types/types.d.ts +1 -0
- package/lib/types.js +0 -0
- package/package.json +115 -4
package/lib/client.js
ADDED
|
@@ -0,0 +1,1444 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: "@ceasarxuu/dsh-agent-team",
|
|
3
|
+
factory: (require) => {
|
|
4
|
+
var module = { exports: {} };
|
|
5
|
+
var exports = module.exports;
|
|
6
|
+
"use strict";
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
|
|
25
|
+
// src/client/index.ts
|
|
26
|
+
var index_exports = {};
|
|
27
|
+
__export(index_exports, {
|
|
28
|
+
apply: () => apply,
|
|
29
|
+
inject: () => inject
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(index_exports);
|
|
32
|
+
|
|
33
|
+
// lib/typert.remote-client.js
|
|
34
|
+
var import_zod = require("zod");
|
|
35
|
+
|
|
36
|
+
// ../../../../../node_modules/.pnpm/@deepseek-ai+dsh-typert-protocol@0.2.2-rc.5_@deepseek-ai+cordis@4.1.0/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-info.js
|
|
37
|
+
function createTypertRemoteInfo(spec, zod) {
|
|
38
|
+
return new RemoteInfo(spec, zod);
|
|
39
|
+
}
|
|
40
|
+
var RemoteInfo = class {
|
|
41
|
+
spec;
|
|
42
|
+
zod;
|
|
43
|
+
index;
|
|
44
|
+
constructor(spec, zod) {
|
|
45
|
+
this.spec = spec;
|
|
46
|
+
this.zod = zod;
|
|
47
|
+
}
|
|
48
|
+
get package() {
|
|
49
|
+
return this.spec.package;
|
|
50
|
+
}
|
|
51
|
+
get descriptors() {
|
|
52
|
+
return this.resolve().descriptors;
|
|
53
|
+
}
|
|
54
|
+
get methods() {
|
|
55
|
+
return this.resolve().methods;
|
|
56
|
+
}
|
|
57
|
+
resolve() {
|
|
58
|
+
if (this.index !== void 0)
|
|
59
|
+
return this.index;
|
|
60
|
+
const zod = this.zod;
|
|
61
|
+
const descriptors = [];
|
|
62
|
+
const methods = /* @__PURE__ */ Object.create(null);
|
|
63
|
+
for (const [endpoint, definition] of Object.entries(this.spec.methods)) {
|
|
64
|
+
const separator = endpoint.indexOf("/");
|
|
65
|
+
const namespace = endpoint.slice(0, separator);
|
|
66
|
+
const method = endpoint.slice(separator + 1);
|
|
67
|
+
const parameters = definition.parameters.map((parameter) => ({ ...parameter, wire: parameter.wire ?? parameter.name }));
|
|
68
|
+
const descriptor = {
|
|
69
|
+
...definition,
|
|
70
|
+
id: `${this.spec.package}#${endpoint}`,
|
|
71
|
+
namespace,
|
|
72
|
+
method,
|
|
73
|
+
parameters,
|
|
74
|
+
result: definition.result.description === void 0 ? definition.result : new ResultValue(definition.result)
|
|
75
|
+
};
|
|
76
|
+
if (definition.invocation.kind === "direct") {
|
|
77
|
+
const inputs = [];
|
|
78
|
+
const direct = Object.assign(descriptor, {
|
|
79
|
+
input(options) {
|
|
80
|
+
const strict = options?.strict === true;
|
|
81
|
+
return inputs[strict ? 1 : 0] ??= new NamedInput(parameters, strict, zod);
|
|
82
|
+
},
|
|
83
|
+
invoke(remote, input, signal) {
|
|
84
|
+
const named = input;
|
|
85
|
+
const values = parameters.map((parameter) => named[parameter.wire]);
|
|
86
|
+
if (definition.cancellation !== void 0)
|
|
87
|
+
values.push(signal);
|
|
88
|
+
const receiver = Reflect.get(remote, namespace);
|
|
89
|
+
const call = Reflect.get(receiver, method);
|
|
90
|
+
return call.apply(receiver, values);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
methods[endpoint] = direct;
|
|
94
|
+
}
|
|
95
|
+
descriptors.push(descriptor);
|
|
96
|
+
}
|
|
97
|
+
return this.index = { descriptors, methods };
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
function optional(parameter) {
|
|
101
|
+
return parameter.source === "json" && parameter.acceptsUndefined === true;
|
|
102
|
+
}
|
|
103
|
+
var NamedInput = class {
|
|
104
|
+
parameters;
|
|
105
|
+
strict;
|
|
106
|
+
zod;
|
|
107
|
+
schema;
|
|
108
|
+
projection;
|
|
109
|
+
constructor(parameters, strict, zod) {
|
|
110
|
+
this.parameters = parameters;
|
|
111
|
+
this.strict = strict;
|
|
112
|
+
this.zod = zod;
|
|
113
|
+
}
|
|
114
|
+
codec(parameter) {
|
|
115
|
+
return this.strict ? parameter.strictCodec : parameter.codec;
|
|
116
|
+
}
|
|
117
|
+
create = () => this.schema ??= this.zod.strictObject(Object.fromEntries(this.parameters.map((parameter) => {
|
|
118
|
+
const value2 = this.codec(parameter).create();
|
|
119
|
+
return [parameter.wire, optional(parameter) ? value2.optional() : value2.nonoptional()];
|
|
120
|
+
})));
|
|
121
|
+
get jsonSchema() {
|
|
122
|
+
return this.project().jsonSchema;
|
|
123
|
+
}
|
|
124
|
+
get jsonSchemaError() {
|
|
125
|
+
return this.project().jsonSchemaError;
|
|
126
|
+
}
|
|
127
|
+
project() {
|
|
128
|
+
if (this.projection !== void 0)
|
|
129
|
+
return this.projection;
|
|
130
|
+
const unavailable = this.parameters.find((parameter) => this.codec(parameter).jsonSchema === void 0);
|
|
131
|
+
if (unavailable !== void 0) {
|
|
132
|
+
return this.projection = { jsonSchemaError: this.codec(unavailable).jsonSchemaError ?? `No JSON Schema for parameter ${unavailable.wire}` };
|
|
133
|
+
}
|
|
134
|
+
return this.projection = {
|
|
135
|
+
jsonSchema: {
|
|
136
|
+
type: "object",
|
|
137
|
+
properties: Object.fromEntries(this.parameters.map((parameter) => [parameter.wire, {
|
|
138
|
+
...this.codec(parameter).jsonSchema,
|
|
139
|
+
...parameter.description === void 0 ? {} : { description: parameter.description }
|
|
140
|
+
}])),
|
|
141
|
+
required: this.parameters.filter((parameter) => !optional(parameter)).map((parameter) => parameter.wire),
|
|
142
|
+
additionalProperties: false
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
var ResultValue = class {
|
|
148
|
+
spec;
|
|
149
|
+
projection;
|
|
150
|
+
constructor(spec) {
|
|
151
|
+
this.spec = spec;
|
|
152
|
+
}
|
|
153
|
+
get mode() {
|
|
154
|
+
return this.spec.mode;
|
|
155
|
+
}
|
|
156
|
+
get typeSymbol() {
|
|
157
|
+
return this.spec.typeSymbol;
|
|
158
|
+
}
|
|
159
|
+
get create() {
|
|
160
|
+
return this.spec.create;
|
|
161
|
+
}
|
|
162
|
+
get decode() {
|
|
163
|
+
return this.spec.decode;
|
|
164
|
+
}
|
|
165
|
+
get encode() {
|
|
166
|
+
return this.spec.encode;
|
|
167
|
+
}
|
|
168
|
+
get description() {
|
|
169
|
+
return this.spec.description;
|
|
170
|
+
}
|
|
171
|
+
get jsonSchemaError() {
|
|
172
|
+
return this.spec.jsonSchemaError;
|
|
173
|
+
}
|
|
174
|
+
get jsonSchema() {
|
|
175
|
+
if (this.projection === void 0) {
|
|
176
|
+
const schema = this.spec.jsonSchema;
|
|
177
|
+
this.projection = { value: schema === void 0 ? void 0 : { ...schema, description: this.spec.description } };
|
|
178
|
+
}
|
|
179
|
+
return this.projection.value;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// lib/typert.remote-client.js
|
|
184
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_0$schema$value;
|
|
185
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_0$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_0$schema$value ??= import_zod.z.string();
|
|
186
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_1$schema$value;
|
|
187
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_1$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_1$schema$value ??= import_zod.z.number();
|
|
188
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_result$schema$value;
|
|
189
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_result$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_result$schema$value ??= import_zod.z.boolean();
|
|
190
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_0$schema$value;
|
|
191
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_0$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_0$schema$value ??= import_zod.z.string();
|
|
192
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_1$schema$value;
|
|
193
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_1$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_1$schema$value ??= import_zod.z.number();
|
|
194
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_2$schema$value;
|
|
195
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_2$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_2$schema$value ??= import_zod.z.string();
|
|
196
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_result$schema$value;
|
|
197
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_result$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_launch_result$schema$value ??= import_zod.z.string();
|
|
198
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_list_result$schema$value;
|
|
199
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_list_result$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_list_result$schema$value ??= import_zod.z.array(import_zod.z.object({
|
|
200
|
+
"id": import_zod.z.string(),
|
|
201
|
+
"revision": import_zod.z.number(),
|
|
202
|
+
"name": import_zod.z.string(),
|
|
203
|
+
"roles": import_zod.z.array(import_zod.z.object({
|
|
204
|
+
"id": import_zod.z.string(),
|
|
205
|
+
"kind": import_zod.z.union([import_zod.z.literal("commander"), import_zod.z.literal("worker"), import_zod.z.literal("reviewer"), import_zod.z.literal("custom")]),
|
|
206
|
+
"name": import_zod.z.string(),
|
|
207
|
+
"description": import_zod.z.string(),
|
|
208
|
+
"model": import_zod.z.union([import_zod.z.literal(null), import_zod.z.object({
|
|
209
|
+
"provider": import_zod.z.string(),
|
|
210
|
+
"model": import_zod.z.string()
|
|
211
|
+
})]),
|
|
212
|
+
"maxInstances": import_zod.z.number(),
|
|
213
|
+
"promptOverride": import_zod.z.union([import_zod.z.literal(null), import_zod.z.string()]),
|
|
214
|
+
"preferredSkills": import_zod.z.array(import_zod.z.string())
|
|
215
|
+
}))
|
|
216
|
+
}));
|
|
217
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_listForSession_parameter_0$schema$value;
|
|
218
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_listForSession_parameter_0$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_listForSession_parameter_0$schema$value ??= import_zod.z.string();
|
|
219
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_listForSession_result$schema$value;
|
|
220
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_listForSession_result$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_listForSession_result$schema$value ??= import_zod.z.object({
|
|
221
|
+
"active": import_zod.z.union([import_zod.z.literal(null), import_zod.z.object({
|
|
222
|
+
"id": import_zod.z.string(),
|
|
223
|
+
"revision": import_zod.z.number(),
|
|
224
|
+
"name": import_zod.z.string(),
|
|
225
|
+
"assignment": import_zod.z.string()
|
|
226
|
+
})]),
|
|
227
|
+
"templates": import_zod.z.array(import_zod.z.object({
|
|
228
|
+
"id": import_zod.z.string(),
|
|
229
|
+
"revision": import_zod.z.number(),
|
|
230
|
+
"name": import_zod.z.string(),
|
|
231
|
+
"roles": import_zod.z.array(import_zod.z.object({
|
|
232
|
+
"id": import_zod.z.string(),
|
|
233
|
+
"kind": import_zod.z.union([import_zod.z.literal("commander"), import_zod.z.literal("worker"), import_zod.z.literal("reviewer"), import_zod.z.literal("custom")]),
|
|
234
|
+
"name": import_zod.z.string(),
|
|
235
|
+
"description": import_zod.z.string(),
|
|
236
|
+
"model": import_zod.z.union([import_zod.z.literal(null), import_zod.z.object({
|
|
237
|
+
"provider": import_zod.z.string(),
|
|
238
|
+
"model": import_zod.z.string()
|
|
239
|
+
})]),
|
|
240
|
+
"maxInstances": import_zod.z.number(),
|
|
241
|
+
"promptOverride": import_zod.z.union([import_zod.z.literal(null), import_zod.z.string()]),
|
|
242
|
+
"preferredSkills": import_zod.z.array(import_zod.z.string())
|
|
243
|
+
}))
|
|
244
|
+
}))
|
|
245
|
+
});
|
|
246
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_save_parameter_0$schema$value;
|
|
247
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_save_parameter_0$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_save_parameter_0$schema$value ??= import_zod.z.object({
|
|
248
|
+
"id": import_zod.z.union([import_zod.z.literal(null), import_zod.z.string()]),
|
|
249
|
+
"revision": import_zod.z.number(),
|
|
250
|
+
"name": import_zod.z.string(),
|
|
251
|
+
"roles": import_zod.z.array(import_zod.z.object({
|
|
252
|
+
"id": import_zod.z.string(),
|
|
253
|
+
"kind": import_zod.z.union([import_zod.z.literal("commander"), import_zod.z.literal("worker"), import_zod.z.literal("reviewer"), import_zod.z.literal("custom")]),
|
|
254
|
+
"name": import_zod.z.string(),
|
|
255
|
+
"description": import_zod.z.string(),
|
|
256
|
+
"model": import_zod.z.union([import_zod.z.literal(null), import_zod.z.object({
|
|
257
|
+
"provider": import_zod.z.string(),
|
|
258
|
+
"model": import_zod.z.string()
|
|
259
|
+
})]),
|
|
260
|
+
"maxInstances": import_zod.z.number(),
|
|
261
|
+
"promptOverride": import_zod.z.union([import_zod.z.literal(null), import_zod.z.string()]),
|
|
262
|
+
"preferredSkills": import_zod.z.array(import_zod.z.string())
|
|
263
|
+
}))
|
|
264
|
+
});
|
|
265
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_save_result$schema$value;
|
|
266
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_save_result$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_save_result$schema$value ??= import_zod.z.object({
|
|
267
|
+
"id": import_zod.z.string(),
|
|
268
|
+
"revision": import_zod.z.number(),
|
|
269
|
+
"name": import_zod.z.string(),
|
|
270
|
+
"roles": import_zod.z.array(import_zod.z.object({
|
|
271
|
+
"id": import_zod.z.string(),
|
|
272
|
+
"kind": import_zod.z.union([import_zod.z.literal("commander"), import_zod.z.literal("worker"), import_zod.z.literal("reviewer"), import_zod.z.literal("custom")]),
|
|
273
|
+
"name": import_zod.z.string(),
|
|
274
|
+
"description": import_zod.z.string(),
|
|
275
|
+
"model": import_zod.z.union([import_zod.z.literal(null), import_zod.z.object({
|
|
276
|
+
"provider": import_zod.z.string(),
|
|
277
|
+
"model": import_zod.z.string()
|
|
278
|
+
})]),
|
|
279
|
+
"maxInstances": import_zod.z.number(),
|
|
280
|
+
"promptOverride": import_zod.z.union([import_zod.z.literal(null), import_zod.z.string()]),
|
|
281
|
+
"preferredSkills": import_zod.z.array(import_zod.z.string())
|
|
282
|
+
}))
|
|
283
|
+
});
|
|
284
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_skills_parameter_0$schema$value;
|
|
285
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_skills_parameter_0$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_skills_parameter_0$schema$value ??= import_zod.z.union([import_zod.z.literal(null), import_zod.z.string()]);
|
|
286
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_skills_result$schema$value;
|
|
287
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_skills_result$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_skills_result$schema$value ??= import_zod.z.array(import_zod.z.object({
|
|
288
|
+
"name": import_zod.z.string(),
|
|
289
|
+
"description": import_zod.z.string()
|
|
290
|
+
}));
|
|
291
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_0$schema$value;
|
|
292
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_0$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_0$schema$value ??= import_zod.z.string();
|
|
293
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_1$schema$value;
|
|
294
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_1$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_1$schema$value ??= import_zod.z.union([import_zod.z.literal(null), import_zod.z.string()]);
|
|
295
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_2$schema$value;
|
|
296
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_2$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_2$schema$value ??= import_zod.z.union([import_zod.z.literal(null), import_zod.z.object({
|
|
297
|
+
"id": import_zod.z.string(),
|
|
298
|
+
"revision": import_zod.z.number()
|
|
299
|
+
})]);
|
|
300
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_result$schema$value;
|
|
301
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_result$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_result$schema$value ??= import_zod.z.object({
|
|
302
|
+
"active": import_zod.z.union([import_zod.z.literal(null), import_zod.z.object({
|
|
303
|
+
"id": import_zod.z.string(),
|
|
304
|
+
"revision": import_zod.z.number(),
|
|
305
|
+
"name": import_zod.z.string(),
|
|
306
|
+
"assignment": import_zod.z.string()
|
|
307
|
+
})]),
|
|
308
|
+
"templates": import_zod.z.array(import_zod.z.object({
|
|
309
|
+
"id": import_zod.z.string(),
|
|
310
|
+
"revision": import_zod.z.number(),
|
|
311
|
+
"name": import_zod.z.string(),
|
|
312
|
+
"roles": import_zod.z.array(import_zod.z.object({
|
|
313
|
+
"id": import_zod.z.string(),
|
|
314
|
+
"kind": import_zod.z.union([import_zod.z.literal("commander"), import_zod.z.literal("worker"), import_zod.z.literal("reviewer"), import_zod.z.literal("custom")]),
|
|
315
|
+
"name": import_zod.z.string(),
|
|
316
|
+
"description": import_zod.z.string(),
|
|
317
|
+
"model": import_zod.z.union([import_zod.z.literal(null), import_zod.z.object({
|
|
318
|
+
"provider": import_zod.z.string(),
|
|
319
|
+
"model": import_zod.z.string()
|
|
320
|
+
})]),
|
|
321
|
+
"maxInstances": import_zod.z.number(),
|
|
322
|
+
"promptOverride": import_zod.z.union([import_zod.z.literal(null), import_zod.z.string()]),
|
|
323
|
+
"preferredSkills": import_zod.z.array(import_zod.z.string())
|
|
324
|
+
}))
|
|
325
|
+
}))
|
|
326
|
+
});
|
|
327
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_0_strict$schema$value;
|
|
328
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_0_strict$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_0_strict$schema$value ??= import_zod.z.string();
|
|
329
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_1_strict$schema$value;
|
|
330
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_1_strict$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_1_strict$schema$value ??= import_zod.z.number();
|
|
331
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_0_strict$schema$value;
|
|
332
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_0_strict$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_0_strict$schema$value ??= import_zod.z.string();
|
|
333
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_1_strict$schema$value;
|
|
334
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_1_strict$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_1_strict$schema$value ??= import_zod.z.number();
|
|
335
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_2_strict$schema$value;
|
|
336
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_2_strict$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_2_strict$schema$value ??= import_zod.z.string();
|
|
337
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_listForSession_parameter_0_strict$schema$value;
|
|
338
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_listForSession_parameter_0_strict$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_listForSession_parameter_0_strict$schema$value ??= import_zod.z.string();
|
|
339
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_save_parameter_0_strict$schema$value;
|
|
340
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_save_parameter_0_strict$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_save_parameter_0_strict$schema$value ??= import_zod.z.strictObject({
|
|
341
|
+
"id": import_zod.z.union([import_zod.z.literal(null), import_zod.z.string()]),
|
|
342
|
+
"revision": import_zod.z.number(),
|
|
343
|
+
"name": import_zod.z.string(),
|
|
344
|
+
"roles": import_zod.z.array(import_zod.z.strictObject({
|
|
345
|
+
"id": import_zod.z.string(),
|
|
346
|
+
"kind": import_zod.z.union([import_zod.z.literal("commander"), import_zod.z.literal("worker"), import_zod.z.literal("reviewer"), import_zod.z.literal("custom")]),
|
|
347
|
+
"name": import_zod.z.string(),
|
|
348
|
+
"description": import_zod.z.string(),
|
|
349
|
+
"model": import_zod.z.union([import_zod.z.literal(null), import_zod.z.strictObject({
|
|
350
|
+
"provider": import_zod.z.string(),
|
|
351
|
+
"model": import_zod.z.string()
|
|
352
|
+
})]),
|
|
353
|
+
"maxInstances": import_zod.z.number(),
|
|
354
|
+
"promptOverride": import_zod.z.union([import_zod.z.literal(null), import_zod.z.string()]),
|
|
355
|
+
"preferredSkills": import_zod.z.array(import_zod.z.string())
|
|
356
|
+
}))
|
|
357
|
+
});
|
|
358
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_skills_parameter_0_strict$schema$value;
|
|
359
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_skills_parameter_0_strict$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_skills_parameter_0_strict$schema$value ??= import_zod.z.union([import_zod.z.literal(null), import_zod.z.string()]);
|
|
360
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_0_strict$schema$value;
|
|
361
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_0_strict$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_0_strict$schema$value ??= import_zod.z.string();
|
|
362
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_1_strict$schema$value;
|
|
363
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_1_strict$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_1_strict$schema$value ??= import_zod.z.union([import_zod.z.literal(null), import_zod.z.string()]);
|
|
364
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_2_strict$schema$value;
|
|
365
|
+
var _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_2_strict$schema = () => _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_2_strict$schema$value ??= import_zod.z.union([import_zod.z.literal(null), import_zod.z.strictObject({
|
|
366
|
+
"id": import_zod.z.string(),
|
|
367
|
+
"revision": import_zod.z.number()
|
|
368
|
+
})]);
|
|
369
|
+
var TYPERT_REMOTE = createTypertRemoteInfo({
|
|
370
|
+
package: "@ceasarxuu/dsh-agent-team",
|
|
371
|
+
methods: {
|
|
372
|
+
"teamConfig/deleteTemplate": {
|
|
373
|
+
service: "teamConfig",
|
|
374
|
+
invocation: { kind: "direct" },
|
|
375
|
+
parameters: [
|
|
376
|
+
{
|
|
377
|
+
name: "teamId",
|
|
378
|
+
source: "json",
|
|
379
|
+
codec: {
|
|
380
|
+
mode: "strict",
|
|
381
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/deleteTemplate:teamId",
|
|
382
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_0$schema,
|
|
383
|
+
jsonSchema: { "type": "string" }
|
|
384
|
+
},
|
|
385
|
+
strictCodec: {
|
|
386
|
+
mode: "strict",
|
|
387
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/deleteTemplate:teamId",
|
|
388
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_0_strict$schema,
|
|
389
|
+
jsonSchema: { "type": "string" }
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
name: "revision",
|
|
394
|
+
source: "json",
|
|
395
|
+
codec: {
|
|
396
|
+
mode: "strict",
|
|
397
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/deleteTemplate:revision",
|
|
398
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_1$schema,
|
|
399
|
+
jsonSchema: { "type": "number" }
|
|
400
|
+
},
|
|
401
|
+
strictCodec: {
|
|
402
|
+
mode: "strict",
|
|
403
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/deleteTemplate:revision",
|
|
404
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_parameter_1_strict$schema,
|
|
405
|
+
jsonSchema: { "type": "number" }
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
],
|
|
409
|
+
result: {
|
|
410
|
+
mode: "strict",
|
|
411
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/deleteTemplate:result",
|
|
412
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_deleteTemplate_result$schema,
|
|
413
|
+
jsonSchema: { "type": "boolean" }
|
|
414
|
+
},
|
|
415
|
+
sourceLocation: { "file": "packages/@ceasarxuu/dsh-agent-team/src/remote.ts", "line": 43, "column": 3 }
|
|
416
|
+
},
|
|
417
|
+
"teamConfig/launch": {
|
|
418
|
+
service: "teamConfig",
|
|
419
|
+
invocation: { kind: "direct" },
|
|
420
|
+
parameters: [
|
|
421
|
+
{
|
|
422
|
+
name: "teamId",
|
|
423
|
+
source: "json",
|
|
424
|
+
codec: {
|
|
425
|
+
mode: "strict",
|
|
426
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/launch:teamId",
|
|
427
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_0$schema,
|
|
428
|
+
jsonSchema: { "type": "string" }
|
|
429
|
+
},
|
|
430
|
+
strictCodec: {
|
|
431
|
+
mode: "strict",
|
|
432
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/launch:teamId",
|
|
433
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_0_strict$schema,
|
|
434
|
+
jsonSchema: { "type": "string" }
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
name: "revision",
|
|
439
|
+
source: "json",
|
|
440
|
+
codec: {
|
|
441
|
+
mode: "strict",
|
|
442
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/launch:revision",
|
|
443
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_1$schema,
|
|
444
|
+
jsonSchema: { "type": "number" }
|
|
445
|
+
},
|
|
446
|
+
strictCodec: {
|
|
447
|
+
mode: "strict",
|
|
448
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/launch:revision",
|
|
449
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_1_strict$schema,
|
|
450
|
+
jsonSchema: { "type": "number" }
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
name: "workspaceId",
|
|
455
|
+
source: "json",
|
|
456
|
+
codec: {
|
|
457
|
+
mode: "strict",
|
|
458
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/launch:workspaceId",
|
|
459
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_2$schema,
|
|
460
|
+
jsonSchema: { "type": "string" }
|
|
461
|
+
},
|
|
462
|
+
strictCodec: {
|
|
463
|
+
mode: "strict",
|
|
464
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/launch:workspaceId",
|
|
465
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_launch_parameter_2_strict$schema,
|
|
466
|
+
jsonSchema: { "type": "string" }
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
],
|
|
470
|
+
cancellation: { parameter: "signal" },
|
|
471
|
+
result: {
|
|
472
|
+
mode: "strict",
|
|
473
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/launch:result",
|
|
474
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_launch_result$schema,
|
|
475
|
+
jsonSchema: { "type": "string" }
|
|
476
|
+
},
|
|
477
|
+
sourceLocation: { "file": "packages/@ceasarxuu/dsh-agent-team/src/remote.ts", "line": 53, "column": 3 }
|
|
478
|
+
},
|
|
479
|
+
"teamConfig/list": {
|
|
480
|
+
service: "teamConfig",
|
|
481
|
+
invocation: { kind: "direct" },
|
|
482
|
+
parameters: [],
|
|
483
|
+
result: {
|
|
484
|
+
mode: "strict",
|
|
485
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/list:result",
|
|
486
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_list_result$schema,
|
|
487
|
+
jsonSchema: { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "revision": { "type": "number" }, "name": { "type": "string" }, "roles": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "kind": { "type": "string", "enum": ["commander", "worker", "reviewer", "custom"] }, "name": { "type": "string" }, "description": { "type": "string" }, "model": { "oneOf": [{ "type": "null", "const": null }, { "type": "object", "properties": { "provider": { "type": "string" }, "model": { "type": "string" } }, "required": ["provider", "model"], "additionalProperties": true }] }, "maxInstances": { "type": "number" }, "promptOverride": { "oneOf": [{ "type": "null", "const": null }, { "type": "string" }] }, "preferredSkills": { "type": "array", "items": { "type": "string" } } }, "required": ["id", "kind", "name", "description", "model", "maxInstances", "promptOverride", "preferredSkills"], "additionalProperties": true } } }, "required": ["id", "revision", "name", "roles"], "additionalProperties": true } }
|
|
488
|
+
},
|
|
489
|
+
sourceLocation: { "file": "packages/@ceasarxuu/dsh-agent-team/src/remote.ts", "line": 28, "column": 3 }
|
|
490
|
+
},
|
|
491
|
+
"teamConfig/listForSession": {
|
|
492
|
+
service: "teamConfig",
|
|
493
|
+
invocation: { kind: "direct" },
|
|
494
|
+
parameters: [
|
|
495
|
+
{
|
|
496
|
+
name: "rootSessionId",
|
|
497
|
+
source: "json",
|
|
498
|
+
codec: {
|
|
499
|
+
mode: "strict",
|
|
500
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/listForSession:rootSessionId",
|
|
501
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_listForSession_parameter_0$schema,
|
|
502
|
+
jsonSchema: { "type": "string" }
|
|
503
|
+
},
|
|
504
|
+
strictCodec: {
|
|
505
|
+
mode: "strict",
|
|
506
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/listForSession:rootSessionId",
|
|
507
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_listForSession_parameter_0_strict$schema,
|
|
508
|
+
jsonSchema: { "type": "string" }
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
],
|
|
512
|
+
result: {
|
|
513
|
+
mode: "strict",
|
|
514
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team/types#SessionTeams",
|
|
515
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_listForSession_result$schema,
|
|
516
|
+
jsonSchema: { "type": "object", "properties": { "active": { "oneOf": [{ "type": "null", "const": null }, { "type": "object", "properties": { "id": { "type": "string" }, "revision": { "type": "number" }, "name": { "type": "string" }, "assignment": { "type": "string" } }, "required": ["id", "revision", "name", "assignment"], "additionalProperties": true }] }, "templates": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "revision": { "type": "number" }, "name": { "type": "string" }, "roles": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "kind": { "type": "string", "enum": ["commander", "worker", "reviewer", "custom"] }, "name": { "type": "string" }, "description": { "type": "string" }, "model": { "oneOf": [{ "type": "null", "const": null }, { "type": "object", "properties": { "provider": { "type": "string" }, "model": { "type": "string" } }, "required": ["provider", "model"], "additionalProperties": true }] }, "maxInstances": { "type": "number" }, "promptOverride": { "oneOf": [{ "type": "null", "const": null }, { "type": "string" }] }, "preferredSkills": { "type": "array", "items": { "type": "string" } } }, "required": ["id", "kind", "name", "description", "model", "maxInstances", "promptOverride", "preferredSkills"], "additionalProperties": true } } }, "required": ["id", "revision", "name", "roles"], "additionalProperties": true } } }, "required": ["active", "templates"], "additionalProperties": true }
|
|
517
|
+
},
|
|
518
|
+
sourceLocation: { "file": "packages/@ceasarxuu/dsh-agent-team/src/remote.ts", "line": 33, "column": 3 }
|
|
519
|
+
},
|
|
520
|
+
"teamConfig/save": {
|
|
521
|
+
service: "teamConfig",
|
|
522
|
+
invocation: { kind: "direct" },
|
|
523
|
+
parameters: [
|
|
524
|
+
{
|
|
525
|
+
name: "draft",
|
|
526
|
+
source: "json",
|
|
527
|
+
codec: {
|
|
528
|
+
mode: "strict",
|
|
529
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team/types#TeamDraft",
|
|
530
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_save_parameter_0$schema,
|
|
531
|
+
jsonSchema: { "type": "object", "properties": { "id": { "oneOf": [{ "type": "null", "const": null }, { "type": "string" }] }, "revision": { "type": "number" }, "name": { "type": "string" }, "roles": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "kind": { "type": "string", "enum": ["commander", "worker", "reviewer", "custom"] }, "name": { "type": "string" }, "description": { "type": "string" }, "model": { "oneOf": [{ "type": "null", "const": null }, { "type": "object", "properties": { "provider": { "type": "string" }, "model": { "type": "string" } }, "required": ["provider", "model"], "additionalProperties": true }] }, "maxInstances": { "type": "number" }, "promptOverride": { "oneOf": [{ "type": "null", "const": null }, { "type": "string" }] }, "preferredSkills": { "type": "array", "items": { "type": "string" } } }, "required": ["id", "kind", "name", "description", "model", "maxInstances", "promptOverride", "preferredSkills"], "additionalProperties": true } } }, "required": ["id", "revision", "name", "roles"], "additionalProperties": true }
|
|
532
|
+
},
|
|
533
|
+
strictCodec: {
|
|
534
|
+
mode: "strict",
|
|
535
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team/types#TeamDraft",
|
|
536
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_save_parameter_0_strict$schema,
|
|
537
|
+
jsonSchema: { "type": "object", "properties": { "id": { "oneOf": [{ "type": "null", "const": null }, { "type": "string" }] }, "revision": { "type": "number" }, "name": { "type": "string" }, "roles": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "kind": { "type": "string", "enum": ["commander", "worker", "reviewer", "custom"] }, "name": { "type": "string" }, "description": { "type": "string" }, "model": { "oneOf": [{ "type": "null", "const": null }, { "type": "object", "properties": { "provider": { "type": "string" }, "model": { "type": "string" } }, "required": ["provider", "model"], "additionalProperties": false }] }, "maxInstances": { "type": "number" }, "promptOverride": { "oneOf": [{ "type": "null", "const": null }, { "type": "string" }] }, "preferredSkills": { "type": "array", "items": { "type": "string" } } }, "required": ["id", "kind", "name", "description", "model", "maxInstances", "promptOverride", "preferredSkills"], "additionalProperties": false } } }, "required": ["id", "revision", "name", "roles"], "additionalProperties": false }
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
],
|
|
541
|
+
result: {
|
|
542
|
+
mode: "strict",
|
|
543
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team/types#TeamConfig",
|
|
544
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_save_result$schema,
|
|
545
|
+
jsonSchema: { "type": "object", "properties": { "id": { "type": "string" }, "revision": { "type": "number" }, "name": { "type": "string" }, "roles": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "kind": { "type": "string", "enum": ["commander", "worker", "reviewer", "custom"] }, "name": { "type": "string" }, "description": { "type": "string" }, "model": { "oneOf": [{ "type": "null", "const": null }, { "type": "object", "properties": { "provider": { "type": "string" }, "model": { "type": "string" } }, "required": ["provider", "model"], "additionalProperties": true }] }, "maxInstances": { "type": "number" }, "promptOverride": { "oneOf": [{ "type": "null", "const": null }, { "type": "string" }] }, "preferredSkills": { "type": "array", "items": { "type": "string" } } }, "required": ["id", "kind", "name", "description", "model", "maxInstances", "promptOverride", "preferredSkills"], "additionalProperties": true } } }, "required": ["id", "revision", "name", "roles"], "additionalProperties": true }
|
|
546
|
+
},
|
|
547
|
+
sourceLocation: { "file": "packages/@ceasarxuu/dsh-agent-team/src/remote.ts", "line": 38, "column": 3 }
|
|
548
|
+
},
|
|
549
|
+
"teamConfig/skills": {
|
|
550
|
+
service: "teamConfig",
|
|
551
|
+
invocation: { kind: "direct" },
|
|
552
|
+
parameters: [
|
|
553
|
+
{
|
|
554
|
+
name: "workspaceId",
|
|
555
|
+
source: "json",
|
|
556
|
+
codec: {
|
|
557
|
+
mode: "strict",
|
|
558
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/skills:workspaceId",
|
|
559
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_skills_parameter_0$schema,
|
|
560
|
+
jsonSchema: { "oneOf": [{ "type": "null", "const": null }, { "type": "string" }] }
|
|
561
|
+
},
|
|
562
|
+
strictCodec: {
|
|
563
|
+
mode: "strict",
|
|
564
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/skills:workspaceId",
|
|
565
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_skills_parameter_0_strict$schema,
|
|
566
|
+
jsonSchema: { "oneOf": [{ "type": "null", "const": null }, { "type": "string" }] }
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
],
|
|
570
|
+
cancellation: { parameter: "signal" },
|
|
571
|
+
result: {
|
|
572
|
+
mode: "strict",
|
|
573
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/skills:result",
|
|
574
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_skills_result$schema,
|
|
575
|
+
jsonSchema: { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["name", "description"], "additionalProperties": true } }
|
|
576
|
+
},
|
|
577
|
+
sourceLocation: { "file": "packages/@ceasarxuu/dsh-agent-team/src/remote.ts", "line": 48, "column": 3 }
|
|
578
|
+
},
|
|
579
|
+
"teamConfig/switchTeam": {
|
|
580
|
+
service: "teamConfig",
|
|
581
|
+
invocation: { kind: "direct" },
|
|
582
|
+
parameters: [
|
|
583
|
+
{
|
|
584
|
+
name: "sessionId",
|
|
585
|
+
source: "json",
|
|
586
|
+
codec: {
|
|
587
|
+
mode: "strict",
|
|
588
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/switchTeam:sessionId",
|
|
589
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_0$schema,
|
|
590
|
+
jsonSchema: { "type": "string" }
|
|
591
|
+
},
|
|
592
|
+
strictCodec: {
|
|
593
|
+
mode: "strict",
|
|
594
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/switchTeam:sessionId",
|
|
595
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_0_strict$schema,
|
|
596
|
+
jsonSchema: { "type": "string" }
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
name: "assignment",
|
|
601
|
+
source: "json",
|
|
602
|
+
codec: {
|
|
603
|
+
mode: "strict",
|
|
604
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/switchTeam:assignment",
|
|
605
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_1$schema,
|
|
606
|
+
jsonSchema: { "oneOf": [{ "type": "null", "const": null }, { "type": "string" }] }
|
|
607
|
+
},
|
|
608
|
+
strictCodec: {
|
|
609
|
+
mode: "strict",
|
|
610
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/switchTeam:assignment",
|
|
611
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_1_strict$schema,
|
|
612
|
+
jsonSchema: { "oneOf": [{ "type": "null", "const": null }, { "type": "string" }] }
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
name: "choice",
|
|
617
|
+
source: "json",
|
|
618
|
+
codec: {
|
|
619
|
+
mode: "strict",
|
|
620
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/switchTeam:choice",
|
|
621
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_2$schema,
|
|
622
|
+
jsonSchema: { "oneOf": [{ "type": "null", "const": null }, { "type": "object", "properties": { "id": { "type": "string" }, "revision": { "type": "number" } }, "required": ["id", "revision"], "additionalProperties": true }] }
|
|
623
|
+
},
|
|
624
|
+
strictCodec: {
|
|
625
|
+
mode: "strict",
|
|
626
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team#teamConfig/switchTeam:choice",
|
|
627
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_parameter_2_strict$schema,
|
|
628
|
+
jsonSchema: { "oneOf": [{ "type": "null", "const": null }, { "type": "object", "properties": { "id": { "type": "string" }, "revision": { "type": "number" } }, "required": ["id", "revision"], "additionalProperties": false }] }
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
],
|
|
632
|
+
cancellation: { parameter: "signal" },
|
|
633
|
+
result: {
|
|
634
|
+
mode: "strict",
|
|
635
|
+
typeSymbol: "@ceasarxuu/dsh-agent-team/types#SessionTeams",
|
|
636
|
+
create: _ceasarxuu_dsh_agent_team_teamConfig_switchTeam_result$schema,
|
|
637
|
+
jsonSchema: { "type": "object", "properties": { "active": { "oneOf": [{ "type": "null", "const": null }, { "type": "object", "properties": { "id": { "type": "string" }, "revision": { "type": "number" }, "name": { "type": "string" }, "assignment": { "type": "string" } }, "required": ["id", "revision", "name", "assignment"], "additionalProperties": true }] }, "templates": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "revision": { "type": "number" }, "name": { "type": "string" }, "roles": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "kind": { "type": "string", "enum": ["commander", "worker", "reviewer", "custom"] }, "name": { "type": "string" }, "description": { "type": "string" }, "model": { "oneOf": [{ "type": "null", "const": null }, { "type": "object", "properties": { "provider": { "type": "string" }, "model": { "type": "string" } }, "required": ["provider", "model"], "additionalProperties": true }] }, "maxInstances": { "type": "number" }, "promptOverride": { "oneOf": [{ "type": "null", "const": null }, { "type": "string" }] }, "preferredSkills": { "type": "array", "items": { "type": "string" } } }, "required": ["id", "kind", "name", "description", "model", "maxInstances", "promptOverride", "preferredSkills"], "additionalProperties": true } } }, "required": ["id", "revision", "name", "roles"], "additionalProperties": true } } }, "required": ["active", "templates"], "additionalProperties": true }
|
|
638
|
+
},
|
|
639
|
+
sourceLocation: { "file": "packages/@ceasarxuu/dsh-agent-team/src/remote.ts", "line": 58, "column": 3 }
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}, import_zod.z);
|
|
643
|
+
var typert_remote_client_default = TYPERT_REMOTE;
|
|
644
|
+
|
|
645
|
+
// src/client/copy.ts
|
|
646
|
+
var en = {
|
|
647
|
+
title: "Agent Teams",
|
|
648
|
+
newTeam: "New team",
|
|
649
|
+
editTeam: "Edit team",
|
|
650
|
+
deleteTeam: "Delete team",
|
|
651
|
+
backToTeams: "Back to teams",
|
|
652
|
+
confirmDelete: "Delete this team template?",
|
|
653
|
+
deleted: "Team template deleted.",
|
|
654
|
+
cancel: "Cancel",
|
|
655
|
+
teamName: "Team name",
|
|
656
|
+
roles: "Roles",
|
|
657
|
+
addRole: "Add role",
|
|
658
|
+
commander: "Commander",
|
|
659
|
+
worker: "Worker",
|
|
660
|
+
reviewer: "Reviewer",
|
|
661
|
+
custom: "Custom",
|
|
662
|
+
removeRole: "Remove role",
|
|
663
|
+
roleName: "Role name",
|
|
664
|
+
description: "Responsibilities",
|
|
665
|
+
maxInstances: "Instance limit",
|
|
666
|
+
model: "Model",
|
|
667
|
+
chooseModel: "Choose a model",
|
|
668
|
+
preferredSkills: "Preferred Skills",
|
|
669
|
+
selectSkills: "Select skills",
|
|
670
|
+
skillsSearch: "Search names or descriptions",
|
|
671
|
+
noSkills: "No matching skills.",
|
|
672
|
+
loadingSkills: "Loading skills\u2026",
|
|
673
|
+
skillsFailed: "Could not load the DSH skills catalog.",
|
|
674
|
+
modelsFailed: "Could not load the DSH model catalog.",
|
|
675
|
+
prompt: "Role Prompt",
|
|
676
|
+
resetPrompt: "Restore default",
|
|
677
|
+
save: "Save team",
|
|
678
|
+
discard: "Discard changes",
|
|
679
|
+
start: "New conversation with team",
|
|
680
|
+
switchTeam: "Switch team",
|
|
681
|
+
busyTeam: "Finish the current work before switching teams.",
|
|
682
|
+
loading: "Loading teams\u2026",
|
|
683
|
+
retry: "Retry",
|
|
684
|
+
saved: "Team saved.",
|
|
685
|
+
selectTeam: "Choose team template",
|
|
686
|
+
officialDefault: "DSH default",
|
|
687
|
+
noTemplates: "Create a template in Settings \u2192 Agent Teams.",
|
|
688
|
+
empty: "Create a team to configure roles, models and skills.",
|
|
689
|
+
unavailable: "Currently unavailable"
|
|
690
|
+
};
|
|
691
|
+
var zh = {
|
|
692
|
+
title: "\u667A\u80FD\u4F53\u56E2\u961F",
|
|
693
|
+
newTeam: "\u65B0\u5EFA\u56E2\u961F",
|
|
694
|
+
editTeam: "\u7F16\u8F91\u56E2\u961F",
|
|
695
|
+
deleteTeam: "\u5220\u9664\u56E2\u961F",
|
|
696
|
+
backToTeams: "\u8FD4\u56DE\u56E2\u961F\u5217\u8868",
|
|
697
|
+
confirmDelete: "\u5220\u9664\u8FD9\u4E2A\u56E2\u961F\u6A21\u677F\uFF1F",
|
|
698
|
+
deleted: "\u56E2\u961F\u6A21\u677F\u5DF2\u5220\u9664\u3002",
|
|
699
|
+
cancel: "\u53D6\u6D88",
|
|
700
|
+
teamName: "\u56E2\u961F\u540D\u79F0",
|
|
701
|
+
roles: "\u89D2\u8272",
|
|
702
|
+
addRole: "\u6DFB\u52A0\u89D2\u8272",
|
|
703
|
+
commander: "Commander",
|
|
704
|
+
worker: "Worker",
|
|
705
|
+
reviewer: "Reviewer",
|
|
706
|
+
custom: "\u81EA\u5B9A\u4E49",
|
|
707
|
+
removeRole: "\u79FB\u9664\u89D2\u8272",
|
|
708
|
+
roleName: "\u89D2\u8272\u540D\u79F0",
|
|
709
|
+
description: "\u804C\u8D23\u8BF4\u660E",
|
|
710
|
+
maxInstances: "\u5B9E\u4F8B\u4E0A\u9650",
|
|
711
|
+
model: "\u6A21\u578B",
|
|
712
|
+
chooseModel: "\u9009\u62E9\u6A21\u578B",
|
|
713
|
+
preferredSkills: "\u4F18\u5148\u4F7F\u7528\u7684 Skills",
|
|
714
|
+
selectSkills: "\u9009\u62E9 Skills",
|
|
715
|
+
skillsSearch: "\u641C\u7D22\u540D\u79F0\u6216\u7B80\u4ECB",
|
|
716
|
+
noSkills: "\u6CA1\u6709\u5339\u914D\u7684 Skill\u3002",
|
|
717
|
+
loadingSkills: "\u6B63\u5728\u8BFB\u53D6 Skills\u2026",
|
|
718
|
+
skillsFailed: "\u65E0\u6CD5\u8BFB\u53D6 DSH \u6280\u80FD\u76EE\u5F55\u3002",
|
|
719
|
+
modelsFailed: "\u65E0\u6CD5\u8BFB\u53D6 DSH \u6A21\u578B\u76EE\u5F55\u3002",
|
|
720
|
+
prompt: "\u89D2\u8272 Prompt",
|
|
721
|
+
resetPrompt: "\u6062\u590D\u9ED8\u8BA4",
|
|
722
|
+
save: "\u4FDD\u5B58\u56E2\u961F",
|
|
723
|
+
discard: "\u653E\u5F03\u4FEE\u6539",
|
|
724
|
+
start: "\u7528\u6B64\u56E2\u961F\u65B0\u5EFA\u4F1A\u8BDD",
|
|
725
|
+
switchTeam: "\u5207\u6362\u56E2\u961F",
|
|
726
|
+
busyTeam: "\u5F53\u524D\u4EFB\u52A1\u7ED3\u675F\u540E\u53EF\u5207\u6362\u56E2\u961F\u3002",
|
|
727
|
+
loading: "\u6B63\u5728\u8BFB\u53D6\u56E2\u961F\u2026",
|
|
728
|
+
retry: "\u91CD\u8BD5",
|
|
729
|
+
saved: "\u56E2\u961F\u5DF2\u4FDD\u5B58\u3002",
|
|
730
|
+
selectTeam: "\u9009\u62E9\u56E2\u961F\u6A21\u677F",
|
|
731
|
+
officialDefault: "DSH \u5B98\u65B9\u9ED8\u8BA4",
|
|
732
|
+
noTemplates: "\u8BF7\u5728\u300C\u8BBE\u7F6E \u2192 \u667A\u80FD\u4F53\u56E2\u961F\u300D\u65B0\u5EFA\u6A21\u677F\u3002",
|
|
733
|
+
empty: "\u65B0\u5EFA\u56E2\u961F\u540E\u5373\u53EF\u914D\u7F6E\u89D2\u8272\u3001\u6A21\u578B\u548C Skills\u3002",
|
|
734
|
+
unavailable: "\u5F53\u524D\u4E0D\u53EF\u7528"
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
// src/client/SessionTemplatePicker.tsx
|
|
738
|
+
var import_react3 = require("react");
|
|
739
|
+
|
|
740
|
+
// src/client/styles.ts
|
|
741
|
+
var styles = `
|
|
742
|
+
.dsh-agent-team-config {
|
|
743
|
+
display: grid; gap: 16px; min-width: 0;
|
|
744
|
+
color: var(--dsw-alias-label-primary, inherit);
|
|
745
|
+
}
|
|
746
|
+
.dsh-agent-team-config :is(h2, h3, p) { margin: 0; }
|
|
747
|
+
.dsh-agent-team-config h2 { font-size: 18px; }
|
|
748
|
+
.dsh-agent-team-config h3 { font-size: 14px; }
|
|
749
|
+
.dsh-agent-team-config .at-header, .dsh-agent-team-config .at-row {
|
|
750
|
+
display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
|
|
751
|
+
}
|
|
752
|
+
.dsh-agent-team-config .at-header { justify-content: space-between; }
|
|
753
|
+
.dsh-agent-team-config .at-templates { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
|
|
754
|
+
.dsh-agent-team-config.at-session-team { gap: 6px; padding: 4px 12px 8px; font-size: 13px; }
|
|
755
|
+
.dsh-agent-team-config.at-session-team .at-picker-trigger { display: flex; align-items: center; gap: 6px; min-width: 0; text-align: start; }
|
|
756
|
+
.dsh-agent-team-config .at-picker-value { display: flex; gap: 6px; min-width: 0; margin-inline-start: auto; align-items: center; }
|
|
757
|
+
.dsh-agent-team-config .at-picked-team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
758
|
+
.dsh-agent-team-config .at-picker-options { display: grid; gap: 4px; max-height: 160px; overflow: auto; }
|
|
759
|
+
.dsh-agent-team-config .at-picker-options button { text-align: start; overflow-wrap: anywhere; }
|
|
760
|
+
.dsh-agent-team-config.at-session-team [data-primary] { justify-self: end; }
|
|
761
|
+
.dsh-agent-team-config .at-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
|
|
762
|
+
.dsh-agent-team-config .at-edit, .dsh-agent-team-config .at-card {
|
|
763
|
+
margin: 0; min-width: 0; display: grid; gap: 12px;
|
|
764
|
+
}
|
|
765
|
+
.dsh-agent-team-config .at-edit { border: 0; padding: 0; }
|
|
766
|
+
.dsh-agent-team-config .at-card {
|
|
767
|
+
padding: 14px; border: 1px solid var(--dsw-alias-settings-card-stroke, #8885);
|
|
768
|
+
border-radius: 12px; background: var(--dsw-alias-settings-card-fill, transparent);
|
|
769
|
+
}
|
|
770
|
+
.dsh-agent-team-config label { display: grid; gap: 6px; min-width: 0; font-size: 13px; }
|
|
771
|
+
.dsh-agent-team-config :is(input:not([type=checkbox]), select, textarea, button) {
|
|
772
|
+
box-sizing: border-box; max-width: 100%; min-height: 32px; padding: 6px 9px;
|
|
773
|
+
border: 1px solid var(--dsw-alias-border-l2, #8886); border-radius: 7px;
|
|
774
|
+
background: var(--dsw-alias-bg-layer-1, transparent); color: inherit; font: inherit;
|
|
775
|
+
}
|
|
776
|
+
.dsh-agent-team-config select { padding-inline-end: 24px; }
|
|
777
|
+
.dsh-agent-team-config textarea { resize: vertical; line-height: 1.5; }
|
|
778
|
+
.dsh-agent-team-config button { cursor: pointer; }
|
|
779
|
+
.dsh-agent-team-config button.at-template-name { border: 0; background: transparent; padding-inline: 0; font-weight: 600; text-align: left; overflow-wrap: anywhere; }
|
|
780
|
+
.dsh-agent-team-config button:disabled { opacity: .52; cursor: default; }
|
|
781
|
+
.dsh-agent-team-config :is(button[aria-pressed=true], button[aria-checked=true], button[data-primary=true]) {
|
|
782
|
+
border-color: var(--dsw-alias-state-business-primary, #527ef5);
|
|
783
|
+
color: var(--dsw-alias-state-business-primary, #527ef5);
|
|
784
|
+
}
|
|
785
|
+
.dsh-agent-team-config :is(input, select, textarea, button, summary):focus-visible {
|
|
786
|
+
outline: 2px solid var(--dsw-focus-ring-color, #527ef5); outline-offset: 2px;
|
|
787
|
+
}
|
|
788
|
+
.dsh-agent-team-config .at-skills { border: 0; margin: 0; padding: 0; min-width: 0; }
|
|
789
|
+
.dsh-agent-team-config .at-skills legend { padding: 0 0 6px; font-size: 13px; }
|
|
790
|
+
.dsh-agent-team-config .at-skills summary { cursor: pointer; width: fit-content; font-size: 13px; margin-block: 6px; }
|
|
791
|
+
.dsh-agent-team-config .at-skills input[type=search] { width: 100%; }
|
|
792
|
+
.dsh-agent-team-config .at-results { max-height: 220px; overflow: auto; margin: 6px 0 0; padding: 0; list-style: none; }
|
|
793
|
+
.dsh-agent-team-config .at-results label { grid-template-columns: auto 1fr; align-items: start; padding: 6px; cursor: pointer; }
|
|
794
|
+
.dsh-agent-team-config .at-results small { display: block; overflow-wrap: anywhere; color: var(--dsw-alias-label-secondary, inherit); }
|
|
795
|
+
.dsh-agent-team-config .at-actions { padding-top: 4px; }
|
|
796
|
+
.dsh-agent-team-config .at-message { font-size: 13px; white-space: pre-wrap; color: var(--dsw-alias-label-secondary, inherit); }
|
|
797
|
+
.dsh-agent-team-config [role=alert] { color: var(--dsw-alias-state-error-primary, #b62c2c); }
|
|
798
|
+
`;
|
|
799
|
+
|
|
800
|
+
// src/client/TeamSettings.tsx
|
|
801
|
+
var import_react2 = require("react");
|
|
802
|
+
var import_zod3 = require("zod");
|
|
803
|
+
|
|
804
|
+
// src/shared/config.ts
|
|
805
|
+
var import_zod2 = require("zod");
|
|
806
|
+
var id = import_zod2.z.string().regex(/^[a-z][a-z0-9-]*$/);
|
|
807
|
+
var skillName = import_zod2.z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
|
|
808
|
+
var roleModel = import_zod2.z.strictObject({
|
|
809
|
+
provider: import_zod2.z.string().trim().min(1),
|
|
810
|
+
model: import_zod2.z.string().trim().min(1)
|
|
811
|
+
});
|
|
812
|
+
var role = import_zod2.z.strictObject({
|
|
813
|
+
id,
|
|
814
|
+
kind: import_zod2.z.enum(["commander", "worker", "reviewer", "custom"]),
|
|
815
|
+
name: import_zod2.z.string().trim().min(1),
|
|
816
|
+
description: import_zod2.z.string().trim(),
|
|
817
|
+
model: roleModel.nullable(),
|
|
818
|
+
maxInstances: import_zod2.z.int().positive(),
|
|
819
|
+
promptOverride: import_zod2.z.string().nullable(),
|
|
820
|
+
preferredSkills: import_zod2.z.array(skillName).refine((names) => new Set(names).size === names.length, "Duplicate preferred skill")
|
|
821
|
+
});
|
|
822
|
+
var roles = import_zod2.z.array(role).superRefine((values, context) => {
|
|
823
|
+
const roleIds = /* @__PURE__ */ new Set();
|
|
824
|
+
let commanders = 0;
|
|
825
|
+
for (const [index, value2] of values.entries()) {
|
|
826
|
+
if (roleIds.has(value2.id)) context.addIssue({ code: "custom", path: [index, "id"], message: "Duplicate role ID" });
|
|
827
|
+
roleIds.add(value2.id);
|
|
828
|
+
if (value2.kind !== "commander") continue;
|
|
829
|
+
commanders++;
|
|
830
|
+
if (commanders > 1) context.addIssue({ code: "custom", path: [index, "kind"], message: "Use at most one Commander" });
|
|
831
|
+
if (value2.maxInstances !== 1) {
|
|
832
|
+
context.addIssue({ code: "custom", path: [index, "maxInstances"], message: "Commander has exactly one seat" });
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
});
|
|
836
|
+
var teamName = import_zod2.z.string().trim().min(1);
|
|
837
|
+
var teamDraftSchema = import_zod2.z.strictObject({
|
|
838
|
+
id: id.nullable(),
|
|
839
|
+
revision: import_zod2.z.int().nonnegative(),
|
|
840
|
+
name: teamName,
|
|
841
|
+
roles
|
|
842
|
+
});
|
|
843
|
+
var teamConfigSchema = import_zod2.z.strictObject({
|
|
844
|
+
id,
|
|
845
|
+
revision: import_zod2.z.int().positive(),
|
|
846
|
+
name: teamName,
|
|
847
|
+
roles
|
|
848
|
+
});
|
|
849
|
+
|
|
850
|
+
// src/client/RoleEditor.tsx
|
|
851
|
+
var import_react = require("react");
|
|
852
|
+
|
|
853
|
+
// src/shared/prompts.ts
|
|
854
|
+
var prompts = {
|
|
855
|
+
commander: `\u4F60\u662F Commander\uFF0C\u8D1F\u8D23\u7406\u89E3\u7528\u6237\u76EE\u6807\u3001\u786E\u5B9A\u9A8C\u6536\u6761\u4EF6\u3001\u5206\u6D3E\u4EFB\u52A1\u3001\u8DDF\u8FDB\u963B\u585E\u5E76\u5411\u7528\u6237\u6C47\u62A5\u3002\u628A\u8C03\u67E5\u3001\u5B9E\u73B0\u548C\u9A8C\u8BC1\u4EA4\u7ED9\u9002\u5F53\u89D2\u8272\u3002\u59D4\u6D3E\u65F6\u63D0\u4F9B\u539F\u59CB\u8981\u6C42\u3001\u9A8C\u6536\u6761\u4EF6\u3001\u8303\u56F4\u3001\u4F9D\u8D56\u53CA\u9884\u671F\u56DE\u62A5\u3002\u53EA\u5728\u4EFB\u52A1\u76F8\u4E92\u72EC\u7ACB\u4E14\u5199\u5165\u8303\u56F4\u53EF\u5206\u5F00\u65F6\u5E76\u884C\u3002\u4F18\u5148\u7528 send_message \u590D\u7528\u7A7A\u95F2\u6210\u5458\u3002
|
|
856
|
+
\u7528\u4EFB\u52A1\u677F\u8BB0\u5F55\u5F52\u5C5E\u548C\u8FDB\u5EA6\uFF0C\u7528\u6D88\u606F\u4EA4\u63A5\u3002\u4EFB\u52A1\u677F\u66F4\u65B0\u540E\uFF0C\u9700\u8981\u6210\u5458\u884C\u52A8\u65F6\u5411\u5176\u53D1\u6D88\u606F\u3002\u4ECE\u6536\u4EF6\u7BB1\u63A5\u6536\u8FDB\u5EA6\uFF0C\u6309\u9700\u4F7F\u7528 wait_agent\u3002\u6240\u6709\u5FC5\u8981\u7ED3\u679C\u9F50\u5907\u540E\u518D\u5BA3\u5E03\u5B8C\u6210\u3002
|
|
857
|
+
\u914D\u7F6E\u4E86 Reviewer \u65F6\uFF0C\u9ED8\u8BA4\u5C06\u53EF\u9A8C\u6536\u7684\u4EA4\u4ED8\u7269\u4EA4\u5176\u72EC\u7ACB\u5BA1\u67E5\u3002\u63D0\u4F9B\u539F\u59CB\u8981\u6C42\u3001\u9A8C\u6536\u6761\u4EF6\u3001\u57FA\u7EBF\u548C\u76EE\u6807\u7248\u672C\uFF0C\u8BA9 Reviewer \u81EA\u5DF1\u68C0\u67E5\u4EA7\u7269\u3002\u6309\u8BC1\u636E\u5904\u7406\u963B\u585E\u9879\uFF0C\u6D3E\u539F Worker \u4FEE\u590D\uFF0C\u6700\u591A\u5B89\u6392\u4E00\u6B21\u805A\u7126\u539F\u963B\u585E\u9879\u53CA\u76F4\u63A5\u56DE\u5F52\u7684\u81EA\u52A8\u590D\u6838\u3002\u7ED3\u8BBA\u7ED1\u5B9A\u76EE\u6807\u7248\u672C\u3002\u4ECD\u6709\u963B\u585E\u6216\u8BC1\u636E\u4E0D\u8DB3\u65F6\uFF0C\u5411\u7528\u6237\u8BF4\u660E\u5B9E\u9645\u72B6\u6001\u548C\u6240\u9700\u51B3\u5B9A\u3002`,
|
|
858
|
+
worker: `\u4F60\u662F Worker\uFF0C\u8D1F\u8D23\u5B8C\u6210\u5206\u6D3E\u7ED9\u4F60\u7684\u4EFB\u52A1\u3002\u9605\u8BFB\u4EFB\u52A1\u3001\u9879\u76EE\u89C4\u5219\u548C\u76F8\u5173\u6750\u6599\uFF0C\u786E\u8BA4\u5F53\u524D\u72B6\u6001\u53CA\u5199\u5165\u8303\u56F4\u3002\u91C7\u7528\u6EE1\u8DB3\u9A8C\u6536\u6761\u4EF6\u7684\u6700\u5C0F\u6539\u52A8\uFF0C\u4FDD\u62A4\u5DF2\u6709\u4FEE\u6539\u548C\u5176\u4ED6\u6210\u5458\u7684\u5DE5\u4F5C\u3002\u8303\u56F4\u51B2\u7A81\u3001\u6743\u9650\u4E0D\u8DB3\u6216\u6838\u5FC3\u8981\u6C42\u4E0D\u660E\u786E\u65F6\uFF0C\u5E26\u7740\u5177\u4F53\u8BC1\u636E\u4EA4\u56DE Commander\uFF0C\u7EE7\u7EED\u53EF\u72EC\u7ACB\u5B8C\u6210\u7684\u5DE5\u4F5C\u3002
|
|
859
|
+
\u6309\u6388\u6743\u505A\u4E0E\u6539\u52A8\u76F8\u5173\u7684\u9A8C\u8BC1\u3002\u901A\u8FC7\u6D88\u606F\u4EA4\u4ED8\u4EFB\u52A1 ID\u3001\u6539\u52A8\u5185\u5BB9\u3001\u4EA7\u7269\u8DEF\u5F84\u548C\u7248\u672C\u3001\u5B9E\u9645\u9A8C\u8BC1\u7ED3\u679C\u53CA\u963B\u585E\u3002\u6536\u5230\u5BA1\u67E5\u53CD\u9988\u540E\uFF0C\u56F4\u7ED5\u5DF2\u786E\u8BA4\u7684\u95EE\u9898\u4FEE\u590D\uFF0C\u5E76\u62A5\u544A\u65B0\u7248\u672C\u53CA\u5BF9\u5E94\u8BC1\u636E\u3002`,
|
|
860
|
+
reviewer: `\u4F60\u662F Reviewer\u3002\u76F4\u63A5\u9605\u8BFB\u539F\u59CB\u9700\u6C42\u3001\u9A8C\u6536\u6761\u4EF6\u548C\u6307\u5B9A\u4EA7\u7269\u7248\u672C\uFF0C\u5C1D\u8BD5\u6784\u9020\u80FD\u63A8\u7FFB\u4EA4\u4ED8\u7ED3\u8BBA\u7684\u53CD\u4F8B\u3002\u4F18\u5148\u770B\u9700\u6C42\u9057\u6F0F\u3001\u8FB9\u754C\u6761\u4EF6\u3001\u5931\u8D25\u6062\u590D\u3001\u5E76\u53D1\u51B2\u7A81\u548C\u56DE\u5F52\u3002\u5B9E\u73B0\u8005\u7684\u81EA\u8BC4\u53EF\u4EE5\u63D0\u4F9B\u7EBF\u7D22\uFF0C\u7ED3\u8BBA\u4EE5\u53EF\u6838\u5BF9\u7684\u8BC1\u636E\u4E3A\u51C6\u3002
|
|
861
|
+
\u6BCF\u6761\u53D1\u73B0\u5199\u660E\u4F4D\u7F6E\u3001\u89E6\u53D1\u6761\u4EF6\u3001\u9884\u671F\u4E0E\u5B9E\u9645\u7ED3\u679C\u3001\u5F71\u54CD\u548C\u8BC1\u636E\u3002\u5C06\u5F71\u54CD\u9A8C\u6536\u4E14\u6709\u8BC1\u636E\u7684\u95EE\u9898\u6807\u4E3A\u963B\u585E\uFF0C\u5F85\u9A8C\u8BC1\u7684\u63A8\u6D4B\u5355\u72EC\u5199\u660E\u3002\u901A\u8FC7\u6D88\u606F\u56DE\u62A5\u300C\u901A\u8FC7\u300D\u300C\u9700\u8981\u4FEE\u590D\u300D\u6216\u300C\u8BC1\u636E\u4E0D\u8DB3\u300D\uFF0C\u5E76\u9644\u76EE\u6807\u7248\u672C\u548C\u68C0\u67E5\u8303\u56F4\u3002\u590D\u6838\u805A\u7126\u4E0A\u4E00\u8F6E\u963B\u585E\u9879\u53CA\u4FEE\u590D\u76F4\u63A5\u5F15\u5165\u7684\u56DE\u5F52\u3002\u4EA7\u7269\u4FEE\u6539\u7531 Worker \u5904\u7406\u3002`,
|
|
862
|
+
custom: ""
|
|
863
|
+
};
|
|
864
|
+
function defaultPrompt(kind) {
|
|
865
|
+
return prompts[kind];
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
// src/client/RoleEditor.tsx
|
|
869
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
870
|
+
var modelKey = (provider, model) => JSON.stringify([provider, model]);
|
|
871
|
+
function RoleEditor({ role: role2, models, skills, skillStatus, t, onChange, remove }) {
|
|
872
|
+
const [search, setSearch] = (0, import_react.useState)("");
|
|
873
|
+
const query = search.trim().toLocaleLowerCase();
|
|
874
|
+
const selectedKey = role2.model ? modelKey(role2.model.provider, role2.model.model) : "";
|
|
875
|
+
const available = models.some((group) => group.models.some((model) => modelKey(group.id, model.id) === selectedKey));
|
|
876
|
+
const results = skills.filter((item) => `${item.name} ${item.description}`.toLocaleLowerCase().includes(query));
|
|
877
|
+
const update = (changes) => onChange({ ...role2, ...changes });
|
|
878
|
+
const toggle = (name) => update({
|
|
879
|
+
preferredSkills: role2.preferredSkills.includes(name) ? role2.preferredSkills.filter((skill) => skill !== name) : [...role2.preferredSkills, name]
|
|
880
|
+
});
|
|
881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "at-card", children: [
|
|
882
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "at-grid", children: [
|
|
883
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
|
|
884
|
+
t("roleName"),
|
|
885
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { value: role2.name, onChange: (event) => update({ name: event.target.value }), required: true })
|
|
886
|
+
] }),
|
|
887
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
|
|
888
|
+
t("maxInstances"),
|
|
889
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
890
|
+
"input",
|
|
891
|
+
{
|
|
892
|
+
type: "number",
|
|
893
|
+
min: 1,
|
|
894
|
+
max: Number.MAX_SAFE_INTEGER,
|
|
895
|
+
step: 1,
|
|
896
|
+
value: Number.isNaN(role2.maxInstances) ? "" : role2.maxInstances,
|
|
897
|
+
readOnly: role2.kind === "commander",
|
|
898
|
+
onChange: (event) => update({ maxInstances: event.currentTarget.valueAsNumber })
|
|
899
|
+
}
|
|
900
|
+
)
|
|
901
|
+
] })
|
|
902
|
+
] }),
|
|
903
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
|
|
904
|
+
t("description"),
|
|
905
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { value: role2.description, onChange: (event) => update({ description: event.target.value }) })
|
|
906
|
+
] }),
|
|
907
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
|
|
908
|
+
t("model"),
|
|
909
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { value: selectedKey, onChange: (event) => {
|
|
910
|
+
const key = event.target.value;
|
|
911
|
+
for (const group of models) {
|
|
912
|
+
const model = group.models.find((model2) => modelKey(group.id, model2.id) === key);
|
|
913
|
+
if (model !== void 0) {
|
|
914
|
+
update({ model: { provider: group.id, model: model.id } });
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
if (key === "") update({ model: null });
|
|
919
|
+
}, children: [
|
|
920
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "", children: t("chooseModel") }),
|
|
921
|
+
role2.model && !available && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("option", { value: selectedKey, disabled: true, children: [
|
|
922
|
+
role2.model.provider,
|
|
923
|
+
"/",
|
|
924
|
+
role2.model.model,
|
|
925
|
+
" \xB7 ",
|
|
926
|
+
t("unavailable")
|
|
927
|
+
] }),
|
|
928
|
+
models.map((group) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("optgroup", { label: group.name, children: group.models.map((model) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: modelKey(group.id, model.id), children: model.name }, model.id)) }, group.id))
|
|
929
|
+
] })
|
|
930
|
+
] }),
|
|
931
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("fieldset", { className: "at-skills", children: [
|
|
932
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("legend", { children: t("preferredSkills") }),
|
|
933
|
+
role2.preferredSkills.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "at-row", children: role2.preferredSkills.map((skill) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", "aria-pressed": "true", onClick: () => toggle(skill), children: [
|
|
934
|
+
skill,
|
|
935
|
+
" \xD7"
|
|
936
|
+
] }, skill)) }),
|
|
937
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", { children: [
|
|
938
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("summary", { children: t("selectSkills") }),
|
|
939
|
+
skillStatus !== "ready" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "at-message", role: "status", children: t(skillStatus === "failed" ? "skillsFailed" : "loadingSkills") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
940
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
941
|
+
"input",
|
|
942
|
+
{
|
|
943
|
+
"aria-label": t("skillsSearch"),
|
|
944
|
+
type: "search",
|
|
945
|
+
placeholder: t("skillsSearch"),
|
|
946
|
+
value: search,
|
|
947
|
+
onChange: (event) => setSearch(event.target.value)
|
|
948
|
+
}
|
|
949
|
+
),
|
|
950
|
+
results.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "at-message", role: "status", children: t("noSkills") }),
|
|
951
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "at-results", children: results.map((skill) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
|
|
952
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
953
|
+
"input",
|
|
954
|
+
{
|
|
955
|
+
type: "checkbox",
|
|
956
|
+
checked: role2.preferredSkills.includes(skill.name),
|
|
957
|
+
onChange: () => toggle(skill.name)
|
|
958
|
+
}
|
|
959
|
+
),
|
|
960
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
961
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: skill.name }),
|
|
962
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: skill.description })
|
|
963
|
+
] })
|
|
964
|
+
] }) }, skill.name)) })
|
|
965
|
+
] })
|
|
966
|
+
] })
|
|
967
|
+
] }),
|
|
968
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
|
|
969
|
+
t("prompt"),
|
|
970
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
971
|
+
"textarea",
|
|
972
|
+
{
|
|
973
|
+
rows: 9,
|
|
974
|
+
value: role2.promptOverride ?? defaultPrompt(role2.kind),
|
|
975
|
+
onChange: (event) => update({ promptOverride: event.target.value })
|
|
976
|
+
}
|
|
977
|
+
)
|
|
978
|
+
] }),
|
|
979
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "at-row", children: [
|
|
980
|
+
role2.kind !== "custom" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
981
|
+
"button",
|
|
982
|
+
{
|
|
983
|
+
type: "button",
|
|
984
|
+
disabled: role2.promptOverride === null,
|
|
985
|
+
onClick: () => update({ promptOverride: null }),
|
|
986
|
+
children: t("resetPrompt")
|
|
987
|
+
}
|
|
988
|
+
),
|
|
989
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: remove, children: t("removeRole") })
|
|
990
|
+
] })
|
|
991
|
+
] });
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
// src/client/TeamSettings.tsx
|
|
995
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
996
|
+
var kinds = ["commander", "worker", "reviewer", "custom"];
|
|
997
|
+
function newRole(kind, index, t) {
|
|
998
|
+
return {
|
|
999
|
+
id: `role-${index}`,
|
|
1000
|
+
kind,
|
|
1001
|
+
name: t(kind),
|
|
1002
|
+
description: "",
|
|
1003
|
+
maxInstances: 1,
|
|
1004
|
+
model: null,
|
|
1005
|
+
promptOverride: null,
|
|
1006
|
+
preferredSkills: []
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
function TeamSettings({ t, operations }) {
|
|
1010
|
+
const [teams, setTeams] = (0, import_react2.useState)();
|
|
1011
|
+
const [editing, setEditing] = (0, import_react2.useState)();
|
|
1012
|
+
const [deleting, setDeleting] = (0, import_react2.useState)();
|
|
1013
|
+
const [busy, setBusy] = (0, import_react2.useState)(false);
|
|
1014
|
+
const [error, setError] = (0, import_react2.useState)("");
|
|
1015
|
+
const [notice, setNotice] = (0, import_react2.useState)("");
|
|
1016
|
+
const [reload, setReload] = (0, import_react2.useState)(0);
|
|
1017
|
+
(0, import_react2.useEffect)(() => {
|
|
1018
|
+
let active = true;
|
|
1019
|
+
operations.list().then((value2) => {
|
|
1020
|
+
if (active) setTeams(value2);
|
|
1021
|
+
}, (failure) => {
|
|
1022
|
+
if (active) setError(errorText(failure));
|
|
1023
|
+
});
|
|
1024
|
+
return () => {
|
|
1025
|
+
active = false;
|
|
1026
|
+
};
|
|
1027
|
+
}, [operations, reload]);
|
|
1028
|
+
function open(team) {
|
|
1029
|
+
setError("");
|
|
1030
|
+
setNotice("");
|
|
1031
|
+
setEditing(team);
|
|
1032
|
+
}
|
|
1033
|
+
async function remove(team) {
|
|
1034
|
+
setBusy(true);
|
|
1035
|
+
setError("");
|
|
1036
|
+
setNotice("");
|
|
1037
|
+
try {
|
|
1038
|
+
if (await operations.remove(team)) setTeams((list) => list?.filter((item) => item.id !== team.id));
|
|
1039
|
+
setDeleting(void 0);
|
|
1040
|
+
setNotice(t("deleted"));
|
|
1041
|
+
} catch (failure) {
|
|
1042
|
+
setDeleting(void 0);
|
|
1043
|
+
setError(errorText(failure));
|
|
1044
|
+
setReload((value2) => value2 + 1);
|
|
1045
|
+
} finally {
|
|
1046
|
+
setBusy(false);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-agent-team-config", children: [
|
|
1050
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", { children: styles }),
|
|
1051
|
+
editing ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1052
|
+
TeamEditor,
|
|
1053
|
+
{
|
|
1054
|
+
t,
|
|
1055
|
+
operations,
|
|
1056
|
+
original: editing,
|
|
1057
|
+
onBack: () => {
|
|
1058
|
+
setEditing(void 0);
|
|
1059
|
+
setReload((value2) => value2 + 1);
|
|
1060
|
+
},
|
|
1061
|
+
onSaved: (team) => {
|
|
1062
|
+
setTeams((list) => editing.id === null ? [...list ?? [], team] : list?.map((item) => item.id === team.id ? team : item));
|
|
1063
|
+
setEditing(void 0);
|
|
1064
|
+
setNotice(t("saved"));
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
1068
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "at-header", children: [
|
|
1069
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { children: t("title") }),
|
|
1070
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", "data-primary": true, disabled: teams === void 0 || deleting !== void 0 || busy, onClick: () => open({
|
|
1071
|
+
id: null,
|
|
1072
|
+
revision: 0,
|
|
1073
|
+
name: "",
|
|
1074
|
+
roles: kinds.slice(0, 3).map((kind, index) => newRole(kind, index + 1, t))
|
|
1075
|
+
}), children: t("newTeam") })
|
|
1076
|
+
] }),
|
|
1077
|
+
teams === void 0 && !error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { role: "status", children: t("loading") }),
|
|
1078
|
+
teams === void 0 && error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", onClick: () => {
|
|
1079
|
+
setError("");
|
|
1080
|
+
setReload((value2) => value2 + 1);
|
|
1081
|
+
}, children: t("retry") }),
|
|
1082
|
+
teams?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "at-message", children: t("empty") }),
|
|
1083
|
+
!!teams?.length && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: "at-templates", children: teams.map((team) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("li", { className: "at-card", children: [
|
|
1084
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "at-header", children: [
|
|
1085
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1086
|
+
"button",
|
|
1087
|
+
{
|
|
1088
|
+
type: "button",
|
|
1089
|
+
className: "at-template-name",
|
|
1090
|
+
disabled: deleting !== void 0 || busy,
|
|
1091
|
+
onClick: () => open(team),
|
|
1092
|
+
children: team.name
|
|
1093
|
+
}
|
|
1094
|
+
),
|
|
1095
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "at-row", children: [
|
|
1096
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", disabled: deleting !== void 0 || busy, onClick: () => open(team), children: t("editTeam") }),
|
|
1097
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", disabled: deleting !== void 0 || busy, onClick: () => {
|
|
1098
|
+
setDeleting(team.id);
|
|
1099
|
+
setError("");
|
|
1100
|
+
setNotice("");
|
|
1101
|
+
}, children: t("deleteTeam") })
|
|
1102
|
+
] })
|
|
1103
|
+
] }),
|
|
1104
|
+
team.roles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "at-message", children: team.roles.map((role2) => role2.name).join(" \xB7 ") }),
|
|
1105
|
+
deleting === team.id && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "at-row", children: [
|
|
1106
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: t("confirmDelete") }),
|
|
1107
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", disabled: busy, onClick: () => void remove(team), children: t("deleteTeam") }),
|
|
1108
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", disabled: busy, onClick: () => setDeleting(void 0), children: t("cancel") })
|
|
1109
|
+
] })
|
|
1110
|
+
] }, team.id)) }),
|
|
1111
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "at-message", role: "status", children: notice }),
|
|
1112
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "at-message", role: "alert", children: error })
|
|
1113
|
+
] })
|
|
1114
|
+
] });
|
|
1115
|
+
}
|
|
1116
|
+
function TeamEditor({ t, operations, original, onSaved, onBack }) {
|
|
1117
|
+
const [draft, setDraft] = (0, import_react2.useState)(original);
|
|
1118
|
+
const [activeRole, setActiveRole] = (0, import_react2.useState)(original.roles[0]?.id);
|
|
1119
|
+
const [busy, setBusy] = (0, import_react2.useState)(false);
|
|
1120
|
+
const [error, setError] = (0, import_react2.useState)("");
|
|
1121
|
+
const [models, setModels] = (0, import_react2.useState)([]);
|
|
1122
|
+
const [modelError, setModelError] = (0, import_react2.useState)(false);
|
|
1123
|
+
const [catalog, setCatalog] = (0, import_react2.useState)();
|
|
1124
|
+
(0, import_react2.useEffect)(() => {
|
|
1125
|
+
const controller = new AbortController();
|
|
1126
|
+
operations.models().then((value2) => {
|
|
1127
|
+
if (!controller.signal.aborted) setModels(value2.groups);
|
|
1128
|
+
}, () => {
|
|
1129
|
+
if (!controller.signal.aborted) setModelError(true);
|
|
1130
|
+
});
|
|
1131
|
+
operations.skills(controller.signal).then((skills) => {
|
|
1132
|
+
if (!controller.signal.aborted) setCatalog({ skills });
|
|
1133
|
+
}, () => {
|
|
1134
|
+
if (!controller.signal.aborted) setCatalog({ skills: [], failed: true });
|
|
1135
|
+
});
|
|
1136
|
+
return () => {
|
|
1137
|
+
controller.abort();
|
|
1138
|
+
};
|
|
1139
|
+
}, [operations]);
|
|
1140
|
+
const dirty = draft.id === null || JSON.stringify(draft) !== JSON.stringify(original);
|
|
1141
|
+
const role2 = draft.roles.find((item) => item.id === activeRole);
|
|
1142
|
+
function edit(changes) {
|
|
1143
|
+
setDraft((previous) => ({ ...previous, ...changes }));
|
|
1144
|
+
setError("");
|
|
1145
|
+
}
|
|
1146
|
+
async function save() {
|
|
1147
|
+
setBusy(true);
|
|
1148
|
+
setError("");
|
|
1149
|
+
try {
|
|
1150
|
+
onSaved(await operations.save(teamDraftSchema.parse(draft)));
|
|
1151
|
+
} catch (failure) {
|
|
1152
|
+
setError(errorText(failure));
|
|
1153
|
+
} finally {
|
|
1154
|
+
setBusy(false);
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
1158
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "at-header", children: [
|
|
1159
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { children: t(draft.id === null ? "newTeam" : "editTeam") }),
|
|
1160
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", disabled: busy, onClick: onBack, children: t(dirty ? "discard" : "backToTeams") })
|
|
1161
|
+
] }),
|
|
1162
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("fieldset", { className: "at-edit", disabled: busy, children: [
|
|
1163
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { children: [
|
|
1164
|
+
t("teamName"),
|
|
1165
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", { value: draft.name, onChange: (event) => edit({ name: event.target.value }), required: true })
|
|
1166
|
+
] }),
|
|
1167
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "at-header", children: [
|
|
1168
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", { children: t("roles") }),
|
|
1169
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("select", { "aria-label": t("addRole"), value: "", onChange: (event) => {
|
|
1170
|
+
const kind = kinds.find((kind2) => kind2 === event.target.value);
|
|
1171
|
+
if (kind === void 0) return;
|
|
1172
|
+
let index = draft.roles.length + 1;
|
|
1173
|
+
while (draft.roles.some((role3) => role3.id === `role-${index}`)) index++;
|
|
1174
|
+
const added = newRole(kind, index, t);
|
|
1175
|
+
edit({ roles: [...draft.roles, added] });
|
|
1176
|
+
setActiveRole(added.id);
|
|
1177
|
+
}, children: [
|
|
1178
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "", disabled: true, children: t("addRole") }),
|
|
1179
|
+
kinds.map((kind) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1180
|
+
"option",
|
|
1181
|
+
{
|
|
1182
|
+
value: kind,
|
|
1183
|
+
disabled: kind === "commander" && draft.roles.some((role3) => role3.kind === kind),
|
|
1184
|
+
children: t(kind)
|
|
1185
|
+
},
|
|
1186
|
+
kind
|
|
1187
|
+
))
|
|
1188
|
+
] })
|
|
1189
|
+
] }),
|
|
1190
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "at-row", role: "group", "aria-label": t("roles"), children: draft.roles.map((item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1191
|
+
"button",
|
|
1192
|
+
{
|
|
1193
|
+
type: "button",
|
|
1194
|
+
"aria-pressed": item.id === activeRole,
|
|
1195
|
+
onClick: () => setActiveRole(item.id),
|
|
1196
|
+
children: item.name || t(item.kind)
|
|
1197
|
+
},
|
|
1198
|
+
item.id
|
|
1199
|
+
)) }),
|
|
1200
|
+
modelError && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "at-message", role: "status", children: t("modelsFailed") }),
|
|
1201
|
+
role2 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1202
|
+
RoleEditor,
|
|
1203
|
+
{
|
|
1204
|
+
role: role2,
|
|
1205
|
+
models,
|
|
1206
|
+
skills: catalog?.skills ?? [],
|
|
1207
|
+
skillStatus: catalog === void 0 ? "loading" : catalog.failed ? "failed" : "ready",
|
|
1208
|
+
t,
|
|
1209
|
+
onChange: (value2) => edit({ roles: draft.roles.map((item) => item.id === value2.id ? value2 : item) }),
|
|
1210
|
+
remove: () => {
|
|
1211
|
+
const roles2 = draft.roles.filter((item) => item.id !== role2.id);
|
|
1212
|
+
edit({ roles: roles2 });
|
|
1213
|
+
setActiveRole(roles2[0]?.id);
|
|
1214
|
+
}
|
|
1215
|
+
},
|
|
1216
|
+
role2.id
|
|
1217
|
+
),
|
|
1218
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "at-row at-actions", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", "data-primary": true, disabled: !dirty, onClick: () => void save(), children: t("save") }) })
|
|
1219
|
+
] }),
|
|
1220
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "at-message", role: "alert", children: error })
|
|
1221
|
+
] });
|
|
1222
|
+
}
|
|
1223
|
+
function errorText(error) {
|
|
1224
|
+
if (error instanceof import_zod3.ZodError) {
|
|
1225
|
+
return error.issues.map((issue) => issue.message).join("\n");
|
|
1226
|
+
}
|
|
1227
|
+
return typeof error === "object" && error !== null && "message" in error ? String(error.message) : String(error);
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
// src/client/SessionTemplatePicker.tsx
|
|
1231
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1232
|
+
function SessionTemplatePicker(props) {
|
|
1233
|
+
const { sessionId, useProjection, useSession, useSessions } = props;
|
|
1234
|
+
const teamState = useProjection("agentTeam");
|
|
1235
|
+
const hasOpenTasks = teamState?.tasks.some((task) => task.status !== "completed") === true;
|
|
1236
|
+
const running = useSession((snapshot) => snapshot.running || snapshot.awaitingFirstTurn);
|
|
1237
|
+
const isChild = useSession((snapshot) => snapshot.subagent !== null);
|
|
1238
|
+
const isNew = useSessions((state) => {
|
|
1239
|
+
const session = state.byId[sessionId];
|
|
1240
|
+
return session?.blank === true && session.origin !== "subagent";
|
|
1241
|
+
});
|
|
1242
|
+
if (teamState?.enabled !== true || isChild) return null;
|
|
1243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TemplatePicker, { ...props, isNew, locked: props.locked || running || hasOpenTasks }, sessionId);
|
|
1244
|
+
}
|
|
1245
|
+
function TemplatePicker({ t, operations, workspaces, sessionId, locked, dismiss, isNew }) {
|
|
1246
|
+
const [state, setState] = (0, import_react3.useState)();
|
|
1247
|
+
const [selected, setSelected] = (0, import_react3.useState)();
|
|
1248
|
+
const [expanded, setExpanded] = (0, import_react3.useState)(false);
|
|
1249
|
+
const [error, setError] = (0, import_react3.useState)("");
|
|
1250
|
+
const [busy, setBusy] = (0, import_react3.useState)(false);
|
|
1251
|
+
const applying = (0, import_react3.useRef)(false);
|
|
1252
|
+
const trigger = (0, import_react3.useRef)(null);
|
|
1253
|
+
const workspace = (0, import_react3.useSyncExternalStore)(
|
|
1254
|
+
(listener) => workspaces.subscribe(listener),
|
|
1255
|
+
() => workspaces.getSnapshot()
|
|
1256
|
+
).items.find((item) => item.sessionIds.includes(sessionId));
|
|
1257
|
+
const active = state?.active;
|
|
1258
|
+
const team = state?.templates.find((item) => item.id === selected);
|
|
1259
|
+
const picked = selected === void 0 ? active : team;
|
|
1260
|
+
const changed = selected === null ? active != null : team !== void 0 && (team.id !== active?.id || team.revision !== active.revision);
|
|
1261
|
+
const createSession = isNew && active === null && team !== void 0;
|
|
1262
|
+
(0, import_react3.useEffect)(() => {
|
|
1263
|
+
let generation = 0;
|
|
1264
|
+
function load() {
|
|
1265
|
+
const request = ++generation;
|
|
1266
|
+
operations.list(sessionId).then((value2) => {
|
|
1267
|
+
if (request === generation) setState(value2);
|
|
1268
|
+
}, (failure) => {
|
|
1269
|
+
if (request === generation) setError(errorText(failure));
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
const unsubscribe = operations.subscribeList(load);
|
|
1273
|
+
load();
|
|
1274
|
+
return () => {
|
|
1275
|
+
generation++;
|
|
1276
|
+
unsubscribe();
|
|
1277
|
+
};
|
|
1278
|
+
}, [operations, sessionId]);
|
|
1279
|
+
function choose(id2) {
|
|
1280
|
+
setSelected(id2);
|
|
1281
|
+
setExpanded(false);
|
|
1282
|
+
setError("");
|
|
1283
|
+
trigger.current?.focus();
|
|
1284
|
+
}
|
|
1285
|
+
async function apply2() {
|
|
1286
|
+
if (!state || !changed || !workspace || locked || applying.current) return;
|
|
1287
|
+
applying.current = true;
|
|
1288
|
+
setBusy(true);
|
|
1289
|
+
setError("");
|
|
1290
|
+
try {
|
|
1291
|
+
if (createSession) {
|
|
1292
|
+
await operations.launch(team, workspace.workspaceId, dismiss);
|
|
1293
|
+
} else {
|
|
1294
|
+
const choice = team === void 0 ? null : { id: team.id, revision: team.revision };
|
|
1295
|
+
setState(await operations.switchTeam(sessionId, active?.assignment ?? null, choice));
|
|
1296
|
+
}
|
|
1297
|
+
setSelected(void 0);
|
|
1298
|
+
} catch (failure) {
|
|
1299
|
+
setError(errorText(failure));
|
|
1300
|
+
setSelected(void 0);
|
|
1301
|
+
try {
|
|
1302
|
+
setState(await operations.list(sessionId));
|
|
1303
|
+
} catch {
|
|
1304
|
+
}
|
|
1305
|
+
} finally {
|
|
1306
|
+
applying.current = false;
|
|
1307
|
+
setBusy(false);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
if (!workspace) return null;
|
|
1311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsh-agent-team-config at-session-team", children: [
|
|
1312
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("style", { children: styles }),
|
|
1313
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1314
|
+
"button",
|
|
1315
|
+
{
|
|
1316
|
+
ref: trigger,
|
|
1317
|
+
type: "button",
|
|
1318
|
+
role: "menuitem",
|
|
1319
|
+
className: "at-picker-trigger",
|
|
1320
|
+
"aria-expanded": expanded,
|
|
1321
|
+
disabled: locked || busy || state === void 0,
|
|
1322
|
+
onClick: () => setExpanded((open) => !open),
|
|
1323
|
+
children: [
|
|
1324
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: t("selectTeam") }),
|
|
1325
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "at-picker-value", children: [
|
|
1326
|
+
state !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "at-picked-team", children: picked?.name ?? t("officialDefault") }),
|
|
1327
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { "aria-hidden": "true", children: expanded ? "\u2304" : "\u203A" })
|
|
1328
|
+
] })
|
|
1329
|
+
]
|
|
1330
|
+
}
|
|
1331
|
+
),
|
|
1332
|
+
expanded && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "at-picker-options", role: "group", "aria-label": t("selectTeam"), children: [
|
|
1333
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1334
|
+
"button",
|
|
1335
|
+
{
|
|
1336
|
+
type: "button",
|
|
1337
|
+
role: "menuitemradio",
|
|
1338
|
+
"aria-checked": picked == null,
|
|
1339
|
+
disabled: locked || busy,
|
|
1340
|
+
onClick: () => choose(null),
|
|
1341
|
+
children: t("officialDefault")
|
|
1342
|
+
}
|
|
1343
|
+
),
|
|
1344
|
+
state?.templates.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1345
|
+
"button",
|
|
1346
|
+
{
|
|
1347
|
+
type: "button",
|
|
1348
|
+
role: "menuitemradio",
|
|
1349
|
+
"aria-checked": item.id === picked?.id,
|
|
1350
|
+
disabled: locked || busy,
|
|
1351
|
+
onClick: () => choose(item.id),
|
|
1352
|
+
children: item.name
|
|
1353
|
+
},
|
|
1354
|
+
item.id
|
|
1355
|
+
))
|
|
1356
|
+
] }),
|
|
1357
|
+
changed && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1358
|
+
"button",
|
|
1359
|
+
{
|
|
1360
|
+
type: "button",
|
|
1361
|
+
role: "menuitem",
|
|
1362
|
+
"data-primary": true,
|
|
1363
|
+
disabled: locked || busy,
|
|
1364
|
+
onClick: () => void apply2(),
|
|
1365
|
+
children: t(createSession ? "start" : "switchTeam")
|
|
1366
|
+
}
|
|
1367
|
+
),
|
|
1368
|
+
locked && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "at-message", children: t("busyTeam") }),
|
|
1369
|
+
state === void 0 && !error && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "at-message", role: "status", children: t("loading") }),
|
|
1370
|
+
state?.templates.length === 0 && !error && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "at-message", children: t("noTemplates") }),
|
|
1371
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "at-message", role: "alert", children: error })
|
|
1372
|
+
] });
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
// src/client/index.ts
|
|
1376
|
+
var inject = ["locale", "remote", "slots", "uiWorkspace", "workspaces"];
|
|
1377
|
+
function value(result) {
|
|
1378
|
+
if (!result.ok) throw result.error;
|
|
1379
|
+
return result.value;
|
|
1380
|
+
}
|
|
1381
|
+
function apply(ctx) {
|
|
1382
|
+
ctx.effect(() => ctx.remote.$mount(typert_remote_client_default), "agent-team-config: Remotes");
|
|
1383
|
+
ctx.effect(() => ctx.locale.register("teamConfig", { en, zh }), "agent-team-config: translations");
|
|
1384
|
+
ctx.inject(["remote.teamConfig", "remote.session"], (scope) => {
|
|
1385
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
1386
|
+
const changed = () => {
|
|
1387
|
+
for (const listener of listeners) listener();
|
|
1388
|
+
};
|
|
1389
|
+
const operations = {
|
|
1390
|
+
list: async () => value(await scope.remote.teamConfig.list()),
|
|
1391
|
+
save: async (draft) => {
|
|
1392
|
+
const team = value(await scope.remote.teamConfig.save(draft));
|
|
1393
|
+
changed();
|
|
1394
|
+
return team;
|
|
1395
|
+
},
|
|
1396
|
+
remove: async (team) => {
|
|
1397
|
+
const removed = value(await scope.remote.teamConfig.deleteTemplate(team.id, team.revision));
|
|
1398
|
+
changed();
|
|
1399
|
+
return removed;
|
|
1400
|
+
},
|
|
1401
|
+
models: async () => value(await scope.remote.session.modelCatalog()),
|
|
1402
|
+
skills: async (signal) => value(await scope.remote.teamConfig.skills(null, signal))
|
|
1403
|
+
};
|
|
1404
|
+
const picker = {
|
|
1405
|
+
list: async (sessionId) => value(await scope.remote.teamConfig.listForSession(sessionId)),
|
|
1406
|
+
subscribeList: (listener) => {
|
|
1407
|
+
listeners.add(listener);
|
|
1408
|
+
return () => {
|
|
1409
|
+
listeners.delete(listener);
|
|
1410
|
+
};
|
|
1411
|
+
},
|
|
1412
|
+
launch: async (team, workspaceId, dismiss) => {
|
|
1413
|
+
const sessionId = value(await scope.remote.teamConfig.launch(team.id, team.revision, workspaceId));
|
|
1414
|
+
dismiss();
|
|
1415
|
+
scope.uiWorkspace.openSession(sessionId);
|
|
1416
|
+
},
|
|
1417
|
+
switchTeam: async (sessionId, assignment, team) => {
|
|
1418
|
+
const state = value(await scope.remote.teamConfig.switchTeam(sessionId, assignment, team));
|
|
1419
|
+
changed();
|
|
1420
|
+
return state;
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
const label = scope.locale.bind("teamConfig");
|
|
1424
|
+
scope.slots.inject("settings.section", () => scope.slots.register({
|
|
1425
|
+
name: "settings.section",
|
|
1426
|
+
id: "agent-team-config",
|
|
1427
|
+
label: () => label("title"),
|
|
1428
|
+
order: 70,
|
|
1429
|
+
locale: "teamConfig",
|
|
1430
|
+
inject: () => ({ operations })
|
|
1431
|
+
}, TeamSettings));
|
|
1432
|
+
scope.slots.inject("conversation.input.model.options", () => scope.slots.register({
|
|
1433
|
+
name: "conversation.input.model.options",
|
|
1434
|
+
id: "agent-team-config",
|
|
1435
|
+
order: 70,
|
|
1436
|
+
locale: "teamConfig",
|
|
1437
|
+
inject: () => ({ operations: picker, workspaces: scope.workspaces.list })
|
|
1438
|
+
}, SessionTemplatePicker));
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
return module.exports;
|
|
1443
|
+
},
|
|
1444
|
+
});
|