import { URI } from "../../../../../../base/common/uri.js"; import type { IAgentConnection } from "../../../../../../platform/agentHost/common/agentService.js"; import { ILogService } from "../../../../../../platform/log/common/log.service.js"; /** The parts of an agent host connection that record which session owns a chat. */ export type AgentHostChatOwnerSource = Pick; /** How long a chat owner lookup waits for one host before skipping it. */ export declare const AGENT_HOST_CHAT_OWNER_TIMEOUT_MS = 5000; /** The session that owns a chat, with that session's advertised default chat. */ export interface IAgentHostChatOwner { readonly session: string; /** `undefined` when the owner's state or record names no default chat. */ readonly defaultChat: string | undefined; /** Whether the chat is the owner's default chat. */ readonly isDefaultChat: boolean; } /** The session that owns a chat, resolved on the host connection that holds it. */ export interface IResolvedAgentHostChatOwner { readonly session: URI; /** `undefined` when the owner's state or record names no default chat. */ readonly defaultChat: string | undefined; /** The authority of the host connection that owns the session. */ readonly connectionAuthority: string; } /** The subscribed session whose state lists `chat` as its default chat or one of its chats. */ export declare function findChatOwnerInSubscribedState(connection: AgentHostChatOwnerSource, chat: string): IAgentHostChatOwner | undefined; /** The session whose host record lists `chat`, its default chat included. */ export declare function findChatOwnerInSessionRecords(connection: AgentHostChatOwnerSource, chat: string): Promise; /** * Resolves the session that owns a backend chat on the one host connection * that holds it: first from session state this client already holds, then * from that host's session records, waiting at most `timeoutMs`. A chat * reference never crosses agent hosts, so callers pass the connection of the * chat that shows the reference; no other host is consulted. A value that is * not a chat channel is a session URI and owns itself. Returns the owner's * advertised default chat and `connectionAuthority` with it. Never derives the * owner or the default chat from the chat URI. */ export declare function resolveAgentHostChatOwner(chat: URI, connection: AgentHostChatOwnerSource, connectionAuthority: string, logService: ILogService, timeoutMs: number): Promise;