import * as effect_Cause from 'effect/Cause'; import * as effect_Types from 'effect/Types'; import { b7 as UploadInput, P as ProcessingCapabilities, ak as DocumentSpec } from '../types-R6f5p55r.js'; import { Effect } from 'effect'; import 'zod'; interface DocumentAgentTokenParams { docId: string; ttlSeconds?: number; nowSeconds?: number; } interface DocumentAgentTokenVerification { valid: boolean; docId?: string; exp?: number; error?: string; } declare function signDocumentAgentToken(signingKey: string, params: DocumentAgentTokenParams): Promise; declare function verifyDocumentAgentToken(signingKeys: string | Array, token: string | null | undefined, expectedDocId: string, opts?: { nowSeconds?: number; }): Promise; declare const ServerClientError_base: new = {}>(args: effect_Types.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => effect_Cause.YieldableError & { readonly _tag: "ServerClientError"; } & Readonly; declare class ServerClientError extends ServerClientError_base<{ readonly method: 'files.create' | 'documents.createAgentToken' | 'renders.create' | 'sign.documentAgentToken'; readonly status?: number; readonly message: string; }> { } type DocumentAutoAction = 'render' | 'parse'; interface OkraServerClientOptions { apiKey: string; signingKey?: string; host?: string; fetch?: typeof globalThis.fetch; } interface CreateOkraDocumentFileOptions { file: UploadInput; fileName?: string; auto?: DocumentAutoAction[]; capabilities?: ProcessingCapabilities; processor?: string; vendorOptions?: Record; config?: DocumentSpec; intent?: string; signal?: AbortSignal; } interface CreatedOkraDocument extends Record { id: string; documentId: string; } interface CreateDocumentAgentTokenOptions { ttlSeconds?: number; signal?: AbortSignal; } interface DocumentAgentToken { token: string; documentId: string; expiresIn: number | null; expiresAt: string | null; } interface RenderFile { path: string; content: string; encoding?: 'utf-8' | 'base64'; } type RenderPublishOptions = boolean | { enabled?: boolean; publicId?: string; slug?: string; fileName?: string; cacheControl?: string; metadata?: Record; source?: boolean | { enabled?: boolean; includeInput?: boolean; includeModules?: boolean; llm?: string; readme?: string; }; llm?: string; readme?: string; }; interface RenderDesignedSpec { title: string; type: string; author?: string; date?: string; subtitle?: string; abstract?: string; accent?: string; cover_bg?: string; cover_image?: string; skipCover?: boolean; content: Array<{ type: string; [key: string]: unknown; }>; } interface RenderReportLabOptions { script: string; files?: Record | RenderFile[]; fileName?: string; persist?: boolean; publish?: RenderPublishOptions; signal?: AbortSignal; } interface RenderExecOptions { code: string; input?: unknown; modules?: Record; fileName?: string; persist?: boolean; publish?: RenderPublishOptions; timeoutMs?: number; signal?: AbortSignal; } interface RenderDesignedOptions { spec: RenderDesignedSpec; fileName?: string; publish?: RenderPublishOptions; signal?: AbortSignal; } interface RenderHtmlOptions { /** HTML string to render to PDF via Browser Rendering. */ html: string; /** Page dimensions in CSS px. Default A4 @ 96dpi (794×1123). */ width?: number; height?: number; /** Block until this selector appears (async charts/fonts) before printing. */ waitForSelector?: string; waitForTimeoutMs?: number; fileName?: string; persist?: boolean; publish?: RenderPublishOptions; signal?: AbortSignal; } type RenderInput = ({ mode: 'reportlab'; } & RenderReportLabOptions) | ({ mode: 'exec'; } & RenderExecOptions) | ({ mode: 'designed'; } & RenderDesignedOptions) | ({ mode: 'html'; } & RenderHtmlOptions); interface RenderResult { pdfBytes: Uint8Array; renderId: string; sha256: string; size: number; documentId: string | null; downloadUrl: string | null; publicUrl: string | null; publishedUrl: string | null; publishBaseUrl: string | null; sourceUrl: string | null; fileName: string; } interface OkraServerClient { /** Native programs for composing SDK requests without leaving Effect. */ readonly effect: OkraServerEffectClient; files: { create(params: CreateOkraDocumentFileOptions): Promise; upload(input: UploadInput, options?: Omit): Promise; }; documents: { createAgentToken(docId: string, opts?: CreateDocumentAgentTokenOptions): Promise; }; renders: { create(input: RenderInput): Promise; reportlab(opts: RenderReportLabOptions): Promise; exec(opts: RenderExecOptions): Promise; designed(opts: RenderDesignedOptions): Promise; html(opts: RenderHtmlOptions): Promise; }; sign: { documentAgentToken(docId: string, opts?: { ttlSeconds?: number; }): Promise; }; } interface OkraServerEffectClient { files: { create(params: CreateOkraDocumentFileOptions): Effect.Effect; upload(input: UploadInput, options?: Omit): Effect.Effect; }; documents: { createAgentToken(docId: string, opts?: CreateDocumentAgentTokenOptions): Effect.Effect; }; renders: { create(input: RenderInput): Effect.Effect; reportlab(opts: RenderReportLabOptions): Effect.Effect; exec(opts: RenderExecOptions): Effect.Effect; designed(opts: RenderDesignedOptions): Effect.Effect; html(opts: RenderHtmlOptions): Effect.Effect; }; sign: { documentAgentToken(docId: string, opts?: { ttlSeconds?: number; }): Effect.Effect; }; } declare function createOkraServerClient(options: OkraServerClientOptions): OkraServerClient; export { type CreateDocumentAgentTokenOptions, type CreateOkraDocumentFileOptions, type CreatedOkraDocument, type DocumentAgentToken, type DocumentAgentTokenParams, type DocumentAgentTokenVerification, type DocumentAutoAction, type OkraServerClient, type OkraServerClientOptions, createOkraServerClient, signDocumentAgentToken, verifyDocumentAgentToken };