@toloka-platform/sdk 0.1.0-preview.6 → 0.1.0-preview.7
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 +7 -11
- package/dist/cli/toloka.js +208 -123
- package/dist/cli/toloka.js.jsc +0 -0
- package/dist/cli/toloka.js.jsc.sha256 +1 -1
- package/dist/cli/toloka.js.sha256 +1 -1
- package/docs/authoring.md +17 -4
- package/docs/cli-v2.md +3 -3
- package/docs/cli.md +29 -16
- package/docs/getting-started.md +7 -12
- package/docs/limitations.md +6 -6
- package/docs/testing-examples.md +248 -0
- package/docs/testing.md +115 -0
- package/examples/face-image-collection/README.md +7 -1
- package/examples/face-image-collection/fields.ts +20 -8
- package/examples/face-image-collection/nodes/annotate-faces/node.ts +1 -9
- package/examples/face-image-collection/nodes/order-faces/node.ts +1 -1
- package/examples/face-image-collection/pipeline.browser.integration.spec.ts +78 -0
- package/examples/video-pair-rating/README.md +14 -6
- package/examples/video-pair-rating/nodes/adjudicate/node.ts +1 -3
- package/examples/video-pair-rating/nodes/adjudicate_op/node.ts +1 -3
- package/examples/video-pair-rating/nodes/overall_preference_pick/node.ts +1 -1
- package/examples/video-pair-rating/nodes/rate_pair/node.ts +1 -1
- package/examples/video-pair-rating/pipeline.browser.integration.spec.ts +267 -0
- package/openapi/gen/api.ts +48 -11
- package/openapi/gen/models/createDatasetExportBody.ts +3 -3
- package/openapi/gen/models/createDatasetExportBodyOneOf.ts +6 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfFormat.ts +2 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThree.ts +10 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeContract.ts +2 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeFormat.ts +2 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilter.ts +9 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldSourcesItem.ts +6 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldSourcesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldSourcesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldSourcesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldValuesItem.ts +12 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldValuesItemOperator.ts +2 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldValuesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldValuesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldValuesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldValuesItemValue.ts +2 -0
- package/openapi/gen/models/datasetExportReport.ts +9 -0
- package/openapi/gen/models/datasetExportReportErrorsItem.ts +5 -0
- package/openapi/gen/models/datasetExportReportTokens.ts +7 -0
- package/openapi/gen/models/exportJob.ts +2 -0
- package/openapi/gen/models/exportJobReport.ts +3 -0
- package/openapi/gen/models/index.ts +48 -0
- package/openapi/gen/models/sampleDatasetItemsBody.ts +4 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOf.ts +8 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfItemFilter.ts +9 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfItemFilterFieldSourcesItem.ts +6 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfItemFilterFieldSourcesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfItemFilterFieldSourcesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfItemFilterFieldSourcesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfItemFilterFieldValuesItem.ts +12 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfItemFilterFieldValuesItemOperator.ts +2 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfItemFilterFieldValuesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfItemFilterFieldValuesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfItemFilterFieldValuesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfItemFilterFieldValuesItemValue.ts +2 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfOnethree.ts +8 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfOnethreeItemFilter.ts +9 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfOnethreeItemFilterFieldSourcesItem.ts +6 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfOnethreeItemFilterFieldSourcesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfOnethreeItemFilterFieldSourcesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfOnethreeItemFilterFieldSourcesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfOnethreeItemFilterFieldValuesItem.ts +12 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfOnethreeItemFilterFieldValuesItemOperator.ts +2 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfOnethreeItemFilterFieldValuesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfOnethreeItemFilterFieldValuesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfOnethreeItemFilterFieldValuesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/sampleDatasetItemsBodyAnyOfOnethreeItemFilterFieldValuesItemValue.ts +2 -0
- package/openapi/gen/models/sampleJob.ts +13 -0
- package/openapi/gen/models/sampleJobStatus.ts +2 -0
- package/openapi/gen/models/sampleResult.ts +5 -0
- package/package.json +23 -2
- package/skills/catalog.json +14 -6
- package/skills/toloka-build/SKILL.md +34 -12
- package/skills/toloka-build/references/node-semantics.md +27 -24
- package/skills/toloka-build/references/workflow-and-cli.md +55 -26
- package/skills/toloka-report-issue/references/report-template.md +1 -1
- package/src/checks/ast.ts +32 -0
- package/src/checks/index.ts +14 -0
- package/src/checks/postprocess-collisions.ts +145 -0
- package/src/checks/task-ui-declarations.generated.ts +19 -0
- package/src/checks/task-ui-typecheck.ts +345 -0
- package/src/checks/typescript-vfs.d.ts +26 -0
- package/src/checks/typescript-vfs.js +5 -0
- package/src/cli/analytics.ts +1 -0
- package/src/cli/check.ts +977 -0
- package/src/cli/program.ts +147 -19
- package/src/cli/project-context.ts +14 -4
- package/src/cli/runs.ts +21 -11
- package/src/cli/skill.ts +17 -6
- package/src/testing/code-node.ts +160 -0
- package/src/testing/index.ts +15 -0
- package/src/testing/task-ui-browser.ts +120 -0
- package/src/testing/task-ui-validation.ts +135 -0
- package/src/testing/task-ui.ts +557 -0
- package/src/testing/test-evidence.ts +170 -0
- package/src/testing/types.ts +141 -0
package/README.md
CHANGED
|
@@ -44,21 +44,16 @@ toloka init
|
|
|
44
44
|
|
|
45
45
|
## Install
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
```sh
|
|
50
|
-
cd packages/sdk && bun link
|
|
51
|
-
cd /path/to/your/project && bun link @toloka-platform/sdk
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Once the hosted installer is deployed, install the bytecode-cached CLI and add the SDK to the project:
|
|
47
|
+
Install the bytecode-cached CLI and add the Preview SDK to the project:
|
|
55
48
|
|
|
56
49
|
```sh
|
|
57
50
|
curl -fsSL https://platform.toloka.ai/cli/install.sh | sh
|
|
58
51
|
bun add @toloka-platform/sdk@preview
|
|
59
52
|
```
|
|
60
53
|
|
|
61
|
-
The installer requires Bun 1.4.0, installs `@toloka-platform/sdk` globally, and exposes `toloka` through Bun's global binary directory. The
|
|
54
|
+
The installer requires Bun 1.4.0, installs `@toloka-platform/sdk` globally, and exposes `toloka` through Bun's global binary directory. The project install makes SDK imports resolvable.
|
|
55
|
+
|
|
56
|
+
For a guided first run, start a fresh coding-agent session and ask it to follow the [agent onboarding guide](https://platform.toloka.ai/onboarding.md).
|
|
62
57
|
|
|
63
58
|
## Documentation
|
|
64
59
|
|
|
@@ -66,6 +61,7 @@ The installer requires Bun 1.4.0, installs `@toloka-platform/sdk` globally, and
|
|
|
66
61
|
| -------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
67
62
|
| [Getting started](./docs/getting-started.md) | install, sign in, adopt an existing project or author a new one, first apply |
|
|
68
63
|
| [Authoring](./docs/authoring.md) | the typed graph API: fields, node constructors, ports, assembly, identity |
|
|
64
|
+
| [Testing](./docs/testing.md) | `toloka check`, typed node tests, Task UI scenarios, and pipeline flows |
|
|
69
65
|
| [Nodes](./docs/nodes.md) | which node to reach for, what lives inside a human-work node, pricing floors |
|
|
70
66
|
| [Datasets](./docs/datasets.md) | columns, immutable schemas, loading rows, what plan refuses |
|
|
71
67
|
| [CLI](./docs/cli.md) | every command, flag, exit code, and the reconcile loop |
|
|
@@ -83,7 +79,7 @@ Each example is a complete project you can read end to end. See [examples](./exa
|
|
|
83
79
|
|
|
84
80
|
## How it works
|
|
85
81
|
|
|
86
|
-
The CLI treats your source tree as the desired state. `toloka plan` reads the source
|
|
82
|
+
The CLI treats your source tree as the desired state. `toloka check` runs project types, automatic Task UI types, and required typed node and pipeline-flow tests without platform credentials. `toloka plan` reads the checked source and live platform state and prints the difference. `toloka apply` reruns the complete local gate before making the platform match. Running `plan` again should print `No changes.`
|
|
87
83
|
|
|
88
84
|
Identity lives in `toloka.json`, written when the CLI binds the directory to a platform project. It maps your source directories and dataset names to platform IDs so later runs reconcile the same resources instead of creating new ones. Do not hand-edit it.
|
|
89
85
|
|
|
@@ -94,7 +90,7 @@ Two rules the platform enforces and the SDK will not paper over:
|
|
|
94
90
|
|
|
95
91
|
## Agent support
|
|
96
92
|
|
|
97
|
-
`toloka init` initializes the current directory with one managed `<toloka>` Agent Bootstrap block in `AGENTS.md` plus minimal pointers to it: a Claude skill at `.claude/skills/toloka-bootstrap/SKILL.md` and, when `.cursor/rules/` exists, an always-applied Cursor rule at `.cursor/rules/toloka-bootstrap.mdc`. It does not
|
|
93
|
+
`toloka init` initializes the current directory with one managed `<toloka>` Agent Bootstrap block in `AGENTS.md` plus minimal pointers to it: a Claude skill at `.claude/skills/toloka-bootstrap/SKILL.md` and, when `.cursor/rules/` exists, an always-applied Cursor rule at `.cursor/rules/toloka-bootstrap.mdc`. It does not bind a checkout from the machine registry's current project. Pass `--project-id`, set `TOLOKA_PROJECT_ID` / `POTATO_PROJECT_ID`, or run `toloka project create` first when `init` must write `toloka.json`. For an existing project, run `toloka import <projectId>` before `init`. Re-running `init` refreshes only SDK-owned content and removes only Toloka-generated legacy entry points. Then open your coding agent in that directory and ask it to create the project you need; the bootstrap directs the agent to `toloka --help`, skill discovery, and the installed skill.
|
|
98
94
|
|
|
99
95
|
## Agent evals
|
|
100
96
|
|