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.

52 lines • 2.8 kB
/** * `push` namespace — the agent-side check on a project's push notifications, * and the Firebase key its phone app's devices are reached with. A deployed * function sends with `push.send(...)` from `@run402/functions`; the two * reads show who is signed up (browsers and phone-app devices), how much of * the organization's daily delivery cap is used, and what happened to each * message. `setFcmCredential` takes a service-account key, so on the MCP * sandbox it refuses with `SECRET_REQUIRES_CLI` (the CLI reads the key file * from disk instead). * * Exposed both unscoped (`r.push.status(projectId)`) and project-scoped * (`r.project(id).push.status()`), mirroring `r.events`. Accepted * credentials: the project's own service_key, a SIWX/control-plane principal * with `project.read`, or a grant key. A principal (grant key, wallet, or * sign-in session) is sent when the credential provider has one; otherwise * the project's locally cached service key. An unknown message id, or another * project's, is a 404 `ApiError` carrying the gateway's `code`. */ import type { Client } from "../kernel.js"; import type { PushFcmCredential, PushFcmRemoval, PushMessage, PushStatus } from "./push.types.js"; export declare class Push { private readonly client; constructor(client: Client); /** * Subscriptions by user, today's deliveries against the organization's * daily cap, and the latest 10 messages with their outcome counts * (`GET /projects/v1/:project_id/push`). */ status(projectId: string): Promise<PushStatus>; /** * One message: what was sent, to whom, and each delivery's state * (`GET /projects/v1/:project_id/push/messages/:message_id`). */ getMessage(projectId: string, messageId: string): Promise<PushMessage>; /** * Give Run402 the project's Firebase service-account key, so `push.send` * reaches the devices its phone app registers * (`POST /projects/v1/:project_id/push/providers/fcm`). `serviceAccount` is * the JSON object Firebase downloads (Project settings, Service accounts, * Generate new private key). Run402 checks it with Google before storing it * (422 when Google refuses it), keeps it encrypted, and answers only its * public fields. A key for another Firebase project removes the devices * registered under the old one (`devices_removed`). */ setFcmCredential(projectId: string, serviceAccount: Record<string, unknown>): Promise<PushFcmCredential>; /** * Remove the project's Firebase key and every device registered under it * (`DELETE /projects/v1/:project_id/push/providers/fcm`). A 404 when none is set. */ removeFcmCredential(projectId: string): Promise<PushFcmRemoval>; } //# sourceMappingURL=push.d.ts.map