mandala-computer-mcp 0.4.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.
Files changed (128) hide show
  1. package/README.md +558 -29
  2. package/dist/api.d.ts +59 -1
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/api.js +404 -33
  5. package/dist/api.js.map +1 -1
  6. package/dist/artifacts.d.ts +63 -0
  7. package/dist/artifacts.d.ts.map +1 -0
  8. package/dist/artifacts.js +81 -0
  9. package/dist/artifacts.js.map +1 -0
  10. package/dist/cli.d.ts +4 -0
  11. package/dist/cli.d.ts.map +1 -1
  12. package/dist/cli.js +52 -21
  13. package/dist/cli.js.map +1 -1
  14. package/dist/credentials.d.ts +33 -0
  15. package/dist/credentials.d.ts.map +1 -0
  16. package/dist/credentials.js +395 -0
  17. package/dist/credentials.js.map +1 -0
  18. package/dist/errors.d.ts +122 -11
  19. package/dist/errors.d.ts.map +1 -1
  20. package/dist/errors.js +237 -41
  21. package/dist/errors.js.map +1 -1
  22. package/dist/executions.d.ts +43 -0
  23. package/dist/executions.d.ts.map +1 -0
  24. package/dist/executions.js +162 -0
  25. package/dist/executions.js.map +1 -0
  26. package/dist/format.d.ts +33 -8
  27. package/dist/format.d.ts.map +1 -1
  28. package/dist/format.js +107 -12
  29. package/dist/format.js.map +1 -1
  30. package/dist/http.d.ts +42 -0
  31. package/dist/http.d.ts.map +1 -1
  32. package/dist/http.js +383 -3
  33. package/dist/http.js.map +1 -1
  34. package/dist/index.d.ts +5 -4
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +3 -3
  37. package/dist/index.js.map +1 -1
  38. package/dist/paths.d.ts +50 -2
  39. package/dist/paths.d.ts.map +1 -1
  40. package/dist/paths.js +65 -5
  41. package/dist/paths.js.map +1 -1
  42. package/dist/results.d.ts +97 -0
  43. package/dist/results.d.ts.map +1 -0
  44. package/dist/results.js +263 -0
  45. package/dist/results.js.map +1 -0
  46. package/dist/secret-errors.d.ts +59 -0
  47. package/dist/secret-errors.d.ts.map +1 -0
  48. package/dist/secret-errors.js +199 -0
  49. package/dist/secret-errors.js.map +1 -0
  50. package/dist/secret-store.d.ts +115 -0
  51. package/dist/secret-store.d.ts.map +1 -0
  52. package/dist/secret-store.js +105 -0
  53. package/dist/secret-store.js.map +1 -0
  54. package/dist/server.d.ts +3 -2
  55. package/dist/server.d.ts.map +1 -1
  56. package/dist/server.js +60 -9
  57. package/dist/server.js.map +1 -1
  58. package/dist/session.d.ts +6 -1
  59. package/dist/session.d.ts.map +1 -1
  60. package/dist/session.js +1 -1
  61. package/dist/session.js.map +1 -1
  62. package/dist/stdio.d.ts +5 -1
  63. package/dist/stdio.d.ts.map +1 -1
  64. package/dist/stdio.js +10 -4
  65. package/dist/stdio.js.map +1 -1
  66. package/dist/tool-filters.d.ts +38 -0
  67. package/dist/tool-filters.d.ts.map +1 -0
  68. package/dist/tool-filters.js +137 -0
  69. package/dist/tool-filters.js.map +1 -0
  70. package/dist/tools/account.d.ts +3 -0
  71. package/dist/tools/account.d.ts.map +1 -0
  72. package/dist/tools/account.js +122 -0
  73. package/dist/tools/account.js.map +1 -0
  74. package/dist/tools/activities.d.ts +3 -0
  75. package/dist/tools/activities.d.ts.map +1 -0
  76. package/dist/tools/activities.js +140 -0
  77. package/dist/tools/activities.js.map +1 -0
  78. package/dist/tools/agent.d.ts.map +1 -1
  79. package/dist/tools/agent.js +21 -9
  80. package/dist/tools/agent.js.map +1 -1
  81. package/dist/tools/artifacts.d.ts +3 -0
  82. package/dist/tools/artifacts.d.ts.map +1 -0
  83. package/dist/tools/artifacts.js +97 -0
  84. package/dist/tools/artifacts.js.map +1 -0
  85. package/dist/tools/chat.d.ts +6 -0
  86. package/dist/tools/chat.d.ts.map +1 -0
  87. package/dist/tools/chat.js +192 -0
  88. package/dist/tools/chat.js.map +1 -0
  89. package/dist/tools/computers.d.ts.map +1 -1
  90. package/dist/tools/computers.js +28 -16
  91. package/dist/tools/computers.js.map +1 -1
  92. package/dist/tools/directory.d.ts +13 -0
  93. package/dist/tools/directory.d.ts.map +1 -0
  94. package/dist/tools/directory.js +88 -0
  95. package/dist/tools/directory.js.map +1 -0
  96. package/dist/tools/executions.d.ts +3 -0
  97. package/dist/tools/executions.d.ts.map +1 -0
  98. package/dist/tools/executions.js +87 -0
  99. package/dist/tools/executions.js.map +1 -0
  100. package/dist/tools/guest.d.ts.map +1 -1
  101. package/dist/tools/guest.js +184 -35
  102. package/dist/tools/guest.js.map +1 -1
  103. package/dist/tools/input.d.ts +2 -0
  104. package/dist/tools/input.d.ts.map +1 -1
  105. package/dist/tools/input.js +31 -5
  106. package/dist/tools/input.js.map +1 -1
  107. package/dist/tools/results.d.ts +30 -0
  108. package/dist/tools/results.d.ts.map +1 -0
  109. package/dist/tools/results.js +106 -0
  110. package/dist/tools/results.js.map +1 -0
  111. package/dist/tools/secrets.d.ts +78 -0
  112. package/dist/tools/secrets.d.ts.map +1 -0
  113. package/dist/tools/secrets.js +448 -0
  114. package/dist/tools/secrets.js.map +1 -0
  115. package/dist/tools/signals.d.ts +3 -0
  116. package/dist/tools/signals.d.ts.map +1 -0
  117. package/dist/tools/signals.js +116 -0
  118. package/dist/tools/signals.js.map +1 -0
  119. package/dist/tools/snapshots.d.ts.map +1 -1
  120. package/dist/tools/snapshots.js +52 -10
  121. package/dist/tools/snapshots.js.map +1 -1
  122. package/dist/tools/ssh.d.ts +3 -0
  123. package/dist/tools/ssh.d.ts.map +1 -0
  124. package/dist/tools/ssh.js +186 -0
  125. package/dist/tools/ssh.js.map +1 -0
  126. package/dist/tools/webhooks.js +1 -1
  127. package/dist/tools/webhooks.js.map +1 -1
  128. package/package.json +1 -1
