flavor-code 1.4.0-beta.1 → 1.4.0-beta.11

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.
Files changed (169) hide show
  1. package/README.md +2 -0
  2. package/README.zh-CN.md +2 -0
  3. package/dist/agent/loop.d.ts +7 -2
  4. package/dist/{app-C5ZQUOKJ.js → app-PXXQOEWP.js} +312 -40
  5. package/dist/{chunk-ODRWR4KK.js → chunk-26T23AKR.js} +180 -14253
  6. package/dist/{chunk-6MNOZ2TX.js → chunk-BYHO2CA5.js} +1925 -765
  7. package/dist/{chunk-URUVFECH.js → chunk-EXOSMO57.js} +12 -7
  8. package/dist/chunk-N5MXHJKD.js +107 -0
  9. package/dist/{chunk-2BF7CVWZ.js → chunk-RAYH6K2H.js} +2 -2
  10. package/dist/{chunk-FOTMP4ZS.js → chunk-UO4DLWU5.js} +8 -2
  11. package/dist/{chunk-3WCDZ6ZL.js → chunk-ZJCAQXA7.js} +2 -1
  12. package/dist/{claude-ink-LP32NSX5.js → claude-ink-C24UQAL7.js} +2 -2
  13. package/dist/cli-main.js +56 -25
  14. package/dist/cli.js +54 -10
  15. package/dist/config/schema.d.ts +8 -0
  16. package/dist/context/manager.d.ts +9 -0
  17. package/dist/desktop/main.js +2318 -1071
  18. package/dist/desktop-renderer/assets/index-RNe5Gtum.js +154 -0
  19. package/dist/desktop-renderer/assets/{interactive-terminal-C4o7MNPO.js → interactive-terminal-DestMQ2z.js} +1 -1
  20. package/dist/desktop-renderer/index.html +1 -1
  21. package/dist/git/service.d.ts +3 -3
  22. package/dist/git/tools.d.ts +1 -1
  23. package/dist/goal/classifier.d.ts +2 -0
  24. package/dist/goal/orchestrator.d.ts +23 -2
  25. package/dist/goal/planner.d.ts +2 -0
  26. package/dist/goal/store.d.ts +2 -0
  27. package/dist/goal/types.d.ts +14 -0
  28. package/dist/harness/journal.d.ts +2 -0
  29. package/dist/harness/local.d.ts +2 -0
  30. package/dist/init/project.d.ts +0 -6
  31. package/dist/jobs/registry.d.ts +7 -1
  32. package/dist/{load-V2UIYYQI.js → load-EW56Q2MM.js} +1 -1
  33. package/dist/loop/orchestrator.d.ts +20 -0
  34. package/dist/loop/types.d.ts +7 -0
  35. package/dist/loop/verifier.d.ts +2 -0
  36. package/dist/models/openai.d.ts +1 -1
  37. package/dist/models/structured.d.ts +7 -0
  38. package/dist/models/types.d.ts +1 -1
  39. package/dist/production.d.ts +17 -0
  40. package/dist/sdk/index.js +5 -5
  41. package/dist/session/tree.d.ts +2 -0
  42. package/dist/tools/lsp.d.ts +15 -10
  43. package/dist/tools/runtime.d.ts +2 -1
  44. package/dist/tools/search.d.ts +1 -0
  45. package/dist/tools/types.d.ts +1 -1
  46. package/dist/ui/session.d.ts +11 -0
  47. package/dist/ui/transcript.d.ts +9 -0
  48. package/dist/utils/abort.d.ts +20 -0
  49. package/dist/utils/execFileNoThrow.d.ts +1 -0
  50. package/dist/utils/heap.d.ts +58 -0
  51. package/dist/utils/memory-restart.d.ts +42 -3
  52. package/dist/utils/process-tree.d.ts +2 -0
  53. package/dist/utils/rotation-census.d.ts +36 -0
  54. package/package.json +3 -2
  55. package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +7 -7
  56. package/dist/astgraph/db.mjs +0 -237
  57. package/dist/astgraph/extract.mjs +0 -239
  58. package/dist/astgraph/flavor-plugin.json +0 -25
  59. package/dist/astgraph/grammars.mjs +0 -68
  60. package/dist/astgraph/index.js +0 -301
  61. package/dist/astgraph/indexer.mjs +0 -175
  62. package/dist/astgraph/query.mjs +0 -165
  63. package/dist/astgraph/resolve.mjs +0 -93
  64. package/dist/astgraph/vendor/tree-sitter-javascript.wasm +0 -0
  65. package/dist/astgraph/vendor/tree-sitter-tsx.wasm +0 -0
  66. package/dist/astgraph/vendor/tree-sitter-typescript.wasm +0 -0
  67. package/dist/astgraph/vendor/tree-sitter.js +0 -3980
  68. package/dist/astgraph/vendor/tree-sitter.wasm +0 -0
  69. package/dist/astgraph/vendor/zod/LICENSE +0 -21
  70. package/dist/astgraph/vendor/zod/index.js +0 -4
  71. package/dist/astgraph/vendor/zod/locales/index.js +0 -1
  72. package/dist/astgraph/vendor/zod/locales/package.json +0 -7
  73. package/dist/astgraph/vendor/zod/package.json +0 -135
  74. package/dist/astgraph/vendor/zod/v4/classic/checks.js +0 -1
  75. package/dist/astgraph/vendor/zod/v4/classic/coerce.js +0 -17
  76. package/dist/astgraph/vendor/zod/v4/classic/compat.js +0 -31
  77. package/dist/astgraph/vendor/zod/v4/classic/errors.js +0 -48
  78. package/dist/astgraph/vendor/zod/v4/classic/external.js +0 -20
  79. package/dist/astgraph/vendor/zod/v4/classic/from-json-schema.js +0 -599
  80. package/dist/astgraph/vendor/zod/v4/classic/index.js +0 -4
  81. package/dist/astgraph/vendor/zod/v4/classic/iso.js +0 -30
  82. package/dist/astgraph/vendor/zod/v4/classic/package.json +0 -7
  83. package/dist/astgraph/vendor/zod/v4/classic/parse.js +0 -15
  84. package/dist/astgraph/vendor/zod/v4/classic/schemas.js +0 -1395
  85. package/dist/astgraph/vendor/zod/v4/core/api.js +0 -1087
  86. package/dist/astgraph/vendor/zod/v4/core/checks.js +0 -575
  87. package/dist/astgraph/vendor/zod/v4/core/core.js +0 -78
  88. package/dist/astgraph/vendor/zod/v4/core/doc.js +0 -35
  89. package/dist/astgraph/vendor/zod/v4/core/errors.js +0 -185
  90. package/dist/astgraph/vendor/zod/v4/core/index.js +0 -16
  91. package/dist/astgraph/vendor/zod/v4/core/json-schema-generator.js +0 -95
  92. package/dist/astgraph/vendor/zod/v4/core/json-schema-processors.js +0 -601
  93. package/dist/astgraph/vendor/zod/v4/core/json-schema.js +0 -1
  94. package/dist/astgraph/vendor/zod/v4/core/package.json +0 -7
  95. package/dist/astgraph/vendor/zod/v4/core/parse.js +0 -93
  96. package/dist/astgraph/vendor/zod/v4/core/regexes.js +0 -139
  97. package/dist/astgraph/vendor/zod/v4/core/registries.js +0 -51
  98. package/dist/astgraph/vendor/zod/v4/core/schemas.js +0 -2239
  99. package/dist/astgraph/vendor/zod/v4/core/standard-schema.js +0 -1
  100. package/dist/astgraph/vendor/zod/v4/core/to-json-schema.js +0 -448
  101. package/dist/astgraph/vendor/zod/v4/core/util.js +0 -674
  102. package/dist/astgraph/vendor/zod/v4/core/versions.js +0 -5
  103. package/dist/astgraph/vendor/zod/v4/index.js +0 -3
  104. package/dist/astgraph/vendor/zod/v4/locales/ar.js +0 -106
  105. package/dist/astgraph/vendor/zod/v4/locales/az.js +0 -105
  106. package/dist/astgraph/vendor/zod/v4/locales/be.js +0 -156
  107. package/dist/astgraph/vendor/zod/v4/locales/bg.js +0 -120
  108. package/dist/astgraph/vendor/zod/v4/locales/ca.js +0 -107
  109. package/dist/astgraph/vendor/zod/v4/locales/cs.js +0 -111
  110. package/dist/astgraph/vendor/zod/v4/locales/da.js +0 -115
  111. package/dist/astgraph/vendor/zod/v4/locales/de.js +0 -108
  112. package/dist/astgraph/vendor/zod/v4/locales/el.js +0 -109
  113. package/dist/astgraph/vendor/zod/v4/locales/en.js +0 -113
  114. package/dist/astgraph/vendor/zod/v4/locales/eo.js +0 -109
  115. package/dist/astgraph/vendor/zod/v4/locales/es.js +0 -132
  116. package/dist/astgraph/vendor/zod/v4/locales/fa.js +0 -114
  117. package/dist/astgraph/vendor/zod/v4/locales/fi.js +0 -112
  118. package/dist/astgraph/vendor/zod/v4/locales/fr-CA.js +0 -107
  119. package/dist/astgraph/vendor/zod/v4/locales/fr.js +0 -125
  120. package/dist/astgraph/vendor/zod/v4/locales/he.js +0 -214
  121. package/dist/astgraph/vendor/zod/v4/locales/hr.js +0 -122
  122. package/dist/astgraph/vendor/zod/v4/locales/hu.js +0 -108
  123. package/dist/astgraph/vendor/zod/v4/locales/hy.js +0 -147
  124. package/dist/astgraph/vendor/zod/v4/locales/id.js +0 -106
  125. package/dist/astgraph/vendor/zod/v4/locales/index.js +0 -52
  126. package/dist/astgraph/vendor/zod/v4/locales/is.js +0 -109
  127. package/dist/astgraph/vendor/zod/v4/locales/it.js +0 -108
  128. package/dist/astgraph/vendor/zod/v4/locales/ja.js +0 -107
  129. package/dist/astgraph/vendor/zod/v4/locales/ka.js +0 -112
  130. package/dist/astgraph/vendor/zod/v4/locales/kh.js +0 -5
  131. package/dist/astgraph/vendor/zod/v4/locales/km.js +0 -110
  132. package/dist/astgraph/vendor/zod/v4/locales/ko.js +0 -111
  133. package/dist/astgraph/vendor/zod/v4/locales/lt.js +0 -203
  134. package/dist/astgraph/vendor/zod/v4/locales/mk.js +0 -109
  135. package/dist/astgraph/vendor/zod/v4/locales/ms.js +0 -107
  136. package/dist/astgraph/vendor/zod/v4/locales/nl.js +0 -110
  137. package/dist/astgraph/vendor/zod/v4/locales/no.js +0 -108
  138. package/dist/astgraph/vendor/zod/v4/locales/ota.js +0 -109
  139. package/dist/astgraph/vendor/zod/v4/locales/package.json +0 -7
  140. package/dist/astgraph/vendor/zod/v4/locales/pl.js +0 -109
  141. package/dist/astgraph/vendor/zod/v4/locales/ps.js +0 -114
  142. package/dist/astgraph/vendor/zod/v4/locales/pt.js +0 -108
  143. package/dist/astgraph/vendor/zod/v4/locales/ro.js +0 -119
  144. package/dist/astgraph/vendor/zod/v4/locales/ru.js +0 -156
  145. package/dist/astgraph/vendor/zod/v4/locales/sl.js +0 -109
  146. package/dist/astgraph/vendor/zod/v4/locales/sv.js +0 -110
  147. package/dist/astgraph/vendor/zod/v4/locales/ta.js +0 -110
  148. package/dist/astgraph/vendor/zod/v4/locales/th.js +0 -110
  149. package/dist/astgraph/vendor/zod/v4/locales/tr.js +0 -105
  150. package/dist/astgraph/vendor/zod/v4/locales/ua.js +0 -5
  151. package/dist/astgraph/vendor/zod/v4/locales/uk.js +0 -108
  152. package/dist/astgraph/vendor/zod/v4/locales/ur.js +0 -110
  153. package/dist/astgraph/vendor/zod/v4/locales/uz.js +0 -110
  154. package/dist/astgraph/vendor/zod/v4/locales/vi.js +0 -108
  155. package/dist/astgraph/vendor/zod/v4/locales/yo.js +0 -107
  156. package/dist/astgraph/vendor/zod/v4/locales/zh-CN.js +0 -109
  157. package/dist/astgraph/vendor/zod/v4/locales/zh-TW.js +0 -107
  158. package/dist/astgraph/vendor/zod/v4/mini/checks.js +0 -1
  159. package/dist/astgraph/vendor/zod/v4/mini/coerce.js +0 -22
  160. package/dist/astgraph/vendor/zod/v4/mini/external.js +0 -14
  161. package/dist/astgraph/vendor/zod/v4/mini/index.js +0 -3
  162. package/dist/astgraph/vendor/zod/v4/mini/iso.js +0 -34
  163. package/dist/astgraph/vendor/zod/v4/mini/package.json +0 -7
  164. package/dist/astgraph/vendor/zod/v4/mini/parse.js +0 -1
  165. package/dist/astgraph/vendor/zod/v4/mini/schemas.js +0 -961
  166. package/dist/astgraph/vendor/zod/v4/package.json +0 -7
  167. package/dist/chunk-CIVPKHF4.js +0 -53
  168. package/dist/desktop-renderer/assets/index-CqRIr-hz.js +0 -154
  169. package/dist/devtools-4QTPKBKK.js +0 -2
