mandala-computer-mcp 0.4.0 → 0.5.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/README.md +450 -29
- package/dist/api.d.ts +12 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +160 -15
- package/dist/api.js.map +1 -1
- package/dist/artifacts.d.ts +63 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +81 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +35 -21
- package/dist/cli.js.map +1 -1
- package/dist/credentials.d.ts +33 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +395 -0
- package/dist/credentials.js.map +1 -0
- package/dist/errors.d.ts +29 -9
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +71 -34
- package/dist/errors.js.map +1 -1
- package/dist/executions.d.ts +43 -0
- package/dist/executions.d.ts.map +1 -0
- package/dist/executions.js +162 -0
- package/dist/executions.js.map +1 -0
- package/dist/format.d.ts +11 -11
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +81 -15
- package/dist/format.js.map +1 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +4 -0
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +40 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +50 -0
- package/dist/paths.js.map +1 -1
- package/dist/results.d.ts +97 -0
- package/dist/results.d.ts.map +1 -0
- package/dist/results.js +263 -0
- package/dist/results.js.map +1 -0
- package/dist/server.d.ts +3 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +60 -9
- package/dist/server.js.map +1 -1
- package/dist/stdio.d.ts +5 -1
- package/dist/stdio.d.ts.map +1 -1
- package/dist/stdio.js +10 -4
- package/dist/stdio.js.map +1 -1
- package/dist/tool-filters.d.ts +38 -0
- package/dist/tool-filters.d.ts.map +1 -0
- package/dist/tool-filters.js +129 -0
- package/dist/tool-filters.js.map +1 -0
- package/dist/tools/account.d.ts +3 -0
- package/dist/tools/account.d.ts.map +1 -0
- package/dist/tools/account.js +122 -0
- package/dist/tools/account.js.map +1 -0
- package/dist/tools/activities.d.ts +3 -0
- package/dist/tools/activities.d.ts.map +1 -0
- package/dist/tools/activities.js +140 -0
- package/dist/tools/activities.js.map +1 -0
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/agent.js +21 -9
- package/dist/tools/agent.js.map +1 -1
- package/dist/tools/artifacts.d.ts +3 -0
- package/dist/tools/artifacts.d.ts.map +1 -0
- package/dist/tools/artifacts.js +97 -0
- package/dist/tools/artifacts.js.map +1 -0
- package/dist/tools/chat.d.ts +6 -0
- package/dist/tools/chat.d.ts.map +1 -0
- package/dist/tools/chat.js +192 -0
- package/dist/tools/chat.js.map +1 -0
- package/dist/tools/computers.d.ts.map +1 -1
- package/dist/tools/computers.js +18 -7
- package/dist/tools/computers.js.map +1 -1
- package/dist/tools/directory.d.ts +13 -0
- package/dist/tools/directory.d.ts.map +1 -0
- package/dist/tools/directory.js +88 -0
- package/dist/tools/directory.js.map +1 -0
- package/dist/tools/executions.d.ts +3 -0
- package/dist/tools/executions.d.ts.map +1 -0
- package/dist/tools/executions.js +87 -0
- package/dist/tools/executions.js.map +1 -0
- package/dist/tools/guest.d.ts.map +1 -1
- package/dist/tools/guest.js +50 -15
- package/dist/tools/guest.js.map +1 -1
- package/dist/tools/results.d.ts +30 -0
- package/dist/tools/results.d.ts.map +1 -0
- package/dist/tools/results.js +106 -0
- package/dist/tools/results.js.map +1 -0
- package/dist/tools/secrets.d.ts +58 -0
- package/dist/tools/secrets.d.ts.map +1 -0
- package/dist/tools/secrets.js +204 -0
- package/dist/tools/secrets.js.map +1 -0
- package/dist/tools/signals.d.ts +3 -0
- package/dist/tools/signals.d.ts.map +1 -0
- package/dist/tools/signals.js +116 -0
- package/dist/tools/signals.js.map +1 -0
- package/dist/tools/snapshots.d.ts.map +1 -1
- package/dist/tools/snapshots.js +44 -8
- package/dist/tools/snapshots.js.map +1 -1
- package/dist/tools/ssh.d.ts +3 -0
- package/dist/tools/ssh.d.ts.map +1 -0
- package/dist/tools/ssh.js +186 -0
- package/dist/tools/ssh.js.map +1 -0
- package/package.json +1 -1
package/dist/errors.d.ts
CHANGED
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
export declare class MandalaError extends Error {
|
|
17
17
|
name: string;
|
|
18
18
|
}
|
|
19
|
+
/** Optional diagnostics supplied by an HTTP response; never permission to replay a request. */
|
|
20
|
+
export interface APIErrorMetadata {
|
|
21
|
+
requestId?: string;
|
|
22
|
+
allow?: string;
|
|
23
|
+
wwwAuthenticate?: string;
|
|
24
|
+
}
|
|
19
25
|
export declare class APIError extends MandalaError {
|
|
20
26
|
readonly status: number;
|
|
21
27
|
readonly body?: unknown | undefined;
|
|
@@ -36,9 +42,15 @@ export declare class APIError extends MandalaError {
|
|
|
36
42
|
* the caller who arrived a moment earlier heard.
|
|
37
43
|
*/
|
|
38
44
|
readonly reason?: string;
|
|
45
|
+
/** Response header first, then the top-level body ID; never an idempotency key. */
|
|
46
|
+
readonly requestId?: string;
|
|
47
|
+
/** The received Allow header, when supplied. */
|
|
48
|
+
readonly allow?: string;
|
|
49
|
+
/** The received WWW-Authenticate header, when supplied. */
|
|
50
|
+
readonly wwwAuthenticate?: string;
|
|
39
51
|
constructor(message: string, status: number, body?: unknown | undefined,
|
|
40
52
|
/** Parsed Retry-After delay in milliseconds; absent when missing or invalid. */
|
|
41
|
-
retryAfterMs?: number | undefined);
|
|
53
|
+
retryAfterMs?: number | undefined, metadata?: APIErrorMetadata);
|
|
42
54
|
}
|
|
43
55
|
/** Whether waiting can change a classified refusal's answer. */
|
|
44
56
|
export type ReasonKind = 'clears' | 'permanent';
|
|
@@ -102,12 +114,14 @@ export declare function reasonAdvice(reason: string | undefined): string | undef
|
|
|
102
114
|
* the work may already stand. None of the three is a fault on the computer, and
|
|
103
115
|
* a model told only "unauthorized (HTTP 401)" reads it as one.
|
|
104
116
|
*
|
|
105
|
-
*
|
|
117
|
+
* A 404 is deliberately not classified here: it does not separate deleted
|
|
106
118
|
* from out of this key's reach, so a single clause would have to be wrong about
|
|
107
119
|
* one of them — that judgement belongs to the tools that know which id they were
|
|
108
120
|
* given. Silence is the same discipline {@link reasonAdvice} keeps.
|
|
109
121
|
*/
|
|
110
|
-
export declare function
|
|
122
|
+
export declare function authenticationAdvice(reason: string | undefined): string;
|
|
123
|
+
/** Status-specific guidance, with authentication provenance supplied by the refusal reason. */
|
|
124
|
+
export declare function statusAdvice(status: number | undefined, reason?: string): string | undefined;
|
|
111
125
|
/** 401 — the key is missing, malformed, or revoked. */
|
|
112
126
|
export declare class AuthenticationError extends APIError {
|
|
113
127
|
name: string;
|
|
@@ -120,10 +134,14 @@ export declare class PlanLimitError extends APIError {
|
|
|
120
134
|
export declare class PermissionDeniedError extends APIError {
|
|
121
135
|
name: string;
|
|
122
136
|
}
|
|
123
|
-
/** 404 — no such computer, snapshot, or route. */
|
|
137
|
+
/** 404 — no such computer, snapshot, guest path, or route. */
|
|
124
138
|
export declare class NotFoundError extends APIError {
|
|
125
139
|
name: string;
|
|
126
140
|
}
|
|
141
|
+
/** 405 — the path does not support the requested method; inspect the received Allow. */
|
|
142
|
+
export declare class MethodNotAllowedError extends APIError {
|
|
143
|
+
name: string;
|
|
144
|
+
}
|
|
127
145
|
/**
|
|
128
146
|
* 409 — the thing exists but is in the wrong state for this right now.
|
|
129
147
|
*
|
|
@@ -180,7 +198,7 @@ export declare class MoveRequiredError extends ConflictError {
|
|
|
180
198
|
name: string;
|
|
181
199
|
constructor(message: string, status: number, body: unknown,
|
|
182
200
|
/** Whether a host in this region could run the size that was asked for. */
|
|
183
|
-
movePossible: boolean, retryAfterMs?: number);
|
|
201
|
+
movePossible: boolean, retryAfterMs?: number, metadata?: APIErrorMetadata);
|
|
184
202
|
}
|
|
185
203
|
/**
|
|
186
204
|
* 416 — the `Range` named no byte the file has.
|
|
@@ -200,7 +218,7 @@ export declare class RangeNotSatisfiableError extends APIError {
|
|
|
200
218
|
name: string;
|
|
201
219
|
constructor(message: string, status: number, body?: unknown,
|
|
202
220
|
/** The file's real length, off `Content-Range`, when the response sent one. */
|
|
203
|
-
size?: number | undefined, retryAfterMs?: number);
|
|
221
|
+
size?: number | undefined, retryAfterMs?: number, metadata?: APIErrorMetadata);
|
|
204
222
|
}
|
|
205
223
|
/**
|
|
206
224
|
* 429 — the request is valid; the caller has spent a temporary rate budget.
|
|
@@ -219,7 +237,7 @@ export declare class RateLimitError extends APIError {
|
|
|
219
237
|
name: string;
|
|
220
238
|
constructor(message: string, status: number, body?: unknown,
|
|
221
239
|
/** From `Retry-After`, in milliseconds from now, when the response sent one. */
|
|
222
|
-
retryAfterMs?: number);
|
|
240
|
+
retryAfterMs?: number, metadata?: APIErrorMetadata);
|
|
223
241
|
}
|
|
224
242
|
/** 503 — a hypervisor could not be reached, so an inventory would be short. */
|
|
225
243
|
export declare class UnavailableError extends APIError {
|
|
@@ -464,7 +482,7 @@ export declare class OriginTLSError extends APIError {
|
|
|
464
482
|
*/
|
|
465
483
|
export declare function platformSaid(body: unknown): string | undefined;
|
|
466
484
|
/** Build the error for a status, with the platform's own message when it sent one. */
|
|
467
|
-
export declare function errorForStatus(status: number, message: string, body?: unknown, retryAfterMs?: number): APIError;
|
|
485
|
+
export declare function errorForStatus(status: number, message: string, body?: unknown, retryAfterMs?: number, metadata?: APIErrorMetadata): APIError;
|
|
468
486
|
/**
|
|
469
487
|
* Whether an error is worth trying again without changing the request.
|
|
470
488
|
*
|
|
@@ -474,7 +492,9 @@ export declare function errorForStatus(status: number, message: string, body?: u
|
|
|
474
492
|
* including one that creates something — so it names only failures that both
|
|
475
493
|
* clear on their own AND are safe to replay blind.
|
|
476
494
|
*
|
|
477
|
-
*
|
|
495
|
+
* Terminal authentication, authority, payment, missing-resource and method
|
|
496
|
+
* refusals stay terminal even with a contradictory reason. Other cases are
|
|
497
|
+
* answered by TYPE, which is the OPL-3724
|
|
478
498
|
* decision written down. Three clients had drifted into three mechanisms for
|
|
479
499
|
* one question: this file matched classes plus a list of numbers, the
|
|
480
500
|
* TypeScript SDK matched classes alone, and the Python SDK named the fatal
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,qBAAa,YAAa,SAAQ,KAAK;IAC5B,IAAI,SAAkB;CAChC;AAED,qBAAa,QAAS,SAAQ,YAAY;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,qBAAa,YAAa,SAAQ,KAAK;IAC5B,IAAI,SAAkB;CAChC;AAED,+FAA+F;AAC/F,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAOD,qBAAa,QAAS,SAAQ,YAAY;IAwBtC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO;IACvB,gFAAgF;IAChF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM;IA1BvB,IAAI,SAAc;IAC3B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,mFAAmF;IACnF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,gDAAgD;IAChD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,QAAQ,CAAC,eAAe,CAA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 @@
|
|
|
16
16
|
export class MandalaError extends Error {
|
|
17
17
|
name = 'MandalaError';
|
|
18
18
|
}
|
|
19
|
+
const nonblank = (value) => typeof value === 'string' && value.trim().length > 0 ? value : undefined;
|
|
20
|
+
const record = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
19
21
|
export class APIError extends MandalaError {
|
|
20
22
|
status;
|
|
21
23
|
body;
|
|
@@ -35,14 +37,24 @@ export class APIError extends MandalaError {
|
|
|
35
37
|
* the caller who arrived a moment earlier heard.
|
|
36
38
|
*/
|
|
37
39
|
reason;
|
|
40
|
+
/** Response header first, then the top-level body ID; never an idempotency key. */
|
|
41
|
+
requestId;
|
|
42
|
+
/** The received Allow header, when supplied. */
|
|
43
|
+
allow;
|
|
44
|
+
/** The received WWW-Authenticate header, when supplied. */
|
|
45
|
+
wwwAuthenticate;
|
|
38
46
|
constructor(message, status, body,
|
|
39
47
|
/** Parsed Retry-After delay in milliseconds; absent when missing or invalid. */
|
|
40
|
-
retryAfterMs) {
|
|
48
|
+
retryAfterMs, metadata) {
|
|
41
49
|
super(message);
|
|
42
50
|
this.status = status;
|
|
43
51
|
this.body = body;
|
|
44
52
|
this.retryAfterMs = retryAfterMs;
|
|
45
53
|
this.reason = refusalReason(body);
|
|
54
|
+
this.requestId =
|
|
55
|
+
nonblank(metadata?.requestId) ?? (record(body) ? nonblank(body.request_id) : undefined);
|
|
56
|
+
this.allow = nonblank(metadata?.allow);
|
|
57
|
+
this.wwwAuthenticate = nonblank(metadata?.wwwAuthenticate);
|
|
46
58
|
}
|
|
47
59
|
}
|
|
48
60
|
/**
|
|
@@ -163,15 +175,28 @@ export function reasonAdvice(reason) {
|
|
|
163
175
|
* the work may already stand. None of the three is a fault on the computer, and
|
|
164
176
|
* a model told only "unauthorized (HTTP 401)" reads it as one.
|
|
165
177
|
*
|
|
166
|
-
*
|
|
178
|
+
* A 404 is deliberately not classified here: it does not separate deleted
|
|
167
179
|
* from out of this key's reach, so a single clause would have to be wrong about
|
|
168
180
|
* one of them — that judgement belongs to the tools that know which id they were
|
|
169
181
|
* given. Silence is the same discipline {@link reasonAdvice} keeps.
|
|
170
182
|
*/
|
|
171
|
-
export function
|
|
183
|
+
export function authenticationAdvice(reason) {
|
|
184
|
+
const classification = reason === 'missing'
|
|
185
|
+
? 'a platform authentication credential was not supplied'
|
|
186
|
+
: reason === 'invalid'
|
|
187
|
+
? 'the supplied platform credential was not accepted'
|
|
188
|
+
: reason === 'revoked'
|
|
189
|
+
? 'the platform authority was revoked and no longer holds'
|
|
190
|
+
: 'a credential was refused; this result alone does not identify whether the account key or model key caused it';
|
|
191
|
+
return `${classification}. Do not replay this request unchanged. A refusal can occur partway through a call; check what already took effect before repeating anything that creates, starts, moves, writes or deletes`;
|
|
192
|
+
}
|
|
193
|
+
/** Status-specific guidance, with authentication provenance supplied by the refusal reason. */
|
|
194
|
+
export function statusAdvice(status, reason) {
|
|
172
195
|
switch (status) {
|
|
173
196
|
case 401:
|
|
174
|
-
return
|
|
197
|
+
return authenticationAdvice(reason);
|
|
198
|
+
case 405:
|
|
199
|
+
return 'check the request method against the received Allow metadata, when present. Do not automatically switch methods or replay this request';
|
|
175
200
|
case 403:
|
|
176
201
|
return 'this account does not permit this — a role that changed or an account suspended, rather than anything wrong with the computer. Retrying does not help, and it can be decided partway through a call, so check what already took effect before repeating anything that writes';
|
|
177
202
|
case 402:
|
|
@@ -191,10 +216,13 @@ export function statusAdvice(status) {
|
|
|
191
216
|
* and the raw word belongs to whoever is embedding this.
|
|
192
217
|
*/
|
|
193
218
|
function refusalReason(body) {
|
|
194
|
-
if (!body
|
|
219
|
+
if (!record(body))
|
|
195
220
|
return undefined;
|
|
196
|
-
|
|
197
|
-
|
|
221
|
+
if (typeof body.reason === 'string')
|
|
222
|
+
return body.reason;
|
|
223
|
+
return record(body.error) && typeof body.error.reason === 'string'
|
|
224
|
+
? body.error.reason
|
|
225
|
+
: undefined;
|
|
198
226
|
}
|
|
199
227
|
/** 401 — the key is missing, malformed, or revoked. */
|
|
200
228
|
export class AuthenticationError extends APIError {
|
|
@@ -208,10 +236,14 @@ export class PlanLimitError extends APIError {
|
|
|
208
236
|
export class PermissionDeniedError extends APIError {
|
|
209
237
|
name = 'PermissionDeniedError';
|
|
210
238
|
}
|
|
211
|
-
/** 404 — no such computer, snapshot, or route. */
|
|
239
|
+
/** 404 — no such computer, snapshot, guest path, or route. */
|
|
212
240
|
export class NotFoundError extends APIError {
|
|
213
241
|
name = 'NotFoundError';
|
|
214
242
|
}
|
|
243
|
+
/** 405 — the path does not support the requested method; inspect the received Allow. */
|
|
244
|
+
export class MethodNotAllowedError extends APIError {
|
|
245
|
+
name = 'MethodNotAllowedError';
|
|
246
|
+
}
|
|
215
247
|
/**
|
|
216
248
|
* 409 — the thing exists but is in the wrong state for this right now.
|
|
217
249
|
*
|
|
@@ -267,8 +299,8 @@ export class MoveRequiredError extends ConflictError {
|
|
|
267
299
|
name = 'MoveRequiredError';
|
|
268
300
|
constructor(message, status, body,
|
|
269
301
|
/** Whether a host in this region could run the size that was asked for. */
|
|
270
|
-
movePossible, retryAfterMs) {
|
|
271
|
-
super(message, status, body, retryAfterMs);
|
|
302
|
+
movePossible, retryAfterMs, metadata) {
|
|
303
|
+
super(message, status, body, retryAfterMs, metadata);
|
|
272
304
|
this.movePossible = movePossible;
|
|
273
305
|
}
|
|
274
306
|
}
|
|
@@ -309,8 +341,8 @@ export class RangeNotSatisfiableError extends APIError {
|
|
|
309
341
|
name = 'RangeNotSatisfiableError';
|
|
310
342
|
constructor(message, status, body,
|
|
311
343
|
/** The file's real length, off `Content-Range`, when the response sent one. */
|
|
312
|
-
size, retryAfterMs) {
|
|
313
|
-
super(message, status, body, retryAfterMs);
|
|
344
|
+
size, retryAfterMs, metadata) {
|
|
345
|
+
super(message, status, body, retryAfterMs, metadata);
|
|
314
346
|
this.size = size;
|
|
315
347
|
}
|
|
316
348
|
}
|
|
@@ -332,8 +364,8 @@ export class RateLimitError extends APIError {
|
|
|
332
364
|
// biome-ignore lint/complexity/noUselessConstructor: Preserve the documented public constructor.
|
|
333
365
|
constructor(message, status, body,
|
|
334
366
|
/** From `Retry-After`, in milliseconds from now, when the response sent one. */
|
|
335
|
-
retryAfterMs) {
|
|
336
|
-
super(message, status, body, retryAfterMs);
|
|
367
|
+
retryAfterMs, metadata) {
|
|
368
|
+
super(message, status, body, retryAfterMs, metadata);
|
|
337
369
|
}
|
|
338
370
|
}
|
|
339
371
|
/** 503 — a hypervisor could not be reached, so an inventory would be short. */
|
|
@@ -564,13 +596,9 @@ const BY_STATUS = {
|
|
|
564
596
|
402: PlanLimitError,
|
|
565
597
|
403: PermissionDeniedError,
|
|
566
598
|
404: NotFoundError,
|
|
599
|
+
405: MethodNotAllowedError,
|
|
567
600
|
409: ConflictError,
|
|
568
|
-
//
|
|
569
|
-
// headers and so cannot fill in `size`. Api.#error builds this one itself for
|
|
570
|
-
// that reason; the entry is here so the mapping stays complete, and so a 416
|
|
571
|
-
// arriving from anywhere else is still the right class with the platform's
|
|
572
|
-
// own message on it.
|
|
573
|
-
416: RangeNotSatisfiableError,
|
|
601
|
+
// 416 has a range-specific constructor and is handled directly by the factory.
|
|
574
602
|
// Retry-After is parsed by Api and passed through errorForStatus.
|
|
575
603
|
// A 429 built without headers still has the same public error class.
|
|
576
604
|
429: RateLimitError,
|
|
@@ -691,7 +719,7 @@ const ORIGIN_TLS_MESSAGE = 'a proxy in front of the platform could not complete
|
|
|
691
719
|
/**
|
|
692
720
|
* Whether the response named this failure in the shape this surface uses.
|
|
693
721
|
*
|
|
694
|
-
*
|
|
722
|
+
* A JSON body with a non-empty `error` string or nonblank `error.message` counts. An HTML page and an
|
|
695
723
|
* empty body are an intermediary's, and both are worth discarding for the
|
|
696
724
|
* wording below; a structured message is not. "upstream unavailable before
|
|
697
725
|
* dispatch" is a more specific true thing than anything written here, and
|
|
@@ -725,13 +753,17 @@ function platformNamed(body) {
|
|
|
725
753
|
* itself.
|
|
726
754
|
*/
|
|
727
755
|
export function platformSaid(body) {
|
|
728
|
-
if (!body
|
|
756
|
+
if (!record(body))
|
|
729
757
|
return undefined;
|
|
730
758
|
const err = body.error;
|
|
731
|
-
return typeof err === 'string' && err.length > 0
|
|
759
|
+
return typeof err === 'string' && err.length > 0
|
|
760
|
+
? err
|
|
761
|
+
: record(err)
|
|
762
|
+
? nonblank(err.message)
|
|
763
|
+
: undefined;
|
|
732
764
|
}
|
|
733
765
|
/** Build the error for a status, with the platform's own message when it sent one. */
|
|
734
|
-
export function errorForStatus(status, message, body, retryAfterMs) {
|
|
766
|
+
export function errorForStatus(status, message, body, retryAfterMs, metadata) {
|
|
735
767
|
const Cls = BY_STATUS[status] ?? APIError;
|
|
736
768
|
// The 409 that is an offer, told apart by its body. Before the substitutions
|
|
737
769
|
// below because it never wants one: the platform's sentence here is the whole
|
|
@@ -740,10 +772,10 @@ export function errorForStatus(status, message, body, retryAfterMs) {
|
|
|
740
772
|
if (Cls === ConflictError) {
|
|
741
773
|
const offer = moveOffer(body);
|
|
742
774
|
if (offer)
|
|
743
|
-
return new MoveRequiredError(message, status, body, offer.possible, retryAfterMs);
|
|
775
|
+
return new MoveRequiredError(message, status, body, offer.possible, retryAfterMs, metadata);
|
|
744
776
|
}
|
|
745
|
-
if (
|
|
746
|
-
return new RangeNotSatisfiableError(message, status, body, undefined, retryAfterMs);
|
|
777
|
+
if (status === 416) {
|
|
778
|
+
return new RangeNotSatisfiableError(message, status, body, undefined, retryAfterMs, metadata);
|
|
747
779
|
}
|
|
748
780
|
// Substituted for an empty body, which says nothing, and for a proxy's HTML
|
|
749
781
|
// page, which says 500 characters of nothing. NOT for a structured message:
|
|
@@ -760,21 +792,21 @@ export function errorForStatus(status, message, body, retryAfterMs) {
|
|
|
760
792
|
// that deployment than the generic outage prose here does, and discarding it
|
|
761
793
|
// was the very thing the 504 and 520 guards exist to prevent.
|
|
762
794
|
if (Cls === GatewayTimeoutError && !platformNamed(body)) {
|
|
763
|
-
return new GatewayTimeoutError(gatewayTimeoutMessage(status), status, body, retryAfterMs);
|
|
795
|
+
return new GatewayTimeoutError(gatewayTimeoutMessage(status), status, body, retryAfterMs, metadata);
|
|
764
796
|
}
|
|
765
797
|
if (Cls === OriginResponseError && !platformNamed(body)) {
|
|
766
798
|
// 502 and 520 share a class and not a message: one knows the request
|
|
767
799
|
// arrived, the other cannot tell. See BAD_GATEWAY_MESSAGE.
|
|
768
800
|
const said = status === 502 ? BAD_GATEWAY_MESSAGE : ORIGIN_RESPONSE_MESSAGE;
|
|
769
|
-
return new OriginResponseError(said, status, body, retryAfterMs);
|
|
801
|
+
return new OriginResponseError(said, status, body, retryAfterMs, metadata);
|
|
770
802
|
}
|
|
771
803
|
if (Cls === OriginTLSError && !platformNamed(body)) {
|
|
772
|
-
return new OriginTLSError(ORIGIN_TLS_MESSAGE, status, body, retryAfterMs);
|
|
804
|
+
return new OriginTLSError(ORIGIN_TLS_MESSAGE, status, body, retryAfterMs, metadata);
|
|
773
805
|
}
|
|
774
806
|
if (Cls === OriginUnreachableError && !platformNamed(body)) {
|
|
775
|
-
return new OriginUnreachableError(ORIGIN_UNREACHABLE_MESSAGE, status, body, retryAfterMs);
|
|
807
|
+
return new OriginUnreachableError(ORIGIN_UNREACHABLE_MESSAGE, status, body, retryAfterMs, metadata);
|
|
776
808
|
}
|
|
777
|
-
return new Cls(message, status, body, retryAfterMs);
|
|
809
|
+
return new Cls(message, status, body, retryAfterMs, metadata);
|
|
778
810
|
}
|
|
779
811
|
/**
|
|
780
812
|
* Whether an error is worth trying again without changing the request.
|
|
@@ -785,7 +817,9 @@ export function errorForStatus(status, message, body, retryAfterMs) {
|
|
|
785
817
|
* including one that creates something — so it names only failures that both
|
|
786
818
|
* clear on their own AND are safe to replay blind.
|
|
787
819
|
*
|
|
788
|
-
*
|
|
820
|
+
* Terminal authentication, authority, payment, missing-resource and method
|
|
821
|
+
* refusals stay terminal even with a contradictory reason. Other cases are
|
|
822
|
+
* answered by TYPE, which is the OPL-3724
|
|
789
823
|
* decision written down. Three clients had drifted into three mechanisms for
|
|
790
824
|
* one question: this file matched classes plus a list of numbers, the
|
|
791
825
|
* TypeScript SDK matched classes alone, and the Python SDK named the fatal
|
|
@@ -849,6 +883,8 @@ export function errorForStatus(status, message, body, retryAfterMs) {
|
|
|
849
883
|
* what it can and cannot tell apart.
|
|
850
884
|
*/
|
|
851
885
|
export function isTransient(err) {
|
|
886
|
+
if (err instanceof APIError && [401, 402, 403, 404, 405].includes(err.status))
|
|
887
|
+
return false;
|
|
852
888
|
// Preparation requires the original template and a token, and may have failed.
|
|
853
889
|
// A generic retry of the unchanged create is not the continuation protocol.
|
|
854
890
|
if (err instanceof APIError &&
|
|
@@ -878,7 +914,8 @@ export function isTransient(err) {
|
|
|
878
914
|
// Through the exported classifier rather than the sets directly, so what an
|
|
879
915
|
// embedder is told and what this server does are one answer and not two.
|
|
880
916
|
const kind = reasonKind(err.reason);
|
|
881
|
-
|
|
917
|
+
// A nested run reason can arrive after billed work and grants no new replay permission.
|
|
918
|
+
if (kind === 'clears' && record(err.body) && typeof err.body.reason === 'string')
|
|
882
919
|
return true;
|
|
883
920
|
if (kind === 'permanent')
|
|
884
921
|
return false;
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAC5B,IAAI,GAAG,cAAc,CAAC;CAChC;AAED,MAAM,OAAO,QAAS,SAAQ,YAAY;IAkB7B;IACA;IAEA;IApBF,IAAI,GAAG,UAAU,CAAC;IAC3B;;;;;;;;;;;;OAYG;IACM,MAAM,CAAU;IACzB,YACE,OAAe,EACN,MAAc,EACd,IAAc;IACvB,gFAAgF;IACvE,YAAqB;QAE9B,KAAK,CAAC,OAAO,CAAC,CAAC;QALN,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAU;QAE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C,MAAM,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QAChF,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC;IAC/C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const EXECUTION_OUTPUT_DEFAULT = 4096;
|
|
2
|
+
export declare const EXECUTION_OUTPUT_MAX = 16384;
|
|
3
|
+
export declare const EXECUTION_RESULT_MAX: number;
|
|
4
|
+
/** Messages contain only field names we own, never an unexpected payload value. */
|
|
5
|
+
export declare class ExecutionValueError extends Error {
|
|
6
|
+
}
|
|
7
|
+
export declare function executionComputerId(id: string): string;
|
|
8
|
+
export declare function executionReadQuery(stdout: number, stderr: number, limit?: number): {
|
|
9
|
+
stdout_offset: number;
|
|
10
|
+
stderr_offset: number;
|
|
11
|
+
limit: number;
|
|
12
|
+
};
|
|
13
|
+
export declare function executionMetadata(value: unknown, computerId: string, executionId: string): {
|
|
14
|
+
execution_id: string;
|
|
15
|
+
computer_id: string;
|
|
16
|
+
pid: number;
|
|
17
|
+
status: string;
|
|
18
|
+
started_at: string;
|
|
19
|
+
output_source: string;
|
|
20
|
+
} | {
|
|
21
|
+
ended_at: string;
|
|
22
|
+
exit_code: number;
|
|
23
|
+
execution_id: string;
|
|
24
|
+
computer_id: string;
|
|
25
|
+
pid: number;
|
|
26
|
+
status: string;
|
|
27
|
+
started_at: string;
|
|
28
|
+
output_source: string;
|
|
29
|
+
};
|
|
30
|
+
export declare function executionOutput(value: unknown, executionId: string, query: ReturnType<typeof executionReadQuery>): {
|
|
31
|
+
diagnostic_available_bytes: number;
|
|
32
|
+
diagnostic_displayed_bytes: number;
|
|
33
|
+
diagnostic_display_truncated: boolean;
|
|
34
|
+
diagnostic_truncated: boolean;
|
|
35
|
+
stdout_bytes: number;
|
|
36
|
+
stderr_bytes: number;
|
|
37
|
+
stdout_offset: number;
|
|
38
|
+
stderr_offset: number;
|
|
39
|
+
stdout_more: boolean;
|
|
40
|
+
stderr_more: boolean;
|
|
41
|
+
execution_id: string;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=executions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executions.d.ts","sourceRoot":"","sources":["../src/executions.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAC7C,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAG1C,eAAO,MAAM,oBAAoB,QAAa,CAAC;AAE/C,mFAAmF;AACnF,qBAAa,mBAAoB,SAAQ,KAAK;CAAG;AAMjD,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAOtD;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,SAA2B;;;;EAgBjC;AA8CD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;;;;;;;;;;;;;;;;EAyBxF;AA+BD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC;;;;;;;;;;;;EAiC7C"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/** Finite, lossless presentations for stable reads over volatile guest output. */
|
|
2
|
+
import { isExecutionId } from './paths.js';
|
|
3
|
+
export const EXECUTION_OUTPUT_DEFAULT = 4096;
|
|
4
|
+
export const EXECUTION_OUTPUT_MAX = 16384;
|
|
5
|
+
const DIAGNOSTIC_AVAILABLE_MAX = 65536;
|
|
6
|
+
const DIAGNOSTIC_DISPLAY_MAX = 4096;
|
|
7
|
+
export const EXECUTION_RESULT_MAX = 256 * 1024;
|
|
8
|
+
/** Messages contain only field names we own, never an unexpected payload value. */
|
|
9
|
+
export class ExecutionValueError extends Error {
|
|
10
|
+
}
|
|
11
|
+
function invalid(field) {
|
|
12
|
+
throw new ExecutionValueError(`Invalid execution response: ${field}. No command was replayed.`);
|
|
13
|
+
}
|
|
14
|
+
export function executionComputerId(id) {
|
|
15
|
+
if (typeof id !== 'string' || !id.length || id.length > 256) {
|
|
16
|
+
throw new ExecutionValueError('Select a computer with use_computer or supply a computer_id of 1–256 characters.');
|
|
17
|
+
}
|
|
18
|
+
return id;
|
|
19
|
+
}
|
|
20
|
+
export function executionReadQuery(stdout, stderr, limit = EXECUTION_OUTPUT_DEFAULT) {
|
|
21
|
+
if (!Number.isSafeInteger(limit) || limit < 1 || limit > EXECUTION_OUTPUT_MAX) {
|
|
22
|
+
throw new ExecutionValueError(`limit must be an integer from 1 to ${EXECUTION_OUTPUT_MAX}.`);
|
|
23
|
+
}
|
|
24
|
+
for (const [field, value] of [
|
|
25
|
+
['stdout_offset', stdout],
|
|
26
|
+
['stderr_offset', stderr],
|
|
27
|
+
]) {
|
|
28
|
+
if (!Number.isSafeInteger(value) || value < 0 || value > Number.MAX_SAFE_INTEGER - limit) {
|
|
29
|
+
throw new ExecutionValueError(`${field} must be a safe nonnegative integer with room for limit.`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return { stdout_offset: stdout, stderr_offset: stderr, limit };
|
|
33
|
+
}
|
|
34
|
+
function record(value, executionId) {
|
|
35
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
36
|
+
invalid('expected an object');
|
|
37
|
+
const d = value;
|
|
38
|
+
if (!isExecutionId(d.execution_id) || d.execution_id !== executionId)
|
|
39
|
+
invalid('execution_id does not match the requested execution');
|
|
40
|
+
return d;
|
|
41
|
+
}
|
|
42
|
+
function integer(value, field) {
|
|
43
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value))
|
|
44
|
+
invalid(field);
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
function flag(value, field) {
|
|
48
|
+
if (typeof value !== 'boolean')
|
|
49
|
+
invalid(field);
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
function timestamp(value, field) {
|
|
53
|
+
if (typeof value !== 'string' || value.length > 35)
|
|
54
|
+
invalid(field);
|
|
55
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d{1,9})?(Z|[+-]\d{2}:\d{2})$/.exec(value);
|
|
56
|
+
if (!match || match[0] !== value || !Number.isFinite(Date.parse(value)))
|
|
57
|
+
invalid(field);
|
|
58
|
+
const year = Number(match[1]);
|
|
59
|
+
const month = Number(match[2]);
|
|
60
|
+
const day = Number(match[3]);
|
|
61
|
+
const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
62
|
+
const days = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
63
|
+
if (month < 1 ||
|
|
64
|
+
month > 12 ||
|
|
65
|
+
day < 1 ||
|
|
66
|
+
day > days[month - 1] ||
|
|
67
|
+
Number(match[4]) > 23 ||
|
|
68
|
+
Number(match[5]) > 59 ||
|
|
69
|
+
Number(match[6]) > 59)
|
|
70
|
+
invalid(field);
|
|
71
|
+
return value;
|
|
72
|
+
}
|
|
73
|
+
export function executionMetadata(value, computerId, executionId) {
|
|
74
|
+
const d = record(value, executionId);
|
|
75
|
+
if (d.computer_id !== computerId)
|
|
76
|
+
invalid('computer_id does not match the requested computer');
|
|
77
|
+
const pid = integer(d.pid, 'pid');
|
|
78
|
+
if (pid <= 0)
|
|
79
|
+
invalid('pid');
|
|
80
|
+
const started = timestamp(d.started_at, 'started_at');
|
|
81
|
+
if (d.output_source !== 'volatile_guest_files')
|
|
82
|
+
invalid('output_source');
|
|
83
|
+
if (d.status !== 'running' && d.status !== 'exited' && d.status !== 'lost')
|
|
84
|
+
invalid('status');
|
|
85
|
+
const identity = {
|
|
86
|
+
execution_id: executionId,
|
|
87
|
+
computer_id: computerId,
|
|
88
|
+
pid,
|
|
89
|
+
status: d.status,
|
|
90
|
+
started_at: started,
|
|
91
|
+
output_source: 'volatile_guest_files',
|
|
92
|
+
};
|
|
93
|
+
if (d.status === 'exited') {
|
|
94
|
+
return {
|
|
95
|
+
...identity,
|
|
96
|
+
ended_at: timestamp(d.ended_at, 'ended_at'),
|
|
97
|
+
exit_code: integer(d.exit_code, 'exit_code'),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if ('ended_at' in d || 'exit_code' in d)
|
|
101
|
+
invalid('non-exited state carries exit evidence');
|
|
102
|
+
return identity;
|
|
103
|
+
}
|
|
104
|
+
function bytes(value, field, max) {
|
|
105
|
+
if (typeof value !== 'string' ||
|
|
106
|
+
value.length > Math.ceil(max / 3) * 4 ||
|
|
107
|
+
!/^[A-Za-z0-9+/]*={0,2}$/.test(value) ||
|
|
108
|
+
value.length % 4 !== 0)
|
|
109
|
+
invalid(field);
|
|
110
|
+
const decoded = Buffer.from(value, 'base64');
|
|
111
|
+
if (decoded.length > max || decoded.toString('base64') !== value)
|
|
112
|
+
invalid(field);
|
|
113
|
+
return decoded;
|
|
114
|
+
}
|
|
115
|
+
/** No replacement characters, dropped BOM, split-character repair, or NUL in text. */
|
|
116
|
+
function present(name, data) {
|
|
117
|
+
try {
|
|
118
|
+
const decoded = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(data);
|
|
119
|
+
if (!data.some((byte) => (byte < 32 && ![9, 10, 13].includes(byte)) || byte === 127) &&
|
|
120
|
+
Buffer.from(decoded, 'utf8').equals(data)) {
|
|
121
|
+
return { [name]: decoded };
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
/* Preserve incomplete or non-text bytes exactly as base64. */
|
|
126
|
+
}
|
|
127
|
+
return { [`${name}_b64`]: data.toString('base64') };
|
|
128
|
+
}
|
|
129
|
+
export function executionOutput(value, executionId, query) {
|
|
130
|
+
const d = record(value, executionId);
|
|
131
|
+
const stdout = bytes(d.stdout_b64, 'stdout_b64', query.limit);
|
|
132
|
+
const stderr = bytes(d.stderr_b64, 'stderr_b64', query.limit);
|
|
133
|
+
const diagnostic = bytes(d.diagnostic_b64, 'diagnostic_b64', DIAGNOSTIC_AVAILABLE_MAX);
|
|
134
|
+
const outOffset = integer(d.stdout_offset, 'stdout_offset');
|
|
135
|
+
const errOffset = integer(d.stderr_offset, 'stderr_offset');
|
|
136
|
+
if (outOffset !== query.stdout_offset + stdout.length)
|
|
137
|
+
invalid('stdout_offset does not match decoded bytes');
|
|
138
|
+
if (errOffset !== query.stderr_offset + stderr.length)
|
|
139
|
+
invalid('stderr_offset does not match decoded bytes');
|
|
140
|
+
const outMore = flag(d.stdout_more, 'stdout_more');
|
|
141
|
+
const errMore = flag(d.stderr_more, 'stderr_more');
|
|
142
|
+
if ((outMore && stdout.length !== query.limit) || (errMore && stderr.length !== query.limit))
|
|
143
|
+
invalid('more flag without a full stream chunk');
|
|
144
|
+
const prefix = diagnostic.subarray(0, DIAGNOSTIC_DISPLAY_MAX);
|
|
145
|
+
return {
|
|
146
|
+
execution_id: executionId,
|
|
147
|
+
...present('stdout', stdout),
|
|
148
|
+
...present('stderr', stderr),
|
|
149
|
+
stdout_bytes: stdout.length,
|
|
150
|
+
stderr_bytes: stderr.length,
|
|
151
|
+
stdout_offset: outOffset,
|
|
152
|
+
stderr_offset: errOffset,
|
|
153
|
+
stdout_more: outMore,
|
|
154
|
+
stderr_more: errMore,
|
|
155
|
+
...present('diagnostic', prefix),
|
|
156
|
+
diagnostic_available_bytes: diagnostic.length,
|
|
157
|
+
diagnostic_displayed_bytes: prefix.length,
|
|
158
|
+
diagnostic_display_truncated: prefix.length < diagnostic.length,
|
|
159
|
+
diagnostic_truncated: flag(d.diagnostic_truncated, 'diagnostic_truncated'),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=executions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executions.js","sourceRoot":"","sources":["../src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