@pipelex/sdk 0.52.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 +17 -17
  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 +248 -218
  16. package/dist/client.js +538 -477
  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 +23 -21
  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 +24 -24
  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
@@ -141,11 +141,10 @@ export interface MethodCopyRequestOptions {
141
141
  * and a refusal for its timing (a `408`, `425` or `429`) are not stored, and a copy that failed
142
142
  * with one left nothing visible, but for the `503` whose `detail` names the copy (see
143
143
  * `copyMethod`), so the same key sends it afresh. The same key with a different body is refused
144
- * (`409` `conflict`, `input` and not retryable, which its `errorDomain` tells from the `runtime`
145
- * `conflict` of an incomplete tree), as is a key whose earlier request is still being handled
146
- * (`409` `idempotency_key_in_use`, retryable: send it again under the same key in a few
147
- * seconds); a changed copy, such as one with a fresh draft token, goes under a new key. See
148
- * `docs/method-copy.md`.
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`.
149
148
  *
150
149
  * A key is held to the rule a start's is (`PipelexStartRequestOptions.idempotencyKey`): 1 to
151
150
  * 255 visible ASCII characters, anything else a `RequestArgumentError` before any request.
@@ -218,8 +217,8 @@ export interface PipelexApiClientOptions {
218
217
  export declare const DEFAULT_API_BASE_URL = "https://api.pipelex.com";
219
218
  /**
220
219
  * The protocol surface `PipelexApiClient` implements as the standard types it: every route but
221
- * `validate`, whose verdict is Pipelex's own (`PipelexValidationResult`) while the hosted plane
222
- * 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.
223
222
  */
224
223
  type HostedProtocolSurface = Omit<MTHDSProtocol<DictPipeOutput>, "validate">;
225
224
  export declare class PipelexApiClient implements HostedProtocolSurface {
@@ -257,17 +256,27 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
257
256
  * Issue one HTTP request and return the raw status/headers/body. Wraps
258
257
  * DNS/connect/TLS/timeout failures as `ApiUnreachableError`; a caller-driven
259
258
  * abort (Ctrl-C / agent walk-away) propagates as-is so the poll loop can stop
260
- * cleanly. Non-2xx interpretation is left to the caller. `url` is a fully
261
- * resolved absolute URL. `mayStartRun` marks a request that may create a run,
262
- * 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`).
263
264
  * `idempotencyKey`, already checked by `idempotencyKeyOf`, is sent as the
264
265
  * `Idempotency-Key` header; only `start` and `copyMethod` pass one.
265
266
  */
266
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;
267
276
  /**
268
277
  * Issue a Pipelex-product request (`/v1/me`, `/v1/methods`, `/v1/billing/*`,
269
278
  * …) and parse its JSON body, mapping a non-2xx response to the typed
270
- * `ApiResponseError` so callers branch on its `errorDomain` and `type`, not the
279
+ * `ApiResponseError` so callers branch on its problem's `code`, not the
271
280
  * HTTP status. Empty-body tolerant — DELETE / onboarding / updateRun
272
281
  * answer 2xx with no body, returned as `undefined`. Uses the management-call
273
282
  * timeout, not the blocking-execute ceiling.
@@ -311,8 +320,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
311
320
  * One page of a cursor-paged product route (`listMethods`, `listMethodVersions`,
312
321
  * `listMethodExamples`, `listRuns`, `listFiles`), read as the platform always serializes it: `items` an
313
322
  * array, `next_cursor` a string or `null`. A page breaking either is an answer the SDK cannot
314
- * read, so it throws the `ApiResponseError` `unreadableAnswer` builds, `runtime` and not
315
- * 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
316
325
  * iterable, or a missing cursor that is neither the end nor a next page, which `iterateRuns`
317
326
  * would follow forever. A route reading its rows itself passes `rows`: `parse` reads the page's
318
327
  * text, and `item` reads each row, throwing as `unreadableAnswer` does for one it cannot read.
@@ -369,23 +378,29 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
369
378
  /**
370
379
  * The `ApiResponseError` of a 2xx answer the SDK cannot read, its message
371
380
  * `API <method> <path> answered <status> with <what>`: the answer's status, its raw text as
372
- * `responseBody`, no hosted problem member but the `X-Request-ID` header, the failure that made it
373
- * unreadable as `cause`, and the verdict the fallback gives a 2xx, `runtime` and not retryable.
374
- * An answer that carries signed links (`RawResponse.carriesLinks`) is held with every link
375
- * 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.
376
387
  */
377
388
  private unreadableAnswer;
378
389
  /**
379
390
  * Throw the `ApiResponseError` of a non-2xx answer, naming the route by its `path` from the
380
- * 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.
381
395
  */
382
396
  private throwApiResponseErrorAt;
383
397
  /**
384
398
  * Translate a "route absent" 404 (a bare pipelex-api with no platform block)
385
- * into a clear `RunLifecycleUnavailableError`. The platform's own 404s (run
386
- * not found / cross-org) carry a structured error envelope (a `code` field)
387
- * and are left for normal handling. `explanation` replaces the sentence saying
388
- * 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.
389
404
  */
390
405
  private throwIfLifecycleUnavailable;
