import { IObservable } from "../../../../base/common/observable.js"; import { URI } from "../../../../base/common/uri.js"; import { RawContextKey } from "../../../../platform/contextkey/common/contextkey.js"; import type { ICanvas, ICanvasReference } from "../../../../workbench/contrib/canvases/common/canvas.js"; /** The custom view that shows the selected pinned canvas full-page. */ export declare const PINNED_CANVAS_PAGE_ID = "sessions.customView.canvas"; /** How many canvases can be pinned at once. Each one keeps its owning session resident. */ export declare const MAX_PINNED_CANVASES = 5; /** Editor resources (as strings) of the canvases that are pinned to the sidebar, for `resource in canvasesPinnedToSidebar` checks. */ export declare const CanvasesPinnedToSidebarContext: RawContextKey; /** Whether the pinned canvas that an action targets is connected to its live canvas. */ export declare const PinnedCanvasConnectedContext: RawContextKey; /** * The persisted identity of a pinned canvas. It survives a window reload while the * live canvas resource and its source URL do not, so neither is part of it. */ export interface IPinnedCanvasIdentity { readonly providerId: string; readonly session: URI; readonly chat: URI; readonly extensionId: string; readonly canvasId: string; readonly instanceId: string; } export declare enum PinnedCanvasState { /** Connected to its live canvas. */ Live = "live", /** Not connected yet: it reconnects when it is shown or its chat is shown, or its provider is connecting. */ Pending = "pending", /** Its canvas is no longer open in its chat. */ Unavailable = "unavailable" } export interface IPinnedCanvas { /** Stable identifier derived from {@link identity}. */ readonly id: string; readonly identity: IPinnedCanvasIdentity; /** The live canvas this pin is bound to, `undefined` until it reconnects. */ readonly reference: IObservable; /** The live canvas state while bound. */ readonly canvas: IObservable; /** The live title, or the last known one. */ readonly title: IObservable; /** The title of the owning chat, when it is known. */ readonly chatTitle: IObservable; readonly state: IObservable; /** Whether it is looking for its live canvas through its chat, without showing the chat. */ readonly reconnecting: IObservable; } /** A pin or the live canvas reference of one. */ export type PinnedCanvasTarget = IPinnedCanvas | ICanvasReference;