import { type ReactNode } from "react";
import type { FileChange } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
import { type OpenEditor, type OpenFileOptions, type SelectedWorkspaceFile } from "../internal/store/index.js";
import type { RevealTarget } from "../internal/useRevealLine.js";
import type { WorkspaceEntry } from "./useWorkspaceEntries.js";
import type { WorkspaceFileLister } from "./WorkspaceFileLister.js";
import type { WorkspaceFileReader } from "./WorkspaceFileReader.js";
import type { WorkspaceContentSearcher } from "./WorkspaceContentSearcher.js";
/**
 * A host-injected rail view: an icon in the activity rail whose content
 * renders in the sidebar pane when active.
 *
 * This is how session facets (Config, Changes, Artifacts, …) join the built-in
 * Explorer/Search views without the surface knowing any session domain — the
 * same composition philosophy as the injected lister/reader capabilities
 * (DD-004). The surface stays an embeddable, domain-pure workspace organism;
 * hosts extend its rail.
 */
export interface SurfaceRailView {
    /** Unique view id. Must not collide with the built-in `"files"`/`"search"`. */
    readonly id: string;
    /** Accessible label; also rendered as the sidebar heading. */
    readonly label: string;
    /** Monochrome rail icon (tinted via `currentColor`, DD-005). */
    readonly icon: ReactNode;
    /** Optional count badge rendered over the rail icon (hidden when 0). */
    readonly badge?: number;
    /** Sidebar content rendered while this view is active. */
    readonly content: ReactNode;
}
/**
 * A host-injected virtual document: an editor tab whose content is not a
 * workspace file — the session's `plan.md` today; execution artifacts are the
 * anticipated next family.
 *
 * The editor-area counterpart of {@link SurfaceRailView}'s rail injection
 * (DD-004): virtual documents share the tab group with file tabs (identical
 * open / pin / close / activate semantics through the same editors store),
 * and only the *body* rendering diverges — the surface renders `content`
 * instead of breadcrumbs + `FileViewer`. The surface stays domain-pure: it
 * matches tabs to virtual documents by identity and knows nothing about what
 * the document is.
 *
 * `entryId` must come from `virtualEntryId(kind)` so it can never alias a
 * real workspace entry; `path` doubles as the tab label's source (its
 * basename), matching file-tab behavior.
 */
export interface SurfaceVirtualDocument {
    /** Virtual entry id (from `virtualEntryId`) — the tab's owning "entry". */
    readonly entryId: string;
    /** Tab identity within the entry; its basename is the tab label. */
    readonly path: string;
    /** Editor-area content rendered while this document's tab is active. */
    readonly content: ReactNode;
}
/** Props for {@link WorkspaceSurface}. */
export interface WorkspaceSurfaceProps {
    /** The workspace entries whose files are browsable (multi-root). */
    readonly entries: readonly WorkspaceEntry[];
    /** Platform-injected file lister. `undefined` disables explorer + search. */
    readonly lister: WorkspaceFileLister | undefined;
    /** Platform-injected content reader for the editor. */
    readonly reader: WorkspaceFileReader | undefined;
    /**
     * Platform-injected content (text) searcher. When provided, the Search pane
     * gains a `Name | Text` toggle offering full-text search; `undefined` (web/git
     * today) keeps the Search pane filename-only (DD-09). Mirrors the lister's
     * null contract — the honest "unavailable here" state.
     */
    readonly searcher?: WorkspaceContentSearcher;
    /**
     * The active rail view id (`"files"`, `"search"`, or an {@link SurfaceRailView.id}).
     * Provide together with `onViewChange` to control the rail from the host;
     * omit for internal (uncontrolled) view state. An id that matches no view
     * (e.g. a contextual extra view that disappeared) falls back to `"files"`.
     */
    readonly view?: string;
    /** Called when the user picks a rail view. */
    readonly onViewChange?: (viewId: string) => void;
    /**
     * Host-injected rail views, rendered after the built-in Explorer/Search.
     * Their `content` renders in the sidebar pane; the editor area stays for
     * files (the VS Code model).
     */
    readonly extraViews?: readonly SurfaceRailView[];
    /**
     * Host-injected virtual documents (see {@link SurfaceVirtualDocument}).
     * A tab whose identity matches one of these renders its `content` in the
     * editor area instead of the file viewer. The host opens/activates the tab
     * through the same editors-store seams as files.
     */
    readonly virtualDocuments?: readonly SurfaceVirtualDocument[];
    /**
     * Detach a workspace entry. When provided, explorer root headers carry a
     * remove control (VS Code's "Remove Folder from Workspace").
     */
    readonly onRemoveEntry?: (entryId: string) => void;
    /**
     * Attach a local folder (host opens its native picker and adds the entry).
     * When provided, the explorer renders an "Add Folder" footer action —
     * desktop hosts wire this; web hosts omit it (no native picker).
     */
    readonly onAddLocalFolder?: () => void;
    /** Open editor tabs in order (VS Code open-editors model). */
    readonly editors: readonly OpenEditor[];
    /** The active editor's file, or `null`. Highlighted in the tree and shown. */
    readonly selectedFile: SelectedWorkspaceFile | null;
    /**
     * Opens a file as a preview (single click) from the explorer or search. The
     * same seam the tree/search uses; the owner routes it to the editors store.
     * `options.line` (content-search hits) requests a jump-to-line reveal.
     */
    readonly onOpenFile: (entryId: string, path: string, options?: OpenFileOptions) => void;
    /** Focuses an already-open editor (tab single click). */
    readonly onActivateEditor: (entryId: string, path: string) => void;
    /** Pins an editor (tab double-click) so it stops being the preview tab. */
    readonly onPinEditor: (entryId: string, path: string) => void;
    /** Closes an editor (tab close control or middle click). */
    readonly onCloseEditor: (entryId: string, path: string) => void;
    /** Collapses the surface back to the chat-dominant layout. */
    readonly onCollapse: () => void;
    /**
     * The session {@link FileChange} that touched the open file, when it was
     * changed this session. When present the editor defaults to the authoritative
     * `baseline→candidate` diff (DD-06), matching the inspector's Viewer tab.
     */
    readonly change?: FileChange;
    /**
     * Jump-to-line reveal for the **active** editor (already scoped by the owner
     * to `reveal.key === activeKey`), or `undefined`. Forwarded to the editor's
     * viewer, which opens in File view and scrolls to / highlights the line.
     */
    readonly reveal?: RevealTarget;
    /** Additional CSS classes for the root element. */
    readonly className?: string;
}
/**
 * A VS Code / Cursor-inspired read-only workspace surface: a slim activity rail
 * (Explorer / Search), a resizable sidebar, and a large editor area.
 *
 * This is the workspace-dominant counterpart to the inspector's cramped Viewer
 * tab. The session viewer flips its layout to give this surface the majority of
 * the screen while chat becomes a narrow column (see `SessionViewer`). It is a
 * self-contained organism: given `entries`, a `lister`, a `reader`, and the
 * open-file selection, it renders identically inside the Console or embedded in
 * a third-party host (DD-004). Explicitly read-only — no editing, no commit UI.
 *
 * All visual properties flow through `--stgm-*` tokens (DD-005).
 */
export declare function WorkspaceSurface({ entries, lister, reader, searcher, view, onViewChange, extraViews, virtualDocuments, onRemoveEntry, onAddLocalFolder, editors, selectedFile, onOpenFile, onActivateEditor, onPinEditor, onCloseEditor, onCollapse, change, reveal, className, }: WorkspaceSurfaceProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=WorkspaceSurface.d.ts.map