391
406
  /**
@@ -406,9 +421,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
406
421
  * there this throws.
407
422
  *
408
423
  * It goes through the same transport as every route: an unreachable origin is an
409
- * `ApiUnreachableError`, and a non-2xx answer an `ApiResponseError` whose verdict the SDK's
410
- * fallback reads from the status, since the probe answers no problem document. So is a 2xx
411
- * 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`.
412
427
  */
413
428
  health(): Promise<Record<string, unknown>>;
414
429
  /**
@@ -456,15 +471,15 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
456
471
  *
457
472
  * `options.idempotencyKey` is sent as the `Idempotency-Key` header, and nothing
458
473
  * is sent without it: the hosted API answers the same start sent again under the
459
- * same key with the run the first one started, so a failure whose
460
- * `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
461
476
  * `PipelexStartRequestOptions`). A malformed key is a `RequestArgumentError`
462
477
  * before anything is sent.
463
478
  *
464
479
  * The method's tree is prepared before the request as `execute` prepares it. The prepared body
465
480
  * is the same for the same tree, so a start retried under its idempotency key sends the body the
466
481
  * key was bound to. A start whose hash entries name a blob the API does not hold yet is refused
467
- * 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
468
483
  * blob route and uploads what is missing first.
469
484
  */
470
485
  start(options: PipelexStartOptions): Promise<PipelexRunResultStart>;
@@ -478,7 +493,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
478
493
  * `/validate` is a diagnostic endpoint: every produced verdict rides a **200**,
479
494
  * discriminated on `is_valid`. This returns the `PipelexValidationResult` union
