@pipelex/sdk 0.36.0 → 0.38.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 +2 -2
- package/dist/cli/environment.js +1 -0
- package/dist/cli/environment.js.map +1 -1
- package/dist/cli/help.d.ts +1 -1
- package/dist/cli/help.js +3 -1
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/script.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/cli.md +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -216,8 +216,8 @@ These pages ship inside the published package, so a reader who has only installe
|
|
|
216
216
|
## Develop
|
|
217
217
|
|
|
218
218
|
```bash
|
|
219
|
-
make install # Install dependencies
|
|
220
|
-
make check #
|
|
219
|
+
make install # Install the dependencies from the lockfile (npm ci, which never rewrites it)
|
|
220
|
+
make check # Lockfile check + lint + format check + typecheck + build + depcruise (alias: make c)
|
|
221
221
|
make test # Run the test suite (alias: make t)
|
|
222
222
|
make all # Clean, check, and test
|
|
223
223
|
```
|
package/dist/cli/environment.js
CHANGED
|
@@ -51,6 +51,7 @@ export function makeClient(io) {
|
|
|
51
51
|
throw usageError(`${API_KEY_VARIABLE} is not set.`, [
|
|
52
52
|
`Get a key at https://app.pipelex.com and export it: export ${API_KEY_VARIABLE}=<your key>`,
|
|
53
53
|
"This command reads no .env file; to load one into the shell, run: set -a; . ./.env; set +a",
|
|
54
|
+
'A key saved by pipelex login is in ~/.pipelex/.env, or under PIPELEX_HOME when that is set; to load it, run: set -a; . "${PIPELEX_HOME:-$HOME/.pipelex}/.env"; set +a',
|
|
54
55
|
]);
|
|
55
56
|
}
|
|
56
57
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/cli/environment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,oBA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G,gBAAgB,cAAc,EAAE;YAClD,8DAA8D,gBAAgB,aAAa;YAC3F,4FAA4F;YAC5F,uKAAuK;SACxK,CAAC,CAAC;IACL,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,gBAAgB,CAAC;YAC1B,MAAM;YACN,4FAA4F;YAC5F,0EAA0E;YAC1E,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,oBAAoB;YAC1D,OAAO,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE;SACzD,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,oBAAoB,EAAE,CAAC;YAC1C,MAAM,UAAU,CAAC,GAAG,iBAAiB,cAAc,EAAE,CAAC,WAAW,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACrF,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/cli/help.d.ts
CHANGED
|
@@ -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. 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
|
|
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, not even the one pipelex login\nsaves the key in, ~/.pipelex/.env or the .env under PIPELEX_HOME when that is set. To load it\ninto the shell: set -a; . \"${PIPELEX_HOME:-$HOME/.pipelex}/.env\"; set +a\n\nExit codes: 0 done, 1 the run failed or the API refused it, 2 a usage error, 130 interrupted.\n";
|
|
3
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
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
|
@@ -16,7 +16,9 @@ id, mt_..., or, for run only, a .mthds file or a bundle directory. A bare catalo
|
|
|
16
16
|
method's latest published version, mt_...@<version> a fixed version, and mt_...@draft its draft.
|
|
17
17
|
|
|
18
18
|
The API key is read from PIPELEX_API_KEY, and the API's address from PIPELEX_BASE_URL
|
|
19
|
-
(https://api.pipelex.com when unset). No .env file is read
|
|
19
|
+
(https://api.pipelex.com when unset). No .env file is read, not even the one pipelex login
|
|
20
|
+
saves the key in, ~/.pipelex/.env or the .env under PIPELEX_HOME when that is set. To load it
|
|
21
|
+
into the shell: set -a; . "\${PIPELEX_HOME:-$HOME/.pipelex}/.env"; set +a
|
|
20
22
|
|
|
21
23
|
Exit codes: 0 done, 1 the run failed or the API refused it, 2 a usage error, 130 interrupted.
|
|
22
24
|
`;
|
package/dist/cli/help.js.map
CHANGED
|
@@ -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
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAE/D,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsBxB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;CAiBvB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;CAiB1B,CAAC"}
|
package/dist/cli/script.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { CommandIO } from "./io.js";
|
|
|
15
15
|
* update notice and npm 12's run notices off the script's stderr, which carries the command's
|
|
16
16
|
* own lines, while npm's warnings and errors still print.
|
|
17
17
|
*/
|
|
18
|
-
export declare const SCRIPT_RUNNER = "npx --yes --no-update-notifier --loglevel=warn @pipelex/sdk@0.
|
|
18
|
+
export declare const SCRIPT_RUNNER = "npx --yes --no-update-notifier --loglevel=warn @pipelex/sdk@0.38.0";
|
|
19
19
|
export declare const SCRIPT_WRITER = "@pipelex/sdk";
|
|
20
20
|
export declare const SCRIPT_NEEDS = "Node 22.12 or later";
|
|
21
21
|
/** Run `pipelex-sdk script` and return its exit code. */
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/docs/cli.md
CHANGED
|
@@ -52,9 +52,9 @@ exec npx --yes --no-update-notifier --loglevel=warn @pipelex/sdk@X.Y.Z run --met
|
|
|
52
52
|
|
|
53
53
|
## The environment
|
|
54
54
|
|
|
55
|
-
The key comes from `PIPELEX_API_KEY` and nowhere else, since a flag would put it in the shell's history and the process list; its absence is a usage error that says where to get a key, and the command never prints it. The API's address comes from `PIPELEX_BASE_URL`, `https://api.pipelex.com` when unset; a refused base URL is reported without its credentials, path or query. An empty variable counts as unset, except `PIPELEX_BASE_URL`: an empty base URL is refused like any other the SDK cannot use, since it is most often a variable that was meant to name another API, as in `PIPELEX_BASE_URL=$STAGING_URL` with `STAGING_URL` unset, and counting it as unset would send the key to the default address. Every request carries `pipelex-sdk-cli/<version>` before the SDK's own token in its `User-Agent` ([`client-identification.md`](client-identification.md)).
|
|
55
|
+
The key comes from `PIPELEX_API_KEY` and nowhere else, since a flag would put it in the shell's history and the process list; its absence is a usage error that says where to get a key and how to load one `pipelex login` saved, and the command never prints it. The API's address comes from `PIPELEX_BASE_URL`, `https://api.pipelex.com` when unset; a refused base URL is reported without its credentials, path or query. An empty variable counts as unset, except `PIPELEX_BASE_URL`: an empty base URL is refused like any other the SDK cannot use, since it is most often a variable that was meant to name another API, as in `PIPELEX_BASE_URL=$STAGING_URL` with `STAGING_URL` unset, and counting it as unset would send the key to the default address. Every request carries `pipelex-sdk-cli/<version>` before the SDK's own token in its `User-Agent` ([`client-identification.md`](client-identification.md)).
|
|
56
56
|
|
|
57
|
-
**No `.env` file is read.** A command started through `npx` from wherever the person stands would otherwise pick up a credential from whichever file it found there. To load one into the shell: `set -a; . ./.env; set +a`.
|
|
57
|
+
**No `.env` file is read.** A command started through `npx` from wherever the person stands would otherwise pick up a credential from whichever file it found there. To load one into the shell: `set -a; . ./.env; set +a`. That holds for the `.env` where `pipelex login` and `pipelex init` save the key, `~/.pipelex/.env`, or the `.env` of the directory `PIPELEX_HOME` names when that is set: load it the same way, `set -a; . "${PIPELEX_HOME:-$HOME/.pipelex}/.env"; set +a`, which finds the file in either place and exports every variable it holds, or export `PIPELEX_API_KEY` yourself. The help and the missing-key error both say so.
|
|
58
58
|
|
|
59
59
|
**`PIPELEX_SDK_POLL_INTERVAL_MS` is for tests only.** It sets the poll interval in milliseconds, a whole number; the case table sets it to `0` so that a run answered "still running" is polled again at once, and serves its `202` answers with `Retry-After: 0`, since the SDK waits at least as long as the server's `Retry-After` and five seconds when a `202` gives none. Unset, the SDK's own interval applies. The Python command reads the same variable.
|
|
60
60
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipelex/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "TypeScript SDK for the Pipelex hosted API — execute methods, manage runs, and call the product surface.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@types/node": "^22.12.0",
|
|
66
66
|
"@vitest/coverage-v8": "^4.1.9",
|
|
67
67
|
"dependency-cruiser": "^17.4.3",
|
|
68
|
-
"esbuild": "^0.
|
|
68
|
+
"esbuild": "^0.28.2",
|
|
69
69
|
"eslint": "^9.39.4",
|
|
70
70
|
"globals": "^16.5.0",
|
|
71
71
|
"prettier": "^3.8.4",
|