@pipelex/sdk 0.34.1 → 0.35.1

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
@@ -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,6 +65,11 @@ 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
68
73
  ```
69
74
 
70
75
  ### Checking a model reference
@@ -91,7 +96,7 @@ A reference the runner cannot read at all (blank, a sigil alone, too long) or an
91
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):
92
97
 
93
98
  ```ts
94
- import { PipelexApiClient, ApiResponseError } from "@pipelex/sdk";
99
+ import { PipelexApiClient, ApiResponseError, parseMethodSelector } from "@pipelex/sdk";
95
100
 
96
101
  const client = new PipelexApiClient({ apiKey: process.env.PIPELEX_API_KEY });
97
102
 
@@ -102,6 +107,21 @@ for await (const method of client.iterateMethods()) {
102
107
  }
103
108
  const created = await client.createMethod({ name: "Greeter", mthds: "domain = 'demo'" });
104
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
+
105
125
  try {
106
126
  const { portal_url } = await client.getBillingPortal();
107
127
  // open portal_url ...
@@ -130,7 +150,7 @@ try {
130
150
  }
131
151
  ```
132
152
 
133
- A refused request throws an `ApiResponseError` carrying every member of the server's RFC 9457 problem document. **Branch on `errorDomain` and `type`**, as the hosted-envelope spec says, never on the HTTP status or the message: `errorDomain` is the verdict's domain and `type` is the stable URI of the error class, the same on every occurrence. The verdict is the server's when it sent a valid one, and otherwise the SDK's fallback, read from the status, except that an `input` or `config` domain the server sent without `retryable` is not retryable; `problemDocument` keeps what the server sent. `userAction` gives the next step, and `requestId` — from the body, or the `X-Request-ID` header — is the id to hand to support. `code` (the platform's native code, one-to-one with `type`) and `errorType` (the runner's exception class name) stay available as each surface's finer code, and `errors` carries the platform's field-level failures.
153
+ A refused request throws an `ApiResponseError` carrying every member of the server's RFC 9457 problem document. **Branch on `errorDomain` and `type`**, as the hosted-envelope spec says, never on the HTTP status or the message: `errorDomain` is the verdict's domain and `type` is the stable URI of the error class, the same on every occurrence. The verdict is the server's when it sent a valid one, and otherwise the SDK's fallback, read from the status, except that an `input` or `config` domain the server sent without `retryable` is not retryable; `problemDocument` keeps what the server sent. `userAction` gives the next step, and `requestId` — from the body, or the `X-Request-ID` header — is the id to hand to support. `code` (the platform's native code, one-to-one with `type`) and `errorType` (the runner's exception class name) are each surface's finer code, and a client of that surface may branch on it too: on the platform's own refusals `code` and `type` read the same answer, `MethodErrorCode` naming the codes a method caller branches on, while a refusal the platform relays from the runner carries the runner's `type` and `errorType` and no `code`. `errors` carries the platform's field-level failures.
134
154
 
135
155
  On the hosted API, a run that ends without completing throws a `RunFailedError` from `waitForResult`, `startAndWaitForResult` and `downloadArtifacts`, and comes back as the `failed` arm of `getRunResult`. (Against a bare `pipelex-api` runner, `startAndWaitForResult` runs the method with the blocking `execute`, so a failed run there throws the runner's `ApiResponseError`, whose problem members carry the same classification.) Its `status` is the run's terminal status and its `error` is the run's stored error report, checked field by field and typed as `RunErrorReport`: the reason in `message`, `error_domain`, `type_uri` and `retryable` to branch on, `user_action` as the next step, and the inference details. It is `null` when the run ended without a report, and the error's own verdict comes from it: the report's domain, and retryable only when the report says so. The report is the runner's VERBOSE one, provider text included, so what a person sees is your presentation:
136
156
 
@@ -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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AAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,IAAI,qBAAqB,CAAC;IACxE,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,IAAI,iDAAiD,CAAC;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.1";
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.1";
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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