flavor-code 1.3.22 → 1.4.0-beta.1

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 (134) hide show
  1. package/README.md +437 -434
  2. package/README.zh-CN.md +434 -431
  3. package/dist/{app-MWGRT3BJ.js → app-C5ZQUOKJ.js} +37 -63
  4. package/dist/astgraph/grammars.mjs +68 -68
  5. package/dist/astgraph/vendor/tree-sitter.js +3980 -3980
  6. package/dist/astgraph/vendor/zod/LICENSE +21 -21
  7. package/dist/astgraph/vendor/zod/index.js +4 -4
  8. package/dist/astgraph/vendor/zod/locales/index.js +1 -1
  9. package/dist/astgraph/vendor/zod/locales/package.json +7 -7
  10. package/dist/astgraph/vendor/zod/package.json +135 -135
  11. package/dist/astgraph/vendor/zod/v4/classic/checks.js +1 -1
  12. package/dist/astgraph/vendor/zod/v4/classic/coerce.js +17 -17
  13. package/dist/astgraph/vendor/zod/v4/classic/compat.js +31 -31
  14. package/dist/astgraph/vendor/zod/v4/classic/errors.js +48 -48
  15. package/dist/astgraph/vendor/zod/v4/classic/external.js +20 -20
  16. package/dist/astgraph/vendor/zod/v4/classic/from-json-schema.js +599 -599
  17. package/dist/astgraph/vendor/zod/v4/classic/index.js +4 -4
  18. package/dist/astgraph/vendor/zod/v4/classic/iso.js +30 -30
  19. package/dist/astgraph/vendor/zod/v4/classic/package.json +7 -7
  20. package/dist/astgraph/vendor/zod/v4/classic/parse.js +15 -15
  21. package/dist/astgraph/vendor/zod/v4/classic/schemas.js +1395 -1395
  22. package/dist/astgraph/vendor/zod/v4/core/api.js +1087 -1087
  23. package/dist/astgraph/vendor/zod/v4/core/checks.js +575 -575
  24. package/dist/astgraph/vendor/zod/v4/core/core.js +78 -78
  25. package/dist/astgraph/vendor/zod/v4/core/doc.js +35 -35
  26. package/dist/astgraph/vendor/zod/v4/core/errors.js +185 -185
  27. package/dist/astgraph/vendor/zod/v4/core/index.js +16 -16
  28. package/dist/astgraph/vendor/zod/v4/core/json-schema-generator.js +95 -95
  29. package/dist/astgraph/vendor/zod/v4/core/json-schema-processors.js +601 -601
  30. package/dist/astgraph/vendor/zod/v4/core/json-schema.js +1 -1
  31. package/dist/astgraph/vendor/zod/v4/core/package.json +7 -7
  32. package/dist/astgraph/vendor/zod/v4/core/parse.js +93 -93
  33. package/dist/astgraph/vendor/zod/v4/core/regexes.js +139 -139
  34. package/dist/astgraph/vendor/zod/v4/core/registries.js +51 -51
  35. package/dist/astgraph/vendor/zod/v4/core/schemas.js +2239 -2239
  36. package/dist/astgraph/vendor/zod/v4/core/standard-schema.js +1 -1
  37. package/dist/astgraph/vendor/zod/v4/core/to-json-schema.js +448 -448
  38. package/dist/astgraph/vendor/zod/v4/core/util.js +674 -674
  39. package/dist/astgraph/vendor/zod/v4/core/versions.js +5 -5
  40. package/dist/astgraph/vendor/zod/v4/index.js +3 -3
  41. package/dist/astgraph/vendor/zod/v4/locales/ar.js +106 -106
  42. package/dist/astgraph/vendor/zod/v4/locales/az.js +105 -105
  43. package/dist/astgraph/vendor/zod/v4/locales/be.js +156 -156
  44. package/dist/astgraph/vendor/zod/v4/locales/bg.js +120 -120
  45. package/dist/astgraph/vendor/zod/v4/locales/ca.js +107 -107
  46. package/dist/astgraph/vendor/zod/v4/locales/cs.js +111 -111
  47. package/dist/astgraph/vendor/zod/v4/locales/da.js +115 -115
  48. package/dist/astgraph/vendor/zod/v4/locales/de.js +108 -108
  49. package/dist/astgraph/vendor/zod/v4/locales/el.js +109 -109
  50. package/dist/astgraph/vendor/zod/v4/locales/en.js +113 -113
  51. package/dist/astgraph/vendor/zod/v4/locales/eo.js +109 -109
  52. package/dist/astgraph/vendor/zod/v4/locales/es.js +132 -132
  53. package/dist/astgraph/vendor/zod/v4/locales/fa.js +114 -114
  54. package/dist/astgraph/vendor/zod/v4/locales/fi.js +112 -112
  55. package/dist/astgraph/vendor/zod/v4/locales/fr-CA.js +107 -107
  56. package/dist/astgraph/vendor/zod/v4/locales/fr.js +125 -125
  57. package/dist/astgraph/vendor/zod/v4/locales/he.js +214 -214
  58. package/dist/astgraph/vendor/zod/v4/locales/hr.js +122 -122
  59. package/dist/astgraph/vendor/zod/v4/locales/hu.js +108 -108
  60. package/dist/astgraph/vendor/zod/v4/locales/hy.js +147 -147
  61. package/dist/astgraph/vendor/zod/v4/locales/id.js +106 -106
  62. package/dist/astgraph/vendor/zod/v4/locales/index.js +52 -52
  63. package/dist/astgraph/vendor/zod/v4/locales/is.js +109 -109
  64. package/dist/astgraph/vendor/zod/v4/locales/it.js +108 -108
  65. package/dist/astgraph/vendor/zod/v4/locales/ja.js +107 -107
  66. package/dist/astgraph/vendor/zod/v4/locales/ka.js +112 -112
  67. package/dist/astgraph/vendor/zod/v4/locales/kh.js +5 -5
  68. package/dist/astgraph/vendor/zod/v4/locales/km.js +110 -110
  69. package/dist/astgraph/vendor/zod/v4/locales/ko.js +111 -111
  70. package/dist/astgraph/vendor/zod/v4/locales/lt.js +203 -203
  71. package/dist/astgraph/vendor/zod/v4/locales/mk.js +109 -109
  72. package/dist/astgraph/vendor/zod/v4/locales/ms.js +107 -107
  73. package/dist/astgraph/vendor/zod/v4/locales/nl.js +110 -110
  74. package/dist/astgraph/vendor/zod/v4/locales/no.js +108 -108
  75. package/dist/astgraph/vendor/zod/v4/locales/ota.js +109 -109
  76. package/dist/astgraph/vendor/zod/v4/locales/package.json +7 -7
  77. package/dist/astgraph/vendor/zod/v4/locales/pl.js +109 -109
  78. package/dist/astgraph/vendor/zod/v4/locales/ps.js +114 -114
  79. package/dist/astgraph/vendor/zod/v4/locales/pt.js +108 -108
  80. package/dist/astgraph/vendor/zod/v4/locales/ro.js +119 -119
  81. package/dist/astgraph/vendor/zod/v4/locales/ru.js +156 -156
  82. package/dist/astgraph/vendor/zod/v4/locales/sl.js +109 -109
  83. package/dist/astgraph/vendor/zod/v4/locales/sv.js +110 -110
  84. package/dist/astgraph/vendor/zod/v4/locales/ta.js +110 -110
  85. package/dist/astgraph/vendor/zod/v4/locales/th.js +110 -110
  86. package/dist/astgraph/vendor/zod/v4/locales/tr.js +105 -105
  87. package/dist/astgraph/vendor/zod/v4/locales/ua.js +5 -5
  88. package/dist/astgraph/vendor/zod/v4/locales/uk.js +108 -108
  89. package/dist/astgraph/vendor/zod/v4/locales/ur.js +110 -110
  90. package/dist/astgraph/vendor/zod/v4/locales/uz.js +110 -110
  91. package/dist/astgraph/vendor/zod/v4/locales/vi.js +108 -108
  92. package/dist/astgraph/vendor/zod/v4/locales/yo.js +107 -107
  93. package/dist/astgraph/vendor/zod/v4/locales/zh-CN.js +109 -109
  94. package/dist/astgraph/vendor/zod/v4/locales/zh-TW.js +107 -107
  95. package/dist/astgraph/vendor/zod/v4/mini/checks.js +1 -1
  96. package/dist/astgraph/vendor/zod/v4/mini/coerce.js +22 -22
  97. package/dist/astgraph/vendor/zod/v4/mini/external.js +14 -14
  98. package/dist/astgraph/vendor/zod/v4/mini/index.js +3 -3
  99. package/dist/astgraph/vendor/zod/v4/mini/iso.js +34 -34
  100. package/dist/astgraph/vendor/zod/v4/mini/package.json +7 -7
  101. package/dist/astgraph/vendor/zod/v4/mini/parse.js +1 -1
  102. package/dist/astgraph/vendor/zod/v4/mini/schemas.js +961 -961
  103. package/dist/astgraph/vendor/zod/v4/package.json +7 -7
  104. package/dist/{chunk-7OICVL2M.js → chunk-2BF7CVWZ.js} +0 -42
  105. package/dist/{chunk-RQTYHUMK.js → chunk-3WCDZ6ZL.js} +15 -0
  106. package/dist/{chunk-Z62P4LL7.js → chunk-6MNOZ2TX.js} +8962 -8422
  107. package/dist/{chunk-VEUSROUQ.js → chunk-FOTMP4ZS.js} +1 -1
  108. package/dist/{chunk-SUSLIHXO.js → chunk-ODRWR4KK.js} +1 -1
  109. package/dist/{chunk-RPFWB45Y.js → chunk-URUVFECH.js} +1 -1
  110. package/dist/{claude-ink-6CEG2XZZ.js → claude-ink-LP32NSX5.js} +2 -3
  111. package/dist/cli-main.js +27 -11
  112. package/dist/config/load.d.ts +2 -0
  113. package/dist/desktop/main.js +1092 -541
  114. package/dist/desktop-renderer/assets/index-Bk6FYhyh.css +1 -0
  115. package/dist/desktop-renderer/assets/{index-D75ozXnZ.js → index-CqRIr-hz.js} +3 -3
  116. package/dist/desktop-renderer/assets/{interactive-terminal-CTFo4fK9.js → interactive-terminal-C4o7MNPO.js} +1 -1
  117. package/dist/desktop-renderer/index.html +2 -2
  118. package/dist/doctor.d.ts +38 -0
  119. package/dist/execution/docker.d.ts +5 -1
  120. package/dist/execution/types.d.ts +11 -0
  121. package/dist/jobs/registry.d.ts +1 -0
  122. package/dist/{load-4FWNXE6F.js → load-V2UIYYQI.js} +1 -1
  123. package/dist/sdk/index.js +4 -4
  124. package/dist/tools/shell.d.ts +17 -12
  125. package/dist/tools/types.d.ts +1 -0
  126. package/dist/ui/commands.d.ts +1 -1
  127. package/dist/ui/session.d.ts +1 -0
  128. package/dist/update/check.d.ts +20 -0
  129. package/dist/utils/semver.d.ts +3 -0
  130. package/dist/utils/spawn-executable.d.ts +2 -0
  131. package/package.json +1 -1
  132. package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +5848 -5848
  133. package/dist/chunk-OTYFL4AG.js +0 -16
  134. package/dist/desktop-renderer/assets/index-ZZsUx916.css +0 -1