package/dist/errors.js CHANGED
@@ -16,6 +16,8 @@
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,27 @@ 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;
46
+ /** The method of the refused request, upper case, when known. */
47
+ method;
38
48
  constructor(message, status, body,
39
49
  /** Parsed Retry-After delay in milliseconds; absent when missing or invalid. */
40
- retryAfterMs) {
50
+ retryAfterMs, metadata) {
41
51
  super(message);
42
52
  this.status = status;
43
53
  this.body = body;
44
54
  this.retryAfterMs = retryAfterMs;
45
55
  this.reason = refusalReason(body);
56
+ this.requestId =
57
+ nonblank(metadata?.requestId) ?? (record(body) ? nonblank(body.request_id) : undefined);
58
+ this.allow = nonblank(metadata?.allow);
59
+ this.wwwAuthenticate = nonblank(metadata?.wwwAuthenticate);
60
+ this.method = nonblank(metadata?.method)?.toUpperCase();
46
61
  }
47
62
  }
48
63
  /**
@@ -67,7 +82,21 @@ const REASON_CLEARS = new Set(['contention', 'starting']);
67
82
  * nothing changes today. What changes is that a future status for this refusal
68
83
  * cannot quietly make it look replayable.
69
84
  */
70
- const REASON_PERMANENT = new Set(['unavailable', 'unsupported', 'revoked']);
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
+ ]);
71
100
  /**
72
101
  * How a refusal the platform classified behaves, or `undefined` for a word this
73
102
  * version has no opinion about.
@@ -124,7 +153,10 @@ export function reasonAdvice(reason) {
124
153
  case 'contention':
125
154
  return 'something was in flight; the same call works once it finishes, so this one is worth sending again';
126
155
  case 'starting':
127
- return 'the guest agent is still inside its boot window, so this is worth sending again in a moment';
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';
128
160
  case 'unavailable':
129
161
  // Softened from "does NOT clear by waiting", which was false of exactly
130
162
  // the case OPL-4631 is about and is the sentence a model actually sees:
@@ -136,6 +168,11 @@ export function reasonAdvice(reason) {
136
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';
137
169
  case 'unsupported':
138
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)';
139
176
  case 'revoked':
140
177
  // Reached only on a status statusAdvice has no sentence for, because the
141
178
  // formatter asks that one first and the platform sends this word on 401 and
@@ -163,15 +200,28 @@ export function reasonAdvice(reason) {
163
200
  * the work may already stand. None of the three is a fault on the computer, and
164
201
  * a model told only "unauthorized (HTTP 401)" reads it as one.
165
202
  *
166
- * Only these three. A 404 is deliberately not here: it does not separate deleted
203
+ * A 404 is deliberately not classified here: it does not separate deleted
167
204
  * from out of this key's reach, so a single clause would have to be wrong about
168
205
  * one of them — that judgement belongs to the tools that know which id they were
169
206
  * given. Silence is the same discipline {@link reasonAdvice} keeps.
170
207
  */
