/** * Connector runtime parity self-check. * * One shared function run from BOTH entrypoints — the worker Docker image * (`node dist/bin.js self-check`) and the built CLI (`lobu connector * runtime-self-check`) — so both assert the identical compile + isolate * execution path. The only per-surface difference is the connector * source discovery roots (monorepo vs worker image vs npm-installed CLI). * * The result also reports the isolate lane (`isolate_lane`): whether this * runtime can load `isolated-vm`, the V8 addon every connector run needs. * That section never flips `ok` — a Bun or Node 25 host legitimately lacks the * addon and simply runs no connector code — but the worker * image smoke asserts `isolate_lane.available` separately, because the image * exists to run the isolate lane and its native build is otherwise unproven. * * Why it exists: the worker image once shipped to prod missing `COPY * packages/core`, so `@lobu/connector-sdk`'s transitive `@lobu/core` import * dangled and every feed sync crashed — yet all CI was green, because CI builds * and pushes the image but never RUNS it. This gate runs the built artifact and * asserts its resolution/compile/execute graph holds. It touches no network, DB, * gateway, or OAuth, and passes under `docker run --network=none`. */ export interface SelfCheckEntry { name: string; ok: boolean; detail: string; } /** * Whether this runtime can host `lane: 'isolate'` runs. Snake_case on purpose: * the image smokes read it with `jq '.isolate_lane.available'`. */ export interface SelfCheckIsolateLane { /** `isolated-vm` loaded; `selectExecutor` can build an `IsolateExecutor`. */ available: boolean; /** Why not, when unavailable; `null` when available. */ reason: string | null; /** Installed version of the build this Node line uses; `null` if absent. */ isolated_vm_version: string | null; node_version: string; } export interface SelfCheckResult { ok: boolean; /** Which entrypoint ran the check — for log/parity-debugging only. */ surface: "cli" | "worker" | "unknown"; connectorSourceDir: string | null; connectorCount: number; checks: SelfCheckEntry[]; /** Informational: does not participate in `ok` (see module doc). */ isolate_lane: SelfCheckIsolateLane; } export interface SelfCheckOptions { /** * Connector source discovery roots, highest priority first; the first * existing one wins. Each surface passes its own layout. Defaults cover the * monorepo + worker image. */ connectorSourceCandidates?: readonly string[]; /** Label recorded on the result so logs say which entrypoint ran. */ surface?: SelfCheckResult["surface"]; } /** * Probe the isolate lane the way `selectExecutor` does — through the memoized * `loadIsolatedVm()` — and read the installed addon's version from the * package this Node line resolves. The version read is best-effort metadata: * `available` is the assertion. */ export declare function probeIsolateLane(): Promise; /** * Fast boot gate for a worker that is about to advertise connector * capabilities. It compiles and executes the synthetic connector through the * real isolate path, so a runtime that cannot load the SDK fails before its * first poll can claim production work. */ export declare function assertConnectorRuntimeLoadable(): Promise; /** * Run the shared connector-runtime parity self-check. Each assertion is * recorded as a `{ ok }` entry rather than thrown; the top-level `ok` is the * AND of all of them. */ export declare function runConnectorRuntimeSelfCheck(opts?: SelfCheckOptions): Promise; /** Pretty-print a self-check result to stderr (human-readable mode). */ export declare function printSelfCheckResult(result: SelfCheckResult): void; //# sourceMappingURL=index.d.ts.map