import type { ArtifactCatalogItem } from "@opengeni/sdk"; import type { OpenGeniBrowserClient } from "@opengeni/sdk/browser"; import type { SessionEditableArtifactSummary } from "../components/session/editable-artifacts-workspace.js"; type DiscoveryClient = Pick & Partial>; /** * Catalog results per sub-session, keyed by the activity version lineage * reported when they were read. A sub-session can only publish an artifact by * running a tool, which appends events and so advances its version; an * unchanged version therefore cannot hide a new artifact. Callers own one * cache per chat view and drop it to force a complete re-read. */ export type SessionArtifactSourceCache = Map; /** * The session dock and workspace library discover the same durable resources. * With a cache, sub-sessions whose activity version is unchanged since the * last successful read reuse that read instead of listing the catalog again. */ export declare function discoverSessionArtifacts(workspaceId: string, sessionId: string, current: () => boolean, client: DiscoveryClient, cache?: SessionArtifactSourceCache): Promise<((_previous: readonly SessionEditableArtifactSummary[]) => { status: "ready"; artifacts: Readonly<{ id: string; modality: "document" | "spreadsheet" | "presentation" | "site" | "image" | "file"; title: string; versionId?: string | undefined; siteStatus?: "active" | "archived" | undefined; catalogItem?: ArtifactCatalogItem | undefined; }>[]; }) | ((previous: readonly SessionEditableArtifactSummary[]) => { status: "error"; artifacts: readonly Readonly<{ id: string; modality: "document" | "spreadsheet" | "presentation" | "site" | "image" | "file"; title: string; versionId?: string | undefined; siteStatus?: "active" | "archived" | undefined; catalogItem?: ArtifactCatalogItem | undefined; }>[]; })>; export {};