Skip to content

Commit f43bc82

Browse files
committed
feat: add hideGenerateButton and workspaceSubpaths to customization provider metadata
Closes parity gap between static harness descriptors (setting OFF) and extension-contributed providers (setting ON). Without these properties, extension harnesses always showed the AI generation button and allowed file creation in any workspace directory. - Add hideGenerateButton to ChatSessionCustomizationProviderMetadata - Add workspaceSubpaths to ChatSessionCustomizationProviderMetadata - Plumb both through DTO and mainThread to IHarnessDescriptor
1 parent e5913be commit f43bc82

4 files changed

Lines changed: 25 additions & 0 deletions

File tree

src/vs/workbench/api/browser/mainThreadChatAgents2.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,8 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA
677677
label: metadata.label,
678678
icon: metadata.iconId ? ThemeIcon.fromId(metadata.iconId) : ThemeIcon.fromId(Codicon.extensions.id),
679679
hiddenSections,
680+
hideGenerateButton: metadata.hideGenerateButton,
681+
workspaceSubpaths: metadata.workspaceSubpaths ? [...metadata.workspaceSubpaths] : undefined,
680682
getStorageSourceFilter: () => ({
681683
// Extension-provided harnesses manage their own items via the provider,
682684
// so we show all sources for storage-filter-based flows.

src/vs/workbench/api/common/extHost.protocol.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,8 @@ export interface IChatSessionCustomizationProviderMetadataDto {
16821682
readonly label: string;
16831683
readonly iconId?: string;
16841684
readonly unsupportedTypes?: readonly string[];
1685+
readonly hideGenerateButton?: boolean;
1686+
readonly workspaceSubpaths?: readonly string[];
16851687
}
16861688

16871689
export interface IChatSessionCustomizationItemDto {

src/vs/workbench/api/common/extHostChatAgents2.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,8 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS
672672
label: metadata.label,
673673
iconId: metadata.iconId,
674674
unsupportedTypes: metadata.unsupportedTypes?.map(t => typeConvert.ChatSessionCustomizationType.from(t)),
675+
hideGenerateButton: metadata.hideGenerateButton,
676+
workspaceSubpaths: metadata.workspaceSubpaths ? [...metadata.workspaceSubpaths] : undefined,
675677
};
676678

677679
this._proxy.$registerChatSessionCustomizationProvider(handle, chatSessionType, metadataDto, extension.identifier);

src/vscode-dts/vscode.proposed.chatSessionCustomizationProvider.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,25 @@ declare module 'vscode' {
6363
* when this provider is active.
6464
*/
6565
readonly unsupportedTypes?: readonly ChatSessionCustomizationType[];
66+
67+
/**
68+
* When `true`, the "Generate with AI" sparkle button is replaced
69+
* with a plain "New" button for manual file creation.
70+
*
71+
* Use this when the provider's backend does not support
72+
* AI-generated customization scaffolding.
73+
*/
74+
readonly hideGenerateButton?: boolean;
75+
76+
/**
77+
* Workspace sub-paths that this provider recognizes for file creation.
78+
* When set, the directory picker for new customization files only
79+
* offers workspace directories under these sub-paths
80+
* (e.g. `['.claude']` for Claude, `['.github', '.copilot']` for CLI).
81+
*
82+
* When omitted, all workspace directories are available.
83+
*/
84+
readonly workspaceSubpaths?: readonly string[];
6685
}
6786

6887
/**

0 commit comments

Comments
 (0)