export type ContentType = 'x-thread' | 'blog' | 'podcast' | 'video' | 'ad-copy' | 'image'; export type ContentStatus = 'outline' | 'drafting' | 'assets' | 'review' | 'published'; export type AssetKind = 'image' | 'audio' | 'video' | 'text'; export interface ContentAsset { kind: AssetKind; /** Producer of the asset: model ID like "openai/gpt-image-2", or "manual". */ source: string; /** USD actually spent producing this asset. 0 is valid (free models). */ costUsd: number; /** Optional payload reference — URL, file path, or short inline text. */ data?: string; createdAt: number; } export interface ContentDraft { text: string; createdAt: number; } export interface DistributionEntry { channel: string; url?: string; at: number; } export interface Content { id: string; type: ContentType; title: string; status: ContentStatus; outline?: string; drafts: ContentDraft[]; assets: ContentAsset[]; spentUsd: number; budgetUsd: number; createdAt: number; publishedAt?: number; distribution: DistributionEntry[]; } export interface CreateContentOptions { type: ContentType; title: string; budgetUsd: number; } export declare class ContentLibrary { private byId; create(opts: CreateContentOptions): Content; get(id: string): Content | undefined; list(): Content[]; /** Replace a content record wholesale — used by the persistence layer. */ restore(content: Content): void; /** * Record a generated asset against a content, enforcing the budget cap. * Returns `{ ok: false, reason }` on rejection so callers (including the * agent-facing capability) can surface the reason instead of catching an * exception. On the happy path mutates the Content in place and returns * the updated spendUsd. */ addAsset(id: string, asset: Omit): { ok: true; spentUsd: number; } | { ok: false; reason: string; }; }