import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable"; 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 { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.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 { ICustomizationItemProvider } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService"; import { ICustomizationHarnessService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service"; import { IAgentPluginService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service"; import { IPromptsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service"; import { IAICustomizationItemSource, IAICustomizationListItem } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource"; import { IAICustomizationItemsModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.service"; /** * The set of sections whose items are sourced from the customization * harness pipeline (extension-contributed providers, sync providers, * and the prompts-service fallback). McpServers / Models have their * own dedicated services and are not modeled here. Plugins keep a * dedicated count observable because remote harnesses can contribute * plugin rows through the same provider pipeline. */ export declare const ITEMS_MODEL_SECTIONS: readonly [ "agents", "skills", "instructions", "prompts", "hooks" ]; export type ItemsModelSection = typeof ITEMS_MODEL_SECTIONS[number]; export declare class AICustomizationItemsModel extends Disposable implements IAICustomizationItemsModel { private readonly harnessService; private readonly promptsService; private readonly workspaceService; private readonly agentPluginService; private readonly fileService; private readonly pathService; readonly _serviceBrand: undefined; private readonly itemNormalizer; private readonly promptsServiceItemProvider; /** * Cached source per active descriptor. Keyed by descriptor reference (not id) so that * an external harness re-registering under the same id (e.g. extension reload) gets a * fresh source bound to the new provider. Pruned when its descriptor is no longer * present in `availableHarnesses`. */ private readonly sourceCache; private readonly perSection; private readonly perSectionCount; private readonly fetchSeq; /** Promise of the most recent fetch per section (resolves regardless of stale-discard). */ private readonly perSectionPending; private readonly remotePluginNames; private readonly pluginCount; private pluginCountObserved; private pluginFetchSeq; /** * Sections that have been observed at least once. The model only fetches on * demand: first `getItems`/`getCount` for a section triggers an initial fetch, * and subsequent harness/source/workspace change events refetch only sections * that have already been read. This avoids 5x provider enumeration on startup. */ private readonly observedSections; constructor(harnessService: ICustomizationHarnessService, promptsService: IPromptsService, workspaceService: IAICustomizationWorkspaceService, workspaceContextService: IWorkspaceContextService, labelService: ILabelService, agentPluginService: IAgentPluginService, productService: IProductService, fileService: IFileService, pathService: IPathService); getItems(section: ItemsModelSection): IObservable; getCount(section: ItemsModelSection): IObservable; getPluginCount(): IObservable; getActiveItemSource(): IAICustomizationItemSource; getPromptsServiceItemProvider(): ICustomizationItemProvider; whenSectionLoaded(section: ItemsModelSection): Promise; private markObserved; private markPluginCountObserved; private getOrCreateSource; private pruneSourceCache; private refetchObserved; private refetchSection; private refetchPluginCount; }