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,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
- }