@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 CHANGED
@@ -43,21 +43,23 @@ toloka init
43
43
 
44
44
  ## Install
45
45
 
46
- Install the bytecode-cached CLI and add the stable SDK to the project:
46
+ Install the CLI:
47
47
 
48
48
  ```sh
49
49
  curl -fsSL https://platform.toloka.ai/cli/install.sh | sh
50
- bun add @toloka-platform/sdk@latest
50
+ toloka --version
51
51
  ```
52
52
 
53
- The installer requires Bun 1.4.0 or newer, installs `@toloka-platform/sdk` globally, and exposes `toloka` through Bun's global binary directory. The project install makes SDK imports resolvable.
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
- `latest` currently resolves to stable `0.2.0`. It includes Training (`toloka training`), the agent runbooks, and their bundled skills. For a reproducible project install, pin the current stable version:
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@0.2.0
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 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.
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