@toloka-platform/sdk 0.20.0 → 0.21.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/dist/cli/toloka.js +159 -159
- 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/openapi/gen/api.schemas.ts +851 -3585
- package/package.json +5 -5
- package/skills/catalog.json +6 -6
- package/skills/toloka-build/references/human-work.md +1 -1
- package/src/client.ts +9 -2
- package/src/pipeline-graph-v1.contract.json +42 -138
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toloka-platform/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Build, inspect, and operate Toloka pipeline projects as TypeScript source. The public API may change between minor versions before 1.0.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"sync-task-ui-declarations": "bun ./scripts/sync-task-ui-declarations.ts",
|
|
41
41
|
"test": "vitest run",
|
|
42
42
|
"test:browser": "vitest run --config vitest.browser.config.ts",
|
|
43
|
-
"typecheck": "
|
|
43
|
+
"typecheck": "tsrs --noEmit"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@inquirer/select": "5.2.1",
|
|
@@ -59,12 +59,12 @@
|
|
|
59
59
|
"orval": "8.40.0",
|
|
60
60
|
"playwright": "1.63.0",
|
|
61
61
|
"typescript": "7.1.0-beta",
|
|
62
|
-
"vitest": "
|
|
62
|
+
"vitest": "5.0.5",
|
|
63
63
|
"yaml": "2.9.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"playwright": ">=1.63.0 <2",
|
|
67
|
-
"vitest": ">=4.1.0 <
|
|
67
|
+
"vitest": ">=4.1.0 <6"
|
|
68
68
|
},
|
|
69
69
|
"peerDependenciesMeta": {
|
|
70
70
|
"playwright": {
|
|
@@ -78,6 +78,6 @@
|
|
|
78
78
|
"bun": ">=1.4.0"
|
|
79
79
|
},
|
|
80
80
|
"tolokaBuild": {
|
|
81
|
-
"commit": "
|
|
81
|
+
"commit": "ebb44d001f2d81bea3c678bebfa24afaee273bd8"
|
|
82
82
|
}
|
|
83
83
|
}
|
package/skills/catalog.json
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"testing",
|
|
12
12
|
"checks"
|
|
13
13
|
],
|
|
14
|
-
"version": "0.
|
|
15
|
-
"digest": "
|
|
14
|
+
"version": "0.21.0",
|
|
15
|
+
"digest": "77d79baf90674ec502155aab57d3a80bc9e9a2f5679d0269c8bd160c8c64f9ee",
|
|
16
16
|
"files": [
|
|
17
17
|
"SKILL.md",
|
|
18
18
|
"references/human-work.md",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"bug",
|
|
34
34
|
"report"
|
|
35
35
|
],
|
|
36
|
-
"version": "0.
|
|
36
|
+
"version": "0.21.0",
|
|
37
37
|
"digest": "70f0bd2c80b32f87896aeb27c363b8a2d37f40e22424f57fe1aad142e125ad67",
|
|
38
38
|
"files": [
|
|
39
39
|
"SKILL.md",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"getting-started",
|
|
51
51
|
"agent"
|
|
52
52
|
],
|
|
53
|
-
"version": "0.
|
|
53
|
+
"version": "0.21.0",
|
|
54
54
|
"digest": "2278adeb46a792356579395fcf73c42322cb23bcd0c61e20856ccabdad6762d1",
|
|
55
55
|
"files": [
|
|
56
56
|
"SKILL.md"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"sft",
|
|
68
68
|
"models"
|
|
69
69
|
],
|
|
70
|
-
"version": "0.
|
|
70
|
+
"version": "0.21.0",
|
|
71
71
|
"digest": "3ce10dee5d3c283d8b5fdea15134a58fc738c7af2c1bb19eb5a0bf70ea0bca13",
|
|
72
72
|
"files": [
|
|
73
73
|
"SKILL.md"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"prompt",
|
|
85
85
|
"models"
|
|
86
86
|
],
|
|
87
|
-
"version": "0.
|
|
87
|
+
"version": "0.21.0",
|
|
88
88
|
"digest": "be8bce8d9cf7241ccb60d2b2a9b7cc07d7755a76e8ff8ec1b0847c49efbb3469",
|
|
89
89
|
"files": [
|
|
90
90
|
"SKILL.md"
|
|
@@ -65,7 +65,7 @@ Use `audienceType: 'synthetic'` only when the user explicitly asks for model-gen
|
|
|
65
65
|
|
|
66
66
|
#### Expert lists and bans
|
|
67
67
|
|
|
68
|
-
Expert lists
|
|
68
|
+
Expert lists and expert bans are enabled for a team together, and only on top of the audience service: `toloka expert-list` and `toloka expert-ban-list` work only for teams with expert lists enabled, and apply rejects `audienceMode: 'service'` unless the team has the audience service enabled. Use them only when the user asks for a fixed set of experts or a ban.
|
|
69
69
|
|
|
70
70
|
- `audienceMode: 'service'` on a `generation` or `quorum` node switches it to the audience service; `'legacy'` (or omitting it on a new node) keeps audience filters and smart search. With the service, `audienceAndPricing.expertListId` takes the labeling experts from an expert list, and on `generation` `qualityAssurance.expertListId` does the same for human QA (`human_only` or `hybrid`). The audience filters then stop deciding who gets tasks; `pricePerTask`, `timeForTask`, and the per-expert cap still apply.
|
|
71
71
|
- Keep the settings `toloka import` wrote. Leaving a field out never detaches a list: plan shows no change for it, but apply rejects the whole graph while any node leaves out a setting the platform has, even when you only changed another node. Run `toloka import` to bring the settings into the source. To remove them, set `audienceMode: 'legacy'` and `expertListId: null` explicitly.
|
package/src/client.ts
CHANGED
|
@@ -84,6 +84,7 @@ import type {
|
|
|
84
84
|
BaseModelId as GeneratedBaseModelId,
|
|
85
85
|
UpdatePipelineBody,
|
|
86
86
|
UpdateProjectBody,
|
|
87
|
+
JsonValue as GeneratedJsonValue,
|
|
87
88
|
UploadJob as GeneratedUploadJob,
|
|
88
89
|
ValidatePipelineGraphBody,
|
|
89
90
|
} from "../openapi/gen/api.schemas";
|
|
@@ -167,7 +168,11 @@ type BrandedResource<T extends { id: string }, Id extends string> = Omit<
|
|
|
167
168
|
id: Id;
|
|
168
169
|
};
|
|
169
170
|
|
|
170
|
-
type
|
|
171
|
+
type IsJsonValue<T> = [T] extends [GeneratedJsonValue] ? ([GeneratedJsonValue] extends [T] ? true : false) : false;
|
|
172
|
+
|
|
173
|
+
type PublicInput<T> = IsJsonValue<T> extends true
|
|
174
|
+
? T
|
|
175
|
+
: T extends readonly unknown[]
|
|
171
176
|
? { [K in keyof T]: PublicInput<T[K]> }
|
|
172
177
|
: T extends object
|
|
173
178
|
? {
|
|
@@ -882,7 +887,9 @@ const createClientImplementation = (config: ClientConfig) => {
|
|
|
882
887
|
};
|
|
883
888
|
};
|
|
884
889
|
|
|
885
|
-
type PublicOutput<T> = T extends
|
|
890
|
+
type PublicOutput<T> = IsJsonValue<T> extends true
|
|
891
|
+
? T
|
|
892
|
+
: T extends GeneratedCheckJob
|
|
886
893
|
? CheckJob
|
|
887
894
|
: T extends GeneratedRunJob
|
|
888
895
|
? RunJob
|
|
@@ -219,19 +219,11 @@
|
|
|
219
219
|
]
|
|
220
220
|
},
|
|
221
221
|
"value": {
|
|
222
|
-
"
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
"type": "number"
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"type": "boolean"
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
"type": "null"
|
|
234
|
-
}
|
|
222
|
+
"type": [
|
|
223
|
+
"string",
|
|
224
|
+
"number",
|
|
225
|
+
"boolean",
|
|
226
|
+
"null"
|
|
235
227
|
]
|
|
236
228
|
},
|
|
237
229
|
"fieldId": {
|
|
@@ -432,7 +424,7 @@
|
|
|
432
424
|
"createdBefore": {
|
|
433
425
|
"type": "string",
|
|
434
426
|
"format": "date-time",
|
|
435
|
-
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d
|
|
427
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
|
|
436
428
|
}
|
|
437
429
|
},
|
|
438
430
|
"additionalProperties": false
|
|
@@ -1029,13 +1021,9 @@
|
|
|
1029
1021
|
"const": true
|
|
1030
1022
|
},
|
|
1031
1023
|
"maxEntities": {
|
|
1032
|
-
"
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
},
|
|
1036
|
-
{
|
|
1037
|
-
"type": "null"
|
|
1038
|
-
}
|
|
1024
|
+
"type": [
|
|
1025
|
+
"number",
|
|
1026
|
+
"null"
|
|
1039
1027
|
]
|
|
1040
1028
|
}
|
|
1041
1029
|
},
|
|
@@ -1323,13 +1311,9 @@
|
|
|
1323
1311
|
"const": true
|
|
1324
1312
|
},
|
|
1325
1313
|
"maxEntities": {
|
|
1326
|
-
"
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
},
|
|
1330
|
-
{
|
|
1331
|
-
"type": "null"
|
|
1332
|
-
}
|
|
1314
|
+
"type": [
|
|
1315
|
+
"number",
|
|
1316
|
+
"null"
|
|
1333
1317
|
]
|
|
1334
1318
|
}
|
|
1335
1319
|
},
|
|
@@ -2048,7 +2032,7 @@
|
|
|
2048
2032
|
"type": "string"
|
|
2049
2033
|
},
|
|
2050
2034
|
"additionalProperties": {
|
|
2051
|
-
"$ref": "#/$defs/
|
|
2035
|
+
"$ref": "#/$defs/__schema2"
|
|
2052
2036
|
}
|
|
2053
2037
|
},
|
|
2054
2038
|
"checks": {
|
|
@@ -2067,7 +2051,7 @@
|
|
|
2067
2051
|
"type": "string"
|
|
2068
2052
|
},
|
|
2069
2053
|
"golden": {
|
|
2070
|
-
"$ref": "#/$defs/
|
|
2054
|
+
"$ref": "#/$defs/__schema2"
|
|
2071
2055
|
},
|
|
2072
2056
|
"hint": {
|
|
2073
2057
|
"type": "string"
|
|
@@ -2353,13 +2337,9 @@
|
|
|
2353
2337
|
"type": "string"
|
|
2354
2338
|
},
|
|
2355
2339
|
"projectDescription": {
|
|
2356
|
-
"
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
},
|
|
2360
|
-
{
|
|
2361
|
-
"type": "null"
|
|
2362
|
-
}
|
|
2340
|
+
"type": [
|
|
2341
|
+
"string",
|
|
2342
|
+
"null"
|
|
2363
2343
|
]
|
|
2364
2344
|
},
|
|
2365
2345
|
"extraHardRequirements": {
|
|
@@ -2550,19 +2530,11 @@
|
|
|
2550
2530
|
]
|
|
2551
2531
|
},
|
|
2552
2532
|
"value": {
|
|
2553
|
-
"
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
"type": "number"
|
|
2559
|
-
},
|
|
2560
|
-
{
|
|
2561
|
-
"type": "boolean"
|
|
2562
|
-
},
|
|
2563
|
-
{
|
|
2564
|
-
"type": "null"
|
|
2565
|
-
}
|
|
2533
|
+
"type": [
|
|
2534
|
+
"string",
|
|
2535
|
+
"number",
|
|
2536
|
+
"boolean",
|
|
2537
|
+
"null"
|
|
2566
2538
|
]
|
|
2567
2539
|
}
|
|
2568
2540
|
},
|
|
@@ -3087,13 +3059,9 @@
|
|
|
3087
3059
|
"const": true
|
|
3088
3060
|
},
|
|
3089
3061
|
"maxEntities": {
|
|
3090
|
-
"
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
},
|
|
3094
|
-
{
|
|
3095
|
-
"type": "null"
|
|
3096
|
-
}
|
|
3062
|
+
"type": [
|
|
3063
|
+
"number",
|
|
3064
|
+
"null"
|
|
3097
3065
|
]
|
|
3098
3066
|
}
|
|
3099
3067
|
},
|
|
@@ -3381,13 +3349,9 @@
|
|
|
3381
3349
|
"const": true
|
|
3382
3350
|
},
|
|
3383
3351
|
"maxEntities": {
|
|
3384
|
-
"
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
},
|
|
3388
|
-
{
|
|
3389
|
-
"type": "null"
|
|
3390
|
-
}
|
|
3352
|
+
"type": [
|
|
3353
|
+
"number",
|
|
3354
|
+
"null"
|
|
3391
3355
|
]
|
|
3392
3356
|
}
|
|
3393
3357
|
},
|
|
@@ -3872,7 +3836,7 @@
|
|
|
3872
3836
|
"type": "string"
|
|
3873
3837
|
},
|
|
3874
3838
|
"additionalProperties": {
|
|
3875
|
-
"$ref": "#/$defs/
|
|
3839
|
+
"$ref": "#/$defs/__schema2"
|
|
3876
3840
|
}
|
|
3877
3841
|
},
|
|
3878
3842
|
"checks": {
|
|
@@ -3891,7 +3855,7 @@
|
|
|
3891
3855
|
"type": "string"
|
|
3892
3856
|
},
|
|
3893
3857
|
"golden": {
|
|
3894
|
-
"$ref": "#/$defs/
|
|
3858
|
+
"$ref": "#/$defs/__schema2"
|
|
3895
3859
|
},
|
|
3896
3860
|
"hint": {
|
|
3897
3861
|
"type": "string"
|
|
@@ -4177,13 +4141,9 @@
|
|
|
4177
4141
|
"type": "string"
|
|
4178
4142
|
},
|
|
4179
4143
|
"projectDescription": {
|
|
4180
|
-
"
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
},
|
|
4184
|
-
{
|
|
4185
|
-
"type": "null"
|
|
4186
|
-
}
|
|
4144
|
+
"type": [
|
|
4145
|
+
"string",
|
|
4146
|
+
"null"
|
|
4187
4147
|
]
|
|
4188
4148
|
},
|
|
4189
4149
|
"extraHardRequirements": {
|
|
@@ -4385,7 +4345,10 @@
|
|
|
4385
4345
|
"type": "number",
|
|
4386
4346
|
"description": "Y"
|
|
4387
4347
|
}
|
|
4388
|
-
]
|
|
4348
|
+
],
|
|
4349
|
+
"items": false,
|
|
4350
|
+
"minItems": 2,
|
|
4351
|
+
"maxItems": 2
|
|
4389
4352
|
},
|
|
4390
4353
|
"maxProperties": 2
|
|
4391
4354
|
},
|
|
@@ -4407,7 +4370,8 @@
|
|
|
4407
4370
|
},
|
|
4408
4371
|
"additionalProperties": {
|
|
4409
4372
|
"$ref": "#/$defs/__schema1"
|
|
4410
|
-
}
|
|
4373
|
+
},
|
|
4374
|
+
"ref": "JsonSchemaProperties"
|
|
4411
4375
|
},
|
|
4412
4376
|
"__schema1": {
|
|
4413
4377
|
"type": "object",
|
|
@@ -4554,9 +4518,11 @@
|
|
|
4554
4518
|
}
|
|
4555
4519
|
}
|
|
4556
4520
|
},
|
|
4557
|
-
"additionalProperties": false
|
|
4521
|
+
"additionalProperties": false,
|
|
4522
|
+
"ref": "JsonSchema"
|
|
4558
4523
|
},
|
|
4559
4524
|
"__schema2": {
|
|
4525
|
+
"ref": "JsonValue",
|
|
4560
4526
|
"anyOf": [
|
|
4561
4527
|
{
|
|
4562
4528
|
"type": "string"
|
|
@@ -4586,68 +4552,6 @@
|
|
|
4586
4552
|
}
|
|
4587
4553
|
}
|
|
4588
4554
|
]
|
|
4589
|
-
},
|
|
4590
|
-
"__schema3": {
|
|
4591
|
-
"anyOf": [
|
|
4592
|
-
{
|
|
4593
|
-
"type": "string"
|
|
4594
|
-
},
|
|
4595
|
-
{
|
|
4596
|
-
"type": "number"
|
|
4597
|
-
},
|
|
4598
|
-
{
|
|
4599
|
-
"type": "boolean"
|
|
4600
|
-
},
|
|
4601
|
-
{
|
|
4602
|
-
"type": "null"
|
|
4603
|
-
},
|
|
4604
|
-
{
|
|
4605
|
-
"type": "array",
|
|
4606
|
-
"items": {
|
|
4607
|
-
"$ref": "#/$defs/__schema3"
|
|
4608
|
-
}
|
|
4609
|
-
},
|
|
4610
|
-
{
|
|
4611
|
-
"type": "object",
|
|
4612
|
-
"propertyNames": {
|
|
4613
|
-
"type": "string"
|
|
4614
|
-
},
|
|
4615
|
-
"additionalProperties": {
|
|
4616
|
-
"$ref": "#/$defs/__schema3"
|
|
4617
|
-
}
|
|
4618
|
-
}
|
|
4619
|
-
]
|
|
4620
|
-
},
|
|
4621
|
-
"__schema4": {
|
|
4622
|
-
"anyOf": [
|
|
4623
|
-
{
|
|
4624
|
-
"type": "string"
|
|
4625
|
-
},
|
|
4626
|
-
{
|
|
4627
|
-
"type": "number"
|
|
4628
|
-
},
|
|
4629
|
-
{
|
|
4630
|
-
"type": "boolean"
|
|
4631
|
-
},
|
|
4632
|
-
{
|
|
4633
|
-
"type": "null"
|
|
4634
|
-
},
|
|
4635
|
-
{
|
|
4636
|
-
"type": "array",
|
|
4637
|
-
"items": {
|
|
4638
|
-
"$ref": "#/$defs/__schema4"
|
|
4639
|
-
}
|
|
4640
|
-
},
|
|
4641
|
-
{
|
|
4642
|
-
"type": "object",
|
|
4643
|
-
"propertyNames": {
|
|
4644
|
-
"type": "string"
|
|
4645
|
-
},
|
|
4646
|
-
"additionalProperties": {
|
|
4647
|
-
"$ref": "#/$defs/__schema4"
|
|
4648
|
-
}
|
|
4649
|
-
}
|
|
4650
|
-
]
|
|
4651
4555
|
}
|
|
4652
4556
|
}
|
|
4653
4557
|
}
|