94
95
getToolData(): IToolData {
97
>
98
>
const properties: IJSONSchemaMap = {
99
>
prompt: {
100
>
type: 'string',
101
>
description: 'A detailed description of the task for the agent to perform'
102
>
},
103
>
description: {
104
>
type: 'string',
105
>
description: 'A short (3-5 word) description of the task'
106
>
}
107
>
};
108
>
properties.agentName = {
109
>
type: 'string',
110
>
description: 'Optional name of a specific agent to invoke. If not provided, uses the current agent.'
111
>
};
112
>
properties.model = {
113
>
type: 'string',
114
>
description: 'Optional model for the subagent. Format: "Model Name (Vendor)", vendor is usually "copilot". Only use to enforce a specific model.',
115
>
};
116
>
117
>
const inputSchema: IJSONSchema & { properties: IJSONSchemaMap } = {
118
>
type: 'object',
119
>
properties,
120
>
required: ['prompt', 'description']
121
>
};
122
>
const runSubagentToolData: IToolData = {
123
>
id: RunSubagentTool.Id,
124
>
toolReferenceName: VSCodeToolReference.runSubagent,
125
>
icon: ThemeIcon.fromId(Codicon.organization.id),
126
>
displayName: localize('tool.runSubagent.displayName', 'Run Subagent'),
127
>
userDescription: localize('tool.runSubagent.userDescription', 'Run a task within an isolated subagent context to enable efficient organization of tasks and context window management.'),
128
>
modelDescription: modelDescription,
129
>
source: ToolDataSource.Internal,
130
>
inputSchema: inputSchema
131
>
};
132
>
return runSubagentToolData;
133
>
}
134
135
async invoke(invocation: IToolInvocation, _countTokens: CountTokensCallback, _progress: ToolProgress, token: CancellationToken): Promise<IToolResult> {