/** * Burger platform for the SDK core. Selected by `#platform` under the * `burger` export condition (Burger apps are bundled by `burger-build`, * which sets it). * * The per-app channel is opened by the Burger runtime from its load_app * message (Contract C3); framing and JSON (de)serialisation happen in Rust * (Contract C4), so this module never splits lines or calls `JSON.parse`. */ import type { AppMemorySample, HostConnection, HostConnectionHandlers, InvocationContextStore, NodeAppCtx } from "./types.js"; export declare const platformName: "bun" | "burger"; /** Burger runs each app on its own runtime; there are no worker threads. */ export declare const isMainThread: boolean; /** Burger applies `PRAGMA cache_size = -256` to every database it opens; the SDK must not widen it. */ export declare const DEFAULT_SQLITE_CACHE_SIZE_KB: number; /** @internal exported for unit tests; not part of the public SDK surface. */ export declare function _resolveCtx(): NodeAppCtx; /** Context captured once at SDK import time. */ export declare const appCtx: NodeAppCtx; /** @internal test-only export */ export declare function _testRunNodeAppPath(): string | undefined; /** @internal test-only export; also the production exit pathway. */ export declare function _testExitWorker(code: number, _mainThread: boolean, exitFn?: (code: number) => never): void; /** Exit this app through the runtime (runs shutdown handlers, tears down the runtime). */ export declare function exitApp(code: number): void; /** The runtime always binds the app channel, so there is nothing to check. */ export declare function assertHostEndpoint(): void; /** * Open the runtime-owned app channel. Each inbound frame is dispatched as * soon as the runtime delivers it: handlers for different frames may * interleave at `await` points, which is what lets a capability handler * await an `invoke_capability_result` frame that arrives later. */ export declare function connectToHost(handlers: HostConnectionHandlers): HostConnection; /** * Burger Phase 1 has no `AsyncLocalStorage` (C6). The store is visible only * during the synchronous part of `fn`: a nested `invokeCapability` made * before the handler's first `await` carries `invocation_context_id`, later * ones carry none and the host classifies them as * `Background(AutonomousApp)` — never a wrong or elevated origin. */ export declare function createInvocationContextStore(): InvocationContextStore; /** @internal Exact QuickJS runtime sample used by the IPC timer and unit tests. */ export declare function _sampleMemory(): AppMemorySample; export declare function _captureHeapSnapshotTo(path: string, generate?: () => ArrayBuffer, write?: (path: string, bytes: ArrayBuffer) => Promise): Promise<{ size_bytes: number; }>;