/**
 * olam memory bridge serve --local — embedded Miniflare bridge.
 *
 * `wrangler dev` is a dev iteration loop, not a production-style host
 * for a long-lived service. This subcommand spawns
 * `packages/memory-service/scripts/local-bridge-server.mjs` as a
 * foreground Node process: operators wire it into launchd / systemd
 * (Type=simple) and get the agent-memory bridge running on their
 * laptop without a Cloudflare account.
 *
 * Flow:
 *   1. Resolve packages/memory-service/ via the shared candidates list
 *      (handles workspace / bundled-CLI / cwd-checkout layouts).
 *   2. Locate scripts/local-bridge-server.mjs inside it.
 *   3. Ensure ~/.olam/memory-secret (0600) exists; pass it via
 *      AGENTMEMORY_SECRET env so the bridge can authenticate
 *      /bridge/stats callers without leaking the secret on argv.
 *   4. Spawn the .mjs in foreground; stdin/stdout/stderr propagate so
 *      the service-manager journal captures the bridge's logs.
 *   5. Forward SIGTERM/SIGINT to the child + exit with its code.
 *
 * Mirrors `start.ts`'s service-resolution + secret-handling pattern;
 * differs in that the spawned process stays in foreground (start.ts
 * detaches because the agentmemory engine is a separate long-lived
 * service).
 *
 * Plan reference: architecture conversation in PR #612.
 */
import type { Command } from 'commander';
import { type ChildProcess } from 'node:child_process';
export interface BridgeServeOpts {
    /** TCP port to bind on. Defaults to 8788. */
    port?: number;
    /** DO SQLite persistence directory. Default is in-memory (lost on restart). */
    persistTo?: string;
    /** Required for forward-compat with future `--cloud` / `--remote` flags. */
    local?: boolean;
}
/** Test seam — runtime injection of the spawn path resolution + child factory. */
export interface BridgeDeps {
    /** Override the memory-service directory lookup (testing). */
    resolveServiceDir?: () => string;
    /** Override the secret-resolver (testing). */
    ensureSecret?: () => string;
    /** Override the spawn entry point (testing). */
    spawnChild?: (command: string, args: readonly string[], env: NodeJS.ProcessEnv) => ChildProcess;
}
export declare function resolveMemoryServiceDir(): string;
export declare function resolveLocalBridgeScript(serviceDir: string): string;
export declare function validateBridgeOpts(opts: BridgeServeOpts): {
    port: number;
    persistTo?: string;
    local: boolean;
};
export declare function runBridgeServe(opts: BridgeServeOpts, deps?: BridgeDeps): Promise<number>;
export declare function registerMemoryBridge(cmd: Command): void;
//# sourceMappingURL=bridge.d.ts.map