@dsrcjs/ai-widget 0.0.0-stage → 1.0.6

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.
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,288 @@
1
+ export type Lang = 'kk' | 'ru' | 'en';
2
+ export declare const LANGS: readonly Lang[];
3
+ /** Explicit option → `<html lang>` → browser language → `ru`. Region suffixes (`ru-RU`) are ignored. */
4
+ export declare const resolveLang: (explicit?: string | null) => Lang;
5
+ /** Russian is the reference: every other language must have exactly its keys (i18n.test.ts). */
6
+ declare const ru: {
7
+ title: string;
8
+ open: string;
9
+ unreadAnswers: string;
10
+ ask: string;
11
+ close: string;
12
+ history: string;
13
+ closeHistory: string;
14
+ newChat: string;
15
+ untitled: string;
16
+ historyEmpty: string;
17
+ historyError: string;
18
+ delete: string;
19
+ deleteConfirm: string;
20
+ deleteYes: string;
21
+ deleteNo: string;
22
+ deleteError: string;
23
+ modeLabel: string;
24
+ 'health.idle': string;
25
+ 'health.busy': string;
26
+ 'health.unavailable': string;
27
+ placeholder: string;
28
+ inputLabel: string;
29
+ send: string;
30
+ stop: string;
31
+ attach: string;
32
+ attachOne: string;
33
+ attachHint: string;
34
+ disclaimer: string;
35
+ removeFile: string;
36
+ counter: string;
37
+ counterLimit: string;
38
+ counterOver: string;
39
+ fileTooLarge: string;
40
+ fileType: string;
41
+ modeUnavailable: string;
42
+ greeting: string;
43
+ loading: string;
44
+ configError: string;
45
+ overloaded: string;
46
+ retry: string;
47
+ dismiss: string;
48
+ scrollDown: string;
49
+ settings: string;
50
+ 'settings.language': string;
51
+ 'settings.theme': string;
52
+ 'settings.themeLight': string;
53
+ 'settings.themeDark': string;
54
+ 'settings.themeAuto': string;
55
+ 'settings.model': string;
56
+ 'settings.modelHint': string;
57
+ 'settings.shortcuts': string;
58
+ 'shortcut.search': string;
59
+ 'shortcut.newChat': string;
60
+ 'shortcut.sidebar': string;
61
+ 'shortcut.close': string;
62
+ search: string;
63
+ searchEmpty: string;
64
+ collapseSidebar: string;
65
+ expandSidebar: string;
66
+ expand: string;
67
+ shrink: string;
68
+ examples: string;
69
+ 'examples.whatCanDo': string;
70
+ 'group.pinned': string;
71
+ 'group.today': string;
72
+ 'group.yesterday': string;
73
+ 'group.week': string;
74
+ 'group.earlier': string;
75
+ 'errors.thread_busy': string;
76
+ 'errors.mode_overloaded': string;
77
+ 'errors.daily_limit': string;
78
+ 'errors.rate_limit': string;
79
+ 'errors.ip_limit': string;
80
+ 'errors.concurrency_limit': string;
81
+ 'errors.file_too_large': string;
82
+ 'errors.file_not_allowed': string;
83
+ 'errors.invalid_query': string;
84
+ 'errors.invalid_parent': string;
85
+ 'errors.mode_not_found': string;
86
+ 'errors.thread_not_found': string;
87
+ 'errors.interrupted': string;
88
+ 'errors.code': string;
89
+ 'errors.generic': string;
90
+ 'errors.network': string;
91
+ 'errors.render': string;
92
+ 'agent.thinking': string;
93
+ 'agent.done': string;
94
+ 'agent.stopped': string;
95
+ 'agent.stopping': string;
96
+ 'agent.failed': string;
97
+ 'agent.interrupted': string;
98
+ 'agent.answerStopped': string;
99
+ 'agent.seconds': string;
100
+ 'agent.attempt': string;
101
+ 'agent.showSteps': string;
102
+ 'agent.hideSteps': string;
103
+ 'steps.router': string;
104
+ 'steps.context_builder': string;
105
+ 'steps.sql_architect': string;
106
+ 'steps.executor': string;
107
+ 'steps.responder': string;
108
+ 'steps.rag': string;
109
+ 'steps.sql': string;
110
+ 'steps.document': string;
111
+ 'steps.understand': string;
112
+ 'steps.search_law': string;
113
+ 'steps.run_sql': string;
114
+ 'steps.run_query': string;
115
+ 'steps.data': string;
116
+ 'steps.lookup_taxpayer': string;
117
+ 'steps.find_taxpayer': string;
118
+ 'steps.ask_clarification': string;
119
+ 'steps.answer': string;
120
+ 'steps.unknown': string;
121
+ copy: string;
122
+ copied: string;
123
+ download: string;
124
+ regenerate: string;
125
+ edit: string;
126
+ editLabel: string;
127
+ cancel: string;
128
+ actionsLabel: string;
129
+ rate: string;
130
+ ratingError: string;
131
+ feedbackOpen: string;
132
+ feedbackEdit: string;
133
+ feedbackLabel: string;
134
+ feedbackPlaceholder: string;
135
+ save: string;
136
+ 'branch.label': string;
137
+ 'branch.prev': string;
138
+ 'branch.next': string;
139
+ 'branch.error': string;
140
+ 'limit.remaining': string;
141
+ 'limit.exhausted': string;
142
+ 'limit.until': string;
143
+ 'blocks.data': string;
144
+ 'blocks.hideData': string;
145
+ 'blocks.methodology': string;
146
+ 'blocks.passport': string;
147
+ 'blocks.indicator': string;
148
+ 'blocks.territory': string;
149
+ 'blocks.period': string;
150
+ 'blocks.breakdown': string;
151
+ 'blocks.breakdown.sex': string;
152
+ 'blocks.breakdown.age': string;
153
+ 'blocks.breakdown.urban_rural': string;
154
+ 'blocks.breakdown.activity': string;
155
+ 'blocks.breakdown.item': string;
156
+ 'blocks.substituted': string;
157
+ 'blocks.alternatives': string;
158
+ 'blocks.table': string;
159
+ 'blocks.tableSearch': string;
160
+ 'blocks.tableEmpty': string;
161
+ 'blocks.page': string;
162
+ 'blocks.prevPage': string;
163
+ 'blocks.nextPage': string;
164
+ 'blocks.truncated': string;
165
+ 'blocks.catalogMore': string;
166
+ 'blocks.catalogExamples': string;
167
+ 'blocks.options': string;
168
+ 'blocks.default': string;
169
+ 'blocks.freeTextHint': string;
170
+ 'blocks.findOption': string;
171
+ 'blocks.chosen': string;
172
+ 'blocks.continue': string;
173
+ 'blocks.cancelPlan': string;
174
+ 'blocks.expired': string;
175
+ 'blocks.askAgain': string;
176
+ 'blocks.dashboard': string;
177
+ 'blocks.hideDashboard': string;
178
+ 'chart.kinds': string;
179
+ 'chart.kind.bar': string;
180
+ 'chart.kind.column': string;
181
+ 'chart.kind.pie': string;
182
+ 'chart.kind.line': string;
183
+ 'chart.kind.area': string;
184
+ 'chart.national': string;
185
+ 'chart.top': string;
186
+ 'chart.label': string;
187
+ 'files.list': string;
188
+ 'files.report': string;
189
+ 'files.document': string;
190
+ 'files.presentation': string;
191
+ 'files.excel': string;
192
+ 'files.csv': string;
193
+ 'files.failed': string;
194
+ 'report.create': string;
195
+ 'report.pending': string;
196
+ 'report.failed': string;
197
+ 'report.retry': string;
198
+ 'report.expired': string;
199
+ 'dashboard.eyebrow': string;
200
+ 'dashboard.label': string;
201
+ 'dashboard.sections': string;
202
+ 'dashboard.regions': string;
203
+ 'dashboard.items': string;
204
+ 'dashboard.openSource': string;
205
+ 'dashboard.methodology': string;
206
+ 'dashboard.fullscreen': string;
207
+ 'dashboard.collapse': string;
208
+ 'dashboard.close': string;
209
+ 'dashboard.chatTab': string;
210
+ 'dashboard.dashboardTab': string;
211
+ 'dashboard.view': string;
212
+ 'dashboard.region': string;
213
+ 'dashboard.allRegions': string;
214
+ 'dashboard.period': string;
215
+ 'dashboard.mode.label': string;
216
+ 'dashboard.mode.value': string;
217
+ 'dashboard.mode.deviation': string;
218
+ 'dashboard.mode.change': string;
219
+ 'dashboard.base.label': string;
220
+ 'dashboard.base.median': string;
221
+ 'dashboard.base.national': string;
222
+ 'dashboard.noPrevious': string;
223
+ 'dashboard.noNational': string;
224
+ 'dashboard.fewRegions': string;
225
+ 'dashboard.ranking': string;
226
+ 'dashboard.trend': string;
227
+ 'dashboard.findings': string;
228
+ 'dashboard.data': string;
229
+ 'dashboard.kpis': string;
230
+ 'dashboard.table.rank': string;
231
+ 'dashboard.table.position': string;
232
+ 'dashboard.table.value': string;
233
+ 'dashboard.table.share': string;
234
+ 'dashboard.table.deviation': string;
235
+ 'dashboard.table.change': string;
236
+ 'dashboard.source': string;
237
+ 'dashboard.points': string;
238
+ 'dashboard.kpi.national': string;
239
+ 'dashboard.kpi.max': string;
240
+ 'dashboard.kpi.min': string;
241
+ 'dashboard.kpi.median': string;
242
+ 'dashboard.kpi.spread': string;
243
+ 'dashboard.kpi.gap': string;
244
+ 'dashboard.kpi.last': string;
245
+ 'dashboard.kpi.first': string;
246
+ 'dashboard.kpi.change': string;
247
+ 'dashboard.kpi.place': string;
248
+ 'dashboard.kpi.placeOf': string;
249
+ 'dashboard.kpi.deviation': string;
250
+ 'dashboard.kpi.previous': string;
251
+ 'steps.counter': string;
252
+ 'feedback.reasonsLabel': string;
253
+ 'feedback.reason.wrong_number': string;
254
+ 'feedback.reason.wrong_indicator': string;
255
+ 'feedback.reason.wrong_territory': string;
256
+ 'feedback.reason.wrong_period': string;
257
+ 'feedback.reason.not_answered': string;
258
+ 'feedback.reason.language': string;
259
+ 'feedback.reason.slow': string;
260
+ 'feedback.reason.other': string;
261
+ 'intro.title': string;
262
+ 'intro.continue': string;
263
+ source: string;
264
+ 'shell.siteBlocked': string;
265
+ 'shell.siteBlockedHint': string;
266
+ 'modes.none': string;
267
+ 'attachment.sending': string;
268
+ 'agent.steps': string;
269
+ 'agent.unfinished': string;
270
+ rateGroup: string;
271
+ 'blocks.catalogTitle': string;
272
+ 'blocks.catalogSections': string;
273
+ 'blocks.catalogIndicators': string;
274
+ 'blocks.catalogSendHint': string;
275
+ 'blocks.clarification': string;
276
+ 'files.expired': string;
277
+ 'files.notFound': string;
278
+ 'files.unavailable': string;
279
+ };
280
+ export type MessageKey = keyof typeof ru;
281
+ export declare const DICT: Record<Lang, Record<MessageKey, string>>;
282
+ export type Vars = Record<string, string | number>;
283
+ /** `{name}` placeholders; a missing variable stays as is, so a typo is visible instead of silently empty. */
284
+ export declare const translate: (lang: Lang, key: MessageKey, vars?: Vars) => string;
285
+ export declare const hasKey: (key: string) => key is MessageKey;
286
+ /** A localized backend value (`{kk, ru, en}`): the language, then Russian, then any non-empty one. */
287
+ export declare const pickLocalized: (value: Partial<Record<Lang, string>> | null | undefined, lang: Lang) => string;
288
+ export {};