import { ClientDecisions } from "./decisions.js"; import { ClientExpr } from "./expr.js"; import { ClientFederation } from "./federation.js"; import { ClientGraph } from "./graph.js"; import { ClientInvites } from "./invites.js"; import { ClientMembers } from "./members.js"; import { SyncropelKindError } from "./grammar.js"; import { ClientIdentity, Identity } from "./identity.js"; import { type InferOptions, type InferPending, type InferRequest, type InferResult } from "./inference.js"; import { ClientNamespaces } from "./namespaces.js"; import { ClientRecords } from "./records.js"; import { type SubscribeOptions, type Subscription } from "./subscription.js"; import { ClientThreads } from "./threads.js"; import { ClientFolds } from "./folds.js"; import { ClientData } from "./data.js"; import type { Transport } from "./transports/types.js"; import type { ActType, CanonicalRef, DataType, EmitResult, KernelRecord } from "./types.js"; export interface ClientOptions { endpoint?: string; identity: Identity; timeoutMs?: number; maxRetries?: number; backoffMs?: number; onEmit?: (result: EmitResult) => void; apiKey?: string; fetch?: typeof fetch; namespace?: string; transport?: Transport; } export interface EmitOptions { act: ActType | string; kind: string; body: Record; thread: string; refs?: CanonicalRef[]; parents?: string[]; dataType?: DataType | string; clock?: number; } export interface QueryThreadOptions { thread: string; limit?: number; since?: number; } export interface QueryOptions { kind?: string; actor?: string; thread?: string; since?: number; limit?: number; where?: Record; } export interface RichQueryOptions { filter: Record; thread?: string; sort?: Record; limit?: number; offset?: number; explain?: boolean; } export interface RichQueryResult { records: KernelRecord[]; plan?: { sql: string; bind_count: number; indexed_fields: string[]; unindexed_fields: string[]; }; } export declare class SyncropelQueryError extends Error { readonly detail: string; constructor(op: string, detail: string); } export interface SearchOptions { query: string; k?: number; thread?: string; actor?: string; kind?: string; afterClock?: number; } export interface SearchHit extends KernelRecord { score: number; } export interface SearchResult { embedder: string | null; k: number; hits: SearchHit[]; disabled?: boolean; } export declare class Client { readonly endpoint: string; readonly identity: ClientIdentity; readonly namespace: string | undefined; private readonly timeoutMs; private readonly maxRetries; private readonly backoffMs; private readonly onEmit; private readonly apiKey; private readonly fetchImpl; private readonly defaultTransport; private readonly requestTransport; readonly threads: ClientThreads; readonly folds: ClientFolds; readonly decisions: ClientDecisions; readonly federation: ClientFederation; readonly namespaces: ClientNamespaces; readonly expr: ClientExpr; readonly graph: ClientGraph; readonly records: ClientRecords; readonly invites: ClientInvites; readonly members: ClientMembers; readonly data: ClientData; private readonly lastAutoClock; constructor(opts: ClientOptions); private nextAutoClock; emit(opts: EmitOptions): Promise; intend(opts: { goal: string; thread?: string; parents?: string[]; kind?: string; body?: Record; clock?: number; }): Promise; message(opts: { text: string; thread?: string; act?: "INTEND" | "KNOW"; parents?: string[]; clock?: number; }): Promise; cancel(opts: { thread: string; fulfills: string; reason?: string; }): Promise<{ success: boolean; recordId?: string; cancelled?: boolean; }>; fulfill(opts: { thread: string; summary: string; fulfills?: string | string[]; kind?: string; body?: Record; parents?: string[]; clock?: number; }): Promise; do(opts: { thread: string; description: string; kind?: string; body?: Record; parents?: string[]; clock?: number; }): Promise; know(opts: { thread: string; observation: string; kind?: string; body?: Record; parents?: string[]; clock?: number; }): Promise; learn(opts: { thread: string; insight: string; kind?: string; body?: Record; parents?: string[]; clock?: number; }): Promise; capabilities(): Promise>; private buildEnvelope; private postWithRetry; private fireHook; queryThread(opts: QueryThreadOptions): Promise; query(opts: QueryOptions): Promise; richQuery(opts: RichQueryOptions): Promise; search(opts: SearchOptions): Promise; infer(request: InferRequest, options?: InferOptions): Promise; subscribe(thread: string, callback: (record: KernelRecord) => void, options?: SubscribeOptions): Subscription; health(): Promise>; emitCorrection(opts: { corrects: string[]; revisedFields: Record; reason: string; thread: string; correctingActor?: string; }): Promise; emitErasure(opts: { erases: string[]; reason: string; thread: string; authorizedBy?: string; effectiveAt?: string; }): Promise; emitAlias(opts: { oldKind: string; newKind: string; reason: string; thread: string; since?: string; publisherDid?: string; }): Promise; emitScopeTransfer(opts: { scope: string; fromPublisher: string; toPublisher: string; reason: string; thread: string; effectiveAt?: string; }): Promise; emitScopeClaim(opts: { scope: string; governancePolicy: Record; thread: string; claimant?: string; effectiveAt?: string; }): Promise; } export { SyncropelKindError };