import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"; import { IMatch } from "@codingame/monaco-vscode-api/vscode/vs/base/common/filters"; import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { ResourceMap } from "@codingame/monaco-vscode-api/vscode/vs/base/common/map"; import { ThemeIcon } from "@codingame/monaco-vscode-api/vscode/vs/base/common/themables"; import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { ExtensionIdentifier } from "@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions"; import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service"; import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service"; import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service"; import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service"; import { IAICustomizationWorkspaceService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service"; import { ICustomizationItem, ICustomizationItemProvider } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService"; import { PromptsType } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes"; import { IPromptsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service"; import { type AICustomizationSource } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement"; /** * Represents an AI customization item in the list widget. */ export interface IAICustomizationListItem { readonly id: string; readonly uri: URI; readonly name: string; readonly filename: string; readonly description?: string; /** Storage or provider origin. All items, including those from external providers, must provide a source. */ readonly source: AICustomizationSource; readonly promptType: PromptsType; readonly disabled: boolean; /** When set, overrides `source` for display grouping purposes. */ readonly groupKey?: string; /** URI of the parent plugin, when this item comes from an installed plugin. */ readonly pluginUri?: URI; /** When set, overrides the formatted name for display. */ readonly displayName?: string; /** When set, shows a small inline badge next to the item name. */ readonly badge?: string; /** Tooltip shown when hovering the badge. */ readonly badgeTooltip?: string; /** When set, overrides the default prompt-type icon. */ readonly typeIcon?: ThemeIcon; /** True when item comes from the default chat extension (grouped under Built-in). */ readonly isBuiltin?: boolean; /** Display name of the contributing extension (for non-built-in extension items). */ readonly extensionId?: string; /** Server-reported loading/sync status for remote customizations. */ readonly status?: "loading" | "loaded" | "degraded" | "error"; /** Human-readable status detail (e.g. error message or warning). */ readonly statusMessage?: string; /** When true, this item can be selected for syncing to a remote harness. */ readonly syncable?: boolean; /** When true, this syncable item is currently selected for syncing. */ readonly synced?: boolean; nameMatches?: IMatch[]; descriptionMatches?: IMatch[]; } /** * Browser-internal item source consumed by the list widget. * * Item sources fetch provider-shaped customization rows, normalize them into * the browser-only list item shape, and add view-only overlays such as sync state. */ export interface IAICustomizationItemSource extends IDisposable { readonly sessionResource: URI; readonly onDidAICustomizationItemsChange: Event; fetchProviderItems(): Promise; fetchAICustomizationItems(promptType: PromptsType): Promise; } /** * Returns true if the given extension identifier matches the default * chat extension (e.g. GitHub Copilot Chat). Used to group items from * the chat extension under "Built-in" instead of "Extensions". */ export declare function isChatExtensionItem(extensionId: ExtensionIdentifier, productService: IProductService): boolean; /** * Derives a friendly name from a filename by removing extension suffixes. */ export declare function getFriendlyName(filename: string): string; /** * Expands hook file items into individual hook entries by parsing hook * definitions from the file content. Falls back to the original item * when parsing fails. */ export declare function expandHookFileItems(hookFileItems: readonly ICustomizationItem[], workspaceService: IAICustomizationWorkspaceService, fileService: IFileService, pathService: IPathService): Promise; /** * Converts provider-shaped customization rows into the rich list model used by the management UI. */ export declare class AICustomizationItemNormalizer { private readonly labelService; private readonly productService; constructor(labelService: ILabelService, productService: IProductService); normalizeItems(items: readonly ICustomizationItem[], promptType: PromptsType): IAICustomizationListItem[]; normalizeItem(item: ICustomizationItem, promptType: PromptsType, uriUseCounts?: ResourceMap): IAICustomizationListItem; private inferStorageAndGroup; } /** * Item source backed by a session-scoped customization item provider. */ export declare class ItemProviderItemSource extends Disposable implements IAICustomizationItemSource { readonly sessionResource: URI; private readonly itemProvider; private readonly promptsService; private readonly workspaceService; private readonly fileService; private readonly pathService; private readonly itemNormalizer; readonly onDidAICustomizationItemsChange: Event; private cachedPromise; constructor(sessionResource: URI, itemProvider: ICustomizationItemProvider, promptsService: IPromptsService, workspaceService: IAICustomizationWorkspaceService, fileService: IFileService, pathService: IPathService, itemNormalizer: AICustomizationItemNormalizer); dispose(): void; fetchProviderItems(): Promise; fetchAICustomizationItems(promptType: PromptsType): Promise; /** * Merges built-in skills (bundled with the app under `vs/sessions/skills/`) * into the provider's items. The provider may re-discover the bundled * copies when scanning disk — those duplicates are dropped (deduped by * URI) and replaced with the authoritative built-in entry tagged * `groupKey: BUILTIN_STORAGE` so the UI renders them in the "Built-in" * group. User-authored overrides (different URI, same name) are preserved. * * A workbench that uses the base `PromptsService` will throw on * `BUILTIN_STORAGE` — we catch and return the items unchanged in that case. */ private mergeBuiltinSkills; private addSkillDescriptionFallbacks; } export declare class EmptyItemProviderItemSource extends Disposable implements IAICustomizationItemSource { readonly sessionResource: URI; readonly onDidAICustomizationItemsChange: Event; constructor(sessionResource: URI); fetchAICustomizationItems(promptType: PromptsType): Promise; fetchProviderItems(): Promise; } export declare class PureItemProviderItemSource extends Disposable implements IAICustomizationItemSource { readonly sessionResource: URI; private readonly itemProvider; private readonly itemNormalizer; readonly onDidAICustomizationItemsChange: Event; private cachedPromise; constructor(sessionResource: URI, itemProvider: ICustomizationItemProvider, itemNormalizer: AICustomizationItemNormalizer); fetchProviderItems(): Promise; fetchAICustomizationItems(promptType: PromptsType): Promise; }