import { URI } from "../../../../../base/common/uri.js"; import { ITextModel } from "../../../../../editor/common/model.js"; import type { ITerminalSandboxPrecheckInputs } from "../../../../../platform/sandbox/common/terminalSandboxService.js"; import { IUriIdentityService } from "../../../../../platform/uriIdentity/common/uriIdentity.service.js"; import { IWorkspaceContextService } from "../../../../../platform/workspace/common/workspace.service.js"; import { IChatWidgetService } from "../chat.service.js"; import { IChatService } from "../../common/chatService/chatService.service.js"; import { ChatPermissionLevel } from "../../common/constants.js"; import { IToolResult } from "../../common/tools/languageModelToolsService.js"; export interface ISymbolToolInput { symbol: string; uri?: string; filePath?: string; lineContent: string; } /** * Returns whether a resource is within the active working directory, or within * a workspace folder when no explicit working directory is set. */ export declare function isSymbolToolResourceInScope(resource: URI, workspaceContextService: IWorkspaceContextService, uriIdentityService: IUriIdentityService, workingDirectory?: URI): boolean; /** * Resolves an in-scope URI from tool input. Accepts either a full URI string or * a file path relative to the working directory when one is provided, or to the * first workspace folder otherwise. */ export declare function resolveSymbolToolFileUri(input: ISymbolToolInput, workspaceContextService: IWorkspaceContextService, uriIdentityService: IUriIdentityService, workingDirectory?: URI): URI | undefined; /** * Gets the chat permission level that should apply to a tool invocation. * * When a request id is available, the request-stamped permission level is the * source of truth for that invocation. If the request cannot be resolved (for * example during early streaming), fall back to the live session widget and then * the latest request in the chat model. */ export declare function getChatPermissionLevelForToolInvocation(chatSessionResource: URI | undefined, chatRequestId: string | undefined, chatWidgetService: IChatWidgetService, chatService: IChatService): ChatPermissionLevel | undefined; /** * Translates the chat permission level for a tool invocation into the * platform-neutral sandbox precheck inputs. */ export declare function getSandboxPrecheckInputsForToolInvocation(chatSessionResource: URI | undefined, chatRequestId: string | undefined, chatWidgetService: IChatWidgetService, chatService: IChatService): ITerminalSandboxPrecheckInputs | undefined; /** * Finds the line number in the model that matches the given line content. * Whitespace is normalized so that extra spaces in the input still match. * * @returns The 1-based line number, or `undefined` if not found. */ export declare function findLineNumber(model: ITextModel, lineContent: string): number | undefined; /** * Finds the 1-based column of a symbol within a line of text using word * boundary matching. * * @returns The 1-based column, or `undefined` if not found. */ export declare function findSymbolColumn(lineText: string, symbol: string): number | undefined; /** * Creates an error tool result with the given message as both the content * and the tool result message. */ export declare function errorResult(message: string): IToolResult;