@pipelex/sdk 0.51.0 → 0.53.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 (88) hide show
  1. package/README.md +20 -19
  2. package/dist/answer-reading.d.ts +70 -0
  3. package/dist/answer-reading.js +106 -0
  4. package/dist/answer-reading.js.map +1 -0
  5. package/dist/artifacts.js +45 -32
  6. package/dist/artifacts.js.map +1 -1
  7. package/dist/cli/present.d.ts +11 -14
  8. package/dist/cli/present.js +41 -37
  9. package/dist/cli/present.js.map +1 -1
  10. package/dist/cli/run.js +8 -7
  11. package/dist/cli/run.js.map +1 -1
  12. package/dist/cli/script.d.ts +1 -1
  13. package/dist/cli/source.js +2 -2
  14. package/dist/cli/source.js.map +1 -1
  15. package/dist/client.d.ts +254 -213
  16. package/dist/client.js +542 -472
  17. package/dist/client.js.map +1 -1
  18. package/dist/codegen-check.d.ts +21 -15
  19. package/dist/codegen-check.js +54 -27
  20. package/dist/codegen-check.js.map +1 -1
  21. package/dist/errors.d.ts +298 -455
  22. package/dist/errors.js +426 -534
  23. package/dist/errors.js.map +1 -1
  24. package/dist/exact-json.d.ts +8 -12
  25. package/dist/exact-json.js +19 -12
  26. package/dist/exact-json.js.map +1 -1
  27. package/dist/hooks/check-core.d.ts +12 -7
  28. package/dist/hooks/check-core.js +20 -14
  29. package/dist/hooks/check-core.js.map +1 -1
  30. package/dist/hooks/validate-stage.js +12 -3
  31. package/dist/hooks/validate-stage.js.map +1 -1
  32. package/dist/index.d.ts +4 -5
  33. package/dist/index.js +7 -6
  34. package/dist/index.js.map +1 -1
  35. package/dist/method-selector.js +7 -5
  36. package/dist/method-selector.js.map +1 -1
  37. package/dist/method-trees.d.ts +6 -7
  38. package/dist/method-trees.js +31 -37
  39. package/dist/method-trees.js.map +1 -1
  40. package/dist/models.d.ts +33 -210
  41. package/dist/models.js +2 -1
  42. package/dist/models.js.map +1 -1
  43. package/dist/prepare-inputs.d.ts +2 -2
  44. package/dist/prepare-inputs.js +51 -54
  45. package/dist/prepare-inputs.js.map +1 -1
  46. package/dist/problem-items.d.ts +19 -0
  47. package/dist/problem-items.js +52 -0
  48. package/dist/problem-items.js.map +1 -0
  49. package/dist/product-models.d.ts +43 -29
  50. package/dist/records.d.ts +12 -0
  51. package/dist/records.js +23 -0
  52. package/dist/records.js.map +1 -0
  53. package/dist/runs.d.ts +49 -38
  54. package/dist/runs.js +45 -19
  55. package/dist/runs.js.map +1 -1
  56. package/dist/transport-reading.d.ts +18 -0
  57. package/dist/{run-may-have-started.js → transport-reading.js} +15 -44
  58. package/dist/transport-reading.js.map +1 -0
  59. package/dist/upload-grant.d.ts +9 -6
  60. package/dist/upload-grant.js +42 -29
  61. package/dist/upload-grant.js.map +1 -1
  62. package/dist/upload.js +53 -33
  63. package/dist/upload.js.map +1 -1
  64. package/dist/version.d.ts +1 -1
  65. package/dist/version.js +1 -1
  66. package/docs/architecture.md +19 -19
  67. package/docs/artifact-download.md +6 -6
  68. package/docs/cli.md +1 -1
  69. package/docs/crate-routes.md +13 -14
  70. package/docs/errors.md +154 -267
  71. package/docs/exact-integers.md +1 -1
  72. package/docs/files.md +13 -13
  73. package/docs/hook-bundle.md +15 -1
  74. package/docs/input-preparation.md +14 -14
  75. package/docs/method-copy.md +35 -33
  76. package/docs/method-examples.md +13 -14
  77. package/docs/method-trees.md +27 -28
  78. package/docs/organization-branding.md +14 -16
  79. package/docs/run-results.md +8 -8
  80. package/package.json +1 -1
  81. package/dist/error-models.d.ts +0 -302
  82. package/dist/error-models.js +0 -203
  83. package/dist/error-models.js.map +0 -1
  84. package/dist/error-verdicts.d.ts +0 -46
  85. package/dist/error-verdicts.js +0 -120
  86. package/dist/error-verdicts.js.map +0 -1
  87. package/dist/run-may-have-started.d.ts +0 -31
  88. package/dist/run-may-have-started.js.map +0 -1
