import { type Agent, type AgentSideConnection, type AuthenticateRequest, type AuthenticateResponse, type ClientCapabilities, type CloseSessionRequest, type CloseSessionResponse, type ForkSessionRequest, type ForkSessionResponse, type InitializeRequest, type InitializeResponse, type ListSessionsRequest, type ListSessionsResponse, type LoadSessionRequest, type LoadSessionResponse, type NewSessionRequest, type NewSessionResponse, type PromptRequest, type PromptResponse, type ResumeSessionRequest, type ResumeSessionResponse, type SetSessionConfigOptionRequest, type SetSessionConfigOptionResponse, type SetSessionModelRequest, type SetSessionModelResponse, type SetSessionModeRequest, type SetSessionModeResponse } from "@agentclientprotocol/sdk"; import type { ExtensionUIContext } from "../../extensibility/extensions"; import type { AgentSession } from "../../session/agent-session"; /** * Delay between `session/new` (or `session/load` / `session/resume` / * `unstable_session/fork`) returning and the agent firing the first * notifications against the new session id. Mitigates Zed's * `Received session notification for unknown session` race — see * `#scheduleBootstrapUpdates`. Exported so the ACP test harness can * wait past this guard without hard-coding the literal. */ export declare const ACP_BOOTSTRAP_RACE_GUARD_MS = 50; type CreateAcpSession = (cwd: string) => Promise; /** * Build an {@link ExtensionUIContext} that translates skill/extension UI * requests into ACP elicitations against `connection` for the session * returned by `getSessionId()`. The id is read lazily at each elicitation * because `AgentSession.sessionId` is a getter over `sessionManager` state * that mutates when an extension command calls `ctx.newSession` / * `ctx.switchSession` — snapshotting it once at factory time would route * later elicitations to the pre-switch id. Live reads keep the bridge * symmetric with every other `sessionUpdate` call in this file * (`record.session.sessionId` is always evaluated at emit time). * * The non-elicitation surface (custom components, editor, theming, * terminal input) remains stubbed — ACP clients render those themselves * or not at all. Capability gating respects the client's `initialize` * advertisement. */ export declare function createAcpExtensionUiContext(connection: AgentSideConnection, getSessionId: () => string, clientCapabilities: ClientCapabilities | undefined): ExtensionUIContext; export declare class AcpAgent implements Agent { #private; constructor(connection: AgentSideConnection, createSession: CreateAcpSession, initialSession?: AgentSession); setCancelCleanupTimeoutForTesting(timeoutMs: number): void; initialize(params: InitializeRequest): Promise; authenticate(params: AuthenticateRequest): Promise; newSession(params: NewSessionRequest): Promise; loadSession(params: LoadSessionRequest): Promise; listSessions(params: ListSessionsRequest): Promise; resumeSession(params: ResumeSessionRequest): Promise; unstable_forkSession(params: ForkSessionRequest): Promise; closeSession(params: CloseSessionRequest): Promise; setSessionMode(params: SetSessionModeRequest): Promise; setSessionConfigOption(params: SetSessionConfigOptionRequest): Promise; unstable_setSessionModel(params: SetSessionModelRequest): Promise; prompt(params: PromptRequest): Promise; cancel(params: { sessionId: string; }): Promise; extMethod(method: string, params: { [key: string]: unknown; }): Promise<{ [key: string]: unknown; }>; extNotification(_method: string, _params: { [key: string]: unknown; }): Promise; get signal(): AbortSignal; get closed(): Promise; } export {};