Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .scripts/samples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ export const samples: Sample[] = [
{ description: 'configuration-sample', excludeFromReadme: true, path: 'configuration-sample', guide: null, apis: [], contributions: [] },
{ description: 'chat-model-provider-sample', excludeFromReadme: true, path: 'chat-model-provider-sample', guide: null, apis: [], contributions: [] },
{ description: 'chat-output-renderer-sample', excludeFromReadme: true, path: 'chat-output-renderer-sample', guide: null, apis: [], contributions: [] },
{ description: 'chat-prompt-files-sample', excludeFromReadme: true, path: 'chat-prompt-files-sample', guide: null, apis: [], contributions: ['chatPromptFiles', 'chatInstructions', 'chatAgents'] },
{ description: 'contentprovider-sample', excludeFromReadme: true, path: 'contentprovider-sample', guide: null, apis: [], contributions: [] },
{ description: 'diagnostic-related-information-sample', excludeFromReadme: true, path: 'diagnostic-related-information-sample', guide: null, apis: [], contributions: [] },
{ description: 'document-paste', excludeFromReadme: true, path: 'document-paste', guide: null, apis: [], contributions: [] },
Expand Down
4 changes: 4 additions & 0 deletions chat-prompt-files-sample/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
out
node_modules
.vscode-test/
*.vsix
9 changes: 9 additions & 0 deletions chat-prompt-files-sample/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
35 changes: 35 additions & 0 deletions chat-prompt-files-sample/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm: watch"
},
{
"name": "Run Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "npm: watch"
}
]
}
3 changes: 3 additions & 0 deletions chat-prompt-files-sample/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.insertSpaces": false
}
20 changes: 20 additions & 0 deletions chat-prompt-files-sample/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
8 changes: 8 additions & 0 deletions chat-prompt-files-sample/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.vscode/**
.vscode-test/**
out/test/**
out/**/*.map
src/**
.gitignore
tsconfig.json
vsc-extension-quickstart.md
26 changes: 26 additions & 0 deletions chat-prompt-files-sample/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Chat Prompt Files Sample

Demonstrates the proposed Chat Prompt Files API to register providers for custom agents, instructions, and prompt files with dynamic content.

## Features

Three provider types, each with dynamic content generation:

- **Custom Agent** ([customAgentProvider.ts](src/customAgentProvider.ts)) - Workspace statistics with folder names and counts
- **Instructions** ([instructionsProvider.ts](src/instructionsProvider.ts)) - Active editor context including current file and language
- **Prompt Files** ([promptFileProvider.ts](src/promptFileProvider.ts)) - Time-based greetings and contextual suggestions

Static files are contributed via `package.json`. Providers demonstrate dynamic content using data URIs.

## Running the Sample

1. `npm install` to install dependencies
2. `npm run watch` to compile
3. `F5` to launch with the extension
4. Open the chat panel to see the contributed prompts

## API Reference

- `vscode.chat.registerCustomAgentProvider()`
- `vscode.chat.registerInstructionsProvider()`
- `vscode.chat.registerPromptFileProvider()`
44 changes: 44 additions & 0 deletions chat-prompt-files-sample/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* ESLint configuration for the project.
*
* See https://eslint.style and https://typescript-eslint.io for additional linting options.
*/
// @ts-check
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';

export default tseslint.config(
{
ignores: [
'.vscode-test',
'out',
]
},
js.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
{
plugins: {
'@stylistic': stylistic
},
rules: {
'curly': 'warn',
'@stylistic/semi': ['warn', 'always'],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/naming-convention': [
'warn',
{
'selector': 'import',
'format': ['camelCase', 'PascalCase']
}
],
'@typescript-eslint/no-unused-vars': [
'error',
{
'argsIgnorePattern': '^_'
}
]
}
}
);
Loading