package/dist/client.d.ts CHANGED
@@ -60,8 +60,8 @@ export interface PipelexHostedRunExtensions {
60
60
  *
61
61
  * - **Alone** — the platform resolves the version the id names and runs its
62
62
  * files, with the method's Python files beside them. A bare `mt_…` runs the
63
- * latest published version, a `409` `method_not_published` for a method never
64
- * published; `mt_…@<n>` runs version `n`, a `404` `method_version_not_found`
63
+ * latest published version, a `409` `pipelex.catalog.not_published` for a method never
64
+ * published; `mt_…@<n>` runs version `n`, a `404` `pipelex.catalog.not_found`
65
65
  * for a version never published; `mt_…@draft` runs the draft. The suffix
66
66
  * rides the string untouched, any other suffix is a `422`, and the answer's
67
67
  * `method_version` says which version runs.
@@ -110,11 +110,11 @@ export interface PipelexStartRequestOptions {
110
110
  * The hosted API binds the key to the run the first request starts, before it dispatches it, so
111
111
  * the same start sent again under the same key is answered with that run's acknowledgement and
112
112
  * starts nothing, whatever became of the first attempt, for 24 hours. A failed start whose
113
- * `runMayHaveStarted` is true can therefore be sent again unchanged, and recovers the run instead
114
- * of paying for a second one. The same key with a different body is refused (`409` `conflict`),
115
- * as is a key whose earlier request is still being handled (`409` `idempotency_key_in_use`,
116
- * retryable: send it again under the same key in a few seconds); see `docs/errors.md`. A bare
117
- * runner ignores the header.
113
+ * problem's `retry` is `outcome_unknown` can therefore be sent again unchanged, and recovers the
114
+ * run instead of paying for a second one. The same key with a different body is refused (`409`
115
+ * `request.idempotency_conflict`), as is a key whose earlier request is still being handled
116
+ * (`409` `request.idempotency_key_in_use`, whose `retry` is `yes`: send it again under the same
117
+ * key after its `retry_after`); see `docs/errors.md`. A bare runner ignores the header.
118
118
  *
119
119
  * A key is 1 to 255 visible ASCII characters (`!` to `~`, so no space); anything else, an empty
120
120
  * string included, is a `RequestArgumentError` before any request is sent, since a start sent
@@ -139,11 +139,12 @@ export interface MethodCopyRequestOptions {
139
139
  * can be sent again unchanged and makes one copy, not two. A verdict and a `4xx` refusal of the
140
140
  * copy are stored alike, so the same copy under the same key is answered the same again; a `5xx`
141
141
  * and a refusal for its timing (a `408`, `425` or `429`) are not stored, and a copy that failed
142
- * with one left nothing visible, so the same key sends it afresh.
143
- * The same key with a different body is refused (`409` `conflict`), as is a key whose earlier
144
- * request is still being handled (`409` `idempotency_key_in_use`, retryable: send it again
145
- * under the same key in a few seconds); a changed copy, such as one with a fresh draft token,
146
- * goes under a new key. See `docs/method-copy.md`.
142
+ * with one left nothing visible, but for the `503` whose `detail` names the copy (see
143
+ * `copyMethod`), so the same key sends it afresh. The same key with a different body is refused
144
+ * (`409` `request.idempotency_conflict`, whose `retry` is `no`), as is a key whose earlier
145
+ * request is still being handled (`409` `request.idempotency_key_in_use`, whose `retry` is
146
+ * `yes`: send it again under the same key in a few seconds); a changed copy, such as one with a
147
+ * fresh draft token, goes under a new key. See `docs/method-copy.md`.
147
148
  *
148
149
  * A key is held to the rule a start's is (`PipelexStartRequestOptions.idempotencyKey`): 1 to
149
150
  * 255 visible ASCII characters, anything else a `RequestArgumentError` before any request.
@@ -216,8 +217,8 @@ export interface PipelexApiClientOptions {
216
217
  export declare const DEFAULT_API_BASE_URL = "https://api.pipelex.com";
217
218
  /**
218
219
  * The protocol surface `PipelexApiClient` implements as the standard types it: every route but
219
- * `validate`, whose verdict is Pipelex's own (`PipelexValidationResult`) while the hosted plane
220
- * answers the verdict that predates the protocol's problem items.
220
+ * `validate`, whose verdict is Pipelex's own (`PipelexValidationResult`): the protocol's problem
221
+ * items beside members of the hosted plane's own.
221
222
  */
222
223
  type HostedProtocolSurface = Omit<MTHDSProtocol<DictPipeOutput>, "validate">;
223
224
  export declare class PipelexApiClient implements HostedProtocolSurface {
@@ -255,17 +256,27 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
255
256
  * Issue one HTTP request and return the raw status/headers/body. Wraps
256
257
  * DNS/connect/TLS/timeout failures as `ApiUnreachableError`; a caller-driven
257
258
  * abort (Ctrl-C / agent walk-away) propagates as-is so the poll loop can stop
258
- * cleanly. Non-2xx interpretation is left to the caller. `url` is a fully
259
- * resolved absolute URL. `mayStartRun` marks a request that may create a run,
260
- * whose `ApiUnreachableError` then says whether it may have (see `RunCreation`).
259
+ * cleanly. A body that arrived and could not be decoded, such as a `gzip` body that is not
260
+ * gzip, is an answer, so it throws the `ApiResponseError` of that answer, read as an answer
261
+ * with an empty body (see `isUndecodableBody`). Non-2xx interpretation is left to the caller.
262
+ * `url` is a fully resolved absolute URL. `mayStartRun` marks a request that may create a run,
263
+ * whose errors then say whether it may have (see `RunCreation`).
261
264
  * `idempotencyKey`, already checked by `idempotencyKeyOf`, is sent as the
262
265
  * `Idempotency-Key` header; only `start` and `copyMethod` pass one.
263
266
  */
264
267
  private requestRaw;
268
+ /**
269
+ * The `ApiResponseError` of an answer whose body arrived and could not be decoded: the answer's
270
+ * status and headers, read as an answer with an empty body (`readHostedAnswer`), so a `2xx` is
271
+ * `client.response_unreadable` naming its status, or `client.outcome_unknown` on a request that
272
+ * may create a run, which the server accepted. `code` is the decompressor's, named in the
273
+ * message, and the decoding failure is its `cause`.
274
+ */
275
+ private undecodableAnswer;
265
276
  /**
266
277
  * Issue a Pipelex-product request (`/v1/me`, `/v1/methods`, `/v1/billing/*`,
267
278
  * …) and parse its JSON body, mapping a non-2xx response to the typed
268
- * `ApiResponseError` so callers branch on its `errorDomain` and `type`, not the
279
+ * `ApiResponseError` so callers branch on its problem's `code`, not the
269
280
  * HTTP status. Empty-body tolerant — DELETE / onboarding / updateRun
270
281
  * answer 2xx with no body, returned as `undefined`. Uses the management-call
271
282
  * timeout, not the blocking-execute ceiling.
@@ -309,8 +320,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
309
320
  * One page of a cursor-paged product route (`listMethods`, `listMethodVersions`,
310
321
  * `listMethodExamples`, `listRuns`, `listFiles`), read as the platform always serializes it: `items` an
311
322
  * array, `next_cursor` a string or `null`. A page breaking either is an answer the SDK cannot
312
- * read, so it throws the `ApiResponseError` `unreadableAnswer` builds, `runtime` and not
313
- * retryable, rather than handing the iterators a page they cannot walk: `items` that is not
323
+ * read, so it throws the `ApiResponseError` `unreadableAnswer` builds,
324
+ * `client.response_unreadable`, rather than handing the iterators a page they cannot walk: `items` that is not
314
325
  * iterable, or a missing cursor that is neither the end nor a next page, which `iterateRuns`
315
326
  * would follow forever. A route reading its rows itself passes `rows`: `parse` reads the page's
316
327
  * text, and `item` reads each row, throwing as `unreadableAnswer` does for one it cannot read.
@@ -367,23 +378,29 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
367
378
  /**
368
379
  * The `ApiResponseError` of a 2xx answer the SDK cannot read, its message
369
380
  * `API <method> <path> answered <status> with <what>`: the answer's status, its raw text as
370
- * `responseBody`, no hosted problem member but the `X-Request-ID` header, the failure that made it
371
- * unreadable as `cause`, and the verdict the fallback gives a 2xx, `runtime` and not retryable.
372
- * An answer that carries signed links (`RawResponse.carriesLinks`) is held with every link
373
- * hidden, and with no `cause`, which could quote one. On a request that may create a run, the run may have started: the server accepted it.
381
+ * `responseBody`, the failure that made it unreadable as `cause`, and the problem
382
+ * `client.response_unreadable` naming the status. On a request that may create a run, the run
383
+ * may exist, since the server accepted the request, so the problem is `client.outcome_unknown`
384
+ * instead, naming the run when the body names one. An answer that carries signed links
385
+ * (`RawResponse.carriesLinks`) is held with every link hidden, and with no `cause`, which could
386
+ * quote one.
374
387
  */
375
388
  private unreadableAnswer;
376
389
  /**
377
390
  * Throw the `ApiResponseError` of a non-2xx answer, naming the route by its `path` from the
378
- * origin (`/v1/...`, or `/health` for the liveness probe).
391
+ * origin (`/v1/...`, or `/health` for the liveness probe). The answer is read as its problem
392
+ * (`readHostedAnswer`): the body as received when it is a problem document, whose `detail` the
393
+ * message quotes, and otherwise the problem the edge's bare answer reads as, the message
394
+ * quoting the body as it came, or the status text for an empty one.
379
395
  */
380
396
  private throwApiResponseErrorAt;
381
397
  /**
382
398
  * Translate a "route absent" 404 (a bare pipelex-api with no platform block)
383
- * into a clear `RunLifecycleUnavailableError`. The platform's own 404s (run
384
- * not found / cross-org) carry a structured error envelope (a `code` field)
385
- * and are left for normal handling. `explanation` replaces the sentence saying
386
- * why the route is missing, for a route a hosted API may also lack.
399
+ * into a clear `RunLifecycleUnavailableError`. A 404 a route answered on purpose (a run
400
+ * not found, cross-org included, or a method that does not exist) names its own `code`
401
+ * and is left for normal handling as `ApiResponseError` (`isMissingRoute404`).
402
+ * `explanation` replaces the sentence saying why the route is missing, for a route a
403
+ * hosted API may also lack.
387
404
  */
388
405
  private throwIfLifecycleUnavailable;
389
406
  /**
@@ -404,9 +421,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
404
421
  * there this throws.
405
422
  *
406
423
  * It goes through the same transport as every route: an unreachable origin is an
407
- * `ApiUnreachableError`, and a non-2xx answer an `ApiResponseError` whose verdict the SDK's
408
- * fallback reads from the status, since the probe answers no problem document. So is a 2xx
409
- * whose body is not a JSON object, such as a gateway's HTML page: `runtime`, not retryable.
424
+ * `ApiUnreachableError`, and a non-2xx answer an `ApiResponseError` whose problem is read from
425
+ * the status when the probe answers no problem document. So is a 2xx whose body is not a JSON
426
+ * object, such as a gateway's HTML page: `client.response_unreadable`.
410
427
  */
411
428
  health(): Promise<Record<string, unknown>>;
412
429
  /**
@@ -454,15 +471,15 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
454
471
  *
455
472
  * `options.idempotencyKey` is sent as the `Idempotency-Key` header, and nothing
456
473
  * is sent without it: the hosted API answers the same start sent again under the
457
- * same key with the run the first one started, so a failure whose
458
- * `runMayHaveStarted` is true can be retried unchanged (see
474
+ * same key with the run the first one started, so a failure whose problem's
475
+ * `retry` is `outcome_unknown` can be retried unchanged (see
459
476
  * `PipelexStartRequestOptions`). A malformed key is a `RequestArgumentError`
460
477
  * before anything is sent.
461
478
  *
462
479
  * The method's tree is prepared before the request as `execute` prepares it. The prepared body
463
480
  * is the same for the same tree, so a start retried under its idempotency key sends the body the
464
481
  * key was bound to. A start whose hash entries name a blob the API does not hold yet is refused
465
- * with a `422` `missing_blobs`, which releases its key: send it again unchanged, which asks the
482
+ * with a `422` `request.blobs_missing`, which releases its key: send it again unchanged, which asks the
466
483
  * blob route and uploads what is missing first.
467
484
  */
468
485
  start(options: PipelexStartOptions): Promise<PipelexRunResultStart>;
@@ -476,7 +493,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
476
493
  * `/validate` is a diagnostic endpoint: every produced verdict rides a **200**,
477
494
  * discriminated on `is_valid`. This returns the `PipelexValidationResult` union
478
495
  * verbatim — `is_valid: true` ⇒ the typed `PipelexValidationReport` (structural
479
- * artifacts), `is_valid: false` ⇒ a `PipelexInvalidReport` (`validation_errors[]`).
496
+ * artifacts), `is_valid: false` ⇒ a `PipelexInvalidReport`, whose `errors[]` are problem
497
+ * items. Both arms' items, the invalid arm's `errors[]` and the valid arm's `warnings[]`, are
498
+ * read member by member (`readProblemItems`).
480
499
  * An invalid method is NOT thrown — the caller pattern-matches `is_valid`. Only a
481
500
  * *no-verdict* condition (a malformed request, a tree the route refuses, auth, a
482
501
  * server fault) is non-2xx and surfaces as `ApiResponseError`.
@@ -506,8 +525,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
506
525
  *
507
526
  * A selector-resolution failure (fetch failure, no package at the address, an
508
527
  * unknown or foreign-org id, a bare id of a method never published, `409`
509
- * `method_not_published`, a version never published, `404`
510
- * `method_version_not_found`, or a malformed suffix, `422`) is a non-2xx
528
+ * `pipelex.catalog.not_published`, a version never published, `404`
529
+ * `pipelex.catalog.not_found`, or a malformed suffix, `422`) is a non-2xx
511
530
  * `ApiResponseError` — never an `is_valid: false` verdict, which is reserved
512
531
  * for actual MTHDS content.
513
532
  *
@@ -629,10 +648,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
629
648
  * Returns a **200 verdict** whatever the resolution: a reference that resolves nowhere is
630
649
  * `resolution: "not_found"` with the names it may have meant, never a thrown error. Narrow
631
650
  * on `kind` to read the shape of `matches`. A request that cannot produce a verdict throws
632
- * the typed `ApiResponseError`, a `422` whose `errorType` says why: `InvalidModelReference`
633
- * (a blank reference, a sigil or a namespace alone, or one past the runner's length limit),
634
- * `InvalidModelCategory` (an unknown `type`) or `ValidationError`. None of that is checked
635
- * here, so the runner's rule is the only one.
651
+ * the typed `ApiResponseError`, a `422` problem whose `code` says why: a blank reference, a
652
+ * sigil or a namespace alone, one past the runner's length limit, or an unknown `type`. None of
653
+ * that is checked here, so the runner's rule is the only one.
636
654
  */
637
655
  checkModelReference(reference: string, category?: ModelCheckCategory): Promise<ModelReferenceVerdict>;
638
656
  /**
@@ -654,7 +672,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
654
672
  *
655
673
  * Returns a **200 verdict**: pattern-match `is_valid` before reading the arm — a
656
674
  * closure that does not parse/load/validate comes back as `is_valid: false` with
657
- * `validation_errors[]`, not as a thrown error. Only a no-verdict condition throws
675
+ * problem items in `errors[]`, not as a thrown error. Only a no-verdict condition throws
658
676
  * `ApiResponseError`: a malformed selector (none, or more than one, of
659
677
  * `files` / `method_ref` / `method_id`) is a 422; a selector-resolution failure
660
678
  * (fetch failure, no package at the address, an unknown or foreign-org id) is
@@ -718,11 +736,11 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
718
736
  * {@link resolve} (the request's members are posted as given, its `directory`, `tree` or
719
737
  * `contents` as the `files` map, and the selector XOR is the server's to enforce).
720
738
  * Only a no-verdict condition throws `ApiResponseError`: a malformed selector and an
721
- * over-limit file are `ValidationError` `422`s; a selection the route refuses is a
722
- * `422` whose `errorType` is `EntryPipeNotFoundError` (an unknown `pipe_ref`, no entry
723
- * pipe) or `EntryPipeAmbiguousError` (an ambiguous code, several entry pipes), the
724
- * candidates in its `serverMessage`; a registry-form `method_ref` is a `501`; a pipe
725
- * whose artifacts cannot be derived is a `500`.
739
+ * over-limit file are `422` problems; a selection the route refuses is a `422` whose
740
+ * `code` is `request.pipe_not_found` (an unknown `pipe_ref`), `request.pipe_unspecified`
741
+ * (no entry pipe) or `request.pipe_ambiguous` (an ambiguous code, several entry pipes), the
742
+ * candidates in its `params`; a registry-form `method_ref` is a `501`; a pipe whose
743
+ * artifacts cannot be derived is a `500`.
726
744
  *
727
745
  * A `method_ref` gets the fetch-sized budget, as on the other crate routes. On the
728
746
  * hosted API the gateway caps a request at about 30 seconds whatever the client allows,
@@ -764,9 +782,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
764
782
  * is live and the run is stuck, its workflow task failing until the platform
765
783
  * ends it at `degradation.ends_at`. `retry_after_seconds` carries the server's
766
784
  * `Retry-After` hint when present, and `request_id` the id to quote to support.
767
- * A failed run's stored report, `error`, and the `degradation` are each
768
- * checked field by field (see `RunErrorReport` and `RunDegradation`), so
769
- * neither ever fails the read. Throws `RunLifecycleUnavailableError` when the
785
+ * A failed run's problem, `error`, is kept when it is a problem document and
786
+ * read as `null` otherwise, and the `degradation` is checked field by field
787
+ * (see `RunDegradation`), so neither ever fails the read. Throws `RunLifecycleUnavailableError` when the
770
788
  * lifecycle routes are absent (a bare runner).
771
789
  */
772
790
  getRunStatus(runId: string, options?: {
@@ -800,10 +818,10 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
800
818
  * Maps the server's poll semantics to a discriminated union:
801
819
  * - HTTP 202 → `running` (with the `Retry-After` hint)
802
820
  * - HTTP 200 → `completed` (with the result artifacts)
803
- * - HTTP 409 → `failed` (terminal non-`COMPLETED`), carrying the problem's `detail` as
804
- * `message`, its `run_status` member as `status` (recovered from `detail` on a platform
805
- * that predates the member) and its `error` member, the run's stored error report, typed
806
- * as `error`
821
+ * - HTTP 409 `run.failed` → `failed` (terminal non-`COMPLETED`), carrying the problem as
822
+ * `problem`, its `detail` as `message`, the terminal status its `run_status` parameter names
823
+ * as `status`, and the run's own problem, which it nests as `run_error`, as `error`; a `409`
824
+ * `run.not_finished` → `running`, and any other `409` throws `ApiResponseError`
807
825
  * - HTTP 503 → `running` (Temporal degraded — retry, never fail a poller)
808
826
  *
809
827
  * `options.artifacts` narrows the read to the named artifacts, sent as one
@@ -840,8 +858,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
840
858
  * real error; no answer at all propagates, uncached. An answer is anything the
841
859
  * server sent back: a non-2xx status, a body that is not JSON, not UTF-8 or no
842
860
  * version, and a body that arrived but could not be decoded, such as a broken
843
- * gzip stream, which `requestRaw` reports as an `ApiUnreachableError` carrying
844
- * the decompressor's code (see `isUndecodableBody`).
861
+ * gzip stream, which `requestRaw` reports as an `ApiResponseError` (see
862
+ * `isUndecodableBody`).
845
863
  *
846
864
  * `signal` stops the handshake: its abort is thrown as is and nothing is cached.
847
865
  *
@@ -876,11 +894,13 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
876
894
  * rather than listing, reading and hashing the tree again.
877
895
  *
878
896
  * An error from the start, or from the blocking execute, says whether that request may still
879
- * have started a run whose id never reached the caller (`runMayHaveStarted`); when it may have,
880
- * it is not retryable, since calling this method again could pay for the run twice: look the run
881
- * up in the run history first. An error from the wait, once `onStarted` has named the run,
882
- * started nothing, so its `runMayHaveStarted` is false, and its `retryable` is about waiting
883
- * again on that id with `waitForResult`, never about calling this method again.
897
+ * have started a run whose id never reached the caller: its problem's `retry` is then
898
+ * `outcome_unknown`, since calling this method again could pay for the run twice, unless it is
899
+ * made with the same `idempotencyKey`: look the run up in the run history first. An error from
900
+ * the wait, once `onStarted` has named the run, started nothing, and its problem is about that
901
+ * run: `client.follow_failed` for a wait that ran out of time, whose step is to read the run
902
+ * again with `waitForResult`, or `run.failed` for a run that ended without success, never a
903
+ * reason to call this method again.
884
904
  *
885
905
  * `options.idempotencyKey` rides the durable start, so a call that failed while its start may
886
906
  * have created a run can be made again with the same options and the same key: the hosted API
@@ -959,16 +979,17 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
959
979
  * and for an id that is empty, `.` or `..`, which the URL would resolve into another route's
960
980
  * path.
961
981
  *
962
- * Throws `ApiResponseError`: `404` `not_found` for an unknown or foreign-org method, `409`
963
- * `method_being_deleted` while its erasure runs, and a `409` whose verdict is `runtime` for a
964
- * method whose draft names a tree the platform holds no record of. An answer whose `files` is
965
- * not a listing is an answer the SDK cannot read, thrown as an `ApiResponseError` too.
982
+ * Throws `ApiResponseError`: `404` `pipelex.catalog.not_found` for an unknown or foreign-org
983
+ * method, `409` `pipelex.catalog.being_deleted` while its erasure runs, and a `500`
984
+ * `runtime.unexpected` for a method whose draft names a tree the platform holds no record of. An
985
+ * answer whose `files` is not a listing is an answer the SDK cannot read, thrown as an
986
+ * `ApiResponseError` too.
966
987
  */
967
988
  getMethod(methodId: string): Promise<MethodDetail>;
968
989
  /**
969
990
  * Create a method — `POST /v1/methods`. The new method holds its tree as its draft and has no
970
- * published version, so its bare id answers `409 method_not_published` on the run and tooling
971
- * routes until its first `publishMethod`; its draft runs as `mt_…@draft` at once.
991
+ * published version, so its bare id answers `409` `pipelex.catalog.not_published` on the run and
992
+ * tooling routes until its first `publishMethod`; its draft runs as `mt_…@draft` at once.
972
993
  *
973
994
  * The tree is `files`, sent as given, or `tree` or `contents`, which the client sends inline
974
995
  * when its inline map weighs 256 KiB or less, or when the platform keeps no blob store, and
@@ -978,12 +999,12 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
978
999
  *
979
1000
  * Throws `RequestArgumentError` for two forms of the tree, or `contents` holding no file, before
980
1001
  * any request; `MethodFileTransferError` when a file the organization lacks could not be
981
- * uploaded, and nothing is saved. Throws `ApiResponseError`: `422` `invalid_method_files` for a
982
- * map the standard refuses, with its `tree_refusal`; `422` `method_tree_too_large` for a tree
983
- * past one of the deployment's limits, named in its `limit`; `422` `blob_mismatch` for a hash
984
- * stated at another size than the one held; `422` `missing_blobs` for a hash entry whose bytes
985
- * the organization does not hold; `413` `payload_too_large` for a method that would leave no
986
- * room for a publish.
1002
+ * uploaded, and nothing is saved. Throws `ApiResponseError`: `422` `method.package_invalid` for
1003
+ * a map the standard refuses, naming the path in its `params`, and for a tree past one of the
1004
+ * deployment's limits, its `params` carrying `reason` `too_large` and the integer `limit`;
1005
+ * `422` `request.invalid` for a hash stated at another size than the one held; `422`
1006
+ * `request.blobs_missing` for a hash entry whose bytes the organization does not hold; `413`
1007
+ * `request.too_large` for a method that would leave no room for a publish.
987
1008
  */
988
1009
  createMethod(input: MethodWriteInput): Promise<MethodData>;
989
1010
  /**
@@ -996,16 +1017,16 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
996
1017
  * `files: null` emptying the draft, or `tree` or `contents`, sent inline or by hash as
997
1018
  * `createMethod` sends them. `input_data` is three-way (see `MethodDraftInput`). With
998
1019
  * `expected_updated_at`, the write is a compare-and-swap on the draft token: a draft that
999
- * moved since is refused with a `409` whose `code` is `method_update_conflict`, and nothing is
1020
+ * moved since is refused with a `409` whose `code` is `pipelex.catalog.update_conflict`, and nothing is
1000
1021
  * written. Without it, last writer wins.
1001
1022
  *
1002
1023
  * Takes a bare catalog id, as `getMethod` does. Throws `RequestArgumentError` for a draft that
1003
1024
  * gives its tree in no form or in two, or `contents` holding no file, before any request;
1004
1025
  * `MethodFileTransferError` when a file the organization lacks could not be uploaded. Throws
1005
- * `ApiResponseError`: `404` `not_found` for an unknown or foreign-org method, `409`
1006
- * `method_being_deleted` while its erasure runs, the `422` refusals of a tree `createMethod`
1007
- * lists, `413` `payload_too_large` for a draft that would grow the method past the room a
1008
- * publish needs, `403` for a read-only key, and a `503` that wrote nothing, safe to retry,
1026
+ * `ApiResponseError`: `404` `pipelex.catalog.not_found` for an unknown or foreign-org method,
1027
+ * `409` `pipelex.catalog.being_deleted` while its erasure runs, the `422` refusals of a tree
1028
+ * `createMethod` lists, `413` `request.too_large` for a draft that would grow the method past the
1029
+ * room a publish needs, `403` for a read-only key, and a `503` that wrote nothing, safe to retry,
1009
1030
  * when the method kept changing under the write.
1010
1031
  */
1011
1032
  writeDraft(methodId: string, input: MethodDraftInput): Promise<MethodData>;
@@ -1177,11 +1198,11 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1177
1198
  * draft, so the `updated_at` a caller holds stays valid for its next `writeDraft` or
1178
1199
  * `publishMethod`.
1179
1200
  *
1180
- * Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404` `not_found`,
1181
- * `409` `method_being_deleted`, `403` for a read-only key, `422` for an empty name or one
1182
- * holding a lone surrogate, `413` `payload_too_large` for a name so long it would leave the
1183
- * method too large to publish, and a `503` that wrote nothing, safe to retry, when draft
1184
- * writes kept landing under the rename.
1201
+ * Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404`
1202
+ * `pipelex.catalog.not_found`, `409` `pipelex.catalog.being_deleted`, `403` for a read-only key,
1203
+ * `422` for an empty name or one holding a lone surrogate, `413` `request.too_large` for a name
1204
+ * so long it would leave the method too large to publish, and a `503` that wrote nothing, safe
1205
+ * to retry, when draft writes kept landing under the rename.
1185
1206
  */
1186
1207
  renameMethod(methodId: string, input: MethodRenameInput): Promise<MethodData>;
1187
1208
  /**
@@ -1195,16 +1216,17 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1195
1216
  * The answer is a `MethodPublishResult` discriminated on `outcome` — branch on it:
1196
1217
  * `published` with the new `version`; `unchanged` with the existing latest `version`;
1197
1218
  * `refused` with a `reason` (`invalid`, or `not_runnable` for a draft that validates with
1198
- * pending signatures), a `message` and the runner's `validation` verdict. Every arm carries the
1199
- * `method`. A publish moves no token.
1219
+ * pending signatures), a `message` and the runner's `validation` verdict, whose problem items
1220
+ * are read member by member as `validate` reads them. Every arm carries the `method`. A publish
1221
+ * moves no token.
1200
1222
  *
1201
1223
  * Takes a bare catalog id, as `getMethod` does. Throws `RequestArgumentError` when
1202
1224
  * `expected_draft_updated_at` is not a string, before any request. Throws `ApiResponseError`
1203
- * when no verdict was produced: `409` `method_update_conflict` for a draft that moved since
1204
- * the token, `409` `method_being_deleted`, `404` `not_found`, `422` for a draft with no
1205
- * `.mthds` file or whose file names a run could not assemble (one name used by a `.mthds` and
1206
- * a Python file), `413` `payload_too_large` for a draft too large to publish, and `403` for a
1207
- * read-only key.
1225
+ * when no verdict was produced: `409` `pipelex.catalog.update_conflict` for a draft that moved since
1226
+ * the token, `409` `pipelex.catalog.being_deleted`, `404` `pipelex.catalog.not_found`, `422` for
1227
+ * a draft with no `.mthds` file or whose file names a run could not assemble (one name used by a
1228
+ * `.mthds` and a Python file), `413` `request.too_large` for a draft too large to publish, and
1229
+ * `403` for a read-only key.
1208
1230
  *
1209
1231
  * Only a draft that differs from the latest version reaches the runner, and a runner that
1210
1232
  * cannot be reached, answers unusably or does not finish within the platform's deadline is a
@@ -1212,8 +1234,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1212
1234
  * itself is relayed under its own status. A retry of a publish that landed while its answer was
1213
1235
  * lost, as on a client timeout, answers `unchanged` with the version it wrote.
1214
1236
  *
1215
- * An answer whose `outcome` is not one of the outcomes above, or that carries no `method`
1216
- * object, is an answer the SDK cannot read, thrown as an `ApiResponseError` too.
1237
+ * An answer whose `outcome` is not one of the outcomes above, that carries no `method` object,
1238
+ * or a refusal whose `validation` is not a verdict object with a boolean `is_valid`, is an answer
1239
+ * the SDK cannot read, thrown as an `ApiResponseError` too.
1217
1240
  */
1218
1241
  publishMethod(methodId: string, input: MethodPublishInput): Promise<MethodPublishResult>;
1219
1242
  /**
@@ -1224,10 +1247,11 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1224
1247
  * may be short while `nextCursor` is set, because the platform reads versions whole. A method
1225
1248
  * never published answers an empty page.
1226
1249
  *
1227
- * Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404` `not_found`
1228
- * for an unknown method, `409` `method_being_deleted`, `400` `malformed_request` for a cursor
1229
- * the listing did not issue for this method, `422` for a `limit` outside 1 to 100. A page whose `items` is not an array or whose `next_cursor` is neither a string nor `null`
1230
- * is an answer the SDK cannot read, thrown as an `ApiResponseError` too.
1250
+ * Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404`
1251
+ * `pipelex.catalog.not_found` for an unknown method, `409` `pipelex.catalog.being_deleted`, and
1252
+ * `422` `request.invalid` for a cursor the listing did not issue for this method or a `limit`
1253
+ * outside 1 to 100. A page whose `items` is not an array or whose `next_cursor` is neither a
1254
+ * string nor `null` is an answer the SDK cannot read, thrown as an `ApiResponseError` too.
1231
1255
  */
1232
1256
  listMethodVersions(methodId: string, query?: ListMethodVersionsQuery): Promise<MethodVersionPage>;
1233
1257
  /**
@@ -1237,10 +1261,10 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1237
1261
  *
1238
1262
  * Takes a bare catalog id, as `getMethod` does, and the version number. Throws
1239
1263
  * `RequestArgumentError` for a `version` that is not a positive integer, before any request.
1240
- * Throws `ApiResponseError`: `404` `method_version_not_found` for a version the method never
1241
- * published, `404` `not_found` for an unknown method, `409` `method_being_deleted`, and `409`
1242
- * `conflict`, whose verdict is `runtime`, for a version stored before methods were trees and
1243
- * never rewritten as one, which names no tree to serve.
1264
+ * Throws `ApiResponseError`: `404` `pipelex.catalog.not_found` for a version the method never
1265
+ * published and for an unknown method, `409` `pipelex.catalog.being_deleted`, and `500`
1266
+ * `runtime.unexpected` for a version stored before methods were trees and never rewritten as
1267
+ * one, which names no tree to serve.
1244
1268
  */
1245
1269
  getMethodVersion(methodId: string, version: number): Promise<MethodVersion>;
1246
1270
  /**
@@ -1258,7 +1282,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1258
1282
  * The answer is a `MethodCopyResult` discriminated on `outcome` — branch on it: `copied` with
1259
1283
  * the copy as `method`, `examples_copied` and `stored_files_copied`; `refused` with the
1260
1284
  * `reason` `bundle_names_other_storage`, a `message` and every `references` entry (`{ path, uri
1261
- * }`) a `.mthds` file of the draft holds that the destination cannot read, nothing written.
1285
+ * }`) a `.mthds` file of the draft holds that the destination cannot read and, in a duplicate,
1286
+ * that names a file under the original's run files, which erasing the original would remove,
1287
+ * nothing written.
1262
1288
  *
1263
1289
  * The route serves web sessions only: a Pipelex API key belongs to one organization and cannot
1264
1290
  * speak for another. `options.idempotencyKey` is sent as the `Idempotency-Key` header, so a copy
@@ -1271,21 +1297,31 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1271
1297
  * `destination_org_id` that is not a non-empty string, a `name` or an
1272
1298
  * `expected_draft_updated_at` given that is not a string, and a malformed idempotency key.
1273
1299
  * Throws `ApiResponseError` when no verdict was produced, each refusal writing nothing a reader
1274
- * sees: `403` `forbidden` for a request that is not from a web session; `403`
1275
- * `role_not_permitted` for a role that may not change methods, in the method's organization or
1276
- * in the destination; `404` `organization_not_found` for a destination the caller does not
1277
- * belong to, still being set up or unknown, alike; `404` `not_found` for an unknown method;
1278
- * `409` `method_being_deleted`; `409` `method_update_conflict` for a draft that moved since
1279
- * `expected_draft_updated_at`; `409` `conflict`, `runtime`, for a draft whose tree the
1280
- * organization holds no full record of; `413` `payload_too_large` for an example or a copy too
1281
- * large for one stored item; `422` `validation_failed` for a body that does not validate, such
1282
- * as a name holding a lone surrogate; `422` `method_copy_too_large` past one of the copy's
1283
- * bounds on the stored files it copies, named by `problemDocument.limit` (`MethodCopyLimit`);
1284
- * and, each retryable, a `502` when the platform could not read the caller's memberships, a
1285
- * `500` `storage_backend_failed` and a `503` past the copy's deadline. An answer whose
1286
- * `outcome` is neither arm's, a `copied` one whose `method` is not an object or a `refused` one
1287
- * whose `references` is not an array, is an answer the SDK cannot read, thrown as an
1288
- * `ApiResponseError` too.
1300
+ * sees but for the `503` whose `detail` names the copy: `403` `auth.forbidden` for a request
1301
+ * that is not from a web session, or for a role that may not change methods, in the method's
1302
+ * organization or in the destination; `404` `pipelex.org.not_found` for a destination the
1303
+ * caller does not belong to, still being set up or unknown, alike; `404`
1304
+ * `pipelex.catalog.not_found` for an unknown method; `409` `pipelex.catalog.being_deleted`;
1305
+ * `409` `pipelex.catalog.update_conflict` for a draft that moved since
1306
+ * `expected_draft_updated_at`; a `409` whose `domain` is `runtime` and `retry` `no`, for a
1307
+ * draft whose tree the method's organization holds no record of or no longer holds every file
1308
+ * of; `413`
1309
+ * `request.too_large` for a copied example, or the copy's row, too large for one stored item,
1310
+ * the row keeping room for the summary a publish adds, so a `name` that would leave none is
1311
+ * refused; `422` `request.invalid` for a body that does not validate, such as a name holding a
1312
+ * lone surrogate; `422` `pipelex.catalog.copy_too_large` past one of the copy's bounds on the
1313
+ * stored files it copies, named by the problem's `limit` member (`MethodCopyLimit`); a `502`
1314
+ * `runtime.unavailable`, with `retry` `yes`, when the platform could not read the caller's
1315
+ * memberships; a `503` `pipelex.storage.unavailable`, with `retry` `yes`, when storage failed,
1316
+ * and a `500` `pipelex.storage.not_configured`, with `retry` `no`, when the platform has no
1317
+ * usable credentials for storage; and a `503` `runtime.unavailable`, with `retry` `yes`, past
1318
+ * the copy's deadline, when a stored file it copies is written over meanwhile, or when DynamoDB
1319
+ * fails. When DynamoDB failed both the copy's row write and the read that would confirm it,
1320
+ * that `503`'s `detail` names the copy's method id: the copy may stand in the destination, so
1321
+ * look for that id there before copying again, since a retry may make a second copy. An answer
1322
+ * whose `outcome` is neither arm's, a `copied` one whose `method` is not an object or a
1323
+ * `refused` one whose `references` is not an array, is an answer the SDK cannot read, thrown as
1324
+ * an `ApiResponseError` too.
1289
1325
  */
1290
1326
  copyMethod(methodId: string, input: MethodCopyInput, options?: MethodCopyRequestOptions): Promise<MethodCopyResult>;
1291
1327
  /**
@@ -1301,11 +1337,11 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1301
1337
  * and a copy itself, answer an empty page. The listing is open to every member of the method's
1302
1338
  * organization, a runner included, as every read of a method is.
1303
1339
  *
1304
- * Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404` `not_found` for
1305
- * an unknown method, `409` `method_being_deleted`, `400` `malformed_request` for a cursor the
1306
- * listing did not issue for this method, `422` for a `limit` outside 1 to 100. A page whose
1307
- * `items` is not an array or whose `next_cursor` is neither a string nor `null` is an answer the
1308
- * SDK cannot read, thrown as an `ApiResponseError` too.
1340
+ * Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404`
1341
+ * `pipelex.catalog.not_found` for an unknown method, `409` `pipelex.catalog.being_deleted`, and
1342
+ * `422` `request.invalid` for a cursor the listing did not issue for this method or a `limit`
1343
+ * outside 1 to 100. A page whose `items` is not an array or whose `next_cursor` is neither a
1344
+ * string nor `null` is an answer the SDK cannot read, thrown as an `ApiResponseError` too.
1309
1345
  */
1310
1346
  listMethodCopies(methodId: string, query?: ListMethodCopiesQuery): Promise<MethodCopyPage>;
1311
1347
  /**
@@ -1321,7 +1357,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1321
1357
  * it with a `409`.
1322
1358
  *
1323
1359
  * A double-clicked delete is safe: the claim is a conditional write, so the
1324
- * second call is an `ApiResponseError` (`409 method_being_deleted`) rather than a
1360
+ * second call is an `ApiResponseError` (`409` `pipelex.catalog.being_deleted`) rather than a
1325
1361
  * second cascade over the same runs. An unknown or foreign-org id is a `404`. The
1326
1362
  * erasure deletes the method's published versions with the rest. Takes a bare catalog id,
1327
1363
  * as `getMethod` does: the whole method is erased, never one of its versions.
@@ -1336,8 +1372,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1336
1372
  * closed, and a `null` `run_id` reads as not given. Throws `RequestArgumentError` before any
1337
1373
  * request when `name` or `inputs` is not given (`null` counting as not given), and for a
1338
1374
  * `run_id` that is given but is not a non-empty string. Throws `ApiResponseError`: `404`
1339
- * `run_not_found` for a `run_id` that is not one of this method's runs in the caller's
1340
- * organization, with nothing written; `413` `payload_too_large` for an example larger than one
1375
+ * `run.not_found` for a `run_id` that is not one of this method's runs in the caller's
1376
+ * organization, with nothing written; `413` `request.too_large` for an example larger than one
1341
1377
  * stored item holds; `422` for a name that is empty, blank or over 200 characters, or inputs
1342
1378
  * that are not a JSON object; and the codes every example route answers.
1343
1379
  */
@@ -1350,12 +1386,12 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1350
1386
  * may be short while `nextCursor` is set, because the platform reads examples whole and stops
1351
1387
  * a read at 1 MB; `iterateMethodExamples` follows the cursor for a caller that wants them all.
1352
1388
  *
1353
- * Throws `ApiResponseError`: `400` `malformed_request` for a cursor the listing did not issue
1354
- * for this method, `422` for a `limit` outside 1 to 100, and the codes every example route
1355
- * answers. A page whose `items` is not an array, whose `next_cursor` is neither a string nor
1356
- * `null`, or one of whose items is not an example `readMethodExample` can read, is an answer
1357
- * the SDK cannot read, thrown as an `ApiResponseError` too. An example whose inputs hold an
1358
- * integer past the safe range is read like any other, that integer as a `bigint`.
1389
+ * Throws `ApiResponseError`: `422` `request.invalid` for a cursor the listing did not issue for
1390
+ * this method or a `limit` outside 1 to 100, and the codes every example route answers. A page
1391
+ * whose `items` is not an array, whose `next_cursor` is neither a string nor `null`, or one of
1392
+ * whose items is not an example `readMethodExample` can read, is an answer the SDK cannot read,
1393
+ * thrown as an `ApiResponseError` too. An example whose inputs hold an integer past the safe
1394
+ * range is read like any other, that integer as a `bigint`.
1359
1395
  */
1360
1396
  listMethodExamples(methodId: string, query?: ListMethodExamplesQuery): Promise<MethodExamplePage>;
1361
1397
  /**
@@ -1407,7 +1443,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1407
1443
  *
1408
1444
  * Throws `RequestArgumentError` before any request for an example id that is empty, `.` or
1409
1445
  * `..`, or when neither `name` nor `inputs` is given. Throws `ApiResponseError`: `413`
1410
- * `payload_too_large` for inputs larger than one stored item holds, `422` for a name that is
1446
+ * `request.too_large` for inputs larger than one stored item holds, `422` for a name that is
1411
1447
  * empty, blank or over 200 characters, or inputs that are not a JSON object, a `503` that wrote
1412
1448
  * nothing, safe to retry, when concurrent edits kept landing under the write, and the codes
1413
1449
  * every example route answers.
@@ -1425,13 +1461,13 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1425
1461
  * since and nothing was written. A stale run is the expected end of a run that outlasted an
1426
1462
  * edit, so it is answered, never thrown. Both arms carry the `example` as it stands.
1427
1463
  *
1428
- * Throws `RequestArgumentError` before any request, checking in this order: an example id that
1429
- * is empty, `.` or `..`, or holds a lone surrogate, a `run_id` that is not a non-empty string,
1430
- * and an `input_revision` that is not a positive integer. Throws `ApiResponseError` when no
1431
- * verdict was produced: `404` `not_found` for an example deleted since, `404` `run_not_found`
1432
- * for a run that is not one of this method's, with nothing written, and the codes every example
1433
- * route answers. An answer whose `outcome` is neither arm's, or whose `example` is not an
1434
- * example `readMethodExample` can read, is an answer the SDK cannot read, thrown as an
1464
+ * Throws `RequestArgumentError` before any request, checking in this order: an example id that is
1465
+ * empty, `.` or `..`, or holds a lone surrogate, a `run_id` that is not a non-empty string, and
1466
+ * an `input_revision` that is not a positive integer. Throws `ApiResponseError` when no verdict
1467
+ * was produced: `404` `pipelex.catalog.not_found` for an example deleted since, `404`
1468
+ * `run.not_found` for a run that is not one of this method's, with nothing written, and the codes
1469
+ * every example route answers. An answer whose `outcome` is neither arm's, or whose `example` is
1470
+ * not an example `readMethodExample` can read, is an answer the SDK cannot read, thrown as an
1435
1471
  * `ApiResponseError` too, read as `publishMethod` reads its verdict.
1436
1472
  */
1437
1473
  recordMethodExampleLatestRun(methodId: string, exampleId: string, input: MethodExampleLatestRunInput): Promise<MethodExampleLatestRunResult>;
@@ -1457,8 +1493,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1457
1493
  * the body is closed, and `null` reads as not given. Throws `RequestArgumentError` before any
1458
1494
  * request when `name` or `inputs` is not given, for an `example_id` that is not a non-empty
1459
1495
  * string or an `input_revision` that is not a positive integer, and when only one of the two is
1460
- * given. Throws `ApiResponseError`: `403` `role_not_permitted` for a role that may not change
1461
- * methods, such as a runner; `413` `payload_too_large` for an example larger than one stored item
1496
+ * given. Throws `ApiResponseError`: `403` `auth.forbidden` for a role that may not change
1497
+ * methods, such as a runner; `413` `request.too_large` for an example larger than one stored item
1462
1498
  * holds; `422` for a name that is empty, blank or over 200 characters, or inputs that are not a
1463
1499
  * JSON object; and the codes every example route answers. An answer whose `outcome` is neither
1464
1500
  * arm's, or whose `example` is not an example `readMethodExample` can read, is an answer the SDK
@@ -1469,10 +1505,10 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1469
1505
  * Delete an example — `DELETE /v1/methods/{id}/examples/{example_id}`. The platform answers
1470
1506
  * `204`. Deleting the example leaves its latest run in the method's history.
1471
1507
  *
1472
- * Throws `RequestArgumentError` for an example id that is empty, `.` or `..`, before any
1473
- * request: `..` would address the method, and its erasure would answer the delete. Throws
1474
- * `ApiResponseError`: `404` `not_found` when there is no such example, one already deleted
1475
- * included, and the codes every example route answers.
1508
+ * Throws `RequestArgumentError` for an example id that is empty, `.` or `..`, before any request:
1509
+ * `..` would address the method, and its erasure would answer the delete. Throws
1510
+ * `ApiResponseError`: `404` `pipelex.catalog.not_found` when there is no such example, one
1511
+ * already deleted included, and the codes every example route answers.
1476
1512
  */
1477
1513
  deleteMethodExample(methodId: string, exampleId: string): Promise<void>;
1478
1514
  /** The caller's org memberships + active-org feature flags — `GET /v1/organizations/memberships`. */
@@ -1508,17 +1544,17 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1508
1544
  *
1509
1545
  * Throws `RequestArgumentError` for an organization id that is empty, `.` or `..`, before any
1510
1546
  * request. Throws `ApiResponseError`, refusing every change of the request when it refuses one:
1511
- * `403` `forbidden` when `orgId` is not the active organization, `403` `role_not_permitted` for
1512
- * a caller who is not its admin, `404` for a missing organization, `409` `conflict` for a
1513
- * personal workspace, which has no branding, and `422` `validation_failed` for a colour that is
1514
- * not `#rrggbb` or a key the body does not know. A logo's refusal names its slot in the error's
1515
- * `errors[]`, each entry's `field` being `square_logo` or `wide_logo` and its `detail` the
1516
- * sentence to show under that slot: `400` `invalid_storage_uri` for a URI that is not a storage
1517
- * URI, `403` `forbidden` for another organization's file, and `422` `validation_failed` with a
1518
- * `LogoRefusalCode` per broken rule for a file the platform refused. A failure of the platform's
1519
- * storage while reading or copying a logo is a `500` `storage_backend_failed`, retryable, with
1520
- * nothing written. A `503` `service_unavailable` is a failure of its database, after which the
1521
- * write may have landed or not: the same input sent again is safe.
1547
+ * `403` `pipelex.org.mismatch` when `orgId` is not the active organization, `403`
1548
+ * `auth.forbidden` for a caller who is not its admin, `404` `pipelex.org.not_found` for a missing
1549
+ * organization, `409` `pipelex.org.not_manageable` for a personal workspace, which has no
1550
+ * branding, and `422` `request.invalid` for a colour that is not `#rrggbb` or a key the body does
1551
+ * not know. A logo's refusal names its slot in its problem's `errors`, each item's
1552
+ * `location.field` being `square_logo` or `wide_logo` and its `detail` the sentence to show under
1553
+ * that slot: `422` `pipelex.storage.uri_invalid` for a URI that is not a storage URI, `403`
1554
+ * `pipelex.org.mismatch` for another organization's file, and `422` `request.invalid` with an
1555
+ * item per broken rule, its code one `LogoRefusalCode` names, for a file the platform refused. A
1556
+ * `503` `runtime.unavailable` is a failure of the platform's storage or its database, after which
1557
+ * the write may have landed or not: the same input sent again is safe.
1522
1558
  */
1523
1559
  updateOrganizationBranding(orgId: string, input: OrganizationBrandingUpdate): Promise<OrganizationBranding>;
1524
1560
  /** The active org's subscription state — `GET /v1/billing/subscription`. */
@@ -1533,7 +1569,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1533
1569
  }): Promise<CheckoutResponse>;
1534
1570
  /**
1535
1571
  * Switch the existing subscription's plan — `POST /v1/billing/change-plan`.
1536
- * A 409 `conflict` (`ApiResponseError.code`) means there is no subscription
1572
+ * A 409 `pipelex.billing.subscription_conflict` (`ApiResponseError.code`) means there is no subscription
1537
1573
  * to change — start one via `createCheckout` first.
1538
1574
  */
1539
1575
  changePlan(input: {
@@ -1541,14 +1577,14 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1541
1577
  }): Promise<ChangePlanResponse>;
1542
1578
  /**
1543
1579
  * A Stripe billing-portal session URL — `GET /v1/billing/portal`. A 409
1544
- * `conflict` (`ApiResponseError.code`) means there is no subscription yet.
1580
+ * `pipelex.billing.subscription_conflict` (`ApiResponseError.code`) means there is no subscription yet.
1545
1581
  */
1546
1582
  getBillingPortal(): Promise<BillingPortalResponse>;
1547
1583
  /** List the caller's Pipelex API keys — `GET /v1/pipelex-api-keys`. */
1548
1584
  listPipelexApiKeys(): Promise<PipelexApiKeyList>;
1549
1585
  /**
1550
1586
  * Mint a Pipelex API key — `POST /v1/pipelex-api-keys`. The plaintext
1551
- * `api_key` is returned ONCE. A 409 `pipelex_api_key_limit_reached`
1587
+ * `api_key` is returned ONCE. A 409 `pipelex.billing.plan_limit`
1552
1588
  * (`ApiResponseError.code`) means the per-account key limit is hit.
1553
1589
  */
1554
1590
  createPipelexApiKey(input: {
@@ -1609,8 +1645,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1609
1645
  /**
1610
1646
  * Upload a base64 file — `POST /v1/upload`, answering the file's `uri`, the `filename` as sent
1611
1647
  * and the `file_id` of its record. An answer with no non-empty string `uri` names no
1612
- * stored file, so it is an answer the SDK cannot read: an `ApiResponseError`, `runtime` and
1613
- * not retryable, which `uploadFile` wraps as an `UploadTransportError` with code `unexpected`.
1648
+ * stored file, so it is an answer the SDK cannot read: an `ApiResponseError` whose problem is
1649
+ * `client.response_unreadable`, which `uploadFile` wraps as an `UploadTransportError` with the
1650
+ * reason `unexpected`.
1614
1651
  */
1615
1652
  upload(input: UploadInput): Promise<UploadedFile>;
1616
1653
  /**
@@ -1631,9 +1668,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1631
1668
  * target is short-lived and a bearer capability, so keep it out of logs. The route
1632
1669
  * never replays a grant: ask again for a new one rather than retrying; with a
1633
1670
  * `sha256`, a new grant answers the same file record. A declared `size` over the cap
1634
- * is a `413` `ApiResponseError` (`code` `payload_too_large`), a malformed `sha256` and
1635
- * a `size` other than the one the organization holds those bytes at are a `422`, and a
1636
- * deployment without the route answers a `404`. See `docs/input-preparation.md`.
1671
+ * is a `413` `ApiResponseError` (`code` `request.too_large`), a malformed `sha256` and
1672
+ * a `size` other than the one the organization holds those bytes at are a `422`
1673
+ * (`request.invalid`), and a deployment without the route answers a `404`. See `docs/input-preparation.md`.
1637
1674
  */
1638
1675
  requestUploadGrant(input: UploadGrantInput, options?: {
1639
1676
  signal?: AbortSignal;
@@ -1699,7 +1736,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1699
1736
  *
1700
1737
  * Throws `ApiResponseError`: `400` for a date bound that is not an instant with an offset, a
1701
1738
  * range whose start is after its end, or a cursor of another list or other filters; `404`
1702
- * `run_not_found` for a run that is not the organization's; `422` for a `limit` outside 1 to
1739
+ * `run.not_found` for a run that is not the organization's; `422` for a `limit` outside 1 to
1703
1740
  * 200, an unknown `kind`, more than 100 values of `format` or `mediaType`, or an id that cannot
1704
1741
  * be one. A page whose `items` is not an array or whose `next_cursor` is neither a string nor
1705
1742
  * `null` is an `ApiResponseError` of an answer the SDK cannot read. See `docs/files.md`.
@@ -1736,10 +1773,11 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1736
1773
  * `stored` when its bytes are there.
1737
1774
  *
1738
1775
  * Throws `RequestArgumentError` for a file id that is empty, `.` or `..`, or holds a lone
1739
- * surrogate, before any request. Throws `ApiResponseError`: `404` `not_found` for a file that is
1740
- * not the organization's; `422` for a `usesLimit` outside 1 to 200 or an id that cannot be one.
1741
- * An answer that is not an object, or whose `uses` is not a page of `items` and `next_cursor`, is
1742
- * an answer the SDK cannot read, thrown as an `ApiResponseError` too. See `docs/files.md`.
1776
+ * surrogate, before any request. Throws `ApiResponseError`: `404` `pipelex.storage.not_found` for
1777
+ * a file that is not the organization's; `422` for a `usesLimit` outside 1 to 200 or an id that
1778
+ * cannot be one. An answer that is not an object, or whose `uses` is not a page of `items` and
1779
+ * `next_cursor`, is an answer the SDK cannot read, thrown as an `ApiResponseError` too. See
1780
+ * `docs/files.md`.
1743
1781
  */
1744
1782
  getFile(fileId: string, query?: GetFileQuery): Promise<FileDetail>;
1745
1783
  /**
@@ -1754,10 +1792,10 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1754
1792
  * kept records.
1755
1793
  *
1756
1794
  * Throws `RequestArgumentError` for a `uri` that is not a non-empty string, before any request.
1757
- * Throws `ApiResponseError`: `400` `invalid_storage_uri` for a malformed address, `403`
1758
- * `forbidden` for another organization's, `404` `run_not_found` for a run that is not the
1759
- * organization's, and `422` for an address over 512 characters. An answer whose `items` is not an
1760
- * array is an answer the SDK cannot read, thrown as an `ApiResponseError` too.
1795
+ * Throws `ApiResponseError`: `pipelex.storage.uri_invalid` for a malformed address, `403`
1796
+ * `pipelex.org.mismatch` for another organization's, `404` `run.not_found` for a run that is not
1797
+ * the organization's, and `422` for an address over 512 characters. An answer whose `items` is
1798
+ * not an array is an answer the SDK cannot read, thrown as an `ApiResponseError` too.
1761
1799
  */
1762
1800
  getFilesByUri(uri: string, options?: GetFilesByUriOptions): Promise<FileRecordList>;
1763
1801
  /**
@@ -1777,9 +1815,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1777
1815
  *
1778
1816
  * Sends `name` alone: the body is closed. Throws `RequestArgumentError` for a file id that is
1779
1817
  * empty, `.` or `..`, or holds a lone surrogate, and for a `name` that is not a string, before
1780
- * any request. Throws `ApiResponseError`: `403` `role_not_permitted` past the rule above; `404`
1781
- * `not_found` for a file that is not the organization's; `422` for a name over 512 characters or
1782
- * with nothing left once cleaned. An answer that is not an object is an answer the SDK cannot
1818
+ * any request. Throws `ApiResponseError`: `403` `auth.forbidden` past the rule above; `404`
1819
+ * `pipelex.storage.not_found` for a file that is not the organization's; `422` for a name over
1820
+ * 512 characters or with nothing left once cleaned. An answer that is not an object is an answer the SDK cannot
1783
1821
  * read, thrown as an `ApiResponseError` too.
1784
1822
  */
1785
1823
  renameFile(fileId: string, input: FileRenameInput): Promise<FileRecord>;
@@ -1806,8 +1844,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1806
1844
  * Sends each file as `{ file_id }` or `{ uri }` and nothing else: the body is closed. Throws
1807
1845
  * `RequestArgumentError` before any request when `files` is not a list, or one of its items does
1808
1846
  * not name exactly one of `file_id` and `uri` as a non-empty string. Throws `ApiResponseError`:
1809
- * `422` for more than 100 files, or an id or address longer than one can be; `500` `config` when
1810
- * the platform cannot sign at all. An answer that is not one item per requested file, each an
1847
+ * `422` `request.invalid` for more than 100 files, or an id or address longer than one can be;
1848
+ * `500` `pipelex.storage.not_configured` when the platform cannot sign at all. An answer that is not one item per requested file, each an
1811
1849
  * object with its `url` or its `error`, is an answer the SDK cannot read, thrown as an
1812
1850
  * `ApiResponseError` whose body hides every link.
1813
1851
  */
@@ -1830,18 +1868,18 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1830
1868
  * list of non-empty strings, when `run_id` is not a non-empty string, and when `name` is not a
1831
1869
  * string. Throws `ApiResponseError`:
1832
1870
  *
1833
- * - `422` `file_archive_too_large` past a cap, at most 500 files or 2,000,000,000 bytes, whose
1834
- * `problemDocument.limit` names it (`FileArchiveLimit`), so the person can be told how far over
1835
- * the selection is;
1836
- * - `422` `validation_failed` for more than 1,000 ids listed, or an id longer than one can be;
1837
- * - `404` `not_found` for a file that is not the organization's, the `detail` naming up to five
1838
- * of them, or a run whose files hold nothing stored to zip; `404` `run_not_found` for a run
1839
- * that is not the organization's;
1840
- * - `409` `conflict`: an `input` one, not retryable, for a selected file whose upload has not
1841
- * finished; a `runtime` one, retryable, for a run whose files are not all recorded yet, which
1842
- * the same request clears a few seconds after the run ends;
1843
- * - `503` `service_unavailable`, retryable, when the archive could not be queued: the same request
1844
- * sent again asks for a new archive.
1871
+ * - `422` `pipelex.files.archive_too_large` past a cap, at most 500 files or 2,000,000,000
1872
+ * bytes, whose problem's `limit` member names it (`FileArchiveLimit`), so the person can be told
1873
+ * how far over the selection is;
1874
+ * - `422` `request.invalid` for more than 1,000 ids listed, or an id longer than one can be;
1875
+ * - `404` `pipelex.storage.not_found` for a file that is not the organization's, the `detail`
1876
+ * naming up to five of them, or a run whose files hold nothing stored to zip; `404`
1877
+ * `run.not_found` for a run that is not the organization's;
1878
+ * - `409` `run.not_finished`, `retry` `yes`, for a run whose files are not all recorded yet,
1879
+ * which the same request clears a few seconds after the run ends, and a `409` with `retry` `no`
1880
+ * for a selected file whose upload has not finished;
1881
+ * - `503` `runtime.unavailable`, `retry` `yes`, when the archive could not be queued: the same
1882
+ * request sent again asks for a new archive.
1845
1883
  *
1846
1884
  * An answer that is not an archive, an object with a string `archive_id` and a known `state`, is
1847
1885
  * an answer the SDK cannot read, thrown as an `ApiResponseError` too.
@@ -1860,10 +1898,10 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1860
1898
  * still `queued` or `building` an hour after it was asked for reads as `failed`.
1861
1899
  *
1862
1900
  * Throws `RequestArgumentError` for an archive id that is empty, `.` or `..`, or holds a lone
1863
- * surrogate, before any request. Throws `ApiResponseError`: `404` `not_found` for an archive that
1864
- * is not the organization's, never existed, or has expired, a day after `created_at`; `500` when
1865
- * the link cannot be signed. An answer that is not an archive is an answer the SDK cannot read,
1866
- * thrown as an `ApiResponseError` whose body hides the link.
1901
+ * surrogate, before any request. Throws `ApiResponseError`: `404` `pipelex.storage.not_found` for
1902
+ * an archive that is not the organization's, never existed, or has expired, a day after
1903
+ * `created_at`; `500` when the link cannot be signed. An answer that is not an archive is an
1904
+ * answer the SDK cannot read, thrown as an `ApiResponseError` whose body hides the link.
1867
1905
  */
1868
1906
  getFileArchive(archiveId: string): Promise<FileArchive>;
1869
1907
  /**
@@ -1894,14 +1932,15 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1894
1932
  * `expected_updated_at`, and nothing else: the body is closed, and a `null` token reads as not
1895
1933
  * given. Throws `RequestArgumentError` before any request for a `file_id` or a `path` that is not
1896
1934
  * a non-empty string, and an `expected_updated_at` that is not a string. Throws
1897
- * `ApiResponseError`: `403` `role_not_permitted` for a role that may not change methods; `404`
1898
- * for an unknown method or a file that is not the organization's; `409` `method_being_deleted`,
1899
- * `409` `method_update_conflict` for a stale `expected_updated_at`, and `409` `conflict` for a
1900
- * file whose upload has not finished or whose stored bytes do not match its record; `422`
1901
- * `invalid_method_files` for a path the draft cannot hold, such as `.env` or `../logo.png`, and
1902
- * `422` `method_tree_too_large` past the deployment's limits. An answer whose `blob` is neither
1903
- * arm's, or whose `file` or `method` is not an object, is an answer the SDK cannot read, thrown
1904
- * as an `ApiResponseError` too.
1935
+ * `ApiResponseError`: `403` `auth.forbidden` for a role that may not change methods; `404`
1936
+ * for an unknown method or a file that is not the organization's; `409` `pipelex.catalog.being_deleted`,
1937
+ * `409` `pipelex.catalog.update_conflict` for a stale `expected_updated_at`, and `409` `conflict` for a
1938
+ * file whose upload has not finished or whose stored bytes do not match its record; and `422`
1939
+ * `method.package_invalid` for a path the draft cannot hold, such as `.env` or `../logo.png`,
1940
+ * naming the path in its `params`, and past the deployment's limits, its `params` carrying
1941
+ * `reason` `too_large` and the integer `limit`. An answer whose `blob` is neither arm's, or
1942
+ * whose `file` or `method` is not an object, is an answer the SDK cannot read, thrown as an
1943
+ * `ApiResponseError` too.
1905
1944
  */
1906
1945
  copyFileIntoDraft(methodId: string, input: DraftFileFromFileInput): Promise<DraftFileFromFileResult>;
1907
1946
  /**
@@ -1919,7 +1958,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1919
1958
  * `iterateRuns` does the latter for you.
1920
1959
  *
1921
1960
  * Each item is a `RunHistoryItem` — the id, status, timestamps, pipe and,
1922
- * for a failed run, its error report. The run's organization, creator,
1961
+ * for a failed run, its own problem. The run's organization, creator,
1923
1962
  * method and workflow id are not on the list; `getRunDetail` returns them.
1924
1963
  *
1925
1964
  * `createdFrom` / `createdTo` are applied server-side as index key
@@ -1974,8 +2013,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1974
2013
  * The whole record for one run — `GET /v1/runs/{id}`.
1975
2014
  *
1976
2015
  * The ONLY call that returns what the run actually executed and its
1977
- * `inputs`. Kept off the status read, which pollers hit every few seconds. A failed run's stored report, `error`, is checked field by
1978
- * field (see `RunErrorReport`).
2016
+ * `inputs`. Kept off the status read, which pollers hit every few seconds. A failed run's problem, `error`, is kept when it is a
2017
+ * problem document and read as `null` otherwise.
1979
2018
  *
1980
2019
  * Read with `parseExactJson`, so an integer past `Number.MAX_SAFE_INTEGER` in the inputs is a
1981
2020
  * `bigint` holding its exact digits, and the inputs passed back to `start` or saved as an
@@ -2032,19 +2071,21 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
2032
2071
  * Whether a request that failed `elapsedMs` after it was sent was cut off by the hosted gateway's
2033
2072
  * ~30-second limit on a request it waits on, rather than refused.
2034
2073
  *
2035
- * It is when, after at least ~28 seconds, the failure is a `503` or `504` answer, or the client's
2036
- * own time limit (`ApiUnreachableError` with the code `ABORT_TIMEOUT`). A fast `503` is the API
2037
- * saying the request was not handled, and any other unreachable host is never the gateway's
2038
- * cut-off, however long it took. The fetch API cannot say whether `ABORT_TIMEOUT` ran out before
2074
+ * It is when, after at least ~28 seconds, the failure is a `503` or `504` answer whose body is no
2075
+ * problem document, or the client's own time limit (`ApiUnreachableError` with the code
2076
+ * `ABORT_TIMEOUT`). A fast `503` is the API saying the request was not handled, a problem document
2077
+ * is the API's own answer however long it took, and any other unreachable host is never the
2078
+ * gateway's cut-off. The fetch API cannot say whether `ABORT_TIMEOUT` ran out before
2039
2079
  * the connection was made, so it is read as the gateway's; with Node's own dispatcher it never
2040
2080
  * does past the threshold, since undici gives up a connection that does not come after ten
2041
2081
  * seconds (`UND_ERR_CONNECT_TIMEOUT`), the TLS handshake included. The Python SDK's
2042
2082
  * `is_gateway_cut_off` reads the same failures, its `ABORT_TIMEOUT` being httpx's read or write
2043
2083
  * timeout.
2044
2084
  *
2045
- * The blocking `execute` turns such a failure into a `PipelineExecuteTimeoutError`. Whether a
2046
- * failed `start` or `execute` may have started a run needs no timing: the error says it as
2047
- * `runMayHaveStarted`, which reads every `503` but the platform's coded one as a run that may
2048
- * have started, however quickly it came back.
2085
+ * The blocking `execute` turns such a failure into a `PipelineExecuteTimeoutError`, for its
2086
+ * message. Whether a failed `start` or `execute` may have started a run needs no timing: the
2087
+ * error's problem says it, its `retry` being `outcome_unknown` for every answer from the edge
2088
+ * that is no problem document past a `5xx` but a `501`, however quickly it came back, while a
2089
+ * `503` problem document from the platform says as received whether it started one.
2049
2090
  */
2050
2091
  export declare function isGatewayCutOff(error: unknown, elapsedMs: number): boolean;