import { IMarkdownString } from "../../../../../base/common/htmlContent.js";
import { ThemeIcon } from "../../../../../base/common/themables.js";
import { URI } from "../../../../../base/common/uri.js";
import { IRange } from "../../../../../editor/common/core/range.js";
import { IOffsetRange } from "../../../../../editor/common/core/ranges/offsetRange.js";
import { Location, SymbolKind } from "../../../../../editor/common/languages.js";
import { MarkerSeverity, IMarker } from "../../../../../platform/markers/common/markers.js";
import { ISCMHistoryItem } from "../../../scm/common/history.js";
import { IChatContentReference } from "../chatService/chatService.js";
import { IChatRequestVariableValue } from "./chatVariables.js";
import { IToolData, IToolSet } from "../tools/languageModelToolsService.js";
import type { ILanguageModelChatMetadata } from "../languageModels.js";
interface IBaseChatRequestVariableEntry {
    readonly id: string;
    readonly fullName?: string;
    readonly icon?: ThemeIcon;
    readonly name: string;
    readonly modelDescription?: string;
    /**
     * The offset-range in the prompt. This means this entry has been explicitly typed out
     * by the user.
     */
    readonly range?: IOffsetRange;
    readonly value: IChatRequestVariableValue;
    readonly references?: IChatContentReference[];
    /**
     * Implementation-defined metadata that providers attach to a variable
     * entry. Used to round-trip provider-specific data (e.g. agent-host
     * `_meta`) when an entry is sent back to the provider as part of a
     * request attachment.
     */
    readonly _meta?: Record<string, unknown>;
    omittedState?: OmittedState;
}
export interface IGenericChatRequestVariableEntry extends IBaseChatRequestVariableEntry {
    kind: "generic";
    tooltip?: IMarkdownString;
}
export interface IChatRequestDirectoryEntry extends IBaseChatRequestVariableEntry {
    kind: "directory";
    imageCount?: number;
}
export interface IChatRequestFileEntry extends IBaseChatRequestVariableEntry {
    kind: "file";
}
export declare enum OmittedState {
    NotOmitted = 0,
    Partial = 1,
    Full = 2,
    ImageLimitExceeded = 3
}
/**
 * Returns the image-attachment limit for the selected model.
 *
 * Claude-family models use a max of 20 (Messages API), Gemini-family models use
 * a max of 10. Other models do not have a UI-enforced image count limit.
 */
