import { type Logger } from "../observe/logger.ts"; import { Metrics } from "../observe/metrics.ts"; import { type PublicKeyResolver } from "./transportAuth.ts"; /** Wire-protocol version the hub speaks (have/objects/refs gossip). Bumped on breaking * changes. v2 adds SSH-style transport auth: write endpoints may require an AVCS-Sig * Authorization header (read endpoints stay public). v3 (additive) adds the integration * queue: POST /integrate + GET /integrations/:ticketId; `GET /version` advertises * `integrate: true` so a client can capability-detect before falling back to legacy * POST /finalize (which is unchanged). v4 (additive) adds live convergence (Phase 15): * GET /events long-poll sharing the objlog cursor with /sync; `GET /version` advertises * `events: true` — a client without it falls back to periodic polling. v5 (additive) adds * BATCHED object transfer (issue #99): POST /objects/batch moves many objects in one signed * request with per-oid verdicts, POST /objects/fetch returns many objects for one wanted-oid * list; `GET /version` advertises `batch: true` plus `batchMaxBytes` (the largest body this * hub accepts) — a client without it keeps the per-object POST /objects and GET /objects/:oid * protocol, which is unchanged. * * Derived-state reads (GET /reduced, GET /reduced/blob — docs/27) are additive and do NOT * bump the version: docs/26 §9 fixed that rule after v5 — capabilities are advertised by * flag only. */ export declare const HUB_PROTOCOL_VERSION = 5; /** Default cap on `tree` entries a `/reduced` answer carries (docs/27 §4.1). Above it the * tree is OMITTED, never truncated — a truncated tree reads as deletions. Advertised as * `reducedTreeMaxEntries` so a client learns it up front instead of through a surprise. */ export declare const REDUCED_TREE_MAX_ENTRIES = 50000; /** What `GET /reduced` answers with (docs/27 §3.1). Maps become plain objects on the wire. */ export interface ReducedBody { view: string; cursor: number; materializer: string; treeHash: string; statuses: Record; headOps: string[]; conflicts: unknown[]; fileConflicts: unknown[]; blockedReasons: Record; untrustedEvidence: number; tree?: Record; synth?: string[]; treeOmitted: boolean; } export interface HubHandle { url: string; port: number; metrics: Metrics; close(): Promise; } /** * Start an HTTP hub backed by `new ObjectStore(opts.repoDir)`. The store is init()'d * so an empty repo dir works. Pass `port: 0` (or omit) to get an OS-assigned port, * read back from the returned handle. */ export declare function startHub(opts: { repoDir: string; port?: number; gated?: boolean; logger?: Logger; metrics?: Metrics; /** App-layer per-actor push quota (E7). Omit to disable. */ rateLimit?: { maxPerWindow: number; windowMs?: number; }; /** SSH-style transport authentication of write requests (read endpoints stay public). * When `required` is true, POST /objects and /finalize must carry a valid AVCS-Sig * Authorization header (see transportAuth.ts) or get a 401. `resolvePublicKey` is the * pluggable hook (D3): an embedder injects its own keyId→publicKey lookup; when omitted * the hub resolves against its own `member:` registry. */ auth?: { required?: boolean; resolvePublicKey?: PublicKeyResolver; windowMs?: number; }; /** Live-convergence long-poll tuning (Phase 15.1). `maxWaiters` bounds concurrently * parked GET /events responses (default 256; beyond it new polls get a 503). */ events?: { maxWaiters?: number; }; /** `GET /reduced` tuning (docs/27 §4.1). `treeMaxEntries` above which the tree is omitted. */ reduced?: { treeMaxEntries?: number; }; }): Promise; //# sourceMappingURL=hubServer.d.ts.map