@toloka-platform/sdk 0.1.0-preview.5 → 0.1.0-preview.6

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.
Files changed (40) hide show
  1. package/dist/cli/toloka.js +121 -120
  2. package/dist/cli/toloka.js.jsc +0 -0
  3. package/dist/cli/toloka.js.jsc.sha256 +1 -1
  4. package/dist/cli/toloka.js.sha256 +1 -1
  5. package/docs/cli.md +26 -1
  6. package/docs/datasets.md +8 -9
  7. package/docs/limitations.md +5 -8
  8. package/docs/troubleshooting.md +0 -11
  9. package/openapi/gen/api.ts +779 -895
  10. package/openapi/gen/models/baseModel.ts +9 -0
  11. package/openapi/gen/models/baseModelId.ts +2 -0
  12. package/openapi/gen/models/baseModelIdProperty.ts +2 -0
  13. package/openapi/gen/models/createProjectModelBody.ts +8 -0
  14. package/openapi/gen/models/createProjectModelBodyDescription.ts +2 -0
  15. package/openapi/gen/models/generationNodeSettingsAudienceAndPricingOneOfOneone.ts +1 -0
  16. package/openapi/gen/models/index.ts +16 -0
  17. package/openapi/gen/models/listBaseModels200.ts +5 -0
  18. package/openapi/gen/models/listModelVersions200.ts +7 -0
  19. package/openapi/gen/models/listModelVersionsParams.ts +5 -0
  20. package/openapi/gen/models/listProjectModels200.ts +7 -0
  21. package/openapi/gen/models/listProjectModelsParams.ts +5 -0
  22. package/openapi/gen/models/model.ts +16 -0
  23. package/openapi/gen/models/modelArchivedAt.ts +2 -0
  24. package/openapi/gen/models/modelDescription.ts +2 -0
  25. package/openapi/gen/models/modelId.ts +2 -0
  26. package/openapi/gen/models/modelVersion.ts +9 -0
  27. package/openapi/gen/models/modelVersionId.ts +2 -0
  28. package/openapi/gen/models/pipelineGraphSnapshotGraphNodesItemOneOfThreeoneSettingsAudienceAndPricingOneOfOneone.ts +1 -0
  29. package/openapi/gen/models/validatePipelineGraphBodyGraphNodesItemOneOfThreeoneSettingsAudienceAndPricingOneOfOneone.ts +1 -0
  30. package/package.json +1 -1
  31. package/skills/catalog.json +4 -4
  32. package/skills/toloka-build/SKILL.md +1 -1
  33. package/skills/toloka-build/references/workflow-and-cli.md +12 -1
  34. package/skills/toloka-report-issue/references/report-template.md +1 -1
  35. package/src/cli/data.ts +148 -25
  36. package/src/cli/models.ts +188 -0
  37. package/src/cli/program.ts +99 -1
  38. package/src/client.ts +109 -35
  39. package/src/errors.ts +25 -10
  40. package/src/transport.ts +16 -13
Binary file
@@ -1 +1 @@
1
- bbe06fffb8a659ebc2903d962ff2b4a225fe3abc691e607a01258350163c36c7 toloka.js.jsc
1
+ 2e4e22afc766a0a267262fe07718505b43f1cdf364e402a990279e224ad92923 toloka.js.jsc
@@ -1 +1 @@
1
- 43e152b2ae5342013785dd1c89843bead8b68039ea6576ae5a8bea5944263127 toloka.js
1
+ 842c3cdfb47d5a899375c288cefa8ba550c22301dbd47d99d224a8b34acd01a2 toloka.js
package/docs/cli.md CHANGED
@@ -202,6 +202,31 @@ toloka pipeline results <runId> [--limit <n>] [--failed]
202
202
 
203
203
  `pipeline status` reports the latest run of that pipeline. `pipeline runs` lists recent runs (default 10). `pipeline cost` forecasts what a run would bill. `pipeline cancel` and `pipeline results` take a run id.
204
204
 
205
+ ## base-model
206
+
207
+ Inspect the global, read-only Base Model Catalog.
208
+
209
+ ```sh
210
+ toloka base-model list [--json]
211
+ toloka base-model get <id> [--json]
212
+ ```
213
+
214
+ Human-readable output is the default. `base-model list` prints aligned ID, name, provider, and upstream-model columns; `base-model get` prints labeled fields including the pinned revision. Pass `--json` for machine-readable output.
215
+
216
+ ## model
217
+
218
+ Manage Model metadata in the selected project.
219
+
220
+ ```sh
221
+ toloka model list [--json]
222
+ toloka model get <name-or-id> [--json]
223
+ toloka model versions <name-or-id> [--json]
224
+ toloka model create <name> --base <base-model-id> [--description <text>] [--json]
225
+ toloka model archive <name-or-id> [--json]
226
+ ```
227
+
228
+ `model create` creates project-owned Model metadata linked to one catalog Base Model; it does not create a Model Version. Human-readable output is the default for every command in this group. Pass `--json` for machine-readable objects or arrays. Weight upload, validation, download, and Model Version creation are deferred.
229
+
205
230
  ## dataset
206
231
 
207
232
  Catalog and row commands for datasets in the selected project. Name or id is accepted; duplicate names must be addressed by id.
@@ -219,7 +244,7 @@ toloka dataset upload <name> <file>
219
244
 
220
245
  `dataset load` starts a platform export, waits for it (default 60s; pass `--timeout`), downloads the JSON array, and writes JSONL to `--out`. `--limit` slices after download; it still waits for the full export. On timeout the message names the export id. Failed downloads and invalid payloads leave `--out` untouched.
