import type { SessionMetadata } from '../session/types.js'; import type { CompactionSourceSnapshot } from '../storage/sqlite/index.js'; import { type SessionShareAttachmentCandidate, type SessionShareMessage, type SessionShareToolActivity } from './session-share-projector.js'; import type { ShareStore } from './share-store.js'; import type { SessionShareRecord } from './share-types.js'; export interface SessionShareManifestAttachment { id: string; messageId: string; mimeType: string; fileName: string; size: number; artifactFileName: string; checksum: string; } export interface SessionShareManifest { schemaVersion: 1; shareId: string; source: { sessionId: string; cutoffSeq: number; }; title: string; snapshotAt: string; messages: SessionShareMessage[]; toolActivities: SessionShareToolActivity[]; attachments: SessionShareManifestAttachment[]; } export interface SessionShareSource { getMetadata(sessionKey: string): Promise; getSnapshot(sessionKey: string): Promise; } export interface SessionSharePreview { sessionId: string; cutoffSeq: number; metadataUpdatedAt: string; title: string; snapshotAt: string; messageCount: number; messages: SessionShareMessage[]; toolActivities: SessionShareToolActivity[]; attachmentCandidates: SessionShareAttachmentCandidate[]; } export interface CreateSessionShareInput { expectedSessionId: string; expectedCutoffSeq: number; expectedMetadataUpdatedAt: string; includeToolActivities?: boolean; attachmentIds?: string[]; ttlMs?: number; maxViews?: number | null; description?: string; gatewayTokenHash: string; } export interface RefreshSessionShareInput { expectedSessionId: string; expectedCutoffSeq: number; expectedMetadataUpdatedAt: string; includeToolActivities?: boolean; attachmentIds?: string[]; } export declare class SessionShareSnapshotConflictError extends Error { constructor(); } export declare class SessionShareService { private readonly store; private readonly source; constructor(store: ShareStore, source: SessionShareSource); preview(sessionKey: string): Promise; create(sessionKey: string, input: CreateSessionShareInput): Promise; refresh(sessionKey: string, shareId: string, input: RefreshSessionShareInput): Promise; list(sessionId: string): SessionShareRecord[]; readManifest(record: SessionShareRecord): Promise; issueAssetTicket(record: SessionShareRecord): string; verifyAssetTicket(record: SessionShareRecord, ticket: string): boolean; resolveAsset(record: SessionShareRecord, attachmentId: string): Promise<{ path: string; attachment: SessionShareManifestAttachment; } | null>; removeArtifact(shareId: string): Promise; private loadExpectedSource; private loadSource; private buildManifestBase; private createArtifact; private writeArtifact; private artifactRelativePath; private artifactDir; private validateMessages; private validateManifestRelations; }