UNPKG

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.

80 lines • 4.69 kB
/** 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[]; /** * vault-object-host-predial (task 2.3): the repo the keystore holds for a * project (`VaultKeystore.findRepoByProject`, org mismatch = miss), or * `null` for "not known here" — never thrown. Injectable like the origin * lookup above. */ findRepoIdByProject: (projectId: string, orgId?: string, keystoreRoot?: string) => string | null; }; /** * 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 (D-vault-client-surface-10/12, 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 (D-vault-client-surface-11/12). 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; /** * vault-object-host-predial task 2.3 — the fresh-target case. A clone's * target directory carries no git-config pin yet (and the in-process * `RUN402_DAEMON=0` helper a handoff `resume` spawns is always such a * clone), so the pin-keyed trigger above predials nothing there. This * resolves the addressed repo OFFLINE from the keystore's own project→repo * match instead — the same `findRepoByProject` lookup id-form address * resolution uses (D-vault-client-surface-14) — and predials its * persisted origins under exactly the same terms: never awaited, every * failure swallowed, a project the keystore does not know predials nothing, * and never a network read to learn where to dial. Callers pass an id-form * address only; a slug names no project id the keystore could match. */ export declare function predialVaultObjectStoreForProject(projectId: string, orgId?: string, keystoreRoot?: string): void; //# sourceMappingURL=vault-prewarm.d.ts.map