/* auto-generated by NAPI-RS */ /* eslint-disable */ declare const _default: typeof import('./index') export default _default export declare class BackendRuntime { acquireCoordinationLease(key: string, owner: string, ttlMs: number): Promise releaseCoordinationLease(key: string, owner: string, fencingToken: bigint | number): Promise renewCoordinationLease(key: string, owner: string, fencingToken: bigint | number, ttlMs: number): Promise /** * Merge pending doc updates with y-octo and persist the merged snapshot. * * Do not use this for snapshots that will be sent back to yjs clients until * the y-octo/yjs round-trip compatibility issue is resolved. * * The caller owns quota reconciliation and must pass a fresh * history_max_age_seconds value. The compactor intentionally does not read * effective_workspace_quota_states; if a future caller cannot provide a * fresh quota state, fail and retry after Node reconciles it. */ compactPendingDocUpdates(workspaceId: string, docId: string, batchLimit: number, historyMinIntervalMs: number, historyMaxAgeSeconds: number, owner: string, leaseTtlMs: number): Promise upsertDocSnapshot(workspaceId: string, docId: string, blob: Buffer, timestampMs: number, editorId?: string | undefined | null): Promise createDocHistory(input: RuntimeDocHistoryInput): Promise deleteDocStorage(workspaceId: string, docId: string): Promise putRuntimeGateIfAbsent(key: string, ttlMs: number): Promise cleanupExpiredRuntimeGates(limit: number): Promise cleanupExpiredUserSessions(limit: number): Promise cleanupExpiredSnapshotHistories(limit: number): Promise isInviteAbuseUserQuarantinedOrBanned(userId: string): Promise isInviteAbuseWorkspaceQuarantined(workspaceId: string): Promise claimInviteAbuseAction(actionId: string, workerId: string): Promise claimRetryableInviteAbuseActions(workerId: string, limit: number): Promise> markInviteAbuseAction(actionId: string, workerId: string, status: string, error?: string | undefined | null): Promise assertWorkspaceInviteQuotaV1(input: RuntimeWorkspaceInviteQuotaInput): Promise commitWorkspaceInviteQuotaV1(reservationId: string, usage: RuntimeWorkspaceInviteQuotaUsage): Promise releaseWorkspaceInviteQuotaV1(reservationId: string): Promise assertMailDeliveryQuotaV1(input: RuntimeMailDeliveryQuotaInput): Promise commitMailDeliveryQuotaV1(reservationId: string): Promise releaseMailDeliveryQuotaV1(reservationId: string): Promise cleanupExpiredRollingQuota(limit: number): Promise createAuthChallenge(purpose: string, token: string, payload: any, ttlMs: number): Promise getAuthChallenge(purpose: string, token: string): Promise consumeAuthChallenge(purpose: string, token: string): Promise createVerificationToken(tokenType: number, credential: string | undefined | null, ttlMs: number): Promise getVerificationToken(tokenType: number, token: string, keep?: boolean | undefined | null): Promise verifyVerificationToken(tokenType: number, token: string, credential?: string | undefined | null, keep?: boolean | undefined | null): Promise cleanupExpiredVerificationTokens(limit: number): Promise upsertMagicLinkOtp(email: string, otpHash: string, token: string, clientNonce: string | undefined | null, ttlMs: number): Promise consumeMagicLinkOtp(email: string, otpHash: string, clientNonce?: string | undefined | null): Promise createWorkspaceInviteLink(workspaceId: string, inviteId: string, inviterUserId: string, ttlMs: number): Promise getWorkspaceInviteLink(workspaceId: string): Promise getWorkspaceInviteLinkById(inviteId: string): Promise revokeWorkspaceInviteLink(workspaceId: string): Promise createByokLocalLease(activeKey: string, leaseId: string, payload: any, ttlMs: number): Promise getByokLocalLease(leaseId: string): Promise cleanupExpiredRuntimeStates(limit: number): Promise refreshWorkspaceAdminStatsDirty(batchLimit: number, owner: string, leaseTtlMs: number): Promise recalibrateWorkspaceAdminStats(lastSid: number, batchLimit: number, owner: string, leaseTtlMs: number): Promise writeWorkspaceAdminStatsDailySnapshot(owner: string, leaseTtlMs: number): Promise recalibrateWorkspaceAdminStatsDaily(batchLimit: number, owner: string, leaseTtlMs: number, lockRetryTimes: number, lockRetryDelayMs: number): Promise constructor() start(): Promise stop(): Promise health(): Promise runMigrations(): Promise } export declare class LlmStreamHandle { abort(): void } export declare class StorageRuntime { planUnreferencedWorkspaceBlobs(workspaceId: string, gracePeriodDays: number, limit: number): Promise executeBlobCleanupCandidates(runId: string, gracePeriodDays: number, limit: number): Promise cleanupExpiredPendingBlobs(cutoffMs: number, limit: number): Promise releaseDeletedBlobs(workspaceId: string, limit: number): Promise backfillMissingBlobMetadata(workspaceId: string | undefined | null, limit: number): Promise rebuildDocBlobRefs(workspaceId: string, docId: string): Promise rebuildWorkspaceDocBlobRefs(workspaceId: string, limit: number): Promise constructor() start(): Promise configure(configJson: string): void stop(): Promise runMigrations(): Promise health(): Promise providerCapabilities(scope: string): Promise putObject(scope: string, key: string, body: Buffer, metadata?: RuntimeObjectStoragePutOptions | undefined | null): Promise headObject(scope: string, key: string): Promise getObject(scope: string, key: string): Promise listObjects(scope: string, prefix?: string | undefined | null): Promise> deleteObject(scope: string, key: string): Promise presignPut(scope: string, key: string, metadata?: RuntimeObjectStoragePutOptions | undefined | null): Promise presignGet(scope: string, key: string): Promise createMultipartUpload(scope: string, key: string, metadata?: RuntimeObjectStoragePutOptions | undefined | null): Promise presignUploadPart(scope: string, key: string, uploadId: string, partNumber: number): Promise proxyUploadPart(scope: string, key: string, uploadId: string, partNumber: number, body: Buffer, contentLength?: number | undefined | null): Promise listMultipartUploadParts(scope: string, key: string, uploadId: string): Promise | null> completeMultipartUpload(scope: string, key: string, uploadId: string, parts: Array): Promise abortMultipartUpload(scope: string, key: string, uploadId: string): Promise completeWorkspaceBlobUpload(workspaceId: string, key: string, expectedSize: number, expectedMime: string): Promise } export declare class Tokenizer { count(content: string, allowedSpecial?: Array | undefined | null): number } export interface ActionEvent { type: ActionEventType actionId: string actionVersion: string stepId?: string status?: ActionRunStatus attachment?: any result?: any errorCode?: string errorMessage?: string trace?: ActionTrace } export type ActionEventType = 'action_start'| 'step_start'| 'attachment'| 'step_end'| 'action_done'| 'error'; export type ActionRunStatus = 'created'| 'running'| 'succeeded'| 'failed'| 'aborted'; export interface ActionRuntimeInput { recipeId: string recipeVersion?: string input: any } export interface ActionTrace { actionId: string actionVersion: string status: ActionRunStatus lightweight: Array errorCode?: string } export declare function activateLicense(request: LicenseKeyRequest): Promise /** * Adds a document ID to the workspace root doc's meta.pages array. * This registers the document in the workspace so it appears in the UI. * * # Arguments * * `root_doc_bin` - The current root doc binary (workspaceId doc) * * `doc_id` - The document ID to add * * `title` - Optional title for the document * * # Returns * A Buffer containing the y-octo update binary to apply to the root doc */ export declare function addDocToRootDoc(rootDocBin: Buffer, docId: string, title?: string | undefined | null): Buffer export const AFFINE_PRO_LICENSE_AES_KEY: string | undefined | null export const AFFINE_PRO_PUBLIC_KEY: string | undefined | null export declare function assertSafeUrl(request: AssertSafeUrlRequest): void export interface AssertSafeUrlRequest { url: string } export interface BackendRuntimeHealth { started: boolean databaseConnected: boolean } export declare function buildPublicRootDoc(rootDocBin: Buffer, docMetas: Array): Buffer export interface BuiltInPromptRenderContract { name: string renderParams: Record } export interface BuiltInPromptSessionContract { name: string turns: Array renderParams: Record maxTokenSize: number } export interface BuiltInPromptSpec { name: string action?: string model: string optionalModels?: Array config?: any params?: Record builtins?: Array messages: Array } export interface CanonicalChatRequestContract { model: string messages: Array maxTokens?: number temperature?: number tools?: Array include?: Array reasoning?: any responseSchema?: any attachmentCapability?: CapabilityAttachmentContract middleware?: any } export interface CanonicalStructuredRequestContract { model: string messages: Array schema?: any maxTokens?: number temperature?: number reasoning?: any strict?: boolean responseMimeType?: string attachmentCapability?: CapabilityAttachmentContract middleware?: any } export interface CapabilityAttachmentContract { kinds: Array<'image' | 'audio' | 'file'> sourceKinds?: Array<'url' | 'data' | 'bytes' | 'file_handle'> allowRemoteUrls?: boolean } export interface CapabilityMatchRequest { models: Array cond: ModelConditionsContract } export interface CapabilityMatchResponse { modelId?: string } export interface CapabilityModelCapability { input: Array<'text' | 'image' | 'audio' | 'file'> output: Array<'text' | 'image' | 'object' | 'structured' | 'embedding' | 'rerank'> attachments?: CapabilityAttachmentContract structuredAttachments?: CapabilityAttachmentContract defaultForOutputType?: boolean } export interface CapabilityModelContract { id: string capabilities: Array } export declare function checkLicenseHealth(request: LicenseHealthRequest): Promise export interface Chunk { index: number content: string } export interface CommandResponse { error?: LicenseError } export interface ContentPolicyMatch { type: string reason: string value?: string span?: ContentPolicyMatchSpan } export interface ContentPolicyMatchSpan { start: number end: number } export interface ContentPolicyScanInput { value: string checks?: Array } export interface ContentPolicyScanResult { version: number original: string normalized: string skeleton: string matched: boolean matches: Array flags: Array } export interface CoordinationLeaseGrant { key: string owner: string fencingToken: bigint | number } /** * Converts markdown content to AFFiNE-compatible y-octo document binary. * * # Arguments * * `title` - The document title * * `markdown` - The markdown content to convert * * `doc_id` - The document ID to use for the y-octo doc * * # Returns * A Buffer containing the y-octo document update binary */ export declare function createDocWithMarkdown(title: string, markdown: string, docId: string): Buffer export declare function createLicenseCustomerPortal(request: LicenseKeyRequest): Promise export declare function deactivateLicense(request: LicenseKeyRequest): Promise export declare function evaluatePermissionV1(input: any): any export declare function fetchRemoteAttachment(request: RemoteAttachmentFetchRequest): Promise export declare function fromModelName(modelName: string): Tokenizer | null export declare function getMime(input: Uint8Array): string export declare function htmlSanitize(input: string): string export interface ImageInspection { mimeType: string width: number height: number } export interface ImageInspectionOptions { maxWidth?: number maxHeight?: number maxPixels?: number } export declare function inferRemoteMimeType(request: RemoteMimeTypeRequest): Promise export declare function inspectImageForProxy(input: Buffer, options?: ImageInspectionOptions | undefined | null): ImageInspection export interface LicenseError { status: number body: string } export interface LicenseHealthRequest { licenseKey: string validateKey: string } export interface LicenseInfo { plan: string recurring: string quantity: number expiresAt: number validateKey: string } export interface LicenseKeyRequest { licenseKey: string } export interface LicenseRecurringRequest { licenseKey: string recurring: string } export interface LicenseResponse { license?: LicenseInfo error?: LicenseError } export interface LicenseSeatsRequest { licenseKey: string seats: number } export declare function llmBuildCanonicalRequest(request: CanonicalChatRequestContract): LlmRequestContract export declare function llmBuildCanonicalStructuredRequest(request: CanonicalStructuredRequestContract): LlmStructuredRequestContract export declare function llmBuildEmbeddingRequest(request: LlmEmbeddingRequestContract): LlmEmbeddingRequestContract export declare function llmBuildImageRequestFromMessages(request: LlmImageRequestBuildContract): LlmImageRequestContract export declare function llmBuildRerankRequest(request: LlmRerankRequestContract): LlmRerankRequestContract export declare function llmCanonicalJsonSchemaHash(schema: any): string export declare function llmCollectPromptMetadata(request: PromptMetadataContract): PromptMetadataResult export declare function llmCompileExecutionPlan(value: any): any export interface LlmCoreMessage { role: string content: Array } export declare function llmCountPromptTokens(request: PromptTokenCountContract): PromptTokenCountResult export declare function llmDispatchPrepared(routesJson: string): Promise export declare function llmDispatchPreparedStream(routesJson: string, callback: ((err: Error | null, arg: string) => void)): LlmStreamHandle export declare function llmDispatchToolLoopStream(protocol: string, backendConfigJson: string, requestJson: string, maxSteps: number, callback: ((err: Error | null, arg: string) => void), toolCallback: ((err: Error | null, arg: string) => Promise)): LlmStreamHandle export declare function llmDispatchToolLoopStreamPrepared(routesJson: string, maxSteps: number, callback: ((err: Error | null, arg: string) => void), toolCallback: ((err: Error | null, arg: string) => Promise)): LlmStreamHandle export declare function llmDispatchToolLoopStreamRouted(routesJson: string, requestJson: string, maxSteps: number, callback: ((err: Error | null, arg: string) => void), toolCallback: ((err: Error | null, arg: string) => Promise)): LlmStreamHandle export declare function llmEmbeddingDispatch(protocol: string, backendConfigJson: string, requestJson: string): Promise export declare function llmEmbeddingDispatchPrepared(routesJson: string): Promise export interface LlmEmbeddingRequestContract { model: string inputs: Array dimensions?: number taskType?: string } export declare function llmGetBuiltInPromptSpec(name: string): BuiltInPromptSpec | null export declare function llmGetContractSchema(name: string): any export declare function llmImageDispatchPrepared(routesJson: string): Promise export interface LlmImageInputContract { kind: 'url' | 'data' | 'bytes' url?: string dataBase64?: string data?: Array mediaType?: string fileName?: string } export interface LlmImageOptionsContract { n?: number size?: string aspectRatio?: string quality?: string outputFormat?: 'png' | 'jpeg' | 'webp' outputCompression?: number background?: string seed?: number } export interface LlmImageProviderOptionsContract { provider: 'openai' | 'gemini' | 'fal' | 'extra' options?: { input_fidelity?: string; response_modalities?: string[]; model_name?: string; image_size?: unknown; aspect_ratio?: string; num_images?: number; enable_safety_checker?: boolean; output_format?: 'jpeg' | 'png' | 'webp'; sync_mode?: boolean; enable_prompt_expansion?: boolean; loras?: unknown; controlnets?: unknown; extra?: unknown; } | unknown } export interface LlmImageRequestBuildContract { model: string protocol: 'openai_chat' | 'openai_responses' | 'openai_images' | 'anthropic' | 'gemini' | 'fal_image' messages: Array options?: any } export interface LlmImageRequestContract { model: string prompt: string operation: 'generate' | 'edit' images?: Array mask?: LlmImageInputContract options?: LlmImageOptionsContract providerOptions?: LlmImageProviderOptionsContract } export declare function llmInferPromptModelConditions(messages: Array): ModelConditionsContract export declare function llmListBuiltInPromptSpecs(): Array export declare function llmMatchModelCapabilities(payload: CapabilityMatchRequest): CapabilityMatchResponse export declare function llmMatchModelRegistry(request: ModelRegistryMatchRequest): ModelRegistryMatchResponse export declare function llmNormalizePreparedRoutes(value: any): any export declare function llmPlanAttachmentReference(protocol: string, backendConfigJson: string, sourceJson: string): string export declare function llmRenderBuiltInPrompt(request: BuiltInPromptRenderContract): PromptRenderResult export declare function llmRenderBuiltInSessionPrompt(request: BuiltInPromptSessionContract): PromptSessionResult export declare function llmRenderPrompt(request: PromptRenderContract): PromptRenderResult export declare function llmRenderSessionPrompt(request: PromptSessionContract): PromptSessionResult export interface LlmRequestContract { model: string messages: Array stream?: boolean maxTokens?: number temperature?: number tools?: Array toolChoice?: any include?: Array reasoning?: any responseSchema?: any middleware?: any } export declare function llmRerankDispatch(protocol: string, backendConfigJson: string, requestJson: string): Promise export declare function llmRerankDispatchPrepared(routesJson: string): Promise export interface LlmRerankRequestContract { model: string query: string candidates: Array topN?: number } export declare function llmResolveModelRegistryVariant(request: ModelRegistryResolveRequest): ModelRegistryResolveResponse export declare function llmResolveRequestedModelMatch(payload: RequestedModelMatchRequest): RequestedModelMatchResponse export declare function llmResolveRequestIntent(protocol: string, backendConfigJson: string, intentJson: string): string export declare function llmStructuredDispatch(protocol: string, backendConfigJson: string, requestJson: string): Promise export declare function llmStructuredDispatchPrepared(routesJson: string): Promise export interface LlmStructuredRequestContract { model: string messages: Array schema: any maxTokens?: number temperature?: number reasoning?: any strict?: boolean responseMimeType?: string middleware?: any } export declare function llmValidateContract(name: string, value: any): any export declare function llmValidateJsonSchema(schema: any, value: any): any /** * Merge updates in form like `Y.applyUpdate(doc, update)` way and return the * result binary. */ export declare function mergeUpdatesInApplyWay(updates: Array): Buffer export declare function mintChallengeResponse(resource: string, bits?: number | undefined | null): Promise export interface ModelConditionsContract { inputTypes?: Array<'text' | 'image' | 'audio' | 'file'> attachmentKinds?: Array<'image' | 'audio' | 'file'> attachmentSourceKinds?: Array<'url' | 'data' | 'bytes' | 'file_handle'> hasRemoteAttachments?: boolean modelId?: string outputType?: 'text' | 'image' | 'object' | 'structured' | 'embedding' | 'rerank' } export interface ModelRegistryMatchRequest { backendKind: 'openai_chat' | 'openai_responses' | 'anthropic' | 'cloudflare_workers_ai' | 'gemini_api' | 'gemini_vertex' | 'fal' | 'anthropic_vertex' cond: ModelConditionsContract } export interface ModelRegistryMatchResponse { variant?: ModelRegistryVariantContract } export interface ModelRegistryResolveRequest { backendKind?: 'openai_chat' | 'openai_responses' | 'anthropic' | 'cloudflare_workers_ai' | 'gemini_api' | 'gemini_vertex' | 'fal' | 'anthropic_vertex' modelId: string } export interface ModelRegistryResolveResponse { variant?: ModelRegistryVariantContract matchedBy?: string } export interface ModelRegistryRouteContract { protocol?: 'openai_chat' | 'openai_responses' | 'openai_images' | 'anthropic' | 'gemini' | 'fal_image' requestLayer?: 'anthropic' | 'chat_completions' | 'cloudflare_workers_ai' | 'responses' | 'openai_images' | 'fal' | 'vertex' | 'vertex_anthropic' | 'gemini_api' | 'gemini_vertex' } export interface ModelRegistryVariantContract { backendKind: 'openai_chat' | 'openai_responses' | 'anthropic' | 'cloudflare_workers_ai' | 'gemini_api' | 'gemini_vertex' | 'fal' | 'anthropic_vertex' canonicalKey: string rawModelId: string displayName?: string aliases: Array legacyAliases?: Array capabilities: Array protocol?: 'openai_chat' | 'openai_responses' | 'openai_images' | 'anthropic' | 'gemini' | 'fal_image' requestLayer?: 'anthropic' | 'chat_completions' | 'cloudflare_workers_ai' | 'responses' | 'openai_images' | 'fal' | 'vertex' | 'vertex_anthropic' | 'gemini_api' | 'gemini_vertex' routeOverrides?: Record behaviorFlags?: Array } export interface NativeBlockInfo { blockId: string flavour: string content?: Array blob?: Array refDocId?: Array refInfo?: Array parentFlavour?: string parentBlockId?: string additional?: string } export interface NativeCrawlResult { blocks: Array title: string summary: string } export interface NativeMarkdownResult { title: string markdown: string knownUnsupportedBlocks: Array unknownBlocks: Array } export interface NativePageDocContent { title: string summary: string } export interface NativeWorkspaceDocContent { name: string avatarKey: string } export interface ParsedDoc { name: string chunks: Array } export declare function parseDoc(filePath: string, doc: Buffer): Promise export declare function parseDocFromBinary(docBin: Buffer, docId: string): NativeCrawlResult export declare function parseDocToMarkdown(docBin: Buffer, docId: string, aiEditable?: boolean | undefined | null, docUrlPrefix?: string | undefined | null): NativeMarkdownResult export declare function parsePageDoc(docBin: Buffer, maxSummaryLength?: number | undefined | null): NativePageDocContent | null export declare function parseWorkspaceDoc(docBin: Buffer): NativeWorkspaceDocContent | null export declare function permissionActionRoleMatrixV1(): any export declare function permissionActionRoleMatrixV1Json(): string export interface PortalResponse { url?: string error?: LicenseError } export declare function processImage(input: Buffer, maxEdge: number, keepExif: boolean): Promise export type PromptBuiltin = 'Date'| 'Language'| 'Timezone'| 'HasDocs'| 'HasFiles'| 'HasSelected'| 'HasCurrentDoc'; export interface PromptCountMessage { content: string } export interface PromptMessageContract { role: 'system' | 'assistant' | 'user' content: string attachments?: Array params?: Record responseFormat?: PromptStructuredResponseContract } export interface PromptMetadataContract { messages: Array } export interface PromptMetadataResult { paramKeys: Array templateParams: Record } export interface PromptParamSpec { default?: string enumValues?: Array } export interface PromptRenderContract { messages: Array templateParams: Record renderParams: Record } export interface PromptRenderResult { messages: Array warnings: Array } export interface PromptSessionContract { prompt: PromptSessionPrompt turns: Array renderParams: Record maxTokenSize: number } export interface PromptSessionPrompt { action?: string model?: string promptTokens: number templateParams: Record messages: Array } export interface PromptSessionResult { messages: Array warnings: Array promptMessagePositions: Array } export interface PromptSpecMessage { role: 'system' | 'assistant' | 'user' template: string } export interface PromptStructuredResponseContract { type: 'json_schema' responseSchemaJson: Record schemaHash: string strict?: boolean } export interface PromptTokenCountContract { model?: string messages: Array } export interface PromptTokenCountResult { tokens: number } export interface ProviderDriverSpec { driverId: string providerType: string models: Array routes: Array hostOnly?: ProviderHostOnlySpec } export interface ProviderHostOnlySpec { errorMapper?: string structuredRetry?: boolean providerToolAlias?: boolean } export interface ProviderRouteSpec { kind: string protocol: string requestLayer?: string supportsNativeFallback?: boolean supportsToolLoop?: boolean requestMiddlewares?: Array streamMiddlewares?: Array nodeTextMiddlewares?: Array } export interface PublicDocMetaInput { id: string title?: string } export declare function readAllDocIdsFromRootDoc(docBin: Buffer, includeTrash?: boolean | undefined | null): Array export interface RemoteAttachmentFetchRequest { url: string timeoutMs?: number maxBytes: number allowPrivateTargetOrigin?: boolean expectedContentTypePrefix?: string maxImageWidth?: number maxImageHeight?: number maxImagePixels?: number } export interface RemoteAttachmentFetchResponse { finalUrl: string mimeType: string body: Buffer } export interface RemoteMimeTypeRequest { url: string timeoutMs?: number } export interface RequestedModelMatchRequest { providerIds: Array optionalModels: Array requestedModelId?: string defaultModel?: string } export interface RequestedModelMatchResponse { selectedModel?: string matchedOptionalModel: boolean } export interface RerankCandidate { id?: string text: string } export interface ResolvedEntitlement { plan: string valid: boolean status: string quantity?: number expiresAt?: string subjectId?: string targetId?: string recurring?: string issuedAt?: string entity?: string issuer?: string quota: ResolvedQuota flags: Record errorCode?: string errorMessage?: string } export interface ResolvedQuota { blobLimit: number storageQuota: number seatLimit?: number seatQuota?: number historyPeriod: number copilotActionLimit?: number } export interface ResolveEntitlementInput { deploymentType: string targetType: string targetId?: string plan?: string quantity?: number signedPayload?: Buffer publicKey?: string licenseAesKey?: string now: string } export declare function resolveEntitlementV1(input: ResolveEntitlementInput): ResolvedEntitlement export declare function runNativeActionRecipePreparedStream(input: ActionRuntimeInput, callback: ((err: Error | null, arg: string) => void)): LlmStreamHandle export interface RuntimeBlobCleanupExecuteResult { scannedCandidates: number deletedObjects: number deletedMetadata: number skippedStillReferenced: number failed: number workspaceIds: Array } export interface RuntimeBlobCleanupPlanResult { runId?: string scannedBlobs: number candidatesMarked: number protectedByDocRefs: number protectedByMetadata: number protectedByOtherRefs: number nextCursor?: string } export interface RuntimeBlobCleanupResult { scanned: number deleted: number abortedMultipart: number workspaceIds: Array } export interface RuntimeBlobCompleteResult { ok: boolean reason?: string contentType?: string contentLength?: number lastModifiedMs?: number } export interface RuntimeBlobMetadataBackfillResult { scannedObjects: number headedObjects: number upsertedMetadata: number skippedExisting: number skippedWorkspaceMissing: number failed: number nextCursor?: string workspaceIds: Array } export interface RuntimeByokLocalLeaseRecord { leaseId: string payload: any expiresAtMs: number } export interface RuntimeDocBlobRefsResult { scannedDocs: number parsedDocs: number refsWritten: number refsDeleted: number failedDocs: number nextCursor?: string } export interface RuntimeDocCompactionResult { leaseAcquired: boolean merged: boolean workspaceId: string docId: string updatesMerged: number historyCreated: boolean } export interface RuntimeDocHistoryInput { workspaceId: string docId: string blob: Buffer timestampMs: number editorId?: string force: boolean historyMinIntervalMs: number historyMaxAgeMs: number } export interface RuntimeInviteAbuseActionRequired { action: string subjectKey: string evidenceId: string actionId: string } export interface RuntimeInviteAbuseClaimedAction { action: string subjectKey: string evidenceId: string actionId: string actorUserId: string workspaceId: string } export interface RuntimeMagicLinkOtpConsumeResult { ok: boolean token?: string reason?: string } export interface RuntimeMailDeliveryQuotaDecision { allowed: boolean reservationId?: string mailClass: string retryAfterSeconds?: number reason?: string scopeKey?: string windowSeconds?: number limit?: number current?: number requested?: number } export interface RuntimeMailDeliveryQuotaInput { requestId?: string mailName: string recipient: RuntimeMailDeliveryQuotaRecipientInput metadata: RuntimeMailDeliveryQuotaMetadataInput source?: RuntimeQuotaSourceInput } export interface RuntimeMailDeliveryQuotaMetadataInput { actorUserId?: string workspaceId?: string notificationId?: string abuseSubjectKey?: string } export interface RuntimeMailDeliveryQuotaRecipientInput { email: string domain: string userId?: string } export interface RuntimeMultipartUploadInit { uploadId: string expiresAtMs: number } export interface RuntimeMultipartUploadPart { partNumber: number etag: string } export interface RuntimeObjectGetResult { body: Buffer metadata: RuntimeObjectMetadata } export interface RuntimeObjectListEntry { key: string contentLength: number lastModifiedMs: number } export interface RuntimeObjectMetadata { contentType: string contentLength: number lastModifiedMs: number checksumCrc32?: string } export interface RuntimeObjectStoragePutOptions { contentType?: string contentLength?: number checksumCrc32?: string } export interface RuntimePresignedObjectRequest { url: string headersJson: string expiresAtMs: number } export interface RuntimeQuotaSourceInput { trusted: boolean ip?: string country?: string asn?: number rayId?: string } export interface RuntimeQuotaTargetDomainInput { domain: string count: number } export interface RuntimeVerificationTokenRecord { tokenType: number token: string credential?: string expiresAtMs: number } export interface RuntimeWorkspaceInviteLinkRecord { workspaceId: string inviteId: string inviterUserId: string expiresAtMs: number } export interface RuntimeWorkspaceInviteQuotaDecision { allowed: boolean reservationId?: string retryAfterSeconds?: number reason?: string scopeKey?: string windowSeconds?: number limit?: number current?: number requested?: number actionRequired?: RuntimeInviteAbuseActionRequired } export interface RuntimeWorkspaceInviteQuotaInput { actorUserId: string workspaceId: string requestId?: string targetCount: number targetDomains: Array source?: RuntimeQuotaSourceInput } export interface RuntimeWorkspaceInviteQuotaUsage { targetCount: number targetDomains: Array } export interface RuntimeWorkspaceStatsDailyRecalibrationResult { processed: number lastSid: number snapshotted: number skipped: boolean } export interface RuntimeWorkspaceStatsRecalibrationResult { processed: number lastSid: number skipped: boolean } export interface RuntimeWorkspaceStatsRefreshResult { processed: number backlog: number skipped: boolean } export interface RuntimeWorkspaceStatsSnapshotResult { snapshotted: number skipped: boolean } export declare function safeFetch(request: SafeFetchRequest): Promise export type SafeFetchMethod = 'get'| 'head'| 'post'| 'put'| 'propfind'| 'report'; export interface SafeFetchRequest { url: string method?: SafeFetchMethod headers?: Record body?: Buffer timeoutMs?: number maxRedirects?: number maxBytes?: number allowedHeaders?: Array allowedHosts?: Array allowHttp?: boolean allowPrivateTargetOrigin?: boolean enableEch?: boolean echConfigList?: Buffer } export interface SafeFetchResponse { status: number finalUrl: string headers: Record body: Buffer } export declare function scanContentPolicyV1(input: ContentPolicyScanInput): ContentPolicyScanResult export interface StorageProviderCapabilities { put: boolean get: boolean head: boolean list: boolean delete: boolean presignPut: boolean presignGet: boolean multipartDirect: boolean proxyUpload: boolean assetpack: boolean serverMediatedOnly: boolean } export interface StorageRuntimeHealth { started: boolean databaseConnected: boolean providerConfigured: boolean provider?: string bucket?: string } export interface ToolContract { name: string description?: string parameters: any } /** * Updates or creates the docProperties record for a document. * * # Arguments * * `existing_binary` - The current docProperties document binary * * `properties_doc_id` - The docProperties document ID * (db$${workspaceId}$docProperties) * * `target_doc_id` - The document ID to update in docProperties * * `created_by` - Optional creator user ID * * `updated_by` - Optional updater user ID * * # Returns * A Buffer containing only the delta (changes) as a y-octo update binary */ export declare function updateDocProperties(existingBinary: Buffer, propertiesDocId: string, targetDocId: string, createdBy?: string | undefined | null, updatedBy?: string | undefined | null): Buffer /** * Updates a document's title without touching content blocks. * * # Arguments * * `existing_binary` - The current document binary * * `title` - The new title * * `doc_id` - The document ID * * # Returns * A Buffer containing only the delta (changes) as a y-octo update binary */ export declare function updateDocTitle(existingBinary: Buffer, title: string, docId: string): Buffer /** * Updates an existing document with new markdown content. * Uses structural diffing to apply block-level replacements for changes. * * # Arguments * * `existing_binary` - The current document binary * * `new_markdown` - The new markdown content to apply * * `doc_id` - The document ID * * # Returns * A Buffer containing only the delta (changes) as a y-octo update binary */ export declare function updateDocWithMarkdown(existingBinary: Buffer, newMarkdown: string, docId: string): Buffer export declare function updateLicenseRecurring(request: LicenseRecurringRequest): Promise export declare function updateLicenseSeats(request: LicenseSeatsRequest): Promise /** * Updates a document title in the workspace root doc's meta.pages array. * * # Arguments * * `root_doc_bin` - The current root doc binary (workspaceId doc) * * `doc_id` - The document ID to update * * `title` - The new title for the document * * # Returns * A Buffer containing the y-octo update binary to apply to the root doc */ export declare function updateRootDocMetaTitle(rootDocBin: Buffer, docId: string, title: string): Buffer /** * Check whether a Yjs update binary can be decoded without applying it to a * document state. */ export declare function validateDocUpdate(update: Buffer): Promise export declare function verifyChallengeResponse(response: string, bits: number, resource: string): Promise