import { type CommandOutputSink } from "./builtins/shellCommandRunner.js"; import type { BackgroundCommandManager, BackgroundCompletedEvent } from "./background-command-manager.js"; export interface BackgroundToolDeps { manager: BackgroundCommandManager; emitCompleted?: (event: BackgroundCompletedEvent) => void; } export type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue; }; export type JsonObject = { [key: string]: JsonValue; }; export interface ACodeBuiltInTool { kind: "builtin"; toolName: string; exposedName: string; description: string; inputSchema: JsonObject; category?: string; execute(args: JsonObject, context?: ACodeBuiltInToolExecutionContext): Promise; } export interface ACodeBuiltInToolExecutionContext { readonly onOutput?: CommandOutputSink; readonly toolCallId?: string; readonly settleSignal?: Promise; } export type ToolPermissionLevel = "allow" | "ask" | "deny"; export type ToolPermissionCapability = "fileReadOutside" | "commandExecution" | "fileModification"; export type ToolPermissionPolicy = Record; export declare const DEFAULT_TOOL_PERMISSION_POLICY: ToolPermissionPolicy; export interface ToolPermissionRequestDetail { path?: string; command?: string; cwd?: string; operation?: "write" | "edit" | "delete"; } export interface ToolPermissionController { getLevel(capability: ToolPermissionCapability): ToolPermissionLevel; requestPermission(capability: ToolPermissionCapability, detail: ToolPermissionRequestDetail): Promise; } export interface AgentFileChangeRecord { filePath: string; operation: 'CREATE' | 'UPDATE' | 'DELETE'; beforeContent: string | null; afterContent: string | null; reason?: string; } export type OnAgentFileChange = (record: AgentFileChangeRecord) => void | Promise; export interface ResolvedWorkspaceTarget { workspaceRoot: string; requestedPath: string; targetPath: string; } export declare function ensureInsideWorkspace(workspaceRoot: string, targetPath: string): string; export declare function resolveWorkspaceTarget(workingDirectory: string, rawFilePath: string): Promise; export declare function createBuiltInFileTools(workingDirectory: string, agentId?: string, onFileChange?: OnAgentFileChange, backgroundDeps?: BackgroundToolDeps, permissionController?: ToolPermissionController): ACodeBuiltInTool[];