Skip to content

Commit 8ebb9d2

Browse files
committed
add prompt files
1 parent 0c01b9a commit 8ebb9d2

18 files changed

+2058
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
out
2+
node_modules
3+
.vscode-test/
4+
*.vsix
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
5+
// List of extensions which should be recommended for users of this workspace.
6+
"recommendations": [
7+
"dbaeumer.vscode-eslint"
8+
]
9+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [{
8+
"name": "Run Extension",
9+
"type": "extensionHost",
10+
"request": "launch",
11+
"runtimeExecutable": "${execPath}",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
],
15+
"outFiles": [
16+
"${workspaceFolder}/out/**/*.js"
17+
],
18+
"preLaunchTask": "npm: watch"
19+
},
20+
{
21+
"name": "Run Extension Tests",
22+
"type": "extensionHost",
23+
"request": "launch",
24+
"runtimeExecutable": "${execPath}",
25+
"args": [
26+
"--extensionDevelopmentPath=${workspaceFolder}",
27+
"--extensionTestsPath=${workspaceFolder}/out/test"
28+
],
29+
"outFiles": [
30+
"${workspaceFolder}/out/test/**/*.js"
31+
],
32+
"preLaunchTask": "npm: watch"
33+
}
34+
]
35+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.insertSpaces": false
3+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "watch",
9+
"problemMatcher": "$tsc-watch",
10+
"isBackground": true,
11+
"presentation": {
12+
"reveal": "never"
13+
},
14+
"group": {
15+
"kind": "build",
16+
"isDefault": true
17+
}
18+
}
19+
]
20+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.vscode/**
2+
.vscode-test/**
3+
out/test/**
4+
out/**/*.map
5+
src/**
6+
.gitignore
7+
tsconfig.json
8+
vsc-extension-quickstart.md

chat-prompt-files-sample/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Chat Prompt Files Sample
2+
3+
Demonstrates the proposed Chat Prompt Files API to register providers for custom agents, instructions, and prompt files with dynamic content.
4+
5+
## Features
6+
7+
Three provider types, each with dynamic content generation:
8+
9+
- **Custom Agent** ([customAgentProvider.ts](src/customAgentProvider.ts)) - Workspace statistics with folder names and counts
10+
- **Instructions** ([instructionsProvider.ts](src/instructionsProvider.ts)) - Active editor context including current file and language
11+
- **Prompt Files** ([promptFileProvider.ts](src/promptFileProvider.ts)) - Time-based greetings and contextual suggestions
12+
13+
Static files are contributed via `package.json`. Providers demonstrate dynamic content using data URIs.
14+
15+
## Running the Sample
16+
17+
1. `npm install` to install dependencies
18+
2. `npm run watch` to compile
19+
3. `F5` to launch with the extension
20+
4. Open the chat panel to see the contributed prompts
21+
22+
## API Reference
23+
24+
- `vscode.chat.registerCustomAgentProvider()`
25+
- `vscode.chat.registerInstructionsProvider()`
26+
- `vscode.chat.registerPromptFileProvider()`
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* ESLint configuration for the project.
3+
*
4+
* See https://eslint.style and https://typescript-eslint.io for additional linting options.
5+
*/
6+
// @ts-check
7+
import js from '@eslint/js';
8+
import tseslint from 'typescript-eslint';
9+
import stylistic from '@stylistic/eslint-plugin';
10+
11+
export default tseslint.config(
12+
{
13+
ignores: [
14+
'.vscode-test',
15+
'out',
16+
]
17+
},
18+
js.configs.recommended,
19+
...tseslint.configs.recommended,
20+
...tseslint.configs.stylistic,
21+
{
22+
plugins: {
23+
'@stylistic': stylistic
24+
},
25+
rules: {
26+
'curly': 'warn',
27+
'@stylistic/semi': ['warn', 'always'],
28+
'@typescript-eslint/no-empty-function': 'off',
29+
'@typescript-eslint/naming-convention': [
30+
'warn',
31+
{
32+
'selector': 'import',
33+
'format': ['camelCase', 'PascalCase']
34+
}
35+
],
36+
'@typescript-eslint/no-unused-vars': [
37+
'error',
38+
{
39+
'argsIgnorePattern': '^_'
40+
}
41+
]
42+
}
43+
}
44+
);

0 commit comments

Comments
 (0)