chat customizations: add ChatResourceEnablement#310212
Conversation
Screenshot ChangesBase: Changed (1)blocks-ci screenshots changedReplace the contents of Updated blocks-ci-screenshots.md<!-- auto-generated by CI — do not edit manually -->
#### editor/codeEditor/CodeEditor/Dark

#### editor/codeEditor/CodeEditor/Light
 |
There was a problem hiding this comment.
Pull request overview
This PR introduces “enablement” metadata for chat customization resources (agents, instructions, prompts, skills, etc.) so the platform and extension API can preserve and propagate conditions describing when a contributed resource should be offered.
Changes:
- Add
*Enablementmetadata types and optionalenablementfields to prompt/customization models and proposed VS Code API types. - Plumb
enablementthrough prompt discovery, contribution registration, and ext-host/main-thread DTO conversions. - Extend tests to validate that enablement metadata is preserved for contributed files and provider-returned resources.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.proposed.chatPromptFiles.d.ts | Adds ChatResourceEnablement and enablement fields; adjusts hooks/plugins API return types. |
| src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.ts | Introduces IPromptFileEnablement and adds enablement to core prompt/customization interfaces. |
| src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts | Propagates enablement from prompt paths into resolved agent/instruction/skill/slash-command models and contributed file registrations. |
| src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.ts | Extends extension-point schema and registration flow to accept and forward enablement. |
| src/vs/workbench/api/common/extHost.protocol.ts | Adds IChatResourceEnablementDto and includes enablement on resource DTOs. |
| src/vs/workbench/api/browser/mainThreadChatAgents2.ts | Includes enablement when mapping core models to DTOs sent to the extension host. |
| src/vs/workbench/api/common/extHostChatAgents2.ts | Includes enablement when reviving DTOs into extension API objects. |
| src/vs/workbench/api/common/extHost.api.impl.ts | Updates API typings for hooks/plugins getters to return ChatHook[] / ChatPlugin[]. |
| src/vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test.ts | Updates expectations and adds coverage for enablement preservation from contributions/providers. |
| src/vs/workbench/contrib/chat/test/common/promptSyntax/service/mockPromptsService.ts | Updates mock service signature for contributed file registration to include enablement. |
| src/vs/platform/extensions/common/extensions.ts | Extends contribution typings with enablement for chat file contributions. |
Copilot's findings
- Files reviewed: 10/11 changed files
- Comments generated: 1
| export interface IChatFileContribution { | ||
| readonly path: string; | ||
| readonly name?: string; | ||
| readonly description?: string; | ||
| readonly when?: string; | ||
| readonly enablement?: IChatFileContributionEnablement; | ||
| } |
There was a problem hiding this comment.
IChatFileContribution now allows enablement, but the chatPlugins extension point schema currently rejects unknown properties (additionalProperties: false) and only supports { path, when } (see agentPluginServiceImpl.ts around the epPlugins schema). This creates a mismatch where contributes.chatPlugins[].enablement is type-allowed but will be rejected at runtime. Either extend the chatPlugins schema/handling to accept enablement, or avoid adding enablement to the shared IChatFileContribution shape used by chatPlugins.
Pull request was converted to draft
No description provided.