@@ -1,214 +1,214 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- // Hebrew labels + grammatical gender
4
- const TypeNames = {
5
- string: { label: "מחרוזת", gender: "f" },
6
- number: { label: "מספר", gender: "m" },
7
- boolean: { label: "ערך בוליאני", gender: "m" },
8
- bigint: { label: "BigInt", gender: "m" },
9
- date: { label: "תאריך", gender: "m" },
10
- array: { label: "מערך", gender: "m" },
11
- object: { label: "אובייקט", gender: "m" },
12
- null: { label: "ערך ריק (null)", gender: "m" },
13
- undefined: { label: "ערך לא מוגדר (undefined)", gender: "m" },
14
- symbol: { label: "סימבול (Symbol)", gender: "m" },
15
- function: { label: "פונקציה", gender: "f" },
16
- map: { label: "מפה (Map)", gender: "f" },
17
- set: { label: "קבוצה (Set)", gender: "f" },
18
- file: { label: "קובץ", gender: "m" },
19
- promise: { label: "Promise", gender: "m" },
20
- NaN: { label: "NaN", gender: "m" },
21
- unknown: { label: "ערך לא ידוע", gender: "m" },
22
- value: { label: "ערך", gender: "m" },
23
- };
24
- // Sizing units for size-related messages + localized origin labels
25
- const Sizable = {
26
- string: { unit: "תווים", shortLabel: "קצר", longLabel: "ארוך" },
27
- file: { unit: "בייטים", shortLabel: "קטן", longLabel: "גדול" },
28
- array: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" },
29
- set: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" },
30
- number: { unit: "", shortLabel: "קטן", longLabel: "גדול" }, // no unit
31
- };
32
- // Helpers — labels, articles, and verbs
33
- const typeEntry = (t) => (t ? TypeNames[t] : undefined);
34
- const typeLabel = (t) => {
35
- const e = typeEntry(t);
36
- if (e)
37
- return e.label;
38
- // fallback: show raw string if unknown
39
- return t ?? TypeNames.unknown.label;
40
- };
41
- const withDefinite = (t) => `ה${typeLabel(t)}`;
42
- const verbFor = (t) => {
43
- const e = typeEntry(t);
44
- const gender = e?.gender ?? "m";
45
- return gender === "f" ? "צריכה להיות" : "צריך להיות";
46
- };
47
- const getSizing = (origin) => {
48
- if (!origin)
49
- return null;
50
- return Sizable[origin] ?? null;
51
- };
52
- const FormatDictionary = {
53
- regex: { label: "קלט", gender: "m" },
54
- email: { label: "כתובת אימייל", gender: "f" },
55
- url: { label: "כתובת רשת", gender: "f" },
56
- emoji: { label: "אימוג'י", gender: "m" },
57
- uuid: { label: "UUID", gender: "m" },
58
- nanoid: { label: "nanoid", gender: "m" },
59
- guid: { label: "GUID", gender: "m" },
60
- cuid: { label: "cuid", gender: "m" },
61
- cuid2: { label: "cuid2", gender: "m" },
62
- ulid: { label: "ULID", gender: "m" },
63
- xid: { label: "XID", gender: "m" },
64
- ksuid: { label: "KSUID", gender: "m" },
65
- datetime: { label: "תאריך וזמן ISO", gender: "m" },
66
- date: { label: "תאריך ISO", gender: "m" },
67
- time: { label: "זמן ISO", gender: "m" },
68
- duration: { label: "משך זמן ISO", gender: "m" },
69
- ipv4: { label: "כתובת IPv4", gender: "f" },
70
- ipv6: { label: "כתובת IPv6", gender: "f" },
71
- cidrv4: { label: "טווח IPv4", gender: "m" },
72
- cidrv6: { label: "טווח IPv6", gender: "m" },
73
- base64: { label: "מחרוזת בבסיס 64", gender: "f" },
74
- base64url: { label: "מחרוזת בבסיס 64 לכתובות רשת", gender: "f" },
75
- json_string: { label: "מחרוזת JSON", gender: "f" },
76
- e164: { label: "מספר E.164", gender: "m" },
77
- jwt: { label: "JWT", gender: "m" },
78
- ends_with: { label: "קלט", gender: "m" },
79
- includes: { label: "קלט", gender: "m" },
80
- lowercase: { label: "קלט", gender: "m" },
81
- starts_with: { label: "קלט", gender: "m" },
82
- uppercase: { label: "קלט", gender: "m" },
83
- };
84
- const TypeDictionary = {
85
- nan: "NaN",
86
- };
87
- return (issue) => {
88
- switch (issue.code) {
89
- case "invalid_type": {
90
- // Expected type: show without definite article for clearer Hebrew
91
- const expectedKey = issue.expected;
92
- const expected = TypeDictionary[expectedKey ?? ""] ?? typeLabel(expectedKey);
93
- // Received: show localized label if known, otherwise constructor/raw
94
- const receivedType = util.parsedType(issue.input);
95
- const received = TypeDictionary[receivedType] ?? TypeNames[receivedType]?.label ?? 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
- }
105
- // Join values with proper Hebrew formatting
106
- const stringified = issue.values.map((v) => util.stringifyPrimitive(v));
107
- if (issue.values.length === 2) {
108
- return `ערך לא תקין: האפשרויות המתאימות הן ${stringified[0]} או ${stringified[1]}`;
109
- }
110
- // For 3+ values: "a", "b" או "c"
111
- const lastValue = stringified[stringified.length - 1];
112
- const restValues = stringified.slice(0, -1).join(", ");
113
- return `ערך לא תקין: האפשרויות המתאימות הן ${restValues} או ${lastValue}`;
114
- }
115
- case "too_big": {
116
- const sizing = getSizing(issue.origin);
117
- const subject = withDefinite(issue.origin ?? "value");
118
- if (issue.origin === "string") {
119
- // Special handling for strings - more natural Hebrew
120
- return `${sizing?.longLabel ?? "ארוך"} מדי: ${subject} צריכה להכיל ${issue.maximum.toString()} ${sizing?.unit ?? ""} ${issue.inclusive ? "או פחות" : "לכל היותר"}`.trim();
121
- }
122
- if (issue.origin === "number") {
123
- // Natural Hebrew for numbers
124
- const comparison = issue.inclusive ? `קטן או שווה ל-${issue.maximum}` : `קטן מ-${issue.maximum}`;
125
- return `גדול מדי: ${subject} צריך להיות ${comparison}`;
126
- }
127
- if (issue.origin === "array" || issue.origin === "set") {
128
- // Natural Hebrew for arrays and sets
129
- const verb = issue.origin === "set" ? "צריכה" : "צריך";
130
- const comparison = issue.inclusive
131
- ? `${issue.maximum} ${sizing?.unit ?? ""} או פחות`
132
- : `פחות מ-${issue.maximum} ${sizing?.unit ?? ""}`;
133
- return `גדול מדי: ${subject} ${verb} להכיל ${comparison}`.trim();
134
- }
135
- const adj = issue.inclusive ? "<=" : "<";
136
- const be = verbFor(issue.origin ?? "value");
137
- if (sizing?.unit) {
138
- return `${sizing.longLabel} מדי: ${subject} ${be} ${adj}${issue.maximum.toString()} ${sizing.unit}`;
139
- }
140
- return `${sizing?.longLabel ?? "גדול"} מדי: ${subject} ${be} ${adj}${issue.maximum.toString()}`;
141
- }
142
- case "too_small": {
143
- const sizing = getSizing(issue.origin);
144
- const subject = withDefinite(issue.origin ?? "value");
145
- if (issue.origin === "string") {
146
- // Special handling for strings - more natural Hebrew
147
- return `${sizing?.shortLabel ?? "קצר"} מדי: ${subject} צריכה להכיל ${issue.minimum.toString()} ${sizing?.unit ?? ""} ${issue.inclusive ? "או יותר" : "לפחות"}`.trim();
148
- }
149
- if (issue.origin === "number") {
150
- // Natural Hebrew for numbers
151
- const comparison = issue.inclusive ? `גדול או שווה ל-${issue.minimum}` : `גדול מ-${issue.minimum}`;
152
- return `קטן מדי: ${subject} צריך להיות ${comparison}`;
153
- }
154
- if (issue.origin === "array" || issue.origin === "set") {
155
- // Natural Hebrew for arrays and sets
156
- const verb = issue.origin === "set" ? "צריכה" : "צריך";
157
- // Special case for singular (minimum === 1)
158
- if (issue.minimum === 1 && issue.inclusive) {
159
- const singularPhrase = issue.origin === "set" ? "לפחות פריט אחד" : "לפחות פריט אחד";
160
- return `קטן מדי: ${subject} ${verb} להכיל ${singularPhrase}`;
161
- }
162
- const comparison = issue.inclusive
163
- ? `${issue.minimum} ${sizing?.unit ?? ""} או יותר`
164
- : `יותר מ-${issue.minimum} ${sizing?.unit ?? ""}`;
165
- return `קטן מדי: ${subject} ${verb} להכיל ${comparison}`.trim();
166
- }
167
- const adj = issue.inclusive ? ">=" : ">";
168
- const be = verbFor(issue.origin ?? "value");
169
- if (sizing?.unit) {
170
- return `${sizing.shortLabel} מדי: ${subject} ${be} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
171
- }
172
- return `${sizing?.shortLabel ?? "קטן"} מדי: ${subject} ${be} ${adj}${issue.minimum.toString()}`;
173
- }
174
- case "invalid_format": {
175
- const _issue = issue;
176
- // These apply to strings — use feminine grammar + ה׳ הידיעה
177
- if (_issue.format === "starts_with")
178
- return `המחרוזת חייבת להתחיל ב "${_issue.prefix}"`;
179
- if (_issue.format === "ends_with")
180
- return `המחרוזת חייבת להסתיים ב "${_issue.suffix}"`;
181
- if (_issue.format === "includes")
182
- return `המחרוזת חייבת לכלול "${_issue.includes}"`;
183
- if (_issue.format === "regex")
184
- return `המחרוזת חייבת להתאים לתבנית ${_issue.pattern}`;
185
- // Handle gender agreement for formats
186
- const nounEntry = FormatDictionary[_issue.format];
187
- const noun = nounEntry?.label ?? _issue.format;
188
- const gender = nounEntry?.gender ?? "m";
189
- const adjective = gender === "f" ? "תקינה" : "תקין";
190
- return `${noun} לא ${adjective}`;
191
- }
192
- case "not_multiple_of":
193
- return `מספר לא תקין: חייב להיות מכפלה של ${issue.divisor}`;
194
- case "unrecognized_keys":
195
- return `מפתח${issue.keys.length > 1 ? "ות" : ""} לא מזוה${issue.keys.length > 1 ? "ים" : "ה"}: ${util.joinValues(issue.keys, ", ")}`;
196
- case "invalid_key": {
197
- return `שדה לא תקין באובייקט`;
198
- }
199
- case "invalid_union":
200
- return "קלט לא תקין";
201
- case "invalid_element": {
202
- const place = withDefinite(issue.origin ?? "array");
203
- return `ערך לא תקין ב${place}`;
204
- }
205
- default:
206
- return `קלט לא תקין`;
207
- }
208
- };
209
- };
210
- export default function () {
211
- return {
212
- localeError: error(),
213
- };
214
- }
1
+ import * as util from "../core/util.js";
2
+ const error = () => {
3
+ // Hebrew labels + grammatical gender
4
+ const TypeNames = {
5
+ string: { label: "מחרוזת", gender: "f" },
6
+ number: { label: "מספר", gender: "m" },
7
+ boolean: { label: "ערך בוליאני", gender: "m" },
8
+ bigint: { label: "BigInt", gender: "m" },
9
+ date: { label: "תאריך", gender: "m" },
10
+ array: { label: "מערך", gender: "m" },
11
+ object: { label: "אובייקט", gender: "m" },
12
+ null: { label: "ערך ריק (null)", gender: "m" },
13
+ undefined: { label: "ערך לא מוגדר (undefined)", gender: "m" },
14
+ symbol: { label: "סימבול (Symbol)", gender: "m" },
15
+ function: { label: "פונקציה", gender: "f" },
16
+ map: { label: "מפה (Map)", gender: "f" },
17
+ set: { label: "קבוצה (Set)", gender: "f" },
18
+ file: { label: "קובץ", gender: "m" },
19
+ promise: { label: "Promise", gender: "m" },
20
+ NaN: { label: "NaN", gender: "m" },
21
+ unknown: { label: "ערך לא ידוע", gender: "m" },
22
+ value: { label: "ערך", gender: "m" },
23
+ };
24
+ // Sizing units for size-related messages + localized origin labels
25
+ const Sizable = {
26
+ string: { unit: "תווים", shortLabel: "קצר", longLabel: "ארוך" },
27
+ file: { unit: "בייטים", shortLabel: "קטן", longLabel: "גדול" },
28
+ array: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" },
29
+ set: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" },
30
+ number: { unit: "", shortLabel: "קטן", longLabel: "גדול" }, // no unit
31
+ };
32
+ // Helpers — labels, articles, and verbs
33
+ const typeEntry = (t) => (t ? TypeNames[t] : undefined);
34
+ const typeLabel = (t) => {
35
+ const e = typeEntry(t);
36
+ if (e)
37
+ return e.label;
38
+ // fallback: show raw string if unknown
39
+ return t ?? TypeNames.unknown.label;
40
+ };
41
+ const withDefinite = (t) => `ה${typeLabel(t)}`;
42
+ const verbFor = (t) => {
43
+ const e = typeEntry(t);
44
+ const gender = e?.gender ?? "m";
45
+ return gender === "f" ? "צריכה להיות" : "צריך להיות";
46
+ };
47
+ const getSizing = (origin) => {
48
+ if (!origin)
49
+ return null;
50
+ return Sizable[origin] ?? null;
51
+ };
52
+ const FormatDictionary = {
53
+ regex: { label: "קלט", gender: "m" },
54
+ email: { label: "כתובת אימייל", gender: "f" },
55
+ url: { label: "כתובת רשת", gender: "f" },
56
+ emoji: { label: "אימוג'י", gender: "m" },
57
+ uuid: { label: "UUID", gender: "m" },
58
+ nanoid: { label: "nanoid", gender: "m" },
59
+ guid: { label: "GUID", gender: "m" },
60
+ cuid: { label: "cuid", gender: "m" },
61
+ cuid2: { label: "cuid2", gender: "m" },
62
+ ulid: { label: "ULID", gender: "m" },
63
+ xid: { label: "XID", gender: "m" },
64
+ ksuid: { label: "KSUID", gender: "m" },
65
+ datetime: { label: "תאריך וזמן ISO", gender: "m" },
66
+ date: { label: "תאריך ISO", gender: "m" },
67
+ time: { label: "זמן ISO", gender: "m" },
68
+ duration: { label: "משך זמן ISO", gender: "m" },
69
+ ipv4: { label: "כתובת IPv4", gender: "f" },
70
+ ipv6: { label: "כתובת IPv6", gender: "f" },
71
+ cidrv4: { label: "טווח IPv4", gender: "m" },
72
+ cidrv6: { label: "טווח IPv6", gender: "m" },
73
+ base64: { label: "מחרוזת בבסיס 64", gender: "f" },
74
+ base64url: { label: "מחרוזת בבסיס 64 לכתובות רשת", gender: "f" },
75
+ json_string: { label: "מחרוזת JSON", gender: "f" },
76
+ e164: { label: "מספר E.164", gender: "m" },
77
+ jwt: { label: "JWT", gender: "m" },
78
+ ends_with: { label: "קלט", gender: "m" },
79
+ includes: { label: "קלט", gender: "m" },
80
+ lowercase: { label: "קלט", gender: "m" },
81
+ starts_with: { label: "קלט", gender: "m" },
82
+ uppercase: { label: "קלט", gender: "m" },
83
+ };
84
+ const TypeDictionary = {
85
+ nan: "NaN",
86
+ };
87
+ return (issue) => {
88
+ switch (issue.code) {
89
+ case "invalid_type": {
90
+ // Expected type: show without definite article for clearer Hebrew
91
+ const expectedKey = issue.expected;
92
+ const expected = TypeDictionary[expectedKey ?? ""] ?? typeLabel(expectedKey);
93
+ // Received: show localized label if known, otherwise constructor/raw
94
+ const receivedType = util.parsedType(issue.input);
95
+ const received = TypeDictionary[receivedType] ?? TypeNames[receivedType]?.label ?? 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
+ }
105
+ // Join values with proper Hebrew formatting
106
+ const stringified = issue.values.map((v) => util.stringifyPrimitive(v));
107
+ if (issue.values.length === 2) {
108
+ return `ערך לא תקין: האפשרויות המתאימות הן ${stringified[0]} או ${stringified[1]}`;
109
+ }
110
+ // For 3+ values: "a", "b" או "c"
111
+ const lastValue = stringified[stringified.length - 1];
112
+ const restValues = stringified.slice(0, -1).join(", ");
113
+ return `ערך לא תקין: האפשרויות המתאימות הן ${restValues} או ${lastValue}`;
114
+ }
115
+ case "too_big": {
116
+ const sizing = getSizing(issue.origin);
117
+ const subject = withDefinite(issue.origin ?? "value");
118
+ if (issue.origin === "string") {
119
+ // Special handling for strings - more natural Hebrew
120
+ return `${sizing?.longLabel ?? "ארוך"} מדי: ${subject} צריכה להכיל ${issue.maximum.toString()} ${sizing?.unit ?? ""} ${issue.inclusive ? "או פחות" : "לכל היותר"}`.trim();
121
+ }
122
+ if (issue.origin === "number") {
123
+ // Natural Hebrew for numbers
124
+ const comparison = issue.inclusive ? `קטן או שווה ל-${issue.maximum}` : `קטן מ-${issue.maximum}`;
125
+ return `גדול מדי: ${subject} צריך להיות ${comparison}`;
126
+ }
127
+ if (issue.origin === "array" || issue.origin === "set") {
128
+ // Natural Hebrew for arrays and sets
129
+ const verb = issue.origin === "set" ? "צריכה" : "צריך";
130
+ const comparison = issue.inclusive
131
+ ? `${issue.maximum} ${sizing?.unit ?? ""} או פחות`
132
+ : `פחות מ-${issue.maximum} ${sizing?.unit ?? ""}`;
133
+ return `גדול מדי: ${subject} ${verb} להכיל ${comparison}`.trim();
134
+ }
135
+ const adj = issue.inclusive ? "<=" : "<";
136
+ const be = verbFor(issue.origin ?? "value");
137
+ if (sizing?.unit) {
138
+ return `${sizing.longLabel} מדי: ${subject} ${be} ${adj}${issue.maximum.toString()} ${sizing.unit}`;
139
+ }
140
+ return `${sizing?.longLabel ?? "גדול"} מדי: ${subject} ${be} ${adj}${issue.maximum.toString()}`;
141
+ }
142
+ case "too_small": {
143
+ const sizing = getSizing(issue.origin);
144
+ const subject = withDefinite(issue.origin ?? "value");
145
+ if (issue.origin === "string") {
146
+ // Special handling for strings - more natural Hebrew
147
+ return `${sizing?.shortLabel ?? "קצר"} מדי: ${subject} צריכה להכיל ${issue.minimum.toString()} ${sizing?.unit ?? ""} ${issue.inclusive ? "או יותר" : "לפחות"}`.trim();
148
+ }
149
+ if (issue.origin === "number") {
150
+ // Natural Hebrew for numbers
151
+ const comparison = issue.inclusive ? `גדול או שווה ל-${issue.minimum}` : `גדול מ-${issue.minimum}`;
152
+ return `קטן מדי: ${subject} צריך להיות ${comparison}`;
153
+ }
154
+ if (issue.origin === "array" || issue.origin === "set") {
155
+ // Natural Hebrew for arrays and sets
156
+ const verb = issue.origin === "set" ? "צריכה" : "צריך";
157
+ // Special case for singular (minimum === 1)
158
+ if (issue.minimum === 1 && issue.inclusive) {
159
+ const singularPhrase = issue.origin === "set" ? "לפחות פריט אחד" : "לפחות פריט אחד";
160
+ return `קטן מדי: ${subject} ${verb} להכיל ${singularPhrase}`;
161
+ }
162
+ const comparison = issue.inclusive
163
+ ? `${issue.minimum} ${sizing?.unit ?? ""} או יותר`
164
+ : `יותר מ-${issue.minimum} ${sizing?.unit ?? ""}`;
165
+ return `קטן מדי: ${subject} ${verb} להכיל ${comparison}`.trim();
166
+ }
167
+ const adj = issue.inclusive ? ">=" : ">";
168
+ const be = verbFor(issue.origin ?? "value");
169
+ if (sizing?.unit) {
170
+ return `${sizing.shortLabel} מדי: ${subject} ${be} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
171
+ }
172
+ return `${sizing?.shortLabel ?? "קטן"} מדי: ${subject} ${be} ${adj}${issue.minimum.toString()}`;
173
+ }
174
+ case "invalid_format": {
175
+ const _issue = issue;
176
+ // These apply to strings — use feminine grammar + ה׳ הידיעה
177
+ if (_issue.format === "starts_with")
178
+ return `המחרוזת חייבת להתחיל ב "${_issue.prefix}"`;
179
+ if (_issue.format === "ends_with")
180
+ return `המחרוזת חייבת להסתיים ב "${_issue.suffix}"`;
181
+ if (_issue.format === "includes")
182
+ return `המחרוזת חייבת לכלול "${_issue.includes}"`;
183
+ if (_issue.format === "regex")
184
+ return `המחרוזת חייבת להתאים לתבנית ${_issue.pattern}`;
185
+ // Handle gender agreement for formats
186
+ const nounEntry = FormatDictionary[_issue.format];
187
+ const noun = nounEntry?.label ?? _issue.format;
188
+ const gender = nounEntry?.gender ?? "m";
189
+ const adjective = gender === "f" ? "תקינה" : "תקין";
190
+ return `${noun} לא ${adjective}`;
191
+ }
192
+ case "not_multiple_of":
193
+ return `מספר לא תקין: חייב להיות מכפלה של ${issue.divisor}`;
194
+ case "unrecognized_keys":
195
+ return `מפתח${issue.keys.length > 1 ? "ות" : ""} לא מזוה${issue.keys.length > 1 ? "ים" : "ה"}: ${util.joinValues(issue.keys, ", ")}`;
196
+ case "invalid_key": {
197
+ return `שדה לא תקין באובייקט`;
198
+ }
199
+ case "invalid_union":
200
+ return "קלט לא תקין";
201
+ case "invalid_element": {
202
+ const place = withDefinite(issue.origin ?? "array");
203
+ return `ערך לא תקין ב${place}`;
204
+ }
205
+ default:
206
+ return `קלט לא תקין`;
207
+ }
208
+ };
209
+ };
210
+ export default function () {
211
+ return {
212
+ localeError: error(),
213
+ };
214
+ }