mandala-computer-mcp 0.5.0 → 0.6.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 +119 -11
- package/dist/api.d.ts +47 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +248 -22
- package/dist/api.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +17 -0
- package/dist/cli.js.map +1 -1
- package/dist/errors.d.ts +93 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +166 -7
- package/dist/errors.js.map +1 -1
- package/dist/format.d.ts +25 -0
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +31 -2
- package/dist/format.js.map +1 -1
- package/dist/http.d.ts +42 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +379 -3
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +10 -2
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +15 -5
- package/dist/paths.js.map +1 -1
- package/dist/secret-errors.d.ts +59 -0
- package/dist/secret-errors.d.ts.map +1 -0
- package/dist/secret-errors.js +199 -0
- package/dist/secret-errors.js.map +1 -0
- package/dist/secret-store.d.ts +115 -0
- package/dist/secret-store.d.ts.map +1 -0
- package/dist/secret-store.js +105 -0
- package/dist/secret-store.js.map +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/session.d.ts +6 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +1 -1
- package/dist/session.js.map +1 -1
- package/dist/tool-filters.d.ts +1 -1
- package/dist/tool-filters.d.ts.map +1 -1
- package/dist/tool-filters.js +9 -1
- package/dist/tool-filters.js.map +1 -1
- package/dist/tools/computers.d.ts.map +1 -1
- package/dist/tools/computers.js +11 -10
- package/dist/tools/computers.js.map +1 -1
- package/dist/tools/guest.d.ts.map +1 -1
- package/dist/tools/guest.js +134 -20
- package/dist/tools/guest.js.map +1 -1
- package/dist/tools/input.d.ts +2 -0
- package/dist/tools/input.d.ts.map +1 -1
- package/dist/tools/input.js +31 -5
- package/dist/tools/input.js.map +1 -1
- package/dist/tools/secrets.d.ts +33 -13
- package/dist/tools/secrets.d.ts.map +1 -1
- package/dist/tools/secrets.js +259 -15
- package/dist/tools/secrets.js.map +1 -1
- package/dist/tools/snapshots.d.ts.map +1 -1
- package/dist/tools/snapshots.js +9 -3
- package/dist/tools/snapshots.js.map +1 -1
- package/dist/tools/webhooks.js +1 -1
- package/dist/tools/webhooks.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAoB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEhF,MAAM,KAAK,GAAG;;;;;;;;;;;iCAWmB,gBAAgB;;;;;;;;;;;;;;qCAcZ,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO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,CAAC;IACD,MAAM,QAAQ,CAAC;QACb,GAAG,IAAI;QACP,MAAM,EAAE,QAAQ;QAChB,0EAA0E;QAC1E,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;QAC3C,wEAAwE;QACxE,OAAO,EAAE,KAAK,CAAC,OAA6B;KAC7C,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,SAAiB,EAAE,GAAuB;IACrE,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,IAAI,CAAC;QACH,OAAO,SAAS,KAAK,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,kEAAkE;QAClE,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnD,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,GAAG,YAAY,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -21,6 +21,13 @@ export interface APIErrorMetadata {
|
|
|
21
21
|
requestId?: string;
|
|
22
22
|
allow?: string;
|
|
23
23
|
wwwAuthenticate?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The HTTP method of the request that was refused, when known. Read by
|
|
26
|
+
* {@link isTransient} for one status: a `503` answered to a change may or may
|
|
27
|
+
* not have been acted on, so only a request that is safe to repeat is
|
|
28
|
+
* transient on it.
|
|
29
|
+
*/
|
|
30
|
+
method?: string;
|
|
24
31
|
}
|
|
25
32
|
export declare class APIError extends MandalaError {
|
|
26
33
|
readonly status: number;
|
|
@@ -48,6 +55,8 @@ export declare class APIError extends MandalaError {
|
|
|
48
55
|
readonly allow?: string;
|
|
49
56
|
/** The received WWW-Authenticate header, when supplied. */
|
|
50
57
|
readonly wwwAuthenticate?: string;
|
|
58
|
+
/** The method of the refused request, upper case, when known. */
|
|
59
|
+
readonly method?: string;
|
|
51
60
|
constructor(message: string, status: number, body?: unknown | undefined,
|
|
52
61
|
/** Parsed Retry-After delay in milliseconds; absent when missing or invalid. */
|
|
53
62
|
retryAfterMs?: number | undefined, metadata?: APIErrorMetadata);
|
|
@@ -200,6 +209,71 @@ export declare class MoveRequiredError extends ConflictError {
|
|
|
200
209
|
/** Whether a host in this region could run the size that was asked for. */
|
|
201
210
|
movePossible: boolean, retryAfterMs?: number, metadata?: APIErrorMetadata);
|
|
202
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* The 409 a create-only upload gets when the path is already taken.
|
|
214
|
+
*
|
|
215
|
+
* `PUT /computers/{id}/files?overwrite=false` creates the file only if nothing
|
|
216
|
+
* is at `path`. When something is, the answer is 409 with `reason: "exists"` and
|
|
217
|
+
* THIS request wrote nothing — an earlier attempt whose answer was lost may have
|
|
218
|
+
* written the file itself. Its own class for the reason {@link MoveRequiredError}
|
|
219
|
+
* has one: it is a {@link ConflictError} by status and the opposite of one by
|
|
220
|
+
* nature — it clears only when the caller decides, never by waiting — so
|
|
221
|
+
* {@link isTransient} says no to it. A subclass, so `instanceof ConflictError`
|
|
222
|
+
* written before this existed still catches it.
|
|
223
|
+
*
|
|
224
|
+
* Raised only for the platform's explicit `reason: "exists"`, so the class is
|
|
225
|
+
* the claim: something is at the path. A create-only 409 whose reason could
|
|
226
|
+
* not be read is {@link CreateOnlyConflictError} instead, which claims nothing
|
|
227
|
+
* about the path.
|
|
228
|
+
*/
|
|
229
|
+
export declare class FileExistsError extends ConflictError {
|
|
230
|
+
name: string;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* A create-only upload refused with 409 whose reason could not be read.
|
|
234
|
+
*
|
|
235
|
+
* `PUT /computers/{id}/files?overwrite=false` is answered 409 `exists`
|
|
236
|
+
* ({@link FileExistsError}) or 409 `unsupported` when it is refused. A 409 can
|
|
237
|
+
* also arrive with no usable reason: the body interrupted, empty, a proxy's
|
|
238
|
+
* page instead of the platform's JSON, or JSON whose `reason` is missing, not a
|
|
239
|
+
* string, or blank. {@link Api} raises that refusal as this class (see
|
|
240
|
+
* {@link createOnlyRefusal}), with {@link APIError.reason} `undefined` and a
|
|
241
|
+
* message saying the reason is unknown. It does NOT say the path is taken, and
|
|
242
|
+
* it does not say whether the write landed.
|
|
243
|
+
*
|
|
244
|
+
* Final, not transient: {@link isTransient} says no to it. Sending the same
|
|
245
|
+
* create-only write again repeats a refusal that was not said to clear, and a
|
|
246
|
+
* delayed retry after the path is cleared could create the file when no one
|
|
247
|
+
* expected it. Read the path to find out what is there before deciding. The
|
|
248
|
+
* raw body stays on {@link APIError.body} for diagnostics. A subclass of
|
|
249
|
+
* {@link ConflictError}, so `instanceof ConflictError` still catches it.
|
|
250
|
+
*/
|
|
251
|
+
export declare class CreateOnlyConflictError extends ConflictError {
|
|
252
|
+
name: string;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* A create-only upload's 409, never left looking like a passing conflict.
|
|
256
|
+
*
|
|
257
|
+
* Applied by {@link Api} to every `PUT computers/:id/files` sent with
|
|
258
|
+
* `overwrite=false`, so an embedder's {@link isTransient} and this server's
|
|
259
|
+
* tools give one answer. The platform's taken path is 409 `exists`, which
|
|
260
|
+
* {@link errorForStatus} already maps to {@link FileExistsError}. A 409 without
|
|
261
|
+
* a usable word — the body lost, empty, a proxy's page, or JSON whose `reason`
|
|
262
|
+
* is missing, not a string, or blank — would otherwise be a bare
|
|
263
|
+
* {@link ConflictError} that {@link isTransient} calls worth sending again: a
|
|
264
|
+
* retry of a refusal that does not clear, and one that could create the file
|
|
265
|
+
* later if the path were cleared in between. So it is a
|
|
266
|
+
* {@link CreateOnlyConflictError} here, final, with a neutral message: not the
|
|
267
|
+
* body's own text, which could say "already exists" without the `exists`
|
|
268
|
+
* reason. The body stays on the error for diagnostics. A 409 that DID carry a
|
|
269
|
+
* string reason keeps the platform's classification, whatever the word.
|
|
270
|
+
*/
|
|
271
|
+
export declare function createOnlyRefusal(err: APIError): APIError;
|
|
272
|
+
/**
|
|
273
|
+
* Whether this request is a create-only upload: `PUT computers/:id/files` with
|
|
274
|
+
* `overwrite=false`. The only request {@link createOnlyRefusal} applies to.
|
|
275
|
+
*/
|
|
276
|
+
export declare function isCreateOnlyUpload(method: string, path: string, query: Record<string, string | number | boolean | undefined> | undefined): boolean;
|
|
203
277
|
/**
|
|
204
278
|
* 416 — the `Range` named no byte the file has.
|
|
205
279
|
*
|
|
@@ -239,10 +313,25 @@ export declare class RateLimitError extends APIError {
|
|
|
239
313
|
/** From `Retry-After`, in milliseconds from now, when the response sent one. */
|
|
240
314
|
retryAfterMs?: number, metadata?: APIErrorMetadata);
|
|
241
315
|
}
|
|
242
|
-
/**
|
|
316
|
+
/**
|
|
317
|
+
* 503 — something the request depends on (a hypervisor, a store, a host's
|
|
318
|
+
* capacity) could not answer or take it right now.
|
|
319
|
+
*
|
|
320
|
+
* A READ answered 503 can be asked again shortly. A CHANGE answered 503 may or
|
|
321
|
+
* may not have happened: the platform answers a failure after the request was
|
|
322
|
+
* sent the same way, with or without a warning in the message. So
|
|
323
|
+
* {@link isTransient} calls a 503 worth repeating only for a request that is
|
|
324
|
+
* safe to repeat — a GET or HEAD, see {@link REPEATABLE_METHODS} — and any
|
|
325
|
+
* change has its current state read before it is sent again.
|
|
326
|
+
*/
|
|
243
327
|
export declare class UnavailableError extends APIError {
|
|
244
328
|
name: string;
|
|
245
329
|
}
|
|
330
|
+
/**
|
|
331
|
+
* Whether a `503` leaves the request's outcome unknown: it was a change, or its
|
|
332
|
+
* method was not recorded.
|
|
333
|
+
*/
|
|
334
|
+
export declare function outcomeUnknownOn503(err: unknown): boolean;
|
|
246
335
|
/**
|
|
247
336
|
* The request was given up on before the platform answered.
|
|
248
337
|
*
|
|
@@ -505,7 +594,9 @@ export declare function errorForStatus(status: number, message: string, body?: u
|
|
|
505
594
|
* - {@link ConflictError} — something is in flight that this cannot run
|
|
506
595
|
* alongside, minus the one that is a decision
|
|
507
596
|
* - {@link RateLimitError} — a cadence, and the response usually says how long
|
|
508
|
-
* - {@link UnavailableError} —
|
|
597
|
+
* - {@link UnavailableError} — something briefly out of reach, for a GET or
|
|
598
|
+
* HEAD only. Any change answered 503 may have happened, so it is not
|
|
599
|
+
* transient, whatever `reason` it carries
|
|
509
600
|
* - {@link ConnectivityError} — the request never left
|
|
510
601
|
*
|
|
511
602
|
* That last line is now literally true, and it was not always. The class used
|
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,+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;
|
|
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,C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
|
44
44
|
/** The received WWW-Authenticate header, when supplied. */
|
|
45
45
|
wwwAuthenticate;
|
|
46
|
+
/** The method of the refused request, upper case, when known. */
|
|
47
|
+
method;
|
|
46
48
|
constructor(message, status, body,
|
|
47
49
|
/** Parsed Retry-After delay in milliseconds; absent when missing or invalid. */
|
|
48
50
|
retryAfterMs, metadata) {
|
|
@@ -55,6 +57,7 @@ export class APIError extends MandalaError {
|
|
|
55
57
|
nonblank(metadata?.requestId) ?? (record(body) ? nonblank(body.request_id) : undefined);
|
|
56
58
|
this.allow = nonblank(metadata?.allow);
|
|
57
59
|
this.wwwAuthenticate = nonblank(metadata?.wwwAuthenticate);
|
|
60
|
+
this.method = nonblank(metadata?.method)?.toUpperCase();
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
63
|
/**
|
|
@@ -79,7 +82,21 @@ const REASON_CLEARS = new Set(['contention', 'starting']);
|
|
|
79
82
|
* nothing changes today. What changes is that a future status for this refusal
|
|
80
83
|
* cannot quietly make it look replayable.
|
|
81
84
|
*/
|
|
82
|
-
|
|
85
|
+
/**
|
|
86
|
+
* `exists` is a create-only upload (`write_file` with `overwrite: false`)
|
|
87
|
+
* refused because something is already at the path (platform OPL-4994). Nothing
|
|
88
|
+
* was written, and the same request answers the same way until whatever is there
|
|
89
|
+
* is moved or the caller agrees to replace it — so it is permanent, and has to be
|
|
90
|
+
* said: without it this would be an ordinary {@link ConflictError}, which
|
|
91
|
+
* {@link isTransient} calls worth sending again. {@link FileExistsError} is the
|
|
92
|
+
* class it arrives as.
|
|
93
|
+
*/
|
|
94
|
+
const REASON_PERMANENT = new Set([
|
|
95
|
+
'unavailable',
|
|
96
|
+
'unsupported',
|
|
97
|
+
'revoked',
|
|
98
|
+
'exists',
|
|
99
|
+
]);
|
|
83
100
|
/**
|
|
84
101
|
* How a refusal the platform classified behaves, or `undefined` for a word this
|
|
85
102
|
* version has no opinion about.
|
|
@@ -136,7 +153,10 @@ export function reasonAdvice(reason) {
|
|
|
136
153
|
case 'contention':
|
|
137
154
|
return 'something was in flight; the same call works once it finishes, so this one is worth sending again';
|
|
138
155
|
case 'starting':
|
|
139
|
-
|
|
156
|
+
// The boot window is bounded (OPL-5025): two minutes from a start, a
|
|
157
|
+
// restart, or a reboot inside the guest. An agent still silent after it
|
|
158
|
+
// is answered 502 instead, which is not this word and not this advice.
|
|
159
|
+
return 'the guest agent has not answered yet and the computer is still inside its boot window (about two minutes after a start, a restart or a reboot inside the guest), so this is worth sending again in a moment. A guest agent still silent after that window is answered 502 instead, which waiting alone does not fix';
|
|
140
160
|
case 'unavailable':
|
|
141
161
|
// Softened from "does NOT clear by waiting", which was false of exactly
|
|
142
162
|
// the case OPL-4631 is about and is the sentence a model actually sees:
|
|
@@ -148,6 +168,11 @@ export function reasonAdvice(reason) {
|
|
|
148
168
|
return 'the computer is not running; if nothing is starting it this will not clear on its own and start_computer is the fix, and if a start is already under way wait_for_computer says so without starting a second one';
|
|
149
169
|
case 'unsupported':
|
|
150
170
|
return 'this computer cannot do it at all, so do not retry it — the answer is the same forever';
|
|
171
|
+
case 'exists':
|
|
172
|
+
// Only THIS attempt is known to have written nothing: a create-only
|
|
173
|
+
// write whose earlier attempt lost its answer may have written the file
|
|
174
|
+
// itself, and the retry meets that file here.
|
|
175
|
+
return 'something is already at that path and this attempt wrote nothing. This does not clear by waiting. If an earlier attempt\u2019s outcome was unknown, the file may be yours: read it and compare before choosing another path or overwriting (without overwrite: false, a write replaces it)';
|
|
151
176
|
case 'revoked':
|
|
152
177
|
// Reached only on a status statusAdvice has no sentence for, because the
|
|
153
178
|
// formatter asks that one first and the platform sends this word on 401 and
|
|
@@ -304,6 +329,97 @@ export class MoveRequiredError extends ConflictError {
|
|
|
304
329
|
this.movePossible = movePossible;
|
|
305
330
|
}
|
|
306
331
|
}
|
|
332
|
+
/**
|
|
333
|
+
* The 409 a create-only upload gets when the path is already taken.
|
|
334
|
+
*
|
|
335
|
+
* `PUT /computers/{id}/files?overwrite=false` creates the file only if nothing
|
|
336
|
+
* is at `path`. When something is, the answer is 409 with `reason: "exists"` and
|
|
337
|
+
* THIS request wrote nothing — an earlier attempt whose answer was lost may have
|
|
338
|
+
* written the file itself. Its own class for the reason {@link MoveRequiredError}
|
|
339
|
+
* has one: it is a {@link ConflictError} by status and the opposite of one by
|
|
340
|
+
* nature — it clears only when the caller decides, never by waiting — so
|
|
341
|
+
* {@link isTransient} says no to it. A subclass, so `instanceof ConflictError`
|
|
342
|
+
* written before this existed still catches it.
|
|
343
|
+
*
|
|
344
|
+
* Raised only for the platform's explicit `reason: "exists"`, so the class is
|
|
345
|
+
* the claim: something is at the path. A create-only 409 whose reason could
|
|
346
|
+
* not be read is {@link CreateOnlyConflictError} instead, which claims nothing
|
|
347
|
+
* about the path.
|
|
348
|
+
*/
|
|
349
|
+
export class FileExistsError extends ConflictError {
|
|
350
|
+
name = 'FileExistsError';
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* A create-only upload refused with 409 whose reason could not be read.
|
|
354
|
+
*
|
|
355
|
+
* `PUT /computers/{id}/files?overwrite=false` is answered 409 `exists`
|
|
356
|
+
* ({@link FileExistsError}) or 409 `unsupported` when it is refused. A 409 can
|
|
357
|
+
* also arrive with no usable reason: the body interrupted, empty, a proxy's
|
|
358
|
+
* page instead of the platform's JSON, or JSON whose `reason` is missing, not a
|
|
359
|
+
* string, or blank. {@link Api} raises that refusal as this class (see
|
|
360
|
+
* {@link createOnlyRefusal}), with {@link APIError.reason} `undefined` and a
|
|
361
|
+
* message saying the reason is unknown. It does NOT say the path is taken, and
|
|
362
|
+
* it does not say whether the write landed.
|
|
363
|
+
*
|
|
364
|
+
* Final, not transient: {@link isTransient} says no to it. Sending the same
|
|
365
|
+
* create-only write again repeats a refusal that was not said to clear, and a
|
|
366
|
+
* delayed retry after the path is cleared could create the file when no one
|
|
367
|
+
* expected it. Read the path to find out what is there before deciding. The
|
|
368
|
+
* raw body stays on {@link APIError.body} for diagnostics. A subclass of
|
|
369
|
+
* {@link ConflictError}, so `instanceof ConflictError` still catches it.
|
|
370
|
+
*/
|
|
371
|
+
export class CreateOnlyConflictError extends ConflictError {
|
|
372
|
+
name = 'CreateOnlyConflictError';
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* A create-only upload's 409, never left looking like a passing conflict.
|
|
376
|
+
*
|
|
377
|
+
* Applied by {@link Api} to every `PUT computers/:id/files` sent with
|
|
378
|
+
* `overwrite=false`, so an embedder's {@link isTransient} and this server's
|
|
379
|
+
* tools give one answer. The platform's taken path is 409 `exists`, which
|
|
380
|
+
* {@link errorForStatus} already maps to {@link FileExistsError}. A 409 without
|
|
381
|
+
* a usable word — the body lost, empty, a proxy's page, or JSON whose `reason`
|
|
382
|
+
* is missing, not a string, or blank — would otherwise be a bare
|
|
383
|
+
* {@link ConflictError} that {@link isTransient} calls worth sending again: a
|
|
384
|
+
* retry of a refusal that does not clear, and one that could create the file
|
|
385
|
+
* later if the path were cleared in between. So it is a
|
|
386
|
+
* {@link CreateOnlyConflictError} here, final, with a neutral message: not the
|
|
387
|
+
* body's own text, which could say "already exists" without the `exists`
|
|
388
|
+
* reason. The body stays on the error for diagnostics. A 409 that DID carry a
|
|
389
|
+
* string reason keeps the platform's classification, whatever the word.
|
|
390
|
+
*/
|
|
391
|
+
export function createOnlyRefusal(err) {
|
|
392
|
+
if (!(err instanceof ConflictError) || err instanceof FileExistsError)
|
|
393
|
+
return err;
|
|
394
|
+
if (err instanceof CreateOnlyConflictError)
|
|
395
|
+
return err;
|
|
396
|
+
if (typeof err.reason === 'string' && err.reason.trim() !== '')
|
|
397
|
+
return err;
|
|
398
|
+
const refusal = new CreateOnlyConflictError('a create-only upload was refused as a conflict, reason unknown: the 409 carried no ' +
|
|
399
|
+
'reason that could be read, so whether the path is taken was not said; treat it as ' +
|
|
400
|
+
'final rather than sending the same write again', err.status, err.body, err.retryAfterMs, {
|
|
401
|
+
requestId: err.requestId,
|
|
402
|
+
allow: err.allow,
|
|
403
|
+
wwwAuthenticate: err.wwwAuthenticate,
|
|
404
|
+
method: err.method,
|
|
405
|
+
});
|
|
406
|
+
// The constructor reads the body again, and would keep a blank word. Unknown
|
|
407
|
+
// is `undefined`, as documented on CreateOnlyConflictError.
|
|
408
|
+
refusal.reason = undefined;
|
|
409
|
+
return refusal;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Whether this request is a create-only upload: `PUT computers/:id/files` with
|
|
413
|
+
* `overwrite=false`. The only request {@link createOnlyRefusal} applies to.
|
|
414
|
+
*/
|
|
415
|
+
export function isCreateOnlyUpload(method, path, query) {
|
|
416
|
+
if (method.toUpperCase() !== 'PUT')
|
|
417
|
+
return false;
|
|
418
|
+
if (!/^\/?computers\/[^/]+\/files$/.test(path))
|
|
419
|
+
return false;
|
|
420
|
+
const overwrite = query?.overwrite;
|
|
421
|
+
return overwrite === false || overwrite === 'false';
|
|
422
|
+
}
|
|
307
423
|
/**
|
|
308
424
|
* The `move` object the platform puts on the refusal above, if this body has one.
|
|
309
425
|
*
|
|
@@ -368,10 +484,36 @@ export class RateLimitError extends APIError {
|
|
|
368
484
|
super(message, status, body, retryAfterMs, metadata);
|
|
369
485
|
}
|
|
370
486
|
}
|
|
371
|
-
/**
|
|
487
|
+
/**
|
|
488
|
+
* 503 — something the request depends on (a hypervisor, a store, a host's
|
|
489
|
+
* capacity) could not answer or take it right now.
|
|
490
|
+
*
|
|
491
|
+
* A READ answered 503 can be asked again shortly. A CHANGE answered 503 may or
|
|
492
|
+
* may not have happened: the platform answers a failure after the request was
|
|
493
|
+
* sent the same way, with or without a warning in the message. So
|
|
494
|
+
* {@link isTransient} calls a 503 worth repeating only for a request that is
|
|
495
|
+
* safe to repeat — a GET or HEAD, see {@link REPEATABLE_METHODS} — and any
|
|
496
|
+
* change has its current state read before it is sent again.
|
|
497
|
+
*/
|
|
372
498
|
export class UnavailableError extends APIError {
|
|
373
499
|
name = 'UnavailableError';
|
|
374
500
|
}
|
|
501
|
+
/**
|
|
502
|
+
* The methods a `503` leaves safe to send again: the two reads.
|
|
503
|
+
*
|
|
504
|
+
* Every other method is a change, and the platform documents that a change
|
|
505
|
+
* answered `503` may or may not have happened. PUT and DELETE are idempotent in
|
|
506
|
+
* HTTP's terms, but "may have happened" still means the caller reads the state
|
|
507
|
+
* rather than replaying blind — the answer the TypeScript and Python SDKs give.
|
|
508
|
+
*/
|
|
509
|
+
const REPEATABLE_METHODS = new Set(['GET', 'HEAD']);
|
|
510
|
+
/**
|
|
511
|
+
* Whether a `503` leaves the request's outcome unknown: it was a change, or its
|
|
512
|
+
* method was not recorded.
|
|
513
|
+
*/
|
|
514
|
+
export function outcomeUnknownOn503(err) {
|
|
515
|
+
return err instanceof UnavailableError && !(err.method && REPEATABLE_METHODS.has(err.method));
|
|
516
|
+
}
|
|
375
517
|
/**
|
|
376
518
|
* The request was given up on before the platform answered.
|
|
377
519
|
*
|
|
@@ -773,6 +915,10 @@ export function errorForStatus(status, message, body, retryAfterMs, metadata) {
|
|
|
773
915
|
const offer = moveOffer(body);
|
|
774
916
|
if (offer)
|
|
775
917
|
return new MoveRequiredError(message, status, body, offer.possible, retryAfterMs, metadata);
|
|
918
|
+
// The create-only upload whose path was taken, told apart by the platform's
|
|
919
|
+
// word rather than by its sentence.
|
|
920
|
+
if (refusalReason(body) === 'exists')
|
|
921
|
+
return new FileExistsError(message, status, body, retryAfterMs, metadata);
|
|
776
922
|
}
|
|
777
923
|
if (status === 416) {
|
|
778
924
|
return new RangeNotSatisfiableError(message, status, body, undefined, retryAfterMs, metadata);
|
|
@@ -830,7 +976,9 @@ export function errorForStatus(status, message, body, retryAfterMs, metadata) {
|
|
|
830
976
|
* - {@link ConflictError} — something is in flight that this cannot run
|
|
831
977
|
* alongside, minus the one that is a decision
|
|
832
978
|
* - {@link RateLimitError} — a cadence, and the response usually says how long
|
|
833
|
-
* - {@link UnavailableError} —
|
|
979
|
+
* - {@link UnavailableError} — something briefly out of reach, for a GET or
|
|
980
|
+
* HEAD only. Any change answered 503 may have happened, so it is not
|
|
981
|
+
* transient, whatever `reason` it carries
|
|
834
982
|
* - {@link ConnectivityError} — the request never left
|
|
835
983
|
*
|
|
836
984
|
* That last line is now literally true, and it was not always. The class used
|
|
@@ -898,13 +1046,23 @@ export function isTransient(err) {
|
|
|
898
1046
|
// First, because it is a subclass of the very branch below that would say yes
|
|
899
1047
|
// (OPL-3775). An embedder wrapping a resize in `if (isTransient(err)) retry()`
|
|
900
1048
|
// is the caller this line is for.
|
|
901
|
-
if (err instanceof MoveRequiredError
|
|
1049
|
+
if (err instanceof MoveRequiredError ||
|
|
1050
|
+
err instanceof FileExistsError ||
|
|
1051
|
+
err instanceof CreateOnlyConflictError)
|
|
902
1052
|
return false;
|
|
903
1053
|
// A lost RESPONSE is not a request that never left, and only one of the two
|
|
904
1054
|
// is safe to replay blind. Same shape as the line above and the same reason:
|
|
905
1055
|
// a subclass of a branch below that would otherwise say yes (OPL-3855).
|
|
906
1056
|
if (err instanceof ConnectivityInterruptedError)
|
|
907
1057
|
return false;
|
|
1058
|
+
// A 503 is a passing moment for a read and an unknown outcome for a change
|
|
1059
|
+
// (OPL-5026): the platform answers a failure after the request was sent the
|
|
1060
|
+
// same way. Decided BEFORE the reason word, which is about the computer and
|
|
1061
|
+
// cannot say whether this request's change landed — a `contention` on a
|
|
1062
|
+
// create's 503 must not make the create look safe to replay. Anything but a
|
|
1063
|
+
// GET or HEAD, or a request whose method was not recorded, is not replayed.
|
|
1064
|
+
if (err instanceof UnavailableError)
|
|
1065
|
+
return !outcomeUnknownOn503(err);
|
|
908
1066
|
// The platform's own word, ahead of the types below, because it is the more
|
|
909
1067
|
// specific answer and it is the one that tells the 409 that never clears from
|
|
910
1068
|
// the two that do (OPL-3898). Only an APIError carries a shape-checked one:
|
|
@@ -922,7 +1080,6 @@ export function isTransient(err) {
|
|
|
922
1080
|
}
|
|
923
1081
|
return (err instanceof ConflictError ||
|
|
924
1082
|
err instanceof RateLimitError ||
|
|
925
|
-
err instanceof UnavailableError ||
|
|
926
1083
|
err instanceof ConnectivityError);
|
|
927
1084
|
}
|
|
928
1085
|
/**
|
|
@@ -1034,7 +1191,9 @@ export function isTransient(err) {
|
|
|
1034
1191
|
export function isTransientForPoll(err) {
|
|
1035
1192
|
if (!(err instanceof APIError) && !(err instanceof ConnectivityError))
|
|
1036
1193
|
return false;
|
|
1037
|
-
if (err instanceof MoveRequiredError
|
|
1194
|
+
if (err instanceof MoveRequiredError ||
|
|
1195
|
+
err instanceof FileExistsError ||
|
|
1196
|
+
err instanceof CreateOnlyConflictError)
|
|
1038
1197
|
return false;
|
|
1039
1198
|
if (err instanceof OriginTLSError)
|
|
1040
1199
|
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;AASD,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAsB,EAAE,CACtD,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,MAAM,MAAM,GAAG,CAAC,KAAc,EAAoC,EAAE,CAClE,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEvE,MAAM,OAAO,QAAS,SAAQ,YAAY;IAwB7B;IACA;IAEA;IA1BF,IAAI,GAAG,UAAU,CAAC;IAC3B;;;;;;;;;;;;OAYG;IACM,MAAM,CAAU;IACzB,mFAAmF;IAC1E,SAAS,CAAU;IAC5B,gDAAgD;IACvC,KAAK,CAAU;IACxB,2DAA2D;IAClD,eAAe,CAAU;IAClC,YACE,OAAe,EACN,MAAc,E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uBAAuB;QAEtC,OAAO,KAAK,CAAC;IACf,IAAI,GAAG,YAAY,cAAc;QAAE,OAAO,KAAK,CAAC;IAChD,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;QAC5B,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG;YAAE,OAAO,KAAK,CAAC;QACrC,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,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"}
|
package/dist/format.d.ts
CHANGED
|
@@ -61,6 +61,14 @@ export declare function errorMetadata(source: APIError | Record<string, unknown>
|
|
|
61
61
|
export declare function withErrorMetadata(result: CallToolResult, source: APIError | Record<string, unknown>): CallToolResult;
|
|
62
62
|
/** Keep scalar error prose, without displaying a serialized response body as its message. */
|
|
63
63
|
export declare function apiErrorMessage(error: APIError): string;
|
|
64
|
+
/**
|
|
65
|
+
* What to tell a model about a `503`, or `undefined` for anything else.
|
|
66
|
+
*
|
|
67
|
+
* Two answers, told apart by the request's method, and the same split
|
|
68
|
+
* isTransient makes: a GET or HEAD can be sent again shortly; any change may
|
|
69
|
+
* already have happened, so the current state is read first.
|
|
70
|
+
*/
|
|
71
|
+
export declare function unavailableAdvice(err: APIError): string | undefined;
|
|
64
72
|
/** A model-visible refusal. A projected run failure must withhold reason-based replay advice. */
|
|
65
73
|
export declare function failed(err: unknown, includeReasonAdvice?: boolean): CallToolResult;
|
|
66
74
|
/** Run a tool body, turning anything it throws into a result the model can read. */
|
|
@@ -121,6 +129,23 @@ export type Computer = {
|
|
|
121
129
|
* wrote before reading the computer back. See `nothingAdmitted`.
|
|
122
130
|
*/
|
|
123
131
|
running_ram_mb?: number;
|
|
132
|
+
/**
|
|
133
|
+
* The secrets bound to this computer, as references (secret id, the revision
|
|
134
|
+
* last delivered, and exactly one of `env` or `file`). Never a value. The
|
|
135
|
+
* whole `secrets*` group is absent on a computer that holds none.
|
|
136
|
+
*/
|
|
137
|
+
secrets?: unknown[];
|
|
138
|
+
/**
|
|
139
|
+
* Whether the desktop is missing a change to its secrets that a restart would
|
|
140
|
+
* deliver. Three answers: `true` (a restart delivers it), `false` (nothing
|
|
141
|
+
* pending), and `null` — the platform could not check, which is not `false`.
|
|
142
|
+
* Only ever true of a running or suspended computer.
|
|
143
|
+
*/
|
|
144
|
+
secrets_pending?: boolean | null;
|
|
145
|
+
/** Why the last delivering start was stopped, in one fixed sentence. Never a value. */
|
|
146
|
+
secrets_error?: string;
|
|
147
|
+
secrets_generation?: number;
|
|
148
|
+
secrets_applied?: unknown;
|
|
124
149
|
vnc?: Record<string, unknown>;
|
|
125
150
|
};
|
|
126
151
|
/**
|
package/dist/format.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EACL,QAAQ,EAOT,MAAM,aAAa,CAAC;AAErB,2BAA2B;AAC3B,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,KAAG,cAA4D,CAAC;AAE9F,6FAA6F;AAC7F,eAAO,MAAM,IAAI,GAAI,GAAG,OAAO,KAAG,cAAkD,CAAC;AAErF,yDAAyD;AACzD,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,EAAE,IAAI,OAAO,KAAG,cAC0B,CAAC;AAE5E;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO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AC,CAAC;CAC/B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,GAAG,OAAO,CAMpD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAgBtD;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAGxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAUjF;AAED,6DAA6D;AAC7D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,GAAG,MAAM,CAuB5C"}
|
package/dist/format.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APIError, MandalaError, platformSaid, reasonAdvice, statusAdvice } from './errors.js';
|
|
1
|
+
import { APIError, MandalaError, outcomeUnknownOn503, platformSaid, reasonAdvice, statusAdvice, UnavailableError, } from './errors.js';
|
|
2
2
|
/** A plain text result. */
|
|
3
3
|
export const text = (s) => ({ content: [{ type: 'text', text: s }] });
|
|
4
4
|
/** A JSON result, pretty-printed — models read indented JSON more reliably than one line. */
|
|
@@ -129,6 +129,20 @@ export function apiErrorMessage(error) {
|
|
|
129
129
|
return `HTTP ${error.status}`;
|
|
130
130
|
return error.message;
|
|
131
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* What to tell a model about a `503`, or `undefined` for anything else.
|
|
134
|
+
*
|
|
135
|
+
* Two answers, told apart by the request's method, and the same split
|
|
136
|
+
* isTransient makes: a GET or HEAD can be sent again shortly; any change may
|
|
137
|
+
* already have happened, so the current state is read first.
|
|
138
|
+
*/
|
|
139
|
+
export function unavailableAdvice(err) {
|
|
140
|
+
if (!(err instanceof UnavailableError))
|
|
141
|
+
return undefined;
|
|
142
|
+
return outcomeUnknownOn503(err)
|
|
143
|
+
? 'something this depends on could not answer right now, and THIS CHANGE MAY OR MAY NOT HAVE HAPPENED: a failure after the request was sent is answered the same way. Read the current state before sending it again — repeating a create, a command, a clone or a snapshot blind can do it twice'
|
|
144
|
+
: 'something this depends on could not answer right now; the same request can be sent again shortly';
|
|
145
|
+
}
|
|
132
146
|
/** A model-visible refusal. A projected run failure must withhold reason-based replay advice. */
|
|
133
147
|
export function failed(err, includeReasonAdvice = true) {
|
|
134
148
|
const message = err instanceof APIError
|
|
@@ -158,8 +172,14 @@ export function failed(err, includeReasonAdvice = true) {
|
|
|
158
172
|
// call works once it finishes", which is exactly the replay this is here to
|
|
159
173
|
// stop (Codex review). Every other status keeps the platform's word ahead of
|
|
160
174
|
// anything generic, which is where it belongs: it is specific to one refusal.
|
|
175
|
+
//
|
|
176
|
+
// A 503 answered to a change is the one status whose advice outranks the
|
|
177
|
+
// platform's word: the change may or may not have happened, and a reason
|
|
178
|
+
// saying "worth sending again" would invite the blind replay of a create or a
|
|
179
|
+
// command that the platform's own docs warn against (OPL-5026).
|
|
161
180
|
const advice = err instanceof APIError
|
|
162
|
-
? (
|
|
181
|
+
? (unavailableAdvice(err) ??
|
|
182
|
+
statusAdvice(err.status, err.reason) ??
|
|
163
183
|
(includeReasonAdvice &&
|
|
164
184
|
![404, 405].includes(err.status) &&
|
|
165
185
|
(!err.body ||
|
|
@@ -348,6 +368,15 @@ export function describe(c) {
|
|
|
348
368
|
bits.push(`suspended ${c.suspended.at}`);
|
|
349
369
|
if (c.unreachable)
|
|
350
370
|
bits.push('UNREACHABLE — its hypervisor could not be reached');
|
|
371
|
+
// Secrets, only where there is something to say: `false` and absent say
|
|
372
|
+
// nothing, and `null` is the platform saying it could not check — not that
|
|
373
|
+
// nothing is pending.
|
|
374
|
+
if (c.secrets_pending === true)
|
|
375
|
+
bits.push('a change to its secrets is pending until it restarts');
|
|
376
|
+
else if (c.secrets_pending === null)
|
|
377
|
+
bits.push('whether its secrets are current is unknown until it restarts');
|
|
378
|
+
if (typeof c.secrets_error === 'string' && c.secrets_error.trim())
|
|
379
|
+
bits.push(`secrets not delivered: ${c.secrets_error.trim()}`);
|
|
351
380
|
return bits.join(' · ');
|
|
352
381
|
}
|
|
353
382
|
//# sourceMappingURL=format.js.map
|