221
246
 
222
- `dataset upload` appends JSONL rows. Field schemas are immutable after the first upload: you can add columns, never alter or remove one. See [datasets](./datasets.md).
247
+ `dataset upload` accepts `.json` arrays, `.jsonl` files with one object per line, and `.csv` files with a header row. The CLI infers the format from the extension and uploads the original bytes without conversion. If the blob transfer or finalization fails, the CLI cancels the started upload before returning the error, so another upload can start immediately and may reuse the same filename. Field schemas are immutable after the first successful upload: you can add columns, never alter or remove one. See [datasets](./datasets.md).
223
248
 
224
249
  ## report
225
250
 
package/docs/datasets.md CHANGED
@@ -109,17 +109,16 @@ toloka dataset upload face-images data/face_images.jsonl
109
109
 
110
110
  The command takes two positional arguments and has no flags:
111
111
 
112
- | Argument | Description |
113
- | -------- | ------------------------------------ |
114
- | `<name>` | Dataset name or id |
115
- | `<file>` | JSONL file, one JSON object per line |
112
+ | Argument | Description |
113
+ | -------- | ------------------------------------------ |
114
+ | `<name>` | Dataset name or id |
115
+ | `<file>` | `.json`, `.jsonl`, or `.csv` file to append |
116
116
 
117
- Each line is a JSON object with keys matching column names:
117
+ The CLI infers the format from the filename extension and uploads the original bytes without conversion:
118
118
 
119
- ```json
120
- {"image_url": "https://example.com/cat-1.jpg"}
121
- {"image_url": "https://example.com/cat-2.jpg"}
122
- ```
119
+ - `.json` contains an array of row objects.
120
+ - `.jsonl` contains one row object per non-empty line and is validated locally before upload.
121
+ - `.csv` uses its header row for field names; every value is ingested as a string.
123
122
 
124
123
  Upload is additive: it appends items and never rewrites existing ones. If the dataset does not exist yet and a pipeline in source declares it, `dataset upload` creates the dataset with the declared columns automatically. If no pipeline declares the dataset, upload stops and asks you to bind a pipeline to it in source so its columns are known, or to upload to an existing dataset. Duplicate live names must be addressed by id.
125
124
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  What this Preview SDK does not do yet, stated plainly so you can decide what to depend on.
4
4
 
5
- `@toloka-platform/sdk` is `0.1.0-preview.5`. This is a Preview: the authoring API, the CLI surface, and the generated source layout can change without a major version bump. Pin an exact version. Do not depend on this in production yet.
5
+ `@toloka-platform/sdk` is `0.1.0-preview.6`. This is a Preview: the authoring API, the CLI surface, and the generated source layout can change without a major version bump. Pin an exact version. Do not depend on this in production yet.
6
6
 
7
7
  ## The SDK does not certify deployability
8
8
 
@@ -39,13 +39,10 @@ A `code` node carries its Python as an inline string in `code.code`. There is no
39
39
 
40
40
  These are reproduced platform-side issues that affect the SDK path. They are not SDK bugs and cannot be fixed from this package.
41
41
 
42
- | defect | effect on you | workaround |
43
- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
44
- | Re-uploading a filename already used in a dataset returns a bodyless `500` | running the same `toloka dataset upload` twice fails | use a distinct filename per upload |
45
- | A failed upload leaves a pending upload row, and a pending upload counts as in progress | later uploads to that dataset return `409 Another upload is already in progress`, with no public cancel | load into a new dataset; ask for the pending upload to be cleared |
46
- | Finalizing a file upload can return a bodyless `500` | `toloka dataset upload` cannot complete on an affected environment | declare columns in source and load rows through a client call |
47
- | Rows added through the items endpoint skip column inference | `toloka dataset fields` reports no columns for a dataset that holds rows | declare columns in source rather than inferring them |
48
- | Starting a run intermittently returns a bodyless `500` | `toloka pipeline run` fails with nothing to act on | check `toloka pipeline runs <name>` for a created run, then retry |
42
+ | defect | effect on you | workaround |
43
+ | ----------------------------------------------------------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------- |
44
+ | Rows added through the items endpoint skip column inference | `toloka dataset fields` reports no columns for a dataset that holds rows | declare columns in source rather than inferring them |
45
+ | Starting a run intermittently returns a bodyless `500` | `toloka pipeline run` fails with nothing to act on | check `toloka pipeline runs <name>` for a created run, then retry |
49
46
 
50
47
  ## Not attempted yet
51
48
 
@@ -51,17 +51,6 @@ A resource exists on the platform but not in your source tree. `apply` reports i
51
51
 
52
52
  Another writer changed the graph after your source was read. Do not retry blindly: `plan` again to re-read live state, review the new diff, carry any intentional remote change into source, then `apply`.
53
53
 
54
- ## Second upload of the same filename fails
55
-
56
- Uploading a file whose basename already exists in that dataset fails with a bodyless `500`. `toloka dataset upload` sends the file's basename, so running the same documented command twice reproduces it:
57
-
58
- ```sh
59
- toloka dataset upload cat-images ./data/rows.jsonl # first time: fine
60
- toloka dataset upload cat-images ./data/rows.jsonl # second time: 500
61
- ```
62
-
63
- Until the platform returns a proper conflict, use a distinct filename per upload — for example `rows-2026-08-13.jsonl`. This is a platform defect, tracked; the SDK cannot detect it in advance.
64
-
65
54
  ## Another upload is already in progress
66
55
 
67
56
  ```