promptsService.ts ×9

Frontier kind: Code frontier

unlabeled · c_0d2d4ce4f6e7

670 tests · 7015 LOC · 33 files · introduces 0 tests · 733 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges733 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
831 ranges7015 lines · 33 files · Browse complete extent
All tests (intent)
670 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 733 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.ts 733 introduced LOC · 9 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- promptsService.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { CancellationToken } from '../../../../../../base/common/cancellation.js';
7 > import { Event } from '../../../../../../base/common/event.js';
8 > import { IDisposable } from '../../../../../../base/common/lifecycle.js';
9 > import { URI } from '../../../../../../base/common/uri.js';
10 > import { ITextModel } from '../../../../../../editor/common/model.js';
11 > import { ExtensionIdentifier, IExtensionDescription } from '../../../../../../platform/extensions/common/extensions.js';
12 > import { createDecorator } from '../../../../../../platform/instantiation/common/instantiation.js';
13 > import { IChatModeInstructions, IVariableReference } from '../../chatModes.js';
14 > import { PromptFileSource, PromptsType, Target } from '../promptTypes.js';
15 > import { IHandOff, ParsedPromptFile } from '../promptFileParser.js';
16 > import { ResourceSet } from '../../../../../../base/common/map.js';
17 > import { IResolvedPromptSourceFolder } from '../config/promptFileLocations.js';
18 > import { ChatRequestHooks } from '../hookSchema.js';
19 > import { isEqual } from '../../../../../../base/common/resources.js';
20 >
21 > /**
22 > * A single structured debug detail entry from the instructions context computer.
23 > */
24 > export interface InstructionsCollectionDebugEntry {
25 > readonly category: 'applying' | 'skipped' | 'referenced' | 'skill' | 'custom-agent' | 'hook';
26 > readonly name: string;
27 > readonly uri?: URI;
28 > readonly reason?: string;
29 > }
30 >
31 > export type InstructionsCollectionEvent = {
32 > applyingInstructionsCount: number;
33 > referencedInstructionsCount: number;
34 > agentInstructionsCount: number;
35 > listedInstructionsCount: number;
36 > totalInstructionsCount: number;
37 > claudeRulesCount: number;
38 > claudeMdCount: number;
39 > claudeAgentsCount: number;
40 > };
41 >
42 > /**
43 > * Debug-only information collected alongside {@link InstructionsCollectionEvent}.
44 > * This data is used for debug logging and is not sent as telemetry.
45 > */
46 > export type InstructionsCollectionDebugInfo = {
47 > /** Per-file detail entries for debug logging. */
48 > debugDetails: InstructionsCollectionDebugEntry[];
49 > /** Total wall-clock time of the collect() call in milliseconds. */
50 > durationInMillis: number;
51 > };
52 >
53 > export function newInstructionsCollectionEvent(): InstructionsCollectionEvent {
54 return { applyingInstructionsCount: 0, referencedInstructionsCount: 0, agentInstructionsCount: 0, listedInstructionsCount: 0, totalInstructionsCount: 0, claudeRulesCount: 0, claudeMdCount: 0, claudeAgentsCount: 0 };
55 }
57 > export function newInstructionsCollectionDebugInfo(): InstructionsCollectionDebugInfo {
58 return { debugDetails: [], durationInMillis: 0 };
59 }
61 > /**
62 > * Activation events for prompt file providers.
63 > */
64 > export const CUSTOM_AGENT_PROVIDER_ACTIVATION_EVENT = 'onCustomAgentProvider';
65 > export const INSTRUCTIONS_PROVIDER_ACTIVATION_EVENT = 'onInstructionsProvider';
66 > export const PROMPT_FILE_PROVIDER_ACTIVATION_EVENT = 'onPromptFileProvider';
67 > export const SKILL_PROVIDER_ACTIVATION_EVENT = 'onSkillProvider';
68 >
69 > /**
70 > * Context for querying prompt files.
71 > */
72 > export interface IPromptFileContext { }
73 >
74 > /**
75 > * Represents a prompt file resource from an external provider.
76 > */
77 > export interface IPromptFileResource {
78 > /**
79 > * The URI to the agent or prompt resource file.
80 > */
81 > readonly uri: URI;
82 > /**
83 > * Optional externally provided prompt command name.
84 > */
85 > readonly name?: string;
86 > /**
87 > * Optional externally provided prompt command description.
88 > */
89 > readonly description?: string;
90 > /**
91 > * Optional condition that must evaluate to true for this resource to be offered.
92 > */
93 > readonly when?: string;
94 > /**
95 > * Optional session types that describe when this resource should be offered.
96 > */
97 > readonly sessionTypes?: readonly string[];
98 > }
99 >
100 > /**
101 > * Returns whether a customization can be used in the provided chat session type.
102 > */
103 > export function matchesSessionType(sessionTypes: readonly string[] | undefined, currentSessionType: string | undefined): boolean {
104 return sessionTypes === undefined || currentSessionType === undefined || sessionTypes.includes(currentSessionType);
105 }
107 > /**
108 > * Provides prompt services.
109 > */
110 > export const IPromptsService = createDecorator<IPromptsService>('IPromptsService');
111 >
112 > /**
113 > * Where the prompt is stored.
114 > */
115 > export enum PromptsStorage {
116 > local = 'local',
117 > user = 'user',
118 > extension = 'extension',
119 > plugin = 'plugin',
120 > builtIn = 'builtin',
121 > }
122 >
123 > /**
124 > * Represents a prompt path with its type.
125 > * This is used for both prompt files and prompt source folders.
126 > */
127 > export type IPromptPath = IExtensionPromptPath | ILocalPromptPath | IUserPromptPath | IPluginPromptPath | IBuiltinPromptPath;
128 >
129 >
130 > export interface IPromptPathBase {
131 > /**
132 > * URI of the prompt.
133 > */
134 > readonly uri: URI;
135 >
136 > /**
137 > * Storage of the prompt.
138 > */
139 > readonly storage: PromptsStorage;
140 >
141 > /**
142 > * Type of the prompt (e.g. 'prompt' or 'instructions').
143 > */
144 > readonly type: PromptsType;
145 >
146 > /**
147 > * Identifier of the contributing extension (only when storage === PromptsStorage.extension).
148 > */
149 > readonly extension?: IExtensionDescription;
150 >
151 > /**
152 > * Identifier of the contributing plugin (only when storage === PromptsStorage.plugin).
153 > */
154 > readonly pluginUri?: URI;
155 >
156 > /**
157 > * Human-readable name of the contributing plugin, used for plugin-scoped slash command names.
158 > */
159 > readonly pluginLabel?: string;
160 >
161 > /**
162 > * The source that produced this prompt path.
163 > */
164 > readonly source?: PromptFileSource;
165 >
166 > readonly name?: string;
167 >
168 > readonly description?: string;
169 >
170 > /**
171 > * Optional session types that describe when this resource should be offered.
172 > */
173 > readonly sessionTypes?: readonly string[];
174 > }
175 >
176 > export interface IExtensionPromptPath extends IPromptPathBase {
177 > readonly storage: PromptsStorage.extension;
178 > readonly extension: IExtensionDescription;
179 > readonly source: PromptFileSource.ExtensionContribution | PromptFileSource.ExtensionAPI;
180 > readonly name?: string;
181 > readonly description?: string;
182 > readonly when?: string;
183 > }
184 >
185 > export function isExtensionPromptPath(obj: IPromptPath): obj is IExtensionPromptPath {
186 return obj.storage === PromptsStorage.extension;
187 }
189 > export interface ILocalPromptPath extends IPromptPathBase {
190 > readonly storage: PromptsStorage.local;
191 > }
192 > export interface IUserPromptPath extends IPromptPathBase {
193 > readonly storage: PromptsStorage.user;
194 > }
195 >
196 > export interface IPluginPromptPath extends IPromptPathBase {
197 > readonly storage: PromptsStorage.plugin;
198 > readonly pluginUri: URI;
199 > readonly source: PromptFileSource.Plugin;
200 > }
201 >
202 > /**
203 > * Prompt path for built-in prompts bundled with the application (e.g. skills
204 > * shipped with the Agents app). These are read-only and provided by
205 > * {@link IPromptsService.listPromptFiles}/`listPromptFilesForStorage`.
206 > */
207 > export interface IBuiltinPromptPath extends IPromptPathBase {
208 > readonly storage: PromptsStorage.builtIn;
209 > }
210 >
211 > export function isBuiltinPromptPath(obj: IPromptPath): obj is IBuiltinPromptPath {
212 return obj.storage === PromptsStorage.builtIn;
213 }
215 > export type IAgentSource = {
216 > readonly storage: PromptsStorage.extension;
217 > readonly extensionId: ExtensionIdentifier;
218 > } | {
219 > readonly storage: PromptsStorage.local | PromptsStorage.user | PromptsStorage.builtIn;
220 > } | {
221 > readonly storage: PromptsStorage.plugin;
222 > readonly pluginUri: URI;
223 > };
224 >
225 > export namespace IAgentSource {
226 > export function fromPromptPath(promptPath: IPromptPath): IAgentSource {
227 if (promptPath.storage === PromptsStorage.extension) {
228 return { storage: PromptsStorage.extension, extensionId: promptPath.extension.identifier };
233 }
234 }
236 > export function isEquals(a: IAgentSource | undefined, b: IAgentSource | undefined): boolean {
237 if (a === b) {
238 return true;
251 return true;
252 }
254 >
255 > /**
256 > * The visibility/availability of an agent.
257 > * - 'all': available as custom agent in picker AND can be used as subagent
258 > * - 'user': only available in the custom agent picker
259 > * - 'agent': only usable as subagent by the subagent tool
260 > * - 'hidden': neither in picker nor usable as subagent
261 > */
262 > export type ICustomAgentVisibility = {
263 > readonly userInvocable: boolean;
264 > readonly agentInvocable: boolean;
265 > };
266 >
267 > export function isCustomAgentVisibility(obj: unknown): obj is ICustomAgentVisibility {
268 if (typeof obj !== 'object' || obj === null) {
269 return false;
272 return typeof v.userInvocable === 'boolean' && typeof v.agentInvocable === 'boolean';
273 }
275 > export interface ICustomAgent {
276 >
277 > readonly id: string;
278 > /**
279 > * URI of a custom agent file.
280 > */
281 > readonly uri: URI;
282 >
283 > /**
284 > * Name of the custom agent as used in prompt files or contexts
285 > */
286 > readonly name: string;
287 >
288 > /**
289 > * Description of the agent
290 > */
291 > readonly description?: string;
292 >
293 > /**
294 > * Tools metadata in the prompt header.
295 > */
296 > readonly tools?: readonly string[];
297 >
298 > /**
299 > * Model metadata in the prompt header.
300 > */
301 > readonly model?: readonly string[];
302 >
303 > /**
304 > * Argument hint metadata in the prompt header that describes what inputs the agent expects or supports.
305 > */
306 > readonly argumentHint?: string;
307 >
308 > /**
309 > * Target of the agent: Copilot, VSCode, Claude, or undefined if not specified.
310 > */
311 > readonly target: Target;
312 >
313 > /**
314 > * What visibility the agent has (user invocable, subagent invocable).
315 > */
316 > readonly visibility: ICustomAgentVisibility;
317 >
318 > /**
319 > * Contents of the custom agent file body and other agent instructions.
320 > */
321 > readonly agentInstructions: IChatModeInstructions;
322 >
323 > /**
324 > * Hand-offs defined in the custom agent file.
325 > */
326 > readonly handOffs?: readonly IHandOff[];
327 >
328 > /**
329 > * List of subagent names that can be used by the agent.
330 > * If empty, no subagents are available. If ['*'] or undefined, all agents can be used.
331 > */
332 > readonly agents?: readonly string[];
333 >
334 > /**
335 > * Lifecycle hooks scoped to this subagent.
336 > */
337 > readonly hooks?: ChatRequestHooks;
338 >
339 > /**
340 > * Where the agent was loaded from.
341 > */
342 > readonly source: IAgentSource;
343 >
344 > /**
345 > * Optional session types that describe when this agent should be offered.
346 > */
347 > readonly sessionTypes?: readonly string[];
348 >
349 > /**
350 > * Whether this agent is enabled. Disabled agents are included in the list
351 > * but should not be offered to users or used in automated flows.
352 > */
353 > readonly enabled: boolean;
354 > }
355 >
356 > export interface IAgentInstructions {
357 > readonly content: string;
358 > readonly toolReferences: readonly IVariableReference[];
359 > readonly metadata?: Record<string, boolean | string | number>;
360 > }
361 >
362 > export interface IChatPromptSlashCommand {
363 > readonly uri: URI;
364 > readonly name: string;
365 > readonly type: PromptsType;
366 > readonly storage: PromptsStorage;
367 > readonly source?: PromptFileSource;
368 > readonly description?: string;
369 > readonly argumentHint?: string;
370 > readonly userInvocable: boolean;
371 > readonly extension?: IExtensionDescription;
372 > readonly pluginUri?: URI;
373 > readonly pluginLabel?: string;
374 > /**
375 > * Optional session types that describe when this slash command should be offered.
376 > */
377 > readonly sessionTypes?: readonly string[];
378 > }
379 >
380 > export interface IResolvedChatPromptSlashCommand extends IChatPromptSlashCommand {
381 > readonly parsedPromptFile: ParsedPromptFile;
382 > }
383 >
384 >
385 > /**
386 > * A fully resolved instruction file with parsed header metadata and provenance information.
387 > */
388 > export interface IInstructionFile {
389 > /**
390 > * URI of the instruction file.
391 > */
392 > readonly uri: URI;
393 > /**
394 > * Name as listed in the instruction file header or derived from the file name
395 > */
396 > readonly name: string;
397 > /**
398 > * Description as listed in the instruction file header. Used to load the instruction on-demand and for display in the UI.
399 > */
400 > readonly description: string | undefined;
401 > /**
402 > * Storage of the prompt.
403 > */
404 > readonly storage: PromptsStorage;
405 > /**
406 > * The "applyTo" pattern (or `paths` when in a Claude rules file) from the instruction file header.
407 > * Describes when this instruction file should be applied.
408 > */
409 > readonly pattern: string | undefined;
410 > /**
411 > * Identifier of the contributing extension (only when storage === PromptsStorage.extension).
412 > */
413 > readonly extension?: IExtensionDescription;
414 >
415 > /**
416 > * Identifier of the contributing plugin (only when storage === PromptsStorage.plugin).
417 > */
418 > readonly pluginUri?: URI;
419 >
420 > /**
421 > * The source that produced this prompt path.
422 > */
423 > readonly source?: PromptFileSource;
424 >
425 > /**
426 > * Optional session types that describe when this instruction should be offered.
427 > */
428 > readonly sessionTypes?: readonly string[];
429 > }
430 >
431 > /**
432 > * Supply-chain metadata describing where a skill originated.
433 > */
434 > export interface IAgentSkill {
435 > readonly uri: URI;
436 > readonly storage: PromptsStorage;
437 > readonly name: string;
438 > readonly description: string | undefined;
439 > /**
440 > * If true, the skill should not be automatically loaded by the agent.
441 > * Use for workflows you want to trigger manually with /name.
442 > */
443 > readonly disableModelInvocation: boolean;
444 > /**
445 > * If false, the skill is hidden from the / menu.
446 > * Use for background knowledge users shouldn't invoke directly.
447 > */
448 > readonly userInvocable: boolean;
449 > /**
450 > * Optional plugin URI describing where this skill originated.
451 > */
452 > readonly pluginUri?: URI;
453 > /**
454 > * Optional plugin display name describing where this skill originated.
455 > */
456 > readonly pluginLabel?: string;
457 > /**
458 > * Optional extension metadata describing where this skill originated.
459 > */
460 > readonly extension?: IExtensionDescription;
461 > /**
462 > * Optional session types that describe when this skill should be offered.
463 > */
464 > readonly sessionTypes?: readonly string[];
465 > }
466 >
467 > /**
468 > * Type of agent instruction file.
469 > */
470 > export enum AgentInstructionFileType {
471 > agentsMd = 'agentsMd',
472 > claudeMd = 'claudeMd',
473 > copilotInstructionsMd = 'copilotInstructionsMd',
474 > }
475 >
476 > /**
477 > * Represents a resolved agent instruction file with its real path for duplicate detection.
478 > * Used by listAgentInstructions to filter out symlinks pointing to the same file.
479 > */
480 > export interface IAgentInstructionFile {
481 > readonly uri: URI;
482 > /**
483 > * The real path of the file, if it is a symlink.
484 > */
485 > readonly realPath: URI | undefined;
486 > readonly type: AgentInstructionFileType;
487 > }
488 >
489 > export interface Logger {
490 > logInfo(message: string): void;
491 > }
492 >
493 > /**
494 > * Reason why a prompt file was skipped during discovery.
495 > */
496 > export type PromptFileSkipReason =
497 > | 'missing-name'
498 > | 'missing-description'
499 > | 'name-mismatch'
500 > | 'duplicate-name'
501 > | 'parse-error'
502 > | 'disabled'
503 > | 'all-hooks-disabled'
504 > | 'claude-hooks-disabled'
505 > | 'workspace-untrusted';
506 >
507 > /**
508 > * Result of discovering a single prompt file.
509 > */
510 > export interface IPromptFileDiscoveryResult {
511 > readonly status: 'loaded' | 'skipped';
512 > readonly skipReason?: PromptFileSkipReason;
513 > /** Error message if parse-error */
514 > readonly errorMessage?: string;
515 > /** For duplicates, the URI of the file that took precedence */
516 > readonly duplicateOf?: URI;
517 > /** Prompt path for the discovered file. */
518 > readonly promptPath: IPromptPath;
519 > /** Whether the skill is user-invocable in the / menu (set user-invocable: false to hide it) */
520 > readonly userInvocable?: boolean;
521 > /** If true, the skill won't be automatically loaded by the agent (disable-model-invocation: true) */
522 > readonly disableModelInvocation?: boolean;
523 > }
524 >
525 > /**
526 > * Diagnostic information about a source folder that was searched during discovery.
527 > */
528 > export interface IPromptSourceFolderResult {
529 > readonly uri: URI;
530 > readonly storage: PromptsStorage;
531 > }
532 >
533 > /**
534 > * Summary of prompt file discovery for a specific type.
535 > */
536 > export interface IPromptDiscoveryInfo {
537 > readonly type: PromptsType;
538 > readonly files: readonly IPromptFileDiscoveryResult[];
539 > /** Time in milliseconds required to compute this discovery result. */
540 > readonly durationInMillis: number;
541 > /** Source folders that were searched */
542 > readonly sourceFolders?: readonly IPromptSourceFolderResult[];
543 > }
544 >
545 > /**
546 > * Discovery result for a slash command file, including the parsed prompt file.
547 > */
548 > export interface ISlashCommandDiscoveryResult extends IPromptFileDiscoveryResult {
549 > readonly userInvocable?: boolean;
550 > readonly argumentHint?: string;
551 > }
552 >
553 > /**
554 > * Summary of slash command discovery, including parsed prompt files.
555 > */
556 > export interface ISlashCommandDiscoveryInfo extends IPromptDiscoveryInfo {
557 > readonly files: readonly ISlashCommandDiscoveryResult[];
558 > }
559 >
560 > /**
561 > * Discovery result for an instruction file, including the resolved applyTo metadata.
562 > */
563 > export interface IInstructionDiscoveryResult extends IPromptFileDiscoveryResult {
564 > readonly pattern?: string;
565 > }
566 >
567 > /**
568 > * Summary of instruction discovery, including resolved metadata.
569 > */
570 > export interface IInstructionDiscoveryInfo extends IPromptDiscoveryInfo {
571 > readonly files: readonly IInstructionDiscoveryResult[];
572 > }
573 >
574 > /**
575 > * Discovery result for an agent file, including the fully resolved agent.
576 > */
577 > export interface IAgentDiscoveryResult extends IPromptFileDiscoveryResult {
578 > readonly agent?: ICustomAgent;
579 > }
580 >
581 > /**
582 > * Summary of agent discovery, including resolved agents.
583 > */
584 > export interface IAgentDiscoveryInfo extends IPromptDiscoveryInfo {
585 > readonly files: readonly IAgentDiscoveryResult[];
586 > }
587 >
588 > export interface IConfiguredHooksInfo {
589 > readonly hooks: ChatRequestHooks;
590 > readonly hasDisabledClaudeHooks: boolean;
591 > }
592 >
593 > /**
594 > * Summary of hook discovery, including the resolved hooks info.
595 > */
596 > export interface IHookDiscoveryInfo extends IPromptDiscoveryInfo {
597 > readonly hooksInfo: IConfiguredHooksInfo | undefined;
598 > }
599 >
600 > /**
601 > * Provides prompt services.
602 > */
603 > export interface IPromptsService extends IDisposable {
604 > readonly _serviceBrand: undefined;
605 >
606 > /**
607 > * The parsed prompt file for the provided text model.
608 > * @param textModel Returns the parsed prompt file.
609 > */
610 > getParsedPromptFile(textModel: ITextModel): ParsedPromptFile;
611 >
612 > /**
613 > * List all available prompt files.
614 > */
615 > listPromptFiles(type: PromptsType, token: CancellationToken): Promise<readonly IPromptPath[]>;
616 >
617 > /**
618 > * List all available prompt files.
619 > */
620 > listPromptFilesForStorage(type: PromptsType, storage: PromptsStorage, token: CancellationToken): Promise<readonly IPromptPath[]>;
621 >
622 > /**
623 > * Get a list of prompt source folders based on the provided prompt type.
624 > */
625 > getSourceFolders(type: PromptsType): Promise<readonly IPromptPath[]>;
626 >
627 > /**
628 > * Get a list of resolved prompt source folders with full metadata.
629 > * This includes displayPath, isDefault, and storage information.
630 > * Used for diagnostics and config-info displays.
631 > */
632 > getResolvedSourceFolders(type: PromptsType): Promise<readonly IResolvedPromptSourceFolder[]>;
633 >
634 > /**
635 > * Validates if the provided command name is a valid prompt slash command.
636 > */
637 > isValidSlashCommandName(name: string): boolean;
638 >
639 > /**
640 > * Synchronously checks whether `name` matches a discovered prompt slash command.
641 > * Backed by a cache that is populated lazily on the first call and refreshed on
642 > * subsequent {@link onDidChangeSlashCommands} firings, so the very first call after
643 > * service creation may return `false` for known commands until the first discovery
644 > * completes.
645 > */
646 > hasPromptSlashCommand(name: string): boolean;
647 >
648 > /**
649 > * Gets the prompt file for a slash command.
650 > */
651 > resolvePromptSlashCommand(command: string, sessionType: string | undefined, token: CancellationToken): Promise<IResolvedChatPromptSlashCommand | undefined>;
652 >
653 > /**
654 > * Event that is triggered when the slash command to ParsedPromptFile cache is updated.
655 > * Event handlers can use {@link resolvePromptSlashCommand} to retrieve the latest data.
656 > */
657 > readonly onDidChangeSlashCommands: Event<void>;
658 >
659 > /**
660 > * Returns a prompt command if the command name is valid.
661 > */
662 > getPromptSlashCommands(token: CancellationToken): Promise<readonly IChatPromptSlashCommand[]>;
663 >
664 > /**
665 > * Returns the prompt command name for the given URI.
666 > */
667 > getPromptSlashCommandName(uri: URI, token: CancellationToken): Promise<string>;
668 >
669 > /**
670 > * Event that is triggered when the list of custom agents changes.
671 > */
672 > readonly onDidChangeCustomAgents: Event<void>;
673 >
674 > /**
675 > * Event that is triggered when the list of instruction files changes.
676 > */
677 > readonly onDidChangeInstructions: Event<void>;
678 >
679 > /**
680 > * Event that is triggered when the list of agent instruction files changes.
681 > */
682 > readonly onDidChangeAgentInstructions: Event<void>;
683 >
684 > /**
685 > * Finds all available custom agents
686 > */
687 > getCustomAgents(token: CancellationToken): Promise<readonly ICustomAgent[]>;
688 >
689 > /**
690 > * Parses the provided URI
691 > * @param uris
692 > */
693 > parseNew(uri: URI, token: CancellationToken): Promise<ParsedPromptFile>;
694 >
695 > /**
696 > * Internal: register a contributed file. Returns a disposable that removes the contribution.
697 > * Not intended for extension authors; used by contribution point handler.
698 > */
699 > registerContributedFile(type: PromptsType, uri: URI, extension: IExtensionDescription, name: string | undefined, description: string | undefined, when?: string, sessionTypes?: readonly string[]): IDisposable;
700 >
701 >
702 > getPromptLocationLabel(promptPath: IPromptPath): string;
703 >
704 > /**
705 > * Gets list of AGENTS.md files, including optionally nested ones from subfolders.
706 > */
707 > listNestedAgentMDs(token: CancellationToken): Promise<IAgentInstructionFile[]>;
708 >
709 > /**
710 > * Gets combined list of agent instruction files (AGENTS.md, CLAUDE.md, copilot-instructions.md).
711 > * Combines results from listAgentMDs (non-nested), listClaudeMDs, and listCopilotInstructionsMDs.
712 > */
713 > listAgentInstructions(token: CancellationToken, logger?: Logger): Promise<IAgentInstructionFile[]>;
714 >
715 > /**
716 > * For a chat mode file URI, return the name of the agent file that it should use.
717 > * @param oldURI
718 > */
719 > getAgentFileURIFromModeFile(oldURI: URI): URI | undefined;
720 >
721 > /**
722 > * Returns the list of disabled prompt file URIs for a given type. By default no prompt files are disabled.
723 > */
724 > getDisabledPromptFiles(type: PromptsType): ResourceSet;
725 >
726 > /**
727 > * Persists the set of disabled prompt file URIs for the given type.
728 > */
729 > setDisabledPromptFiles(type: PromptsType, uris: ResourceSet): void;
730 >
731 > /**
732 > * Registers a prompt file provider that can provide prompt files for repositories.
733 > * @param extension The extension registering the provider.
734 > * @param type The type of contribution.
735 > * @param provider The provider implementation with optional change event.
736 > * @returns A disposable that unregisters the provider when disposed.
737 > */
738 > registerPromptFileProvider(extension: IExtensionDescription, type: PromptsType, provider: {
739 > onDidChangePromptFiles?: Event<void>;
740 > providePromptFiles: (context: IPromptFileContext, token: CancellationToken) => Promise<IPromptFileResource[] | undefined>;
741 > }): IDisposable;
742 >
743 > /**
744 > * Gets list of agent skills files.
745 > */
746 > findAgentSkills(token: CancellationToken): Promise<IAgentSkill[] | undefined>;
747 >
748 > /**
749 > * Event that is triggered when the list of skills changes.
750 > */
751 > readonly onDidChangeSkills: Event<void>;
752 >
753 > /**
754 > * Event that is triggered when the effective hook availability or configuration changes.
755 > */
756 > readonly onDidChangeHooks: Event<void>;
757 >
758 > /**
759 > * Gets all hooks collected from hooks.json files.
760 > * The result is cached and invalidated when the effective hook availability or configuration changes.
761 > */
762 > getHooks(token: CancellationToken): Promise<IConfiguredHooksInfo | undefined>;
763 >
764 > /**
765 > * Gets all instruction files
766 > */
767 > getInstructionFiles(token: CancellationToken): Promise<readonly IInstructionFile[]>;
768 >
769 > /**
770 > * Returns the cached discovery info for the given prompt type.
771 > */
772 > getDiscoveryInfo(type: PromptsType, token: CancellationToken): Promise<IPromptDiscoveryInfo>;
773 > }