@pipelex/sdk 0.34.0 → 0.35.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 CHANGED
@@ -6,7 +6,7 @@ TypeScript SDK for the **Pipelex hosted API** — execute MTHDS methods, manage
6
6
 
7
7
  ## Status
8
8
 
9
- Early. `PipelexApiClient` implements the MTHDS protocol-execution routes (`execute` / `start` / `validate` / `models` / `version`), the crate routes (`resolve` / `codegen` / `pipeIo`), the durable run lifecycle (`start` → poll → result), and the Pipelex product routes (user profile, methods catalog, organizations, billing, API keys, onboarding, storage, runs list/update).
9
+ Early. `PipelexApiClient` implements the MTHDS protocol-execution routes (`execute` / `start` / `validate` / `models` / `version`), the crate routes (`resolve` / `codegen` / `pipeIo`), the model reference check (`checkModelReference`), the durable run lifecycle (`start` → poll → result), and the Pipelex product routes (user profile, methods catalog, organizations, billing, API keys, onboarding, storage, runs list/update).
10
10
 
11
11
  Besides the client, the package exports `runCodegenCheck` — a **pure** offline check that verifies a committed `codegen()` tree still matches its `codegen.lock`. It needs no server, no key, and no client instance, so it fits a CI job. See [`docs/crate-routes.md`](./docs/crate-routes.md#the-offline-check--runcodegencheck).
12
12
 
@@ -27,7 +27,7 @@ npx @pipelex/sdk run --method github.com/acme/methods/receipt-review@v1.0.0 --in
27
27
  npx @pipelex/sdk run --method github.com/acme/methods/receipt-review@v1.0.0 --inputs inputs.json
28
28
  ```
29
29
 
30
- `--method` takes a published address, a catalog id (`mt_…`) or a local `.mthds` file or bundle directory. The run's main output is printed on stdout as JSON, and the run id, each uploaded file and every error on stderr. `script` writes a method its own command, a shell script pinned to this SDK's version:
30
+ `--method` takes a published address, a catalog id (`mt_…`, which runs the method's latest published version, `mt_…@<n>` for a fixed version or `mt_…@draft` for its draft) or a local `.mthds` file or bundle directory. The run's main output is printed on stdout as JSON, and the run id, each uploaded file and every error on stderr. `script` writes a method its own command, a shell script pinned to this SDK's version:
31
31
 
32
32
  ```bash
33
33
  npx @pipelex/sdk script --method github.com/acme/methods/receipt-review@v1.0.0
@@ -65,14 +65,38 @@ const ack = await client.start({
65
65
  inputs: { document: { url: "https://example.com/report.pdf" } },
66
66
  });
67
67
  console.log(ack.method_provenance); // { address, tag, commit_sha }
68
+
69
+ // Or run a saved method by its catalog id. A bare id runs its latest published version,
70
+ // `mt_…@3` version 3 and `mt_…@draft` its draft; the ack says which version runs.
71
+ const saved = await client.start({ method_id: "mt_abc123@3", inputs: {} });
72
+ console.log(saved.method_version); // 3
73
+ ```
74
+
75
+ ### Checking a model reference
76
+
77
+ `checkModelReference` asks the runner whether a reference a method's `model` field could name resolves, as what kind and to which model (`GET /v1/models/check`, served by `pipelex-api` from pipelex 0.78.0). A reference that resolves nowhere is a verdict, not an error, and narrowing on `kind` types its `matches`:
78
+
79
+ ```ts
80
+ const verdict = await client.checkModelReference("$writing-factual", "llm");
81
+ if (verdict.resolution === "resolved") {
82
+ for (const match of verdict.matches) {
83
+ // `resolves_to` is null when the name exists but a run through it would reach no model.
84
+ console.log(match.category, match.resolves_to ?? "warning: no model the runner can call");
85
+ }
86
+ if (verdict.kind === "preset") console.log(verdict.matches[0]?.description);
87
+ } else {
88
+ console.log(verdict.other_kinds, verdict.suggestions); // what the caller may have meant
89
+ }
68
90
  ```
69
91
 
92
+ A reference the runner cannot read at all (blank, a sigil alone, too long) or an unknown category throws `ApiResponseError`, a `422` whose `errorType` is `InvalidModelReference` or `InvalidModelCategory`.
93
+
70
94
  ### Product routes
71
95
 
72
96
  The hosted management surface (catalog, account, billing) hangs off the same client. Every route maps a non-2xx `problem+json` to a typed `ApiResponseError` (see [Errors](#errors) for how to branch on it):
73
97
 
74
98
  ```ts
75
- import { PipelexApiClient, ApiResponseError } from "@pipelex/sdk";
99
+ import { PipelexApiClient, ApiResponseError, parseMethodSelector } from "@pipelex/sdk";
76
100
 
77
101
  const client = new PipelexApiClient({ apiKey: process.env.PIPELEX_API_KEY });
78
102
 
@@ -83,6 +107,21 @@ for await (const method of client.iterateMethods()) {
83
107
  }
84
108
  const created = await client.createMethod({ name: "Greeter", mthds: "domain = 'demo'" });
85
109
 
110
+ // A saved method has a draft, written freely and never validated, and immutable published
111
+ // versions. `updated_at` is the draft's token: echo it so no write or publish takes a draft
112
+ // you have not seen.
113
+ const draft = await client.writeDraft(created.method_id, {
114
+ mthds: "domain = 'demo'\n",
115
+ expected_updated_at: created.updated_at,
116
+ });
117
+ const published = await client.publishMethod(created.method_id, {
118
+ expected_draft_updated_at: draft.updated_at,
119
+ });
120
+ if (published.outcome === "refused") console.error(published.message, published.validation);
121
+ else console.log(`version ${published.version.version}`); // "published" or "unchanged"
122
+ const versions = await client.listMethodVersions(created.method_id); // newest first
123
+ const { method_id, version } = parseMethodSelector("mt_abc123@3"); // the method routes take a bare id
124
+
86
125
  try {
87
126
  const { portal_url } = await client.getBillingPortal();
88
127
  // open portal_url ...
@@ -1,4 +1,4 @@
1
1
  /** The command's help texts, printed on stdout by `--help`. */
2
- export declare const MAIN_HELP = "pipelex-sdk: run an MTHDS method on the Pipelex API, with nothing to install.\n\nUsage:\n pipelex-sdk run --method <method> [--pipe <domain.pipe_code>] [--inputs <file> | --inputs-template]\n pipelex-sdk script --method <address | catalog id> [--pipe <domain.pipe_code>] [--name <name>] [--dir <dir>]\n pipelex-sdk --version\n pipelex-sdk <command> --help\n\nCommands:\n run Run a method and print its main output as JSON on stdout.\n script Write a shell script that runs one method with this SDK's version pinned.\n\nA method is a published address, github.com/<owner>/<repo>[/<package>][@<tag>], a catalog\nid, mt_..., or, for run only, a .mthds file or a bundle directory.\n\nThe API key is read from PIPELEX_API_KEY, and the API's address from PIPELEX_BASE_URL\n(https://api.pipelex.com when unset). No .env file is read.\n\nExit codes: 0 done, 1 the run failed or the API refused it, 2 a usage error, 130 interrupted.\n";
3
- export declare const RUN_HELP = "Usage: pipelex-sdk run --method <method> [--pipe <domain.pipe_code>] [--inputs <file> | --inputs-template]\n\nRun a method on the Pipelex API, wait for it however long it takes, and print its main\noutput as indented JSON on stdout. The run id, each uploaded file and every error go to\nstderr. Ctrl-C stops waiting; the run keeps going on the server.\n\nOptions:\n --method <method> A published address (github.com/<owner>/<repo>[/<package>][@<tag>]),\n a catalog id (mt_...), or a path to a .mthds file or a bundle directory.\n --pipe <domain.pipe_code> The pipe to run, by its qualified ref. Default: the method's main pipe.\n --inputs <file> The inputs, a JSON object with one entry per input; - reads stdin.\n A local path or a data: URL at a file input is uploaded first.\n --inputs-template Print the inputs template, the object --inputs takes, and run nothing.\n -h, --help Show this help.\n\nNeeds PIPELEX_API_KEY in the environment.\n";
4
- export declare const SCRIPT_HELP = "Usage: pipelex-sdk script --method <address | catalog id> [--pipe <domain.pipe_code>] [--name <name>] [--dir <dir>]\n\nCheck a method with the API, then write an executable shell script that runs it through\nthis SDK, its version pinned. The script passes its own arguments on to run:\n./<name> --inputs inputs.json, or ./<name> --inputs-template. It never overwrites a file.\n\nOptions:\n --method <method> A published address (github.com/<owner>/<repo>[/<package>][@<tag>])\n or a catalog id (mt_...). A local bundle is refused.\n --pipe <domain.pipe_code> The pipe the script runs. Default: the method's main pipe.\n --name <name> The script's file name. Default: the address's last segment, or the\n catalog method's name in kebab-case.\n --dir <dir> Where to write it. Default: the current directory.\n -h, --help Show this help.\n\nNeeds PIPELEX_API_KEY in the environment. The script needs a POSIX shell.\n";
2
+ export declare const MAIN_HELP = "pipelex-sdk: run an MTHDS method on the Pipelex API, with nothing to install.\n\nUsage:\n pipelex-sdk run --method <method> [--pipe <domain.pipe_code>] [--inputs <file> | --inputs-template]\n pipelex-sdk script --method <address | catalog id> [--pipe <domain.pipe_code>] [--name <name>] [--dir <dir>]\n pipelex-sdk --version\n pipelex-sdk <command> --help\n\nCommands:\n run Run a method and print its main output as JSON on stdout.\n script Write a shell script that runs one method with this SDK's version pinned.\n\nA method is a published address, github.com/<owner>/<repo>[/<package>][@<tag>], a catalog\nid, mt_..., or, for run only, a .mthds file or a bundle directory. A bare catalog id runs the\nmethod's latest published version, mt_...@<version> a fixed version, and mt_...@draft its draft.\n\nThe API key is read from PIPELEX_API_KEY, and the API's address from PIPELEX_BASE_URL\n(https://api.pipelex.com when unset). No .env file is read.\n\nExit codes: 0 done, 1 the run failed or the API refused it, 2 a usage error, 130 interrupted.\n";
3
+ export declare const RUN_HELP = "Usage: pipelex-sdk run --method <method> [--pipe <domain.pipe_code>] [--inputs <file> | --inputs-template]\n\nRun a method on the Pipelex API, wait for it however long it takes, and print its main\noutput as indented JSON on stdout. The run id, each uploaded file and every error go to\nstderr. Ctrl-C stops waiting; the run keeps going on the server.\n\nOptions:\n --method <method> A published address (github.com/<owner>/<repo>[/<package>][@<tag>]),\n a catalog id (mt_..., mt_...@<version> or mt_...@draft), or a path\n to a .mthds file or a bundle directory.\n --pipe <domain.pipe_code> The pipe to run, by its qualified ref. Default: the method's main pipe.\n --inputs <file> The inputs, a JSON object with one entry per input; - reads stdin.\n A local path or a data: URL at a file input is uploaded first.\n --inputs-template Print the inputs template, the object --inputs takes, and run nothing.\n -h, --help Show this help.\n\nNeeds PIPELEX_API_KEY in the environment.\n";
4
+ export declare const SCRIPT_HELP = "Usage: pipelex-sdk script --method <address | catalog id> [--pipe <domain.pipe_code>] [--name <name>] [--dir <dir>]\n\nCheck a method with the API, then write an executable shell script that runs it through\nthis SDK, its version pinned. The script passes its own arguments on to run:\n./<name> --inputs inputs.json, or ./<name> --inputs-template. It never overwrites a file.\n\nOptions:\n --method <method> A published address (github.com/<owner>/<repo>[/<package>][@<tag>])\n or a catalog id (mt_..., mt_...@<version> or mt_...@draft). A local\n bundle is refused.\n --pipe <domain.pipe_code> The pipe the script runs. Default: the method's main pipe.\n --name <name> The script's file name. Default: the address's last segment, or the\n catalog method's name in kebab-case.\n --dir <dir> Where to write it. Default: the current directory.\n -h, --help Show this help.\n\nNeeds PIPELEX_API_KEY in the environment. The script needs a POSIX shell.\n";
package/dist/cli/help.js CHANGED
@@ -12,7 +12,8 @@ Commands:
12
12
  script Write a shell script that runs one method with this SDK's version pinned.
13
13
 
14
14
  A method is a published address, github.com/<owner>/<repo>[/<package>][@<tag>], a catalog
15
- id, mt_..., or, for run only, a .mthds file or a bundle directory.
15
+ id, mt_..., or, for run only, a .mthds file or a bundle directory. A bare catalog id runs the
16
+ method's latest published version, mt_...@<version> a fixed version, and mt_...@draft its draft.
16
17
 
17
18
  The API key is read from PIPELEX_API_KEY, and the API's address from PIPELEX_BASE_URL
18
19
  (https://api.pipelex.com when unset). No .env file is read.
@@ -27,7 +28,8 @@ stderr. Ctrl-C stops waiting; the run keeps going on the server.
27
28
 
28
29
  Options:
29
30
  --method <method> A published address (github.com/<owner>/<repo>[/<package>][@<tag>]),
30
- a catalog id (mt_...), or a path to a .mthds file or a bundle directory.
31
+ a catalog id (mt_..., mt_...@<version> or mt_...@draft), or a path
32
+ to a .mthds file or a bundle directory.
31
33
  --pipe <domain.pipe_code> The pipe to run, by its qualified ref. Default: the method's main pipe.
32
34
  --inputs <file> The inputs, a JSON object with one entry per input; - reads stdin.
33
35
  A local path or a data: URL at a file input is uploaded first.
@@ -44,7 +46,8 @@ this SDK, its version pinned. The script passes its own arguments on to run:
44
46
 
45
47
  Options:
46
48
  --method <method> A published address (github.com/<owner>/<repo>[/<package>][@<tag>])
47
- or a catalog id (mt_...). A local bundle is refused.
49
+ or a catalog id (mt_..., mt_...@<version> or mt_...@draft). A local
50
+ bundle is refused.
48
51
  --pipe <domain.pipe_code> The pipe the script runs. Default: the method's main pipe.
49
52
  --name <name> The script's file name. Default: the address's last segment, or the
50
53
  catalog method's name in kebab-case.
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAE/D,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;CAmBxB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;CAgBvB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;CAgB1B,CAAC"}
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAE/D,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;CAoBxB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;CAiBvB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;CAiB1B,CAAC"}
@@ -23,9 +23,15 @@ export type MethodSelector = {
23
23
  * happens to be named `mt_…` is reached as `./mt_…`, so that what a value names never depends on
24
24
  * what the current directory holds.
25
25
  *
26
- * @throws {CommandError} A usage error for an `mt_…` value holding a character no catalog id
27
- * holds (a letter, a digit, `_` or `-`), such as `mt_review.mthds`, which is a path written
28
- * without its `./`.
26
+ * A catalog id may carry a version suffix, `mt_…@<n>` for a fixed published version or
27
+ * `mt_…@draft` for the draft; it is kept whole, since the API resolves it.
28
+ *
29
+ * @throws {CommandError} A usage error for an `mt_…` value whose id holds a character no catalog
30
+ * id holds (a letter, a digit, `_` or `-`), such as `mt_review.mthds`, which is a path written
31
+ * without its `./`; and for a version suffix the selector grammar refuses, with the grammar's
32
+ * own reason — a suffix that is neither a positive number without a leading zero nor `draft`,
33
+ * or a number too large to address exactly. Both name the `./` form too, since an `mt_…`
34
+ * value such as `mt_review@v2.mthds` may be a path written without it.
29
35
  */
30
36
  export declare function classifyMethod(value: string): MethodSelector;
31
37
  /**
@@ -2,27 +2,50 @@
2
2
  * How the command names a method and a pipe: the forms of `--method`, the qualified form of
3
3
  * `--pipe`, and the names and quoting `script` derives from them.
4
4
  */
5
+ import { parseMethodSelector, RequestArgumentError } from "../index.js";
5
6
  import { usageError } from "./io.js";
6
7
  /** The prefix of a published method's address. */
7
8
  export const ADDRESS_PREFIX = "github.com/";
8
9
  /** The prefix of a stored method's catalog id. */
9
10
  export const CATALOG_ID_PREFIX = "mt_";
10
- /** The characters a catalog id is made of, which the API's run route accepts and no other. */
11
- const CATALOG_ID_SHAPE = /^[A-Za-z0-9_-]+$/;
11
+ /** A catalog id without its version suffix: `mt_` and the characters the API's run route accepts. */
12
+ const CATALOG_ID_SHAPE = /^mt_[A-Za-z0-9_-]+$/;
12
13
  /**
13
14
  * Tell a `--method` value's form by its shape: `mt_…` is a catalog id, `github.com/…` an address,
14
15
  * and anything else a path to a `.mthds` file or a bundle directory. A file or directory that
15
16
  * happens to be named `mt_…` is reached as `./mt_…`, so that what a value names never depends on
16
17
  * what the current directory holds.
17
18
  *
18
- * @throws {CommandError} A usage error for an `mt_…` value holding a character no catalog id
19
- * holds (a letter, a digit, `_` or `-`), such as `mt_review.mthds`, which is a path written
20
- * without its `./`.
19
+ * A catalog id may carry a version suffix, `mt_…@<n>` for a fixed published version or
20
+ * `mt_…@draft` for the draft; it is kept whole, since the API resolves it.
21
+ *
22
+ * @throws {CommandError} A usage error for an `mt_…` value whose id holds a character no catalog
23
+ * id holds (a letter, a digit, `_` or `-`), such as `mt_review.mthds`, which is a path written
24
+ * without its `./`; and for a version suffix the selector grammar refuses, with the grammar's
25
+ * own reason — a suffix that is neither a positive number without a leading zero nor `draft`,
26
+ * or a number too large to address exactly. Both name the `./` form too, since an `mt_…`
27
+ * value such as `mt_review@v2.mthds` may be a path written without it.
21
28
  */
22
29
  export function classifyMethod(value) {
23
30
  if (value.startsWith(CATALOG_ID_PREFIX)) {
24
- if (!CATALOG_ID_SHAPE.test(value)) {
25
- throw usageError(`--method "${value}" is not a catalog id: a catalog id holds only letters, digits, _ and -.`, [`To name a local file or directory whose name starts with mt_, write it as ./${value}.`]);
31
+ const at = value.indexOf("@");
32
+ const bareId = at < 0 ? value : value.slice(0, at);
33
+ const pathHint = `To name a local file or directory whose name starts with mt_, write it as ./${value}.`;
34
+ if (!CATALOG_ID_SHAPE.test(bareId)) {
35
+ throw usageError(`--method "${value}" is not a catalog id: a catalog id holds only letters, digits, _ and -.`, [pathHint]);
36
+ }
37
+ // The id is well formed, so the selector grammar refuses the suffix alone, and its message
38
+ // says which way: a suffix of no known form, or a number too large to address exactly.
39
+ try {
40
+ parseMethodSelector(value);
41
+ }
42
+ catch (error) {
43
+ if (!(error instanceof RequestArgumentError))
44
+ throw error;
45
+ throw usageError(`--method ${error.message}`, [
46
+ `Pass ${bareId} for its latest published version, or ${bareId}@draft for its draft.`,
47
+ pathHint,
48
+ ]);
26
49
  }
27
50
  return { kind: "catalog", methodId: value };
28
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"method.js","sourceRoot":"","sources":["../../src/cli/method.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,kDAAkD;AAClD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;AAC5C,kDAAkD;AAClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAQvC,8FAA8F;AAC9F,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,IAAI,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACxC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAClC,MAAM,UAAU,CACd,aAAa,KAAK,0EAA0E,EAC5F,CAAC,+EAA+E,KAAK,GAAG,CAAC,CAC1F,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC9C,CAAC;IACD,IAAI,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACnF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACvC,CAAC;A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C;IACzF,uFAAuF;IACvF,wCAAwC;IACxC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,IAAI,8EAA8E,CAAC;IAChG,CAAC;IACD,IAAI,mBAAmB,CAAC,IAAI,CAAC;QAAE,OAAO,2BAA2B,CAAC;IAClE,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;AAC/C,CAAC"}
@@ -10,8 +10,12 @@
10
10
  * one, with the permissions of an executable, an interrupt meanwhile waiting until it is whole.
11
11
  */
12
12
  import type { CommandIO } from "./io.js";
13
- /** The package a written script runs, and what its runner needs. */
14
- export declare const SCRIPT_RUNNER = "npx --yes @pipelex/sdk@0.34.0";
13
+ /**
14
+ * The package a written script runs, and what its runner needs. The runner's flags keep npm's
15
+ * update notice and npm 12's run notices off the script's stderr, which carries the command's
16
+ * own lines, while npm's warnings and errors still print.
17
+ */
18
+ export declare const SCRIPT_RUNNER = "npx --yes --no-update-notifier --loglevel=warn @pipelex/sdk@0.35.0";
15
19
  export declare const SCRIPT_WRITER = "@pipelex/sdk";
16
20
  export declare const SCRIPT_NEEDS = "Node 22.12 or later";
17
21
  /** Run `pipelex-sdk script` and return its exit code. */
@@ -11,7 +11,7 @@
11
11
  */
12
12
  import { lstat, open, stat, unlink } from "node:fs/promises";
13
13
  import { resolve } from "node:path";
14
- import { SDK_VERSION } from "../index.js";
14
+ import { parseMethodSelector, SDK_VERSION } from "../index.js";
15
15
  import { parseFlags } from "./args.js";
16
16
  import { systemReason } from "./bundle.js";
17
17
  import { makeClient } from "./environment.js";
@@ -25,8 +25,12 @@ const SCRIPT_FLAGS = {
25
25
  name: { type: "string" },
26
26
  dir: { type: "string" },
27
27
  };
28
- /** The package a written script runs, and what its runner needs. */
29
- export const SCRIPT_RUNNER = `npx --yes @pipelex/sdk@${SDK_VERSION}`;
28
+ /**
29
+ * The package a written script runs, and what its runner needs. The runner's flags keep npm's
30
+ * update notice and npm 12's run notices off the script's stderr, which carries the command's
31
+ * own lines, while npm's warnings and errors still print.
32
+ */
33
+ export const SCRIPT_RUNNER = `npx --yes --no-update-notifier --loglevel=warn @pipelex/sdk@${SDK_VERSION}`;
30
34
  export const SCRIPT_WRITER = "@pipelex/sdk";
31
35
  export const SCRIPT_NEEDS = "Node 22.12 or later";
32
36
  /** Run `pipelex-sdk script` and return its exit code. */
@@ -174,11 +178,14 @@ function defaultName(candidate, method) {
174
178
  return candidate;
175
179
  }
176
180
  /**
177
- * A catalog method's name, kebab-cased, read from its catalog entry. An entry whose name is
178
- * missing or not a string gives an empty one, which asks for `--name` as an unusable name does.
181
+ * A catalog method's name, kebab-cased, read from its catalog entry. The name belongs to the
182
+ * method, not to a version, and the method route takes the bare id, so a version suffix is
183
+ * stripped for the read and kept in the script. An entry whose name is missing or not a
184
+ * string gives an empty one, which asks for `--name` as an unusable name does.
179
185
  */
180
186
  async function catalogName(client, methodId, io) {
181
- const entry = await untilInterrupted(() => client.getMethod(methodId), io.interrupt);
187
+ const bareId = parseMethodSelector(methodId).method_id;
188
+ const entry = await untilInterrupted(() => client.getMethod(bareId), io.interrupt);
182
189
  const name = entry.name;
183
190
  return typeof name === "string" ? kebabCase(name) : "";
184
191
  }
@@ -1 +1 @@
1
- {"version":3,"file":"script.js","sourceRoot":"","sources":["../../src/cli/script.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAA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IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;IACT,CAAC;IACD,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,YAAY,CAAC,MAAc;IAClC,OAAO,UAAU,CAAC,IAAI,MAAM,uDAAuD,EAAE;QACnF,gFAAgF;KACjF,CAAC,CAAC;AACL,CAAC"}
package/dist/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { MTHDSProtocol, ModelCategory, ModelDeck, RunOptions, StartOptions, VersionInfo } from "mthds/protocol";
2
- import type { CodegenRequest, CodegenResponse, DictPipeOutput, FormatResponse, LintResponse, MthdsFileItem, PipeIORequest, PipeIOResponse, PipelexRunResultStart, PipelexValidationResult, ResolveRequest, ResolveResponse, ValidateMethodSelector } from "./models.js";
2
+ import type { CodegenRequest, CodegenResponse, DictPipeOutput, FormatResponse, LintResponse, ModelCheckCategory, ModelReferenceVerdict, MthdsFileItem, PipeIORequest, PipeIOResponse, PipelexRunResultStart, PipelexValidationResult, ResolveRequest, ResolveResponse, ValidateMethodSelector } from "./models.js";
3
3
  import { type GetRunResultOptions, type RunRead, type RunResults, type RunResultState, type StartAndWaitForResultOptions, type WaitForResultOptions } from "./runs.js";
4
- import type { BillingPortalResponse, ChangePlanResponse, CheckoutResponse, InvoiceView, Membership, MembershipsResponse, ListMethodsQuery, MethodData, MethodDeletionAccepted, MethodPage, MethodSummary, MethodWriteInput, OnboardingSubmission, PipelexApiKeyCreated, PipelexApiKeyList, ListRunsQuery, RunHistoryItem, RunDetail, RunPage, PlanView, ResolvedStorageUrl, SubscriptionResponse, UpdateRunInput, UploadGrant, UploadGrantInput, UploadInput, UploadedFile, UserProfile } from "./product-models.js";
4
+ import type { BillingPortalResponse, ChangePlanResponse, CheckoutResponse, InvoiceView, Membership, MembershipsResponse, ListMethodsQuery, ListMethodVersionsQuery, MethodData, MethodDeletionAccepted, MethodDraftInput, MethodPage, MethodPublishInput, MethodPublishResult, MethodRenameInput, MethodSummary, MethodVersion, MethodVersionPage, MethodWriteInput, OnboardingSubmission, PipelexApiKeyCreated, PipelexApiKeyList, ListRunsQuery, RunHistoryItem, RunDetail, RunPage, PlanView, ResolvedStorageUrl, SubscriptionResponse, UpdateRunInput, UploadGrant, UploadGrantInput, UploadInput, UploadedFile, UserProfile } from "./product-models.js";
5
5
  import type { AppInfo } from "./user-agent.js";
6
6
  import type { UploadableAsset, UploadFileOptions, UploadRecord } from "./upload.js";
7
7
  import type { PrepareInputsRequest, PreparedInputs } from "./prepare-inputs.js";
@@ -175,20 +175,25 @@ export declare class PipelexApiClient implements MTHDSProtocol<DictPipeOutput> {
175
175
  private requestProductObject;
176
176
  /**
177
177
  * A methods-catalog route answering one stored method (`getMethod`, `createMethod`,
178
- * `updateMethod`), parsed into the public shape. A stored `mthds` that is neither a string nor
179
- * absent (`null` stays "no source", which `getMethodClosure` reports), and a stored `python`
180
- * the SDK cannot parse, are an answer it cannot read, so each throws an `ApiResponseError` built
181
- * from that answer, the latter with `mthds`'s refusal as `cause`: `runtime`, not retryable,
182
- * since no change to the call fixes it.
178
+ * `writeDraft`, `renameMethod`), parsed into the public shape by `readStoredSources`.
183
179
  */
184
180
  private requestMethodData;
185
181
  /**
186
- * One page of a cursor-paged product route (`listMethods`, `listRuns`), read as the platform
187
- * always serializes it: `items` an array, `next_cursor` a string or `null`. A page breaking
188
- * either is an answer the SDK cannot read, so it throws the `ApiResponseError` `unreadableAnswer`
189
- * builds, `runtime` and not retryable, rather than handing the iterators a page they cannot
190
- * walk: `items` that is not iterable, or a missing cursor that is neither the end nor a next
191
- * page, which `iterateRuns` would follow forever.
182
+ * The stored sources of a method or of a published version, read from the answer `res`
183
+ * carried, into the public shape. A stored `mthds` that is neither a string nor absent (`null`
184
+ * stays "no source", which `getMethodClosure` reports), and a stored `python` the SDK cannot
185
+ * parse, are an answer it cannot read, so each throws an `ApiResponseError` built from that
186
+ * answer, the latter with `mthds`'s refusal as `cause`: `runtime`, not retryable, since no
187
+ * change to the call fixes it. `subject` names what carried them in the message.
188
+ */
189
+ private readStoredSources;
190
+ /**
191
+ * One page of a cursor-paged product route (`listMethods`, `listMethodVersions`, `listRuns`),
192
+ * read as the platform always serializes it: `items` an array, `next_cursor` a string or
193
+ * `null`. A page breaking either is an answer the SDK cannot read, so it throws the
194
+ * `ApiResponseError` `unreadableAnswer` builds, `runtime` and not retryable, rather than
195
+ * handing the iterators a page they cannot walk: `items` that is not iterable, or a missing
196
+ * cursor that is neither the end nor a next page, which `iterateRuns` would follow forever.
192
197
  */
193
198
  private requestPage;
194
199
  /** Issue a product request and return its 2xx answer, a non-2xx thrown as `ApiResponseError`. */
@@ -421,6 +426,26 @@ export declare class PipelexApiClient implements MTHDSProtocol<DictPipeOutput> {
421
426
  private requestExtension;
422
427
  /** The model deck the runner can route to — `GET /v1/models[?type=]`. */
423
428
  models(category?: ModelCategory): Promise<ModelDeck>;
429
+ /**
430
+ * Check one model reference — `GET /v1/models/check?reference=<ref>[&type=<category>]`, a
431
+ * Pipelex API extension served by any `pipelex-api` runner from pipelex 0.78.0 and on the
432
+ * hosted API.
433
+ *
434
+ * Answers whether `reference` resolves on the runner, as what kind and to which model, from
435
+ * the parser and the deck lookups a validation runs. `reference` is written as a method's
436
+ * `model` field writes it — `$preset`, `@alias`, `~waterfall`, a bare handle, or a
437
+ * spelled-out namespace (`handle:gpt-4o`) — and is sent percent-encoded. `category` checks
438
+ * in that category alone; without it, the check covers every one.
439
+ *
440
+ * Returns a **200 verdict** whatever the resolution: a reference that resolves nowhere is
441
+ * `resolution: "not_found"` with the names it may have meant, never a thrown error. Narrow
442
+ * on `kind` to read the shape of `matches`. A request that cannot produce a verdict throws
443
+ * the typed `ApiResponseError`, a `422` whose `errorType` says why: `InvalidModelReference`
444
+ * (a blank reference, a sigil or a namespace alone, or one past the runner's length limit),
445
+ * `InvalidModelCategory` (an unknown `type`) or `ValidationError`. None of that is checked
446
+ * here, so the runner's rule is the only one.
447
+ */
448
+ checkModelReference(reference: string, category?: ModelCheckCategory): Promise<ModelReferenceVerdict>;
424
449
  /**
425
450
  * Protocol + implementation versions — `GET /v1/version` (always public).
426
451
  * The handshake for feature detection (hosted extensions or not).
@@ -613,14 +638,29 @@ export declare class PipelexApiClient implements MTHDSProtocol<DictPipeOutput> {
613
638
  * explicit choice.
614
639
  */
615
640
  iterateMethods(query?: Omit<ListMethodsQuery, "cursor">): AsyncGenerator<MethodSummary, void, undefined>;
616
- /** Fetch one method by id — `GET /v1/methods/{id}`. */
641
+ /**
642
+ * Read one method — `GET /v1/methods/{id}`: its identity, its draft (`mthds`, `python`,
643
+ * `input_data`) with the draft's token (`updated_at`) and digest (`draft_digest`), and its
644
+ * latest published version's summary (`latest_version`, `latest_published`), whatever the
645
+ * publish state. A method never published reads with both `null`, never as an error.
646
+ *
647
+ * Takes a bare catalog id: the method routes address the method itself, never a version of
648
+ * it. A caller holding `mt_…@3` strips the suffix with `parseMethodSelector` and reads that
649
+ * version with `getMethodVersion`. Every method route throws `RequestArgumentError` for a
650
+ * suffixed id, before any request, rather than read back the `404` the platform would answer.
651
+ */
617
652
  getMethod(methodId: string): Promise<MethodData>;
618
653
  /**
619
- * Resolve a stored method's id into its runnable MTHDS closure — a client-side
620
- * semantic layer over `getMethod` (the platform has no route that returns a
621
- * parsed closure). Fetches the method, parses its polymorphic `mthds` source
622
- * with `methodSourceToContents`, and labels each resulting file with the
623
- * `method_id` as its `source` provenance.
654
+ * Resolve a stored method's id into the runnable MTHDS closure of its DRAFT — a
655
+ * client-side semantic layer over `getMethod` (the platform has no route that
656
+ * returns a parsed closure). Fetches the method, parses its draft's polymorphic
657
+ * `mthds` source with `methodSourceToContents`, and labels each resulting file
658
+ * with the `method_id` as its `source` provenance.
659
+ *
660
+ * **This is the draft, not what a bare id runs.** A run, a validation or a pipe I/O
661
+ * read by a bare `method_id` resolves to the latest PUBLISHED version, which the
662
+ * draft may be ahead of. For the closure of a version, read it with
663
+ * `getMethodVersion` and parse its `mthds` with `methodSourceToContents`.
624
664
  *
625
665
  * This is the LOCAL expansion utility — for callers that want the files in
626
666
  * hand (to edit, to diff, or to send to a bare runner, which has no catalog to
@@ -629,17 +669,104 @@ export declare class PipelexApiClient implements MTHDSProtocol<DictPipeOutput> {
629
669
  * `prepareInputs`, which composes a `pipeIo` of its own) take the id as a
630
670
  * pass-through instead; nothing in this client expands an id behind your back.
631
671
  *
632
- * Requires an API key: the methods catalog is org-scoped to the key's org, so
633
- * an unknown OR foreign-org id is a `getMethod` `404` (`ApiResponseError`
634
- * `not_found`), which propagates unchanged. A real, in-org method whose source
635
- * parses to nothing throws `EmptyMethodSourceError` (distinct from the 404) —
636
- * the row exists but has no runnable source yet.
672
+ * Takes a bare catalog id, as `getMethod` does. Requires an API key: the methods
673
+ * catalog is org-scoped to the key's org, so an unknown OR foreign-org id is a
674
+ * `getMethod` `404` (`ApiResponseError` `not_found`), which propagates unchanged. A
675
+ * real, in-org method whose draft parses to nothing throws `EmptyMethodSourceError`
676
+ * (distinct from the 404) — the row exists but has no runnable source yet.
637
677
  */
638
678
  getMethodClosure(methodId: string): Promise<MthdsFileItem[]>;
639
- /** Create a method — `POST /v1/methods`. */
679
+ /**
680
+ * Create a method — `POST /v1/methods`. The new method holds the input as its draft and has
681
+ * no published version, so its bare id answers `409 method_not_published` on the run and
682
+ * tooling routes until its first `publishMethod`; its draft runs as `mt_…@draft` at once.
683
+ */
640
684
  createMethod(input: MethodWriteInput): Promise<MethodData>;
641
- /** Replace a method (rename = changed `name`) — `PUT /v1/methods/{id}`. */
642
- updateMethod(methodId: string, input: MethodWriteInput): Promise<MethodData>;
685
+ /**
686
+ * Replace a method's draft — `PUT /v1/methods/{id}/draft` — and return the method with the
687
+ * draft's new token (`updated_at`) and digest (`draft_digest`).
688
+ *
689
+ * The draft is never validated on write, and writing it changes nothing for the callers of
690
+ * the method's bare id, who run the latest published version until the next `publishMethod`.
691
+ * `python` and `input_data` are three-way (see `MethodDraftInput`). With
692
+ * `expected_updated_at`, the write is a compare-and-swap on the draft token: a draft that
693
+ * moved since is refused with a `409` whose `code` is `method_update_conflict`, and nothing is
694
+ * written. Without it, last writer wins.
695
+ *
696
+ * Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404` `not_found`
697
+ * for an unknown or foreign-org method, `409` `method_being_deleted` while its erasure runs,
698
+ * `413` `payload_too_large` for a draft over the store's item limit, `403` for a read-only
699
+ * key.
700
+ */
701
+ writeDraft(methodId: string, input: MethodDraftInput): Promise<MethodData>;
702
+ /**
703
+ * Rename a method — `PATCH /v1/methods/{id}` — and return it. The name belongs to the method,
704
+ * not to a version: a rename changes nothing else, moves no token, and never commits the
705
+ * draft, so the `updated_at` a caller holds stays valid for its next `writeDraft` or
706
+ * `publishMethod`.
707
+ *
708
+ * Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404` `not_found`,
709
+ * `409` `method_being_deleted`, `403` for a read-only key, `422` for an empty name, and `413`
710
+ * `payload_too_large` for a name so long it would leave the method too large to publish.
711
+ */
712
+ renameMethod(methodId: string, input: MethodRenameInput): Promise<MethodData>;
713
+ /**
714
+ * Publish a method's draft as its next version — `POST /v1/methods/{id}/publish`.
715
+ *
716
+ * `expected_draft_updated_at` is the draft token the caller last saw, and it is required: a
717
+ * publish never takes a draft its caller has not seen. The platform checks the token, answers
718
+ * `unchanged` without asking the runner when the draft's digest equals the latest version's,
719
+ * and otherwise validates the draft and, when it validates and runs, writes version N+1.
720
+ *
721
+ * The answer is a `MethodPublishResult` discriminated on `outcome` — branch on it:
722
+ * `published` with the new `version`; `unchanged` with the existing latest `version`;
723
+ * `refused` with a `reason` (`invalid`, or `not_runnable` for a draft that validates with
724
+ * pending signatures), a `message` and the runner's `validation` verdict. Every arm carries the
725
+ * `method`. A publish moves no token.
726
+ *
727
+ * Takes a bare catalog id, as `getMethod` does. Throws `RequestArgumentError` when
728
+ * `expected_draft_updated_at` is not a string, before any request. Throws `ApiResponseError`
729
+ * when no verdict was produced: `409` `method_update_conflict` for a draft that moved since
730
+ * the token, `409` `method_being_deleted`, `404` `not_found`, `422` for a draft with no
731
+ * `.mthds` file or whose file names a run could not assemble (one name used by a `.mthds` and
732
+ * a Python file), `413` `payload_too_large` for a draft too large to publish, and `403` for a
733
+ * read-only key.
734
+ *
735
+ * Only a draft that differs from the latest version reaches the runner, and a runner that
736
+ * cannot be reached, answers unusably or does not finish within the platform's deadline is a
737
+ * `502` or a `503` with nothing written, so a retry is safe; a runner that refuses the request
738
+ * itself is relayed under its own status. A retry of a publish that landed while its answer was
739
+ * lost, as on a client timeout, answers `unchanged` with the version it wrote.
740
+ *
741
+ * An answer whose `outcome` is not one of the outcomes above, or that carries no `method`
742
+ * object, is an answer the SDK cannot read, thrown as an `ApiResponseError` too.
743
+ */
744
+ publishMethod(methodId: string, input: MethodPublishInput): Promise<MethodPublishResult>;
745
+ /**
746
+ * One page of a method's published versions, newest first, without their sources —
747
+ * `GET /v1/methods/{id}/versions`.
748
+ *
749
+ * Pass the page's `nextCursor` back as `cursor` to continue; `null` is the last page. A page
750
+ * may be short while `nextCursor` is set, because the platform reads versions whole. A method
751
+ * never published answers an empty page.
752
+ *
753
+ * Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404` `not_found`
754
+ * for an unknown method, `409` `method_being_deleted`, `400` for a cursor from another method.
755
+ * A page whose `items` is not an array or whose `next_cursor` is neither a string nor `null`
756
+ * is an answer the SDK cannot read, thrown as an `ApiResponseError` too.
757
+ */
758
+ listMethodVersions(methodId: string, query?: ListMethodVersionsQuery): Promise<MethodVersionPage>;
759
+ /**
760
+ * One published version of a method, with its sources —
761
+ * `GET /v1/methods/{id}/versions/{n}`. Its `python` is parsed into `MethodFile[]` as a
762
+ * method's is.
763
+ *
764
+ * Takes a bare catalog id, as `getMethod` does, and the version number. Throws
765
+ * `RequestArgumentError` for a `version` that is not a positive integer, before any request.
766
+ * Throws `ApiResponseError`: `404` `method_version_not_found` for a version the method never
767
+ * published, `404` `not_found` for an unknown method, `409` `method_being_deleted`.
768
+ */
769
+ getMethodVersion(methodId: string, version: number): Promise<MethodVersion>;
643
770
  /**
644
771
  * Erase a method and everything it produced — `DELETE /v1/methods/{id}`.
645
772
  *
@@ -653,8 +780,10 @@ export declare class PipelexApiClient implements MTHDSProtocol<DictPipeOutput> {
653
780
  * it with a `409`.
654
781
  *
655
782
  * A double-clicked delete is safe: the claim is a conditional write, so the
656
- * second call is an `ApiResponseError` (`409 conflict`) rather than a second
657
- * cascade over the same runs. An unknown or foreign-org id is a `404`.
783
+ * second call is an `ApiResponseError` (`409 method_being_deleted`) rather than a
784
+ * second cascade over the same runs. An unknown or foreign-org id is a `404`. The
785
+ * erasure deletes the method's published versions with the rest. Takes a bare catalog id,
786
+ * as `getMethod` does: the whole method is erased, never one of its versions.
658
787
  */
659
788
  deleteMethod(methodId: string): Promise<MethodDeletionAccepted>;
660
789
  /** The caller's org memberships + active-org feature flags — `GET /v1/organizations/memberships`. */
@@ -829,6 +958,12 @@ export declare class PipelexApiClient implements MTHDSProtocol<DictPipeOutput> {
829
958
  * `createdFrom` / `createdTo` are applied server-side as index key
830
959
  * conditions, so a bounded page genuinely reads less. They are INSTANTS,
831
960
  * not days — see `ListRunsQuery`.
961
+ *
962
+ * Takes a bare catalog id: the history files the runs of every version and
963
+ * of the draft together under it, so `mt_…@3` names no history of its own
964
+ * and the platform refuses it with a `400`. Strip a suffix with
965
+ * `parseMethodSelector`, and read which version a run ran from its
966
+ * `method_version`.
832
967
  */
833
968
  listRuns(methodId: string, query?: ListRunsQuery): Promise<RunPage>;
834
969
  /**
@@ -852,6 +987,8 @@ export declare class PipelexApiClient implements MTHDSProtocol<DictPipeOutput> {
852
987
  * cliff: it yields until the server says there is no more, the caller decides
853
988
  * when to stop, and only one page is ever in memory. If you truly want an
854
989
  * array, `Array.fromAsync` makes that your explicit choice.
990
+ *
991
+ * Takes a bare catalog id, as `listRuns` does.
855
992
  */
856
993
  iterateRuns(methodId: string, query?: Omit<ListRunsQuery, "cursor">): AsyncGenerator<RunHistoryItem, void, undefined>;
857
994
  /**