171
- export function statusAdvice(status) {
208
+ export function authenticationAdvice(reason) {
209
+ const classification = reason === 'missing'
210
+ ? 'a platform authentication credential was not supplied'
211
+ : reason === 'invalid'
212
+ ? 'the supplied platform credential was not accepted'
213
+ : reason === 'revoked'
214
+ ? 'the platform authority was revoked and no longer holds'
215
+ : 'a credential was refused; this result alone does not identify whether the account key or model key caused it';
216
+ 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`;
217
+ }
218
+ /** Status-specific guidance, with authentication provenance supplied by the refusal reason. */
219
+ export function statusAdvice(status, reason) {
172
220
  switch (status) {
173
221
  case 401:
174
- return 'the credential this server is using stopped being accepted — revoked, or a session that ended. Sending this again unchanged is refused the same way. This can be decided partway through a call, so check what already took effect before repeating anything that creates, starts, moves, writes or deletes';
222
+ return authenticationAdvice(reason);
223
+ case 405:
224
+ return 'check the request method against the received Allow metadata, when present. Do not automatically switch methods or replay this request';
175
225
  case 403:
176
226
  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
227
  case 402:
@@ -191,10 +241,13 @@ export function statusAdvice(status) {
191
241
  * and the raw word belongs to whoever is embedding this.
192
242
  */
193
243
  function refusalReason(body) {
194
- if (!body || typeof body !== 'object')
244
+ if (!record(body))
195
245
  return undefined;
196
- const reason = body.reason;
197
- return typeof reason === 'string' ? reason : undefined;
246
+ if (typeof body.reason === 'string')
247
+ return body.reason;
248
+ return record(body.error) && typeof body.error.reason === 'string'
249
+ ? body.error.reason
250
+ : undefined;
198
251
  }
199
252
  /** 401 — the key is missing, malformed, or revoked. */
200
253
  export class AuthenticationError extends APIError {
@@ -208,10 +261,14 @@ export class PlanLimitError extends APIError {
208
261
  export class PermissionDeniedError extends APIError {
209
262
  name = 'PermissionDeniedError';
210
263
  }
211
- /** 404 — no such computer, snapshot, or route. */
264
+ /** 404 — no such computer, snapshot, guest path, or route. */
212
265
  export class NotFoundError extends APIError {
213
266
  name = 'NotFoundError';
214
267
  }
268
+ /** 405 — the path does not support the requested method; inspect the received Allow. */
269
+ export class MethodNotAllowedError extends APIError {
270
+ name = 'MethodNotAllowedError';
271
+ }
215
272
  /**
216
273
  * 409 — the thing exists but is in the wrong state for this right now.
217
274
  *
@@ -267,11 +324,102 @@ export class MoveRequiredError extends ConflictError {
267
324
  name = 'MoveRequiredError';
268
325
  constructor(message, status, body,
269
326
  /** Whether a host in this region could run the size that was asked for. */
270
- movePossible, retryAfterMs) {
271
- super(message, status, body, retryAfterMs);
327
+ movePossible, retryAfterMs, metadata) {
328
+ super(message, status, body, retryAfterMs, metadata);
272
329
  this.movePossible = movePossible;
273
330
  }
274
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
+ }
275
423
  /**
276
424
  * The `move` object the platform puts on the refusal above, if this body has one.
277
425
  *
@@ -309,8 +457,8 @@ export class RangeNotSatisfiableError extends APIError {
309
457
  name = 'RangeNotSatisfiableError';
310
458
  constructor(message, status, body,
311
459
  /** The file's real length, off `Content-Range`, when the response sent one. */
312
- size, retryAfterMs) {
313
- super(message, status, body, retryAfterMs);
460
+ size, retryAfterMs, metadata) {
461
+ super(message, status, body, retryAfterMs, metadata);
314
462
  this.size = size;
315
463
  }
316
464
  }
@@ -332,14 +480,40 @@ export class RateLimitError extends APIError {
332
480
  // biome-ignore lint/complexity/noUselessConstructor: Preserve the documented public constructor.
333
481
  constructor(message, status, body,
334
482
  /** From `Retry-After`, in milliseconds from now, when the response sent one. */
335
- retryAfterMs) {
336
- super(message, status, body, retryAfterMs);
483
+ retryAfterMs, metadata) {
484
+ super(message, status, body, retryAfterMs, metadata);
337
485
  }
338
486
  }
339
- /** 503 — a hypervisor could not be reached, so an inventory would be short. */
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
+ */
340
498
  export class UnavailableError extends APIError {
341
499
  name = 'UnavailableError';
342
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
+ }
343
517
  /**
344
518
  * The request was given up on before the platform answered.
345
519
  *
@@ -564,13 +738,9 @@ const BY_STATUS = {
564
738
  402: PlanLimitError,
565
739
  403: PermissionDeniedError,
566
740
  404: NotFoundError,
741
+ 405: MethodNotAllowedError,
567
742
  409: ConflictError,
568
- // Only ever reached through errorForStatus, which cannot see the response
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,
743
+ // 416 has a range-specific constructor and is handled directly by the factory.
574
744
  // Retry-After is parsed by Api and passed through errorForStatus.
575
745
  // A 429 built without headers still has the same public error class.
576
746
  429: RateLimitError,
@@ -691,7 +861,7 @@ const ORIGIN_TLS_MESSAGE = 'a proxy in front of the platform could not complete
691
861
  /**
692
862
  * Whether the response named this failure in the shape this surface uses.
693
863
  *
694
- * Only a JSON body with a non-empty `error` string counts. An HTML page and an
864
+ * A JSON body with a non-empty `error` string or nonblank `error.message` counts. An HTML page and an
695
865
  * empty body are an intermediary's, and both are worth discarding for the
696
866
  * wording below; a structured message is not. "upstream unavailable before
697
867
  * dispatch" is a more specific true thing than anything written here, and
@@ -725,13 +895,17 @@ function platformNamed(body) {
725
895
  * itself.
726
896
  */
727
897
  export function platformSaid(body) {
728
- if (!body || typeof body !== 'object')
898
+ if (!record(body))
729
899
  return undefined;
730
900
  const err = body.error;
731
- return typeof err === 'string' && err.length > 0 ? err : undefined;
901
+ return typeof err === 'string' && err.length > 0
902
+ ? err
903
+ : record(err)
904
+ ? nonblank(err.message)
905
+ : undefined;
732
906
  }
733
907
  /** Build the error for a status, with the platform's own message when it sent one. */
734
- export function errorForStatus(status, message, body, retryAfterMs) {
908
+ export function errorForStatus(status, message, body, retryAfterMs, metadata) {
735
909
  const Cls = BY_STATUS[status] ?? APIError;
736
910
  // The 409 that is an offer, told apart by its body. Before the substitutions
737
911
  // below because it never wants one: the platform's sentence here is the whole
@@ -740,10 +914,14 @@ export function errorForStatus(status, message, body, retryAfterMs) {
740
914
  if (Cls === ConflictError) {
741
915
  const offer = moveOffer(body);
742
916
  if (offer)
743
- return new MoveRequiredError(message, status, body, offer.possible, retryAfterMs);
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);
744
922
  }
745
- if (Cls === RangeNotSatisfiableError) {
746
- return new RangeNotSatisfiableError(message, status, body, undefined, retryAfterMs);
923
+ if (status === 416) {
924
+ return new RangeNotSatisfiableError(message, status, body, undefined, retryAfterMs, metadata);
747
925
  }
748
926
  // Substituted for an empty body, which says nothing, and for a proxy's HTML
749
927
  // page, which says 500 characters of nothing. NOT for a structured message:
@@ -760,21 +938,21 @@ export function errorForStatus(status, message, body, retryAfterMs) {
760
938
  // that deployment than the generic outage prose here does, and discarding it
761
939
  // was the very thing the 504 and 520 guards exist to prevent.
762
940
  if (Cls === GatewayTimeoutError && !platformNamed(body)) {
763
- return new GatewayTimeoutError(gatewayTimeoutMessage(status), status, body, retryAfterMs);
941
+ return new GatewayTimeoutError(gatewayTimeoutMessage(status), status, body, retryAfterMs, metadata);
764
942
  }
765
943
  if (Cls === OriginResponseError && !platformNamed(body)) {
766
944
  // 502 and 520 share a class and not a message: one knows the request
767
945
  // arrived, the other cannot tell. See BAD_GATEWAY_MESSAGE.
768
946
  const said = status === 502 ? BAD_GATEWAY_MESSAGE : ORIGIN_RESPONSE_MESSAGE;
769
- return new OriginResponseError(said, status, body, retryAfterMs);
947
+ return new OriginResponseError(said, status, body, retryAfterMs, metadata);
770
948
  }
771
949
  if (Cls === OriginTLSError && !platformNamed(body)) {
772
- return new OriginTLSError(ORIGIN_TLS_MESSAGE, status, body, retryAfterMs);
950
+ return new OriginTLSError(ORIGIN_TLS_MESSAGE, status, body, retryAfterMs, metadata);
773
951
  }
774
952
  if (Cls === OriginUnreachableError && !platformNamed(body)) {
775
- return new OriginUnreachableError(ORIGIN_UNREACHABLE_MESSAGE, status, body, retryAfterMs);
953
+ return new OriginUnreachableError(ORIGIN_UNREACHABLE_MESSAGE, status, body, retryAfterMs, metadata);
776
954
  }
777
- return new Cls(message, status, body, retryAfterMs);
955
+ return new Cls(message, status, body, retryAfterMs, metadata);
778
956
  }
779
957
  /**
780
958
  * Whether an error is worth trying again without changing the request.
@@ -785,7 +963,9 @@ export function errorForStatus(status, message, body, retryAfterMs) {
785
963
  * including one that creates something — so it names only failures that both
786
964
  * clear on their own AND are safe to replay blind.
787
965
  *
788
- * Answered by TYPE, with no status numbers at all, which is the OPL-3724
966
+ * Terminal authentication, authority, payment, missing-resource and method
967
+ * refusals stay terminal even with a contradictory reason. Other cases are
968
+ * answered by TYPE, which is the OPL-3724
789
969
  * decision written down. Three clients had drifted into three mechanisms for
790
970
  * one question: this file matched classes plus a list of numbers, the
791
971
  * TypeScript SDK matched classes alone, and the Python SDK named the fatal
@@ -796,7 +976,9 @@ export function errorForStatus(status, message, body, retryAfterMs) {
796
976
  * - {@link ConflictError} — something is in flight that this cannot run
797
977
  * alongside, minus the one that is a decision
798
978
  * - {@link RateLimitError} — a cadence, and the response usually says how long
799
- * - {@link UnavailableError} — a hypervisor briefly out of reach
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
800
982
  * - {@link ConnectivityError} — the request never left
801
983
  *
802
984
  * That last line is now literally true, and it was not always. The class used
@@ -849,6 +1031,8 @@ export function errorForStatus(status, message, body, retryAfterMs) {
849
1031
  * what it can and cannot tell apart.
850
1032
  */
851
1033
  export function isTransient(err) {
1034
+ if (err instanceof APIError && [401, 402, 403, 404, 405].includes(err.status))
1035
+ return false;
852
1036
  // Preparation requires the original template and a token, and may have failed.
853
1037
  // A generic retry of the unchanged create is not the continuation protocol.
854
1038
  if (err instanceof APIError &&
@@ -862,13 +1046,23 @@ export function isTransient(err) {
862
1046
  // First, because it is a subclass of the very branch below that would say yes
863
1047
  // (OPL-3775). An embedder wrapping a resize in `if (isTransient(err)) retry()`
864
1048
  // is the caller this line is for.
865
- if (err instanceof MoveRequiredError)
1049
+ if (err instanceof MoveRequiredError ||
1050
+ err instanceof FileExistsError ||
1051
+ err instanceof CreateOnlyConflictError)
866
1052
  return false;
867
1053
  // A lost RESPONSE is not a request that never left, and only one of the two
868
1054
  // is safe to replay blind. Same shape as the line above and the same reason:
869
1055
  // a subclass of a branch below that would otherwise say yes (OPL-3855).
870
1056
  if (err instanceof ConnectivityInterruptedError)
871
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);
872
1066
  // The platform's own word, ahead of the types below, because it is the more
873
1067
  // specific answer and it is the one that tells the 409 that never clears from
874
1068
  // the two that do (OPL-3898). Only an APIError carries a shape-checked one:
@@ -878,14 +1072,14 @@ export function isTransient(err) {
878
1072
  // Through the exported classifier rather than the sets directly, so what an
879
1073
  // embedder is told and what this server does are one answer and not two.
880
1074
  const kind = reasonKind(err.reason);
881
- if (kind === 'clears')
1075
+ // A nested run reason can arrive after billed work and grants no new replay permission.
1076
+ if (kind === 'clears' && record(err.body) && typeof err.body.reason === 'string')
882
1077
  return true;
883
1078
  if (kind === 'permanent')
884
1079
  return false;
885
1080
  }
886
1081
  return (err instanceof ConflictError ||
887
1082
  err instanceof RateLimitError ||
888
- err instanceof UnavailableError ||
889
1083
  err instanceof ConnectivityError);
890
1084
  }
891
1085
  /**
@@ -997,7 +1191,9 @@ export function isTransient(err) {
997
1191
  export function isTransientForPoll(err) {
998
1192
  if (!(err instanceof APIError) && !(err instanceof ConnectivityError))
999
1193
  return false;
1000
- if (err instanceof MoveRequiredError)
1194
+ if (err instanceof MoveRequiredError ||
1195
+ err instanceof FileExistsError ||
1196
+ err instanceof CreateOnlyConflictError)
1001
1197
  return false;
1002
1198
  if (err instanceof OriginTLSError)
1003
1199
  return false;
@@ -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;I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AG,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"}
@@ -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"}