@@ -1,119 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "caractere", verb: "să aibă" },
5
- file: { unit: "octeți", verb: "să aibă" },
6
- array: { unit: "elemente", verb: "să aibă" },
7
- set: { unit: "elemente", verb: "să aibă" },
8
- map: { unit: "intrări", verb: "să aibă" },
9
- };
10
- function getSizing(origin) {
11
- return Sizable[origin] ?? null;
12
- }
13
- const FormatDictionary = {
14
- regex: "intrare",
15
- email: "adresă de email",
16
- url: "URL",
17
- emoji: "emoji",
18
- uuid: "UUID",
19
- uuidv4: "UUIDv4",
20
- uuidv6: "UUIDv6",
21
- nanoid: "nanoid",
22
- guid: "GUID",
23
- cuid: "cuid",
24
- cuid2: "cuid2",
25
- ulid: "ULID",
26
- xid: "XID",
27
- ksuid: "KSUID",
28
- datetime: "dată și oră ISO",
29
- date: "dată ISO",
30
- time: "oră ISO",
31
- duration: "durată ISO",
32
- ipv4: "adresă IPv4",
33
- ipv6: "adresă IPv6",
34
- mac: "adresă MAC",
35
- cidrv4: "interval IPv4",
36
- cidrv6: "interval IPv6",
37
- base64: "șir codat base64",
38
- base64url: "șir codat base64url",
39
- json_string: "șir JSON",
40
- e164: "număr E.164",
41
- jwt: "JWT",
42
- template_literal: "intrare",
43
- };
44
- const TypeDictionary = {
45
- nan: "NaN",
46
- string: "șir",
47
- number: "număr",
48
- boolean: "boolean",
49
- function: "funcție",
50
- array: "matrice",
51
- object: "obiect",
52
- undefined: "nedefinit",
53
- symbol: "simbol",
54
- bigint: "număr mare",
55
- void: "void",
56
- never: "never",
57
- map: "hartă",
58
- set: "set",
59
- };
60
- return (issue) => {
61
- switch (issue.code) {
62
- case "invalid_type": {
63
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
64
- const receivedType = util.parsedType(issue.input);
65
- const received = TypeDictionary[receivedType] ?? receivedType;
66
- return `Intrare invalidă: așteptat ${expected}, primit ${received}`;
67
- }
68
- case "invalid_value":
69
- if (issue.values.length === 1)
70
- return `Intrare invalidă: așteptat ${util.stringifyPrimitive(issue.values[0])}`;
71
- return `Opțiune invalidă: așteptat una dintre ${util.joinValues(issue.values, "|")}`;
72
- case "too_big": {
73
- const adj = issue.inclusive ? "<=" : "<";
74
- const sizing = getSizing(issue.origin);
75
- if (sizing)
76
- return `Prea mare: așteptat ca ${issue.origin ?? "valoarea"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemente"}`;
77
- return `Prea mare: așteptat ca ${issue.origin ?? "valoarea"} să fie ${adj}${issue.maximum.toString()}`;
78
- }
79
- case "too_small": {
80
- const adj = issue.inclusive ? ">=" : ">";
81
- const sizing = getSizing(issue.origin);
82
- if (sizing) {
83
- return `Prea mic: așteptat ca ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
84
- }
85
- return `Prea mic: așteptat ca ${issue.origin} să fie ${adj}${issue.minimum.toString()}`;
86
- }
87
- case "invalid_format": {
88
- const _issue = issue;
89
- if (_issue.format === "starts_with") {
90
- return `Șir invalid: trebuie să înceapă cu "${_issue.prefix}"`;
91
- }
92
- if (_issue.format === "ends_with")
93
- return `Șir invalid: trebuie să se termine cu "${_issue.suffix}"`;
94
- if (_issue.format === "includes")
95
- return `Șir invalid: trebuie să includă "${_issue.includes}"`;
96
- if (_issue.format === "regex")
97
- return `Șir invalid: trebuie să se potrivească cu modelul ${_issue.pattern}`;
98
- return `Format invalid: ${FormatDictionary[_issue.format] ?? issue.format}`;
99
- }
100
- case "not_multiple_of":
101
- return `Număr invalid: trebuie să fie multiplu de ${issue.divisor}`;
102
- case "unrecognized_keys":
103
- return `Chei nerecunoscute: ${util.joinValues(issue.keys, ", ")}`;
104
- case "invalid_key":
105
- return `Cheie invalidă în ${issue.origin}`;
106
- case "invalid_union":
107
- return "Intrare invalidă";
108
- case "invalid_element":
109
- return `Valoare invalidă în ${issue.origin}`;
110
- default:
111
- return `Intrare invalidă`;
112
- }
113
- };
114
- };
115
- export default function () {
116
- return {
117
- localeError: error(),
118
- };
119
- }
@@ -1,156 +0,0 @@
1
- import * as util from "../core/util.js";
2
- function getRussianPlural(count, one, few, many) {
3
- const absCount = Math.abs(count);
4
- const lastDigit = absCount % 10;
5
- const lastTwoDigits = absCount % 100;
6
- if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
7
- return many;
8
- }
9
- if (lastDigit === 1) {
10
- return one;
11
- }
12
- if (lastDigit >= 2 && lastDigit <= 4) {
13
- return few;
14
- }
15
- return many;
16
- }
17
- const error = () => {
18
- const Sizable = {
19
- string: {
20
- unit: {
21
- one: "символ",
22
- few: "символа",
23
- many: "символов",
24
- },
25
- verb: "иметь",
26
- },
27
- file: {
28
- unit: {
29
- one: "байт",
30
- few: "байта",
31
- many: "байт",
32
- },
33
- verb: "иметь",
34
- },
35
- array: {
36
- unit: {
37
- one: "элемент",
38
- few: "элемента",
39
- many: "элементов",
40
- },
41
- verb: "иметь",
42
- },
43
- set: {
44
- unit: {
45
- one: "элемент",
46
- few: "элемента",
47
- many: "элементов",
48
- },
49
- verb: "иметь",
50
- },
51
- };
52
- function getSizing(origin) {
53
- return Sizable[origin] ?? null;
54
- }
55
- const FormatDictionary = {
56
- regex: "ввод",
57
- email: "email адрес",
58
- url: "URL",
59
- emoji: "эмодзи",
60
- uuid: "UUID",
61
- uuidv4: "UUIDv4",
62
- uuidv6: "UUIDv6",
63
- nanoid: "nanoid",
64
- guid: "GUID",
65
- cuid: "cuid",
66
- cuid2: "cuid2",
67
- ulid: "ULID",
68
- xid: "XID",
69
- ksuid: "KSUID",
70
- datetime: "ISO дата и время",
71
- date: "ISO дата",
72
- time: "ISO время",
73
- duration: "ISO длительность",
74
- ipv4: "IPv4 адрес",
75
- ipv6: "IPv6 адрес",
76
- cidrv4: "IPv4 диапазон",
77
- cidrv6: "IPv6 диапазон",
78
- base64: "строка в формате base64",
79
- base64url: "строка в формате base64url",
80
- json_string: "JSON строка",
81
- e164: "номер E.164",
82
- jwt: "JWT",
83
- template_literal: "ввод",
84
- };
85
- const TypeDictionary = {
86
- nan: "NaN",
87
- number: "число",
88
- array: "массив",
89
- };
90
- return (issue) => {
91
- switch (issue.code) {
92
- case "invalid_type": {
93
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
94
- const receivedType = util.parsedType(issue.input);
95
- const received = TypeDictionary[receivedType] ?? receivedType;
96
- if (/^[A-Z]/.test(issue.expected)) {
97
- return `Неверный ввод: ожидалось instanceof ${issue.expected}, получено ${received}`;
98
- }
99
- return `Неверный ввод: ожидалось ${expected}, получено ${received}`;
100
- }
101
- case "invalid_value":
102
- if (issue.values.length === 1)
103
- return `Неверный ввод: ожидалось ${util.stringifyPrimitive(issue.values[0])}`;
104
- return `Неверный вариант: ожидалось одно из ${util.joinValues(issue.values, "|")}`;
105
- case "too_big": {
106
- const adj = issue.inclusive ? "<=" : "<";
107
- const sizing = getSizing(issue.origin);
108
- if (sizing) {
109
- const maxValue = Number(issue.maximum);
110
- const unit = getRussianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
111
- return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет иметь ${adj}${issue.maximum.toString()} ${unit}`;
112
- }
113
- return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет ${adj}${issue.maximum.toString()}`;
114
- }
115
- case "too_small": {
116
- const adj = issue.inclusive ? ">=" : ">";
117
- const sizing = getSizing(issue.origin);
118
- if (sizing) {
119
- const minValue = Number(issue.minimum);
120
- const unit = getRussianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
121
- return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет иметь ${adj}${issue.minimum.toString()} ${unit}`;
122
- }
123
- return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет ${adj}${issue.minimum.toString()}`;
124
- }
125
- case "invalid_format": {
126
- const _issue = issue;
127
- if (_issue.format === "starts_with")
128
- return `Неверная строка: должна начинаться с "${_issue.prefix}"`;
129
- if (_issue.format === "ends_with")
130
- return `Неверная строка: должна заканчиваться на "${_issue.suffix}"`;
131
- if (_issue.format === "includes")
132
- return `Неверная строка: должна содержать "${_issue.includes}"`;
133
- if (_issue.format === "regex")
134
- return `Неверная строка: должна соответствовать шаблону ${_issue.pattern}`;
135
- return `Неверный ${FormatDictionary[_issue.format] ?? issue.format}`;
136
- }
137
- case "not_multiple_of":
138
- return `Неверное число: должно быть кратным ${issue.divisor}`;
139
- case "unrecognized_keys":
140
- return `Нераспознанн${issue.keys.length > 1 ? "ые" : "ый"} ключ${issue.keys.length > 1 ? "и" : ""}: ${util.joinValues(issue.keys, ", ")}`;
141
- case "invalid_key":
142
- return `Неверный ключ в ${issue.origin}`;
143
- case "invalid_union":
144
- return "Неверные входные данные";
145
- case "invalid_element":
146
- return `Неверное значение в ${issue.origin}`;
147
- default:
148
- return `Неверные входные данные`;
149
- }
150
- };
151
- };
152
- export default function () {
153
- return {
154
- localeError: error(),
155
- };
156
- }
@@ -1,109 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "znakov", verb: "imeti" },
5
- file: { unit: "bajtov", verb: "imeti" },
6
- array: { unit: "elementov", verb: "imeti" },
7
- set: { unit: "elementov", verb: "imeti" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "vnos",
14
- email: "e-poštni naslov",
15
- url: "URL",
16
- emoji: "emoji",
17
- uuid: "UUID",
18
- uuidv4: "UUIDv4",
19
- uuidv6: "UUIDv6",
20
- nanoid: "nanoid",
21
- guid: "GUID",
22
- cuid: "cuid",
23
- cuid2: "cuid2",
24
- ulid: "ULID",
25
- xid: "XID",
26
- ksuid: "KSUID",
27
- datetime: "ISO datum in čas",
28
- date: "ISO datum",
29
- time: "ISO čas",
30
- duration: "ISO trajanje",
31
- ipv4: "IPv4 naslov",
32
- ipv6: "IPv6 naslov",
33
- cidrv4: "obseg IPv4",
34
- cidrv6: "obseg IPv6",
35
- base64: "base64 kodiran niz",
36
- base64url: "base64url kodiran niz",
37
- json_string: "JSON niz",
38
- e164: "E.164 številka",
39
- jwt: "JWT",
40
- template_literal: "vnos",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- number: "število",
45
- array: "tabela",
46
- };
47
- return (issue) => {
48
- switch (issue.code) {
49
- case "invalid_type": {
50
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
51
- const receivedType = util.parsedType(issue.input);
52
- const received = TypeDictionary[receivedType] ?? receivedType;
53
- if (/^[A-Z]/.test(issue.expected)) {
54
- return `Neveljaven vnos: pričakovano instanceof ${issue.expected}, prejeto ${received}`;
55
- }
56
- return `Neveljaven vnos: pričakovano ${expected}, prejeto ${received}`;
57
- }
58
- case "invalid_value":
59
- if (issue.values.length === 1)
60
- return `Neveljaven vnos: pričakovano ${util.stringifyPrimitive(issue.values[0])}`;
61
- return `Neveljavna možnost: pričakovano eno izmed ${util.joinValues(issue.values, "|")}`;
62
- case "too_big": {
63
- const adj = issue.inclusive ? "<=" : "<";
64
- const sizing = getSizing(issue.origin);
65
- if (sizing)
66
- return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} imelo ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementov"}`;
67
- return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} ${adj}${issue.maximum.toString()}`;
68
- }
69
- case "too_small": {
70
- const adj = issue.inclusive ? ">=" : ">";
71
- const sizing = getSizing(issue.origin);
72
- if (sizing) {
73
- return `Premajhno: pričakovano, da bo ${issue.origin} imelo ${adj}${issue.minimum.toString()} ${sizing.unit}`;
74
- }
75
- return `Premajhno: pričakovano, da bo ${issue.origin} ${adj}${issue.minimum.toString()}`;
76
- }
77
- case "invalid_format": {
78
- const _issue = issue;
79
- if (_issue.format === "starts_with") {
80
- return `Neveljaven niz: mora se začeti z "${_issue.prefix}"`;
81
- }
82
- if (_issue.format === "ends_with")
83
- return `Neveljaven niz: mora se končati z "${_issue.suffix}"`;
84
- if (_issue.format === "includes")
85
- return `Neveljaven niz: mora vsebovati "${_issue.includes}"`;
86
- if (_issue.format === "regex")
87
- return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`;
88
- return `Neveljaven ${FormatDictionary[_issue.format] ?? issue.format}`;
89
- }
90
- case "not_multiple_of":
91
- return `Neveljavno število: mora biti večkratnik ${issue.divisor}`;
92
- case "unrecognized_keys":
93
- return `Neprepoznan${issue.keys.length > 1 ? "i ključi" : " ključ"}: ${util.joinValues(issue.keys, ", ")}`;
94
- case "invalid_key":
95
- return `Neveljaven ključ v ${issue.origin}`;
96
- case "invalid_union":
97
- return "Neveljaven vnos";
98
- case "invalid_element":
99
- return `Neveljavna vrednost v ${issue.origin}`;
100
- default:
101
- return "Neveljaven vnos";
102
- }
103
- };
104
- };
105
- export default function () {
106
- return {
107
- localeError: error(),
108
- };
109
- }
@@ -1,110 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "tecken", verb: "att ha" },
5
- file: { unit: "bytes", verb: "att ha" },
6
- array: { unit: "objekt", verb: "att innehålla" },
7
- set: { unit: "objekt", verb: "att innehålla" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "reguljärt uttryck",
14
- email: "e-postadress",
15
- url: "URL",
16
- emoji: "emoji",
17
- uuid: "UUID",
18
- uuidv4: "UUIDv4",
19
- uuidv6: "UUIDv6",
20
- nanoid: "nanoid",
21
- guid: "GUID",
22
- cuid: "cuid",
23
- cuid2: "cuid2",
24
- ulid: "ULID",
25
- xid: "XID",
26
- ksuid: "KSUID",
27
- datetime: "ISO-datum och tid",
28
- date: "ISO-datum",
29
- time: "ISO-tid",
30
- duration: "ISO-varaktighet",
31
- ipv4: "IPv4-intervall",
32
- ipv6: "IPv6-intervall",
33
- cidrv4: "IPv4-spektrum",
34
- cidrv6: "IPv6-spektrum",
35
- base64: "base64-kodad sträng",
36
- base64url: "base64url-kodad sträng",
37
- json_string: "JSON-sträng",
38
- e164: "E.164-nummer",
39
- jwt: "JWT",
40
- template_literal: "mall-literal",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- number: "antal",
45
- array: "lista",
46
- };
47
- return (issue) => {
48
- switch (issue.code) {
49
- case "invalid_type": {
50
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
51
- const receivedType = util.parsedType(issue.input);
52
- const received = TypeDictionary[receivedType] ?? receivedType;
53
- if (/^[A-Z]/.test(issue.expected)) {
54
- return `Ogiltig inmatning: förväntat instanceof ${issue.expected}, fick ${received}`;
55
- }
56
- return `Ogiltig inmatning: förväntat ${expected}, fick ${received}`;
57
- }
58
- case "invalid_value":
59
- if (issue.values.length === 1)
60
- return `Ogiltig inmatning: förväntat ${util.stringifyPrimitive(issue.values[0])}`;
61
- return `Ogiltigt val: förväntade en av ${util.joinValues(issue.values, "|")}`;
62
- case "too_big": {
63
- const adj = issue.inclusive ? "<=" : "<";
64
- const sizing = getSizing(issue.origin);
65
- if (sizing) {
66
- return `För stor(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
67
- }
68
- return `För stor(t): förväntat ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()}`;
69
- }
70
- case "too_small": {
71
- const adj = issue.inclusive ? ">=" : ">";
72
- const sizing = getSizing(issue.origin);
73
- if (sizing) {
74
- return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
75
- }
76
- return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()}`;
77
- }
78
- case "invalid_format": {
79
- const _issue = issue;
80
- if (_issue.format === "starts_with") {
81
- return `Ogiltig sträng: måste börja med "${_issue.prefix}"`;
82
- }
83
- if (_issue.format === "ends_with")
84
- return `Ogiltig sträng: måste sluta med "${_issue.suffix}"`;
85
- if (_issue.format === "includes")
86
- return `Ogiltig sträng: måste innehålla "${_issue.includes}"`;
87
- if (_issue.format === "regex")
88
- return `Ogiltig sträng: måste matcha mönstret "${_issue.pattern}"`;
89
- return `Ogiltig(t) ${FormatDictionary[_issue.format] ?? issue.format}`;
90
- }
91
- case "not_multiple_of":
92
- return `Ogiltigt tal: måste vara en multipel av ${issue.divisor}`;
93
- case "unrecognized_keys":
94
- return `${issue.keys.length > 1 ? "Okända nycklar" : "Okänd nyckel"}: ${util.joinValues(issue.keys, ", ")}`;
95
- case "invalid_key":
96
- return `Ogiltig nyckel i ${issue.origin ?? "värdet"}`;
97
- case "invalid_union":
98
- return "Ogiltig input";
99
- case "invalid_element":
100
- return `Ogiltigt värde i ${issue.origin ?? "värdet"}`;
101
- default:
102
- return `Ogiltig input`;
103
- }
104
- };
105
- };
106
- export default function () {
107
- return {
108
- localeError: error(),
109
- };
110
- }
@@ -1,110 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "எழுத்துக்கள்", verb: "கொண்டிருக்க வேண்டும்" },
5
- file: { unit: "பைட்டுகள்", verb: "கொண்டிருக்க வேண்டும்" },
6
- array: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" },
7
- set: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "உள்ளீடு",
14
- email: "மின்னஞ்சல் முகவரி",
15
- url: "URL",
16
- emoji: "emoji",
17
- uuid: "UUID",
18
- uuidv4: "UUIDv4",
19
- uuidv6: "UUIDv6",
20
- nanoid: "nanoid",
21
- guid: "GUID",
22
- cuid: "cuid",
23
- cuid2: "cuid2",
24
- ulid: "ULID",
25
- xid: "XID",
26
- ksuid: "KSUID",
27
- datetime: "ISO தேதி நேரம்",
28
- date: "ISO தேதி",
29
- time: "ISO நேரம்",
30
- duration: "ISO கால அளவு",
31
- ipv4: "IPv4 முகவரி",
32
- ipv6: "IPv6 முகவரி",
33
- cidrv4: "IPv4 வரம்பு",
34
- cidrv6: "IPv6 வரம்பு",
35
- base64: "base64-encoded சரம்",
36
- base64url: "base64url-encoded சரம்",
37
- json_string: "JSON சரம்",
38
- e164: "E.164 எண்",
39
- jwt: "JWT",
40
- template_literal: "input",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- number: "எண்",
45
- array: "அணி",
46
- null: "வெறுமை",
47
- };
48
- return (issue) => {
49
- switch (issue.code) {
50
- case "invalid_type": {
51
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
52
- const receivedType = util.parsedType(issue.input);
53
- const received = TypeDictionary[receivedType] ?? receivedType;
54
- if (/^[A-Z]/.test(issue.expected)) {
55
- return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${issue.expected}, பெறப்பட்டது ${received}`;
56
- }
57
- return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${expected}, பெறப்பட்டது ${received}`;
58
- }
59
- case "invalid_value":
60
- if (issue.values.length === 1)
61
- return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${util.stringifyPrimitive(issue.values[0])}`;
62
- return `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${util.joinValues(issue.values, "|")} இல் ஒன்று`;
63
- case "too_big": {
64
- const adj = issue.inclusive ? "<=" : "<";
65
- const sizing = getSizing(issue.origin);
66
- if (sizing) {
67
- return `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${issue.origin ?? "மதிப்பு"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "உறுப்புகள்"} ஆக இருக்க வேண்டும்`;
68
- }
69
- return `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${issue.origin ?? "மதிப்பு"} ${adj}${issue.maximum.toString()} ஆக இருக்க வேண்டும்`;
70
- }
71
- case "too_small": {
72
- const adj = issue.inclusive ? ">=" : ">";
73
- const sizing = getSizing(issue.origin);
74
- if (sizing) {
75
- return `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} ஆக இருக்க வேண்டும்`; //
76
- }
77
- return `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${issue.origin} ${adj}${issue.minimum.toString()} ஆக இருக்க வேண்டும்`;
78
- }
79
- case "invalid_format": {
80
- const _issue = issue;
81
- if (_issue.format === "starts_with")
82
- return `தவறான சரம்: "${_issue.prefix}" இல் தொடங்க வேண்டும்`;
83
- if (_issue.format === "ends_with")
84
- return `தவறான சரம்: "${_issue.suffix}" இல் முடிவடைய வேண்டும்`;
85
- if (_issue.format === "includes")
86
- return `தவறான சரம்: "${_issue.includes}" ஐ உள்ளடக்க வேண்டும்`;
87
- if (_issue.format === "regex")
88
- return `தவறான சரம்: ${_issue.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;
89
- return `தவறான ${FormatDictionary[_issue.format] ?? issue.format}`;
90
- }
91
- case "not_multiple_of":
92
- return `தவறான எண்: ${issue.divisor} இன் பலமாக இருக்க வேண்டும்`;
93
- case "unrecognized_keys":
94
- return `அடையாளம் தெரியாத விசை${issue.keys.length > 1 ? "கள்" : ""}: ${util.joinValues(issue.keys, ", ")}`;
95
- case "invalid_key":
96
- return `${issue.origin} இல் தவறான விசை`;
97
- case "invalid_union":
98
- return "தவறான உள்ளீடு";
99
- case "invalid_element":
100
- return `${issue.origin} இல் தவறான மதிப்பு`;
101
- default:
102
- return `தவறான உள்ளீடு`;
103
- }
104
- };
105
- };
106
- export default function () {
107
- return {
108
- localeError: error(),
109
- };
110
- }