@toloka-platform/sdk 0.2.1 → 0.3.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 +12 -6
- package/dist/cli/toloka.js +242 -134
- 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/cli.md +73 -20
- package/docs/getting-started.md +11 -9
- package/docs/limitations.md +6 -0
- package/docs/testing-examples.md +2 -2
- package/docs/testing.md +10 -2
- package/docs/troubleshooting.md +16 -4
- package/package.json +1 -1
- package/skills/catalog.json +10 -10
- package/skills/toloka-build/SKILL.md +8 -5
- package/skills/toloka-build/references/workflow-and-cli.md +44 -22
- package/skills/toloka-fine-tuning/SKILL.md +1 -2
- package/skills/toloka-get-started/SKILL.md +4 -3
- package/skills/toloka-gisting/SKILL.md +1 -2
- package/skills/toloka-report-issue/references/report-template.md +1 -1
- package/src/cli/auth.ts +382 -81
- package/src/cli/browser-login.ts +265 -0
- package/src/cli/browser-session.ts +244 -0
- package/src/cli/commands/auth.ts +22 -15
- package/src/cli/commands/project.ts +3 -3
- package/src/cli/config.ts +41 -14
- package/src/cli/context.ts +38 -7
- package/src/cli/credentials.ts +13 -13
- package/src/cli/keycloak.ts +189 -0
- package/src/cli/program.ts +3 -0
- package/src/cli/sign-in-page.ts +153 -0
- package/src/cli/style.ts +37 -0
- package/src/cli/terminal-io.ts +9 -2
- package/src/client.ts +3 -3
- package/src/pipeline-graph-v1.contract.json +47 -24
- package/src/transport.ts +19 -11
package/README.md
CHANGED
|
@@ -43,21 +43,23 @@ toloka init
|
|
|
43
43
|
|
|
44
44
|
## Install
|
|
45
45
|
|
|
46
|
-
Install the
|
|
46
|
+
Install the CLI:
|
|
47
47
|
|
|
48
48
|
```sh
|
|
49
49
|
curl -fsSL https://platform.toloka.ai/cli/install.sh | sh
|
|
50
|
-
|
|
50
|
+
toloka --version
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
The installer
|
|
53
|
+
The installer uses compatible Bun when available, otherwise installs a standalone executable with its runtime included. See [CLI setup](./docs/cli.md#install) for `--bun` / `--native`, supported platforms, PATH, and updates.
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
**Bun is the recommended runtime and package manager for SDK development.** Add the SDK when authoring pipelines:
|
|
56
56
|
|
|
57
57
|
```sh
|
|
58
|
-
bun add @toloka-platform/sdk@
|
|
58
|
+
bun add @toloka-platform/sdk@latest
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
+
For an existing project, run `bun i` to install its dependencies. Training-only workflows need neither the SDK nor a separate runtime. See [Getting started](./docs/getting-started.md) for the full authoring workflow.
|
|
62
|
+
|
|
61
63
|
For a guided first run, start a fresh coding-agent session and ask it to follow the [Toloka agent bootstrap](https://platform.toloka.ai/agents/SKILL.md). It routes to the data-labeling, fine-tuning, or gisting runbook and the matching packaged skill.
|
|
62
64
|
|
|
63
65
|
## Documentation
|
|
@@ -93,9 +95,13 @@ Two rules the platform enforces and the SDK will not paper over:
|
|
|
93
95
|
- **Dataset columns are immutable.** A column can be added, never altered, never removed. `plan` reports a schema conflict and `apply` refuses rather than rewriting data.
|
|
94
96
|
- **Nothing is deleted implicitly.** A pipeline or dataset that exists live but not in source is reported and refused, not dropped.
|
|
95
97
|
|
|
98
|
+
## Authenticate the client from code
|
|
99
|
+
|
|
100
|
+
`createClient` takes the platform URL and one credential. `{ baseUrl, apiKey }` sends the key with the `ApiKey` authorization scheme on every request; the key does not expire until it is deleted in the Business Console. `{ baseUrl, accessToken }` calls the `accessToken` function before every request and sends its result as a Bearer token, so a renewable session can back the client. The two forms are exclusive. The CLI uses the second form for its browser sign-in.
|
|
101
|
+
|
|
96
102
|
## Agent support
|
|
97
103
|
|
|
98
|
-
`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`, 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
|
|
104
|
+
`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`, 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 CLI-owned content and removes only Toloka-generated legacy entry points; run it again after updating the standalone CLI. 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.
|
|
99
105
|
|
|
100
106
|
## Agent evals
|
|
101
107
|
|