import type { AgentChatMoveDestination } from "./agentHostChatMove.js"; import type { IAgentHostManagedWorktree, IAgentHostWorktreeCleanupStatus } from "./agentHostWorktreeCleanup.js"; import type { CancellationToken } from "../../../base/common/cancellation.js"; import type { VSBuffer } from "../../../base/common/buffer.js"; import { Event } from "../../../base/common/event.js"; import { IDisposable, IReference } from "../../../base/common/lifecycle.js"; import type { ArtifactIntegrationDescriptor } from "../../artifactIntegrations/common/artifactIntegration.js"; import type { IArtifactIntegrationTransport } from "../../artifactIntegrations/common/artifactIntegrationProtocol.js"; import type { ArtifactChatAction } from "./artifactIntegrationChat.js"; import type { IObservable } from "../../../base/common/observable.js"; import { URI } from "../../../base/common/uri.js"; import type { IConfigurationChangeEvent } from "../../configuration/common/configuration.js"; import { IConfigurationService } from "../../configuration/common/configuration.service.js"; import type { IActiveSubscriptionInfo, IAgentSubscription } from "./state/agentSubscription.js"; import type { IRemoteWatchHandle } from "./agentHostFileSystemProvider.js"; import type { IAgentHostResourceUriMapper } from "./agentHostUri.js"; import type { AgentHostClientConnectionKind, IAgentHostClientTelemetryContext } from "./agentHostTelemetry.js"; import type { IAgentHostTcpConnection } from "./agentHostTcpConnection.js"; import type { IAgentHostFirstResponseDiagnostic } from "./otel/agentHostTiming.js"; import type { IChatUserInteractionTiming } from "@codingame/monaco-vscode-chat-service-override/vscode/vs/platform/otel/common/chatUserInteraction"; import { IDevContainerAgentHostMainService } from "./devContainerAgentHost.service.js"; import type { IAgentHostMcpAuthenticationRequest } from "./agentHostExtensionProtocol.js"; import type { IMcpServerConfiguration } from "../../mcp/common/mcpPlatformTypes.js"; import type { IAgentHostSavedChat, IAgentHostSavedChatContinuation, IAgentHostSavedChatContinuationResult } from "./agentHostSavedChat.js"; import type { CompletionsParams, CompletionsResult, CreateTerminalParams, ResolveSessionConfigResult, SessionConfigCompletionsResult } from "./state/protocol/commands.js"; import type { InitializeResult } from "./state/protocol/common/commands.js"; import type { InvokeChangesetOperationParams, InvokeChangesetOperationResult } from "./state/protocol/channels-changeset/commands.js"; import type { FetchAutomationRunsParams, FetchAutomationRunsResult, ListAutomationTriggerDefinitionsParams, ListAutomationTriggerDefinitionsResult, RunAutomationParams, RunAutomationResult } from "./state/protocol/channels-automation/commands.js"; import type { ActionEnvelope, ClientAutomationAction, ClientAutomationRunAction, INotification, IRootConfigChangedAction, SessionAction, ChatAction, TerminalAction, ClientAnnotationsAction, ClientChangesetAction } from "./state/sessionActions.js"; import type { ContentEncoding, ResourceCopyParams, ResourceCopyResult, ResourceDeleteParams, ResourceDeleteResult, ResourceListResult, ResourceMkdirParams, ResourceMkdirResult, ResourceMoveParams, ResourceMoveResult, ResourceReadResult, ResourceResolveParams, ResourceResolveResult, ResourceWriteParams, ResourceWriteResult, CreateResourceWatchParams, CreateResourceWatchResult } from "./state/sessionProtocol.js"; import { ComponentToState, StateComponents, type RootState } from "./state/sessionState.js"; import { type AgentCanvasDefinitionSnapshot, type AgentProvider, type AuthenticateParams, type AuthenticateResult, type IAgentCanvasCloseRequest, type IAgentCanvasOpenRequest, type IAgentCreateChatRequestOptions, type IAgentCreateChatWorkspace, type IAgentCreateSessionConfig, type IAgentCustomizationInstallation, type IAgentCustomizationInstallationApplyResult, type IAgentCustomizationInstallationRequest, type IAgentCustomizationInstallationReview, type IAgentCustomizationMarketplaceSearchRequest, type IAgentCustomizationMarketplaceSearchResult, type IAgentExtensionInventory, type IAgentHostManagedSettingsSnapshot, type IAgentHostNetworkEndpoint, type IAgentManagedPluginRetryEntry, type IAgentPluginInstallation, type IAgentPluginInstallRequest, type IAgentPluginMarketplace, type IAgentPluginMarketplaceItem, type IAgentPluginMarketplaceRefreshResult, type IAgentPluginMarketplaceRemoveResult, type IAgentPluginUninstallRequest, type IAgentResolveSessionConfigParams, type IAgentSessionConfigCompletionsParams, type IAgentSessionMetadata, type IMcpNotification } from "./agent.js"; export type { IAgent, IAgentChats, IAgentChatContext, IAgentCreateChatOptions, IAgentCreateChatRequestOptions, IAgentCreateChatWorkspace, IAgentCreateChatForkSource, IAgentCreateChatSideChatSelection, IAgentCreateChatSideChatSource, IAgentCreateChatResult, IAgentCreateSessionConfig, IAgentCreateSessionResult, IAgentChatMetadata, IAgentSessionMetadata, IAgentSessionProjectInfo, IAgentLegacyChat, IAgentChatAdoptionResult, IAgentSpawnedChatParent, IAgentSpawnChatEvent, IAgentMaterializeChatEvent, IAgentChatDataChange, IAgentResolveChatConfigParams, IAgentChatConfigCompletionsParams, IAgentResolveSessionConfigParams, IAgentSessionConfigCompletionsParams, IAgentModelInfo, AgentSignal, IAgentActionSignal, IAgentToolPendingConfirmationSignal, IAgentSubagentStartedSignal, IAgentSubagentResumedSignal, IAgentSubagentCompletedSignal, IAgentSteeringConsumedSignal, IMcpNotification, IActiveClient, AgentProvider, IAgentCapabilities, IAgentDescriptor, AuthenticateParams, IAgentHostAuthTokenRequest, AuthenticateResult, IAgentHostNetworkEndpoint, IAgentHostManagedSettingsSnapshot, IAgentPluginUninstallRequest, AgentCanvasDefinitionSnapshot, IAgentCanvasInfo, IAgentCanvasOpenRequest, IAgentCanvasCloseRequest, AgentCanvasExtensionSource, IAgentExtensionInfo, IAgentExtensionInventory, AgentExtensionMode, AgentExtensionSource, AgentExtensionStatus, IAgentCustomizationInstallation, IAgentCustomizationInstallationApplyResult, IAgentCustomizationInstallationRequest, IAgentCustomizationInstallationReview, IAgentCustomizationMarketplaceSearchRequest, IAgentCustomizationMarketplaceSearchResult, IAgentPluginInstallRequest, IAgentManagedPluginRetryEntry, } from "./agent.js"; export { AgentSession, CLAUDE_AGENT_PROVIDER_ID, CODEX_AGENT_PROVIDER_ID, COPILOT_CLI_AGENT_PROVIDER_ID, GITHUB_COPILOT_PROTECTED_RESOURCE, GITHUB_REPO_PROTECTED_RESOURCE, protectedResourcesRequireGitHubCopilotSignIn, resolveAgentChatContext, resolveAgentChatOrigin, resolveSubagentChatParent, resolveAgentHostCustomizations, subagentChatTitle, SubagentChatSignal, } from "./agent.js"; export declare enum AgentHostIpcChannels { /** Channel for the agent host service on the main-process side */ AgentHost = "agentHost", /** Channel for log forwarding from the agent host process */ Logger = "agentHostLogger", /** Channel for WebSocket client connection count (server process management only) */ ConnectionTracker = "agentHostConnectionTracker", /** Channel carrying raw Agent Host Protocol frames over a MessagePort. */ Protocol = "agentHostProtocol", /** Narrow local management channel that remains outside of the AHP data plane. */ Management = "agentHostManagement", /** * Channel registered by the remote server that proxies AHP JSON-RPC * frames between a renderer and the agent host running on the server. * Pairs with `AgentHostIpcChannelTransport` on the renderer side. */ RemoteProxy = "agentHostProxy" } /** VS Code IPC-only launch options, never forwarded over the Agent Host Protocol. */ export interface IAgentHostIpcConnectionOptions { readonly env?: Readonly>; /** Kept separate so the server can apply resolver precedence using its own environment casing. */ readonly debugEnv?: Readonly>; } /** Configuration key that controls whether AHP JSONL logs are written for agent host transports. */ export declare const AgentHostAhpJsonlLoggingSettingId = "chat.agentHost.ahpJsonlLoggingEnabled"; /** * Trusted connection facts retained by the protocol ingress while it asks the * host to submit a create-chat initial message. This is deliberately not part * of the protocol request or provider creation options. */ export interface IAgentCreateChatInitialMessageContext { readonly clientId: string; readonly telemetryContext: IAgentHostClientTelemetryContext; } export type AgentHostDebugLogsArtifactKind = "archive" | "directory"; /** Maximum number of files in one Agent Host debug-log artifact. */ export declare const AGENT_HOST_DEBUG_LOGS_MAX_ENTRIES = 1000; /** * Maximum payload of a single {@link IAgentHostDebugLogsChunk}. Debug-log * artifacts are streamed in chunks of at most this size so a remote agent host * never has to encode a whole archive into one JSON-RPC message. */ export declare const AGENT_HOST_DEBUG_LOGS_CHUNK_BYTES: number; export interface IAgentHostDebugLogsArtifactEntry { readonly path: string; readonly size: number; } export interface IAgentHostDebugLogsArtifact { readonly kind: AgentHostDebugLogsArtifactKind; readonly resource: URI; readonly providerLogsIncluded: boolean; readonly size: number; readonly uncompressedSize: number; /** Exact regular files staged in the artifact. Paths are relative, normalized, and unique. */ readonly entries: readonly IAgentHostDebugLogsArtifactEntry[]; } /** One bounded slice of a debug-log artifact, read via `readDebugLogsChunk`. */ export interface IAgentHostDebugLogsChunk { /** Raw bytes for this slice. Empty once `position` is at or past the end. */ readonly data: VSBuffer; /** `true` when this slice reaches the end of the artifact. */ readonly eof: boolean; } /** Configuration key controlling automatic OS system proxy discovery for agent-host Copilot sessions. */ export declare const AgentHostSystemProxyEnabledSettingId = "chat.agentHost.systemProxy.enabled"; /** Configuration key controlling the GitHub MCP server in agent-host sessions. */ export declare const AgentHostGitHubMcpServerEnabledSettingId = "chat.agentHost.githubMcpServer.enabled"; /** Configuration key offering GitHub's Computer Use plugin to local agent-host Copilot sessions. */ export declare const AgentHostComputerUseEnabledSettingId = "chat.agentHost.computerUse.enabled"; /** Configuration key selecting the automatic session and chat title generation strategy. */ export declare const AgentHostTitleGenerationSettingId = "chat.agentHost.experimental.titleGeneration"; /** Legacy boolean settings migrated to {@link AgentHostTitleGenerationSettingId}. */ export declare const AgentHostActiveAgentTitleGenerationSettingId = "chat.agentHost.experimental.activeAgentTitleGeneration"; export declare const AgentHostDeferredTitleGenerationSettingId = "chat.agentHost.experimental.deferredTitleGeneration"; /** Configuration key enabling cached MCP tool routing and relevance-based authentication prompts. */ export declare const AgentHostMcpToolRoutingEnabledSettingId = "chat.agentHost.experimental.mcpToolRouting"; /** Configuration key enabling rich-link guidance for Markdown plan documents. */ export declare const AgentHostMarkdownPlanRichLinksEnabledSettingId = "chat.agentHost.experimental.markdownPlanRichLinks"; /** Configuration key enabling the initial workspace file-name snapshot in Copilot agent-host chats. */ export declare const AgentHostWorkspaceSnapshotEnabledSettingId = "chat.experimental.workspaceSnapshot"; /** Configuration key controlling Agent Host agent-orchestration safety limits. */ export declare const AgentHostAgentOrchestrationLimitsSettingId = "chat.agentHost.agentOrchestrationLimits"; /** Configuration key gating the artifact tools and their agent instruction. */ export declare const ArtifactToolsSettingId = "chat.artifactTools.enabled"; /** Configuration key gating Canvas extensions and presentation in agent-host sessions. */ export declare const CanvasesEnabledSettingId = "chat.canvases.enabled"; /** Configuration key controlling automatic pull request association for the checked-out branch. */ export declare const AgentHostAutoAttachPullRequestsSettingId = "chat.agentHost.experimental.autoAttachPullRequests"; /** Configuration key controlling whether providers prepare a turn alongside the turn-start checkpoint. */ export declare const AgentHostOverlapProviderPreparationSettingId = "chat.agentHost.experimental.overlapProviderPreparation"; /** Configuration key controlling whether new Copilot drafts start their runtime and MCP servers before the first message. */ export declare const AgentHostPrewarmSessionsSettingId = "chat.agentHost.experimental.prewarmSessions"; /** * Configuration key controlling whether the Claude provider is registered in * the agent host process. When `false`, the agent host skips registering the * Claude provider regardless of SDK availability. Defaults to `true`. * * The agent host process must be restarted for changes to take effect. */ export declare const AgentHostClaudeAgentEnabledSettingId = "chat.agentHost.claudeAgent.enabled"; /** * Configuration key controlling whether the Codex provider is registered in * the agent host process. When `false`, the agent host skips registering the * Codex provider regardless of SDK availability. The setting defaults to * enabled outside Stable and disabled in Stable, subject to its startup * experiment override. The agent host process must be restarted to unregister * a provider that is already running. */ export declare const AgentHostCodexAgentEnabledSettingId = "chat.agentHost.codexAgent.enabled"; /** * Configuration key controlling whether extension-provided BYOK ("bring your * own key") models are published and included in new agent-host sessions. * Changes are synchronized to the running agent host. */ export declare const AgentHostByokModelsEnabledSettingId = "chat.agentHost.byokModels.enabled"; /** * Optional override that points at an **SDK root directory** containing a * `node_modules/@anthropic-ai/claude-agent-sdk` subtree. When set, the agent * host loads the Claude SDK from that path instead of the bare import (which * resolves via this repo's `node_modules` in dev) or the on-demand download * from `product.agentSdks.claude` (built products). Mainly exists for the * remote server's `--claude-sdk-root` CLI flag and for one-off developer * overrides pointing at an out-of-tree SDK build. */ export declare const AgentHostClaudeSdkRootEnvVar = "VSCODE_AGENT_HOST_CLAUDE_SDK_ROOT"; /** * Environment variable form of {@link AgentHostClaudeAgentEnabledSettingId}. * Set by the agent host starters from the setting. Accepts `'true'` / * `'false'`; absent uses the agent host's Claude fallback (`true`). The * starters normally forward the resolved setting explicitly. */ export declare const AgentHostClaudeAgentEnabledEnvVar = "VSCODE_AGENT_HOST_CLAUDE_AGENT_ENABLED"; /** * Environment variable form of `chat.agentHost.multipleChatProviders.enabled`, set by the local agent host starters * only when the setting is on (`'true'`). The host seeds its root `multipleChatProviders.enabled` from it before its * first handshake, so the first `initialize` can already advertise `multipleChatProviders`. The renderer's mirror of * the setting stays authoritative afterwards. Not a control of its own: a mirror of the existing setting. */ export declare const AgentHostMultipleChatProvidersEnabledEnvVar = "VSCODE_AGENT_HOST_MULTIPLE_CHAT_PROVIDERS_ENABLED"; /** * Environment variable form of {@link AgentHostCodexAgentEnabledSettingId}. * Set by the agent host starters from the setting. Accepts `'true'` / * `'false'`; absent uses the host-level fallback (`false`), independently of * the product-quality-specific setting default. The starters normally forward * the resolved setting explicitly. */ export declare const AgentHostCodexAgentEnabledEnvVar = "VSCODE_AGENT_HOST_CODEX_AGENT_ENABLED"; /** Overrides the soft cap on resident session roots. Primarily used by integration tests. */ export declare const AgentHostSessionResidencyLimitEnvVar = "VSCODE_AGENT_HOST_SESSION_RESIDENCY_LIMIT"; /** Overrides the retry delay after a provider temporarily vetoes session release. Primarily used by integration tests. */ export declare const AgentHostSessionReleaseRetryMsEnvVar = "VSCODE_AGENT_HOST_SESSION_RELEASE_RETRY_MS"; /** Overrides how long a changeset read waits for the file snapshots of a running Codex turn. Primarily used by integration tests. */ export declare const AgentHostCodexTurnEditsWaitMsEnvVar = "VSCODE_AGENT_HOST_CODEX_TURN_EDITS_WAIT_MS"; /** * Resolves the effective enable state for a Claude/Codex provider from the * env-var value forwarded by the starter. Recognized values (case- and * whitespace-insensitive): * * - `'true'` / `'1'` → enabled * - `'false'` / `'0'` → disabled * - `undefined`, empty string, or any other value → falls through to * {@link defaultEnabled} */ export declare function isAgentEnabled(envValue: string | undefined, defaultEnabled: boolean): boolean; /** * Selects whether the regular workbench surfaces Codex from the agent host * instead of the OpenAI extension. */ export declare const CodexPreferAgentHostEditorSettingId = "chat.editor.codex.preferAgentHost"; export declare function affectsAgentHostProviderPreference(event: IConfigurationChangeEvent, isSessionsWindow: boolean): boolean; export declare function shouldSurfaceLocalAgentHostProvider(provider: AgentProvider, configurationService: IConfigurationService, isSessionsWindow: boolean): boolean; /** Policy disablement keeps saved history available without enabling the provider. */ export declare function isLocalAgentHostProviderDisabledByPolicy(provider: AgentProvider, configurationService: IConfigurationService): boolean; export declare function getPolicyUnavailableLocalAgentHostProviders(configurationService: IConfigurationService, isSessionsWindow: boolean): readonly AgentProvider[]; /** * Absolute path to the **SDK root directory** containing a * `node_modules/@openai/codex` subtree. When non-empty, the agent host treats * it as a dev override and skips the on-demand download from * `product.agentSdks.codex`. Empty (the default) falls through to product * config; if neither is present, the provider is not registered. */ export declare const AgentHostCodexAgentSdkRootSettingId = "chat.agentHost.codexAgent.sdkRoot"; /** * Optional override for `$CODEX_HOME`. When set, the codex app-server child * process inherits this value, controlling where rollouts and config live. */ export declare const AgentHostCodexAgentCodexHomeSettingId = "chat.agentHost.codexAgent.codexHome"; /** * Additional command-line arguments passed to `codex app-server`. Mainly for * debugging (e.g. `--log-level=debug`). */ export declare const AgentHostCodexAgentBinaryArgsSettingId = "chat.agentHost.codexAgent.binaryArgs"; /** * Environment variable form of {@link AgentHostCodexAgentSdkRootSettingId}. * Forwarded by the starters from the setting. */ export declare const AgentHostCodexAgentSdkRootEnvVar = "VSCODE_AGENT_HOST_CODEX_SDK_ROOT"; /** Forwarded `$CODEX_HOME`. */ export declare const AgentHostCodexAgentCodexHomeEnvVar = "CODEX_HOME"; /** Forwarded extra args for `codex app-server` (JSON-encoded string[]). */ export declare const AgentHostCodexAgentBinaryArgsEnvVar = "VSCODE_AGENT_HOST_CODEX_APP_SERVER_ARGS"; /** Master toggle for agent-host OTel. Explicit opt-in; other settings imply this when set. */ export declare const AgentHostOTelEnabledSettingId = "chat.agentHost.otel.enabled"; /** Exporter type for the SDK's OTel pipeline. One of: `otlp-http`, `otlp-grpc`, `console`, `file`. */ export declare const AgentHostOTelExporterTypeSettingId = "chat.agentHost.otel.exporterType"; /** * OTLP wire protocol (`http/json`, `http/protobuf`, `grpc`). Policy-only delivery slot (no user UI): * carries the enterprise-managed `telemetry.protocol` so it can be threaded into the agent host's * `OTEL_EXPORTER_OTLP_PROTOCOL` env, which the runtime needs to distinguish protobuf from json * (the `exporterType` setting only models transport, not the HTTP wire encoding). */ export declare const AgentHostOTelOtlpProtocolSettingId = "chat.agentHost.otel.otlpProtocol"; /** OTLP endpoint URL when `exporterType` is `otlp-http` or `otlp-grpc`. */ export declare const AgentHostOTelOtlpEndpointSettingId = "chat.agentHost.otel.otlpEndpoint"; /** Whether to include prompt/response content in span attributes (privacy-sensitive). */ export declare const AgentHostOTelCaptureContentSettingId = "chat.agentHost.otel.captureContent"; /** Policy delivery slot for identity capture in the host-owned OTel pipeline. */ export declare const AgentHostOTelCaptureIdentitySettingId = "chat.agentHost.otel.captureIdentity"; /** Output path when `exporterType` is `file`. */ export declare const AgentHostOTelOutfileSettingId = "chat.agentHost.otel.outfile"; /** Policy-only delivery slot for the enterprise-managed OTel `service.name` (no user UI). */ export declare const AgentHostOTelServiceNameSettingId = "chat.agentHost.otel.serviceName"; /** Policy-only delivery slot for enterprise-managed OTel resource attributes (no user UI). */ export declare const AgentHostOTelResourceAttributesSettingId = "chat.agentHost.otel.resourceAttributes"; /** When true, ALL spans are persisted to a local SQLite store regardless of `exporterType`. */ export declare const AgentHostOTelDbSpanExporterEnabledSettingId = "chat.agentHost.otel.dbSpanExporter.enabled"; /** * Path of the local SQLite span database, relative to `INativeEnvironmentService.userDataPath`. * Kept here so both the renderer-side export action and the agent-host-side service * use the same on-disk location. */ export declare const AgentHostOTelSpansDbSubPath = "agent-host/otel/agent-host-traces.db"; /** * Environment variables consumed by `AgentHostOTelService` inside the agent host * process. The workbench-side agent-host starters translate the corresponding * `chat.agentHost.otel.*` settings into these variables (settings → env), while * any value already present on the parent process's env wins (developer override). * * These names match the conventions documented in * `extensions/copilot/docs/monitoring/agent_monitoring.md` so the same external * tooling and `OTEL_EXPORTER_OTLP_*` config recipes work unchanged. */ export declare const AgentHostOTelEnvVars: Readonly<{ readonly Enabled: "COPILOT_OTEL_ENABLED"; readonly ExporterType: "COPILOT_OTEL_EXPORTER_TYPE"; readonly OtlpEndpoint: "OTEL_EXPORTER_OTLP_ENDPOINT"; readonly OtlpEndpointAlt: "COPILOT_OTEL_ENDPOINT"; readonly OtlpTracesEndpoint: "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT"; readonly OtlpMetricsEndpoint: "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT"; readonly OtlpProtocol: "OTEL_EXPORTER_OTLP_PROTOCOL"; readonly OtlpProtocolAlt: "COPILOT_OTEL_PROTOCOL"; readonly OtlpTracesProtocol: "OTEL_EXPORTER_OTLP_TRACES_PROTOCOL"; readonly OtlpMetricsProtocol: "OTEL_EXPORTER_OTLP_METRICS_PROTOCOL"; readonly OtlpHeaders: "OTEL_EXPORTER_OTLP_HEADERS"; readonly OtlpTracesHeaders: "OTEL_EXPORTER_OTLP_TRACES_HEADERS"; readonly OtlpMetricsHeaders: "OTEL_EXPORTER_OTLP_METRICS_HEADERS"; readonly CaptureContent: "OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT"; readonly CaptureIdentity: "COPILOT_OTEL_CAPTURE_IDENTITY"; readonly FilePath: "COPILOT_OTEL_FILE_EXPORTER_PATH"; readonly FilePathIsManaged: "VSCODE_AGENT_HOST_OTEL_FILE_PATH_IS_MANAGED"; readonly SourceName: "COPILOT_OTEL_SOURCE_NAME"; readonly ServiceName: "OTEL_SERVICE_NAME"; readonly ResourceAttributes: "OTEL_RESOURCE_ATTRIBUTES"; readonly DbSpanExporterEnabled: "COPILOT_OTEL_DB_SPAN_EXPORTER_ENABLED"; }>; /** * Snapshot of the `chat.agentHost.otel.*` settings; produced by the workbench-side * starters and merged with the parent process's env (env wins on key collision). */ export interface IAgentHostOTelSettings { readonly enabled?: boolean; readonly exporterType?: string; readonly otlpProtocol?: string; readonly otlpEndpoint?: string; readonly captureContent?: boolean; readonly captureIdentity?: boolean; readonly outfile?: string; readonly serviceName?: string; readonly resourceAttributes?: Record; readonly dbSpanExporterEnabled?: boolean; } /** * IPC channel (renderer -> main) the desktop agent-host path uses to hand the * enterprise-resolved `chat.agentHost.otel.*` policy to `ElectronAgentHostStarter`. * * The main-process configuration service does NOT include the renderer-only * `AccountPolicyService` (managed settings: server / native-MDM / file channels), so a * starter running in the main process sees `policyValue === undefined` for these keys. * The renderer — whose policy layer does include managed settings — forwards the resolved * values here just before requesting the agent-host connection, so the host is spawned with * the managed OTel env. See {@link readAgentHostOTelPolicySettings}. */ export declare const AgentHostOTelPolicyIpcChannel = "vscode:agentHostOTelPolicy"; /** Whether the renderer has a settled policy rather than startup/refresh placeholders. */ export interface IAgentHostOTelPolicyReadiness { isReady(): boolean; readonly onDidChange: Event; } /** Renderer-to-main request to replace the shared local Agent Host process. */ export declare const AgentHostRestartIpcChannel = "vscode:restartAgentHost"; /** Main-to-renderer notification sent before replacement so each local client reconnects immediately. */ export declare const AgentHostWillRestartIpcChannel = "vscode:agentHostWillRestart"; /** * Resolve the enterprise-policy values for the `chat.agentHost.otel.*` settings from a * configuration service whose policy layer includes managed settings (i.e. the renderer's). * Each field is `undefined` when no policy is set. Intended as the `policySettings` argument * of {@link buildAgentHostOTelEnv}. */ export declare function readAgentHostOTelPolicySettings(configurationService: IConfigurationService): IAgentHostOTelSettings; /** * Validate/normalize an {@link IAgentHostOTelSettings} received over IPC, keeping only * well-typed fields. Defends the main process against a malformed payload before the values * are turned into agent-host process env vars. */ export declare function sanitizeAgentHostOTelPolicySettings(raw: unknown): IAgentHostOTelSettings; /** Tracks renderer-forwarded policy and coalesces restart requests until the host starts. */ export declare class AgentHostOTelPolicyState { private _policy; private _restartPending; private _hasSettledPolicy; get policy(): IAgentHostOTelSettings | undefined; update(raw: unknown, agentHostRunning: boolean, ready?: boolean): boolean; didStart(): void; } /** * Build the env-var overlay for the agent host process from user settings and * inherited env. Settings are translated to env vars, but if the same env var is * already present on `inheritedEnv` it wins (developer override). * * Only sets a key when the underlying setting was explicitly configured — empty * string / undefined settings are dropped so they don't shadow inherited env. * Resolved shell env participates only in identity capture; other keys retain * their existing process-env/settings precedence. */ export declare function buildAgentHostOTelEnv(settings: IAgentHostOTelSettings, inheritedEnv: Readonly>, policySettings?: IAgentHostOTelSettings, shellEnv?: Readonly>): Record; /** * Settings -> env-var fan-out for the Claude/Codex SDK overrides that the * agent host process consumes. Shared by both starters * (`nodeAgentHostStarter.ts`, `electronAgentHostStarter.ts`) so they don't * drift the next time someone adds a setting. * * The shape mirrors {@link buildAgentHostOTelEnv}: only set a key when the * underlying setting has a non-empty value AND the inherited env doesn't * already define it (developer override wins). Returns a partial env map * the caller spreads into the spawned child's environment. */ export interface IAgentSdkStarterSettings { readonly codexSdkRoot?: string; readonly codexHome?: string; readonly codexBinaryArgs?: readonly string[]; readonly claudeAgentEnabled?: boolean; readonly codexAgentEnabled?: boolean; /** `chat.agentHost.multipleChatProviders.enabled`; forwarded only when on, so with it off the env is unchanged. */ readonly multipleChatProvidersEnabled?: boolean; } export declare function buildAgentSdkEnv(settings: IAgentSdkStarterSettings, inheritedEnv: Readonly>): Record; /** Result of starting the agent host WebSocket server on-demand. */ export interface IAgentHostSocketInfo { readonly socketPath: string; } /** Inspector listener information for the agent host process. */ export interface IAgentHostInspectInfo { readonly host: string; readonly port: number; /** A `devtools://` URL that can be opened with `INativeHostService.openDevToolsWindow`. */ readonly devtoolsUrl: string; } /** Host-level network context for diagnostics, produced by {@link IAgentConnection.getNetworkDiagnosticsInfo}. */ export interface IAgentHostNetworkDiagnosticsInfo { /** Agent host product version. */ readonly version: string; /** Operating system platform of the agent host process (`process.platform`). */ readonly os: string; /** CPU architecture of the agent host process (`process.arch`). */ readonly arch: string; /** Authenticated GitHub account login, when known. */ readonly account?: string; /** VS Code `http.*` proxy settings observed by the agent host, keyed by setting id (only those that are set). */ readonly proxySettings: Readonly>; /** Proxy-related environment variables observed by the agent host process, keyed by name (only those that are set). */ readonly proxyEnv: Readonly>; /** Endpoints the agent host suggests probing via {@link IAgentConnection.diagnosticsFetch}. */ readonly endpoints: readonly IAgentHostNetworkEndpoint[]; } export interface IAgentHostManagedSettingsDiagnostics { readonly provider: AgentProvider; readonly snapshot?: IAgentHostManagedSettingsSnapshot; readonly error?: string; } /** Result of a DNS lookup for a single address family, part of {@link IAgentHostNetworkFetchResult}. */ export interface IAgentHostDnsResult { /** The resolved address, when the lookup succeeded. */ readonly address?: string; /** Time taken by the lookup, in milliseconds. */ readonly durationMs?: number; /** Lookup error message, when it failed. */ readonly error?: string; } /** Result of a single connectivity probe, produced by {@link IAgentConnection.diagnosticsFetch}. */ export interface IAgentHostNetworkFetchResult { /** The URL that was probed. */ readonly url: string; /** The resolved proxy URL for this endpoint, or `undefined` for a direct connection. */ readonly proxyUrl?: string; /** IPv4 DNS lookup result for the host. */ readonly dnsIpv4?: IAgentHostDnsResult; /** IPv6 DNS lookup result for the host. */ readonly dnsIpv6?: IAgentHostDnsResult; /** HTTP status code from the probe, when a response arrived. */ readonly statusCode?: number; /** HTTP status message from the probe, when a response arrived. */ readonly statusMessage?: string; /** Response body text (possibly truncated), when a response arrived. Callers use it to check expected content. */ readonly body?: string; /** Time taken by the reachability probe, in milliseconds. */ readonly durationMs?: number; /** Probe error message, when the connection failed. */ readonly error?: string; } /** * IPC service exposed on the {@link AgentHostIpcChannels.ConnectionTracker} * channel. Used by the server process for lifetime management and by the * shared process to request a local WebSocket listener on-demand. */ export interface IConnectionTrackerService { readonly onDidChangeConnectionCount: Event; /** Resolves after the WebSocket listener configured at process startup is bound. */ waitForConfiguredWebSocketServer(): Promise; /** * Request the agent host to start a WebSocket server on a local * pipe/socket. Returns the socket path. * If a server is already running, returns the existing info. */ startWebSocketServer(): Promise; /** * Get inspector listener info for the agent host process. If the inspector * is not currently active and `tryEnable` is true, opens the inspector on * a random local port. Returns `undefined` if the inspector cannot be * enabled (e.g. running in an environment without `node:inspector`). */ getInspectInfo(tryEnable: boolean): Promise; } /** * Narrow renderer-to-local-agent-host control surface. All stateful agent * operations travel over {@link AgentHostIpcChannels.Protocol}. */ export interface IMissionControlOptions { readonly baseUrl: string; readonly name?: string; readonly accountId: string; readonly credential: string; readonly roots: readonly string[]; /** Catalogue entries, separate from filesystem grants. Defaults to the granted roots when omitted. */ readonly projects?: readonly string[]; readonly defaultDirectory?: string; /** Host-owned default parent for repository clones; clients can only override it within existing grants. */ readonly cloneRoot?: string; readonly live?: boolean; readonly requireConnectionBinding?: boolean; /** Explicit host-owner opt-in to use local Copilot credentials for same-owner relay clients. */ readonly useLocalCredentials?: boolean; /** Explicit host-owner testing override; omit device remote-control policy from Mission Control registration. */ readonly ignoreRemoteControlPolicy?: boolean; /** Host-owner development override; omit project metadata from mirrored session events. */ readonly disableRepositoryMetadata?: boolean; } /** Stateless sealing on trusted local IPC; this surface is not exposed through AHP. */ export interface IMissionControlCredentialSealingRequest { readonly token: string; readonly resource: string; readonly key: { readonly key_id: string; readonly use: "auth-token" | "mcp-auth-token"; readonly algorithm: string; readonly public_key: string; }; readonly challenge?: string; } export interface IAgentHostManagementService { readonly _serviceBrand: undefined; /** Opt-in Mission Control ingress configured through trusted local IPC. */ configureMissionControl(options: IMissionControlOptions | undefined, withdrawingAccountId?: string): Promise; sealMissionControlCredential(request: IMissionControlCredentialSealingRequest): Promise; getMissionControlEnvironmentId(): Promise; getMissionControlEnvironmentName(): Promise; /** * Local-only compatibility path for session fields not yet represented by * AHP `createSession` (`model`, `agent`, and `importConversation`). */ createSessionWithExtensions(config: IAgentCreateSessionConfig): Promise; /** * Local-only compatibility path for chat fields not yet represented by AHP * `createChat` (`model`). */ createChatWithExtensions(session: URI, chat: URI, options: IAgentCreateChatRequestOptions): Promise; /** Installs the chat's sandbox CA through trusted local management IPC after user consent, preserving its advertised identity. */ installSandboxCertificate(chat: string, scopeId: string): Promise; rotateSandboxCertificate(chat: string, scopeId: string): Promise; removeSandboxCertificate(chat: string, scopeId: string): Promise; createDetachedWorktree(session: URI, prompt: string): Promise<{ handle: string; worktree: URI; }>; setDetachedWorktreeArchived(handle: string, archived: boolean): Promise; claimDetachedWorktree(handle: string): Promise; deleteDetachedWorktree(handle: string): Promise; reconcileDetachedWorktrees(scope: string, activeHandles: readonly string[]): Promise; /** Local-only bridge for refreshing live Copilot sessions after Connector membership or authorization changes. */ refreshCopilotConnectorSessions(forceConnectorName?: string): Promise; /** Local-only bridge for provider-owned persisted plugin inventory. */ listPluginInstallations(provider: AgentProvider, session?: URI, chat?: URI): Promise; /** Local-only bridge for provider-owned plugin uninstall transactions. */ uninstallPlugin(provider: AgentProvider, request: IAgentPluginUninstallRequest, session?: URI, chat?: URI): Promise; setPluginEnabled(provider: AgentProvider, plugin: string, enabled: boolean): Promise; listAgentExtensions(session?: URI, chat?: URI): Promise; setAgentExtensionEnabled(extensionId: string, enabled: boolean, session?: URI, chat?: URI): Promise; /** Returns `undefined` while the provider registry is unsettled; the provider must publish a canvas change after it settles. */ listSessionCanvases(session: URI, chat: URI): Promise; openSessionCanvas(session: URI, request: IAgentCanvasOpenRequest, chat: URI): Promise; closeSessionCanvas(session: URI, request: IAgentCanvasCloseRequest, chat: URI): Promise; /** Local-only bridge for provider-owned plugin install transactions. */ installPlugin(provider: AgentProvider, request: IAgentPluginInstallRequest, session?: URI, chat?: URI): Promise; /** Local-only bridge for retrying the plugins a live chat's managed settings require. */ retryManagedPlugins(provider: AgentProvider, session: URI, chat?: URI): Promise; listPluginMarketplaces(provider: AgentProvider, session: URI, chat?: URI): Promise; addPluginMarketplace(provider: AgentProvider, session: URI, source: string, chat?: URI): Promise; browsePluginMarketplace(provider: AgentProvider, session: URI, name: string, chat?: URI): Promise; removePluginMarketplace(provider: AgentProvider, session: URI, name: string, force?: boolean, chat?: URI): Promise; refreshPluginMarketplaces(provider: AgentProvider, session: URI, name?: string, chat?: URI): Promise; searchCustomizationMarketplace(provider: AgentProvider, session: URI, request: IAgentCustomizationMarketplaceSearchRequest): Promise; listCustomizationInstallations(provider: AgentProvider, session: URI): Promise; prepareCustomizationInstallation(provider: AgentProvider, session: URI, request: IAgentCustomizationInstallationRequest | { readonly installationId: string; }): Promise; applyCustomizationInstallation(provider: AgentProvider, operationId: string): Promise; recoverCustomizationInstallations(provider: AgentProvider, session: URI): Promise; addMcpServerConfiguration(provider: AgentProvider, name: string, config: IMcpServerConfiguration): Promise; /** * Local-only bridge for the owning client process to report whether the * machine is fully awake, rather than asleep or in a background maintenance wake. */ setSystemFullyAwake(fullyAwake: boolean): Promise; /** * Local-only bridge for the owning client process to report whether the network is online after a full wake, so * scheduled work waits for it. */ setSystemNetworkOnline(online: boolean): Promise; /** * Local-only bridge for the owning client process to report that macOS changed which apps it trusts to control the * computer through Accessibility. */ reportMacAccessibilityTrustChange(): Promise; shutdown(): Promise; getNetworkDiagnosticsInfo(): Promise; getManagedSettingsDiagnostics(): Promise; diagnosticsFetch(url: string): Promise; getSessionStateFile(session: URI, chat?: URI): Promise; collectDebugLogs(session: URI | undefined, kind: AgentHostDebugLogsArtifactKind, chat?: URI, progressToken?: string): Promise; cancelDebugLogs?(progressToken: string): Promise; readDebugLogsChunk(resource: URI, position: number): Promise; startWebSocketServer(): Promise; getInspectInfo(tryEnable: boolean): Promise; } /** * Service contract for communicating with the agent host process. Methods here * are proxied across MessagePort via `ProxyChannel`. * * State is synchronized via the subscribe/unsubscribe/dispatchAction protocol. * Clients observe root state (agents, models) and session state via subscriptions, * and mutate state by dispatching actions (e.g. session/turnStarted, session/turnCancelled). */ /** * Host-side `createSession` input: the shared client config plus the capability of * the requesting connection. `legacyChatUris` is `true` when the requester cannot * address opaque chat URIs and `false` when it can; `undefined` lets the host * decide from the client that initiated the session. */ export interface IAgentServiceCreateSessionConfig extends IAgentCreateSessionConfig { readonly legacyChatUris: boolean | undefined; } /** * Consumer-facing connection to an agent host. Session handlers, terminal * contributions, and other features program against this interface. * * Implementations wrap an {@link IAgentService} and layer subscription * management and optimistic write-ahead on top. */ export interface IAgentConnection { /** Opens a private, non-resumable stream in the connected host's network. */ openTcpConnection?(target: { host: string; port: number; }): Promise; readonly connectionAvailable?: IObservable; readonly artifactIntegrationTransport?: IArtifactIntegrationTransport; dispatchBackgroundChatAction?(chat: string, action: ArtifactChatAction): Promise; /** * Offers integrations this client coordinates to the host. A fresh server is created for each connection * and disposed when that connection ends, so the host's subscriptions never outlive it. Disposal withdraws the offer. */ serveArtifactIntegrations?(createServer: () => IArtifactIntegrationTransport & IDisposable, integrations: IObservable): IDisposable; /** Available for capable hosts, including while reconnecting; absent after permanent disconnection. */ readonly devContainerService?: IDevContainerAgentHostMainService; readonly clientId: string; /** Client-owned connection classification, independent of host identities and provider names. */ readonly clientConnectionKind?: AgentHostClientConnectionKind; readonly resourceUris: IAgentHostResourceUriMapper; readonly rootState: IAgentSubscription; /** * Acquire a refcounted subscription to `resource`. `owner` names the * caller holding the reference so inspection surfaces can attribute who * is retaining a subscription; use a stable identifier such as the * acquiring class name. */ getSubscription(kind: T, resource: URI, owner: string): IReference>; getSubscriptionUnmanaged(kind: T, resource: URI): IAgentSubscription | undefined; /** * Returns the in-flight `createSession` Promise for `resource`, or `undefined` if no create is pending. Callers * that need to gate work on a racing eager `createSession` (e.g. before deciding whether to fall through to a * duplicate create) should await this first. */ getInflightSessionCreate(resource: URI): Promise | undefined; /** * Read-only descriptors of every active resource subscription on this * connection, for inspection/debug surfaces. Excludes the always-live * {@link rootState}. */ getActiveSubscriptions(): readonly IActiveSubscriptionInfo[]; /** * Dispatch a client-originated action. `channel` is the protocol URI * string identifying the channel the action targets (a session URI for * session actions, terminal URI for terminal actions, or * `ROOT_STATE_URI` for root-config actions). Strings are used rather * than {@link URI} objects so authority-less scheme URIs like * `ahp-root://` survive the wire format without normalization. */ dispatch(channel: string, action: SessionAction | ChatAction | TerminalAction | ClientChangesetAction | ClientAnnotationsAction | ClientAutomationAction | ClientAutomationRunAction | IRootConfigChangedAction): void; /** Wait for the authoritative action echo, including any rejection, or cancellation; the caller must hold the subscription until settlement. */ dispatchConfirmed(channel: string, subscription: IAgentSubscription, action: SessionAction | ChatAction | TerminalAction | ClientChangesetAction | ClientAnnotationsAction | ClientAutomationAction | ClientAutomationRunAction | IRootConfigChangedAction, token: CancellationToken): Promise; readonly onDidNotification: Event; readonly onDidAction: Event; /** * Fires when the host forwards an MCP server notification (e.g. * `notifications/tools/list_changed`) over the `mcp://` side channel. * The `channel` field on the notification routes the payload to the * matching {@link McpServerCustomization}. */ readonly onMcpNotification: Event; /** * Send a request on an `mcp://` AHP side channel. `channel` is the * `mcp://` URI advertised by the matching {@link McpServerCustomization} * (only available while the server is `ready`). `method` is the raw MCP * JSON-RPC method (e.g. `tools/call`, `resources/read`, * `sampling/createMessage`); `params` are the JSON-RPC params (the * connection adds the routing envelope's `channel` field automatically). * * Rejects with an `Error` whose message begins with `Method not found` * when the channel is unknown or the host doesn't recognise the method. */ handleMcpRequest(channel: string, method: string, params: Record | undefined): Promise; /** Requires the saved-chat capability advertised by the local native host. */ readSavedChat?(session: URI, chat?: URI): Promise; /** Requires the local native host's saved-chat continuation capability. */ completeSavedChatContinuation?(request: IAgentHostSavedChatContinuation): Promise; /** Best-effort renderer diagnostics; supported only by hosts advertising the OTel timing capability. */ reportFirstResponse?(diagnostic: IAgentHostFirstResponseDiagnostic): Promise; reportUserInteraction?(timing: IChatUserInteractionTiming): Promise; /** Registers a connection-scoped handler that supplies MCP authentication without prompting. */ registerMcpAuthenticationHandler?(handler: (request: IAgentHostMcpAuthenticationRequest) => Promise): IDisposable; authenticate(params: AuthenticateParams): Promise; listSessions(): Promise; createSession(config?: IAgentCreateSessionConfig): Promise; /** Requires the Automation history capability; returns exact backend session URIs deleted by this request. */ deleteAutomation?(resource: string, deleteHistory: boolean, legacySessions?: readonly URI[], requestId?: string): Promise; acknowledgeAutomationDeletion?(requestId: string): Promise; /** Requires the VS Code session import capability advertised by initialize. */ importSession?(session: URI): Promise; /** * Moves a session whose only chat is its default chat under `destination` (placed after `after`, `undefined`: * first) and resolves to `destination`. Rejects with `AgentHostSessionMoveUnsupportedError`, without a request, * when the host doesn't advertise `vscode.sessionMove`. */ moveSession(session: URI, destination: URI, after: URI | undefined): Promise; /** * Moves `chat` (AHP `moveChat`) within its session, into another session, or into a new session, and resolves to * its owning session after the move. A host refusal rejects with a `ProtocolError` whose `data.reason` is an * `AgentChatMoveRefusal`. */ moveChat(chat: URI, destination: AgentChatMoveDestination): Promise; /** Requires the VS Code artifact removal capability advertised by initialize. */ removeSessionArtifact?(session: URI, artifactId: string): Promise; /** Only for background work whose `_meta` the host marked stoppable. Resolves false when it had already finished. */ stopBackgroundWork?(chat: URI, id: string): Promise; /** Whether this connection can install through trusted local management or an advertised remote capability. */ readonly sandboxCertificateInstallationSupported?: IObservable; /** Requires installation support and explicit user consent. The advertised chat identity must not be URI-normalized. */ installSandboxCertificate?(chat: string, scopeId: string): Promise; readonly sandboxCertificateRotationSupported?: IObservable; /** Replaces the stored CA and establishes OS trust, after explicit user consent. */ rotateSandboxCertificate?(chat: string, scopeId: string): Promise; readonly sandboxCertificateRemovalSupported?: IObservable; /** Removes OS trust only, after explicit user consent. */ removeSandboxCertificate?(chat: string, scopeId: string): Promise; /** Refresh a held subscription through the standard subscribe request, preserving pending actions. */ refreshSubscription?(resource: URI): Promise; createDetachedWorktree?(session: URI, prompt: string): Promise<{ handle: string; worktree: URI; }>; claimDetachedWorktree?(handle: string): Promise; setDetachedWorktreeArchived?(handle: string, archived: boolean): Promise; deleteDetachedWorktree?(handle: string): Promise; reconcileDetachedWorktrees?(scope: string, activeHandles: readonly string[]): Promise; listAgentExtensions?(session?: URI, chat?: URI): Promise; setAgentExtensionEnabled?(extensionId: string, enabled: boolean, session?: URI, chat?: URI): Promise; /** Returns `undefined` while the provider registry is unsettled; the host later publishes a canvas change after it settles. */ listSessionCanvases?(session: URI, chat: URI): Promise; openSessionCanvas?(session: URI, request: IAgentCanvasOpenRequest, chat: URI): Promise; /** Local-only: closes a canvas the chat presents, which notifies its canvas provider. */ closeSessionCanvas?(session: URI, request: IAgentCanvasCloseRequest, chat: URI): Promise; resolveSessionConfig(params: IAgentResolveSessionConfigParams): Promise; sessionConfigCompletions(params: IAgentSessionConfigCompletionsParams): Promise; completions(params: CompletionsParams): Promise; listAutomationTriggerDefinitions(params: ListAutomationTriggerDefinitionsParams): Promise; runAutomation(params: RunAutomationParams): Promise; fetchAutomationRuns(params: FetchAutomationRunsParams): Promise; /** * Trigger characters announced by the connected agent host that should * cause the client to issue a `completions` request when typed in a * user-message input. Resolves once on first request and is cached. */ getCompletionTriggerCharacters(): Promise; /** * The host's `initialize` handshake result, exposed observably so callers * can derive advertised capabilities (e.g. {@link InitializeResult.terminalCommandPrefix}, * {@link InitializeResult.completionTriggerCharacters}). `undefined` until * the handshake completes. */ readonly initializeResult: IObservable; disposeSession(session: URI): Promise; /** * Host-level network context for diagnostics (version, OS/arch, account, * proxy settings/env, endpoints). Runs on the agent host process (local or * remote), so the result reflects the environment the Copilot SDK actually * runs in. */ getNetworkDiagnosticsInfo(): Promise; /** Resolve managed settings through each provider's native SDK/runtime implementation. */ getManagedSettingsDiagnostics(): Promise; /** * Probe connectivity from the agent host to a single `url`. Runs on the * agent host process (local or remote), so the result reflects the * environment the Copilot SDK actually runs in. */ diagnosticsFetch(url: string): Promise; getSessionStateFile(session: URI, chat?: URI): Promise; collectDebugLogs(session: URI | undefined, kind: AgentHostDebugLogsArtifactKind, chat?: URI, progressToken?: string): Promise; cancelDebugLogs?(progressToken: string): Promise; /** * Read one bounded slice of an artifact previously returned by * {@link collectDebugLogs}. Only artifacts this host produced are readable. */ readDebugLogsChunk(resource: URI, position: number): Promise; /** * Create an additional peer chat inside an existing session. `chat` is a * client-chosen chat URI (see {@link buildChatUri}). The host adds the * chat to the session's catalog and publishes `session/chatAdded`. */ createChat(session: URI, chat: URI, options?: IAgentCreateChatRequestOptions, initialMessageContext?: IAgentCreateChatInitialMessageContext): Promise; /** * Applies `workspace` to an existing peer chat that has not started a turn * (VS Code extension request `vscode/setChatWorkspace`): the host prepares * the folder, worktree or scratch folder and rebinds the chat to it. Rejects * without a request when the host doesn't advertise `vscode.createChatWorkspace`. */ setChatWorkspace(chat: URI, workspace: IAgentCreateChatWorkspace): Promise; /** Dispose an additional chat created via {@link createChat}. */ disposeChat(chat: URI): Promise; createTerminal(params: CreateTerminalParams): Promise; disposeTerminal(terminal: URI): Promise; invokeChangesetOperation(params: InvokeChangesetOperationParams): Promise; /** Estimates reclaimable allocation on local or remote hosts, optionally cached for an idle session. Unsupported hosts must not fall back to per-file RPCs. */ measureWorktreeDiskUsage?(root: URI, token: CancellationToken, session?: URI): Promise; sessionWorktreeCleanup?(session: URI, retry: boolean, force?: boolean): Promise; listManagedWorktrees?(repositories: readonly URI[]): Promise; cleanupManagedWorktree?(repository: URI, worktree: URI, branch: string, force?: boolean): Promise; resourceList(uri: URI): Promise; resourceRead(uri: URI, encoding?: ContentEncoding): Promise; resourceWrite(params: ResourceWriteParams): Promise; resourceCopy(params: ResourceCopyParams): Promise; resourceDelete(params: ResourceDeleteParams): Promise; resourceMove(params: ResourceMoveParams): Promise; resourceResolve(params: ResourceResolveParams): Promise; resourceMkdir(params: ResourceMkdirParams): Promise; createResourceWatch(params: CreateResourceWatchParams): Promise; /** * Convenience method that bundles * {@link createResourceWatch} + {@link subscribe} + a typed * {@link IFileChange}[] event stream, so consumers (notably * `AHPFileSystemProvider.watch`) can drive a watcher without * understanding the underlying channel protocol. Disposing the * returned handle unsubscribes. */ watchResource(params: CreateResourceWatchParams): Promise; }