/** * @codemem/server — HTTP server (viewer, sync, API). * * Single HTTP server handling viewer routes and sync daemon. * Shares one better-sqlite3 connection between viewer and sync. * Embedding inference runs in a worker_thread (lazy-started). * * Entry: `codemem serve` */ import type { ObserverClient } from "@codemem/core"; import { MemoryStore, type RawEventSweeper, VERSION } from "@codemem/core"; import { Hono } from "hono"; import { type InMemoryRequestRateLimiter } from "./request-rate-limit.js"; export { VERSION }; /** Get (or create) the shared store instance. Exported so the sweeper can share it. */ export declare function getStore(): MemoryStore; /** Close the shared store (called on shutdown). */ export declare function closeStore(): void; /** * Create the Hono app with all viewer routes. * Exported for testing — pass a custom store factory to inject test DBs. */ export interface AppOptions { storeFactory?: () => MemoryStore; sweeper?: RawEventSweeper | null; observer?: ObserverClient | null; syncRequestRateLimit?: { limiter?: InMemoryRequestRateLimiter; readLimit?: number; mutationLimit?: number; unauthenticatedReadLimit?: number; unauthenticatedMutationLimit?: number; }; getSyncRuntimeStatus?: () => { phase: "starting" | "running" | "stopping" | "error" | "disabled" | "rebootstrapping" | "needs_attention" | null; detail?: string | null; } | null; } export declare function createApp(opts?: AppOptions): Hono; /** * Create the Hono app for peer-to-peer sync protocol routes only. * * This app is bound to a separate network-accessible listener * (default 0.0.0.0:7337) so remote peers can reach the sync * endpoints without exposing the viewer UI or local API routes. * * No CORS/origin guard is applied — sync requests are authenticated * via cryptographic signature verification instead. */ export declare function createSyncApp(opts?: AppOptions): Hono; //# sourceMappingURL=index.d.ts.map