flavor-code 1.3.23 → 1.4.0-beta.10

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 (181) hide show
  1. package/README.md +439 -434
  2. package/README.zh-CN.md +436 -431
  3. package/dist/agent/loop.d.ts +7 -2
  4. package/dist/{app-NTEUPJKJ.js → app-SMIB6P23.js} +82 -161
  5. package/dist/{chunk-Z62P4LL7.js → chunk-BYHO2CA5.js} +10412 -8712
  6. package/dist/{chunk-RPFWB45Y.js → chunk-EXOSMO57.js} +13 -8
  7. package/dist/chunk-N5MXHJKD.js +107 -0
  8. package/dist/{chunk-7OICVL2M.js → chunk-RAYH6K2H.js} +2 -44
  9. package/dist/{chunk-VEUSROUQ.js → chunk-UO4DLWU5.js} +8 -2
  10. package/dist/{chunk-SUSLIHXO.js → chunk-XMRKRPNC.js} +179 -14253
  11. package/dist/{chunk-RQTYHUMK.js → chunk-ZJCAQXA7.js} +17 -1
  12. package/dist/{claude-ink-6CEG2XZZ.js → claude-ink-6EZHF64C.js} +2 -3
  13. package/dist/cli-main.js +75 -28
  14. package/dist/cli.js +54 -10
  15. package/dist/config/load.d.ts +2 -0
  16. package/dist/config/schema.d.ts +8 -0
  17. package/dist/context/manager.d.ts +9 -0
  18. package/dist/desktop/main.js +3035 -1237
  19. package/dist/desktop-renderer/assets/index-Bk6FYhyh.css +1 -0
  20. package/dist/desktop-renderer/assets/index-RNe5Gtum.js +154 -0
  21. package/dist/desktop-renderer/assets/{interactive-terminal-CTFo4fK9.js → interactive-terminal-DestMQ2z.js} +1 -1
  22. package/dist/desktop-renderer/index.html +2 -2
  23. package/dist/doctor.d.ts +38 -0
  24. package/dist/execution/docker.d.ts +5 -1
  25. package/dist/execution/types.d.ts +11 -0
  26. package/dist/git/service.d.ts +3 -3
  27. package/dist/git/tools.d.ts +1 -1
  28. package/dist/goal/classifier.d.ts +2 -0
  29. package/dist/goal/orchestrator.d.ts +23 -2
  30. package/dist/goal/planner.d.ts +2 -0
  31. package/dist/goal/store.d.ts +2 -0
  32. package/dist/goal/types.d.ts +14 -0
  33. package/dist/harness/journal.d.ts +2 -0
  34. package/dist/harness/local.d.ts +2 -0
  35. package/dist/init/project.d.ts +0 -6
  36. package/dist/jobs/registry.d.ts +8 -1
  37. package/dist/{load-4FWNXE6F.js → load-EW56Q2MM.js} +1 -1
  38. package/dist/loop/orchestrator.d.ts +20 -0
  39. package/dist/loop/types.d.ts +7 -0
  40. package/dist/loop/verifier.d.ts +2 -0
  41. package/dist/models/openai.d.ts +1 -1
  42. package/dist/models/structured.d.ts +7 -0
  43. package/dist/models/types.d.ts +1 -1
  44. package/dist/production.d.ts +17 -0
  45. package/dist/sdk/index.js +5 -5
  46. package/dist/session/tree.d.ts +2 -0
  47. package/dist/tools/lsp.d.ts +15 -10
  48. package/dist/tools/runtime.d.ts +2 -1
  49. package/dist/tools/search.d.ts +1 -0
  50. package/dist/tools/shell.d.ts +17 -12
  51. package/dist/tools/types.d.ts +2 -1
  52. package/dist/ui/commands.d.ts +1 -1
  53. package/dist/ui/session.d.ts +12 -0
  54. package/dist/ui/transcript.d.ts +9 -0
  55. package/dist/update/check.d.ts +20 -0
  56. package/dist/utils/abort.d.ts +20 -0
  57. package/dist/utils/execFileNoThrow.d.ts +1 -0
  58. package/dist/utils/heap.d.ts +58 -0
  59. package/dist/utils/memory-restart.d.ts +42 -3
  60. package/dist/utils/process-tree.d.ts +2 -0
  61. package/dist/utils/rotation-census.d.ts +36 -0
  62. package/dist/utils/semver.d.ts +3 -0
  63. package/dist/utils/spawn-executable.d.ts +2 -0
  64. package/package.json +3 -2
  65. package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +5848 -5848
  66. package/dist/astgraph/db.mjs +0 -237
  67. package/dist/astgraph/extract.mjs +0 -239
  68. package/dist/astgraph/flavor-plugin.json +0 -25
  69. package/dist/astgraph/grammars.mjs +0 -68
  70. package/dist/astgraph/index.js +0 -301
  71. package/dist/astgraph/indexer.mjs +0 -175
  72. package/dist/astgraph/query.mjs +0 -165
  73. package/dist/astgraph/resolve.mjs +0 -93
  74. package/dist/astgraph/vendor/tree-sitter-javascript.wasm +0 -0
  75. package/dist/astgraph/vendor/tree-sitter-tsx.wasm +0 -0
  76. package/dist/astgraph/vendor/tree-sitter-typescript.wasm +0 -0
  77. package/dist/astgraph/vendor/tree-sitter.js +0 -3980
  78. package/dist/astgraph/vendor/tree-sitter.wasm +0 -0
  79. package/dist/astgraph/vendor/zod/LICENSE +0 -21
  80. package/dist/astgraph/vendor/zod/index.js +0 -4
  81. package/dist/astgraph/vendor/zod/locales/index.js +0 -1
  82. package/dist/astgraph/vendor/zod/locales/package.json +0 -7
  83. package/dist/astgraph/vendor/zod/package.json +0 -135
  84. package/dist/astgraph/vendor/zod/v4/classic/checks.js +0 -1
  85. package/dist/astgraph/vendor/zod/v4/classic/coerce.js +0 -17
  86. package/dist/astgraph/vendor/zod/v4/classic/compat.js +0 -31
  87. package/dist/astgraph/vendor/zod/v4/classic/errors.js +0 -48
  88. package/dist/astgraph/vendor/zod/v4/classic/external.js +0 -20
  89. package/dist/astgraph/vendor/zod/v4/classic/from-json-schema.js +0 -599
  90. package/dist/astgraph/vendor/zod/v4/classic/index.js +0 -4
  91. package/dist/astgraph/vendor/zod/v4/classic/iso.js +0 -30
  92. package/dist/astgraph/vendor/zod/v4/classic/package.json +0 -7
  93. package/dist/astgraph/vendor/zod/v4/classic/parse.js +0 -15
  94. package/dist/astgraph/vendor/zod/v4/classic/schemas.js +0 -1395
  95. package/dist/astgraph/vendor/zod/v4/core/api.js +0 -1087
  96. package/dist/astgraph/vendor/zod/v4/core/checks.js +0 -575
  97. package/dist/astgraph/vendor/zod/v4/core/core.js +0 -78
  98. package/dist/astgraph/vendor/zod/v4/core/doc.js +0 -35
  99. package/dist/astgraph/vendor/zod/v4/core/errors.js +0 -185
  100. package/dist/astgraph/vendor/zod/v4/core/index.js +0 -16
  101. package/dist/astgraph/vendor/zod/v4/core/json-schema-generator.js +0 -95
  102. package/dist/astgraph/vendor/zod/v4/core/json-schema-processors.js +0 -601
  103. package/dist/astgraph/vendor/zod/v4/core/json-schema.js +0 -1
  104. package/dist/astgraph/vendor/zod/v4/core/package.json +0 -7
  105. package/dist/astgraph/vendor/zod/v4/core/parse.js +0 -93
  106. package/dist/astgraph/vendor/zod/v4/core/regexes.js +0 -139
  107. package/dist/astgraph/vendor/zod/v4/core/registries.js +0 -51
  108. package/dist/astgraph/vendor/zod/v4/core/schemas.js +0 -2239
  109. package/dist/astgraph/vendor/zod/v4/core/standard-schema.js +0 -1
  110. package/dist/astgraph/vendor/zod/v4/core/to-json-schema.js +0 -448
  111. package/dist/astgraph/vendor/zod/v4/core/util.js +0 -674
  112. package/dist/astgraph/vendor/zod/v4/core/versions.js +0 -5
  113. package/dist/astgraph/vendor/zod/v4/index.js +0 -3
  114. package/dist/astgraph/vendor/zod/v4/locales/ar.js +0 -106
  115. package/dist/astgraph/vendor/zod/v4/locales/az.js +0 -105
  116. package/dist/astgraph/vendor/zod/v4/locales/be.js +0 -156
  117. package/dist/astgraph/vendor/zod/v4/locales/bg.js +0 -120
  118. package/dist/astgraph/vendor/zod/v4/locales/ca.js +0 -107
  119. package/dist/astgraph/vendor/zod/v4/locales/cs.js +0 -111
  120. package/dist/astgraph/vendor/zod/v4/locales/da.js +0 -115
  121. package/dist/astgraph/vendor/zod/v4/locales/de.js +0 -108
  122. package/dist/astgraph/vendor/zod/v4/locales/el.js +0 -109
  123. package/dist/astgraph/vendor/zod/v4/locales/en.js +0 -113
  124. package/dist/astgraph/vendor/zod/v4/locales/eo.js +0 -109
  125. package/dist/astgraph/vendor/zod/v4/locales/es.js +0 -132
  126. package/dist/astgraph/vendor/zod/v4/locales/fa.js +0 -114
  127. package/dist/astgraph/vendor/zod/v4/locales/fi.js +0 -112
  128. package/dist/astgraph/vendor/zod/v4/locales/fr-CA.js +0 -107
  129. package/dist/astgraph/vendor/zod/v4/locales/fr.js +0 -125
  130. package/dist/astgraph/vendor/zod/v4/locales/he.js +0 -214
  131. package/dist/astgraph/vendor/zod/v4/locales/hr.js +0 -122
  132. package/dist/astgraph/vendor/zod/v4/locales/hu.js +0 -108
  133. package/dist/astgraph/vendor/zod/v4/locales/hy.js +0 -147
  134. package/dist/astgraph/vendor/zod/v4/locales/id.js +0 -106
  135. package/dist/astgraph/vendor/zod/v4/locales/index.js +0 -52
  136. package/dist/astgraph/vendor/zod/v4/locales/is.js +0 -109
  137. package/dist/astgraph/vendor/zod/v4/locales/it.js +0 -108
  138. package/dist/astgraph/vendor/zod/v4/locales/ja.js +0 -107
  139. package/dist/astgraph/vendor/zod/v4/locales/ka.js +0 -112
  140. package/dist/astgraph/vendor/zod/v4/locales/kh.js +0 -5
  141. package/dist/astgraph/vendor/zod/v4/locales/km.js +0 -110
  142. package/dist/astgraph/vendor/zod/v4/locales/ko.js +0 -111
  143. package/dist/astgraph/vendor/zod/v4/locales/lt.js +0 -203
  144. package/dist/astgraph/vendor/zod/v4/locales/mk.js +0 -109
  145. package/dist/astgraph/vendor/zod/v4/locales/ms.js +0 -107
  146. package/dist/astgraph/vendor/zod/v4/locales/nl.js +0 -110
  147. package/dist/astgraph/vendor/zod/v4/locales/no.js +0 -108
  148. package/dist/astgraph/vendor/zod/v4/locales/ota.js +0 -109
  149. package/dist/astgraph/vendor/zod/v4/locales/package.json +0 -7
  150. package/dist/astgraph/vendor/zod/v4/locales/pl.js +0 -109
  151. package/dist/astgraph/vendor/zod/v4/locales/ps.js +0 -114
  152. package/dist/astgraph/vendor/zod/v4/locales/pt.js +0 -108
  153. package/dist/astgraph/vendor/zod/v4/locales/ro.js +0 -119
  154. package/dist/astgraph/vendor/zod/v4/locales/ru.js +0 -156
  155. package/dist/astgraph/vendor/zod/v4/locales/sl.js +0 -109
  156. package/dist/astgraph/vendor/zod/v4/locales/sv.js +0 -110
  157. package/dist/astgraph/vendor/zod/v4/locales/ta.js +0 -110
  158. package/dist/astgraph/vendor/zod/v4/locales/th.js +0 -110
  159. package/dist/astgraph/vendor/zod/v4/locales/tr.js +0 -105
  160. package/dist/astgraph/vendor/zod/v4/locales/ua.js +0 -5
  161. package/dist/astgraph/vendor/zod/v4/locales/uk.js +0 -108
  162. package/dist/astgraph/vendor/zod/v4/locales/ur.js +0 -110
  163. package/dist/astgraph/vendor/zod/v4/locales/uz.js +0 -110
  164. package/dist/astgraph/vendor/zod/v4/locales/vi.js +0 -108
  165. package/dist/astgraph/vendor/zod/v4/locales/yo.js +0 -107
  166. package/dist/astgraph/vendor/zod/v4/locales/zh-CN.js +0 -109
  167. package/dist/astgraph/vendor/zod/v4/locales/zh-TW.js +0 -107
  168. package/dist/astgraph/vendor/zod/v4/mini/checks.js +0 -1
  169. package/dist/astgraph/vendor/zod/v4/mini/coerce.js +0 -22
  170. package/dist/astgraph/vendor/zod/v4/mini/external.js +0 -14
  171. package/dist/astgraph/vendor/zod/v4/mini/index.js +0 -3
  172. package/dist/astgraph/vendor/zod/v4/mini/iso.js +0 -34
  173. package/dist/astgraph/vendor/zod/v4/mini/package.json +0 -7
  174. package/dist/astgraph/vendor/zod/v4/mini/parse.js +0 -1
  175. package/dist/astgraph/vendor/zod/v4/mini/schemas.js +0 -961
  176. package/dist/astgraph/vendor/zod/v4/package.json +0 -7
  177. package/dist/chunk-CIVPKHF4.js +0 -53
  178. package/dist/chunk-OTYFL4AG.js +0 -16
  179. package/dist/desktop-renderer/assets/index-D75ozXnZ.js +0 -154
  180. package/dist/desktop-renderer/assets/index-ZZsUx916.css +0 -1
  181. package/dist/devtools-4QTPKBKK.js +0 -2
