run402-mcp
Version:
MCP server for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.
59 lines • 3.35 kB
TypeScript
/** Injectable for tests. */
export declare const prewarmDeps: {
fetch: typeof globalThis.fetch;
warmSigner: () => unknown;
warmPaidStack: () => unknown;
/**
* vault-object-host-predial (task 2.1): this repo's locally-learned
* object-store origins, or `[]` for "nothing known" (a first-ever
* session, or any read failure — never thrown). Injectable so the dial
* loop below is testable without a real keystore on disk; the real
* implementation is a plain, synchronous `VaultKeystore.readRepo`.
*/
readObjectStoreOrigins: (repoId: string, keystoreRoot?: string) => string[];
};
/**
* The connection-dial half alone (vault-first-op-premium task 2.1 —
* "pre-connect on session accept"). A RESIDENT daemon already ran the full
* prewarm (dial + signer + paid-stack) exactly once at boot; re-running
* `warmPaidStack` on every forwarded session was measured to cost an EXTRA
* ~150-300ms per session (two live Base RPC probes, `sepolia.base.org` +
* `mainnet.base.org`, that a vault session never actually needs) for no
* benefit — the paid-fetch buyer stack only needs loading once per process.
* This is the narrow half a session-accept hook should call: kick the owned
* dispatcher's connection (so a dead/never-dialed socket redials NOW,
* overlapping git's own helper handshake) and nothing else. Same contract as
* the full prewarm: fire-and-forget, every failure swallowed, no side effects.
*/
export declare function kickVaultConnection(apiBase?: string): void;
/**
* Start the connection + signer prewarm. Returns immediately; nothing to
* await, nothing thrown, ever. Call this ONCE per process (verb startup, or
* daemon boot) — see `kickVaultConnection` for the narrower, repeatable
* connection-only half a resident daemon should use per forwarded session.
*/
export declare function prewarmVaultConnection(apiBase?: string): void;
/**
* vault-object-host-predial (design D2/D4, task 2.1): fire-and-forget,
* dial-only connection establishment to a repo's PERSISTED object-store
* origin(s) — the presigned/edge host(s) an earlier session in this
* checkout already fetched objects from (recorded via
* `VaultKeystore.recordObjectStoreOrigins`). Every guarantee of the
* prewarm above applies verbatim: never awaited, every failure (a
* malformed origin, a keystore read failure, a dial that never completes)
* is swallowed silently, the abort timer is unref'd via
* `AbortSignal.timeout`, and the response body is cancelled immediately —
* nothing here can hold the process open or touch a counted transport
* budget. Rides the SAME owned dispatcher as `kickVaultConnection`
* (vault-owned-dispatcher D5), so a warmed socket lands in the exact
* per-origin pool the verb's real object GET draws from.
*
* A repo with nothing persisted (first-ever session, or a keystore read
* failure) predials nothing — there is deliberately no fallback guess and
* no network read to learn where to predial (design D4/D6). Dialing an
* origin that no longer serves this vault's objects (a bucket migration)
* costs one harmless background round trip; the next observed fetch
* overwrites the persisted hint.
*/
export declare function predialVaultObjectStore(repoId: string, keystoreRoot?: string): void;
//# sourceMappingURL=vault-prewarm.d.ts.map