mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
feat: sdk subagent support
This commit is contained in:
@@ -129,6 +129,7 @@ export class Query implements AsyncIterable<CLIMessage> {
|
||||
sdkMcpServers:
|
||||
sdkMcpServerNames.length > 0 ? sdkMcpServerNames : undefined,
|
||||
mcpServers: this.options.mcpServers,
|
||||
agents: this.options.agents,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('[Query] Initialization error:', error);
|
||||
|
||||
@@ -517,7 +517,7 @@ export interface SubagentConfig {
|
||||
tools?: string[];
|
||||
systemPrompt: string;
|
||||
level: SubagentLevel;
|
||||
filePath: string;
|
||||
filePath?: string;
|
||||
modelConfig?: Partial<ModelConfig>;
|
||||
runConfig?: Partial<RunConfig>;
|
||||
color?: string;
|
||||
|
||||
@@ -31,7 +31,6 @@ export const SubagentConfigSchema = z.object({
|
||||
description: z.string().min(1, 'Description must be a non-empty string'),
|
||||
tools: z.array(z.string()).optional(),
|
||||
systemPrompt: z.string().min(1, 'System prompt must be a non-empty string'),
|
||||
filePath: z.string().min(1, 'File path must be a non-empty string'),
|
||||
modelConfig: ModelConfigSchema.partial().optional(),
|
||||
runConfig: RunConfigSchema.partial().optional(),
|
||||
color: z.string().optional(),
|
||||
@@ -71,9 +70,9 @@ export const QueryOptionsSchema = z
|
||||
typeof val === 'object' &&
|
||||
'name' in val &&
|
||||
'description' in val &&
|
||||
'systemPrompt' in val &&
|
||||
'filePath' in val,
|
||||
{ message: 'agents must be an array of SubagentConfig objects' },
|
||||
'systemPrompt' in val && {
|
||||
message: 'agents must be an array of SubagentConfig objects',
|
||||
},
|
||||
),
|
||||
)
|
||||
.optional(),
|
||||
|
||||
Reference in New Issue
Block a user