run402 4.159.0 → 4.159.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/package.json +1 -1
- package/sdk/dist/namespaces/deploy.js +23 -0
- package/sdk/dist/namespaces/deploy.js.map +1 -1
- package/sdk/dist/node/deploy-manifest.d.ts +3 -0
- package/sdk/dist/node/deploy-manifest.d.ts.map +1 -1
- package/sdk/dist/node/deploy-manifest.js +10 -5
- package/sdk/dist/node/deploy-manifest.js.map +1 -1
- package/vault-surface.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run402",
|
|
3
|
-
"version": "4.159.
|
|
3
|
+
"version": "4.159.2",
|
|
4
4
|
"description": "CLI 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.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -4442,6 +4442,14 @@ function translateDeployError(err, phase, planId, operationId) {
|
|
|
4442
4442
|
if (isNoResponseError(err)) {
|
|
4443
4443
|
return noResponseDeployError(err, phase, planId, operationId);
|
|
4444
4444
|
}
|
|
4445
|
+
// The kernel throws every 401/403 as `Unauthorized`. One the deploy state
|
|
4446
|
+
// machine itself refused (a tier cap at plan, a CI route scope) names its
|
|
4447
|
+
// phase, so it stays a deploy error, with its fix, next actions and status;
|
|
4448
|
+
// an auth or lifecycle refusal names none and is re-thrown below.
|
|
4449
|
+
const refusal = deployRefusalOf(err);
|
|
4450
|
+
if (refusal) {
|
|
4451
|
+
return translateGatewayError(refusal, phase, planId, operationId, err.status);
|
|
4452
|
+
}
|
|
4445
4453
|
// Re-throw other Run402Error subclasses (PaymentRequired, Unauthorized, etc.)
|
|
4446
4454
|
// as-is — the consumer handles them at a different layer than
|
|
4447
4455
|
// deploy-state-machine errors.
|
|
@@ -4608,6 +4616,21 @@ function extractGatewayError(body) {
|
|
|
4608
4616
|
}
|
|
4609
4617
|
return null;
|
|
4610
4618
|
}
|
|
4619
|
+
/**
|
|
4620
|
+
* The gateway error of a 401/403 that a deploy phase refused, or null. The
|
|
4621
|
+
* check is structural (`kind`), so it holds across duplicate SDK copies.
|
|
4622
|
+
*/
|
|
4623
|
+
function deployRefusalOf(err) {
|
|
4624
|
+
if (!isRun402Error(err) || err.kind !== "unauthorized")
|
|
4625
|
+
return null;
|
|
4626
|
+
const body = err.body && typeof err.body === "object" && !Array.isArray(err.body)
|
|
4627
|
+
? err.body
|
|
4628
|
+
: null;
|
|
4629
|
+
if (!body)
|
|
4630
|
+
return null;
|
|
4631
|
+
const phase = stringField(body, "phase") ?? stringField(objectField(body, "details"), "phase");
|
|
4632
|
+
return phase ? extractGatewayError(body) : null;
|
|
4633
|
+
}
|
|
4611
4634
|
function stringField(obj, key) {
|
|
4612
4635
|
return obj && typeof obj === "object" && typeof obj[key] === "string"
|
|
4613
4636
|
? obj[key]
|