@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 +42 -3
- package/dist/cli/help.d.ts +3 -3
- package/dist/cli/help.js +6 -3
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/method.d.ts +9 -3
- package/dist/cli/method.js +30 -7
- package/dist/cli/method.js.map +1 -1
- package/dist/cli/script.d.ts +6 -2
- package/dist/cli/script.js +13 -6
- package/dist/cli/script.js.map +1 -1
- package/dist/client.d.ts +166 -29
- package/dist/client.js +248 -36
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +26 -5
- package/dist/errors.js +8 -5
- package/dist/errors.js.map +1 -1
- package/dist/execute-result.d.ts +6 -0
- package/dist/execute-result.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/method-selector.d.ts +42 -0
- package/dist/method-selector.js +63 -0
- package/dist/method-selector.js.map +1 -0
- package/dist/models.d.ts +126 -4
- package/dist/models.js +4 -3
- package/dist/models.js.map +1 -1
- package/dist/product-models.d.ts +211 -11
- package/dist/runs.d.ts +13 -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 +7 -3
- package/docs/cli.md +6 -6
- package/docs/crate-routes.md +4 -2
- package/docs/errors.md +17 -4
- package/docs/input-preparation.md +4 -2
- package/docs/run-results.md +1 -1
- package/package.json +1 -1
|
@@ -149,7 +149,9 @@ There is no single-pipe fallback: a method that declares one pipe and no `main_p
|
|
|
149
149
|
client.getMethodClosure(methodId) → MthdsFileItem[]
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
`getMethodClosure` is the public **local expansion utility** — a client-side semantic layer over `getMethod` (the platform has no route that returns a parsed closure). It fetches the method, parses its polymorphic `mthds` source with [`methodSourceToContents`](#methodsourcetocontents--the-canonical-source-parser), and labels each resulting file with the `method_id` as its `source` provenance.
|
|
152
|
+
`getMethodClosure` is the public **local expansion utility** — a client-side semantic layer over `getMethod` (the platform has no route that returns a parsed closure). It fetches the method, parses its **draft's** polymorphic `mthds` source with [`methodSourceToContents`](#methodsourcetocontents--the-canonical-source-parser), and labels each resulting file with the `method_id` as its `source` provenance.
|
|
153
|
+
|
|
154
|
+
**It reads the draft, which is not what a bare id runs.** `GET /v1/methods/{id}` answers the method with its draft, whatever the publish state, while a run or a tooling call by a bare `method_id` resolves to the latest *published* version, which the draft may be ahead of. For the closure of a version, read it with `getMethodVersion(methodId, n)` and parse its `mthds` with `methodSourceToContents`. Like `getMethod`, it takes a bare id: a caller holding `mt_…@3` strips the suffix with `parseMethodSelector` first.
|
|
153
155
|
|
|
154
156
|
Reach for it whenever you want the files **in hand** — to edit, to diff, or to send to a bare runner, which has no catalog to resolve an id against:
|
|
155
157
|
|
|
@@ -157,7 +159,7 @@ Reach for it whenever you want the files **in hand** — to edit, to diff, or to
|
|
|
157
159
|
runner.resolve({ files: await hosted.getMethodClosure("mt_…") })
|
|
158
160
|
```
|
|
159
161
|
|
|
160
|
-
Every method-taking operation — `execute` / `start`, `validate` / `resolve` / `codegen` / `pipeIo`, and `prepareInputs` — takes a `method_id` **natively** on the hosted API, as a server pass-through: the platform resolves it and injects the
|
|
162
|
+
Every method-taking operation — `execute` / `start`, `validate` / `resolve` / `codegen` / `pipeIo`, and `prepareInputs` — takes a `method_id` **natively** on the hosted API, as a server pass-through, its version suffix included (`mt_…`, `mt_…@<n>`, `mt_…@draft`): the platform resolves it and injects the source of the version it names before the runner sees the request (see [architecture.md → hosted run extensions](./architecture.md#hosted-run-extensions-method_id)). That is the uniform rule — *an id option is always a server pass-through, and any client-side expansion is the caller's own explicit call*.
|
|
161
163
|
|
|
162
164
|
- **Requires an API key.** The methods catalog is org-scoped to the key's org, so resolution only works with an authenticated Pipelex-product key.
|
|
163
165
|
- **Unknown or foreign-org id → the `getMethod` `404`** (`ApiResponseError`, `code: "not_found"`), propagated unchanged. An id from another org is indistinguishable from a nonexistent one — both 404.
|
package/docs/run-results.md
CHANGED
|
@@ -70,7 +70,7 @@ const results = await client.startAndWaitForResult(
|
|
|
70
70
|
);
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
It is never called on the blocking path, a bare runner's `POST /v1/execute` or the fallback to it, which has no run id to give before it answers. The acknowledgement is handed over whole, a `method_ref` run's `method_provenance` included. The callback runs synchronously and its return value is ignored; an exception it throws propagates out of `startAndWaitForResult` before anything is polled, and the run it was told about keeps going.
|
|
73
|
+
It is never called on the blocking path, a bare runner's `POST /v1/execute` or the fallback to it, which has no run id to give before it answers. The acknowledgement is handed over whole, a `method_ref` run's `method_provenance` and a `method_id` run's `method_version` (the version the run runs, a number or `"draft"`) included. The callback runs synchronously and its return value is ignored; an exception it throws propagates out of `startAndWaitForResult` before anything is polled, and the run it was told about keeps going.
|
|
74
74
|
|
|
75
75
|
**An abort before the run exists creates none.** The `signal` is read before the run is started as well as during the wait: a caller that aborts while the `GET /v1/version` handshake is in flight gets its abort, and neither `POST /v1/start` nor the blocking `POST /v1/execute` is sent; nor is the execute when the abort lands while a runner that looked hosted refuses the start. Once the start or the execute is sent, the abort stops only the wait, and a started run goes on, by its id.
|
|
76
76
|
|