import { VSBuffer } from "../../../base/common/buffer.js"; import { URI } from "../../../base/common/uri.js"; import { DirectoryEntry, ResourceRequestParams } from "./state/protocol/commands.js"; /** Trusted identity used only by the in-process local agent host. */ export declare const LOCAL_AGENT_HOST_RESOURCE_IDENTITY: unique symbol; /** Authorization identity for an agent host requesting client-side resources. */ export type AgentHostResourceIdentity = string | typeof LOCAL_AGENT_HOST_RESOURCE_IDENTITY; /** Configuration key for persisted per-host filesystem grants. */ export declare const AgentHostLocalFilePermissionsSettingId = "chat.agentHost.localFilePermissions"; /** Persisted access mode for a granted URI. */ export declare enum AgentHostAccessMode { Read = "r", ReadWrite = "rw" } /** * Persisted shape of {@link AgentHostLocalFilePermissionsSettingId}: * `{ [normalizedAddress]: { [canonicalUriString]: 'r' | 'rw' | { mode, lexicalUri } } }`. */ export type AgentHostPermissionGrant = AgentHostAccessMode | { readonly mode: AgentHostAccessMode; readonly lexicalUri: string; }; export type AgentHostPermissionsSetting = Record>; /** * Capability a request needs from the user. The protocol-level `read` and * `write` flags are split into one or two of these requests. */ export declare enum AgentHostPermissionMode { Read = "read", Write = "write" } /** A single pending permission request awaiting user input. */ export interface IPendingResourceRequest { readonly id: string; readonly address: string; readonly uri: URI; readonly mode: AgentHostPermissionMode; /** Approve and remember the grant in user settings. */ allowAlways(): void; /** * Approve the request and remember it in memory for the lifetime of the * connection (cleared on connection close or window reload). */ allow(): void; /** Reject this request. */ deny(): void; } /** * Thrown by gated FS operations on {@link IAgentHostResourceService} when * the calling address lacks the required permission. Carries the * {@link ResourceRequestParams} that, if approved, would unlock the * operation, so wire adapters can echo it back to the agent host inside a * `PermissionDenied` frame and let the host run the standard * `resourceRequest` → retry loop. */ export declare class AgentHostResourcePermissionError extends Error { readonly request: ResourceRequestParams | undefined; constructor(request: ResourceRequestParams | undefined); } export interface IResourceReadResult { readonly bytes: VSBuffer; } export interface IResourceListResult { readonly entries: readonly DirectoryEntry[]; }