@@ -1,111 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "znaků", verb: "mít" },
5
- file: { unit: "bajtů", verb: "mít" },
6
- array: { unit: "prvků", verb: "mít" },
7
- set: { unit: "prvků", verb: "mít" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "regulární výraz",
14
- email: "e-mailová adresa",
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: "datum a čas ve formátu ISO",
28
- date: "datum ve formátu ISO",
29
- time: "čas ve formátu ISO",
30
- duration: "doba trvání ISO",
31
- ipv4: "IPv4 adresa",
32
- ipv6: "IPv6 adresa",
33
- cidrv4: "rozsah IPv4",
34
- cidrv6: "rozsah IPv6",
35
- base64: "řetězec zakódovaný ve formátu base64",
36
- base64url: "řetězec zakódovaný ve formátu base64url",
37
- json_string: "řetězec ve formátu JSON",
38
- e164: "číslo E.164",
39
- jwt: "JWT",
40
- template_literal: "vstup",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- number: "číslo",
45
- string: "řetězec",
46
- function: "funkce",
47
- array: "pole",
48
- };
49
- return (issue) => {
50
- switch (issue.code) {
51
- case "invalid_type": {
52
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
53
- const receivedType = util.parsedType(issue.input);
54
- const received = TypeDictionary[receivedType] ?? receivedType;
55
- if (/^[A-Z]/.test(issue.expected)) {
56
- return `Neplatný vstup: očekáváno instanceof ${issue.expected}, obdrženo ${received}`;
57
- }
58
- return `Neplatný vstup: očekáváno ${expected}, obdrženo ${received}`;
59
- }
60
- case "invalid_value":
61
- if (issue.values.length === 1)
62
- return `Neplatný vstup: očekáváno ${util.stringifyPrimitive(issue.values[0])}`;
63
- return `Neplatná možnost: očekávána jedna z hodnot ${util.joinValues(issue.values, "|")}`;
64
- case "too_big": {
65
- const adj = issue.inclusive ? "<=" : "<";
66
- const sizing = getSizing(issue.origin);
67
- if (sizing) {
68
- return `Hodnota je příliš velká: ${issue.origin ?? "hodnota"} musí mít ${adj}${issue.maximum.toString()} ${sizing.unit ?? "prvků"}`;
69
- }
70
- return `Hodnota je příliš velká: ${issue.origin ?? "hodnota"} musí být ${adj}${issue.maximum.toString()}`;
71
- }
72
- case "too_small": {
73
- const adj = issue.inclusive ? ">=" : ">";
74
- const sizing = getSizing(issue.origin);
75
- if (sizing) {
76
- return `Hodnota je příliš malá: ${issue.origin ?? "hodnota"} musí mít ${adj}${issue.minimum.toString()} ${sizing.unit ?? "prvků"}`;
77
- }
78
- return `Hodnota je příliš malá: ${issue.origin ?? "hodnota"} musí být ${adj}${issue.minimum.toString()}`;
79
- }
80
- case "invalid_format": {
81
- const _issue = issue;
82
- if (_issue.format === "starts_with")
83
- return `Neplatný řetězec: musí začínat na "${_issue.prefix}"`;
84
- if (_issue.format === "ends_with")
85
- return `Neplatný řetězec: musí končit na "${_issue.suffix}"`;
86
- if (_issue.format === "includes")
87
- return `Neplatný řetězec: musí obsahovat "${_issue.includes}"`;
88
- if (_issue.format === "regex")
89
- return `Neplatný řetězec: musí odpovídat vzoru ${_issue.pattern}`;
90
- return `Neplatný formát ${FormatDictionary[_issue.format] ?? issue.format}`;
91
- }
92
- case "not_multiple_of":
93
- return `Neplatné číslo: musí být násobkem ${issue.divisor}`;
94
- case "unrecognized_keys":
95
- return `Neznámé klíče: ${util.joinValues(issue.keys, ", ")}`;
96
- case "invalid_key":
97
- return `Neplatný klíč v ${issue.origin}`;
98
- case "invalid_union":
99
- return "Neplatný vstup";
100
- case "invalid_element":
101
- return `Neplatná hodnota v ${issue.origin}`;
102
- default:
103
- return `Neplatný vstup`;
104
- }
105
- };
106
- };
107
- export default function () {
108
- return {
109
- localeError: error(),
110
- };
111
- }
@@ -1,115 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "tegn", verb: "havde" },
5
- file: { unit: "bytes", verb: "havde" },
6
- array: { unit: "elementer", verb: "indeholdt" },
7
- set: { unit: "elementer", verb: "indeholdt" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "input",
14
- email: "e-mailadresse",
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 dato- og klokkeslæt",
28
- date: "ISO-dato",
29
- time: "ISO-klokkeslæt",
30
- duration: "ISO-varighed",
31
- ipv4: "IPv4-område",
32
- ipv6: "IPv6-område",
33
- cidrv4: "IPv4-spektrum",
34
- cidrv6: "IPv6-spektrum",
35
- base64: "base64-kodet streng",
36
- base64url: "base64url-kodet streng",
37
- json_string: "JSON-streng",
38
- e164: "E.164-nummer",
39
- jwt: "JWT",
40
- template_literal: "input",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- string: "streng",
45
- number: "tal",
46
- boolean: "boolean",
47
- array: "liste",
48
- object: "objekt",
49
- set: "sæt",
50
- file: "fil",
51
- };
52
- return (issue) => {
53
- switch (issue.code) {
54
- case "invalid_type": {
55
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
56
- const receivedType = util.parsedType(issue.input);
57
- const received = TypeDictionary[receivedType] ?? receivedType;
58
- if (/^[A-Z]/.test(issue.expected)) {
59
- return `Ugyldigt input: forventede instanceof ${issue.expected}, fik ${received}`;
60
- }
61
- return `Ugyldigt input: forventede ${expected}, fik ${received}`;
62
- }
63
- case "invalid_value":
64
- if (issue.values.length === 1)
65
- return `Ugyldig værdi: forventede ${util.stringifyPrimitive(issue.values[0])}`;
66
- return `Ugyldigt valg: forventede en af følgende ${util.joinValues(issue.values, "|")}`;
67
- case "too_big": {
68
- const adj = issue.inclusive ? "<=" : "<";
69
- const sizing = getSizing(issue.origin);
70
- const origin = TypeDictionary[issue.origin] ?? issue.origin;
71
- if (sizing)
72
- return `For stor: forventede ${origin ?? "value"} ${sizing.verb} ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "elementer"}`;
73
- return `For stor: forventede ${origin ?? "value"} havde ${adj} ${issue.maximum.toString()}`;
74
- }
75
- case "too_small": {
76
- const adj = issue.inclusive ? ">=" : ">";
77
- const sizing = getSizing(issue.origin);
78
- const origin = TypeDictionary[issue.origin] ?? issue.origin;
79
- if (sizing) {
80
- return `For lille: forventede ${origin} ${sizing.verb} ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
81
- }
82
- return `For lille: forventede ${origin} havde ${adj} ${issue.minimum.toString()}`;
83
- }
84
- case "invalid_format": {
85
- const _issue = issue;
86
- if (_issue.format === "starts_with")
87
- return `Ugyldig streng: skal starte med "${_issue.prefix}"`;
88
- if (_issue.format === "ends_with")
89
- return `Ugyldig streng: skal ende med "${_issue.suffix}"`;
90
- if (_issue.format === "includes")
91
- return `Ugyldig streng: skal indeholde "${_issue.includes}"`;
92
- if (_issue.format === "regex")
93
- return `Ugyldig streng: skal matche mønsteret ${_issue.pattern}`;
94
- return `Ugyldig ${FormatDictionary[_issue.format] ?? issue.format}`;
95
- }
96
- case "not_multiple_of":
97
- return `Ugyldigt tal: skal være deleligt med ${issue.divisor}`;
98
- case "unrecognized_keys":
99
- return `${issue.keys.length > 1 ? "Ukendte nøgler" : "Ukendt nøgle"}: ${util.joinValues(issue.keys, ", ")}`;
100
- case "invalid_key":
101
- return `Ugyldig nøgle i ${issue.origin}`;
102
- case "invalid_union":
103
- return "Ugyldigt input: matcher ingen af de tilladte typer";
104
- case "invalid_element":
105
- return `Ugyldig værdi i ${issue.origin}`;
106
- default:
107
- return `Ugyldigt input`;
108
- }
109
- };
110
- };
111
- export default function () {
112
- return {
113
- localeError: error(),
114
- };
115
- }
@@ -1,108 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "Zeichen", verb: "zu haben" },
5
- file: { unit: "Bytes", verb: "zu haben" },
6
- array: { unit: "Elemente", verb: "zu haben" },
7
- set: { unit: "Elemente", verb: "zu haben" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "Eingabe",
14
- email: "E-Mail-Adresse",
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 und -Uhrzeit",
28
- date: "ISO-Datum",
29
- time: "ISO-Uhrzeit",
30
- duration: "ISO-Dauer",
31
- ipv4: "IPv4-Adresse",
32
- ipv6: "IPv6-Adresse",
33
- cidrv4: "IPv4-Bereich",
34
- cidrv6: "IPv6-Bereich",
35
- base64: "Base64-codierter String",
36
- base64url: "Base64-URL-codierter String",
37
- json_string: "JSON-String",
38
- e164: "E.164-Nummer",
39
- jwt: "JWT",
40
- template_literal: "Eingabe",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- number: "Zahl",
45
- array: "Array",
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 `Ungültige Eingabe: erwartet instanceof ${issue.expected}, erhalten ${received}`;
55
- }
56
- return `Ungültige Eingabe: erwartet ${expected}, erhalten ${received}`;
57
- }
58
- case "invalid_value":
59
- if (issue.values.length === 1)
60
- return `Ungültige Eingabe: erwartet ${util.stringifyPrimitive(issue.values[0])}`;
61
- return `Ungültige Option: erwartet eine von ${util.joinValues(issue.values, "|")}`;
62
- case "too_big": {
63
- const adj = issue.inclusive ? "<=" : "<";
64
- const sizing = getSizing(issue.origin);
65
- if (sizing)
66
- return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "Elemente"} hat`;
67
- return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ist`;
68
- }
69
- case "too_small": {
70
- const adj = issue.inclusive ? ">=" : ">";
71
- const sizing = getSizing(issue.origin);
72
- if (sizing) {
73
- return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} hat`;
74
- }
75
- return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ist`;
76
- }
77
- case "invalid_format": {
78
- const _issue = issue;
79
- if (_issue.format === "starts_with")
80
- return `Ungültiger String: muss mit "${_issue.prefix}" beginnen`;
81
- if (_issue.format === "ends_with")
82
- return `Ungültiger String: muss mit "${_issue.suffix}" enden`;
83
- if (_issue.format === "includes")
84
- return `Ungültiger String: muss "${_issue.includes}" enthalten`;
85
- if (_issue.format === "regex")
86
- return `Ungültiger String: muss dem Muster ${_issue.pattern} entsprechen`;
87
- return `Ungültig: ${FormatDictionary[_issue.format] ?? issue.format}`;
88
- }
89
- case "not_multiple_of":
90
- return `Ungültige Zahl: muss ein Vielfaches von ${issue.divisor} sein`;
91
- case "unrecognized_keys":
92
- return `${issue.keys.length > 1 ? "Unbekannte Schlüssel" : "Unbekannter Schlüssel"}: ${util.joinValues(issue.keys, ", ")}`;
93
- case "invalid_key":
94
- return `Ungültiger Schlüssel in ${issue.origin}`;
95
- case "invalid_union":
96
- return "Ungültige Eingabe";
97
- case "invalid_element":
98
- return `Ungültiger Wert in ${issue.origin}`;
99
- default:
100
- return `Ungültige Eingabe`;
101
- }
102
- };
103
- };
104
- export default function () {
105
- return {
106
- localeError: error(),
107
- };
108
- }
@@ -1,109 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "χαρακτήρες", verb: "να έχει" },
5
- file: { unit: "bytes", verb: "να έχει" },
6
- array: { unit: "στοιχεία", verb: "να έχει" },
7
- set: { unit: "στοιχεία", verb: "να έχει" },
8
- map: { unit: "καταχωρήσεις", verb: "να έχει" },
9
- };
10
- function getSizing(origin) {
11
- return Sizable[origin] ?? null;
12
- }
13
- const FormatDictionary = {
14
- regex: "είσοδος",
15
- email: "διεύθυνση 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: "ISO ημερομηνία και ώρα",
29
- date: "ISO ημερομηνία",
30
- time: "ISO ώρα",
31
- duration: "ISO διάρκεια",
32
- ipv4: "διεύθυνση IPv4",
33
- ipv6: "διεύθυνση IPv6",
34
- mac: "διεύθυνση MAC",
35
- cidrv4: "εύρος IPv4",
36
- cidrv6: "εύρος IPv6",
37
- base64: "συμβολοσειρά κωδικοποιημένη σε base64",
38
- base64url: "συμβολοσειρά κωδικοποιημένη σε base64url",
39
- json_string: "συμβολοσειρά JSON",
40
- e164: "αριθμός E.164",
41
- jwt: "JWT",
42
- template_literal: "είσοδος",
43
- };
44
- const TypeDictionary = {
45
- nan: "NaN",
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 (typeof issue.expected === "string" && /^[A-Z]/.test(issue.expected)) {
54
- return `Μη έγκυρη είσοδος: αναμενόταν instanceof ${issue.expected}, λήφθηκε ${received}`;
55
- }
56
- return `Μη έγκυρη είσοδος: αναμενόταν ${expected}, λήφθηκε ${received}`;
57
- }
58
- case "invalid_value":
59
- if (issue.values.length === 1)
60
- return `Μη έγκυρη είσοδος: αναμενόταν ${util.stringifyPrimitive(issue.values[0])}`;
61
- return `Μη έγκυρη επιλογή: αναμενόταν ένα από ${util.joinValues(issue.values, "|")}`;
62
- case "too_big": {
63
- const adj = issue.inclusive ? "<=" : "<";
64
- const sizing = getSizing(issue.origin);
65
- if (sizing)
66
- return `Πολύ μεγάλο: αναμενόταν ${issue.origin ?? "τιμή"} να έχει ${adj}${issue.maximum.toString()} ${sizing.unit ?? "στοιχεία"}`;
67
- return `Πολύ μεγάλο: αναμενόταν ${issue.origin ?? "τιμή"} να είναι ${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 `Πολύ μικρό: αναμενόταν ${issue.origin} να έχει ${adj}${issue.minimum.toString()} ${sizing.unit}`;
74
- }
75
- return `Πολύ μικρό: αναμενόταν ${issue.origin} να είναι ${adj}${issue.minimum.toString()}`;
76
- }
77
- case "invalid_format": {
78
- const _issue = issue;
79
- if (_issue.format === "starts_with") {
80
- return `Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${_issue.prefix}"`;
81
- }
82
- if (_issue.format === "ends_with")
83
- return `Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${_issue.suffix}"`;
84
- if (_issue.format === "includes")
85
- return `Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${_issue.includes}"`;
86
- if (_issue.format === "regex")
87
- return `Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${_issue.pattern}`;
88
- return `Μη έγκυρο: ${FormatDictionary[_issue.format] ?? issue.format}`;
89
- }
90
- case "not_multiple_of":
91
- return `Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${issue.divisor}`;
92
- case "unrecognized_keys":
93
- return `Άγνωστ${issue.keys.length > 1 ? "α" : "ο"} κλειδ${issue.keys.length > 1 ? "ιά" : "ί"}: ${util.joinValues(issue.keys, ", ")}`;
94
- case "invalid_key":
95
- return `Μη έγκυρο κλειδί στο ${issue.origin}`;
96
- case "invalid_union":
97
- return "Μη έγκυρη είσοδος";
98
- case "invalid_element":
99
- return `Μη έγκυρη τιμή στο ${issue.origin}`;
100
- default:
101
- return `Μη έγκυρη είσοδος`;
102
- }
103
- };
104
- };
105
- export default function () {
106
- return {
107
- localeError: error(),
108
- };
109
- }
@@ -1,113 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "characters", verb: "to have" },
5
- file: { unit: "bytes", verb: "to have" },
6
- array: { unit: "items", verb: "to have" },
7
- set: { unit: "items", verb: "to have" },
8
- map: { unit: "entries", verb: "to have" },
9
- };
10
- function getSizing(origin) {
11
- return Sizable[origin] ?? null;
12
- }
13
- const FormatDictionary = {
14
- regex: "input",
15
- email: "email address",
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: "ISO datetime",
29
- date: "ISO date",
30
- time: "ISO time",
31
- duration: "ISO duration",
32
- ipv4: "IPv4 address",
33
- ipv6: "IPv6 address",
34
- mac: "MAC address",
35
- cidrv4: "IPv4 range",
36
- cidrv6: "IPv6 range",
37
- base64: "base64-encoded string",
38
- base64url: "base64url-encoded string",
39
- json_string: "JSON string",
40
- e164: "E.164 number",
41
- jwt: "JWT",
42
- template_literal: "input",
43
- };
44
- // type names: missing keys = do not translate (use raw value via ?? fallback)
45
- const TypeDictionary = {
46
- // Compatibility: "nan" -> "NaN" for display
47
- nan: "NaN",
48
- // All other type names omitted - they fall back to raw values via ?? operator
49
- };
50
- return (issue) => {
51
- switch (issue.code) {
52
- case "invalid_type": {
53
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
54
- const receivedType = util.parsedType(issue.input);
55
- const received = TypeDictionary[receivedType] ?? receivedType;
56
- return `Invalid input: expected ${expected}, received ${received}`;
57
- }
58
- case "invalid_value":
59
- if (issue.values.length === 1)
60
- return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;
61
- return `Invalid option: expected one of ${util.joinValues(issue.values, "|")}`;
62
- case "too_big": {
63
- const adj = issue.inclusive ? "<=" : "<";
64
- const sizing = getSizing(issue.origin);
65
- if (sizing)
66
- return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
67
- return `Too big: expected ${issue.origin ?? "value"} to be ${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 `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
74
- }
75
- return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
76
- }
77
- case "invalid_format": {
78
- const _issue = issue;
79
- if (_issue.format === "starts_with") {
80
- return `Invalid string: must start with "${_issue.prefix}"`;
81
- }
82
- if (_issue.format === "ends_with")
83
- return `Invalid string: must end with "${_issue.suffix}"`;
84
- if (_issue.format === "includes")
85
- return `Invalid string: must include "${_issue.includes}"`;
86
- if (_issue.format === "regex")
87
- return `Invalid string: must match pattern ${_issue.pattern}`;
88
- return `Invalid ${FormatDictionary[_issue.format] ?? issue.format}`;
89
- }
90
- case "not_multiple_of":
91
- return `Invalid number: must be a multiple of ${issue.divisor}`;
92
- case "unrecognized_keys":
93
- return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
94
- case "invalid_key":
95
- return `Invalid key in ${issue.origin}`;
96
- case "invalid_union":
97
- if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) {
98
- const opts = issue.options.map((o) => `'${o}'`).join(" | ");
99
- return `Invalid discriminator value. Expected ${opts}`;
100
- }
101
- return "Invalid input";
102
- case "invalid_element":
103
- return `Invalid value in ${issue.origin}`;
104
- default:
105
- return `Invalid input`;
106
- }
107
- };
108
- };
109
- export default function () {
110
- return {
111
- localeError: error(),
112
- };
113
- }
@@ -1,109 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "karaktrojn", verb: "havi" },
5
- file: { unit: "bajtojn", verb: "havi" },
6
- array: { unit: "elementojn", verb: "havi" },
7
- set: { unit: "elementojn", verb: "havi" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "enigo",
14
- email: "retadreso",
15
- url: "URL",
16
- emoji: "emoĝio",
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-datotempo",
28
- date: "ISO-dato",
29
- time: "ISO-tempo",
30
- duration: "ISO-daŭro",
31
- ipv4: "IPv4-adreso",
32
- ipv6: "IPv6-adreso",
33
- cidrv4: "IPv4-rango",
34
- cidrv6: "IPv6-rango",
35
- base64: "64-ume kodita karaktraro",
36
- base64url: "URL-64-ume kodita karaktraro",
37
- json_string: "JSON-karaktraro",
38
- e164: "E.164-nombro",
39
- jwt: "JWT",
40
- template_literal: "enigo",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- number: "nombro",
45
- array: "tabelo",
46
- null: "senvalora",
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 `Nevalida enigo: atendiĝis instanceof ${issue.expected}, riceviĝis ${received}`;
56
- }
57
- return `Nevalida enigo: atendiĝis ${expected}, riceviĝis ${received}`;
58
- }
59
- case "invalid_value":
60
- if (issue.values.length === 1)
61
- return `Nevalida enigo: atendiĝis ${util.stringifyPrimitive(issue.values[0])}`;
62
- return `Nevalida opcio: atendiĝis unu el ${util.joinValues(issue.values, "|")}`;
63
- case "too_big": {
64
- const adj = issue.inclusive ? "<=" : "<";
65
- const sizing = getSizing(issue.origin);
66
- if (sizing)
67
- return `Tro granda: atendiĝis ke ${issue.origin ?? "valoro"} havu ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementojn"}`;
68
- return `Tro granda: atendiĝis ke ${issue.origin ?? "valoro"} havu ${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 `Tro malgranda: atendiĝis ke ${issue.origin} havu ${adj}${issue.minimum.toString()} ${sizing.unit}`;
75
- }
76
- return `Tro malgranda: atendiĝis ke ${issue.origin} estu ${adj}${issue.minimum.toString()}`;
77
- }
78
- case "invalid_format": {
79
- const _issue = issue;
80
- if (_issue.format === "starts_with")
81
- return `Nevalida karaktraro: devas komenciĝi per "${_issue.prefix}"`;
82
- if (_issue.format === "ends_with")
83
- return `Nevalida karaktraro: devas finiĝi per "${_issue.suffix}"`;
84
- if (_issue.format === "includes")
85
- return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`;
86
- if (_issue.format === "regex")
87
- return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`;
88
- return `Nevalida ${FormatDictionary[_issue.format] ?? issue.format}`;
89
- }
90
- case "not_multiple_of":
91
- return `Nevalida nombro: devas esti oblo de ${issue.divisor}`;
92
- case "unrecognized_keys":
93
- return `Nekonata${issue.keys.length > 1 ? "j" : ""} ŝlosilo${issue.keys.length > 1 ? "j" : ""}: ${util.joinValues(issue.keys, ", ")}`;
94
- case "invalid_key":
95
- return `Nevalida ŝlosilo en ${issue.origin}`;
96
- case "invalid_union":
97
- return "Nevalida enigo";
98
- case "invalid_element":
99
- return `Nevalida valoro en ${issue.origin}`;
100
- default:
101
- return `Nevalida enigo`;
102
- }
103
- };
104
- };
105
- export default function () {
106
- return {
107
- localeError: error(),
108
- };
109
- }