@pipelex/sdk 0.39.0 → 0.41.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 +3 -0
- package/dist/bundle-resources.d.ts +62 -0
- package/dist/bundle-resources.js +165 -0
- package/dist/bundle-resources.js.map +1 -0
- package/dist/cli/script.d.ts +1 -1
- package/dist/cli/source.d.ts +2 -1
- package/dist/cli/source.js +61 -3
- package/dist/cli/source.js.map +1 -1
- package/dist/client.d.ts +107 -23
- package/dist/client.js +216 -113
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +16 -5
- package/dist/errors.js +15 -5
- package/dist/errors.js.map +1 -1
- package/dist/hooks/bundle-gather.d.ts +28 -1
- package/dist/hooks/bundle-gather.js +163 -3
- package/dist/hooks/bundle-gather.js.map +1 -1
- package/dist/hooks/claude-mthds-check.d.ts +4 -2
- package/dist/hooks/claude-mthds-check.js +5 -2
- package/dist/hooks/claude-mthds-check.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +42 -4
- package/dist/prepare-inputs.d.ts +48 -7
- package/dist/prepare-inputs.js +236 -35
- package/dist/prepare-inputs.js.map +1 -1
- package/dist/product-models.d.ts +46 -0
- package/dist/runs.d.ts +11 -0
- package/dist/runs.js +35 -0
- package/dist/runs.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/architecture.md +5 -3
- package/docs/bundle-resources.md +107 -0
- package/docs/cli.md +1 -0
- package/docs/crate-routes.md +5 -1
- package/docs/errors.md +4 -3
- package/docs/hook-bundle.md +2 -0
- package/docs/input-preparation.md +9 -5
- package/package.json +1 -1
package/dist/prepare-inputs.js
CHANGED
|
@@ -33,9 +33,31 @@
|
|
|
33
33
|
import { isValidationItem } from "./error-models.js";
|
|
34
34
|
import { throwIfAborted } from "./runs.js";
|
|
35
35
|
import { ApiResponseError, InputPreparationError, InvalidInputValueError, MethodLoadError, UploadNotAllowedError, } from "./errors.js";
|
|
36
|
+
import { hasBundleResources, isResourceMap } from "./bundle-resources.js";
|
|
36
37
|
import { uploadFile } from "./upload.js";
|
|
37
38
|
const PIPELEX_STORAGE_SCHEME = "pipelex-storage://";
|
|
38
39
|
const HTTP_URL_RE = /^https?:\/\//i;
|
|
40
|
+
/**
|
|
41
|
+
* Every `kind` the walk handles, in the standard's order, and the only kinds a descriptor may name:
|
|
42
|
+
* any other is refused. It is the walk's own table rather than the `FIELD_KINDS` of whichever
|
|
43
|
+
* `mthds` is installed beside the SDK, so a newer `mthds` defining a new kind, which may be a file
|
|
44
|
+
* kind, cannot reach the walk at run time. Moving the pin onto such an `mthds` stops the build
|
|
45
|
+
* here, where `satisfies` requires every `FieldKind`, and in `resolveNode`'s exhaustive switch.
|
|
46
|
+
*/
|
|
47
|
+
const WALKED_KINDS = {
|
|
48
|
+
text: true,
|
|
49
|
+
prose: true,
|
|
50
|
+
date: true,
|
|
51
|
+
number: true,
|
|
52
|
+
boolean: true,
|
|
53
|
+
enum: true,
|
|
54
|
+
document: true,
|
|
55
|
+
image: true,
|
|
56
|
+
object: true,
|
|
57
|
+
list: true,
|
|
58
|
+
unknown: true,
|
|
59
|
+
};
|
|
60
|
+
const KNOWN_KINDS = new Set(Object.keys(WALKED_KINDS));
|
|
39
61
|
/**
|
|
40
62
|
* The `error_type`s of the route's pipe-selection refusals — the only `422`s
|
|
41
63
|
* `prepareInputs` turns into an `InputPreparationError`. They are the runtime's
|
|
@@ -81,11 +103,18 @@ function isExplicitEnvelope(value) {
|
|
|
81
103
|
const keys = Object.keys(value);
|
|
82
104
|
return keys.length === 2 && "concept" in value && "content" in value;
|
|
83
105
|
}
|
|
84
|
-
/**
|
|
85
|
-
function
|
|
106
|
+
/** An `InvalidInputValueError` for the value at `at`, whose message the caller words. */
|
|
107
|
+
function invalidValueAt(at, message, options) {
|
|
108
|
+
return new InvalidInputValueError(message, { inputName: at.name, inputPath: at.path }, options);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Decode a `data:` URL into bytes plus its MIME type. `at` is where the URL sits, for the
|
|
112
|
+
* error's wording only; the message never quotes the URL, which is the caller's data.
|
|
113
|
+
*/
|
|
114
|
+
function decodeDataUrl(dataUrl, at) {
|
|
86
115
|
const comma = dataUrl.indexOf(",");
|
|
87
116
|
if (comma < 0) {
|
|
88
|
-
throw
|
|
117
|
+
throw invalidValueAt(at, `Input "${at.path}" holds a malformed data URL (no comma separator).`);
|
|
89
118
|
}
|
|
90
119
|
const header = dataUrl.slice(5, comma); // strip "data:"
|
|
91
120
|
const payload = dataUrl.slice(comma + 1);
|
|
@@ -107,7 +136,8 @@ function decodeDataUrl(dataUrl) {
|
|
|
107
136
|
return { bytes: new TextEncoder().encode(text), contentType };
|
|
108
137
|
}
|
|
109
138
|
catch (cause) {
|
|
110
|
-
throw
|
|
139
|
+
throw invalidValueAt(at, `Input "${at.path}" holds a malformed data URL ` +
|
|
140
|
+
`(${isBase64 ? "invalid base64" : "invalid percent-encoding"}).`, { cause });
|
|
111
141
|
}
|
|
112
142
|
}
|
|
113
143
|
/**
|
|
@@ -138,21 +168,26 @@ function classifySource(source) {
|
|
|
138
168
|
}
|
|
139
169
|
return { kind: "unsupported", value: source };
|
|
140
170
|
}
|
|
141
|
-
/**
|
|
142
|
-
|
|
171
|
+
/**
|
|
172
|
+
* Resolve one classified source to the URL/URI to write, deduped by the caller's value's identity.
|
|
173
|
+
* `at` words a malformed `data:` URL's error; a decode rejected once is handed, cached, to a later
|
|
174
|
+
* position holding the same URL, and is never the one reported, since the walk reports the first
|
|
175
|
+
* failure it meets.
|
|
176
|
+
*/
|
|
177
|
+
function resolveSource(ctx, source, at) {
|
|
143
178
|
const cached = ctx.dedup.get(source.value);
|
|
144
179
|
if (cached !== undefined)
|
|
145
180
|
return cached;
|
|
146
|
-
const pending = doResolveSource(ctx, source);
|
|
181
|
+
const pending = doResolveSource(ctx, source, at);
|
|
147
182
|
ctx.dedup.set(source.value, pending);
|
|
148
183
|
return pending;
|
|
149
184
|
}
|
|
150
|
-
async function doResolveSource(ctx, source) {
|
|
185
|
+
async function doResolveSource(ctx, source, at) {
|
|
151
186
|
switch (source.kind) {
|
|
152
187
|
case "reference":
|
|
153
188
|
return source.value; // already prepared, or a reachable URL — pass through
|
|
154
189
|
case "data_url": {
|
|
155
|
-
const { bytes, contentType } = decodeDataUrl(source.value);
|
|
190
|
+
const { bytes, contentType } = decodeDataUrl(source.value, at);
|
|
156
191
|
throwIfAborted(ctx.signal);
|
|
157
192
|
const record = await uploadFile(ctx.client, bytes, { contentType, signal: ctx.signal });
|
|
158
193
|
ctx.uploads.push(record);
|
|
@@ -165,30 +200,54 @@ async function doResolveSource(ctx, source) {
|
|
|
165
200
|
ctx.uploads.push(record);
|
|
166
201
|
return record.uri;
|
|
167
202
|
}
|
|
168
|
-
case "unsupported":
|
|
169
|
-
// An unrecognized value sits at a file-bearing position (neither a source string,
|
|
170
|
-
// bytes, nor a canonical `{url}` content dict). Fail with a typed error rather than
|
|
171
|
-
// letting a raw TypeError escape from the byte-extraction path.
|
|
172
|
-
throw new InvalidInputValueError(`Unsupported value at a file input: expected a path string, bytes (Blob/File/ArrayBuffer/Uint8Array), ` +
|
|
173
|
-
`a data URL, an http(s)/pipelex-storage:// URL, or canonical {url} content; got ${typeof source.value}.`);
|
|
174
203
|
}
|
|
175
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* What a value no file input takes is, in words naming its kind and never its content, for the
|
|
207
|
+
* message that refuses it: `a number`, `null`, `an object with no "url" key`.
|
|
208
|
+
*/
|
|
209
|
+
function describeUnsupported(value) {
|
|
210
|
+
if (value === null)
|
|
211
|
+
return "null";
|
|
212
|
+
if (value === undefined)
|
|
213
|
+
return "undefined";
|
|
214
|
+
if (Array.isArray(value))
|
|
215
|
+
return "an array";
|
|
216
|
+
if (isPlainObject(value))
|
|
217
|
+
return "url" in value ? "{url} content" : 'an object with no "url" key';
|
|
218
|
+
if (typeof value === "object")
|
|
219
|
+
return "an object that is neither bytes nor {url} content";
|
|
220
|
+
return `a ${typeof value}`;
|
|
221
|
+
}
|
|
222
|
+
/** The forms a file input takes, in the words of the refusal of a value it does not. */
|
|
223
|
+
const FILE_FORMS_WITH_UPLOADS = ": pass a local path, bytes (a Blob, File, ArrayBuffer or Uint8Array), a data: URL, an http(s) " +
|
|
224
|
+
"URL or a pipelex-storage:// reference, bare or as the url of {url} content.";
|
|
225
|
+
/** The same under `allowUploads: false`, word for word `UploadNotAllowedError`'s tail. */
|
|
226
|
+
const FILE_FORMS_WITHOUT_UPLOADS = ", and this preparation uploads nothing: pass an http(s) URL or a pipelex-storage:// reference " +
|
|
227
|
+
"instead.";
|
|
176
228
|
/**
|
|
177
229
|
* Resolve a value known to sit at a file position into canonical content with a rewritten `url`.
|
|
178
|
-
*
|
|
179
|
-
* `
|
|
230
|
+
* A value no file input takes is refused here, where its position and the mode are known, and
|
|
231
|
+
* under `allowUploads: false` so is a source that would need an upload, before `resolveSource`
|
|
232
|
+
* could read, decode or upload it.
|
|
180
233
|
*/
|
|
181
234
|
async function resolveFilePosition(ctx, callerValue, at) {
|
|
182
235
|
const fileContent = isFileContent(callerValue);
|
|
183
236
|
const source = classifySource(fileContent ? callerValue.url : callerValue);
|
|
184
|
-
if (
|
|
237
|
+
if (source.kind === "unsupported") {
|
|
238
|
+
const unsupported = describeUnsupported(source.value);
|
|
239
|
+
throw invalidValueAt(at, `Input "${at.path}" holds ${fileContent ? `{url} content whose url is ${unsupported}` : unsupported}, ` +
|
|
240
|
+
"which no file input takes" +
|
|
241
|
+
(ctx.allowUploads ? FILE_FORMS_WITH_UPLOADS : FILE_FORMS_WITHOUT_UPLOADS));
|
|
242
|
+
}
|
|
243
|
+
if (!ctx.allowUploads && source.kind !== "reference") {
|
|
185
244
|
throw new UploadNotAllowedError({
|
|
186
245
|
inputName: at.name,
|
|
187
246
|
inputPath: at.path,
|
|
188
247
|
valueKind: source.kind,
|
|
189
248
|
});
|
|
190
249
|
}
|
|
191
|
-
const resolved = await resolveSource(ctx, source);
|
|
250
|
+
const resolved = await resolveSource(ctx, source, at);
|
|
192
251
|
return fileContent ? { ...callerValue, url: resolved } : { url: resolved };
|
|
193
252
|
}
|
|
194
253
|
/**
|
|
@@ -208,6 +267,12 @@ async function resolveFilePosition(ctx, callerValue, at) {
|
|
|
208
267
|
* A caller value whose shape disagrees with the node (a scalar at an `object`, a
|
|
209
268
|
* non-array at a `list`) passes through for the run to reject — preparation never
|
|
210
269
|
* second-guesses the signature.
|
|
270
|
+
*
|
|
271
|
+
* Every node it receives was checked by {@link inputFormFault}: an `object`
|
|
272
|
+
* carries a list of named fields, a `list` carries a node, and every `kind` is one
|
|
273
|
+
* of {@link WALKED_KINDS}, so the walk trusts the descriptor's types without a
|
|
274
|
+
* guard. The switch names every kind, so a kind the standard adds does not
|
|
275
|
+
* compile until the walk decides what it is.
|
|
211
276
|
*/
|
|
212
277
|
async function resolveNode(ctx, node, callerValue, at) {
|
|
213
278
|
switch (node.kind) {
|
|
@@ -233,17 +298,33 @@ async function resolveNode(ctx, node, callerValue, at) {
|
|
|
233
298
|
return callerValue;
|
|
234
299
|
return Promise.all(callerValue.map((element, index) => resolveNode(ctx, node.item, element, { name: at.name, path: `${at.path}[${index}]` })));
|
|
235
300
|
}
|
|
236
|
-
|
|
301
|
+
case "text":
|
|
302
|
+
case "prose":
|
|
303
|
+
case "date":
|
|
304
|
+
case "number":
|
|
305
|
+
case "boolean":
|
|
306
|
+
case "enum":
|
|
307
|
+
case "unknown":
|
|
237
308
|
return callerValue;
|
|
309
|
+
default: {
|
|
310
|
+
// Unreachable: the descriptor was checked against WALKED_KINDS before the walk began.
|
|
311
|
+
const unwalked = node;
|
|
312
|
+
throw new InputPreparationError(`Cannot prepare inputs: the walk has no arm for the kind ${described(unwalked.kind)}.`, { verdict: { errorDomain: "runtime", retryable: false } });
|
|
313
|
+
}
|
|
238
314
|
}
|
|
239
315
|
}
|
|
316
|
+
/** Whether `resources` is a plain object with no file in it, which sends nothing. */
|
|
317
|
+
function isEmptyResourceMap(resources) {
|
|
318
|
+
return isResourceMap(resources) && !hasBundleResources(resources);
|
|
319
|
+
}
|
|
240
320
|
/**
|
|
241
321
|
* Normalize and check the three selectors. Empty is absent (`files: []`,
|
|
242
322
|
* `method_ref: ""`, `method_id: " "`), mirroring the run options' rule and the
|
|
243
323
|
* Python `CrateRequestBase` normalisers, and exactly one must remain — the check
|
|
244
324
|
* lives here because this helper is the one that composes the `pipeIo` call.
|
|
245
|
-
*
|
|
246
|
-
* untyped (JS) ones
|
|
325
|
+
* `resources` that carry a file accompany inline `files` only. The illegal shapes
|
|
326
|
+
* are compile errors for typed callers; this backs them up for untyped (JS) ones
|
|
327
|
+
* with a typed `InputPreparationError`.
|
|
247
328
|
*/
|
|
248
329
|
function resolveSelector(request) {
|
|
249
330
|
const raw = request;
|
|
@@ -252,6 +333,12 @@ function resolveSelector(request) {
|
|
|
252
333
|
: undefined;
|
|
253
334
|
const methodRef = nonEmptyString(raw["method_ref"]);
|
|
254
335
|
const methodId = nonEmptyString(raw["method_id"]);
|
|
336
|
+
// Any value goes on with inline `files`, so the client's encoder refuses one that is not a
|
|
337
|
+
// map of paths to bytes, as it does on every route; an empty map is not sent.
|
|
338
|
+
const rawResources = raw["resources"];
|
|
339
|
+
const resources = rawResources === undefined || rawResources === null
|
|
340
|
+
? undefined
|
|
341
|
+
: rawResources;
|
|
255
342
|
const given = [];
|
|
256
343
|
if (files !== undefined)
|
|
257
344
|
given.push("`files`");
|
|
@@ -270,7 +357,11 @@ function resolveSelector(request) {
|
|
|
270
357
|
"selector — `files`, `method_ref` or `method_id`.");
|
|
271
358
|
}
|
|
272
359
|
if (files !== undefined)
|
|
273
|
-
return { files };
|
|
360
|
+
return resources === undefined ? { files } : { files, resources };
|
|
361
|
+
// Beside the other selectors only an empty map passes, as it sends nothing.
|
|
362
|
+
if (resources !== undefined && !isEmptyResourceMap(resources)) {
|
|
363
|
+
throw new InputPreparationError(`Cannot prepare inputs: \`resources\` accompany inline \`files\`; a ${methodRef !== undefined ? "published" : "stored"} method's files are its own.`);
|
|
364
|
+
}
|
|
274
365
|
if (methodRef !== undefined)
|
|
275
366
|
return { method_ref: methodRef };
|
|
276
367
|
return { method_id: methodId };
|
|
@@ -327,7 +418,8 @@ function resolveAllowUploads(raw) {
|
|
|
327
418
|
* which it answers with a `422` typed by one of {@link PIPE_SELECTION_ERROR_TYPES};
|
|
328
419
|
* every other failure is re-thrown unchanged. An answer with no boolean `is_valid`
|
|
329
420
|
* is neither arm, so it fails the preparation with a `runtime` verdict, as an
|
|
330
|
-
* `input_form` that does not describe the selected pipe does
|
|
421
|
+
* `input_form` that does not describe the selected pipe does, and one whose
|
|
422
|
+
* descriptor is malformed where the walk reads it.
|
|
331
423
|
*/
|
|
332
424
|
async function fetchSignature(client, selector, pipeRef) {
|
|
333
425
|
const request = pipeRef === undefined ? { ...selector } : { ...selector, pipe_ref: pipeRef };
|
|
@@ -377,20 +469,123 @@ function invalidReason(answer) {
|
|
|
377
469
|
* The descriptor of the pipe the route selected. The route answers a
|
|
378
470
|
* single-pipe request with `input_form` keyed by exactly the `pipe_ref` it
|
|
379
471
|
* resolved, so a missing ref or a missing key is the answer contradicting itself
|
|
380
|
-
* — preparing any other pipe would silently walk the wrong signature.
|
|
472
|
+
* — preparing any other pipe would silently walk the wrong signature. The entry
|
|
473
|
+
* found is then checked whole, by {@link checkedDescriptor}, before it is trusted.
|
|
381
474
|
*/
|
|
382
475
|
function selectedDescriptor(report) {
|
|
383
476
|
const pipeRef = nonEmptyString(report.pipe_ref);
|
|
384
477
|
const inputForm = report.input_form;
|
|
385
478
|
if (pipeRef === undefined || !isPlainObject(inputForm) || !Object.hasOwn(inputForm, pipeRef)) {
|
|
386
|
-
const
|
|
479
|
+
const describedPipes = isPlainObject(inputForm)
|
|
387
480
|
? Object.keys(inputForm).join(", ") || "none"
|
|
388
481
|
: "none";
|
|
389
482
|
// The route broke its own contract, which no change to the request fixes.
|
|
390
483
|
throw new InputPreparationError(`Cannot prepare inputs: the pipe I/O answer selected ${pipeRef === undefined ? "no pipe" : `"${pipeRef}"`}, ` +
|
|
391
|
-
`but its \`input_form\` does not describe it (it describes: ${
|
|
484
|
+
`but its \`input_form\` does not describe it (it describes: ${describedPipes}).`, { verdict: { errorDomain: "runtime", retryable: false } });
|
|
485
|
+
}
|
|
486
|
+
return checkedDescriptor(pipeRef, inputForm[pipeRef]);
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* The selected entry of `input_form`, checked whole by {@link inputFormFault}
|
|
490
|
+
* before any caller value is read and before anything is uploaded, and refused at
|
|
491
|
+
* its first fault.
|
|
492
|
+
*
|
|
493
|
+
* A malformation is the route breaking its contract, at whatever depth and under
|
|
494
|
+
* whichever input, so it is refused with a `runtime` verdict, not retryable. It is
|
|
495
|
+
* never passed through: a node the SDK cannot read may be a file position, and
|
|
496
|
+
* under the default mode passing it through would send the caller's local path to
|
|
497
|
+
* the runner verbatim. A `kind` outside {@link WALKED_KINDS} is refused for the
|
|
498
|
+
* same reason, since it may be a file kind a newer standard defines.
|
|
499
|
+
*/
|
|
500
|
+
function checkedDescriptor(pipeRef, entry) {
|
|
501
|
+
const found = inputFormFault(entry);
|
|
502
|
+
if (found !== undefined) {
|
|
503
|
+
throw new InputPreparationError(`Cannot prepare inputs: the pipe I/O answer's \`input_form\` for "${pipeRef}" ` +
|
|
504
|
+
`is ${found.message}.`, { verdict: { errorDomain: "runtime", retryable: false } });
|
|
505
|
+
}
|
|
506
|
+
return entry;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* The first fault of one pipe's input-form entry (`input_form[pipe_ref]`) in
|
|
510
|
+
* document order, or `undefined` when `prepareInputs` can walk it. It checks what
|
|
511
|
+
* the walk reads and only that: the entry is an object whose `fields` is a list;
|
|
512
|
+
* every field, at the top level or in an `object` node, is an object with a string
|
|
513
|
+
* `name`; every node, a field or a `list` node's `item`, has a string `kind` this
|
|
514
|
+
* SDK walks, the standard's vocabulary at the `mthds` it pins; an `object` node's
|
|
515
|
+
* `fields` is a list and a `list` node's `item` is a node. Members the walk does
|
|
516
|
+
* not read (`concept_ref`, `presence`, `hints`, …) are not checked. `prepareInputs`
|
|
517
|
+
* refuses an entry with a fault before it uploads anything; a caller that reads an
|
|
518
|
+
* entry itself, to render a form or a template, checks it here first.
|
|
519
|
+
*/
|
|
520
|
+
export function inputFormFault(entry) {
|
|
521
|
+
if (!isPlainObject(entry)) {
|
|
522
|
+
return fault("", `expected an object with a list of fields, got ${described(entry)}`);
|
|
523
|
+
}
|
|
524
|
+
return fieldsFault(entry.fields, "fields");
|
|
525
|
+
}
|
|
526
|
+
function fault(path, problem) {
|
|
527
|
+
return {
|
|
528
|
+
path,
|
|
529
|
+
problem,
|
|
530
|
+
message: `malformed${path === "" ? "" : ` at ${path}`}: ${problem}`,
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
function fieldsFault(fields, path) {
|
|
534
|
+
if (!Array.isArray(fields)) {
|
|
535
|
+
return fault(path, `expected a list of fields, got ${described(fields)}`);
|
|
536
|
+
}
|
|
537
|
+
for (const [index, field] of fields.entries()) {
|
|
538
|
+
const at = `${path}[${index}]`;
|
|
539
|
+
if (!isPlainObject(field)) {
|
|
540
|
+
return fault(at, `expected a field with a string name and kind, got ${described(field)}`);
|
|
541
|
+
}
|
|
542
|
+
if (typeof field.name !== "string") {
|
|
543
|
+
return fault(`${at}.name`, `expected a string, got ${described(field.name)}`);
|
|
544
|
+
}
|
|
545
|
+
const found = nodeFault(field, at);
|
|
546
|
+
if (found !== undefined)
|
|
547
|
+
return found;
|
|
548
|
+
}
|
|
549
|
+
return undefined;
|
|
550
|
+
}
|
|
551
|
+
function nodeFault(node, path) {
|
|
552
|
+
if (!isPlainObject(node)) {
|
|
553
|
+
return fault(path, `expected a node with a string kind, got ${described(node)}`);
|
|
554
|
+
}
|
|
555
|
+
const kind = node.kind;
|
|
556
|
+
if (typeof kind !== "string") {
|
|
557
|
+
return fault(`${path}.kind`, `expected a string, got ${described(kind)}`);
|
|
558
|
+
}
|
|
559
|
+
if (!KNOWN_KINDS.has(kind)) {
|
|
560
|
+
return fault(`${path}.kind`, `${described(kind)} is not a kind this version of @pipelex/sdk knows ` +
|
|
561
|
+
`(${[...KNOWN_KINDS].join(", ")}); a newer API may need a newer SDK`);
|
|
562
|
+
}
|
|
563
|
+
if (kind === "object")
|
|
564
|
+
return fieldsFault(node.fields, `${path}.fields`);
|
|
565
|
+
if (kind === "list")
|
|
566
|
+
return nodeFault(node.item, `${path}.item`);
|
|
567
|
+
return undefined;
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* A value of the server's answer, described for a message: `null`, `nothing` for
|
|
571
|
+
* an absent member, a string quoted and cut at 40 characters, a number or a
|
|
572
|
+
* boolean as written, else what it is.
|
|
573
|
+
*/
|
|
574
|
+
function described(value) {
|
|
575
|
+
if (value === null)
|
|
576
|
+
return "null";
|
|
577
|
+
if (value === undefined)
|
|
578
|
+
return "nothing";
|
|
579
|
+
if (typeof value === "string") {
|
|
580
|
+
return JSON.stringify(value.length > 40 ? `${value.slice(0, 40)}…` : value);
|
|
392
581
|
}
|
|
393
|
-
|
|
582
|
+
if (typeof value === "number" || typeof value === "boolean")
|
|
583
|
+
return String(value);
|
|
584
|
+
if (Array.isArray(value))
|
|
585
|
+
return "a list";
|
|
586
|
+
if (isPlainObject(value))
|
|
587
|
+
return "an object";
|
|
588
|
+
return typeof value;
|
|
394
589
|
}
|
|
395
590
|
/**
|
|
396
591
|
* Prepare a pipe's inputs: upload local/byte/data-URL assets at the signature's
|
|
@@ -398,18 +593,24 @@ function selectedDescriptor(report) {
|
|
|
398
593
|
* records. HTTP(S) URLs and existing `pipelex-storage://` URIs pass through
|
|
399
594
|
* unchanged. All failures are raised before any run is created.
|
|
400
595
|
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
* where inside it the value
|
|
596
|
+
* A value at a file input that cannot be a file — a value of a type no file input
|
|
597
|
+
* takes, or a `data:` URL that does not decode — throws
|
|
598
|
+
* {@link InvalidInputValueError}, naming the input and where inside it the value
|
|
599
|
+
* sits. With `allowUploads: false`, nothing is read from disk or uploaded: a value
|
|
600
|
+
* that would need either throws {@link UploadNotAllowedError}, naming them too.
|
|
404
601
|
*
|
|
405
602
|
* The pipe and its signature come from one `POST /v1/pipe-io`, whatever the
|
|
406
603
|
* selector — inline `files`, a `method_ref` the runner resolves, or a
|
|
407
604
|
* `method_id` the platform resolves. A bare or alias-qualified `pipe_ref`, a
|
|
408
605
|
* closure that does not load, and a selection the route refuses (an unknown
|
|
409
|
-
* `pipe_ref`, no entry pipe, several) throw {@link InputPreparationError}
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
*
|
|
606
|
+
* `pipe_ref`, no entry pipe, several) throw {@link InputPreparationError}. So
|
|
607
|
+
* does an answer that breaks the route's contract, with a `runtime` verdict that
|
|
608
|
+
* is not retryable: no boolean `is_valid`, an `input_form` that does not describe
|
|
609
|
+
* the selected pipe, or a descriptor that is malformed or names a kind this SDK
|
|
610
|
+
* does not know, which is checked whole before anything is uploaded. Any other
|
|
611
|
+
* failure from the route (a malformed selector, an unknown or foreign-org id, no
|
|
612
|
+
* package at the address, auth, a server fault, a deployment that does not serve
|
|
613
|
+
* the route) surfaces as `ApiResponseError`, unchanged.
|
|
413
614
|
*/
|
|
414
615
|
export async function prepareInputs(client, request) {
|
|
415
616
|
const selector = resolveSelector(request);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare-inputs.js","sourceRoot":"","sources":["../src/prepare-inputs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAQH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,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AC"}
|
package/dist/product-models.d.ts
CHANGED
|
@@ -157,6 +157,11 @@ export interface MethodDeletionAccepted {
|
|
|
157
157
|
* (immutable — over a mutable sort key a cursor duplicates and skips rows), and
|
|
158
158
|
* displaying a different timestamp from the one it sorts by makes "newest
|
|
159
159
|
* first" unreadable.
|
|
160
|
+
*
|
|
161
|
+
* The row carries the method's publish state, so a list tells its methods apart without
|
|
162
|
+
* reading each one: never published (`latest_version` is `null`), published with the draft
|
|
163
|
+
* unchanged (`draft_digest === latest_published.source_digest`), or published with the draft
|
|
164
|
+
* ahead (they differ). The three fields are absent from a platform that does not serve them.
|
|
160
165
|
*/
|
|
161
166
|
export interface MethodSummary {
|
|
162
167
|
method_id: string;
|
|
@@ -169,6 +174,17 @@ export interface MethodSummary {
|
|
|
169
174
|
* it with a 409.
|
|
170
175
|
*/
|
|
171
176
|
deletion_state?: MethodDeletionState | null;
|
|
177
|
+
/** The number of the latest published version; `null` when the method was never published. */
|
|
178
|
+
latest_version?: number | null;
|
|
179
|
+
/** The latest published version's summary; `null` when the method was never published. */
|
|
180
|
+
latest_published?: MethodVersionSummary | null;
|
|
181
|
+
/**
|
|
182
|
+
* The digest the last draft write stored, in the form of `MethodData.draft_digest`. Unlike on
|
|
183
|
+
* `MethodData` it can be `null` here: the list reads an index that holds no bundle to digest,
|
|
184
|
+
* so a row that never stored a digest carries `null` until its next draft write stores one.
|
|
185
|
+
* Compare it with `latest_published.source_digest` only when both are strings.
|
|
186
|
+
*/
|
|
187
|
+
draft_digest?: string | null;
|
|
172
188
|
}
|
|
173
189
|
export interface ListMethodsQuery {
|
|
174
190
|
/**
|
|
@@ -177,6 +193,12 @@ export interface ListMethodsQuery {
|
|
|
177
193
|
* client-side would be searching 50 of 10,000 and calling it a search.
|
|
178
194
|
*/
|
|
179
195
|
q?: string;
|
|
196
|
+
/**
|
|
197
|
+
* `true` lists only the methods with a published version, `false` only those never
|
|
198
|
+
* published; omitted, both. It combines with `q`, and like `q` it filters after the index
|
|
199
|
+
* read, so a page can come back empty and still carry a `nextCursor`.
|
|
200
|
+
*/
|
|
201
|
+
published?: boolean;
|
|
180
202
|
/** Page size. The API defaults to 50 and caps at 200. */
|
|
181
203
|
limit?: number;
|
|
182
204
|
/** Opaque `nextCursor` from the previous page. */
|
|
@@ -189,6 +211,11 @@ export interface ListMethodsQuery {
|
|
|
189
211
|
* `null` means this was the last page. There is deliberately no total:
|
|
190
212
|
* counting would mean reading the whole catalog, which is the cost paging
|
|
191
213
|
* exists to avoid.
|
|
214
|
+
*
|
|
215
|
+
* Under `q` or `published` a page can hold fewer rows than `limit`, or none, and still carry
|
|
216
|
+
* a `nextCursor`: the filters run after the index read, so an empty page is not the end of
|
|
217
|
+
* the list, and only a `null` cursor is. `iterateMethods` keeps following the cursor through
|
|
218
|
+
* such a page.
|
|
192
219
|
*/
|
|
193
220
|
export interface MethodPage {
|
|
194
221
|
items: MethodSummary[];
|
|
@@ -568,6 +595,20 @@ export interface ListRunsQuery {
|
|
|
568
595
|
createdFrom?: string;
|
|
569
596
|
/** Only runs created at or before this instant. Same rules as `createdFrom`. */
|
|
570
597
|
createdTo?: string;
|
|
598
|
+
/**
|
|
599
|
+
* `"me"` lists only the runs the caller started, resolved by the platform from the
|
|
600
|
+
* authenticated identity; omitted, every member's runs. It takes no other value: the list
|
|
601
|
+
* never narrows to another member. Sent as `created_by=me`.
|
|
602
|
+
*/
|
|
603
|
+
createdBy?: "me";
|
|
604
|
+
/**
|
|
605
|
+
* Only runs in one of these statuses, sent as one repeated `status=` parameter per status;
|
|
606
|
+
* omitted, every status. The caller's own latest unfinished run is
|
|
607
|
+
* `{ createdBy: "me", status: ["PENDING", "STARTED", "RUNNING"], limit: 1 }`. An empty list
|
|
608
|
+
* names no status and is a `RequestArgumentError` before any request, as is a name that is no
|
|
609
|
+
* `RunStatus`.
|
|
610
|
+
*/
|
|
611
|
+
status?: readonly RunStatus[];
|
|
571
612
|
/** Page size. The API defaults to 50 and caps at 200. */
|
|
572
613
|
limit?: number;
|
|
573
614
|
/** Opaque `nextCursor` from the previous page. */
|
|
@@ -580,6 +621,11 @@ export interface ListRunsQuery {
|
|
|
580
621
|
* `null` means this was the last page. There is deliberately no total: counting
|
|
581
622
|
* would mean reading the whole history, which is the cost paging exists to
|
|
582
623
|
* avoid.
|
|
624
|
+
*
|
|
625
|
+
* Under `createdBy` or `status` a page can hold fewer rows than `limit`, or none, and still
|
|
626
|
+
* carry a `nextCursor`: the platform applies them after the index read, so an empty page is
|
|
627
|
+
* not the end of the history, and only a `null` cursor is. `iterateRuns` keeps following the
|
|
628
|
+
* cursor through such a page.
|
|
583
629
|
*/
|
|
584
630
|
export interface RunPage {
|
|
585
631
|
items: RunHistoryItem[];
|
package/dist/runs.d.ts
CHANGED
|
@@ -26,6 +26,17 @@ import type { DictPipeOutput, DictWorkingMemory, PipelexRunResultStart } from ".
|
|
|
26
26
|
* server-side but kept here for historical rows.
|
|
27
27
|
*/
|
|
28
28
|
export type RunStatus = "PENDING" | "STARTED" | "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "TERMINATED" | "TIMED_OUT";
|
|
29
|
+
/** Every `RunStatus`, in the platform's declaration order. */
|
|
30
|
+
export declare const RUN_STATUSES: readonly RunStatus[];
|
|
31
|
+
/**
|
|
32
|
+
* The statuses a run-history filter sends, deduplicated into `RUN_STATUSES` order so the same
|
|
33
|
+
* filter always builds the same query, as the Python twin builds it. `undefined` is no filter,
|
|
34
|
+
* which lists every status. An empty list names no status, and a name that is no `RunStatus`
|
|
35
|
+
* names one the platform refuses with a `422`; each is a `RequestArgumentError`, `input` and not
|
|
36
|
+
* retryable, before any request, rather than a query that lists every status or fails late. A
|
|
37
|
+
* value that is not an array at all is a `TypeError`, a bug in the calling code.
|
|
38
|
+
*/
|
|
39
|
+
export declare function runStatusFilter(status: readonly RunStatus[] | undefined): readonly RunStatus[] | undefined;
|
|
29
40
|
/** A terminal status means the run is done and will not transition again. */
|
|
30
41
|
export declare function isTerminalRunStatus(status: RunStatus): boolean;
|
|
31
42
|
/** Only `COMPLETED` has a result; every other terminal status is a failure. */
|
package/dist/runs.js
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
import { RequestArgumentError, RunFailedError, RunTimeoutError } from "./errors.js";
|
|
2
2
|
import { MAX_TIMER_DELAY_MS } from "./timers.js";
|
|
3
3
|
import { dropUnfit, isPlainObject } from "./error-models.js";
|
|
4
|
+
/** Every `RunStatus`, in the platform's declaration order. */
|
|
5
|
+
export const RUN_STATUSES = [
|
|
6
|
+
"PENDING",
|
|
7
|
+
"STARTED",
|
|
8
|
+
"RUNNING",
|
|
9
|
+
"COMPLETED",
|
|
10
|
+
"FAILED",
|
|
11
|
+
"CANCELLED",
|
|
12
|
+
"TERMINATED",
|
|
13
|
+
"TIMED_OUT",
|
|
14
|
+
];
|
|
15
|
+
/**
|
|
16
|
+
* The statuses a run-history filter sends, deduplicated into `RUN_STATUSES` order so the same
|
|
17
|
+
* filter always builds the same query, as the Python twin builds it. `undefined` is no filter,
|
|
18
|
+
* which lists every status. An empty list names no status, and a name that is no `RunStatus`
|
|
19
|
+
* names one the platform refuses with a `422`; each is a `RequestArgumentError`, `input` and not
|
|
20
|
+
* retryable, before any request, rather than a query that lists every status or fails late. A
|
|
21
|
+
* value that is not an array at all is a `TypeError`, a bug in the calling code.
|
|
22
|
+
*/
|
|
23
|
+
export function runStatusFilter(status) {
|
|
24
|
+
if (status === undefined)
|
|
25
|
+
return undefined;
|
|
26
|
+
if (!Array.isArray(status)) {
|
|
27
|
+
throw new TypeError(`"status" must be an array naming one or more of ${RUN_STATUSES.join(", ")}.`);
|
|
28
|
+
}
|
|
29
|
+
if (status.length === 0) {
|
|
30
|
+
throw new RequestArgumentError(`"status" must name one or more of ${RUN_STATUSES.join(", ")}; omit it to list every status.`);
|
|
31
|
+
}
|
|
32
|
+
const known = RUN_STATUSES;
|
|
33
|
+
const unknown = status.filter((name) => !known.includes(name));
|
|
34
|
+
if (unknown.length > 0) {
|
|
35
|
+
throw new RequestArgumentError(`Unknown run status(es) ${unknown.join(", ")}; valid statuses are: ${RUN_STATUSES.join(", ")}.`);
|
|
36
|
+
}
|
|
37
|
+
return RUN_STATUSES.filter((name) => status.includes(name));
|
|
38
|
+
}
|
|
4
39
|
const TERMINAL_RUN_STATUSES = new Set([
|
|
5
40
|
"COMPLETED",
|
|
6
41
|
"FAILED",
|