import type { DocumentArtifactId, DocumentArtifactIdKind, DocumentArtifactCommand, DocumentArtifactQuery, EditableArtifactStableId, PresentationArtifactCommand, PresentationArtifactQuery, SpreadsheetArtifactCommand, SpreadsheetArtifactKernelQuery } from "@opengeni/contracts/editable-artifacts"; import type { CodemodeCallOptions } from "./index.js"; import type { CodemodeClientProvider } from "./environment.js"; export type CodemodeArtifactModality = "spreadsheet" | "document" | "presentation"; export type CodemodeArtifactFormat = "xlsx" | "pptx" | "docx" | "pdf" | "png" | "webp"; export type CodemodeArtifactMetadata = Readonly<{ id: string; /** Server-authored handoff reference; absent on older servers. */ artifactReference?: string; modality: CodemodeArtifactModality; title: string; lifecycle: "active" | "archived"; headSequence: number; stateHash: string; createdAt: string; updatedAt: string; }>; export type CodemodeArtifactQuery = SpreadsheetArtifactKernelQuery | DocumentArtifactQuery | PresentationArtifactQuery; export type CodemodeArtifactCommand = SpreadsheetArtifactCommand | DocumentArtifactCommand | PresentationArtifactCommand; export type CodemodeArtifactMutationReceipt = Readonly<{ artifact: CodemodeArtifactMetadata; transaction: Readonly<{ id: string; clientTransactionId: string; sequenceStart: number; sequenceEnd: number; stateHash: string; committedAt: string; replayed: boolean; }>; }>; export type CodemodeArtifactExportFile = Readonly<{ fileId: string; filename: string; contentType: string; sizeBytes: number; sha256: string; artifactId: string; versionId: string; materializationJobId: string; sourceHeadSequence: number; sourceStateHash: string; }>; export type CodemodeArtifactExportStatus = Readonly<{ artifact: CodemodeArtifactMetadata; versionId: string; jobId: string; sourceHeadSequence: number; sourceStateHash: string; state: "pending" | "running" | "succeeded" | "failed"; errorCode: string | null; file: CodemodeArtifactExportFile | null; }>; export type CodemodeArtifactIdFactory = Readonly<{ /** Create a nonzero 128-bit id accepted by spreadsheet and presentation commands. */ stable(): EditableArtifactStableId; /** Create a document object id in the namespace returned by a summary query. */ document(kind: DocumentArtifactIdKind, namespace: bigint | number | string): DocumentArtifactId; }>; export declare const codemodeArtifactIds: CodemodeArtifactIdFactory; /** Authored CodeMode collection over the exact MCP-backed artifact operations. */ export declare class CodemodeArtifactCollection { private readonly client; readonly ids: Readonly<{ /** Create a nonzero 128-bit id accepted by spreadsheet and presentation commands. */ stable(): EditableArtifactStableId; /** Create a document object id in the namespace returned by a summary query. */ document(kind: DocumentArtifactIdKind, namespace: bigint | number | string): DocumentArtifactId; }>; constructor(client: CodemodeClientProvider); list(options?: { limit?: number | undefined; }, callOptions?: CodemodeCallOptions): Promise; create(modality: CodemodeArtifactModality, title: string, callOptions?: CodemodeCallOptions): Promise; import(fileId: string, modality: CodemodeArtifactModality, title: string, callOptions?: CodemodeCallOptions): Promise; use(artifact: string | CodemodeArtifactMetadata): CodemodeArtifact; } export declare class CodemodeArtifact { private readonly client; readonly id: string; private metadata; constructor(client: CodemodeClientProvider, id: string, metadata?: CodemodeArtifactMetadata | null); get(callOptions?: CodemodeCallOptions): Promise; inspect(query: CodemodeArtifactQuery, callOptions?: CodemodeCallOptions): Promise>; apply(commands: readonly CodemodeArtifactCommand[], callOptions?: CodemodeCallOptions): Promise; export(format: CodemodeArtifactFormat, options?: Readonly>, callOptions?: CodemodeCallOptions): Promise; private currentMetadata; } export declare class CodemodeArtifactExport { private readonly client; readonly artifactId: string; readonly versionId: string; readonly jobId: string; readonly sourceHeadSequence: number; readonly sourceStateHash: string; constructor(client: CodemodeClientProvider, artifactId: string, versionId: string, jobId: string, sourceHeadSequence: number, sourceStateHash: string); status(callOptions?: CodemodeCallOptions): Promise; }