import type { ArtifactCatalogKind, ArtifactCatalogListQuery } from "@opengeni/contracts"; import { type Database } from "./database.js"; import type { WorkspaceArtifactViewer } from "./workspace-artifacts.js"; /** A chat plus the most sub-sessions its lineage lists (see SESSION_TREE_DESCENDANT_LIMIT). */ export declare const MAX_CATALOG_SOURCE_SESSIONS = 201; export type ArtifactCatalogPosition = { key: string; kind: ArtifactCatalogKind; id: string; /** Legacy cursor frontiers did not carry this bit. */ pinned?: boolean | undefined; }; /** Internal candidates are NOT an authorized public projection. */ export type ArtifactCatalogCandidate = { id: string; kind: ArtifactCatalogKind; /** Internal adapter identity; never exposed as public provenance. */ origin: "site" | "editable_artifact" | "generated_image" | "sandbox_file"; title: string; status: "active" | "archived"; created_at: Date | string; updated_at: Date | string; source_session_id: string | null; version_id: string | null; sort_key: string; pinned?: boolean; /** Sites, documents, spreadsheets and presentations: the stored audience. */ visibility?: "workspace_shared" | "user_private" | null; /** Who may change that audience; null for legacy and non-audience rows. */ owner_subject_id?: string | null; }; /** API callers must first verify publish permission and domain-specific read authority. */ export declare function updateArtifactPin(db: Database, scope: { accountId: string; workspaceId: string; }, input: { kind: ArtifactCatalogKind; artifactId: string; pinned: boolean; }): Promise; /** Called only after immutable bytes have been retained by explicit publication. */ export declare function recordSandboxFilePublication(db: Database, input: { accountId: string; workspaceId: string; fileId: string; sourceSessionId: string; }): Promise; /** Bounded keyset projection over existing domains; no universal content store. * The caller must still perform editable application and file access checks. */ export declare function listArtifactCatalogCandidates(db: Database, scope: { accountId: string; workspaceId: string; }, input: { query: ArtifactCatalogListQuery; kinds: readonly ArtifactCatalogKind[]; /** * Who is reading: Sites, documents, spreadsheets and presentations are * limited to the workspace's and this person's own Only me ones. */ siteViewer: WorkspaceArtifactViewer; snapshotAt: string; after?: ArtifactCatalogPosition; limit: number; /** * Sessions whose artifacts to list, already authorized by the caller; this * replaces `query.sourceSessionId`, e.g. with a chat and its sub-sessions. */ sourceSessionIds?: readonly string[]; }): Promise;