This commit is contained in:
Paul Wang
2026-01-07 17:27:40 -08:00
parent 5f038b194e
commit 4aa2e51aae
5 changed files with 24 additions and 23 deletions

View File

@ -23,8 +23,7 @@
],
"main": "./out/extension.js",
"enabledApiProposals": [
"chatPromptFiles",
"chatParticipantPrivate"
"chatPromptFiles"
],
"contributes": {
"chatPromptFiles": [

View File

@ -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;
}

View File

@ -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!');
}

View File

@ -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;
}

View File

@ -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;
}