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
>
}