import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model"; import type { ITerminalSandboxPrecheckInputs } from "../../../../../platform/sandbox/common/terminalSandboxService.js"; import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service"; import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service"; import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service"; import { ChatPermissionLevel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants"; import { IToolResult } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService"; export interface ISymbolToolInput { symbol: string; uri?: string; filePath?: string; lineContent: string; } /** * Resolves a URI from tool input. Accepts either a full URI string or a * workspace-relative file path. When a {@link workingDirectory} is provided * (agents window), relative paths are resolved against it first. * * Relative paths that escape the resolution base directory via parent-directory * segments (e.g. `../outside.ts`) are rejected and `undefined` is returned, so a * `filePath` cannot traverse out of the working directory boundary. */ export declare function resolveSymbolToolFileUri(input: ISymbolToolInput, workspaceContextService: IWorkspaceContextService, 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;