import { ensureOxigraphBinary } from './oxigraph-binary.js'; import { type OxigraphServerHandle, type OxigraphServerIo } from './oxigraph-server.js'; /** Config value that opts a node into the daemon-managed local server. */ export declare const MANAGED_OXIGRAPH_BACKEND = "oxigraph-server"; /** Default loopback bind port. Override via `store.options.port`. */ export declare const DEFAULT_OXIGRAPH_PORT = 7878; /** Same port validation as {@link planManagedOxigraph} — shared with status. */ export declare function resolveManagedOxigraphPort(options: Record | undefined): number; interface StoreConfigLike { backend?: unknown; options?: Record; } interface ConfigLike { store?: StoreConfigLike; largeLiteralStorage?: { enabled?: boolean; thresholdBytes?: number; directory?: string; }; sharedMemoryPublicSnapshotStorage?: { enabled?: boolean; directory?: string; }; } export interface ManagedOxigraphPlan { /** Loopback bind port. */ port: number; /** RocksDB data directory (`oxigraph serve --location`). */ location: string; /** Directory the verified binary is cached in. */ cacheDir: string; /** * `store` config rewritten to the equivalent `sparql-http` backend so * the rest of boot treats it as a normal external endpoint. Endpoints * are filled in by {@link startManagedOxigraph} once the port is bound. */ storeConfigTemplate: { backend: 'sparql-http'; options: Record; }; /** * largeLiteralStorage to apply when the operator didn't configure one. * External backends have no `options.path`, so the blob store would * throw without an explicit directory; we default it under the data dir * to preserve parity with the local Oxigraph default. */ largeLiteralStorage: { enabled: boolean; thresholdBytes?: number; directory: string; }; /** * sharedMemoryPublicSnapshotStorage with a defaulted `directory`, set * only when the operator enabled it. Same rewrite hazard as * largeLiteralStorage: the local Oxigraph path infers a directory, but * after rewriting to `sparql-http` a config with `enabled: true` and no * explicit `directory` would fail validateStoreConfig(). Defaulted to * the same `swm-public-snapshots` dir createPublicSnapshotStore() uses. */ sharedMemoryPublicSnapshotStorage?: { enabled: boolean; directory: string; }; } /** * Pure: decide how to launch the managed server from config, or return * null if this node isn't using `oxigraph-server`. Does no I/O. */ export declare function planManagedOxigraph(config: ConfigLike, dataDir: string): ManagedOxigraphPlan | null; export interface ManagedOxigraphResult { handle: OxigraphServerHandle; /** Drop-in replacement for `config.store`. */ storeConfig: { backend: 'sparql-http'; options: Record; }; largeLiteralStorage: { enabled: boolean; thresholdBytes?: number; directory: string; }; /** Set only when the operator enabled the feature (else leave config as-is). */ sharedMemoryPublicSnapshotStorage?: { enabled: boolean; directory: string; }; } export interface StartManagedOxigraphOptions { config: ConfigLike; dataDir: string; log?: (msg: string) => void; platform?: NodeJS.Platform; arch?: string; binaryIo?: Parameters[0]['io']; serverIo?: Partial; readyTimeoutMs?: number; } /** * Start the managed server if configured. Returns null when the node uses * a different backend (so callers can `const m = await start(...); if (m) * { config.store = m.storeConfig; ... }`). Throws if the binary can't be * fetched/verified or the server never becomes ready — boot should treat * that as fatal (a misconfigured store is not safe to run half-up). */ export declare function startManagedOxigraph(opts: StartManagedOxigraphOptions): Promise; export {}; //# sourceMappingURL=oxigraph-managed.d.ts.map