@run402/sdk 1.53.0 → 1.53.1
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/README.md +77 -18
- package/dist/errors.d.ts +73 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +128 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/namespaces/admin.d.ts +4 -1
- package/dist/namespaces/admin.d.ts.map +1 -1
- package/dist/namespaces/admin.js +1 -1
- package/dist/namespaces/admin.js.map +1 -1
- package/dist/namespaces/apps.d.ts +27 -30
- package/dist/namespaces/apps.d.ts.map +1 -1
- package/dist/namespaces/apps.js.map +1 -1
- package/dist/namespaces/billing.d.ts +15 -6
- package/dist/namespaces/billing.d.ts.map +1 -1
- package/dist/namespaces/billing.js.map +1 -1
- package/dist/namespaces/contracts.d.ts +67 -15
- package/dist/namespaces/contracts.d.ts.map +1 -1
- package/dist/namespaces/contracts.js +32 -8
- package/dist/namespaces/contracts.js.map +1 -1
- package/dist/namespaces/domains.d.ts +5 -1
- package/dist/namespaces/domains.d.ts.map +1 -1
- package/dist/namespaces/domains.js +1 -1
- package/dist/namespaces/domains.js.map +1 -1
- package/dist/namespaces/email.d.ts +21 -13
- package/dist/namespaces/email.d.ts.map +1 -1
- package/dist/namespaces/email.js +5 -4
- package/dist/namespaces/email.js.map +1 -1
- package/dist/namespaces/functions.d.ts +2 -2
- package/dist/namespaces/functions.d.ts.map +1 -1
- package/dist/namespaces/functions.js +1 -1
- package/dist/namespaces/functions.js.map +1 -1
- package/dist/namespaces/functions.types.d.ts +4 -0
- package/dist/namespaces/functions.types.d.ts.map +1 -1
- package/dist/namespaces/projects.d.ts.map +1 -1
- package/dist/namespaces/projects.js +3 -5
- package/dist/namespaces/projects.js.map +1 -1
- package/dist/namespaces/projects.types.d.ts +9 -1
- package/dist/namespaces/projects.types.d.ts.map +1 -1
- package/dist/namespaces/secrets.d.ts +5 -1
- package/dist/namespaces/secrets.d.ts.map +1 -1
- package/dist/namespaces/secrets.js +1 -1
- package/dist/namespaces/secrets.js.map +1 -1
- package/dist/namespaces/sender-domain.d.ts +4 -1
- package/dist/namespaces/sender-domain.d.ts.map +1 -1
- package/dist/namespaces/sender-domain.js +1 -1
- package/dist/namespaces/sender-domain.js.map +1 -1
- package/dist/namespaces/service.d.ts +11 -31
- package/dist/namespaces/service.d.ts.map +1 -1
- package/dist/namespaces/service.js.map +1 -1
- package/dist/namespaces/subdomains.d.ts +10 -1
- package/dist/namespaces/subdomains.d.ts.map +1 -1
- package/dist/namespaces/subdomains.js +1 -1
- package/dist/namespaces/subdomains.js.map +1 -1
- package/dist/namespaces/tier.d.ts +9 -1
- package/dist/namespaces/tier.d.ts.map +1 -1
- package/dist/namespaces/tier.js.map +1 -1
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/retry.d.ts +50 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +61 -0
- package/dist/retry.js.map +1 -0
- package/dist/scoped.d.ts +13 -13
- package/dist/scoped.d.ts.map +1 -1
- package/dist/scoped.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -156,25 +156,69 @@ const resumed = await r.deploy.resume(operationId);
|
|
|
156
156
|
|
|
157
157
|
### Errors
|
|
158
158
|
|
|
159
|
-
All failures throw subclasses of `Run402Error
|
|
159
|
+
All failures throw subclasses of `Run402Error`. Every subclass carries a stable
|
|
160
|
+
`kind` discriminator string and an `isRun402Error` brand:
|
|
161
|
+
|
|
162
|
+
| Class | `kind` | When | Notable fields |
|
|
163
|
+
|---|---|---|---|
|
|
164
|
+
| `PaymentRequired` | `"payment_required"` | HTTP 402 | x402 payment requirements in `body` |
|
|
165
|
+
| `ProjectNotFound` | `"project_not_found"` | Project ID not in the credential provider | `projectId` |
|
|
166
|
+
| `Unauthorized` | `"unauthorized"` | HTTP 401 / 403 | — |
|
|
167
|
+
| `ApiError` | `"api_error"` | Other non-2xx responses | `status`, `body` |
|
|
168
|
+
| `NetworkError` | `"network_error"` | Fetch rejected with no HTTP response | `cause` |
|
|
169
|
+
| `LocalError` | `"local_error"` | Local-host issues (filesystem, signing) | `cause` |
|
|
170
|
+
| `Run402DeployError` | `"deploy_error"` | Structured envelope from the deploy state machine (v1.34+) | `code`, `phase`, `operationId`, `safeToRetry`, `mutationState`, `nextActions` |
|
|
171
|
+
|
|
172
|
+
**Branch with type guards, not `instanceof`.** `instanceof X` is an identity
|
|
173
|
+
check on the class object — it fails silently when the consumer's runtime
|
|
174
|
+
holds a different copy of the SDK (duplicate npm installs, bundler chunk
|
|
175
|
+
splits, ESM/CJS interop, V8-isolate realms). The exported guards
|
|
176
|
+
(`isPaymentRequired`, `isDeployError`, …) check `isRun402Error` + `kind`,
|
|
177
|
+
which is identity-free and survives all of those scenarios. `instanceof`
|
|
178
|
+
continues to work for back-compat in the simple single-copy case.
|
|
160
179
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
| `LocalError` | Local-host issues (filesystem, signing) | — |
|
|
169
|
-
| `Run402DeployError` | Structured envelope from the deploy state machine (v1.34+) | `code`, `phase`, `operationId`, `safeToRetry`, `mutationState`, `nextActions` |
|
|
180
|
+
```ts
|
|
181
|
+
import {
|
|
182
|
+
run402,
|
|
183
|
+
isPaymentRequired,
|
|
184
|
+
isDeployError,
|
|
185
|
+
type ReleaseSpec,
|
|
186
|
+
} from "@run402/sdk/node";
|
|
170
187
|
|
|
171
|
-
|
|
188
|
+
declare const spec: ReleaseSpec;
|
|
189
|
+
const r = run402();
|
|
190
|
+
|
|
191
|
+
try {
|
|
192
|
+
await r.deploy.apply(spec);
|
|
193
|
+
} catch (e) {
|
|
194
|
+
if (isPaymentRequired(e)) {
|
|
195
|
+
// e is narrowed to PaymentRequired
|
|
196
|
+
// present payment requirements to the user — read e.body, e.context, etc.
|
|
197
|
+
} else if (isDeployError(e) && e.safeToRetry) {
|
|
198
|
+
// e is narrowed to Run402DeployError; it's safe to retry with the same idempotency key
|
|
199
|
+
} else throw e;
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
`Run402Error.toJSON()` returns a canonical envelope, so `JSON.stringify(e)`
|
|
204
|
+
produces a populated structured object instead of the empty `"{}"` plain
|
|
205
|
+
`Error` produces. Use this for telemetry, MCP tool results, CLI JSON output,
|
|
206
|
+
and any inter-process boundary where the error needs to survive serialization.
|
|
207
|
+
|
|
208
|
+
#### Retry idempotent operations with `withRetry`
|
|
209
|
+
|
|
210
|
+
`withRetry(fn, opts?)` wraps any async call with exponential backoff. It uses
|
|
211
|
+
`isRetryableRun402Error` (the canonical "should I retry this?" policy: 408 /
|
|
212
|
+
425 / 429 / 5xx / `NetworkError` / gateway-flagged `retryable` or
|
|
213
|
+
`safeToRetry`) by default. Pair it with the SDK method's own
|
|
214
|
+
`idempotencyKey` so retried mutations dedup server-side:
|
|
172
215
|
|
|
173
216
|
```ts
|
|
174
217
|
import {
|
|
175
218
|
run402,
|
|
176
|
-
|
|
177
|
-
|
|
219
|
+
withRetry,
|
|
220
|
+
isPaymentRequired,
|
|
221
|
+
isDeployError,
|
|
178
222
|
type ReleaseSpec,
|
|
179
223
|
} from "@run402/sdk/node";
|
|
180
224
|
|
|
@@ -182,16 +226,31 @@ declare const spec: ReleaseSpec;
|
|
|
182
226
|
const r = run402();
|
|
183
227
|
|
|
184
228
|
try {
|
|
185
|
-
await
|
|
229
|
+
const release = await withRetry(
|
|
230
|
+
() => r.deploy.apply(spec, { idempotencyKey: "deploy-2026-05-01" }),
|
|
231
|
+
{
|
|
232
|
+
attempts: 3,
|
|
233
|
+
onRetry: (e, attempt, delayMs) =>
|
|
234
|
+
process.stderr.write(`retry ${attempt} in ${delayMs}ms\n`),
|
|
235
|
+
},
|
|
236
|
+
);
|
|
237
|
+
console.log(release.urls);
|
|
186
238
|
} catch (e) {
|
|
187
|
-
if (e
|
|
188
|
-
// present payment
|
|
189
|
-
} else if (e
|
|
190
|
-
//
|
|
239
|
+
if (isPaymentRequired(e)) {
|
|
240
|
+
// ... present payment
|
|
241
|
+
} else if (isDeployError(e)) {
|
|
242
|
+
// log structured envelope for triage
|
|
243
|
+
process.stderr.write(JSON.stringify(e) + "\n");
|
|
191
244
|
} else throw e;
|
|
192
245
|
}
|
|
193
246
|
```
|
|
194
247
|
|
|
248
|
+
Defaults: 3 attempts (1 initial + 2 retries), 250 ms base delay, 5 s cap. Pass
|
|
249
|
+
a custom `retryIf` to override the default policy (e.g., retry on
|
|
250
|
+
`PaymentRequired` if your sandbox auto-funds). After exhausting attempts
|
|
251
|
+
`withRetry` throws the LAST error — your catch handler sees the original
|
|
252
|
+
structured envelope, not a wrapper.
|
|
253
|
+
|
|
195
254
|
The SDK never calls `process.exit`. Each interface (MCP tools, CLI, your code) wraps with its own error behavior.
|
|
196
255
|
|
|
197
256
|
## Stability
|
package/dist/errors.d.ts
CHANGED
|
@@ -2,8 +2,34 @@
|
|
|
2
2
|
* Error hierarchy for the Run402 SDK. Every failure throws a subclass of
|
|
3
3
|
* {@link Run402Error}. Consumers (MCP handlers, CLI commands, user functions)
|
|
4
4
|
* translate these into their native error shapes at the edge.
|
|
5
|
+
*
|
|
6
|
+
* Branch on {@link Run402Error.kind} (or the exported `is*` type guards) rather
|
|
7
|
+
* than `instanceof`. Discriminator-based checks survive duplicate SDK installs,
|
|
8
|
+
* bundler chunk splits, ESM/CJS interop, and V8-isolate realm boundaries —
|
|
9
|
+
* any setting where a class object's identity might differ from the consumer's
|
|
10
|
+
* own class object reference. `instanceof X` continues to work for callers
|
|
11
|
+
* holding a single SDK copy (back-compat); the guards are the recommended path.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Stable string discriminator on every {@link Run402Error} subclass. Use this
|
|
15
|
+
* (or the exported `is*` guards) to branch on errors safely across SDK copies
|
|
16
|
+
* and realms — value comparison, no class-identity dependency.
|
|
5
17
|
*/
|
|
18
|
+
export type Run402ErrorKind = "payment_required" | "project_not_found" | "unauthorized" | "api_error" | "network_error" | "local_error" | "deploy_error";
|
|
6
19
|
export declare abstract class Run402Error extends Error {
|
|
20
|
+
/**
|
|
21
|
+
* Structural brand. Always `true` on any {@link Run402Error} subclass
|
|
22
|
+
* instance, regardless of which SDK copy created it. The exported
|
|
23
|
+
* {@link isRun402Error} guard checks this field instead of `instanceof`,
|
|
24
|
+
* so cross-realm and cross-bundle errors still match.
|
|
25
|
+
*/
|
|
26
|
+
readonly isRun402Error: true;
|
|
27
|
+
/**
|
|
28
|
+
* Stable string discriminator. Branch on `e.kind === "..."` (or the
|
|
29
|
+
* exported subclass guards) rather than `e instanceof X`. Equality on
|
|
30
|
+
* `kind` survives duplicate SDK copies and cross-realm errors.
|
|
31
|
+
*/
|
|
32
|
+
abstract readonly kind: Run402ErrorKind;
|
|
7
33
|
/** HTTP status, or null for local/network failures that produced no response. */
|
|
8
34
|
readonly status: number | null;
|
|
9
35
|
/** Parsed response body, or null when no body was received. */
|
|
@@ -27,28 +53,42 @@ export declare abstract class Run402Error extends Error {
|
|
|
27
53
|
/** Advisory next actions from the gateway. Rendering them must not execute them. */
|
|
28
54
|
readonly nextActions?: unknown[];
|
|
29
55
|
constructor(message: string, status: number | null, body: unknown, context: string);
|
|
56
|
+
/**
|
|
57
|
+
* Canonical structured envelope for `JSON.stringify`. Without this, an
|
|
58
|
+
* `Error` instance serializes as `"{}"` (its built-in fields are
|
|
59
|
+
* non-enumerable), losing every structured detail an agent needs for
|
|
60
|
+
* triage. Subclasses with extra fields (e.g. {@link Run402DeployError})
|
|
61
|
+
* override and spread `super.toJSON()`.
|
|
62
|
+
*/
|
|
63
|
+
toJSON(): Record<string, unknown>;
|
|
30
64
|
}
|
|
31
65
|
/** HTTP 402 — the gateway requires payment (lease expired, insufficient balance, or x402 quote). */
|
|
32
66
|
export declare class PaymentRequired extends Run402Error {
|
|
67
|
+
readonly kind: "payment_required";
|
|
33
68
|
}
|
|
34
69
|
/** Project ID is not present in the credential provider (local miss) or the gateway returned 404. */
|
|
35
70
|
export declare class ProjectNotFound extends Run402Error {
|
|
71
|
+
readonly kind: "project_not_found";
|
|
36
72
|
readonly projectId: string;
|
|
37
73
|
constructor(projectId: string, context: string, status?: number | null, body?: unknown);
|
|
38
74
|
}
|
|
39
75
|
/** HTTP 401 or 403 — authentication missing, invalid, or insufficient for the operation. */
|
|
40
76
|
export declare class Unauthorized extends Run402Error {
|
|
77
|
+
readonly kind: "unauthorized";
|
|
41
78
|
}
|
|
42
79
|
/** Any other non-2xx HTTP response from the gateway. */
|
|
43
80
|
export declare class ApiError extends Run402Error {
|
|
81
|
+
readonly kind: "api_error";
|
|
44
82
|
}
|
|
45
83
|
/** The underlying `fetch` threw before producing a response (DNS, connection reset, offline). */
|
|
46
84
|
export declare class NetworkError extends Run402Error {
|
|
85
|
+
readonly kind: "network_error";
|
|
47
86
|
readonly cause: unknown;
|
|
48
87
|
constructor(message: string, cause: unknown, context: string);
|
|
49
88
|
}
|
|
50
89
|
/** Local/filesystem error — input validation, missing path, unreadable dir. No HTTP involved. */
|
|
51
90
|
export declare class LocalError extends Run402Error {
|
|
91
|
+
readonly kind: "local_error";
|
|
52
92
|
readonly cause?: unknown;
|
|
53
93
|
constructor(message: string, context: string, cause?: unknown);
|
|
54
94
|
}
|
|
@@ -69,6 +109,7 @@ export interface Run402DeployErrorFix {
|
|
|
69
109
|
[key: string]: unknown;
|
|
70
110
|
}
|
|
71
111
|
export declare class Run402DeployError extends Run402Error {
|
|
112
|
+
readonly kind: "deploy_error";
|
|
72
113
|
readonly code: Run402DeployErrorCode;
|
|
73
114
|
readonly phase: string | null;
|
|
74
115
|
readonly resource: string | null;
|
|
@@ -92,5 +133,37 @@ export declare class Run402DeployError extends Run402Error {
|
|
|
92
133
|
body?: unknown;
|
|
93
134
|
context: string;
|
|
94
135
|
});
|
|
136
|
+
toJSON(): Record<string, unknown>;
|
|
95
137
|
}
|
|
138
|
+
/** True if `e` is any {@link Run402Error} subclass instance, regardless of which SDK copy created it. */
|
|
139
|
+
export declare function isRun402Error(e: unknown): e is Run402Error;
|
|
140
|
+
/** True if `e` is a {@link PaymentRequired}. Survives duplicate SDK copies and realms. */
|
|
141
|
+
export declare function isPaymentRequired(e: unknown): e is PaymentRequired;
|
|
142
|
+
/** True if `e` is a {@link ProjectNotFound}. */
|
|
143
|
+
export declare function isProjectNotFound(e: unknown): e is ProjectNotFound;
|
|
144
|
+
/** True if `e` is an {@link Unauthorized}. */
|
|
145
|
+
export declare function isUnauthorized(e: unknown): e is Unauthorized;
|
|
146
|
+
/** True if `e` is an {@link ApiError}. */
|
|
147
|
+
export declare function isApiError(e: unknown): e is ApiError;
|
|
148
|
+
/** True if `e` is a {@link NetworkError}. */
|
|
149
|
+
export declare function isNetworkError(e: unknown): e is NetworkError;
|
|
150
|
+
/** True if `e` is a {@link LocalError}. */
|
|
151
|
+
export declare function isLocalError(e: unknown): e is LocalError;
|
|
152
|
+
/** True if `e` is a {@link Run402DeployError}. */
|
|
153
|
+
export declare function isDeployError(e: unknown): e is Run402DeployError;
|
|
154
|
+
/**
|
|
155
|
+
* Canonical "should I retry this?" policy. Returns true when `e` is a
|
|
156
|
+
* {@link Run402Error} AND any of:
|
|
157
|
+
* - `e.retryable === true` (gateway flagged it)
|
|
158
|
+
* - `e.safeToRetry === true` (gateway flagged it)
|
|
159
|
+
* - `e.kind === "network_error"` (fetch never produced a response)
|
|
160
|
+
* - `e.status` is 408 (Request Timeout), 425 (Too Early), or 429 (Too Many
|
|
161
|
+
* Requests)
|
|
162
|
+
* - `e.status` is a 5xx server error
|
|
163
|
+
*
|
|
164
|
+
* Returns false for non-Run402 errors so it can be safely called with
|
|
165
|
+
* `unknown` from a catch block. Used as the default `retryIf` in
|
|
166
|
+
* {@link withRetry}.
|
|
167
|
+
*/
|
|
168
|
+
export declare function isRetryableRun402Error(e: unknown): boolean;
|
|
96
169
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB,kBAAkB,GAClB,mBAAmB,GACnB,cAAc,GACd,WAAW,GACX,eAAe,GACf,aAAa,GACb,cAAc,CAAC;AAEnB,8BAAsB,WAAY,SAAQ,KAAK;IAC7C;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,CAAU;IACvC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IACxC,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,2FAA2F;IAC3F,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mFAAmF;IACnF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,kDAAkD;IAClD,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,yFAAyF;IACzF,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,sEAAsE;IACtE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,mFAAmF;I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AAE,OAAO,GAAG,CAAC,IAAI,iBAAiB,CAEhE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAQ1D"}
|
package/dist/errors.js
CHANGED
|
@@ -2,8 +2,22 @@
|
|
|
2
2
|
* Error hierarchy for the Run402 SDK. Every failure throws a subclass of
|
|
3
3
|
* {@link Run402Error}. Consumers (MCP handlers, CLI commands, user functions)
|
|
4
4
|
* translate these into their native error shapes at the edge.
|
|
5
|
+
*
|
|
6
|
+
* Branch on {@link Run402Error.kind} (or the exported `is*` type guards) rather
|
|
7
|
+
* than `instanceof`. Discriminator-based checks survive duplicate SDK installs,
|
|
8
|
+
* bundler chunk splits, ESM/CJS interop, and V8-isolate realm boundaries —
|
|
9
|
+
* any setting where a class object's identity might differ from the consumer's
|
|
10
|
+
* own class object reference. `instanceof X` continues to work for callers
|
|
11
|
+
* holding a single SDK copy (back-compat); the guards are the recommended path.
|
|
5
12
|
*/
|
|
6
13
|
export class Run402Error extends Error {
|
|
14
|
+
/**
|
|
15
|
+
* Structural brand. Always `true` on any {@link Run402Error} subclass
|
|
16
|
+
* instance, regardless of which SDK copy created it. The exported
|
|
17
|
+
* {@link isRun402Error} guard checks this field instead of `instanceof`,
|
|
18
|
+
* so cross-realm and cross-bundle errors still match.
|
|
19
|
+
*/
|
|
20
|
+
isRun402Error = true;
|
|
7
21
|
/** HTTP status, or null for local/network failures that produced no response. */
|
|
8
22
|
status;
|
|
9
23
|
/** Parsed response body, or null when no body was received. */
|
|
@@ -51,6 +65,31 @@ export class Run402Error extends Error {
|
|
|
51
65
|
if (Array.isArray(envelope?.next_actions))
|
|
52
66
|
this.nextActions = envelope.next_actions;
|
|
53
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Canonical structured envelope for `JSON.stringify`. Without this, an
|
|
70
|
+
* `Error` instance serializes as `"{}"` (its built-in fields are
|
|
71
|
+
* non-enumerable), losing every structured detail an agent needs for
|
|
72
|
+
* triage. Subclasses with extra fields (e.g. {@link Run402DeployError})
|
|
73
|
+
* override and spread `super.toJSON()`.
|
|
74
|
+
*/
|
|
75
|
+
toJSON() {
|
|
76
|
+
return {
|
|
77
|
+
name: this.name,
|
|
78
|
+
kind: this.kind,
|
|
79
|
+
message: this.message,
|
|
80
|
+
status: this.status,
|
|
81
|
+
code: this.code,
|
|
82
|
+
category: this.category,
|
|
83
|
+
retryable: this.retryable,
|
|
84
|
+
safeToRetry: this.safeToRetry,
|
|
85
|
+
mutationState: this.mutationState,
|
|
86
|
+
traceId: this.traceId,
|
|
87
|
+
context: this.context,
|
|
88
|
+
details: this.details,
|
|
89
|
+
nextActions: this.nextActions,
|
|
90
|
+
body: this.body,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
54
93
|
}
|
|
55
94
|
function canonicalEnvelope(body) {
|
|
56
95
|
return body && typeof body === "object" && !Array.isArray(body)
|
|
@@ -59,9 +98,11 @@ function canonicalEnvelope(body) {
|
|
|
59
98
|
}
|
|
60
99
|
/** HTTP 402 — the gateway requires payment (lease expired, insufficient balance, or x402 quote). */
|
|
61
100
|
export class PaymentRequired extends Run402Error {
|
|
101
|
+
kind = "payment_required";
|
|
62
102
|
}
|
|
63
103
|
/** Project ID is not present in the credential provider (local miss) or the gateway returned 404. */
|
|
64
104
|
export class ProjectNotFound extends Run402Error {
|
|
105
|
+
kind = "project_not_found";
|
|
65
106
|
projectId;
|
|
66
107
|
constructor(projectId, context, status = null, body = null) {
|
|
67
108
|
super(`Project ${projectId} not found`, status, body, context);
|
|
@@ -70,12 +111,15 @@ export class ProjectNotFound extends Run402Error {
|
|
|
70
111
|
}
|
|
71
112
|
/** HTTP 401 or 403 — authentication missing, invalid, or insufficient for the operation. */
|
|
72
113
|
export class Unauthorized extends Run402Error {
|
|
114
|
+
kind = "unauthorized";
|
|
73
115
|
}
|
|
74
116
|
/** Any other non-2xx HTTP response from the gateway. */
|
|
75
117
|
export class ApiError extends Run402Error {
|
|
118
|
+
kind = "api_error";
|
|
76
119
|
}
|
|
77
120
|
/** The underlying `fetch` threw before producing a response (DNS, connection reset, offline). */
|
|
78
121
|
export class NetworkError extends Run402Error {
|
|
122
|
+
kind = "network_error";
|
|
79
123
|
cause;
|
|
80
124
|
constructor(message, cause, context) {
|
|
81
125
|
super(message, null, null, context);
|
|
@@ -84,6 +128,7 @@ export class NetworkError extends Run402Error {
|
|
|
84
128
|
}
|
|
85
129
|
/** Local/filesystem error — input validation, missing path, unreadable dir. No HTTP involved. */
|
|
86
130
|
export class LocalError extends Run402Error {
|
|
131
|
+
kind = "local_error";
|
|
87
132
|
cause;
|
|
88
133
|
constructor(message, context, cause) {
|
|
89
134
|
super(message, null, null, context);
|
|
@@ -92,6 +137,7 @@ export class LocalError extends Run402Error {
|
|
|
92
137
|
}
|
|
93
138
|
}
|
|
94
139
|
export class Run402DeployError extends Run402Error {
|
|
140
|
+
kind = "deploy_error";
|
|
95
141
|
code;
|
|
96
142
|
phase;
|
|
97
143
|
resource;
|
|
@@ -113,5 +159,87 @@ export class Run402DeployError extends Run402Error {
|
|
|
113
159
|
this.logs = init.logs ?? null;
|
|
114
160
|
this.rolledBack = init.rolledBack ?? false;
|
|
115
161
|
}
|
|
162
|
+
toJSON() {
|
|
163
|
+
return {
|
|
164
|
+
...super.toJSON(),
|
|
165
|
+
phase: this.phase,
|
|
166
|
+
resource: this.resource,
|
|
167
|
+
operationId: this.operationId,
|
|
168
|
+
planId: this.planId,
|
|
169
|
+
fix: this.fix,
|
|
170
|
+
logs: this.logs,
|
|
171
|
+
rolledBack: this.rolledBack,
|
|
172
|
+
retryable: this.retryable,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// ─── Type guards ─────────────────────────────────────────────────────────────
|
|
177
|
+
//
|
|
178
|
+
// Identity-free guards. Each one checks the structural brand and (for subclass
|
|
179
|
+
// guards) the `kind` discriminator. Use these instead of `instanceof X` so the
|
|
180
|
+
// check survives duplicate SDK installs, bundler chunk splits, ESM/CJS interop,
|
|
181
|
+
// and V8-isolate realm boundaries — anywhere the consumer's class object
|
|
182
|
+
// reference might differ from the throw site's.
|
|
183
|
+
/** True if `e` is any {@link Run402Error} subclass instance, regardless of which SDK copy created it. */
|
|
184
|
+
export function isRun402Error(e) {
|
|
185
|
+
return Boolean(e &&
|
|
186
|
+
typeof e === "object" &&
|
|
187
|
+
e.isRun402Error === true);
|
|
188
|
+
}
|
|
189
|
+
/** True if `e` is a {@link PaymentRequired}. Survives duplicate SDK copies and realms. */
|
|
190
|
+
export function isPaymentRequired(e) {
|
|
191
|
+
return isRun402Error(e) && e.kind === "payment_required";
|
|
192
|
+
}
|
|
193
|
+
/** True if `e` is a {@link ProjectNotFound}. */
|
|
194
|
+
export function isProjectNotFound(e) {
|
|
195
|
+
return isRun402Error(e) && e.kind === "project_not_found";
|
|
196
|
+
}
|
|
197
|
+
/** True if `e` is an {@link Unauthorized}. */
|
|
198
|
+
export function isUnauthorized(e) {
|
|
199
|
+
return isRun402Error(e) && e.kind === "unauthorized";
|
|
200
|
+
}
|
|
201
|
+
/** True if `e` is an {@link ApiError}. */
|
|
202
|
+
export function isApiError(e) {
|
|
203
|
+
return isRun402Error(e) && e.kind === "api_error";
|
|
204
|
+
}
|
|
205
|
+
/** True if `e` is a {@link NetworkError}. */
|
|
206
|
+
export function isNetworkError(e) {
|
|
207
|
+
return isRun402Error(e) && e.kind === "network_error";
|
|
208
|
+
}
|
|
209
|
+
/** True if `e` is a {@link LocalError}. */
|
|
210
|
+
export function isLocalError(e) {
|
|
211
|
+
return isRun402Error(e) && e.kind === "local_error";
|
|
212
|
+
}
|
|
213
|
+
/** True if `e` is a {@link Run402DeployError}. */
|
|
214
|
+
export function isDeployError(e) {
|
|
215
|
+
return isRun402Error(e) && e.kind === "deploy_error";
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Canonical "should I retry this?" policy. Returns true when `e` is a
|
|
219
|
+
* {@link Run402Error} AND any of:
|
|
220
|
+
* - `e.retryable === true` (gateway flagged it)
|
|
221
|
+
* - `e.safeToRetry === true` (gateway flagged it)
|
|
222
|
+
* - `e.kind === "network_error"` (fetch never produced a response)
|
|
223
|
+
* - `e.status` is 408 (Request Timeout), 425 (Too Early), or 429 (Too Many
|
|
224
|
+
* Requests)
|
|
225
|
+
* - `e.status` is a 5xx server error
|
|
226
|
+
*
|
|
227
|
+
* Returns false for non-Run402 errors so it can be safely called with
|
|
228
|
+
* `unknown` from a catch block. Used as the default `retryIf` in
|
|
229
|
+
* {@link withRetry}.
|
|
230
|
+
*/
|
|
231
|
+
export function isRetryableRun402Error(e) {
|
|
232
|
+
if (!isRun402Error(e))
|
|
233
|
+
return false;
|
|
234
|
+
if (e.retryable === true || e.safeToRetry === true)
|
|
235
|
+
return true;
|
|
236
|
+
if (e.kind === "network_error")
|
|
237
|
+
return true;
|
|
238
|
+
const s = e.status;
|
|
239
|
+
if (s === 408 || s === 425 || s === 429)
|
|
240
|
+
return true;
|
|
241
|
+
if (typeof s === "number" && s >= 500)
|
|
242
|
+
return true;
|
|
243
|
+
return false;
|
|
116
244
|
}
|
|
117
245
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAgBH,MAAM,OAAgB,WAAY,SAAQ,KAAK;IAC7C;;;;;OAKG;IACM,aAAa,GAAG,IAAa,CAAC;IAOvC,iFAAiF;IACxE,MAAM,CAAgB;IAC/B,+DAA+D;IACtD,IAAI,CAAU;IACvB,2FAA2F;IAClF,OAAO,CAAS;IACzB,mFAAmF;IAC1E,IAAI,CAAU;IACvB,+DAA+D;IACtD,QAAQ,CAAU;IAC3B,kDAAkD;IACzC,SAAS,CAAW;IA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,CAAC;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,CAAC,CAAC,SAAS,KAAK,IAAI,IAAI,CAAC,CAAC,WAAW,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChE,IAAI,CAAC,CAAC,IAAI,KAAK,eAAe;QAAE,OAAO,IAAI,CAAC;IAC5C,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;IACnB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IACrD,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,IAAI,GAAG;QAAE,OAAO,IAAI,CAAC;IACnD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -115,8 +115,10 @@ export declare function files(record: Record<string, ContentSource>): FileSet;
|
|
|
115
115
|
* sandbox examples: `const r = run402({ ... })`.
|
|
116
116
|
*/
|
|
117
117
|
export declare function run402(opts: Run402Options): Run402;
|
|
118
|
-
export { Run402Error, PaymentRequired, ProjectNotFound, Unauthorized, ApiError, NetworkError, LocalError, Run402DeployError, } from "./errors.js";
|
|
119
|
-
export type { Run402DeployErrorCode, Run402DeployErrorFix, } from "./errors.js";
|
|
118
|
+
export { Run402Error, PaymentRequired, ProjectNotFound, Unauthorized, ApiError, NetworkError, LocalError, Run402DeployError, isRun402Error, isPaymentRequired, isProjectNotFound, isUnauthorized, isApiError, isNetworkError, isLocalError, isDeployError, isRetryableRun402Error, } from "./errors.js";
|
|
119
|
+
export type { Run402DeployErrorCode, Run402DeployErrorFix, Run402ErrorKind, } from "./errors.js";
|
|
120
|
+
export { withRetry } from "./retry.js";
|
|
121
|
+
export type { RetryOptions } from "./retry.js";
|
|
120
122
|
export type { CredentialsProvider, ProjectKeys } from "./credentials.js";
|
|
121
123
|
export type { RequestOptions, Client } from "./kernel.js";
|
|
122
124
|
export { Deploy } from "./namespaces/deploy.js";
|
package/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OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,YAAY,EACV,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,cAAc,EACd,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,SAAS,EACT,WAAW,EACX,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,cAAc,GACf,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -151,7 +151,8 @@ export function files(record) {
|
|
|
151
151
|
export function run402(opts) {
|
|
152
152
|
return new Run402(opts);
|
|
153
153
|
}
|
|
154
|
-
export { Run402Error, PaymentRequired, ProjectNotFound, Unauthorized, ApiError, NetworkError, LocalError, Run402DeployError, } from "./errors.js";
|
|
154
|
+
export { Run402Error, PaymentRequired, ProjectNotFound, Unauthorized, ApiError, NetworkError, LocalError, Run402DeployError, isRun402Error, isPaymentRequired, isProjectNotFound, isUnauthorized, isApiError, isNetworkError, isLocalError, isDeployError, isRetryableRun402Error, } from "./errors.js";
|
|
155
|
+
export { withRetry } from "./retry.js";
|
|
155
156
|
export { Deploy } from "./namespaces/deploy.js";
|
|
156
157
|
export { ScopedRun402 } from "./scoped.js";
|
|
157
158
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAkC,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,E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sB,GACvB,MAAM,aAAa,CAAC;AAMrB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -19,11 +19,14 @@ export interface AgentContactResult {
|
|
|
19
19
|
webhook?: string;
|
|
20
20
|
updated_at: string;
|
|
21
21
|
}
|
|
22
|
+
export interface SendMessageResult {
|
|
23
|
+
status: string;
|
|
24
|
+
}
|
|
22
25
|
export declare class Admin {
|
|
23
26
|
private readonly client;
|
|
24
27
|
constructor(client: Client);
|
|
25
28
|
/** Send a message to the Run402 developers. Requires an active tier. */
|
|
26
|
-
sendMessage(message: string): Promise<
|
|
29
|
+
sendMessage(message: string): Promise<SendMessageResult>;
|
|
27
30
|
/** Register agent contact info (name, email, webhook). */
|
|
28
31
|
setAgentContact(contact: AgentContact): Promise<AgentContactResult>;
|
|
29
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/namespaces/admin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C,wEAAwE;IAClE,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/namespaces/admin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C,wEAAwE;IAClE,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAQ9D,0DAA0D;IACpD,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAW1E"}
|
package/dist/namespaces/admin.js
CHANGED
|
@@ -13,7 +13,7 @@ export class Admin {
|
|
|
13
13
|
}
|
|
14
14
|
/** Send a message to the Run402 developers. Requires an active tier. */
|
|
15
15
|
async sendMessage(message) {
|
|
16
|
-
|
|
16
|
+
return this.client.request("/message/v1", {
|
|
17
17
|
method: "POST",
|
|
18
18
|
body: { message },
|
|
19
19
|
context: "sending message",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/namespaces/admin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/namespaces/admin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAsBH,MAAM,OAAO,KAAK;IACa;IAA7B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,wEAAwE;IACxE,KAAK,CAAC,WAAW,CAAC,OAAe;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAoB,aAAa,EAAE;YAC3D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,OAAO,EAAE;YACjB,OAAO,EAAE,iBAAiB;SAC3B,CAAC,CAAC;IACL,CAAC;IAED,0DAA0D;IAC1D,KAAK,CAAC,eAAe,CAAC,OAAqB;QACzC,MAAM,IAAI,GAA2B,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;QAC5D,IAAI,OAAO,CAAC,KAAK;YAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC9C,IAAI,OAAO,CAAC,OAAO;YAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAEpD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAqB,mBAAmB,EAAE;YAClE,MAAM,EAAE,MAAM;YACd,IAAI;YACJ,OAAO,EAAE,uBAAuB;SACjC,CAAC,CAAC;IACL,CAAC;CACF"}
|