import { URI } from "../../../base/common/uri.js"; import { ChatInteractivity, type ChatOrigin } from "./state/protocol/channels-chat/state.js"; /** Host root config keys for moving chats between sessions. */ export declare const ChatMoveConfigKey: { readonly Enabled: "chatMoves.enabled"; }; /** Workbench settings for moving chats. `Enabled` is mirrored into {@link ChatMoveConfigKey}. */ export declare const ChatMoveSettingId: { readonly Enabled: "chat.agentHost.moveChats.enabled"; }; export declare const chatMoveRootConfigSchema: import("./agentHostSchema.js").ISchema<{ "chatMoves.enabled": import("./agentHostSchema.js").ISchemaProperty; }>; /** What makes a chat structurally eligible to be the source of a move, whatever its state. */ export interface IChatMoveStructuralEligibility { /** Whether moving chats is enabled. */ readonly enabled: boolean; /** Whether the chat is its owning session's default chat. */ readonly isDefault: boolean; readonly origin: ChatOrigin | undefined; readonly interactivity: ChatInteractivity | undefined; } /** * What decides whether a chat may be the source of a move: its structural eligibility and every condition of the chat * or its own session for which a move would be refused, whatever its destination. */ export interface IChatMoveEligibility extends IChatMoveStructuralEligibility { /** Its session is archived ({@link AgentChatMoveRefusal.SessionArchived}). */ readonly sessionArchived: boolean; /** Its session has no workspace, or the chat no folder ({@link AgentChatMoveRefusal.Workspaceless}). */ readonly workspaceless: boolean; /** Its session is quarantined, or it or a descendant is changing its workspace ({@link AgentChatMoveRefusal.SessionQuarantined}, {@link AgentChatMoveRefusal.ConversionInProgress}). */ readonly converting: boolean; /** It works in an additional worktree recorded for it that a chat staying in its session also uses ({@link AgentChatMoveRefusal.WorktreeFolder}). */ readonly worktreeFolder: boolean; /** Its session's legacy chat catalog can't be converted for now: its conversion is parked ({@link AgentChatMoveRefusal.LegacyCatalog}). */ readonly legacyCatalog: boolean; /** It has no turn yet, so nothing of it exists beyond its composer ({@link AgentChatMoveRefusal.NotStarted}). */ readonly notStarted: boolean; } /** * Whether a chat is structurally eligible to be moved. A session's default chat never is (AHP), nor a chat spawned by * a tool call (it moves with its parent) or a hidden chat. */ export declare function isChatStructurallyMovable(eligibility: IChatMoveStructuralEligibility): boolean; /** * Whether a chat may be moved now (`ChatSummary.movable`): it is structurally eligible and nothing about the chat or * its own session would refuse its move. Refusals that depend on the destination (its provider, folders or state, * whether its session is a single chat) or on the kind of move (a promotion needs a started chat) are only decided per * request, which also validates everything again. */ export declare function isChatMovable(eligibility: IChatMoveEligibility): boolean; /** Where a chat moves: another position in its own session, another existing session, or a new session. */ export type AgentChatMoveDestination = { readonly kind: "session"; readonly session: URI; readonly after: URI | undefined; } | { readonly kind: "newSession"; }; /** Why a host refused a chat move. Stable, for clients to explain the refusal. */ export declare enum AgentChatMoveRefusal { Disabled = "disabled", NotMovable = "notMovable", DestinationNotFound = "destinationNotFound", InvalidAnchor = "invalidAnchor", DifferentProvider = "differentProvider", SessionArchived = "sessionArchived", SessionNotReady = "sessionNotReady", SessionQuarantined = "sessionQuarantined", ConversionInProgress = "conversionInProgress", WorktreeFolder = "worktreeFolder", Workspaceless = "workspaceless", /** Only older hosts: a chat that runs Agent Merge now moves with it. */ AgentMergeOwner = "agentMergeOwner", DestinationSingleFolder = "destinationSingleFolder", LegacyCatalog = "legacyCatalog", Conflict = "conflict", Unsupported = "unsupported", /** A session moves under another session only while its default chat is its only chat (Block 4, VS Code-internal). */ NotSingleChat = "notSingleChat", /** A chat moves, or becomes its own session, only once its first turn started, which is when every agent persists its conversation. */ NotStarted = "notStarted", /** * The chat's session and the destination session are sponsored by different credential owners, or only one of them is. * Credentials never cross owners, so such sessions can't be combined. Client text: "This chat uses a different account's * credentials than the destination session." */ DifferentCredentialOwner = "differentCredentialOwner", /** * Chats with their own agents are on, but the chat's agent is unknown or disabled on the host, so it can't move to a * session of another agent or become a session of its own agent. Client text: enable the chat's agent. Distinct from * {@link DifferentProvider}, which means chats with their own agents are off. */ AgentUnavailable = "agentUnavailable", /** * Chats with their own agents are on, but the destination's agent can't host chats of other agents, or the chat's * agent can't join a session of another agent: one of them doesn't support multiple chats. Client text: pick a * session of an agent that supports chats of other agents. */ AgentWithoutChats = "agentWithoutChats", /** * The chat's agent couldn't describe its settings for the chat when it moved into a session of another agent or * into a new session of its own agent. Transient: client text asks to try again. Distinct from {@link Unsupported} * (no conversation of its own to take into a new session). */ AgentConfigUnavailable = "agentConfigUnavailable" } /** A chat move the host refused before changing anything. */ export declare class AgentChatMoveRefusedError extends Error { readonly reason: AgentChatMoveRefusal; constructor(reason: AgentChatMoveRefusal, message: string); }