mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
clean
This commit is contained in:
@ -23,8 +23,7 @@
|
||||
],
|
||||
"main": "./out/extension.js",
|
||||
"enabledApiProposals": [
|
||||
"chatPromptFiles",
|
||||
"chatParticipantPrivate"
|
||||
"chatPromptFiles"
|
||||
],
|
||||
"contributes": {
|
||||
"chatPromptFiles": [
|
||||
|
||||
@ -8,12 +8,12 @@ export function createCustomAgentProvider(_context: vscode.ExtensionContext): vs
|
||||
// Dynamic agent with generated content
|
||||
const dynamicContent = generateDynamicAgentContent();
|
||||
|
||||
agents.push(new vscode.CustomAgentChatResource({
|
||||
name: 'workspace-helper',
|
||||
description: 'Dynamic agent with workspace statistics',
|
||||
body: dynamicContent,
|
||||
isEditable: false
|
||||
}));
|
||||
agents.push(new vscode.CustomAgentChatResource(
|
||||
'workspace-helper',
|
||||
'Dynamic agent with workspace statistics',
|
||||
{ body: dynamicContent },
|
||||
{ isEditable: false }
|
||||
));
|
||||
|
||||
return agents;
|
||||
}
|
||||
|
||||
@ -3,17 +3,17 @@ import { createCustomAgentProvider } from './customAgentProvider';
|
||||
import { createInstructionsProvider } from './instructionsProvider';
|
||||
import { createPromptFileProvider } from './promptFileProvider';
|
||||
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
export async function activate(context: vscode.ExtensionContext) {
|
||||
// Create and register all providers
|
||||
const customAgentProvider = createCustomAgentProvider(context);
|
||||
const instructionsProvider = createInstructionsProvider(context);
|
||||
const promptFileProvider = createPromptFileProvider(context);
|
||||
|
||||
|
||||
context.subscriptions.push(
|
||||
vscode.chat.registerCustomAgentProvider(customAgentProvider),
|
||||
vscode.chat.registerInstructionsProvider(instructionsProvider),
|
||||
vscode.chat.registerPromptFileProvider(promptFileProvider)
|
||||
);
|
||||
|
||||
|
||||
console.log('Chat prompt files sample extension activated with dynamic providers!');
|
||||
}
|
||||
|
||||
@ -8,12 +8,12 @@ export function createInstructionsProvider(_context: vscode.ExtensionContext): v
|
||||
// Dynamic instructions with current workspace info
|
||||
const dynamicContent = generateDynamicInstructions();
|
||||
|
||||
instructions.push(new vscode.InstructionsChatResource({
|
||||
name: 'workspace-context',
|
||||
description: 'Dynamic workspace context and guidelines',
|
||||
body: dynamicContent,
|
||||
isEditable: false
|
||||
}));
|
||||
instructions.push(new vscode.InstructionsChatResource(
|
||||
'workspace-context',
|
||||
'Dynamic workspace context and guidelines',
|
||||
{ body: dynamicContent },
|
||||
{ isEditable: false }
|
||||
));
|
||||
|
||||
return instructions;
|
||||
}
|
||||
|
||||
@ -8,12 +8,14 @@ export function createPromptFileProvider(_context: vscode.ExtensionContext): vsc
|
||||
// Dynamic prompt with time-based content
|
||||
const dynamicContent = generateDynamicPrompt();
|
||||
|
||||
prompts.push(new vscode.PromptFileChatResource({
|
||||
name: 'time-aware',
|
||||
description: 'Dynamic prompt with current timestamp',
|
||||
body: dynamicContent,
|
||||
isEditable: false
|
||||
}));
|
||||
prompts.push(
|
||||
new vscode.PromptFileChatResource(
|
||||
'time-aware',
|
||||
'Dynamic prompt with current timestamp',
|
||||
{ body: dynamicContent },
|
||||
{ isEditable: false }
|
||||
)
|
||||
);
|
||||
|
||||
return prompts;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user