run402-mcp 4.130.0 → 4.130.2
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 +3 -3
- package/package.json +1 -1
- package/sdk/dist/namespaces/deploy.d.ts.map +1 -1
- package/sdk/dist/namespaces/deploy.js +38 -6
- package/sdk/dist/namespaces/deploy.js.map +1 -1
- package/sdk/dist/node/actions-node.d.ts.map +1 -1
- package/sdk/dist/node/actions-node.js +5 -0
- package/sdk/dist/node/actions-node.js.map +1 -1
package/dist/docs/llms-sdk.txt
CHANGED
|
@@ -108,7 +108,7 @@ Fields a static site uses:
|
|
|
108
108
|
- `subdomains`: one of `{ "set": [name] }` (the release's managed subdomain; one name), `{ "add": [...] }`, or `{ "remove": [...] }`. A name is 3-63 characters of lowercase letters, digits and hyphens and becomes `<name>.run402.com`; later deploys to the project keep it pointed at the new release.
|
|
109
109
|
- `site.embedding`, `site.sign_in_path`: the framing opt-in and the app's own sign-in page; see the `ReleaseSpec` shape.
|
|
110
110
|
|
|
111
|
-
Empty containers (`site
|
|
111
|
+
Empty containers (`site: {}`, `subdomains.set: []`) fail locally with `MANIFEST_EMPTY`; an explicit `site.replace: {}` is a deploy that takes the static files offline. A full-stack manifest adds `database` (migrations and the expose manifest), `functions`, `routes`, `secrets` and `assets`: the first-deploy guide carries a complete example with a table, and the whole `ReleaseSpec` shape is in the unified-apply section (MCP: `docs({ topic: "unified-apply" })`).
|
|
112
112
|
|
|
113
113
|
> Package: `@run402/sdk` (npm)
|
|
114
114
|
> Wayfinder: https://run402.com/llms.txt
|
|
@@ -1070,8 +1070,8 @@ The full type is exported as `ReleaseSpec` from `@run402/sdk` and `@run402/sdk/n
|
|
|
1070
1070
|
When a gate passes, the gateway injects `x-run402-user-id` (always when any gate ran) and `x-run402-user-role` (only when `requireRole` ran) into the request. In-function code reads them directly from `req.headers.get("x-run402-user-id")` / `req.headers.get("x-run402-user-role")`. The bare `getUserId(req)` / `getRole(req)` exports throw `R402_AUTH_UNKNOWN_EXPORT`. For the canonical cookie-session flow, use the `auth.*` namespace (see below). All `requireRole` blocks in a single release must share the same `(table, idColumn, roleColumn)` triple; mixed-table specs are rejected at plan time with `Run402DeployError.code === "INVALID_SPEC"`. The SDK does not validate gate shape — the gateway is authoritative. Missing table or column at activation throws `Run402DeployError.code === "DEPLOY_INVALID_ROLE_GATE"` (HTTP 422) before flipping the live release.
|
|
1071
1071
|
- Routes. `ReleaseRoutesSpec` is `undefined | null | { replace: RouteSpec[] }`. Omitted and `null` carry forward base routes; `{ replace: [] }` clears dynamic routes; `{ replace: [...] }` replaces the route table. `RouteSpec` is one entry: `{ pattern: string, methods?: RouteHttpMethod[], target: RouteTarget }`. Function targets are `{ type: "function", name: string }`; static route targets are `{ type: "static", file: string }` for exact method-aware static aliases, not ordinary clean URLs, rewrites, or redirects. Prefer `site.public_paths` for clean static URLs e.g. `/events -> events.html`; use static routes for cases like static `GET /login` plus function `POST /login`. Static targets require exact patterns only, methods `["GET"]` or `["GET","HEAD"]`, and a relative deployed asset path with no leading slash, wildcard, directory shorthand, query, or fragment. `methods` omitted means all supported methods for function routes; `methods: []` is invalid. Supported methods are exported as `ROUTE_HTTP_METHODS` and `RouteHttpMethod` (`GET`, `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS`). Function target names are materialized release function names.
|
|
1072
1072
|
- Strict validation is SDK-owned. `apply.plan/start/apply` reject unknown raw `ReleaseSpec` fields before normalization can drop them; only top-level `$schema` metadata is tolerated and stripped before the plan request. `project_id`, `subdomain`, `site.replcae`, `functions.replace.api.deps`, `functions.replace.api.config.schedule`, and similar typos are `Run402DeployError.code === "INVALID_SPEC"` before any hash/upload/plan request. Use `loadDeployManifest` / `normalizeDeployManifest` for CLI/MCP JSON that legitimately uses `project_id`, `{ path }`, base64 file entries, or migration `sql_path`.
|
|
1073
|
-
- No-op specs fail locally. A spec with only `project` / `base`, or empty containers e.g. `site
|
|
1074
|
-
- Tier preflight is local but gateway remains authoritative. After normalization and before manifest CAS upload or `/apply/v1/plans`, `apply.plan/start/apply` check literal function `config.timeoutSeconds`, `config.memoryMb`, schedule-trigger cron minimum interval, and scheduled-trigger count when computable. Failures are `Run402DeployError.code === "BAD_FIELD"` with `details.field`, `details.value`, `details.tier`, `tier_max` or `min_interval_minutes`, and `details.limit_source` (`tier_status` or `local_static_fallback`). Current caps: prototype 10s / 128 MB / 1 scheduled trigger / 15 min, hobby 30s / 256 MB / 3 / 5 min, team 60s / 512 MB / 10 / 1 min; an SSR-class function (`class: "ssr"`) is checked against its own memory cap, 1,769 MB on team (prototype 128 MB, hobby 256 MB). `tier.status()`
|
|
1073
|
+
- No-op specs fail locally. A spec with only `project` / `base`, or empty containers e.g. `site: {}`, `functions.patch.delete: []`, `secrets.require: []`, or `subdomains.set: []`, throws `Run402DeployError.code === "MANIFEST_EMPTY"` before any network call. Delete-only patches with non-empty `delete` arrays still count as deployable, and so does an explicit `site.replace: {}`: it takes the site's static files offline (the plan asks to confirm `ZERO_SITE_FILES_AFTER`, except for a release whose `ssr` function renders every path).
|
|
1074
|
+
- Tier preflight is local but gateway remains authoritative. After normalization and before manifest CAS upload or `/apply/v1/plans`, `apply.plan/start/apply` check literal function `config.timeoutSeconds`, `config.memoryMb`, schedule-trigger cron minimum interval, and scheduled-trigger count when computable. Failures are `Run402DeployError.code === "BAD_FIELD"` with `details.field`, `details.value`, `details.tier`, `tier_max` or `min_interval_minutes`, and `details.limit_source` (`tier_status` or `local_static_fallback`). Current caps: prototype 10s / 128 MB / 1 scheduled trigger / 15 min, hobby 30s / 256 MB / 3 / 5 min, team 60s / 512 MB / 10 / 1 min; an SSR-class function (`class: "ssr"`) is checked against its own memory cap, 1,769 MB on team (prototype 128 MB, hobby 256 MB). The caps are those of the tier of the organization that owns the project (read from `GET /projects/v1/:project_id`), the tier the gateway judges the deploy by; `tier.status()` describes the wallet's own organization, so its `function_limits` / `limits.functions` (including current scheduled usage) count only when its tier is the project's.
|
|
1075
1075
|
- Plan warnings are structured. `PlanResponse.warnings` and `DeployResult.warnings` are `WarningEntry[]`; `apply()` emits `plan.warnings` and aborts before upload/commit when a warning requires confirmation unless broad `allowWarnings` is set or every blocking warning code is listed in `allowWarningCodes`. `MISSING_REQUIRED_SECRET` means set the affected keys with `r.secrets.set`, then retry. For `WILDCARD_ROUTE_EXCLUDES_MUTATION_METHODS`, add the mutation methods the function supports or omit methods for an API prefix; when the GET/HEAD final-wildcard function route is intentionally read-only, list the code in `allowWarningCodes` after inspecting all affected entries. `DESTRUCTIVE_SITE_BULK_REMOVAL` lists the counted removals in `affected`, and the SDK adds `details.removed_paths_summary` (heuristic: `pages`, `page_paths`, `content_hashed_build_assets`, `other`, `only_content_hashed_build_assets`, plus `by_top_level_dir` unless the gateway sends `counted_removed_by_dir`) so removals of pages are distinguishable from removed hashed bundles. The gateway already leaves out fingerprinted bundles the build replaces in the same directory (`details.replaced_fingerprinted`).
|
|
1076
1076
|
- Deploy summaries are derived SDK helpers. `summarizeDeployResult(result: DeployResult): DeploySummary` is exported from `@run402/sdk` and `@run402/sdk/node`. It makes no gateway calls and summarizes only current reliable `DeployResult.diff` / `DeployResult.warnings` data: site path counts, CAS new/reused bytes, functions, migrations, routes, secrets, subdomains, and warning counts. Missing buckets are omitted, not zero-filled. It intentionally has no timings, client-side duration estimates, server phase estimates, or function old/new code hash fields.
|
|
1077
1077
|
- Safe release-race retries are automatic. For omitted/current-base specs, `apply()` re-plans and retries `BASE_RELEASE_CONFLICT` only when the gateway marks the error `safe_to_retry: true`. Pinned `base.release_id` and `{ release: "empty" }` stay caller-owned. Transient platform conditions the gateway marks `safe_to_retry: true` (`OPERATION_INTERRUPTED` when a gateway rollout replaced the task running the commit, `IMAGE_ENCODE_TIMEOUT` / `TOO_MANY_ENCODES_QUEUED` under encoder load, `EXPORT_CONSISTENCY_UNAVAILABLE` during an archive-export write pause) are retried the same way for any base, with a longer backoff (2s, 4s, … capped at 15s); nothing was activated, and content is content-addressed, so the re-apply uploads nothing twice. Content plans and operation polls lost to a 502/503/504 or a dropped connection are repeated in place. Static activation/spec failures inside `activation_pending` throw immediately with gateway metadata preserved instead of polling until timeout. Pass `maxRetries: 0` to opt out.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run402-mcp",
|
|
3
|
-
"version": "4.130.
|
|
3
|
+
"version": "4.130.2",
|
|
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.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/namespaces/deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAwB3C,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EAQtB,WAAW,EACX,oBAAoB,EAEpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EAIvB,sBAAsB,EACtB,oBAAoB,EAUpB,iBAAiB,EAGjB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,2BAA2B,EAC3B,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAGlB,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAgH3B,qBAAa,MAAM;IACL,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAnC,YAA6B,MAAM,EAAE,MAAM,EAAI;IAE/C;;;;OAIG;IACG,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,GAAE,Y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;IACG,gBAAgB,CACpB,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,sBAAsB,CAAC,CAmBjC;IAED;;;;OAIG;IACG,IAAI,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA6BlE;IAED;;;;OAIG;IACG,OAAO,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAUxE;CACF;AAszED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;iEAG6D;IAC7D,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;CACvC;AAs+ED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrD"}
|
|
@@ -1342,7 +1342,7 @@ async function preflightTierFunctionLimits(client, spec, ciCredentials) {
|
|
|
1342
1342
|
return;
|
|
1343
1343
|
if (!hasFunctionTierPreflightInputs(spec.functions))
|
|
1344
1344
|
return;
|
|
1345
|
-
const limits = await readTierFunctionLimits(client);
|
|
1345
|
+
const limits = await readTierFunctionLimits(client, spec.project_id);
|
|
1346
1346
|
if (!limits)
|
|
1347
1347
|
return;
|
|
1348
1348
|
const entries = collectFunctionPreflightEntries(spec.functions);
|
|
@@ -1424,7 +1424,14 @@ function collectFunctionPreflightEntries(functions) {
|
|
|
1424
1424
|
}
|
|
1425
1425
|
return entries;
|
|
1426
1426
|
}
|
|
1427
|
-
|
|
1427
|
+
/**
|
|
1428
|
+
* The function caps of the tier the deploy is judged by: the tier of the
|
|
1429
|
+
* organization that owns the project. `/tiers/v1/status` describes the
|
|
1430
|
+
* wallet's own organization, so its caps count only when the project's tier
|
|
1431
|
+
* is the same; otherwise the static table for the project's tier applies.
|
|
1432
|
+
* When the project cannot be read, the wallet's own tier is used.
|
|
1433
|
+
*/
|
|
1434
|
+
async function readTierFunctionLimits(client, projectId) {
|
|
1428
1435
|
let status;
|
|
1429
1436
|
try {
|
|
1430
1437
|
status = await client.request("/tiers/v1/status", {
|
|
@@ -1434,12 +1441,20 @@ async function readTierFunctionLimits(client) {
|
|
|
1434
1441
|
catch {
|
|
1435
1442
|
return null;
|
|
1436
1443
|
}
|
|
1444
|
+
const projectTier = await readProjectTier(client, projectId);
|
|
1445
|
+
let walletTier;
|
|
1446
|
+
if (projectTier && projectTier.toLowerCase() !== String(status.tier ?? "").toLowerCase()) {
|
|
1447
|
+
walletTier = typeof status.tier === "string" ? status.tier : "";
|
|
1448
|
+
status = { tier: projectTier };
|
|
1449
|
+
}
|
|
1437
1450
|
if (typeof status.tier !== "string" || status.tier.length === 0) {
|
|
1438
1451
|
return null;
|
|
1439
1452
|
}
|
|
1440
1453
|
const tierKey = status.tier.toLowerCase();
|
|
1441
1454
|
const fallback = STATIC_FUNCTION_LIMITS_BY_TIER[tierKey];
|
|
1442
1455
|
const limits = { tier: status.tier };
|
|
1456
|
+
if (walletTier !== undefined)
|
|
1457
|
+
limits.walletTier = walletTier;
|
|
1443
1458
|
limits.maxTimeoutSeconds = tierStatusLimitOrFallback(status, [
|
|
1444
1459
|
"max_function_timeout_seconds",
|
|
1445
1460
|
"max_timeout_seconds",
|
|
@@ -1475,6 +1490,18 @@ async function readTierFunctionLimits(client) {
|
|
|
1475
1490
|
]);
|
|
1476
1491
|
return hasAnyTierFunctionLimit(limits) ? limits : null;
|
|
1477
1492
|
}
|
|
1493
|
+
async function readProjectTier(client, projectId) {
|
|
1494
|
+
try {
|
|
1495
|
+
const project = await client.request(`/projects/v1/${encodeURIComponent(projectId)}`, {
|
|
1496
|
+
method: "GET",
|
|
1497
|
+
context: "checking the project's tier for deploy preflight",
|
|
1498
|
+
});
|
|
1499
|
+
return typeof project.tier === "string" && project.tier.length > 0 ? project.tier : null;
|
|
1500
|
+
}
|
|
1501
|
+
catch {
|
|
1502
|
+
return null;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1478
1505
|
function tierStatusLimitOrFallback(status, keys, fallback) {
|
|
1479
1506
|
return tierStatusLimit(status, keys) ?? (fallback === undefined
|
|
1480
1507
|
? undefined
|
|
@@ -1607,9 +1634,11 @@ function scheduledCountTierLimitError(count, limits, limit, countSource) {
|
|
|
1607
1634
|
});
|
|
1608
1635
|
}
|
|
1609
1636
|
function tierLimitError(message, field, value, limits, limit, extraDetails) {
|
|
1610
|
-
const hint =
|
|
1611
|
-
?
|
|
1612
|
-
:
|
|
1637
|
+
const hint = limits.walletTier !== undefined
|
|
1638
|
+
? `The project's organization is on the ${limits.tier} tier (your wallet's own organization ${limits.walletTier ? `is on ${limits.walletTier}` : "has no tier"}), and a deploy is held to the limits of the organization that owns the project. Lower the function setting or upgrade that organization's tier.`
|
|
1639
|
+
: limit.source === "local_static_fallback"
|
|
1640
|
+
? "Tier limits came from the SDK's static fallback because /tiers/v1/status did not expose function caps. Run `run402 tier status` to refresh, lower the function setting, upgrade the tier, or retry and let gateway validation decide if this seems stale."
|
|
1641
|
+
: "Lower the function setting or upgrade the tier before deploying.";
|
|
1613
1642
|
const details = {
|
|
1614
1643
|
field,
|
|
1615
1644
|
value,
|
|
@@ -3212,7 +3241,10 @@ function hasSiteContent(site) {
|
|
|
3212
3241
|
}
|
|
3213
3242
|
if (!isRecord(site))
|
|
3214
3243
|
return false;
|
|
3215
|
-
|
|
3244
|
+
// An explicit `site.replace` is content even with no files: the release
|
|
3245
|
+
// then serves none of the previous release's static files (the gateway
|
|
3246
|
+
// asks to confirm ZERO_SITE_FILES_AFTER unless an ssr function serves them).
|
|
3247
|
+
if (isRecord(site.replace))
|
|
3216
3248
|
return true;
|
|
3217
3249
|
if (isRecord(site.patch)) {
|
|
3218
3250
|
return hasRecordEntries(site.patch.put) || hasArrayEntries(site.patch.delete);
|