export declare function getImageAttachmentLimit(model: Pick<ILanguageModelChatMetadata, "family"> | undefined): number | undefined;
export interface IChatRequestToolEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "tool";
}
export interface IChatRequestToolSetEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "toolset";
    readonly value: IChatRequestToolEntry[];
}
export type ChatRequestToolReferenceEntry = IChatRequestToolEntry | IChatRequestToolSetEntry;
export interface StringChatContextValue {
    value?: string;
    name?: string;
    modelDescription?: string;
    icon?: ThemeIcon;
    uri: URI;
    resourceUri?: URI;
    tooltip?: IMarkdownString;
    /**
     * Command ID to execute when this context item is clicked.
     */
    readonly commandId?: string;
    readonly handle: number;
}
export interface IChatRequestImplicitVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "implicit";
    readonly isFile: true;
    readonly value: URI | Location | StringChatContextValue | undefined;
    readonly uri: URI | undefined;
    readonly isSelection: boolean;
    enabled: boolean;
}
export interface IChatRequestStringVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "string";
    readonly value: string | undefined;
    readonly modelDescription?: string;
    readonly icon?: ThemeIcon;
    readonly uri: URI;
    readonly resourceUri?: URI;
    readonly tooltip?: IMarkdownString;
    /**
     * Command ID to execute when this context item is clicked.
     */
    readonly commandId?: string;
    readonly handle: number;
}
export interface IChatRequestWorkspaceVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "workspace";
    readonly value: string;
    readonly modelDescription?: string;
}
export interface IChatRequestPasteVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "paste";
    readonly code: string;
    readonly language: string;
    readonly pastedLines: string;
    readonly fileName: string;
    readonly copiedFrom: {
        readonly uri: URI;
        readonly range: IRange;
    } | undefined;
}
export interface ISymbolVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "symbol";
    readonly value: Location;
    readonly symbolKind: SymbolKind;
}
export interface ICommandResultVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "command";
}
export interface IImageVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "image";
    readonly isPasted?: boolean;
    readonly isURL?: boolean;
    readonly mimeType?: string;
}
export interface INotebookOutputVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "notebookOutput";
    readonly outputIndex?: number;
    readonly mimeType?: string;
}
export interface IDiagnosticVariableEntryFilterData {
    readonly owner?: string;
    readonly problemMessage?: string;
    readonly filterUri?: URI;
    readonly filterSeverity?: MarkerSeverity;
    readonly filterRange?: IRange;
}
export declare namespace IDiagnosticVariableEntryFilterData {
    const icon: ThemeIcon;
    function fromMarker(marker: IMarker): IDiagnosticVariableEntryFilterData;
    function toEntry(data: IDiagnosticVariableEntryFilterData): IDiagnosticVariableEntry;
    function id(data: IDiagnosticVariableEntryFilterData): string;
    function label(data: IDiagnosticVariableEntryFilterData): string;
}
export interface IDiagnosticVariableEntry extends IBaseChatRequestVariableEntry, IDiagnosticVariableEntryFilterData {
    readonly kind: "diagnostic";
}
export interface IElementAncestorData {
    readonly tagName: string;
    readonly id?: string;
    readonly classNames?: string[];
}
export interface IElementVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "element";
    readonly ancestors?: IElementAncestorData[];
    readonly attributes?: Record<string, string>;
    readonly computedStyles?: Record<string, string>;
    readonly dimensions?: {
        readonly top: number;
        readonly left: number;
        readonly width: number;
        readonly height: number;
    };
    readonly innerText?: string;
}
export interface IPromptFileVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "promptFile";
    readonly value: URI;
    readonly isRoot: boolean;
    readonly originLabel?: string;
    readonly modelDescription: string;
    readonly automaticallyAdded: boolean;
    readonly toolReferences?: readonly ChatRequestToolReferenceEntry[];
}
export interface IPromptTextVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "promptText";
    readonly value: string;
    readonly settingId?: string;
    readonly modelDescription: string;
    readonly automaticallyAdded: boolean;
    readonly toolReferences?: readonly ChatRequestToolReferenceEntry[];
}
export interface ISCMHistoryItemVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "scmHistoryItem";
    readonly value: URI;
    readonly historyItem: ISCMHistoryItem;
}
export interface ISCMHistoryItemChangeVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "scmHistoryItemChange";
    readonly value: URI;
    readonly historyItem: ISCMHistoryItem;
}
export interface ISCMHistoryItemChangeRangeVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "scmHistoryItemChangeRange";
    readonly value: URI;
    readonly historyItemChangeStart: {
        readonly uri: URI;
        readonly historyItem: ISCMHistoryItem;
    };
    readonly historyItemChangeEnd: {
        readonly uri: URI;
        readonly historyItem: ISCMHistoryItem;
    };
}
export interface ITerminalVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "terminalCommand";
    readonly value: string;
    readonly resource: URI;
    readonly command: string;
    readonly output?: string;
    readonly exitCode?: number;
}
export interface IDebugVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "debugVariable";
    readonly value: string;
    readonly expression: string;
    readonly type?: string;
}
export interface IAgentFeedbackVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "agentFeedback";
    readonly sessionResource: URI;
    readonly feedbackItems: ReadonlyArray<{
        readonly id: string;
        readonly text: string;
        readonly resourceUri: URI;
        readonly range: IRange;
        readonly codeSelection?: string;
        readonly diffHunks?: string;
        /** When this item was converted from a PR review comment, the original thread ID. */
        readonly sourcePRReviewCommentId?: string;
        /** Additional replies that belong to the same comment thread as {@link text}. */
        readonly replies?: readonly string[];
    }>;
}
export interface IChatRequestDebugEventsVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "debugEvents";
    /** Timestamp when the debug events were snapshotted. */
    readonly snapshotTime: number;
    /** The session resource these debug events belong to. */
    readonly sessionResource: URI;
}
export interface IChatRequestSessionReferenceVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "sessionReference";
    readonly value: URI;
}
export interface IBrowserViewVariableEntry extends IBaseChatRequestVariableEntry {
    readonly kind: "browserView";
    readonly value: URI;
    readonly browserId: string;
}
export declare function isBrowserViewVariableEntry(entry: IChatRequestVariableEntry): entry is IBrowserViewVariableEntry;
export type IChatRequestVariableEntry = IGenericChatRequestVariableEntry | IChatRequestImplicitVariableEntry | IChatRequestPasteVariableEntry | ISymbolVariableEntry | ICommandResultVariableEntry | IDiagnosticVariableEntry | IImageVariableEntry | IChatRequestToolEntry | IChatRequestToolSetEntry | IChatRequestDirectoryEntry | IChatRequestFileEntry | INotebookOutputVariableEntry | IElementVariableEntry | IPromptFileVariableEntry | IPromptTextVariableEntry | ISCMHistoryItemVariableEntry | ISCMHistoryItemChangeVariableEntry | ISCMHistoryItemChangeRangeVariableEntry | ITerminalVariableEntry | IChatRequestStringVariableEntry | IChatRequestWorkspaceVariableEntry | IDebugVariableEntry | IAgentFeedbackVariableEntry | IChatRequestDebugEventsVariableEntry | IChatRequestSessionReferenceVariableEntry | IBrowserViewVariableEntry;
export declare namespace IChatRequestVariableEntry {
    /**
     * Returns URI of the passed variant entry. Return undefined if not found.
     */
    function toUri(entry: IChatRequestVariableEntry): URI | undefined;
    function toExport(v: IChatRequestVariableEntry): IChatRequestVariableEntry;
    function fromExport(v: IChatRequestVariableEntry): IChatRequestVariableEntry;
}
export declare function isImplicitVariableEntry(obj: IChatRequestVariableEntry): obj is IChatRequestImplicitVariableEntry;
export declare function isStringVariableEntry(obj: IChatRequestVariableEntry): obj is IChatRequestStringVariableEntry;
export declare function isTerminalVariableEntry(obj: IChatRequestVariableEntry): obj is ITerminalVariableEntry;
export declare function isDebugVariableEntry(obj: IChatRequestVariableEntry): obj is IDebugVariableEntry;
export declare function isAgentFeedbackVariableEntry(obj: IChatRequestVariableEntry): obj is IAgentFeedbackVariableEntry;
export declare function isPasteVariableEntry(obj: IChatRequestVariableEntry): obj is IChatRequestPasteVariableEntry;
export declare function isWorkspaceVariableEntry(obj: IChatRequestVariableEntry): obj is IChatRequestWorkspaceVariableEntry;
export declare function isImageVariableEntry(obj: IChatRequestVariableEntry): obj is IImageVariableEntry;
export declare function isExplicitFileOrImageVariableEntry(obj: IChatRequestVariableEntry): obj is IChatRequestFileEntry | IChatRequestDirectoryEntry | IImageVariableEntry;
export declare function getExplicitFileOrImageAttachmentSummary(entries: readonly IChatRequestVariableEntry[]): string | undefined;
export declare function isNotebookOutputVariableEntry(obj: IChatRequestVariableEntry): obj is INotebookOutputVariableEntry;
export declare function isElementVariableEntry(obj: IChatRequestVariableEntry): obj is IElementVariableEntry;
export declare function isDiagnosticsVariableEntry(obj: IChatRequestVariableEntry): obj is IDiagnosticVariableEntry;
export declare function isChatRequestFileEntry(obj: IChatRequestVariableEntry): obj is IChatRequestFileEntry;
export declare function isPromptFileVariableEntry(obj: IChatRequestVariableEntry): obj is IPromptFileVariableEntry;
export declare function isPromptTextVariableEntry(obj: IChatRequestVariableEntry): obj is IPromptTextVariableEntry;
export declare function isChatRequestVariableEntry(obj: unknown): obj is IChatRequestVariableEntry;
export declare function isSCMHistoryItemVariableEntry(obj: IChatRequestVariableEntry): obj is ISCMHistoryItemVariableEntry;
export declare function isSCMHistoryItemChangeVariableEntry(obj: IChatRequestVariableEntry): obj is ISCMHistoryItemChangeVariableEntry;
export declare function isSCMHistoryItemChangeRangeVariableEntry(obj: IChatRequestVariableEntry): obj is ISCMHistoryItemChangeRangeVariableEntry;
export declare function isStringImplicitContextValue(value: unknown): value is StringChatContextValue;
export declare enum PromptFileVariableKind {
    Instruction = "vscode.instructions.file.root",
    InstructionReference = "vscode.instructions.file.reference",
    PromptFile = "vscode.prompt.file"
}
/**
 * Utility to convert a {@link uri} to a chat variable entry.
 * The `id` of the chat variable can be one of the following:
 *
 * - `vscode.instructions.file.reference__<URI>`: for all non-root prompt instructions references
 * - `vscode.instructions.file.root__<URI>`: for *root* prompt instructions references
 * - `vscode.prompt.file__<URI>`: for prompt file references
 *
 * @param uri A resource URI that points to a prompt instructions file.
 * @param kind The kind of the prompt file variable entry.
 */
export declare function toPromptFileVariableEntry(uri: URI, kind: PromptFileVariableKind, originLabel?: string, automaticallyAdded?: boolean, toolReferences?: ChatRequestToolReferenceEntry[]): IPromptFileVariableEntry;
export declare function toPromptTextVariableEntry(content: string, automaticallyAdded?: boolean, toolReferences?: ChatRequestToolReferenceEntry[]): IPromptTextVariableEntry;
export declare function toFileVariableEntry(uri: URI, range?: IRange): IChatRequestFileEntry;
export declare function toToolVariableEntry(entry: IToolData, range?: IOffsetRange): IChatRequestToolEntry;
export declare function toToolSetVariableEntry(entry: IToolSet, range?: IOffsetRange): IChatRequestToolSetEntry;
export declare class ChatRequestVariableSet {
    private _ids;
    private _entries;
    constructor(entries?: IChatRequestVariableEntry[]);
    add(...entry: IChatRequestVariableEntry[]): void;
    insertFirst(entry: IChatRequestVariableEntry): void;
    remove(entry: IChatRequestVariableEntry): void;
    has(entry: IChatRequestVariableEntry): boolean;
    asArray(): IChatRequestVariableEntry[];
    get length(): number;
}
export {};
