@verbatra/sdk 0.11.0 → 0.12.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.
@@ -0,0 +1,926 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://verbatra.kreitz-webdev.de/schema/v1/run-summary.json",
4
+ "title": "verbatra run summary",
5
+ "type": "object",
6
+ "properties": {
7
+ "dryRun": {
8
+ "type": "boolean"
9
+ },
10
+ "locales": {
11
+ "type": "array",
12
+ "items": {
13
+ "type": "object",
14
+ "properties": {
15
+ "locale": {
16
+ "type": "string"
17
+ },
18
+ "status": {
19
+ "type": "string",
20
+ "enum": [
21
+ "succeeded",
22
+ "partial",
23
+ "failed"
24
+ ]
25
+ },
26
+ "translated": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "string"
30
+ }
31
+ },
32
+ "unchanged": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "string"
36
+ }
37
+ },
38
+ "orphaned": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string"
42
+ }
43
+ },
44
+ "pruned": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "string"
48
+ }
49
+ },
50
+ "invalidIcuSource": {
51
+ "type": "array",
52
+ "items": {
53
+ "type": "string"
54
+ }
55
+ },
56
+ "emptySource": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "string"
60
+ }
61
+ },
62
+ "cacheHits": {
63
+ "type": "array",
64
+ "items": {
65
+ "type": "string"
66
+ }
67
+ },
68
+ "fuzzyHits": {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "object",
72
+ "properties": {
73
+ "key": {
74
+ "type": "string"
75
+ },
76
+ "previousSource": {
77
+ "type": "string"
78
+ },
79
+ "similarity": {
80
+ "type": "number"
81
+ }
82
+ },
83
+ "required": [
84
+ "key",
85
+ "previousSource",
86
+ "similarity"
87
+ ]
88
+ }
89
+ },
90
+ "integrityMismatches": {
91
+ "type": "array",
92
+ "items": {
93
+ "type": "string"
94
+ }
95
+ },
96
+ "integrityRefusals": {
97
+ "type": "array",
98
+ "items": {
99
+ "type": "object",
100
+ "properties": {
101
+ "key": {
102
+ "type": "string"
103
+ },
104
+ "reason": {
105
+ "type": "string",
106
+ "enum": [
107
+ "placeholder",
108
+ "markup",
109
+ "icu",
110
+ "degenerate",
111
+ "empty"
112
+ ]
113
+ },
114
+ "details": {
115
+ "type": "array",
116
+ "items": {
117
+ "type": "string"
118
+ }
119
+ }
120
+ },
121
+ "required": [
122
+ "key",
123
+ "reason"
124
+ ]
125
+ }
126
+ },
127
+ "providerFailures": {
128
+ "type": "array",
129
+ "items": {
130
+ "type": "string"
131
+ }
132
+ },
133
+ "generated": {
134
+ "type": "array",
135
+ "items": {
136
+ "type": "string"
137
+ }
138
+ },
139
+ "budgetWithheld": {
140
+ "type": "array",
141
+ "items": {
142
+ "type": "string"
143
+ }
144
+ },
145
+ "sensitiveWithheld": {
146
+ "type": "array",
147
+ "items": {
148
+ "type": "string"
149
+ }
150
+ },
151
+ "usage": {
152
+ "type": "object",
153
+ "properties": {
154
+ "inputTokens": {
155
+ "type": "number"
156
+ },
157
+ "outputTokens": {
158
+ "type": "number"
159
+ }
160
+ },
161
+ "required": [
162
+ "inputTokens",
163
+ "outputTokens"
164
+ ]
165
+ },
166
+ "notices": {
167
+ "type": "array",
168
+ "items": {
169
+ "anyOf": [
170
+ {
171
+ "type": "object",
172
+ "properties": {
173
+ "code": {
174
+ "type": "string",
175
+ "enum": [
176
+ "FORMALITY_DOWNGRADED",
177
+ "GLOSSARY_IGNORED",
178
+ "PLACEHOLDER_UNSUPPORTED"
179
+ ]
180
+ },
181
+ "message": {
182
+ "type": "string"
183
+ }
184
+ },
185
+ "required": [
186
+ "code",
187
+ "message"
188
+ ]
189
+ },
190
+ {
191
+ "type": "object",
192
+ "properties": {
193
+ "code": {
194
+ "type": "string",
195
+ "enum": [
196
+ "PLURAL_CATEGORIES_INCOMPLETE",
197
+ "SUB_BATCH_FAILED",
198
+ "BLANK_ROW_BASELINE_RETAINED",
199
+ "HANDOFF_REVIEWS_RECORDED",
200
+ "BUDGET_TOKENS_EXCEEDED",
201
+ "CACHE_VERSION_UNRECOGNIZED",
202
+ "PROVENANCE_VERSION_UNRECOGNIZED",
203
+ "PROVENANCE_FILE_TOO_LARGE",
204
+ "LOCALE_STATE_CARRIED_OVER",
205
+ "LOCALE_STATE_CARRY_OVER_SKIPPED",
206
+ "LOCALE_UNVERIFIED_BY_PROVIDER",
207
+ "LOCALE_NOT_WELL_TESTED",
208
+ "GLOSSARY_UNSUPPORTED_BY_PROVIDER",
209
+ "FORMALITY_UNSUPPORTED_BY_PROVIDER",
210
+ "SOURCE_FOREIGN_PLACEHOLDERS",
211
+ "SOURCE_VALUE_EMPTY",
212
+ "SENSITIVE_CONTENT_SENT",
213
+ "SENSITIVE_CONTENT_REDACTED",
214
+ "SENSITIVE_CONTENT_WITHHELD",
215
+ "RUN_CANCELLED"
216
+ ]
217
+ },
218
+ "message": {
219
+ "type": "string"
220
+ },
221
+ "causeCode": {
222
+ "type": "string",
223
+ "enum": [
224
+ "MISSING_API_KEY",
225
+ "INVALID_REQUEST",
226
+ "INVALID_RESPONSE",
227
+ "OUTPUT_TRUNCATED",
228
+ "PROVIDER_REFUSED",
229
+ "PROVIDER_BLOCKED",
230
+ "RATE_LIMITED",
231
+ "TIMEOUT",
232
+ "AUTH_FAILED",
233
+ "PROVIDER_UNAVAILABLE",
234
+ "NETWORK_POLICY_VIOLATION",
235
+ "PROVIDER_ERROR"
236
+ ]
237
+ }
238
+ },
239
+ "required": [
240
+ "code",
241
+ "message"
242
+ ]
243
+ }
244
+ ]
245
+ }
246
+ },
247
+ "needsReview": {
248
+ "type": "array",
249
+ "items": {
250
+ "type": "object",
251
+ "properties": {
252
+ "key": {
253
+ "type": "string"
254
+ },
255
+ "reasons": {
256
+ "type": "array",
257
+ "items": {
258
+ "type": "string",
259
+ "enum": [
260
+ "LENGTH_RATIO_OUTLIER",
261
+ "MAX_LENGTH_EXCEEDED",
262
+ "EQUALS_SOURCE",
263
+ "GLOSSARY_TERM_MISSED",
264
+ "GLOSSARY_FORBIDDEN_TERM",
265
+ "INTEGRITY_REORDERED",
266
+ "PROVIDER_DEGRADED",
267
+ "FUZZY_CACHE_REUSE",
268
+ "FOREIGN_PLACEHOLDER_CHANGED",
269
+ "BIDI_CONTROLS_CHANGED"
270
+ ]
271
+ }
272
+ }
273
+ },
274
+ "required": [
275
+ "key",
276
+ "reasons"
277
+ ]
278
+ }
279
+ },
280
+ "unfilled": {
281
+ "type": "array",
282
+ "items": {
283
+ "type": "string"
284
+ }
285
+ },
286
+ "protected": {
287
+ "type": "array",
288
+ "items": {
289
+ "type": "object",
290
+ "properties": {
291
+ "key": {
292
+ "type": "string"
293
+ },
294
+ "reason": {
295
+ "type": "string",
296
+ "enum": [
297
+ "human",
298
+ "import",
299
+ "external",
300
+ "pinned"
301
+ ]
302
+ },
303
+ "suggestion": {
304
+ "type": "string"
305
+ },
306
+ "suggestionStatus": {
307
+ "type": "string",
308
+ "enum": [
309
+ "planned",
310
+ "suggested",
311
+ "integrity-mismatch",
312
+ "provider-failure",
313
+ "budget-withheld",
314
+ "sensitive-withheld"
315
+ ]
316
+ }
317
+ },
318
+ "required": [
319
+ "key",
320
+ "reason"
321
+ ]
322
+ }
323
+ },
324
+ "malformedRows": {
325
+ "type": "array",
326
+ "items": {
327
+ "type": "object",
328
+ "properties": {
329
+ "row": {
330
+ "type": "number"
331
+ },
332
+ "line": {
333
+ "type": "number"
334
+ },
335
+ "column": {
336
+ "type": "string"
337
+ }
338
+ },
339
+ "required": [
340
+ "row",
341
+ "column"
342
+ ]
343
+ }
344
+ },
345
+ "duplicateKeys": {
346
+ "type": "array",
347
+ "items": {
348
+ "type": "object",
349
+ "properties": {
350
+ "key": {
351
+ "type": "string"
352
+ },
353
+ "row": {
354
+ "type": "number"
355
+ },
356
+ "line": {
357
+ "type": "number"
358
+ }
359
+ },
360
+ "required": [
361
+ "key",
362
+ "row"
363
+ ]
364
+ }
365
+ },
366
+ "error": {
367
+ "type": "object",
368
+ "properties": {
369
+ "code": {
370
+ "type": "string"
371
+ },
372
+ "message": {
373
+ "type": "string"
374
+ }
375
+ },
376
+ "required": [
377
+ "code",
378
+ "message"
379
+ ]
380
+ }
381
+ },
382
+ "required": [
383
+ "locale",
384
+ "status",
385
+ "translated",
386
+ "unchanged",
387
+ "orphaned",
388
+ "pruned",
389
+ "invalidIcuSource",
390
+ "cacheHits",
391
+ "fuzzyHits",
392
+ "integrityMismatches",
393
+ "providerFailures",
394
+ "generated",
395
+ "budgetWithheld",
396
+ "sensitiveWithheld",
397
+ "notices",
398
+ "needsReview",
399
+ "unfilled",
400
+ "protected",
401
+ "malformedRows",
402
+ "duplicateKeys"
403
+ ]
404
+ }
405
+ },
406
+ "succeeded": {
407
+ "type": "array",
408
+ "items": {
409
+ "type": "string"
410
+ }
411
+ },
412
+ "partial": {
413
+ "type": "array",
414
+ "items": {
415
+ "type": "string"
416
+ }
417
+ },
418
+ "failed": {
419
+ "type": "array",
420
+ "items": {
421
+ "type": "string"
422
+ }
423
+ },
424
+ "usage": {
425
+ "type": "object",
426
+ "properties": {
427
+ "inputTokens": {
428
+ "type": "number"
429
+ },
430
+ "outputTokens": {
431
+ "type": "number"
432
+ }
433
+ },
434
+ "required": [
435
+ "inputTokens",
436
+ "outputTokens"
437
+ ]
438
+ },
439
+ "budget": {
440
+ "type": "object",
441
+ "properties": {
442
+ "maxTokens": {
443
+ "type": "number"
444
+ },
445
+ "behavior": {
446
+ "type": "string",
447
+ "enum": [
448
+ "warn",
449
+ "stop"
450
+ ]
451
+ },
452
+ "supported": {
453
+ "type": "boolean"
454
+ },
455
+ "tokensUsed": {
456
+ "type": "number"
457
+ },
458
+ "exceeded": {
459
+ "type": "boolean"
460
+ }
461
+ },
462
+ "required": [
463
+ "maxTokens",
464
+ "behavior",
465
+ "supported",
466
+ "tokensUsed",
467
+ "exceeded"
468
+ ]
469
+ },
470
+ "estimate": {
471
+ "anyOf": [
472
+ {
473
+ "type": "object",
474
+ "properties": {
475
+ "provider": {
476
+ "type": "string",
477
+ "enum": [
478
+ "anthropic",
479
+ "openai",
480
+ "gemini",
481
+ "deepl",
482
+ "google-translate",
483
+ "openai-compatible",
484
+ "opencode",
485
+ "libretranslate",
486
+ "none"
487
+ ]
488
+ },
489
+ "model": {
490
+ "type": "string"
491
+ },
492
+ "rateKey": {
493
+ "type": "string"
494
+ },
495
+ "keys": {
496
+ "type": "number"
497
+ },
498
+ "requests": {
499
+ "type": "number"
500
+ },
501
+ "caveats": {
502
+ "type": "array",
503
+ "items": {
504
+ "type": "string",
505
+ "enum": [
506
+ "CACHE_NOT_CONSULTED",
507
+ "SOURCE_DUPLICATES_NOT_DEDUPLICATED",
508
+ "TRANSPORT_RETRIES_NOT_COUNTED",
509
+ "TRANSLATION_LENGTH_IS_ESTIMATED",
510
+ "TOKEN_COUNT_IS_HEURISTIC",
511
+ "REPAIR_REQUESTS_NOT_COUNTED"
512
+ ]
513
+ }
514
+ },
515
+ "unit": {
516
+ "type": "string",
517
+ "const": "tokens"
518
+ },
519
+ "inputTokens": {
520
+ "type": "number"
521
+ },
522
+ "outputTokens": {
523
+ "type": "number"
524
+ },
525
+ "pricing": {
526
+ "type": "string",
527
+ "const": "priced"
528
+ },
529
+ "currency": {
530
+ "type": "string"
531
+ },
532
+ "asOf": {
533
+ "type": "string"
534
+ },
535
+ "locales": {
536
+ "type": "array",
537
+ "items": {
538
+ "type": "object",
539
+ "properties": {
540
+ "locale": {
541
+ "type": "string"
542
+ },
543
+ "keys": {
544
+ "type": "number"
545
+ },
546
+ "requests": {
547
+ "type": "number"
548
+ },
549
+ "inputTokens": {
550
+ "type": "number"
551
+ },
552
+ "outputTokens": {
553
+ "type": "number"
554
+ },
555
+ "sourceCharacters": {
556
+ "type": "number"
557
+ },
558
+ "cost": {
559
+ "type": "number"
560
+ }
561
+ },
562
+ "required": [
563
+ "locale",
564
+ "keys",
565
+ "requests",
566
+ "cost"
567
+ ]
568
+ }
569
+ },
570
+ "cost": {
571
+ "type": "number"
572
+ }
573
+ },
574
+ "required": [
575
+ "provider",
576
+ "rateKey",
577
+ "keys",
578
+ "requests",
579
+ "caveats",
580
+ "unit",
581
+ "inputTokens",
582
+ "outputTokens",
583
+ "pricing",
584
+ "currency",
585
+ "asOf",
586
+ "locales",
587
+ "cost"
588
+ ]
589
+ },
590
+ {
591
+ "type": "object",
592
+ "properties": {
593
+ "provider": {
594
+ "type": "string",
595
+ "enum": [
596
+ "anthropic",
597
+ "openai",
598
+ "gemini",
599
+ "deepl",
600
+ "google-translate",
601
+ "openai-compatible",
602
+ "opencode",
603
+ "libretranslate",
604
+ "none"
605
+ ]
606
+ },
607
+ "model": {
608
+ "type": "string"
609
+ },
610
+ "rateKey": {
611
+ "type": "string"
612
+ },
613
+ "keys": {
614
+ "type": "number"
615
+ },
616
+ "requests": {
617
+ "type": "number"
618
+ },
619
+ "caveats": {
620
+ "type": "array",
621
+ "items": {
622
+ "type": "string",
623
+ "enum": [
624
+ "CACHE_NOT_CONSULTED",
625
+ "SOURCE_DUPLICATES_NOT_DEDUPLICATED",
626
+ "TRANSPORT_RETRIES_NOT_COUNTED",
627
+ "TRANSLATION_LENGTH_IS_ESTIMATED",
628
+ "TOKEN_COUNT_IS_HEURISTIC",
629
+ "REPAIR_REQUESTS_NOT_COUNTED"
630
+ ]
631
+ }
632
+ },
633
+ "unit": {
634
+ "type": "string",
635
+ "const": "characters"
636
+ },
637
+ "sourceCharacters": {
638
+ "type": "number"
639
+ },
640
+ "pricing": {
641
+ "type": "string",
642
+ "const": "priced"
643
+ },
644
+ "currency": {
645
+ "type": "string"
646
+ },
647
+ "asOf": {
648
+ "type": "string"
649
+ },
650
+ "locales": {
651
+ "type": "array",
652
+ "items": {
653
+ "type": "object",
654
+ "properties": {
655
+ "locale": {
656
+ "type": "string"
657
+ },
658
+ "keys": {
659
+ "type": "number"
660
+ },
661
+ "requests": {
662
+ "type": "number"
663
+ },
664
+ "inputTokens": {
665
+ "type": "number"
666
+ },
667
+ "outputTokens": {
668
+ "type": "number"
669
+ },
670
+ "sourceCharacters": {
671
+ "type": "number"
672
+ },
673
+ "cost": {
674
+ "type": "number"
675
+ }
676
+ },
677
+ "required": [
678
+ "locale",
679
+ "keys",
680
+ "requests",
681
+ "cost"
682
+ ]
683
+ }
684
+ },
685
+ "cost": {
686
+ "type": "number"
687
+ }
688
+ },
689
+ "required": [
690
+ "provider",
691
+ "rateKey",
692
+ "keys",
693
+ "requests",
694
+ "caveats",
695
+ "unit",
696
+ "sourceCharacters",
697
+ "pricing",
698
+ "currency",
699
+ "asOf",
700
+ "locales",
701
+ "cost"
702
+ ]
703
+ },
704
+ {
705
+ "type": "object",
706
+ "properties": {
707
+ "provider": {
708
+ "type": "string",
709
+ "enum": [
710
+ "anthropic",
711
+ "openai",
712
+ "gemini",
713
+ "deepl",
714
+ "google-translate",
715
+ "openai-compatible",
716
+ "opencode",
717
+ "libretranslate",
718
+ "none"
719
+ ]
720
+ },
721
+ "model": {
722
+ "type": "string"
723
+ },
724
+ "rateKey": {
725
+ "type": "string"
726
+ },
727
+ "keys": {
728
+ "type": "number"
729
+ },
730
+ "requests": {
731
+ "type": "number"
732
+ },
733
+ "caveats": {
734
+ "type": "array",
735
+ "items": {
736
+ "type": "string",
737
+ "enum": [
738
+ "CACHE_NOT_CONSULTED",
739
+ "SOURCE_DUPLICATES_NOT_DEDUPLICATED",
740
+ "TRANSPORT_RETRIES_NOT_COUNTED",
741
+ "TRANSLATION_LENGTH_IS_ESTIMATED",
742
+ "TOKEN_COUNT_IS_HEURISTIC",
743
+ "REPAIR_REQUESTS_NOT_COUNTED"
744
+ ]
745
+ }
746
+ },
747
+ "unit": {
748
+ "type": "string",
749
+ "const": "tokens"
750
+ },
751
+ "inputTokens": {
752
+ "type": "number"
753
+ },
754
+ "outputTokens": {
755
+ "type": "number"
756
+ },
757
+ "pricing": {
758
+ "type": "string",
759
+ "enum": [
760
+ "no-rate-on-file",
761
+ "rate-unit-mismatch",
762
+ "not-billed"
763
+ ]
764
+ },
765
+ "locales": {
766
+ "type": "array",
767
+ "items": {
768
+ "type": "object",
769
+ "properties": {
770
+ "locale": {
771
+ "type": "string"
772
+ },
773
+ "keys": {
774
+ "type": "number"
775
+ },
776
+ "requests": {
777
+ "type": "number"
778
+ },
779
+ "inputTokens": {
780
+ "type": "number"
781
+ },
782
+ "outputTokens": {
783
+ "type": "number"
784
+ },
785
+ "sourceCharacters": {
786
+ "type": "number"
787
+ }
788
+ },
789
+ "required": [
790
+ "locale",
791
+ "keys",
792
+ "requests"
793
+ ]
794
+ }
795
+ }
796
+ },
797
+ "required": [
798
+ "provider",
799
+ "rateKey",
800
+ "keys",
801
+ "requests",
802
+ "caveats",
803
+ "unit",
804
+ "inputTokens",
805
+ "outputTokens",
806
+ "pricing",
807
+ "locales"
808
+ ]
809
+ },
810
+ {
811
+ "type": "object",
812
+ "properties": {
813
+ "provider": {
814
+ "type": "string",
815
+ "enum": [
816
+ "anthropic",
817
+ "openai",
818
+ "gemini",
819
+ "deepl",
820
+ "google-translate",
821
+ "openai-compatible",
822
+ "opencode",
823
+ "libretranslate",
824
+ "none"
825
+ ]
826
+ },
827
+ "model": {
828
+ "type": "string"
829
+ },
830
+ "rateKey": {
831
+ "type": "string"
832
+ },
833
+ "keys": {
834
+ "type": "number"
835
+ },
836
+ "requests": {
837
+ "type": "number"
838
+ },
839
+ "caveats": {
840
+ "type": "array",
841
+ "items": {
842
+ "type": "string",
843
+ "enum": [
844
+ "CACHE_NOT_CONSULTED",
845
+ "SOURCE_DUPLICATES_NOT_DEDUPLICATED",
846
+ "TRANSPORT_RETRIES_NOT_COUNTED",
847
+ "TRANSLATION_LENGTH_IS_ESTIMATED",
848
+ "TOKEN_COUNT_IS_HEURISTIC",
849
+ "REPAIR_REQUESTS_NOT_COUNTED"
850
+ ]
851
+ }
852
+ },
853
+ "unit": {
854
+ "type": "string",
855
+ "const": "characters"
856
+ },
857
+ "sourceCharacters": {
858
+ "type": "number"
859
+ },
860
+ "pricing": {
861
+ "type": "string",
862
+ "enum": [
863
+ "no-rate-on-file",
864
+ "rate-unit-mismatch",
865
+ "not-billed"
866
+ ]
867
+ },
868
+ "locales": {
869
+ "type": "array",
870
+ "items": {
871
+ "type": "object",
872
+ "properties": {
873
+ "locale": {
874
+ "type": "string"
875
+ },
876
+ "keys": {
877
+ "type": "number"
878
+ },
879
+ "requests": {
880
+ "type": "number"
881
+ },
882
+ "inputTokens": {
883
+ "type": "number"
884
+ },
885
+ "outputTokens": {
886
+ "type": "number"
887
+ },
888
+ "sourceCharacters": {
889
+ "type": "number"
890
+ }
891
+ },
892
+ "required": [
893
+ "locale",
894
+ "keys",
895
+ "requests"
896
+ ]
897
+ }
898
+ }
899
+ },
900
+ "required": [
901
+ "provider",
902
+ "rateKey",
903
+ "keys",
904
+ "requests",
905
+ "caveats",
906
+ "unit",
907
+ "sourceCharacters",
908
+ "pricing",
909
+ "locales"
910
+ ]
911
+ }
912
+ ]
913
+ },
914
+ "cancelled": {
915
+ "type": "boolean",
916
+ "const": true
917
+ }
918
+ },
919
+ "required": [
920
+ "dryRun",
921
+ "locales",
922
+ "succeeded",
923
+ "partial",
924
+ "failed"
925
+ ]
926
+ }