import { URI } from "../../base/common/uri.js"; import { ISession } from "../services/sessions/common/session.js"; /** * Code data transfer mime types specific to the Agents window. */ export declare const SessionsDataTransfers: { /** Mime type used to identify a session being dragged within the application. */ SESSION: string; /** Mime type used to identify a chat being dragged into or between groups within a session. */ CHAT: string; /** Marks a chat dragged from a standalone pane, readable during dragover. */ DETACHED_CHAT: string; }; /** Attachment inputs take precedence over grid placement for chat references. */ export declare function isChatReferenceInputDrop(event: DragEvent): boolean; /** Leave composer inputs outside the placement overlay's pointer hit region. */ export declare function getChatReferenceDropClipPath(container: HTMLElement, event: DragEvent): string; /** Keep a small drag-free buffer beside the pane's resize boundaries. */ export declare function isSessionDragFromPaneEdge(element: HTMLElement, event: MouseEvent): boolean; /** * Identifier used to track a session being dragged via * {@link LocalSelectionTransfer}. Mirrors the editor's * {@link DraggedEditorIdentifier} pattern. */ export declare class DraggedSessionIdentifier { readonly sessionId: string | undefined; readonly resource: URI | undefined; constructor(sessionId: string | undefined, resource: URI | undefined); } /** Attach a session placement payload; an absent session represents the empty composer. */ export declare function fillSessionDragData(event: DragEvent, session: ISession | undefined): void; /** * The group-placement payload carried on a chat drag via the * {@link SessionsDataTransfers.CHAT} `dataTransfer` mime. Used to move/split a * visible chat between groups or open a hidden chat in a group within a session. * * This is deliberately carried on the drag event's `dataTransfer` (not on the * shared {@link LocalSelectionTransfer} singleton) because a chat-tab drag can * also offer a chat *reference* payload, and that reference uses the singleton. The * singleton holds only one payload at a time, so relying on it here would let * the reference payload clobber the group-move payload (and vice versa). The * `dataTransfer` mime keeps the two independent: its `types` are readable during * `dragover` (to gate the drop overlay) and its value on `drop`. */ export interface IDraggedSessionChat { readonly sessionId: string; readonly resource: string; readonly isDetached?: boolean; } /** * Attaches the {@link IDraggedSessionChat} group-placement payload to a chat drag. */ export declare function fillSessionChatDragData(e: DragEvent, sessionId: string, resource: URI, isDetached?: boolean): void; /** * Whether the drag carries a session chat. Reads the `dataTransfer` **types**, so * it works during `dragover` (when values are not yet readable). */ export declare function isSessionChatDrag(e: DragEvent, sessionId?: string): boolean; /** * Reads the {@link IDraggedSessionChat} group-move payload from a drop event. * Only meaningful on `drop` (when `dataTransfer` values are readable). */ export declare function getSessionChatDragData(e: DragEvent): IDraggedSessionChat | undefined; /** * Attach a chat-reference payload to a drag started from a chat tab in the * Agents window, so it can be dropped into an agent-host chat input to insert an * inline `#chat:` reference. The payload carries both the opaque * {@link chatResource backend chat URI} — forwarded verbatim into the reference * entry — and the {@link clientResource client chat resource} used only for * identity comparison, plus the display title. The payload is transient (never * persisted), so carrying both resources is fine. * * Populates both the `dataTransfer` mime payload (read on drop) and an in-process * {@link LocalSelectionTransfer} (readable during `dragover`). Callers MUST pair * this with {@link clearChatReferenceDragData} on `dragend`. * * @param e The in-progress drag event to fill. * @param chatResource The referenced chat's opaque backend chat URI (the value * carried on `MessageChatAttachment.resource`), forwarded into the reference entry. * @param clientResource The sessions-window client chat resource (`IChat.resource`), * carried for identity comparison only. * @param title The display title; whitespace is collapsed so the inserted * `#chat:<title>` token stays on a single line. */ export declare function fillChatReferenceDragData(e: DragEvent, chatResource: URI, clientResource: URI, title: string): void; /** * Clears the in-process chat-reference local transfer set by * {@link fillChatReferenceDragData}. Call on `dragend` so a stale reference does * not leak into a later, unrelated drag. */ export declare function clearChatReferenceDragData(): void;