import type { URI } from "../../../base/common/uri.js"; import type { IAgentConnection } from "./agentService.js"; import type { DefaultChangesetKind } from "./changesetUri.js"; /** * Chat-session resource scheme prefix for the window's ambient/local agent * host: `agent-host-`. * * Remote agent host session schemes (`remote--`) are * handled by `agentHostSessionType.ts` (`isRemoteAgentHostSessionType` and * friends), which also owns the authority disambiguation. */ export declare const LOCAL_AGENT_HOST_SCHEME_PREFIX = "agent-host-"; /** * Reserved connection authority for the window's ambient/primary agent host. * * NOTE: "ambient" is not the same as "local". In a local window the ambient * host is the in-process utility agent host; in a window attached to a remote * authority the ambient host is itself remote (the `EditorRemoteAgentHostServiceClient`). * The `'local'` string is reserved/canonical for this ambient connection — it * is already used as the agent-host URI authority for in-window resources * (see `toAgentHostUri` in `agentHostUri.ts`). */ export declare const AMBIENT_AGENT_HOST_AUTHORITY = "local"; /** * A descriptor for a single agent-host connection exposed by * {@link IAgentHostConnectionsService}. Covers both the window's ambient host * and every connected remote host with one uniform shape. */ export interface IAgentHostConnectionInfo { /** * Sanitized connection authority. The ambient host uses * {@link AMBIENT_AGENT_HOST_AUTHORITY}; remotes use the authority derived * from their address via `agentHostAuthority`. */ readonly authority: string; /** Raw remote address. `undefined` for the ambient host. */ readonly address: string | undefined; /** Human-readable label for the connection. */ readonly name: string; /** * `true` for the window's ambient/primary host. Remember this host may * itself be remote in a remote window — see {@link AMBIENT_AGENT_HOST_AUTHORITY}. */ readonly isAmbient: boolean; /** The live connection, or `undefined` when not currently connected. */ readonly connection: IAgentConnection | undefined; } /** * The result of resolving a chat-session resource to its backing agent host: * the owning {@link IAgentConnection}, its authority, and the canonical backend * agent-session URI used for protocol operations on that connection. */ export interface IAgentHostSessionIdentity { readonly connectionAuthority: string; /** Provider-owned remote address, retained even when the live connection has been removed. */ readonly connectionAddress?: string; readonly backendSession: URI; /** The backend resource was advertised, not reconstructed by the bounded legacy fallback. */ readonly backendSessionIsAdvertised?: true; readonly defaultChangesetKind?: DefaultChangesetKind; } export interface IAgentHostSessionResolution extends IAgentHostSessionIdentity { readonly connection: IAgentConnection; } /** Provider-owned policy needed to resolve a workbench session resource back to its host. */ export interface IAgentHostSessionResolutionPolicy { readonly connectionAddress?: string; readonly sessionSchemeAlias?: IAgentHostSessionSchemeAlias; readonly defaultChangesetKind?: DefaultChangesetKind; } /** The UI and backend schemes for a session whose provider and host identities differ. */ export interface IAgentHostSessionSchemeAlias { readonly ui: string; readonly backend: string; } /** * Whether a link's `chatId` addresses the session's advertised default chat * (rule 7 matching). Reads the cached session state and, when the session is * not subscribed, the host's session listing summary. `false` when neither * knows the session. */ export declare function isDefaultChatLinkId(connection: IAgentConnection, backendSession: URI, chatId: string): Promise;