436
return labelStr;
437
}
439
>
440
>
export interface IDiagnosticVariableEntry extends IBaseChatRequestVariableEntry, IDiagnosticVariableEntryFilterData {
441
>
readonly kind: 'diagnostic';
442
>
}
443
>
444
>
export interface IElementAncestorData {
445
>
readonly tagName: string;
446
>
readonly id?: string;
447
>
readonly classNames?: string[];
448
>
}
449
>
450
>
export interface IElementVariableEntry extends IBaseChatRequestVariableEntry {
451
>
readonly kind: 'element';
452
>
readonly value: string;
453
>
readonly ancestors?: IElementAncestorData[];
454
>
readonly attributes?: Record<string, string>;
455
>
readonly computedStyles?: Record<string, string>;
456
>
readonly dimensions?: { readonly top: number; readonly left: number; readonly width: number; readonly height: number };
457
>
readonly innerText?: string;
458
>
}
459
>
460
>
export interface IPromptFileVariableEntry extends IBaseChatRequestVariableEntry {
461
>
readonly kind: 'promptFile';
462
>
readonly value: URI;
463
>
readonly isRoot: boolean;
464
>
readonly originLabel?: string;
465
>
readonly modelDescription: string;
466
>
readonly automaticallyAdded: boolean;
467
>
readonly toolReferences?: readonly ChatRequestToolReferenceEntry[];
468
>
}
469
>
470
>
export interface IPromptTextVariableEntry extends IBaseChatRequestVariableEntry {
471
>
readonly kind: 'promptText';
472
>
readonly value: string;
473
>
readonly settingId?: string;
474
>
readonly modelDescription: string;
475
>
readonly automaticallyAdded: boolean;
476
>
readonly toolReferences?: readonly ChatRequestToolReferenceEntry[];
477
>
}
478
>
479
>
export interface ISCMHistoryItemVariableEntry extends IBaseChatRequestVariableEntry {
480
>
readonly kind: 'scmHistoryItem';
481
>
readonly value: URI;
482
>
readonly historyItem: ISCMHistoryItem;
483
>
}
484
>
485
>
export interface ISCMHistoryItemChangeVariableEntry extends IBaseChatRequestVariableEntry {
486
>
readonly kind: 'scmHistoryItemChange';
487
>
readonly value: URI;
488
>
readonly historyItem: ISCMHistoryItem;
489
>
}
490
>
491
>
export interface ISCMHistoryItemChangeRangeVariableEntry extends IBaseChatRequestVariableEntry {
492
>
readonly kind: 'scmHistoryItemChangeRange';
493
>
readonly value: URI;
494
>
readonly historyItemChangeStart: {
495
>
readonly uri: URI;
496
>
readonly historyItem: ISCMHistoryItem;
497
>
};
498
>
readonly historyItemChangeEnd: {
499
>
readonly uri: URI;
500
>
readonly historyItem: ISCMHistoryItem;
501
>
};
502
>
}
503
>
504
>
export interface ITerminalVariableEntry extends IBaseChatRequestVariableEntry {
505
>
readonly kind: 'terminalCommand';
506
>
readonly value: string;
507
>
readonly resource: URI;
508
>
readonly command: string;
509
>
readonly output?: string;
510
>
readonly exitCode?: number;
511
>
}
512
>
513
>
export interface IDebugVariableEntry extends IBaseChatRequestVariableEntry {
514
>
readonly kind: 'debugVariable';
515
>
readonly value: string;
516
>
readonly expression: string;
517
>
readonly type?: string;
518
>
}
519
>
520
>
export interface IAgentFeedbackVariableEntry extends IBaseChatRequestVariableEntry {
521
>
readonly kind: 'agentFeedback';
522
>
readonly sessionResource: URI;
523
>
/**
524
>
* The agent-host annotations channel URI that backs these feedback items
525
>
* (each item id is an annotation id on this channel). Set only for
526
>
* agent-host sessions; used to emit {@link MessageAnnotationsAttachment}s
527
>
* referencing the specific comments on the wire.
528
>
*/
529
>
readonly annotationsResource?: URI;
530
>
readonly feedbackItems: ReadonlyArray<{
531
>
readonly id: string;
532
>
readonly text: string;
533
>
readonly resourceUri: URI;
534
>
readonly range: IRange;
535
>
readonly codeSelection?: string;
536
>
readonly diffHunks?: string;
537
>
/** When this item was converted from a PR review comment, the original thread ID. */
538
>
readonly sourcePRReviewCommentId?: string;
539
>
/** Additional replies that belong to the same comment thread as {@link text}. */
540
>
readonly replies?: readonly string[];
541
>
}>;
542
>
}
543
>
544
>
export interface IChatRequestDebugEventsVariableEntry extends IBaseChatRequestVariableEntry {
545
>
readonly kind: 'debugEvents';
546
>
/** Timestamp when the debug events were snapshotted. */
547
>
readonly snapshotTime: number;
548
>
/** The session resource these debug events belong to. */
549
>
readonly sessionResource: URI;
550
>
}
551
>
552
>
export interface IChatRequestSessionReferenceVariableEntry extends IBaseChatRequestVariableEntry {
553
>
readonly kind: 'sessionReference';
554
>
readonly value: URI;
555
>
}
556
>
557
>
export interface IBrowserViewVariableEntry extends IBaseChatRequestVariableEntry {
558
>
readonly kind: 'browserView';
559
>
readonly value: URI;
560
>
readonly browserId: string;
561
>
}
562
>
563
>
export function isBrowserViewVariableEntry(entry: IChatRequestVariableEntry): entry is IBrowserViewVariableEntry {
564
return entry.kind === 'browserView';
565
}
567
>
export type IChatRequestVariableEntry = IGenericChatRequestVariableEntry | IChatRequestImplicitVariableEntry | IChatRequestPasteVariableEntry
568
>
| ISymbolVariableEntry | ICommandResultVariableEntry | IDiagnosticVariableEntry | IImageVariableEntry
569
>
| IChatRequestToolEntry | IChatRequestToolSetEntry
570
>
| IChatRequestDirectoryEntry | IChatRequestFileEntry | INotebookOutputVariableEntry | IElementVariableEntry
571
>
| IPromptFileVariableEntry | IPromptTextVariableEntry
572
>
| ISCMHistoryItemVariableEntry | ISCMHistoryItemChangeVariableEntry | ISCMHistoryItemChangeRangeVariableEntry | ITerminalVariableEntry
573
>
| IChatRequestStringVariableEntry | IChatRequestWorkspaceVariableEntry | IDebugVariableEntry | IAgentFeedbackVariableEntry
574
>
| IChatRequestDebugEventsVariableEntry | IChatRequestSessionReferenceVariableEntry | IBrowserViewVariableEntry;
575
>
576
>
export namespace IChatRequestVariableEntry {
577
>
578
>
/**
579
>
* Returns URI of the passed variant entry. Return undefined if not found.
580
>
*/
581
>
export function toUri(entry: IChatRequestVariableEntry): URI | undefined {
582
return URI.isUri(entry.value)
583
? entry.value