run402-mcp 4.138.2 → 4.139.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/llms-sdk.txt +17 -1
- package/package.json +1 -1
- package/sdk/dist/namespaces/deploy.js +2 -2
- package/sdk/dist/namespaces/deploy.js.map +1 -1
- package/sdk/dist/namespaces/deploy.types.d.ts +6 -2
- package/sdk/dist/namespaces/deploy.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/deploy.types.js.map +1 -1
- package/sdk/dist/namespaces/domains.d.ts +9 -0
- package/sdk/dist/namespaces/domains.d.ts.map +1 -1
- package/sdk/dist/namespaces/domains.js.map +1 -1
- package/sdk/dist/namespaces/email.d.ts +33 -0
- package/sdk/dist/namespaces/email.d.ts.map +1 -1
- package/sdk/dist/namespaces/email.js +3 -1
- package/sdk/dist/namespaces/email.js.map +1 -1
package/dist/docs/llms-sdk.txt
CHANGED
|
@@ -1063,7 +1063,7 @@ The full type is exported as `ReleaseSpec` from `@run402/sdk` and `@run402/sdk/n
|
|
|
1063
1063
|
```
|
|
1064
1064
|
|
|
1065
1065
|
- Replace vs patch semantics per resource. `site.replace` = "this is the whole site" (files absent are removed). `site.patch.put` / `patch.delete` = surgical updates. `site.public_paths` is the browser reachability table and is separate from release asset paths: `{ mode: "explicit", replace: { "/events": { asset: "events.html", cache_class: "html" } } }` serves public `/events` from release asset `events.html`; in explicit mode `/events.html` is not public unless separately declared. `{ mode: "implicit" }` restores filename-derived public reachability and can widen access. Public-path-only site specs are deployable. Known static `cache_class` inputs are `html`, `immutable_versioned`, and `revalidating_asset`; preserve unknown strings returned by observability APIs. `functions` has the same replace/patch split. Secrets are declaration-only: use `r.project(id).secrets.set(key, { value })` for values, then `secrets.require[]` to assert keys exist and `secrets.delete[]` to remove keys at activation. `subdomains` supports exactly one mode per spec: `set` replaces the release's managed subdomain list, `add` appends without removing existing entries, and `remove` deletes named entries. Today `subdomains.set` accepts at most one subdomain per project; multi-subdomain `set` is rejected locally with `SUBDOMAIN_MULTI_NOT_SUPPORTED`. Top-level absence = leave untouched.
|
|
1066
|
-
- FunctionSpec. `functions.replace` is the complete desired function map; `functions.patch.set` updates only listed functions, and `functions.patch.delete` removes listed names. Each function accepts `runtime?: "node22"`, exactly one code source (`source` for a single bundled module, or `files` plus `entrypoint` for multi-file functions), optional `config.timeoutSeconds`, optional `config.memoryMb`, optional required-id `triggers[]`, and the auth-gate fields `requireAuth` and `requireRole`. Schedule triggers use `{ id, type: "schedule", cron, run }`; `run` contains at least `event_type` and may include `payload`, `retry`, and `expires_after_seconds`. Each scheduled tick creates a durable function run. Email triggers use `{ id, type: "email", mailbox, events, run }`, where `mailbox` is a mailbox slug/id and `events` is any of `reply_received`, `delivery`, `bounced`, `complained`, `mailbox_suspended`; each matching email event creates a durable function run with the canonical event payload under `payload.event`. A `mailbox_suspended` trigger fires when the mailbox is abuse-suspended (payload event carries `suspended_reason`, `suspended_at`, `evidence`, `recovery_actions`) and executes independently of the suspended mailbox's send capability — the app observes its own outage without polling or a public webhook URL. In typed deploy configs, prefer `scheduleTrigger(...)` and `emailTrigger(...)`. `FunctionSpec` also accepts `deps?: string[]` (npm specs) under capability `apply-v1-function-deps`; the gateway installs and bundles them. `r.functions.deploy(..., { deps })` builds a one-function `functions.patch.set` and rides this same unified-apply path.
|
|
1066
|
+
- FunctionSpec. `functions.replace` is the complete desired function map; `functions.patch.set` updates only listed functions, and `functions.patch.delete` removes listed names. Each function accepts `runtime?: "node22"`, exactly one code source (`source` for a single bundled module, or `files` plus `entrypoint` for multi-file functions), optional `config.timeoutSeconds`, optional `config.memoryMb`, optional required-id `triggers[]`, and the auth-gate fields `requireAuth` and `requireRole`. Schedule triggers use `{ id, type: "schedule", cron, run }`; `run` contains at least `event_type` and may include `payload`, `retry`, and `expires_after_seconds`. Each scheduled tick creates a durable function run. Email triggers use `{ id, type: "email", mailbox, events, run }`, where `mailbox` is a mailbox slug/id and `events` is any of `reply_received`, `delivery`, `bounced`, `complained`, `mailbox_suspended`, `sender_suspended`; each matching email event creates a durable function run with the canonical event payload under `payload.event`. A `mailbox_suspended` trigger fires when the mailbox is abuse-suspended (payload event carries `suspended_reason`, `suspended_at`, `evidence`, `recovery_actions`) and executes independently of the suspended mailbox's send capability — the app observes its own outage without polling or a public webhook URL. A `sender_suspended` trigger fires when one sending address of a catch-all mailbox is suspended (payload event carries `address`, `suspended_reason`, `suspended_at`, `evidence`, `recovery_actions`). A `reply_received` payload carries `delivered_to`. In typed deploy configs, prefer `scheduleTrigger(...)` and `emailTrigger(...)`. `FunctionSpec` also accepts `deps?: string[]` (npm specs) under capability `apply-v1-function-deps`; the gateway installs and bundles them. `r.functions.deploy(..., { deps })` builds a one-function `functions.patch.set` and rides this same unified-apply path.
|
|
1067
1067
|
- Function-level auth gates. Each `FunctionSpec` carries two optional declarative fields enforced by the gateway before invocation:
|
|
1068
1068
|
- `requireAuth?: boolean` — when `true`, gateway rejects callers without a valid project user JWT with `Run402DeployError`-shaped envelope or `401` at request time. No DB lookup. Independent from `requireRole`.
|
|
1069
1069
|
- `requireRole?: RequireRoleSpec | null` — gateway resolves the caller's role from the project-schema table and rejects callers whose role is not in `allowed` with `403`. Implies authentication (no JWT → 401). Pass `null` in patch mode to remove an existing gate. `RequireRoleSpec` is `{ table: string; idColumn: string; roleColumn: string; allowed: string[]; cacheTtl?: number }`. All identifiers are unqualified; `cacheTtl` is seconds (default 60, max 600, 0 disables caching for instant-revocation paths).
|
|
@@ -2121,6 +2121,8 @@ await r.domains.connect(projectId, { domain: "app.example.com", desired: { web:
|
|
|
2121
2121
|
|
|
2122
2122
|
`authority: "hosted_dns_zone"` is the only workable path for a ROOT domain at most registrars (a root CNAME is illegal without flattening/ALIAS support) and collapses setup to one registrar step: Run402 applies every in-zone record, verifies ownership, and issues TLS once delegation is observed. Existing MX/TXT are imported into the hosted zone before the nameserver change is recommended, so mail keeps working. `hosted_zone` reports `{ dns_hosting, status, ns_assigned, imported_records }`. The zone belongs to the project's organization: another project of it can `ensure` a name under the domain (`barry.example.com`), and Run402 serves it from the same zone, writing only that name's records on `apply` and `repair`. Disconnecting a name removes its binding and records; the zone is torn down only with the organization's last name under it (`hosted_zone_released: true`; DNS stops resolving until nameservers are re-pointed), and otherwise stays (`hosted_zone_retained: true`). A name in another organization's hosted zone is `409 HOSTED_DNS_ZONE_CONFLICT`.
|
|
2123
2123
|
|
|
2124
|
+
A catch-all mailbox is a domain setting: `desired.email.mailbox_addresses: { mode: "primary", all_mailboxes: true, catch_all: "letters", addresses: [] }` on a `full_receive_takeover` or `subdomain_mode` domain makes the active mailbox `letters` receive every local part no binding or mailbox owns, and send as any of them with `r.email.send(projectId, { ..., from_address: "tal@example.com" })`. `catch_all` is accepted only beside `all_mailboxes: true`; `null` clears it.
|
|
2125
|
+
|
|
2124
2126
|
Every response carries `next_actions[]` (ordered; `[0]` is the recommended step).
|
|
2125
2127
|
|
|
2126
2128
|
### `r.events`
|
|
@@ -2649,10 +2651,19 @@ send(projectId, opts: SendEmailOptions): Promise<SendEmailResult>
|
|
|
2649
2651
|
// no header names them; each counts as one send. The result and EmailSummary /
|
|
2650
2652
|
// EmailDetail carry bcc: { address, status, bounce_type }[]; a blind copy's
|
|
2651
2653
|
// bounce never changes the message status. No cc (gateway 400).
|
|
2654
|
+
// opts.from_address?: string — send as another address on a custom domain.
|
|
2655
|
+
// Only the domain's effective catch-all mailbox may send as a local part no
|
|
2656
|
+
// mailbox owns; the mailbox's own address works on any mailbox. Refusals:
|
|
2657
|
+
// 400 VALIDATION_FAILED, 403 FROM_ADDRESS_NOT_ALLOWED,
|
|
2658
|
+
// FROM_ADDRESS_NOT_EFFECTIVE (addressing demoted), SENDER_SUSPENDED. The
|
|
2659
|
+
// result's from_address is the address used.
|
|
2652
2660
|
list(projectId, opts?: { limit?, after?, direction? }): Promise<EmailSummary[]>
|
|
2653
2661
|
// direction?: "inbound" | "outbound" — omit for BOTH. direction:"inbound" lists
|
|
2654
2662
|
// received replies (each EmailSummary carries `direction`) and is the
|
|
2655
2663
|
// reconciliation backstop if a reply_received webhook is ever lost.
|
|
2664
|
+
// Inbound EmailSummary / EmailDetail carry delivered_to: string[] — every
|
|
2665
|
+
// address the message was delivered to (a catch-all may list several); the
|
|
2666
|
+
// reply_received webhook and email-trigger payloads carry it too.
|
|
2656
2667
|
get(projectId, messageId): Promise<EmailDetail>
|
|
2657
2668
|
getRaw(projectId, messageId): Promise<RawEmailResult> // bytes + content_type
|
|
2658
2669
|
|
|
@@ -2672,6 +2683,11 @@ webhooks.listDeliveries(projectId, opts?: { status?, limit?, after? }): Promise<
|
|
|
2672
2683
|
// webhooks are unsigned (verifyWebhook is for owner notifications only).
|
|
2673
2684
|
webhooks.redriveDelivery(projectId, deliveryId): Promise<RedriveDeliveryResult>
|
|
2674
2685
|
// Re-queue a dead-lettered delivery for another attempt (after fixing the consumer).
|
|
2686
|
+
// Events: delivery, bounced, complained, reply_received, mailbox_suspended,
|
|
2687
|
+
// sender_suspended (one sending address of a catch-all suspended; the
|
|
2688
|
+
// mailbox keeps sending as its other addresses).
|
|
2689
|
+
// Mailbox reads carry catch_all_for: string[] and, when non-empty,
|
|
2690
|
+
// suspended_senders: { address, reason, suspended_at, recovery_actions }[].
|
|
2675
2691
|
|
|
2676
2692
|
// CLI-style aliases:
|
|
2677
2693
|
create(projectId, slug): Promise<CreateMailboxResult>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run402-mcp",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.139.0",
|
|
4
4
|
"packageManager": "npm@11.19.0",
|
|
5
5
|
"mcpName": "com.run402/mcp",
|
|
6
6
|
"description": "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.",
|
|
@@ -68,7 +68,7 @@ const APPLY_TRANSIENT_RETRY_MAX_DELAY_MS = 15_000;
|
|
|
68
68
|
/** A read or an idempotent request lost to a 502/503/504 or a dropped connection. */
|
|
69
69
|
const TRANSIENT_REQUEST_MAX_ATTEMPTS = 3;
|
|
70
70
|
const TRANSIENT_REQUEST_RETRY_BASE_DELAY_MS = 500;
|
|
71
|
-
const EMAIL_TRIGGER_EVENTS = new Set(["reply_received", "delivery", "bounced", "complained", "mailbox_suspended"]);
|
|
71
|
+
const EMAIL_TRIGGER_EVENTS = new Set(["reply_received", "delivery", "bounced", "complained", "mailbox_suspended", "sender_suspended"]);
|
|
72
72
|
const STATIC_ACTIVATION_FAILURE_CODES = new Set([
|
|
73
73
|
"BAD_FIELD",
|
|
74
74
|
"INVALID_SPEC",
|
|
@@ -2693,7 +2693,7 @@ function validateFunctionTriggers(value, resource) {
|
|
|
2693
2693
|
}
|
|
2694
2694
|
for (const [eventIndex, event] of obj.events.entries()) {
|
|
2695
2695
|
if (typeof event !== "string" || !EMAIL_TRIGGER_EVENTS.has(event)) {
|
|
2696
|
-
throw invalidSpec(`ReleaseSpec.${path}.events.${eventIndex} must be one of reply_received, delivery, bounced, complained`, `${path}.events.${eventIndex}`);
|
|
2696
|
+
throw invalidSpec(`ReleaseSpec.${path}.events.${eventIndex} must be one of reply_received, delivery, bounced, complained, mailbox_suspended, sender_suspended`, `${path}.events.${eventIndex}`);
|
|
2697
2697
|
}
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|