import { CancellationToken } from "../../../../base/common/cancellation.js";
import { IMarkdownString } from "../../../../base/common/htmlContent.js";
import { IJSONSchema } from "../../../../base/common/jsonSchema.js";
import { ThemeIcon } from "../../../../base/common/themables.js";
import { URI } from "../../../../base/common/uri.js";
import { ContextKeyExpression } from "../../../../platform/contextkey/common/contextkey.js";
import { ExtensionIdentifier } from "../../../../platform/extensions/common/extensions.js";
import { Location } from "../../../../editor/common/languages.js";
import { IChatTerminalToolInvocationData, IChatToolInputInvocationData } from "./chatService.js";
export interface IToolData {
    id: string;
    source: ToolDataSource;
    toolReferenceName?: string;
    icon?: {
        dark: URI;
        light?: URI;
    } | ThemeIcon;
    when?: ContextKeyExpression;
    tags?: string[];
    displayName: string;
    userDescription?: string;
    modelDescription: string;
    inputSchema?: IJSONSchema;
    canBeReferencedInPrompt?: boolean;
    runsInWorkspace?: boolean;
    requiresConfirmation?: boolean;
    alwaysDisplayInputOutput?: boolean;
    supportsToolPicker?: boolean;
}
export type ToolDataSource = {
    type: "extension";
    extensionId: ExtensionIdentifier;
    isExternalTool: boolean;
} | {
    type: "mcp";
    collectionId: string;
    definitionId: string;
} | {
    type: "internal";
};
export declare namespace ToolDataSource {
    function toKey(source: ToolDataSource): string;
}
export interface IToolInvocation {
    callId: string;
    toolId: string;
    parameters: Object;
    tokenBudget?: number;
    context: IToolInvocationContext | undefined;
    chatRequestId?: string;
    chatInteractionId?: string;
    toolSpecificData?: IChatTerminalToolInvocationData | IChatToolInputInvocationData;
    modelId?: string;
}
export interface IToolInvocationContext {
    sessionId: string;
}
export declare function isToolInvocationContext(obj: any): obj is IToolInvocationContext;
export interface IToolResultInputOutputDetails {
    readonly input: string;
    readonly output: string;
}
export declare function isToolResultInputOutputDetails(obj: any): obj is IToolResultInputOutputDetails;
export interface IToolResult {
    content: (IToolResultPromptTsxPart | IToolResultTextPart)[];
    toolResultMessage?: string | IMarkdownString;
    toolResultDetails?: Array<URI | Location> | IToolResultInputOutputDetails;
}
export interface IToolResultPromptTsxPart {
    kind: "promptTsx";
    value: unknown;
}
export declare function stringifyPromptTsxPart(part: IToolResultPromptTsxPart): string;
export interface IToolResultTextPart {
    kind: "text";
    value: string;
}
export interface IToolConfirmationMessages {
    title: string;
    message: string | IMarkdownString;
    allowAutoConfirm?: boolean;
}
export interface IPreparedToolInvocation {
    invocationMessage?: string | IMarkdownString;
    pastTenseMessage?: string | IMarkdownString;
    confirmationMessages?: IToolConfirmationMessages;
    presentation?: "hidden" | undefined;
    toolSpecificData?: IChatTerminalToolInvocationData | IChatToolInputInvocationData;
}
export interface IToolImpl {
    invoke(invocation: IToolInvocation, countTokens: CountTokensCallback, token: CancellationToken): Promise<IToolResult>;
    prepareToolInvocation?(parameters: any, token: CancellationToken): Promise<IPreparedToolInvocation | undefined>;
}
export type CountTokensCallback = (input: string, token: CancellationToken) => Promise<number>;
export declare function createToolInputUri(toolOrId: IToolData | string): URI;