480
495
  * verbatim — `is_valid: true` ⇒ the typed `PipelexValidationReport` (structural
481
- * 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`).
482
499
  * An invalid method is NOT thrown — the caller pattern-matches `is_valid`. Only a
483
500
  * *no-verdict* condition (a malformed request, a tree the route refuses, auth, a
484
501
  * server fault) is non-2xx and surfaces as `ApiResponseError`.
@@ -508,8 +525,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
508
525
  *
509
526
  * A selector-resolution failure (fetch failure, no package at the address, an
510
527
  * unknown or foreign-org id, a bare id of a method never published, `409`
511
- * `method_not_published`, a version never published, `404`
512
- * `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
513
530
  * `ApiResponseError` — never an `is_valid: false` verdict, which is reserved
514
531
  * for actual MTHDS content.
515
532
  *
@@ -631,10 +648,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
631
648
  * Returns a **200 verdict** whatever the resolution: a reference that resolves nowhere is
632
649
  * `resolution: "not_found"` with the names it may have meant, never a thrown error. Narrow
633
650
  * on `kind` to read the shape of `matches`. A request that cannot produce a verdict throws
634
- * the typed `ApiResponseError`, a `422` whose `errorType` says why: `InvalidModelReference`
635
- * (a blank reference, a sigil or a namespace alone, or one past the runner's length limit),
636
- * `InvalidModelCategory` (an unknown `type`) or `ValidationError`. None of that is checked
637
- * 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.
638
654
  */
639
655
  checkModelReference(reference: string, category?: ModelCheckCategory): Promise<ModelReferenceVerdict>;
640
656
  /**
@@ -656,7 +672,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
656
672
  *
657
673
  * Returns a **200 verdict**: pattern-match `is_valid` before reading the arm — a
658
674
  * closure that does not parse/load/validate comes back as `is_valid: false` with
659
- * `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
660
676
  * `ApiResponseError`: a malformed selector (none, or more than one, of
661
677
  * `files` / `method_ref` / `method_id`) is a 422; a selector-resolution failure
662
678
  * (fetch failure, no package at the address, an unknown or foreign-org id) is
@@ -720,11 +736,11 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
720
736
  * {@link resolve} (the request's members are posted as given, its `directory`, `tree` or
721
737
  * `contents` as the `files` map, and the selector XOR is the server's to enforce).
722
738
  * Only a no-verdict condition throws `ApiResponseError`: a malformed selector and an
723
- * over-limit file are `ValidationError` `422`s; a selection the route refuses is a
724
- * `422` whose `errorType` is `EntryPipeNotFoundError` (an unknown `pipe_ref`, no entry
725
- * pipe) or `EntryPipeAmbiguousError` (an ambiguous code, several entry pipes), the
726
- * candidates in its `serverMessage`; a registry-form `method_ref` is a `501`; a pipe
727
- * 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`.
728
744
  *
729
745
  * A `method_ref` gets the fetch-sized budget, as on the other crate routes. On the
730
746
  * hosted API the gateway caps a request at about 30 seconds whatever the client allows,
@@ -766,9 +782,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
766
782
  * is live and the run is stuck, its workflow task failing until the platform
767
783
  * ends it at `degradation.ends_at`. `retry_after_seconds` carries the server's
768
784
  * `Retry-After` hint when present, and `request_id` the id to quote to support.
769
- * A failed run's stored report, `error`, and the `degradation` are each
770
- * checked field by field (see `RunErrorReport` and `RunDegradation`), so
771
- * 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
772
788
  * lifecycle routes are absent (a bare runner).
773
789
  */
774
790
  getRunStatus(runId: string, options?: {
@@ -802,10 +818,10 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
802
818
  * Maps the server's poll semantics to a discriminated union:
803
819
  * - HTTP 202 → `running` (with the `Retry-After` hint)
804
820
  * - HTTP 200 → `completed` (with the result artifacts)
805
- * - HTTP 409 → `failed` (terminal non-`COMPLETED`), carrying the problem's `detail` as
806
- * `message`, its `run_status` member as `status` (recovered from `detail` on a platform
807
- * that predates the member) and its `error` member, the run's stored error report, typed
808
- * 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`
809
825
  * - HTTP 503 → `running` (Temporal degraded — retry, never fail a poller)
810
826
  *
811
827
  * `options.artifacts` narrows the read to the named artifacts, sent as one
@@ -842,8 +858,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
842
858
  * real error; no answer at all propagates, uncached. An answer is anything the
843
859
  * server sent back: a non-2xx status, a body that is not JSON, not UTF-8 or no
844
860
  * version, and a body that arrived but could not be decoded, such as a broken
845
- * gzip stream, which `requestRaw` reports as an `ApiUnreachableError` carrying
846
- * the decompressor's code (see `isUndecodableBody`).
861
+ * gzip stream, which `requestRaw` reports as an `ApiResponseError` (see
862
+ * `isUndecodableBody`).
847
863
  *
848
864
  * `signal` stops the handshake: its abort is thrown as is and nothing is cached.
849
865
  *
@@ -878,11 +894,13 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
878
894
  * rather than listing, reading and hashing the tree again.
879
895
  *
880
896
  * An error from the start, or from the blocking execute, says whether that request may still
881
- * have started a run whose id never reached the caller (`runMayHaveStarted`); when it may have,
882
- * it is not retryable, since calling this method again could pay for the run twice: look the run
883
- * up in the run history first. An error from the wait, once `onStarted` has named the run,
884
- * started nothing, so its `runMayHaveStarted` is false, and its `retryable` is about waiting
885
- * 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.
886
904
  *
887
905
  * `options.idempotencyKey` rides the durable start, so a call that failed while its start may
888
906
  * have created a run can be made again with the same options and the same key: the hosted API
@@ -961,16 +979,17 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
961
979
  * and for an id that is empty, `.` or `..`, which the URL would resolve into another route's
962
980
  * path.
963
981
  *
964
- * Throws `ApiResponseError`: `404` `not_found` for an unknown or foreign-org method, `409`
965
- * `method_being_deleted` while its erasure runs, and a `409` whose verdict is `runtime` for a
966
- * method whose draft names a tree the platform holds no record of. An answer whose `files` is
967
- * 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.
968
987
  */
969
988
  getMethod(methodId: string): Promise<MethodDetail>;
970
989
  /**
971
990
  * Create a method — `POST /v1/methods`. The new method holds its tree as its draft and has no
972
- * published version, so its bare id answers `409 method_not_published` on the run and tooling
973
- * 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.
974
993
  *
975
994
  * The tree is `files`, sent as given, or `tree` or `contents`, which the client sends inline
976
995
  * when its inline map weighs 256 KiB or less, or when the platform keeps no blob store, and
@@ -980,12 +999,12 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
980
999
  *
981
1000
  * Throws `RequestArgumentError` for two forms of the tree, or `contents` holding no file, before
982
1001
  * any request; `MethodFileTransferError` when a file the organization lacks could not be
983
- * uploaded, and nothing is saved. Throws `ApiResponseError`: `422` `invalid_method_files` for a
984
- * map the standard refuses, with its `tree_refusal`; `422` `method_tree_too_large` for a tree
985
- * past one of the deployment's limits, named in its `limit`; `422` `blob_mismatch` for a hash
986
- * stated at another size than the one held; `422` `missing_blobs` for a hash entry whose bytes
987
- * the organization does not hold; `413` `payload_too_large` for a method that would leave no
988
- * 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.
989
1008
  */
990
1009
  createMethod(input: MethodWriteInput): Promise<MethodData>;
991
1010
  /**
@@ -998,16 +1017,16 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
998
1017
  * `files: null` emptying the draft, or `tree` or `contents`, sent inline or by hash as
999
1018
  * `createMethod` sends them. `input_data` is three-way (see `MethodDraftInput`). With
1000
1019
  * `expected_updated_at`, the write is a compare-and-swap on the draft token: a draft that
1001
- * 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
1002
1021
  * written. Without it, last writer wins.
1003
1022
  *
1004
1023
  * Takes a bare catalog id, as `getMethod` does. Throws `RequestArgumentError` for a draft that
1005
1024
  * gives its tree in no form or in two, or `contents` holding no file, before any request;
1006
1025
  * `MethodFileTransferError` when a file the organization lacks could not be uploaded. Throws
1007
- * `ApiResponseError`: `404` `not_found` for an unknown or foreign-org method, `409`
1008
- * `method_being_deleted` while its erasure runs, the `422` refusals of a tree `createMethod`
1009
- * lists, `413` `payload_too_large` for a draft that would grow the method past the room a
1010
- * 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,
1011
1030
  * when the method kept changing under the write.
1012
1031
  */
1013
1032
  writeDraft(methodId: string, input: MethodDraftInput): Promise<MethodData>;
@@ -1179,11 +1198,11 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1179
1198
  * draft, so the `updated_at` a caller holds stays valid for its next `writeDraft` or
1180
1199
  * `publishMethod`.
1181
1200
  *
1182
- * Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404` `not_found`,
1183
- * `409` `method_being_deleted`, `403` for a read-only key, `422` for an empty name or one
1184
- * holding a lone surrogate, `413` `payload_too_large` for a name so long it would leave the
1185
- * method too large to publish, and a `503` that wrote nothing, safe to retry, when draft
1186
- * 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.
1187
1206
  */
1188
1207
  renameMethod(methodId: string, input: MethodRenameInput): Promise<MethodData>;
1189
1208
  /**
@@ -1197,16 +1216,17 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1197
1216
  * The answer is a `MethodPublishResult` discriminated on `outcome` — branch on it:
1198
1217
  * `published` with the new `version`; `unchanged` with the existing latest `version`;
1199
1218
  * `refused` with a `reason` (`invalid`, or `not_runnable` for a draft that validates with
1200
- * pending signatures), a `message` and the runner's `validation` verdict. Every arm carries the
1201
- * `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.
1202
1222
  *
1203
1223
  * Takes a bare catalog id, as `getMethod` does. Throws `RequestArgumentError` when
1204
1224
  * `expected_draft_updated_at` is not a string, before any request. Throws `ApiResponseError`
1205
- * when no verdict was produced: `409` `method_update_conflict` for a draft that moved since
1206
- * the token, `409` `method_being_deleted`, `404` `not_found`, `422` for a draft with no
1207
- * `.mthds` file or whose file names a run could not assemble (one name used by a `.mthds` and
1208
- * a Python file), `413` `payload_too_large` for a draft too large to publish, and `403` for a
1209
- * 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.
1210
1230
  *
1211
1231
  * Only a draft that differs from the latest version reaches the runner, and a runner that
1212
1232
  * cannot be reached, answers unusably or does not finish within the platform's deadline is a
@@ -1214,8 +1234,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1214
1234
  * itself is relayed under its own status. A retry of a publish that landed while its answer was
1215
1235
  * lost, as on a client timeout, answers `unchanged` with the version it wrote.
1216
1236
  *
1217
- * An answer whose `outcome` is not one of the outcomes above, or that carries no `method`
1218
- * 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.
1219
1240
  */
1220
1241
  publishMethod(methodId: string, input: MethodPublishInput): Promise<MethodPublishResult>;
1221
1242
  /**
@@ -1226,10 +1247,11 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1226
1247
  * may be short while `nextCursor` is set, because the platform reads versions whole. A method
1227
1248
  * never published answers an empty page.
1228
1249
  *
1229
- * Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404` `not_found`
1230
- * for an unknown method, `409` `method_being_deleted`, `400` `malformed_request` for a cursor
1231
- * 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`
1232
- * 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.
1233
1255
  */
1234
1256
  listMethodVersions(methodId: string, query?: ListMethodVersionsQuery): Promise<MethodVersionPage>;
1235
1257
  /**
@@ -1239,10 +1261,10 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1239
1261
  *
1240
1262
  * Takes a bare catalog id, as `getMethod` does, and the version number. Throws
1241
1263
  * `RequestArgumentError` for a `version` that is not a positive integer, before any request.
1242
- * Throws `ApiResponseError`: `404` `method_version_not_found` for a version the method never
1243
- * published, `404` `not_found` for an unknown method, `409` `method_being_deleted`, and `409`
1244
- * `conflict`, whose verdict is `runtime`, for a version stored before methods were trees and
1245
- * 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.
1246
1268
  */
1247
1269
  getMethodVersion(methodId: string, version: number): Promise<MethodVersion>;
1248
1270
  /**
@@ -1275,28 +1297,31 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1275
1297
  * `destination_org_id` that is not a non-empty string, a `name` or an
1276
1298
  * `expected_draft_updated_at` given that is not a string, and a malformed idempotency key.
1277
1299
  * Throws `ApiResponseError` when no verdict was produced, each refusal writing nothing a reader
1278
- * sees but for the `503` whose `detail` names the copy: `403` `forbidden` for a request that is
1279
- * not from a web session; `403`
1280
- * `role_not_permitted` for a role that may not change methods, in the method's organization or
1281
- * in the destination; `404` `organization_not_found` for a destination the caller does not
1282
- * belong to, still being set up or unknown, alike; `404` `not_found` for an unknown method;
1283
- * `409` `method_being_deleted`; `409` `method_update_conflict` for a draft that moved since
1284
- * `expected_draft_updated_at`; `409` `conflict`, `runtime` and not retryable, for a draft whose
1285
- * tree the method's organization holds no record of or no longer holds every file of; `413`
1286
- * `payload_too_large` for a copied example, or the copy's row, too large for one stored item,
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,
1287
1310
  * the row keeping room for the summary a publish adds, so a `name` that would leave none is
1288
- * refused; `422` `validation_failed` for a body that does not validate, such as a name holding a
1289
- * lone surrogate; `422` `method_copy_too_large` past one of the copy's bounds on the stored files
1290
- * it copies, named by `problemDocument.limit` (`MethodCopyLimit`); a retryable `502` when the
1291
- * platform could not read the caller's memberships; a `500` `storage_backend_failed`, retryable
1292
- * unless the platform has no usable credentials for storage; and a retryable `503` past the
1293
- * copy's deadline, when a stored file it copies is written over meanwhile, or when DynamoDB
1294
- * fails. When DynamoDB failed both the copy's row write and the read that would confirm it, that
1295
- * `503`'s `detail` names the copy's method id: the copy may stand in the destination, so look for
1296
- * that id there before copying again, since a retry may make a second copy. An answer whose
1297
- * `outcome` is neither arm's, a `copied` one whose `method` is not an object or a `refused` one
1298
- * whose `references` is not an array, is an answer the SDK cannot read, thrown as an
1299
- * `ApiResponseError` too.
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.
1300
1325
  */
1301
1326
  copyMethod(methodId: string, input: MethodCopyInput, options?: MethodCopyRequestOptions): Promise<MethodCopyResult>;
1302
1327
  /**
@@ -1312,11 +1337,11 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1312
1337
  * and a copy itself, answer an empty page. The listing is open to every member of the method's
1313
1338
  * organization, a runner included, as every read of a method is.
1314
1339
  *
1315
- * Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404` `not_found` for
1316
- * an unknown method, `409` `method_being_deleted`, `400` `malformed_request` for a cursor the
1317
- * listing did not issue for this method, `422` for a `limit` outside 1 to 100. A page whose
1318
- * `items` is not an array or whose `next_cursor` is neither a string nor `null` is an answer the
1319
- * 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.
1320
1345
  */
1321
1346
  listMethodCopies(methodId: string, query?: ListMethodCopiesQuery): Promise<MethodCopyPage>;
1322
1347
  /**
@@ -1332,7 +1357,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1332
1357
  * it with a `409`.
1333
1358
  *
1334
1359
  * A double-clicked delete is safe: the claim is a conditional write, so the
1335
- * 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
1336
1361
  * second cascade over the same runs. An unknown or foreign-org id is a `404`. The
1337
1362
  * erasure deletes the method's published versions with the rest. Takes a bare catalog id,
1338
1363
  * as `getMethod` does: the whole method is erased, never one of its versions.
@@ -1347,8 +1372,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1347
1372
  * closed, and a `null` `run_id` reads as not given. Throws `RequestArgumentError` before any
1348
1373
  * request when `name` or `inputs` is not given (`null` counting as not given), and for a
1349
1374
  * `run_id` that is given but is not a non-empty string. Throws `ApiResponseError`: `404`
1350
- * `run_not_found` for a `run_id` that is not one of this method's runs in the caller's
1351
- * 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
1352
1377
  * stored item holds; `422` for a name that is empty, blank or over 200 characters, or inputs
1353
1378
  * that are not a JSON object; and the codes every example route answers.
1354
1379
  */
@@ -1361,12 +1386,12 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1361
1386
  * may be short while `nextCursor` is set, because the platform reads examples whole and stops
1362
1387
  * a read at 1 MB; `iterateMethodExamples` follows the cursor for a caller that wants them all.
1363
1388
  *
1364
- * Throws `ApiResponseError`: `400` `malformed_request` for a cursor the listing did not issue
1365
- * for this method, `422` for a `limit` outside 1 to 100, and the codes every example route
1366
- * answers. A page whose `items` is not an array, whose `next_cursor` is neither a string nor
1367
- * `null`, or one of whose items is not an example `readMethodExample` can read, is an answer
1368
- * the SDK cannot read, thrown as an `ApiResponseError` too. An example whose inputs hold an
1369
- * 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`.
1370
1395
  */
1371
1396
  listMethodExamples(methodId: string, query?: ListMethodExamplesQuery): Promise<MethodExamplePage>;
1372
1397
  /**
@@ -1418,7 +1443,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1418
1443
  *
1419
1444
  * Throws `RequestArgumentError` before any request for an example id that is empty, `.` or
1420
1445
  * `..`, or when neither `name` nor `inputs` is given. Throws `ApiResponseError`: `413`
1421
- * `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
1422
1447
  * empty, blank or over 200 characters, or inputs that are not a JSON object, a `503` that wrote
1423
1448
  * nothing, safe to retry, when concurrent edits kept landing under the write, and the codes
1424
1449
  * every example route answers.
@@ -1436,13 +1461,13 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1436
1461
  * since and nothing was written. A stale run is the expected end of a run that outlasted an
1437
1462
  * edit, so it is answered, never thrown. Both arms carry the `example` as it stands.
1438
1463
  *
1439
- * Throws `RequestArgumentError` before any request, checking in this order: an example id that
1440
- * is empty, `.` or `..`, or holds a lone surrogate, a `run_id` that is not a non-empty string,
1441
- * and an `input_revision` that is not a positive integer. Throws `ApiResponseError` when no
1442
- * verdict was produced: `404` `not_found` for an example deleted since, `404` `run_not_found`
1443
- * for a run that is not one of this method's, with nothing written, and the codes every example
1444
- * route answers. An answer whose `outcome` is neither arm's, or whose `example` is not an
1445
- * 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
1446
1471
  * `ApiResponseError` too, read as `publishMethod` reads its verdict.
1447
1472
  */
1448
1473
  recordMethodExampleLatestRun(methodId: string, exampleId: string, input: MethodExampleLatestRunInput): Promise<MethodExampleLatestRunResult>;
@@ -1468,8 +1493,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1468
1493
  * the body is closed, and `null` reads as not given. Throws `RequestArgumentError` before any
1469
1494
  * request when `name` or `inputs` is not given, for an `example_id` that is not a non-empty
1470
1495
  * string or an `input_revision` that is not a positive integer, and when only one of the two is
1471
- * given. Throws `ApiResponseError`: `403` `role_not_permitted` for a role that may not change
1472
- * 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
1473
1498
  * holds; `422` for a name that is empty, blank or over 200 characters, or inputs that are not a
1474
1499
  * JSON object; and the codes every example route answers. An answer whose `outcome` is neither
1475
1500
  * arm's, or whose `example` is not an example `readMethodExample` can read, is an answer the SDK
@@ -1480,10 +1505,10 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1480
1505
  * Delete an example — `DELETE /v1/methods/{id}/examples/{example_id}`. The platform answers
1481
1506
  * `204`. Deleting the example leaves its latest run in the method's history.
1482
1507
  *
1483
- * Throws `RequestArgumentError` for an example id that is empty, `.` or `..`, before any
1484
- * request: `..` would address the method, and its erasure would answer the delete. Throws
1485
- * `ApiResponseError`: `404` `not_found` when there is no such example, one already deleted
1486
- * 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.
1487
1512
  */
1488
1513
  deleteMethodExample(methodId: string, exampleId: string): Promise<void>;
1489
1514
  /** The caller's org memberships + active-org feature flags — `GET /v1/organizations/memberships`. */
@@ -1519,17 +1544,17 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1519
1544
  *
1520
1545
  * Throws `RequestArgumentError` for an organization id that is empty, `.` or `..`, before any
1521
1546
  * request. Throws `ApiResponseError`, refusing every change of the request when it refuses one:
1522
- * `403` `forbidden` when `orgId` is not the active organization, `403` `role_not_permitted` for
1523
- * a caller who is not its admin, `404` for a missing organization, `409` `conflict` for a
1524
- * personal workspace, which has no branding, and `422` `validation_failed` for a colour that is
1525
- * not `#rrggbb` or a key the body does not know. A logo's refusal names its slot in the error's
1526
- * `errors[]`, each entry's `field` being `square_logo` or `wide_logo` and its `detail` the
1527
- * sentence to show under that slot: `400` `invalid_storage_uri` for a URI that is not a storage
1528
- * URI, `403` `forbidden` for another organization's file, and `422` `validation_failed` with a
1529
- * `LogoRefusalCode` per broken rule for a file the platform refused. A failure of the platform's
1530
- * storage while reading or copying a logo is a `500` `storage_backend_failed`, retryable, with
1531
- * nothing written. A `503` `service_unavailable` is a failure of its database, after which the
1532
- * 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.
1533
1558
  */
1534
1559
  updateOrganizationBranding(orgId: string, input: OrganizationBrandingUpdate): Promise<OrganizationBranding>;
1535
1560
  /** The active org's subscription state — `GET /v1/billing/subscription`. */
@@ -1544,7 +1569,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1544
1569
  }): Promise<CheckoutResponse>;
1545
1570
  /**
1546
1571
  * Switch the existing subscription's plan — `POST /v1/billing/change-plan`.
1547
- * A 409 `conflict` (`ApiResponseError.code`) means there is no subscription
1572
+ * A 409 `pipelex.billing.subscription_conflict` (`ApiResponseError.code`) means there is no subscription
1548
1573
  * to change — start one via `createCheckout` first.
1549
1574
  */
1550
1575
  changePlan(input: {
@@ -1552,14 +1577,14 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1552
1577
  }): Promise<ChangePlanResponse>;
1553
1578
  /**
1554
1579
  * A Stripe billing-portal session URL — `GET /v1/billing/portal`. A 409
1555
- * `conflict` (`ApiResponseError.code`) means there is no subscription yet.
1580
+ * `pipelex.billing.subscription_conflict` (`ApiResponseError.code`) means there is no subscription yet.
1556
1581
  */
1557
1582
  getBillingPortal(): Promise<BillingPortalResponse>;
1558
1583
  /** List the caller's Pipelex API keys — `GET /v1/pipelex-api-keys`. */
1559
1584
  listPipelexApiKeys(): Promise<PipelexApiKeyList>;
1560
1585
  /**
1561
1586
  * Mint a Pipelex API key — `POST /v1/pipelex-api-keys`. The plaintext
1562
- * `api_key` is returned ONCE. A 409 `pipelex_api_key_limit_reached`
1587
+ * `api_key` is returned ONCE. A 409 `pipelex.billing.plan_limit`
1563
1588
  * (`ApiResponseError.code`) means the per-account key limit is hit.
1564
1589
  */
1565
1590
  createPipelexApiKey(input: {
@@ -1620,8 +1645,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1620
1645
  /**
1621
1646
  * Upload a base64 file — `POST /v1/upload`, answering the file's `uri`, the `filename` as sent
1622
1647
  * and the `file_id` of its record. An answer with no non-empty string `uri` names no
1623
- * stored file, so it is an answer the SDK cannot read: an `ApiResponseError`, `runtime` and
1624
- * 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`.
1625
1651
  */
1626
1652
  upload(input: UploadInput): Promise<UploadedFile>;
1627
1653
  /**
@@ -1642,9 +1668,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1642
1668
  * target is short-lived and a bearer capability, so keep it out of logs. The route
1643
1669
  * never replays a grant: ask again for a new one rather than retrying; with a
1644
1670
  * `sha256`, a new grant answers the same file record. A declared `size` over the cap
1645
- * is a `413` `ApiResponseError` (`code` `payload_too_large`), a malformed `sha256` and
1646
- * a `size` other than the one the organization holds those bytes at are a `422`, and a
1647
- * 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`.
1648
1674
  */
1649
1675
  requestUploadGrant(input: UploadGrantInput, options?: {
1650
1676
  signal?: AbortSignal;
@@ -1710,7 +1736,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1710
1736
  *
1711
1737
  * Throws `ApiResponseError`: `400` for a date bound that is not an instant with an offset, a
1712
1738
  * range whose start is after its end, or a cursor of another list or other filters; `404`
1713
- * `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
1714
1740
  * 200, an unknown `kind`, more than 100 values of `format` or `mediaType`, or an id that cannot
1715
1741
  * be one. A page whose `items` is not an array or whose `next_cursor` is neither a string nor
1716
1742
  * `null` is an `ApiResponseError` of an answer the SDK cannot read. See `docs/files.md`.
@@ -1747,10 +1773,11 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1747
1773
  * `stored` when its bytes are there.
1748
1774
  *
1749
1775
  * Throws `RequestArgumentError` for a file id that is empty, `.` or `..`, or holds a lone
1750
- * surrogate, before any request. Throws `ApiResponseError`: `404` `not_found` for a file that is
1751
- * not the organization's; `422` for a `usesLimit` outside 1 to 200 or an id that cannot be one.
1752
- * An answer that is not an object, or whose `uses` is not a page of `items` and `next_cursor`, is
1753
- * 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`.
1754
1781
  */
1755
1782
  getFile(fileId: string, query?: GetFileQuery): Promise<FileDetail>;
1756
1783
  /**
@@ -1765,10 +1792,10 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1765
1792
  * kept records.
1766
1793
  *
1767
1794
  * Throws `RequestArgumentError` for a `uri` that is not a non-empty string, before any request.
1768
- * Throws `ApiResponseError`: `400` `invalid_storage_uri` for a malformed address, `403`
1769
- * `forbidden` for another organization's, `404` `run_not_found` for a run that is not the
1770
- * organization's, and `422` for an address over 512 characters. An answer whose `items` is not an
1771
- * 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.
1772
1799
  */
1773
1800
  getFilesByUri(uri: string, options?: GetFilesByUriOptions): Promise<FileRecordList>;
1774
1801
  /**
@@ -1788,9 +1815,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1788
1815
  *
1789
1816
  * Sends `name` alone: the body is closed. Throws `RequestArgumentError` for a file id that is
1790
1817
  * empty, `.` or `..`, or holds a lone surrogate, and for a `name` that is not a string, before
1791
- * any request. Throws `ApiResponseError`: `403` `role_not_permitted` past the rule above; `404`
1792
- * `not_found` for a file that is not the organization's; `422` for a name over 512 characters or
1793
- * 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
1794
1821
  * read, thrown as an `ApiResponseError` too.
1795
1822
  */
1796
1823
  renameFile(fileId: string, input: FileRenameInput): Promise<FileRecord>;
@@ -1817,8 +1844,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1817
1844
  * Sends each file as `{ file_id }` or `{ uri }` and nothing else: the body is closed. Throws
1818
1845
  * `RequestArgumentError` before any request when `files` is not a list, or one of its items does
1819
1846
  * not name exactly one of `file_id` and `uri` as a non-empty string. Throws `ApiResponseError`:
1820
- * `422` for more than 100 files, or an id or address longer than one can be; `500` `config` when
1821
- * 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
1822
1849
  * object with its `url` or its `error`, is an answer the SDK cannot read, thrown as an
1823
1850
  * `ApiResponseError` whose body hides every link.
1824
1851
  */
@@ -1841,18 +1868,18 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1841
1868
  * list of non-empty strings, when `run_id` is not a non-empty string, and when `name` is not a
1842
1869
  * string. Throws `ApiResponseError`:
1843
1870
  *
1844
- * - `422` `file_archive_too_large` past a cap, at most 500 files or 2,000,000,000 bytes, whose
1845
- * `problemDocument.limit` names it (`FileArchiveLimit`), so the person can be told how far over
1846
- * the selection is;
1847
- * - `422` `validation_failed` for more than 1,000 ids listed, or an id longer than one can be;
1848
- * - `404` `not_found` for a file that is not the organization's, the `detail` naming up to five
1849
- * of them, or a run whose files hold nothing stored to zip; `404` `run_not_found` for a run
1850
- * that is not the organization's;
1851
- * - `409` `conflict`: an `input` one, not retryable, for a selected file whose upload has not
1852
- * finished; a `runtime` one, retryable, for a run whose files are not all recorded yet, which
1853
- * the same request clears a few seconds after the run ends;
1854
- * - `503` `service_unavailable`, retryable, when the archive could not be queued: the same request
1855
- * 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.
1856
1883
  *
1857
1884
  * An answer that is not an archive, an object with a string `archive_id` and a known `state`, is
1858
1885
  * an answer the SDK cannot read, thrown as an `ApiResponseError` too.
@@ -1871,10 +1898,10 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1871
1898
  * still `queued` or `building` an hour after it was asked for reads as `failed`.
1872
1899
  *
1873
1900
  * Throws `RequestArgumentError` for an archive id that is empty, `.` or `..`, or holds a lone
1874
- * surrogate, before any request. Throws `ApiResponseError`: `404` `not_found` for an archive that
1875
- * is not the organization's, never existed, or has expired, a day after `created_at`; `500` when
1876
- * the link cannot be signed. An answer that is not an archive is an answer the SDK cannot read,
1877
- * 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.
1878
1905
  */
1879
1906
  getFileArchive(archiveId: string): Promise<FileArchive>;
1880
1907
  /**
@@ -1905,14 +1932,15 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1905
1932
  * `expected_updated_at`, and nothing else: the body is closed, and a `null` token reads as not
1906
1933
  * given. Throws `RequestArgumentError` before any request for a `file_id` or a `path` that is not
1907
1934
  * a non-empty string, and an `expected_updated_at` that is not a string. Throws
1908
- * `ApiResponseError`: `403` `role_not_permitted` for a role that may not change methods; `404`
1909
- * for an unknown method or a file that is not the organization's; `409` `method_being_deleted`,
1910
- * `409` `method_update_conflict` for a stale `expected_updated_at`, and `409` `conflict` for a
1911
- * file whose upload has not finished or whose stored bytes do not match its record; `422`
1912
- * `invalid_method_files` for a path the draft cannot hold, such as `.env` or `../logo.png`, and
1913
- * `422` `method_tree_too_large` past the deployment's limits. An answer whose `blob` is neither
1914
- * arm's, or whose `file` or `method` is not an object, is an answer the SDK cannot read, thrown
1915
- * 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.
1916
1944
  */
1917
1945
  copyFileIntoDraft(methodId: string, input: DraftFileFromFileInput): Promise<DraftFileFromFileResult>;
1918
1946
  /**
@@ -1930,7 +1958,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1930
1958
  * `iterateRuns` does the latter for you.
1931
1959
  *
1932
1960
  * Each item is a `RunHistoryItem` — the id, status, timestamps, pipe and,
1933
- * 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,
1934
1962
  * method and workflow id are not on the list; `getRunDetail` returns them.
1935
1963
  *
1936
1964
  * `createdFrom` / `createdTo` are applied server-side as index key
@@ -1985,8 +2013,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
1985
2013
  * The whole record for one run — `GET /v1/runs/{id}`.
1986
2014
  *
1987
2015
  * The ONLY call that returns what the run actually executed and its
1988
- * `inputs`. Kept off the status read, which pollers hit every few seconds. A failed run's stored report, `error`, is checked field by
1989
- * 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.
1990
2018
  *
1991
2019
  * Read with `parseExactJson`, so an integer past `Number.MAX_SAFE_INTEGER` in the inputs is a
1992
2020
  * `bigint` holding its exact digits, and the inputs passed back to `start` or saved as an
@@ -2043,19 +2071,21 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
2043
2071
  * Whether a request that failed `elapsedMs` after it was sent was cut off by the hosted gateway's
2044
2072
  * ~30-second limit on a request it waits on, rather than refused.
2045
2073
  *
2046
- * It is when, after at least ~28 seconds, the failure is a `503` or `504` answer, or the client's
2047
- * own time limit (`ApiUnreachableError` with the code `ABORT_TIMEOUT`). A fast `503` is the API
2048
- * saying the request was not handled, and any other unreachable host is never the gateway's
2049
- * 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
2050
2079
  * the connection was made, so it is read as the gateway's; with Node's own dispatcher it never
2051
2080
  * does past the threshold, since undici gives up a connection that does not come after ten
2052
2081
  * seconds (`UND_ERR_CONNECT_TIMEOUT`), the TLS handshake included. The Python SDK's
2053
2082
  * `is_gateway_cut_off` reads the same failures, its `ABORT_TIMEOUT` being httpx's read or write
2054
2083
  * timeout.
2055
2084
  *
2056
- * The blocking `execute` turns such a failure into a `PipelineExecuteTimeoutError`. Whether a
2057
- * failed `start` or `execute` may have started a run needs no timing: the error says it as
2058
- * `runMayHaveStarted`, which reads every `503` but the platform's coded one as a run that may
2059
- * 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.
2060
2090
  */
2061
2091
  export declare function isGatewayCutOff(error: unknown, elapsedMs: number): boolean;