@pipelex/sdk 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -3
- package/dist/artifacts.js +1 -1
- package/dist/artifacts.js.map +1 -1
- package/dist/client.d.ts +6 -3
- package/dist/client.js +106 -34
- package/dist/client.js.map +1 -1
- package/dist/error-models.d.ts +198 -0
- package/dist/error-models.js +26 -0
- package/dist/error-models.js.map +1 -0
- package/dist/errors.d.ts +132 -26
- package/dist/errors.js +134 -23
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +47 -8
- package/dist/product-models.d.ts +4 -15
- package/dist/runs.d.ts +22 -8
- package/dist/runs.js +4 -3
- package/dist/runs.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/architecture.md +7 -6
- package/docs/artifact-download.md +1 -1
- package/docs/errors.md +143 -0
- package/docs/run-results.md +3 -1
- package/package.json +2 -2
package/dist/errors.js
CHANGED
|
@@ -227,19 +227,37 @@ export class PipelineExecuteTimeoutError extends PipelineRequestError {
|
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
|
-
* Thrown when a run reaches a terminal state that is not `COMPLETED`
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
230
|
+
* Thrown when a run reaches a terminal state that is not `COMPLETED` (`FAILED`, `CANCELLED`,
|
|
231
|
+
* `TERMINATED`, `TIMED_OUT`) — by `waitForResult`, `startAndWaitForResult` and the artifact
|
|
232
|
+
* download when the platform answers the results read with HTTP 409. (`getRunResult` returns
|
|
233
|
+
* the same facts as its `failed` arm instead of throwing.)
|
|
234
|
+
*
|
|
235
|
+
* - `status` is the run's terminal status, read from the problem's `run_status` member, or from
|
|
236
|
+
* its `detail` sentence on a platform that predates the member.
|
|
237
|
+
* - `error` is the run's stored error report, typed whole as `RunErrorReport`: the runner's
|
|
238
|
+
* `error_type`, `message`, `title`, `type_uri`, `error_domain`, `error_category`,
|
|
239
|
+
* `retryable`, `user_action`, `model`, `provider`, `provider_metadata`, `validation_errors`
|
|
240
|
+
* and anything newer through its index signature. Branch on `error.error_domain`,
|
|
241
|
+
* `error.type_uri` and `error.retryable`; show `error.user_action` as the next step. It is
|
|
242
|
+
* the runner's VERBOSE report, so `message` and `provider_metadata` can hold a provider's raw
|
|
243
|
+
* text — deciding what a person sees is the consumer's. `null` when the run ended with no
|
|
244
|
+
* stored report (a cancelled, terminated or timed-out run, or one the platform finalized
|
|
245
|
+
* itself).
|
|
246
|
+
* - The error's own `message` is the problem's `detail`, which names the status and then the
|
|
247
|
+
* report's message (`Run finished with status FAILED: <message>`), so printing the error
|
|
248
|
+
* already tells the reason.
|
|
249
|
+
* - `runId` locates the run, for a status read or a support request.
|
|
234
250
|
*/
|
|
235
251
|
export class RunFailedError extends PipelineRequestError {
|
|
236
252
|
runId;
|
|
237
253
|
status;
|
|
254
|
+
error;
|
|
238
255
|
constructor(message, runId, status, options) {
|
|
239
|
-
super(message, options);
|
|
256
|
+
super(message, options?.cause === undefined ? undefined : { cause: options.cause });
|
|
240
257
|
this.name = "RunFailedError";
|
|
241
258
|
this.runId = runId;
|
|
242
259
|
this.status = status;
|
|
260
|
+
this.error = options?.error ?? null;
|
|
243
261
|
}
|
|
244
262
|
}
|
|
245
263
|
/**
|
|
@@ -315,15 +333,36 @@ export class RunLifecycleUnavailableError extends PipelineRequestError {
|
|
|
315
333
|
}
|
|
316
334
|
}
|
|
317
335
|
/**
|
|
318
|
-
* A non-2xx response that DID come back from the API
|
|
319
|
-
*
|
|
320
|
-
*
|
|
336
|
+
* A non-2xx response that DID come back from the API, with its problem document parsed.
|
|
337
|
+
*
|
|
338
|
+
* Every error the hosted API answers is an RFC 9457 `application/problem+json` document, and
|
|
339
|
+
* this error carries its members as typed fields, each `undefined` when the document did not
|
|
340
|
+
* carry it (a member of the wrong type reads as absent rather than as a wrong value):
|
|
321
341
|
*
|
|
322
|
-
* `
|
|
323
|
-
* (`
|
|
324
|
-
*
|
|
325
|
-
* the HTTP status
|
|
326
|
-
*
|
|
342
|
+
* - **The branch fields.** `errorDomain` says who can fix the failure — `input` (the caller),
|
|
343
|
+
* `config` (a configuration change), `runtime` (nobody beforehand) — and `type` is the stable
|
|
344
|
+
* URI naming the error class. `retryable` says whether a retry can succeed, `undefined`
|
|
345
|
+
* meaning unknown. Branch on these, never on the HTTP status or on the wording of a message.
|
|
346
|
+
* - **The native codes.** `code` is the platform's own closed code (`conflict`, `not_found`,
|
|
347
|
+
* `pipelex_api_key_limit_reached`, …) and `errorType` the runner's open exception class
|
|
348
|
+
* name. Each is finer than `errorDomain` and specific to the surface that emits it; the
|
|
349
|
+
* platform's `type` is one-to-one with its `code` (`https://pipelex.com/errors/<code>`).
|
|
350
|
+
* - **For a person.** `title` is the stable label of the error class, `serverMessage` the
|
|
351
|
+
* per-occurrence `detail`, `userAction` the advised next step, and `errorCategory`, `model`,
|
|
352
|
+
* `provider` and `providerMetadata` describe an inference failure.
|
|
353
|
+
* - **For support.** `requestId` correlates the response with the server's logs; it is read
|
|
354
|
+
* from the body, or from the `X-Request-ID` response header when the body has none.
|
|
355
|
+
* `instance` is the occurrence's URN or request path.
|
|
356
|
+
* - **Per-item failures.** `errors` is the platform's field-level list (`field`, `code`,
|
|
357
|
+
* `detail`), and `validationErrors` the structured diagnostics of a bundle that failed
|
|
358
|
+
* validation.
|
|
359
|
+
*
|
|
360
|
+
* `problemDocument` is the decoded document whole, so a member this SDK does not name stays
|
|
361
|
+
* reachable without re-parsing `responseBody`, which is the raw text; it is `undefined` when
|
|
362
|
+
* the body was not a JSON object. The members `mthds`'s own `ApiResponseError` carries have the
|
|
363
|
+
* same names and types here, and the rest (`code`, `errorCategory`, `model`, `provider`,
|
|
364
|
+
* `providerMetadata`, `migration`, `errors`) are the Pipelex members the standard's client
|
|
365
|
+
* leaves to this SDK.
|
|
327
366
|
*/
|
|
328
367
|
export class ApiResponseError extends PipelineRequestError {
|
|
329
368
|
apiUrl;
|
|
@@ -332,23 +371,80 @@ export class ApiResponseError extends PipelineRequestError {
|
|
|
332
371
|
responseBody;
|
|
333
372
|
errorType;
|
|
334
373
|
serverMessage;
|
|
374
|
+
/**
|
|
375
|
+
* The platform's native code — a closed set (`conflict`, `not_found`, `run_not_found`,
|
|
376
|
+
* `pipelex_api_key_limit_reached`, …), one-to-one with `type`. Finer than `errorDomain` and
|
|
377
|
+
* specific to the platform: a runner's problem carries `errorType` instead. `undefined` for a
|
|
378
|
+
* body that carries no `code`.
|
|
379
|
+
*/
|
|
335
380
|
code;
|
|
381
|
+
/**
|
|
382
|
+
* RFC 9457 `type`: the stable URI naming the error class. With `errorDomain`, the field a
|
|
383
|
+
* machine consumer branches on — the same class carries the same URI on every occurrence.
|
|
384
|
+
*/
|
|
385
|
+
type;
|
|
386
|
+
/** RFC 9457 `title`: the short human label of the error class. */
|
|
387
|
+
title;
|
|
388
|
+
/** RFC 9457 `instance`: the occurrence — the request path, or a request URN. */
|
|
389
|
+
instance;
|
|
390
|
+
/**
|
|
391
|
+
* The request's correlation id — the body's `request_id`, or the `X-Request-ID` response
|
|
392
|
+
* header when the body carries none. The id to hand to support: it finds the server's log
|
|
393
|
+
* lines for this request.
|
|
394
|
+
*/
|
|
395
|
+
requestId;
|
|
396
|
+
/**
|
|
397
|
+
* The body's `error_domain`: who can fix the failure. `input` — the caller (a malformed
|
|
398
|
+
* bundle, a bad argument, a missing input); `config` — a configuration change (a missing
|
|
399
|
+
* secret, a model the backend does not serve); `runtime` — nobody beforehand (a provider
|
|
400
|
+
* outage during execution). Typed open, as the server owns the vocabulary; `undefined` when
|
|
401
|
+
* the server did not classify it.
|
|
402
|
+
*/
|
|
403
|
+
errorDomain;
|
|
404
|
+
/**
|
|
405
|
+
* The body's `error_category`: the finer classification of an inference failure — known
|
|
406
|
+
* values `transient`, `configuration`, `content`, `capacity`, `ambiguous`, `unknown`.
|
|
407
|
+
*/
|
|
408
|
+
errorCategory;
|
|
409
|
+
/**
|
|
410
|
+
* The body's `retryable`: whether retrying the same request can plausibly succeed.
|
|
411
|
+
* `undefined` means unknown, which is not the same as `false`.
|
|
412
|
+
*/
|
|
413
|
+
retryable;
|
|
414
|
+
/** The body's `user_action`: what the caller should do next, when the server can say. */
|
|
415
|
+
userAction;
|
|
416
|
+
/** The body's `model`: the model an inference failure used. */
|
|
417
|
+
model;
|
|
418
|
+
/** The body's `provider`: the provider an inference failure reached. */
|
|
419
|
+
provider;
|
|
420
|
+
/** The body's `provider_metadata`: what the provider's SDK said, raw text included. */
|
|
421
|
+
providerMetadata;
|
|
422
|
+
/** The body's `migration`: a pending configuration migration that explains the failure. */
|
|
423
|
+
migration;
|
|
424
|
+
/** The platform's field-level `errors[]` — one item per offending request field. */
|
|
425
|
+
errors;
|
|
426
|
+
/**
|
|
427
|
+
* The decoded problem document whole — every member, named or not, such as a failed run's
|
|
428
|
+
* `run_status` and `error` or a member a newer server adds. `undefined` when the body was not
|
|
429
|
+
* a JSON object.
|
|
430
|
+
*/
|
|
431
|
+
problemDocument;
|
|
336
432
|
/**
|
|
337
433
|
* Structured per-error diagnostics on a problem body that carries a top-level
|
|
338
|
-
* `validation_errors[]` — the **
|
|
339
|
-
*
|
|
434
|
+
* `validation_errors[]` — the 422 a **run route** (`execute`, `start`) answers when the
|
|
435
|
+
* runner refuses the method for its validation errors.
|
|
340
436
|
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* per-error list (auth, transport, a request-shape 422
|
|
346
|
-
* assume a given `error_type` implies a
|
|
347
|
-
* `serverMessage` when this is empty.
|
|
437
|
+
* Everywhere else an invalid bundle is a produced verdict, not an `ApiResponseError`:
|
|
438
|
+
* `POST /v1/validate` answers it with a **200** `PipelexInvalidReport`, and the build
|
|
439
|
+
* and crate routes with a **200** `CrateInvalidReport`, whose `validation_errors[]` the
|
|
440
|
+
* caller reads off the returned value. This field is `undefined` for any error that
|
|
441
|
+
* carries no per-error list (auth, transport, a request-shape 422, a build route's 422
|
|
442
|
+
* for a pipe it cannot build). A consumer must NOT assume a given `error_type` implies a
|
|
443
|
+
* populated list — fall back to `serverMessage` when this is empty.
|
|
348
444
|
*/
|
|
349
445
|
validationErrors;
|
|
350
446
|
constructor(message, apiUrl, status, statusText, responseBody, errorType, serverMessage, validationErrors, code, options) {
|
|
351
|
-
super(message, options);
|
|
447
|
+
super(message, options?.cause === undefined ? undefined : { cause: options.cause });
|
|
352
448
|
this.name = "ApiResponseError";
|
|
353
449
|
this.apiUrl = apiUrl;
|
|
354
450
|
this.status = status;
|
|
@@ -358,6 +454,21 @@ export class ApiResponseError extends PipelineRequestError {
|
|
|
358
454
|
this.serverMessage = serverMessage;
|
|
359
455
|
this.validationErrors = validationErrors;
|
|
360
456
|
this.code = code;
|
|
457
|
+
const problem = options?.problem;
|
|
458
|
+
this.type = problem?.type;
|
|
459
|
+
this.title = problem?.title;
|
|
460
|
+
this.instance = problem?.instance;
|
|
461
|
+
this.requestId = problem?.requestId;
|
|
462
|
+
this.errorDomain = problem?.errorDomain;
|
|
463
|
+
this.errorCategory = problem?.errorCategory;
|
|
464
|
+
this.retryable = problem?.retryable;
|
|
465
|
+
this.userAction = problem?.userAction;
|
|
466
|
+
this.model = problem?.model;
|
|
467
|
+
this.provider = problem?.provider;
|
|
468
|
+
this.providerMetadata = problem?.providerMetadata;
|
|
469
|
+
this.migration = problem?.migration;
|
|
470
|
+
this.errors = problem?.errors;
|
|
471
|
+
this.problemDocument = options?.problemDocument;
|
|
361
472
|
}
|
|
362
473
|
}
|
|
363
474
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;
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js";
|
|
|
20
20
|
export type { PrepareInputsBase, PrepareInputsClosure, PrepareInputsRequest, PreparedInputs, } from "./prepare-inputs.js";
|
|
21
21
|
export { locateArtifacts, collectArtifacts, artifactFilename, PIPELEX_STORAGE_SCHEME, BULK_RESOLVE_MAX_URIS, DEFAULT_ARTIFACT_MAX_BYTES, DEFAULT_ARTIFACT_TIMEOUT_MS, DEFAULT_DOWNLOAD_MAX_TOTAL_BYTES, DEFAULT_DOWNLOAD_CONCURRENCY, } from "./artifacts.js";
|
|
22
22
|
export type { ArtifactItemError, ArtifactLocation, ArtifactScope, BulkResolveStorageUrlsInput, BulkResolvedStorageUrls, DownloadArtifactsOptions, DownloadArtifactsRequest, DownloadArtifactsResult, DownloadedArtifact, FetchArtifactOptions, ResolvedArtifact, } from "./artifacts.js";
|
|
23
|
-
export type { DiagnosticKind, DiagnosticRange, Diagnostic, LintResponse, FormatResponse, DictStuff, DictWorkingMemory, DictPipeOutput, DictRunResultExecute, MethodProvenance, PipelexRunResultStart, PipelexHostedToolingExtensions, DryRunStatus, ValidatedPipeEntry, LiftablePipeEntry, PipelexValidationReport, PipelexInvalidReport, PipelexValidationResult, ValidationErrorCategory, ValidationErrorItem, FixSafety, FixOpKind, TomlScalar, TomlValue, SetKeyOp, EnsureTableOp, DeleteKeyOp, DeleteTableOp, RenameTableKeyOp, MoveKeyOp, RemapValueOp, FixOp, SuggestedFix, ConceptRepresentationFormat, InputsTemplateFormat, MthdsFileItem, CrateRequestBase, BuildRequestBase, BuildInputsRequest, BuildOutputRequest, BuildRunnerRequest, ConceptRequest, PipeSpecRequest, CrateInvalidReport, BuildInputsValidReport, BuildOutputValidReport, BuildRunnerValidReport, GeneratedArtifact, RunnerStructures, BuildInputsResponse, BuildOutputResponse, BuildRunnerResponse, ConceptResponse, PipeSpecResponse, ResolveRequest, ResolveValidReport, ResolveResponse, CodegenKind, CodegenTarget, CodegenRequest, CodegenValidReport, CodegenResponse, } from "./models.js";
|
|
23
|
+
export type { DiagnosticKind, DiagnosticRange, Diagnostic, LintResponse, FormatResponse, DictStuff, DictWorkingMemory, DictPipeOutput, DictRunResultExecute, MethodProvenance, PipelexRunResultStart, PipelexHostedToolingExtensions, DryRunStatus, ValidatedPipeEntry, LiftablePipeEntry, PipelexValidationReport, PipelexInvalidReport, PipelexValidationResult, ValidationErrorCategory, ValidationErrorItem, FixSafety, FixOpKind, TomlScalar, TomlValue, FixValue, SetKeyOp, EnsureTableOp, DeleteKeyOp, DeleteTableOp, RenameTableKeyOp, MoveKeyOp, RemapValueOp, FixOp, SuggestedFix, ConceptRepresentationFormat, InputsTemplateFormat, MthdsFileItem, CrateRequestBase, BuildRequestBase, BuildInputsRequest, BuildOutputRequest, BuildRunnerRequest, ConceptRequest, PipeSpecRequest, CrateInvalidReport, BuildInputsValidReport, BuildOutputValidReport, BuildRunnerValidReport, GeneratedArtifact, RunnerStructures, BuildInputsResponse, BuildOutputResponse, BuildRunnerResponse, ConceptResponse, PipeSpecResponse, ResolveRequest, ResolveValidReport, ResolveResponse, CodegenKind, CodegenTarget, CodegenRequest, CodegenValidReport, CodegenResponse, } from "./models.js";
|
|
24
24
|
export { runCodegenCheck, isStampableArtifactPath, STAMPABLE_ARTIFACT_SUFFIXES, CodegenLockError, } from "./codegen-check.js";
|
|
25
25
|
export type { CodegenCheckInput, CodegenCheckReport, CodegenDrift, CodegenDriftCategory, CodegenTreeFile, } from "./codegen-check.js";
|
|
26
|
-
export type { UserProfile, ListMethodsQuery, MethodData, MethodDeletionAccepted, MethodDeletionState, MethodPage, MethodSummary, MethodWriteInput, Membership, MembershipsResponse, SubscriptionResponse, PlanView, InvoiceView, CheckoutResponse, ChangePlanResponse, BillingPortalResponse, PipelexApiKey, PipelexApiKeyCreated, PipelexApiKeyList, OnboardingRole, OnboardingCurrentTool, OnboardingInputType, OnboardingHeardFrom, OnboardingSubmission, ResolvedStorageUrl, UploadInput, UploadedFile, UploadGrantInput, UploadGrant, PipeStatus, ListRunsQuery, PipelineRun, RunDetail,
|
|
26
|
+
export type { UserProfile, ListMethodsQuery, MethodData, MethodDeletionAccepted, MethodDeletionState, MethodPage, MethodSummary, MethodWriteInput, Membership, MembershipsResponse, SubscriptionResponse, PlanView, InvoiceView, CheckoutResponse, ChangePlanResponse, BillingPortalResponse, PipelexApiKey, PipelexApiKeyCreated, PipelexApiKeyList, OnboardingRole, OnboardingCurrentTool, OnboardingInputType, OnboardingHeardFrom, OnboardingSubmission, ResolvedStorageUrl, UploadInput, UploadedFile, UploadGrantInput, UploadGrant, PipeStatus, ListRunsQuery, PipelineRun, RunDetail, RunPage, UpdateRunInput, } from "./product-models.js";
|
|
27
27
|
export { isTerminalRunStatus, isSuccessRunStatus } from "./runs.js";
|
|
28
28
|
export type { RunStatus, RunPublic, RunRead, RunResults, RunResultState, TokensUsageRecord, WaitForResultOptions, } from "./runs.js";
|
|
29
29
|
export { summarizeUsage } from "./usage.js";
|
|
30
30
|
export type { PipeUsageSummary, RunUsagePair, UsageSummary, UsageSummaryState, UsageTokenTotals, } from "./usage.js";
|
|
31
31
|
export { ApiResponseError, ApiUnreachableError, ClientAuthenticationError, MissingMainStuffError, PipelineExecuteTimeoutError, RunFailedError, RunTimeoutError, RunStillRunningError, RunLifecycleUnavailableError, InputPreparationError, EmptyMethodSourceError, InvalidLocalSourceError, RejectedAssetError, UnsupportedUploadCapabilityError, UploadAuthenticationError, UploadTransportError, ArtifactOperationError, ArtifactAuthenticationError, ArtifactFetchError, ScopeUnavailableError, } from "./errors.js";
|
|
32
|
-
export type { RejectedAssetCode, UploadTransportCode } from "./errors.js";
|
|
32
|
+
export type { ApiResponseErrorOptions, RejectedAssetCode, UploadTransportCode } from "./errors.js";
|
|
33
|
+
export type { FieldError, MigrationErrorBlock, ProblemDetails, ProviderErrorMetadata, RunErrorReport, UserAction, } from "./error-models.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings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EAAsE;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AASpD,uEAAuE;AACvE,wFAAwF;AACxF,0FAA0F;AAC1F,iFAAiF;AACjF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,gCAAgC,EAChC,4BAA4B,GAC7B,MAAM,gBAAgB,CAAC;AAkFxB,+EAA+E;AAC/E,4EAA4E;AAC5E,iFAAiF;AACjF,0EAA0E;AAC1E,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAgD5B,wEAAwE;AACxE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAWpE,oFAAoF;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAS5C,+EAA+E;AAC/E,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,EACtB,2BAA2B,EAC3B,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,aAAa,CAAC"}
|
package/dist/models.d.ts
CHANGED
|
@@ -271,19 +271,35 @@ export type ValidationErrorCategory = "blueprint_validation" | "pipe_factory" |
|
|
|
271
271
|
* One structured bundle-validation error — mirror of pipelex's `ValidationErrorItem`.
|
|
272
272
|
* Carried by `PipelexInvalidReport.validation_errors[]` on the **200** invalid arm of
|
|
273
273
|
* `POST /v1/validate` (NOT a 422 — an invalid bundle is a produced verdict), by the
|
|
274
|
-
* VALID arm's advisory `warnings[]`,
|
|
275
|
-
* (`
|
|
274
|
+
* VALID arm's advisory `warnings[]`, by the build and crate routes' **200** invalid arm
|
|
275
|
+
* (`CrateInvalidReport.validation_errors[]`), by the 422 problem body a run route answers
|
|
276
|
+
* when the runner refuses the method for its validation errors
|
|
277
|
+
* (`ApiResponseError.validationErrors`), and by a failed run's stored report.
|
|
278
|
+
*
|
|
279
|
+
* **The shape is `mthds`'s.** The standard's client declares the same item, member for
|
|
280
|
+
* member under the same names, and a consumer reads one vocabulary whichever client
|
|
281
|
+
* handed it the item. It is restated here rather than imported because `mthds` exports it
|
|
282
|
+
* only from its package root, which this SDK does not import (it takes `mthds` through
|
|
283
|
+
* `mthds/protocol` alone, the rule `.dependency-cruiser.cjs` enforces); a type-level test
|
|
284
|
+
* (`tests/validation-items.test.ts`) pins this declaration and `SuggestedFix`'s to the
|
|
285
|
+
* standard's, so a member added on one side and not the other fails the typecheck.
|
|
276
286
|
*
|
|
277
287
|
* Only `category` and `message` are always present; the rest are populated per
|
|
278
|
-
* `category`. Every other member is `?: T | null`
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
288
|
+
* `category`. Every other member is `?: T | null` — the one way this declaration
|
|
289
|
+
* differs from `mthds`'s — because the two channels serialize an unset locator
|
|
290
|
+
* differently: the invalid arm and the crate routes drop the key (`exclude_none`
|
|
291
|
+
* server-side) while the valid arm — which carries `warnings[]` — does not, so the same
|
|
292
|
+
* item arrives with explicit `null`s there. A truthiness check reads both; an
|
|
293
|
+
* `=== undefined` check would be wrong on one of them.
|
|
283
294
|
*
|
|
284
295
|
* `source` is the declaring file path (CLI) or the per-content `mthds_sources` name
|
|
285
296
|
* the API threads onto the in-memory load path — the owning file for cross-file
|
|
286
297
|
* diagnostics.
|
|
298
|
+
*
|
|
299
|
+
* An `unknown_model` item (a model reference the runner's model deck does not know)
|
|
300
|
+
* carries the reference as written, the kind of model the field takes and the close
|
|
301
|
+
* matches, and, when there is exactly one close match, a `suggested_fix` that remaps
|
|
302
|
+
* the reference to it.
|
|
287
303
|
*/
|
|
288
304
|
export interface ValidationErrorItem {
|
|
289
305
|
category: ValidationErrorCategory;
|
|
@@ -297,8 +313,21 @@ export interface ValidationErrorItem {
|
|
|
297
313
|
field_name?: string | null;
|
|
298
314
|
variable_names?: string[] | null;
|
|
299
315
|
missing_concept_code?: string | null;
|
|
316
|
+
/** The pipe a reference names that the bundle does not declare. */
|
|
300
317
|
missing_pipe_code?: string | null;
|
|
301
318
|
declared_concepts?: string[] | null;
|
|
319
|
+
/**
|
|
320
|
+
* On an `unknown_model` item: the model reference exactly as the author wrote it
|
|
321
|
+
* (`gpt-5.1`, `@best-sonet`, `$writting-factual`).
|
|
322
|
+
*/
|
|
323
|
+
model_reference?: string | null;
|
|
324
|
+
/** On an `unknown_model` item: the kind of model the field takes (`llm`, `img_gen`, …). */
|
|
325
|
+
model_type?: string | null;
|
|
326
|
+
/**
|
|
327
|
+
* On an `unknown_model` item: the close matches of the same kind, each spelled as a
|
|
328
|
+
* reference the field accepts.
|
|
329
|
+
*/
|
|
330
|
+
suggestions?: string[] | null;
|
|
302
331
|
/** The server's deterministic repair proposal for this error, when it has one. */
|
|
303
332
|
suggested_fix?: SuggestedFix | null;
|
|
304
333
|
}
|
|
@@ -314,6 +343,8 @@ export type TomlScalar = string | number | boolean;
|
|
|
314
343
|
* the server does not emit it.
|
|
315
344
|
*/
|
|
316
345
|
export type TomlValue = TomlScalar | Record<string, TomlScalar>;
|
|
346
|
+
/** `TomlValue` under the name `mthds` gives it, so either client's vocabulary reads here. */
|
|
347
|
+
export type FixValue = TomlValue;
|
|
317
348
|
/**
|
|
318
349
|
* What every fix op carries: the table it acts in. `table_path` addresses the containing
|
|
319
350
|
* table (e.g. `["pipe", "my_seq"]`), aligned with the `field_path` conventions of
|
|
@@ -358,7 +389,11 @@ export interface MoveKeyOp extends FixOpBase {
|
|
|
358
389
|
new_table_path: string[];
|
|
359
390
|
new_key: string;
|
|
360
391
|
}
|
|
361
|
-
/**
|
|
392
|
+
/**
|
|
393
|
+
* Rewrite `key`'s value through `mapping`, leaving an unmapped value untouched. The
|
|
394
|
+
* unknown-model fix is one: it maps the reference as written to its one close match, so
|
|
395
|
+
* it changes nothing once the author has edited the field.
|
|
396
|
+
*/
|
|
362
397
|
export interface RemapValueOp extends FixOpBase {
|
|
363
398
|
kind: "remap_value";
|
|
364
399
|
key: string;
|
|
@@ -370,6 +405,10 @@ export type FixOp = SetKeyOp | EnsureTableOp | DeleteKeyOp | DeleteTableOp | Ren
|
|
|
370
405
|
* A deterministic fix for one validation error, ready for a style-preserving applier —
|
|
371
406
|
* mirror of pipelex's `SuggestedFix`. The ops are semantic patches over the `.mthds`
|
|
372
407
|
* document, not a text diff, so an applier keeps the author's formatting.
|
|
408
|
+
*
|
|
409
|
+
* The shape is `mthds`'s `SuggestedFix`, its op vocabulary included (this SDK's
|
|
410
|
+
* `TomlValue` is the standard's `FixValue`), restated and pinned for the reason
|
|
411
|
+
* `ValidationErrorItem` gives; `source` alone is widened to `| null`.
|
|
373
412
|
*/
|
|
374
413
|
export interface SuggestedFix {
|
|
375
414
|
/** The kebab-case rule id, e.g. `"match-sequence-output"`. */
|
package/dist/product-models.d.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* consumes — not a speculative mirror of every server field.
|
|
11
11
|
*/
|
|
12
12
|
import type { MethodFile } from "mthds/protocol";
|
|
13
|
+
import type { RunErrorReport } from "./error-models.js";
|
|
13
14
|
import type { RunStatus } from "./runs.js";
|
|
14
15
|
export interface UserProfile {
|
|
15
16
|
email: string;
|
|
@@ -270,18 +271,6 @@ export interface UploadGrant {
|
|
|
270
271
|
}
|
|
271
272
|
/** Per-pipe progress marker surfaced in a run's `pipe_statuses` map. */
|
|
272
273
|
export type PipeStatus = "scheduled" | "running" | "succeeded" | "failed" | "skipped";
|
|
273
|
-
/**
|
|
274
|
-
* The runner's structured failure report, as stored on a terminal-failed run.
|
|
275
|
-
*
|
|
276
|
-
* The wire payload carries the full VERBOSE `ErrorReport`; these are the two
|
|
277
|
-
* fields a consumer can rely on. Optional throughout: the shape is owned by the
|
|
278
|
-
* runner, and a failure whose callback carried no report has none of it.
|
|
279
|
-
*/
|
|
280
|
-
export interface RunErrorReport {
|
|
281
|
-
message?: string;
|
|
282
|
-
error_type?: string;
|
|
283
|
-
[key: string]: unknown;
|
|
284
|
-
}
|
|
285
274
|
export interface PipelineRun {
|
|
286
275
|
pipeline_run_id: string;
|
|
287
276
|
/** `null` on an ad-hoc run — one started from an inline bundle belongs to no
|
|
@@ -300,9 +289,9 @@ export interface PipelineRun {
|
|
|
300
289
|
pipe_statuses?: Record<string, PipeStatus> | null;
|
|
301
290
|
created_at: string;
|
|
302
291
|
finished_at?: string | null;
|
|
303
|
-
/**
|
|
304
|
-
* This is how a consumer tells the user
|
|
305
|
-
* a generic message. */
|
|
292
|
+
/** The runner's stored error report, typed whole — present only on a failed run
|
|
293
|
+
* whose completion callback carried one. This is how a consumer tells the user
|
|
294
|
+
* WHY a run failed rather than showing a generic message. */
|
|
306
295
|
error?: RunErrorReport | null;
|
|
307
296
|
}
|
|
308
297
|
/**
|
package/dist/runs.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InputForm, OutputForm, PipeIOContracts } from "mthds/protocol";
|
|
2
|
+
import type { RunErrorReport } from "./error-models.js";
|
|
2
3
|
import type { DictPipeOutput, DictWorkingMemory } from "./models.js";
|
|
3
4
|
/**
|
|
4
5
|
* Run-lifecycle types + polling for the hosted polling surface (`/v1/runs/*`).
|
|
@@ -32,11 +33,11 @@ export declare function isSuccessRunStatus(status: RunStatus): boolean;
|
|
|
32
33
|
/**
|
|
33
34
|
* A run record — the BASE shape of the run-lifecycle read surface.
|
|
34
35
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* signature keeps them accessible, mirroring the
|
|
39
|
-
* passthrough.
|
|
36
|
+
* The base fields are declared, and so is `error`, the stored report of a failed run, which
|
|
37
|
+
* is how a caller learns why a run failed. An implementation may return more (identity,
|
|
38
|
+
* workflow ids, storage URLs, anything else) — those are server-specific response fields,
|
|
39
|
+
* not named in this SDK; the index signature keeps them accessible, mirroring the
|
|
40
|
+
* request-side `extra` passthrough.
|
|
40
41
|
*/
|
|
41
42
|
export interface RunPublic {
|
|
42
43
|
pipeline_run_id: string;
|
|
@@ -44,6 +45,14 @@ export interface RunPublic {
|
|
|
44
45
|
status: RunStatus;
|
|
45
46
|
created_at: string;
|
|
46
47
|
finished_at?: string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Why the run failed: the runner's stored error report, typed whole (see `RunErrorReport`).
|
|
50
|
+
* `null` on a completed run and on a run that ended without a report — a cancelled,
|
|
51
|
+
* terminated or timed-out run, or one the platform finalized itself; absent on a server that
|
|
52
|
+
* does not serve it. The results read of the same run carries the same object in its `409`,
|
|
53
|
+
* which is where `getRunResult`'s failed arm and `RunFailedError` take it from.
|
|
54
|
+
*/
|
|
55
|
+
error?: RunErrorReport | null;
|
|
47
56
|
/** Server-specific response fields (defined by the server you call). */
|
|
48
57
|
[extension: string]: unknown;
|
|
49
58
|
}
|
|
@@ -236,7 +245,10 @@ export interface RunResults {
|
|
|
236
245
|
* Single-shot result lookup outcome, discriminated on `state`:
|
|
237
246
|
* - `running` — HTTP 202; poll again after `retry_after_seconds`.
|
|
238
247
|
* - `completed` — HTTP 200; `result` carries the artifacts.
|
|
239
|
-
* - `failed` — HTTP 409; run reached a terminal non-`COMPLETED` status.
|
|
248
|
+
* - `failed` — HTTP 409; run reached a terminal non-`COMPLETED` status. `status` is the
|
|
249
|
+
* problem's `run_status` member (recovered from `detail` on a platform that predates it),
|
|
250
|
+
* `message` its `detail` (`Run finished with status FAILED: <the report's message>`), and
|
|
251
|
+
* `error` the run's stored error report, typed, or `null` when the run ended without one.
|
|
240
252
|
*/
|
|
241
253
|
export type RunResultState = {
|
|
242
254
|
state: "running";
|
|
@@ -251,6 +263,7 @@ export type RunResultState = {
|
|
|
251
263
|
pipeline_run_id: string;
|
|
252
264
|
status: RunStatus;
|
|
253
265
|
message: string;
|
|
266
|
+
error: RunErrorReport | null;
|
|
254
267
|
};
|
|
255
268
|
export interface WaitForResultOptions {
|
|
256
269
|
/**
|
|
@@ -286,8 +299,9 @@ export declare function assertWaitOptions(options?: WaitForResultOptions): void;
|
|
|
286
299
|
/**
|
|
287
300
|
* Poll a single-shot result lookup (`fetchOnce`) until the run reaches a
|
|
288
301
|
* terminal state. Returns the artifacts on `COMPLETED`, throws `RunFailedError`
|
|
289
|
-
* on any other terminal status
|
|
290
|
-
*
|
|
302
|
+
* on any other terminal status — carrying the run's status and its stored error
|
|
303
|
+
* report — and throws `RunTimeoutError` if `timeoutMs` elapses first (the run
|
|
304
|
+
* keeps executing server-side — re-poll by id later).
|
|
291
305
|
*
|
|
292
306
|
* The single owner of the wait/poll/Retry-After/abort logic — `PipelexApiClient.waitForResult`
|
|
293
307
|
* delegates here, so the behavior can never drift.
|
package/dist/runs.js
CHANGED
|
@@ -33,8 +33,9 @@ export function assertWaitOptions(options = {}) {
|
|
|
33
33
|
/**
|
|
34
34
|
* Poll a single-shot result lookup (`fetchOnce`) until the run reaches a
|
|
35
35
|
* terminal state. Returns the artifacts on `COMPLETED`, throws `RunFailedError`
|
|
36
|
-
* on any other terminal status
|
|
37
|
-
*
|
|
36
|
+
* on any other terminal status — carrying the run's status and its stored error
|
|
37
|
+
* report — and throws `RunTimeoutError` if `timeoutMs` elapses first (the run
|
|
38
|
+
* keeps executing server-side — re-poll by id later).
|
|
38
39
|
*
|
|
39
40
|
* The single owner of the wait/poll/Retry-After/abort logic — `PipelexApiClient.waitForResult`
|
|
40
41
|
* delegates here, so the behavior can never drift.
|
|
@@ -59,7 +60,7 @@ export async function pollUntilResult(fetchOnce, runId, options = {}) {
|
|
|
59
60
|
return state.result;
|
|
60
61
|
}
|
|
61
62
|
if (state.state === "failed") {
|
|
62
|
-
throw new RunFailedError(state.message, runId, state.status);
|
|
63
|
+
throw new RunFailedError(state.message, runId, state.status, { error: state.error });
|
|
63
64
|
}
|
|
64
65
|
attempt += 1;
|
|
65
66
|
options.onPoll?.({ attempt, elapsedMs });
|
package/dist/runs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../src/runs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../src/runs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAyCjD,MAAM,qBAAqB,GAA2B,IAAI,GAAG,CAAY;IACvE,WAAW;IACX,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,WAAW;CACZ,CAAC,CAAC;AAEH,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,OAAO,qBAAqB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,OAAO,MAAM,KAAK,WAAW,CAAC;AAChC,CAAC;AAkQD,uEAAuE;AAEvE,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAC9C,MAAM,CAAC,MAAM,uBAAuB,GAAG,SAAS,CAAC,CAAC,0DAA0D;AAQ5G;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAgC,EAAE;IAClE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAC1C,IAAI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;QAC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