@alwith/module-chat 0.1.0

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 (171) hide show
  1. package/LICENSE +94 -0
  2. package/README.md +54 -0
  3. package/THIRD_PARTY_NOTICES.md +43 -0
  4. package/dist/activity-host.d.ts +32 -0
  5. package/dist/activity-host.js +1 -0
  6. package/dist/approval/choice-elicitation-form.d.ts +15 -0
  7. package/dist/approval/choice-elicitation-form.js +1 -0
  8. package/dist/approval/choice-schema.d.ts +18 -0
  9. package/dist/approval/choice-schema.js +1 -0
  10. package/dist/approval/permission-options.d.ts +7 -0
  11. package/dist/approval/permission-options.js +1 -0
  12. package/dist/approval/permission-view.d.ts +19 -0
  13. package/dist/approval/permission-view.js +1 -0
  14. package/dist/approval/schema-elicitation-form.d.ts +29 -0
  15. package/dist/approval/schema-elicitation-form.js +1 -0
  16. package/dist/approval/url-elicitation-card.d.ts +8 -0
  17. package/dist/approval/url-elicitation-card.js +1 -0
  18. package/dist/codex/activity-group.d.ts +15 -0
  19. package/dist/codex/activity-group.js +6 -0
  20. package/dist/codex/assistant-message.d.ts +43 -0
  21. package/dist/codex/assistant-message.js +2 -0
  22. package/dist/codex/disclosure-state.d.ts +2 -0
  23. package/dist/codex/disclosure-state.js +1 -0
  24. package/dist/codex/edited-files-card.d.ts +15 -0
  25. package/dist/codex/edited-files-card.js +2 -0
  26. package/dist/codex/markdown-renderer.d.ts +11 -0
  27. package/dist/codex/markdown-renderer.js +6 -0
  28. package/dist/codex/markdown.css +760 -0
  29. package/dist/codex/navigation-audio.d.ts +18 -0
  30. package/dist/codex/navigation-audio.js +1 -0
  31. package/dist/codex/navigation-instruments.d.ts +54 -0
  32. package/dist/codex/navigation-instruments.js +1 -0
  33. package/dist/codex/navigation-preview.d.ts +8 -0
  34. package/dist/codex/navigation-preview.js +1 -0
  35. package/dist/codex/navigation-rail.css +216 -0
  36. package/dist/codex/navigation-rail.d.ts +25 -0
  37. package/dist/codex/navigation-rail.js +1 -0
  38. package/dist/codex/patch-view.d.ts +8 -0
  39. package/dist/codex/patch-view.js +2 -0
  40. package/dist/codex/plan.d.ts +4 -0
  41. package/dist/codex/plan.js +1 -0
  42. package/dist/codex/styles.css +1238 -0
  43. package/dist/codex/terminal-output.d.ts +3 -0
  44. package/dist/codex/terminal-output.js +1 -0
  45. package/dist/codex/thread-virtualizer.d.ts +52 -0
  46. package/dist/codex/thread-virtualizer.js +1 -0
  47. package/dist/codex/user-message.d.ts +30 -0
  48. package/dist/codex/user-message.js +1 -0
  49. package/dist/codex/virtualized-turn-list.d.ts +16 -0
  50. package/dist/codex/virtualized-turn-list.js +1 -0
  51. package/dist/composer/completion-filter.d.ts +12 -0
  52. package/dist/composer/completion-filter.js +1 -0
  53. package/dist/composer/completion-menu.d.ts +21 -0
  54. package/dist/composer/completion-menu.js +3 -0
  55. package/dist/composer/completion-trigger.d.ts +8 -0
  56. package/dist/composer/completion-trigger.js +3 -0
  57. package/dist/composer/effort-slider.d.ts +10 -0
  58. package/dist/composer/effort-slider.js +1 -0
  59. package/dist/composer/menu-radio.d.ts +15 -0
  60. package/dist/composer/menu-radio.js +1 -0
  61. package/dist/composer/model-select.d.ts +56 -0
  62. package/dist/composer/model-select.js +1 -0
  63. package/dist/composer/permission-mode-select.d.ts +13 -0
  64. package/dist/composer/permission-mode-select.js +1 -0
  65. package/dist/composer/prompt-input-attachments.d.ts +16 -0
  66. package/dist/composer/prompt-input-attachments.js +1 -0
  67. package/dist/composer/prompt-input-clipboard.d.ts +10 -0
  68. package/dist/composer/prompt-input-clipboard.js +1 -0
  69. package/dist/composer/prompt-input-context.d.ts +59 -0
  70. package/dist/composer/prompt-input-context.js +1 -0
  71. package/dist/composer/prompt-input-textarea.d.ts +13 -0
  72. package/dist/composer/prompt-input-textarea.js +3 -0
  73. package/dist/composer/prompt-input.d.ts +44 -0
  74. package/dist/composer/prompt-input.js +1 -0
  75. package/dist/image-lightbox.d.ts +5 -0
  76. package/dist/image-lightbox.js +1 -0
  77. package/dist/image-preview-dialog.d.ts +14 -0
  78. package/dist/image-preview-dialog.js +1 -0
  79. package/dist/lib/code-highlighter.d.ts +27 -0
  80. package/dist/lib/code-highlighter.js +1 -0
  81. package/dist/lib/code-highlighter.worker.d.ts +1 -0
  82. package/dist/lib/code-highlighter.worker.js +1 -0
  83. package/dist/lib/fuzzy.d.ts +11 -0
  84. package/dist/lib/fuzzy.js +1 -0
  85. package/dist/lib/group-blocks.d.ts +5 -0
  86. package/dist/lib/group-blocks.js +1 -0
  87. package/dist/lib/image-encode.d.ts +1 -0
  88. package/dist/lib/image-encode.js +1 -0
  89. package/dist/lib/limits.d.ts +5 -0
  90. package/dist/lib/limits.js +1 -0
  91. package/dist/lib/markdown-parser.d.ts +34 -0
  92. package/dist/lib/markdown-parser.js +1 -0
  93. package/dist/lib/markdown-parser.worker.d.ts +1 -0
  94. package/dist/lib/markdown-parser.worker.js +1 -0
  95. package/dist/lib/markdown-rules.d.ts +9 -0
  96. package/dist/lib/markdown-rules.js +1 -0
  97. package/dist/lib/pointer-centered-zoom.d.ts +13 -0
  98. package/dist/lib/pointer-centered-zoom.js +1 -0
  99. package/dist/lib/prepare-prompt-files.d.ts +7 -0
  100. package/dist/lib/prepare-prompt-files.js +1 -0
  101. package/dist/lib/stream-entry.d.ts +28 -0
  102. package/dist/lib/stream-entry.js +0 -0
  103. package/dist/lib/stream-style.d.ts +15 -0
  104. package/dist/lib/stream-style.js +2 -0
  105. package/dist/lib/streaming-markdown.d.ts +4 -0
  106. package/dist/lib/streaming-markdown.js +2 -0
  107. package/dist/locales.d.ts +489 -0
  108. package/dist/locales.js +1 -0
  109. package/dist/search/chat-search.d.ts +19 -0
  110. package/dist/search/chat-search.js +1 -0
  111. package/dist/search/dom-matches.d.ts +1 -0
  112. package/dist/search/dom-matches.js +1 -0
  113. package/dist/search/find-bar.d.ts +14 -0
  114. package/dist/search/find-bar.js +1 -0
  115. package/dist/search/literal-matches.d.ts +12 -0
  116. package/dist/search/literal-matches.js +1 -0
  117. package/dist/types.d.ts +139 -0
  118. package/dist/types.js +0 -0
  119. package/dist/ui/badge.d.ts +7 -0
  120. package/dist/ui/badge.js +1 -0
  121. package/dist/ui/button.d.ts +8 -0
  122. package/dist/ui/button.js +1 -0
  123. package/dist/ui/card.d.ts +11 -0
  124. package/dist/ui/card.js +1 -0
  125. package/dist/ui/checkbox.d.ts +3 -0
  126. package/dist/ui/checkbox.js +1 -0
  127. package/dist/ui/dialog.d.ts +17 -0
  128. package/dist/ui/dialog.js +1 -0
  129. package/dist/ui/dropdown-menu.d.ts +29 -0
  130. package/dist/ui/dropdown-menu.js +1 -0
  131. package/dist/ui/field.d.ts +24 -0
  132. package/dist/ui/field.js +1 -0
  133. package/dist/ui/hover-card.d.ts +5 -0
  134. package/dist/ui/hover-card.js +1 -0
  135. package/dist/ui/input-group-textarea.d.ts +2 -0
  136. package/dist/ui/input-group-textarea.js +1 -0
  137. package/dist/ui/input-group.d.ts +17 -0
  138. package/dist/ui/input-group.js +1 -0
  139. package/dist/ui/input.d.ts +3 -0
  140. package/dist/ui/input.js +1 -0
  141. package/dist/ui/label.d.ts +3 -0
  142. package/dist/ui/label.js +1 -0
  143. package/dist/ui/radio-group.d.ts +5 -0
  144. package/dist/ui/radio-group.js +1 -0
  145. package/dist/ui/separator.d.ts +3 -0
  146. package/dist/ui/separator.js +1 -0
  147. package/dist/ui/switch.d.ts +5 -0
  148. package/dist/ui/switch.js +1 -0
  149. package/dist/ui/textarea.d.ts +3 -0
  150. package/dist/ui/textarea.js +1 -0
  151. package/dist/ui/tooltip.d.ts +6 -0
  152. package/dist/ui/tooltip.js +1 -0
  153. package/licenses/Apache-2.0.txt +191 -0
  154. package/licenses/_agentclientprotocol_sdk-LICENSE +191 -0
  155. package/licenses/_base-ui_react-LICENSE +21 -0
  156. package/licenses/_floating-ui_dom-LICENSE +20 -0
  157. package/licenses/ai-elements-notice.txt +13 -0
  158. package/licenses/ansi_up-LICENSE +22 -0
  159. package/licenses/class-variance-authority-LICENSE +190 -0
  160. package/licenses/cn-LICENSE +21 -0
  161. package/licenses/diff2html-LICENSE.md +14 -0
  162. package/licenses/entities-LICENSE +11 -0
  163. package/licenses/highlight.js-LICENSE +29 -0
  164. package/licenses/katex-LICENSE +21 -0
  165. package/licenses/lucide-react-LICENSE +43 -0
  166. package/licenses/marked-LICENSE +44 -0
  167. package/licenses/marked-linkify-it-LICENSE +21 -0
  168. package/licenses/react-LICENSE +21 -0
  169. package/licenses/react-dom-LICENSE +21 -0
  170. package/licenses/shadcn-ui-MIT.txt +21 -0
  171. package/package.json +314 -0
@@ -0,0 +1,489 @@
1
+ export declare const chatLocales: {
2
+ readonly ar: {
3
+ readonly stream: {
4
+ readonly codex: {
5
+ readonly worked: "تمت المعالجة";
6
+ readonly workedFor: "تمت المعالجة لمدة {{duration}}";
7
+ readonly editedFilesCount_one: "تم تعديل {{count}} ملف";
8
+ readonly editedFilesCount_other: "تم تعديل {{count}} ملفات";
9
+ readonly viewChanges: "عرض التغييرات";
10
+ readonly hideChanges: "إخفاء التغييرات";
11
+ readonly changedLines: "الأسطر المتغيرة";
12
+ readonly showMore: "عرض المزيد";
13
+ readonly showLess: "عرض أقل";
14
+ readonly thought: "تم التفكير";
15
+ readonly thoughtFor: "تم التفكير لمدة {{duration}}";
16
+ readonly running: "جارٍ التشغيل";
17
+ readonly ran: "تم التشغيل";
18
+ readonly runningCommand: "جارٍ تشغيل الأمر";
19
+ readonly ranCommandGeneric: "تم تشغيل الأمر";
20
+ readonly searching: "جارٍ البحث";
21
+ readonly searched: "تم البحث";
22
+ readonly forDetail: "عن {{detail}}";
23
+ readonly searchingFiles: "جارٍ البحث في الملفات";
24
+ readonly searchedFiles: "تم البحث في الملفات";
25
+ readonly searchingWeb: "جارٍ البحث في الويب";
26
+ readonly searchedWeb: "تم البحث في الويب";
27
+ readonly readLabel: "تمت قراءة";
28
+ readonly readFiles: "تمت قراءة الملفات";
29
+ readonly editingLabel: "جارٍ تعديل";
30
+ readonly editedLabel: "تم تعديل";
31
+ readonly editingFiles: "جارٍ تعديل الملفات";
32
+ readonly editedFiles: "تم تعديل الملفات";
33
+ readonly deletingLabel: "جارٍ حذف";
34
+ readonly deletedLabel: "تم حذف";
35
+ readonly deletingFiles: "جارٍ حذف الملفات";
36
+ readonly deletedFiles: "تم حذف الملفات";
37
+ readonly movingLabel: "جارٍ نقل";
38
+ readonly movedLabel: "تم نقل";
39
+ readonly movingFiles: "جارٍ نقل الملفات";
40
+ readonly movedFiles: "تم نقل الملفات";
41
+ readonly subagentWorking: "بدأ {{name}} العمل";
42
+ readonly subagentFinished: "أنهى {{name}} العمل";
43
+ readonly contextCompacted: "تم ضغط السياق";
44
+ readonly audioOutput: "مخرج صوتي";
45
+ readonly exitCode: "رمز الخروج {{code}}";
46
+ readonly summary: {
47
+ readonly read: {
48
+ readonly leading: "تمت قراءة الملفات";
49
+ readonly following: "وقراءة الملفات";
50
+ };
51
+ readonly edit: {
52
+ readonly leading: "تم تعديل الملفات";
53
+ readonly following: "وتعديل الملفات";
54
+ };
55
+ readonly delete: {
56
+ readonly leading: "تم حذف الملفات";
57
+ readonly following: "وحذف الملفات";
58
+ };
59
+ readonly move: {
60
+ readonly leading: "تم نقل الملفات";
61
+ readonly following: "ونقل الملفات";
62
+ };
63
+ readonly search: {
64
+ readonly leading: "تم البحث في الملفات";
65
+ readonly following: "والبحث في الملفات";
66
+ };
67
+ readonly execute: {
68
+ readonly leading_one: "تم تشغيل أمر";
69
+ readonly leading_other: "تم تشغيل أوامر";
70
+ readonly following_one: "وتشغيل أمر";
71
+ readonly following_other: "وتشغيل أوامر";
72
+ };
73
+ readonly fetch: {
74
+ readonly leading: "تم البحث في الويب";
75
+ readonly following: "والبحث في الويب";
76
+ };
77
+ readonly mcp: {
78
+ readonly leading_one: "تم استدعاء أداة";
79
+ readonly leading_other: "تم استدعاء أدوات";
80
+ readonly following_one: "واستدعاء أداة";
81
+ readonly following_other: "واستدعاء أدوات";
82
+ };
83
+ readonly other: {
84
+ readonly leading_one: "تم استدعاء أداة";
85
+ readonly leading_other: "تم استدعاء أدوات";
86
+ readonly following_one: "واستدعاء أداة";
87
+ readonly following_other: "واستدعاء أدوات";
88
+ };
89
+ };
90
+ };
91
+ };
92
+ readonly message: {
93
+ readonly thinking: "التفكير";
94
+ };
95
+ readonly actions: {
96
+ readonly copy: "ينسخ";
97
+ };
98
+ readonly model: {
99
+ readonly loadingModels: "جارٍ تحميل النماذج...";
100
+ readonly switchProvider: "مزود التبديل";
101
+ readonly moreModels: "المزيد من النماذج";
102
+ readonly selectModel: "حدد النموذج";
103
+ readonly switchModel: "نموذج التبديل";
104
+ readonly noModelsAvailable: "لا توجد نماذج متاحة";
105
+ };
106
+ };
107
+ readonly de: {
108
+ readonly stream: {};
109
+ readonly message: {
110
+ readonly thinking: "Denkt nach";
111
+ };
112
+ readonly actions: {
113
+ readonly copy: "Kopieren";
114
+ };
115
+ readonly model: {
116
+ readonly loadingModels: "Lädt Modelle...";
117
+ readonly switchProvider: "Provider wechseln";
118
+ readonly moreModels: "Mehr Modelle";
119
+ readonly selectModel: "Modell auswählen";
120
+ readonly switchModel: "Modell wechseln";
121
+ readonly noModelsAvailable: "Keine Modelle verfügbar";
122
+ };
123
+ };
124
+ readonly en: {
125
+ readonly stream: {
126
+ readonly codex: {
127
+ readonly worked: "Worked";
128
+ readonly workedFor: "Worked for {{duration}}";
129
+ readonly editedFilesCount_one: "Edited {{count}} file";
130
+ readonly editedFilesCount_other: "Edited {{count}} files";
131
+ readonly viewChanges: "View changes";
132
+ readonly hideChanges: "Hide changes";
133
+ readonly changedLines: "Changed lines";
134
+ readonly showMore: "Show more";
135
+ readonly showLess: "Show less";
136
+ readonly thought: "Thought";
137
+ readonly thoughtFor: "Thought for {{duration}}";
138
+ readonly running: "Running";
139
+ readonly ran: "Ran";
140
+ readonly runningCommand: "Running command";
141
+ readonly ranCommandGeneric: "Ran command";
142
+ readonly searching: "Searching";
143
+ readonly searched: "Searched";
144
+ readonly forDetail: "for {{detail}}";
145
+ readonly searchingFiles: "Searching for files";
146
+ readonly searchedFiles: "Searched for files";
147
+ readonly searchingWeb: "Searching the web";
148
+ readonly searchedWeb: "Searched the web";
149
+ readonly readLabel: "Read";
150
+ readonly readFiles: "Read files";
151
+ readonly editingLabel: "Editing";
152
+ readonly editedLabel: "Edited";
153
+ readonly editingFiles: "Editing files";
154
+ readonly editedFiles: "Edited files";
155
+ readonly deletingLabel: "Deleting";
156
+ readonly deletedLabel: "Deleted";
157
+ readonly deletingFiles: "Deleting files";
158
+ readonly deletedFiles: "Deleted files";
159
+ readonly movingLabel: "Moving";
160
+ readonly movedLabel: "Moved";
161
+ readonly movingFiles: "Moving files";
162
+ readonly movedFiles: "Moved files";
163
+ readonly subagentWorking: "{{name}} started working";
164
+ readonly subagentFinished: "{{name}} finished";
165
+ readonly contextCompacted: "Context compacted";
166
+ readonly audioOutput: "Audio output";
167
+ readonly exitCode: "Exit code {{code}}";
168
+ readonly summary: {
169
+ readonly read: {
170
+ readonly leading: "Read files";
171
+ readonly following: "read files";
172
+ };
173
+ readonly edit: {
174
+ readonly leading: "Edited files";
175
+ readonly following: "edited files";
176
+ };
177
+ readonly delete: {
178
+ readonly leading: "Deleted files";
179
+ readonly following: "deleted files";
180
+ };
181
+ readonly move: {
182
+ readonly leading: "Moved files";
183
+ readonly following: "moved files";
184
+ };
185
+ readonly search: {
186
+ readonly leading: "Searched files";
187
+ readonly following: "searched files";
188
+ };
189
+ readonly execute: {
190
+ readonly leading_one: "Ran a command";
191
+ readonly leading_other: "Ran commands";
192
+ readonly following_one: "ran a command";
193
+ readonly following_other: "ran commands";
194
+ };
195
+ readonly fetch: {
196
+ readonly leading: "Searched the web";
197
+ readonly following: "searched the web";
198
+ };
199
+ readonly mcp: {
200
+ readonly leading_one: "Called a tool";
201
+ readonly leading_other: "Called tools";
202
+ readonly following_one: "called a tool";
203
+ readonly following_other: "called tools";
204
+ };
205
+ readonly other: {
206
+ readonly leading_one: "Called a tool";
207
+ readonly leading_other: "Called tools";
208
+ readonly following_one: "called a tool";
209
+ readonly following_other: "called tools";
210
+ };
211
+ };
212
+ };
213
+ };
214
+ readonly message: {
215
+ readonly thinking: "Thinking";
216
+ };
217
+ readonly actions: {
218
+ readonly copy: "Copy";
219
+ };
220
+ readonly model: {
221
+ readonly loadingModels: "Loading models...";
222
+ readonly switchProvider: "Switch provider";
223
+ readonly moreModels: "More models";
224
+ readonly selectModel: "Select model";
225
+ readonly switchModel: "Switch model";
226
+ readonly noModelsAvailable: "No models available";
227
+ };
228
+ };
229
+ readonly es: {
230
+ readonly stream: {};
231
+ readonly message: {
232
+ readonly thinking: "Pensando";
233
+ };
234
+ readonly actions: {
235
+ readonly copy: "Copiar";
236
+ };
237
+ readonly model: {
238
+ readonly loadingModels: "Cargando modelos...";
239
+ readonly switchProvider: "Cambiar provider";
240
+ readonly moreModels: "Más modelos";
241
+ readonly selectModel: "Seleccionar modelo";
242
+ readonly switchModel: "Cambiar modelo";
243
+ readonly noModelsAvailable: "No hay modelos disponibles";
244
+ };
245
+ };
246
+ readonly fr: {
247
+ readonly stream: {};
248
+ readonly message: {
249
+ readonly thinking: "Réflexion";
250
+ };
251
+ readonly actions: {
252
+ readonly copy: "Copier";
253
+ };
254
+ readonly model: {
255
+ readonly loadingModels: "Chargement des modèles...";
256
+ readonly switchProvider: "Changer de provider";
257
+ readonly moreModels: "Plus de modèles";
258
+ readonly selectModel: "Sélectionner un modèle";
259
+ readonly switchModel: "Changer de modèle";
260
+ readonly noModelsAvailable: "Aucun modèle disponible";
261
+ };
262
+ };
263
+ readonly hi: {
264
+ readonly stream: {};
265
+ readonly message: {
266
+ readonly thinking: "सोच रहा है";
267
+ };
268
+ readonly actions: {
269
+ readonly copy: "कॉपी करें";
270
+ };
271
+ readonly model: {
272
+ readonly loadingModels: "मॉडल लोड हो रहे हैं...";
273
+ readonly switchProvider: "Provider बदलें";
274
+ readonly moreModels: "और मॉडल";
275
+ readonly selectModel: "मॉडल चुनें";
276
+ readonly switchModel: "मॉडल बदलें";
277
+ readonly noModelsAvailable: "कोई मॉडल उपलब्ध नहीं";
278
+ };
279
+ };
280
+ readonly id: {
281
+ readonly stream: {};
282
+ readonly message: {
283
+ readonly thinking: "Berpikir";
284
+ };
285
+ readonly actions: {
286
+ readonly copy: "Salin";
287
+ };
288
+ readonly model: {
289
+ readonly loadingModels: "Memuat model...";
290
+ readonly switchProvider: "Ganti provider";
291
+ readonly moreModels: "Model lainnya";
292
+ readonly selectModel: "Pilih model";
293
+ readonly switchModel: "Ganti model";
294
+ readonly noModelsAvailable: "Tidak ada model tersedia";
295
+ };
296
+ };
297
+ readonly it: {
298
+ readonly stream: {};
299
+ readonly message: {
300
+ readonly thinking: "Sto pensando";
301
+ };
302
+ readonly actions: {
303
+ readonly copy: "Copia";
304
+ };
305
+ readonly model: {
306
+ readonly loadingModels: "Caricamento modelli...";
307
+ readonly switchProvider: "Cambia provider";
308
+ readonly moreModels: "Altri modelli";
309
+ readonly selectModel: "Seleziona modello";
310
+ readonly switchModel: "Cambia modello";
311
+ readonly noModelsAvailable: "Nessun modello disponibile";
312
+ };
313
+ };
314
+ readonly ja: {
315
+ readonly stream: {};
316
+ readonly message: {
317
+ readonly thinking: "考え中";
318
+ };
319
+ readonly actions: {
320
+ readonly copy: "コピー";
321
+ };
322
+ readonly model: {
323
+ readonly loadingModels: "モデルを読み込み中...";
324
+ readonly switchProvider: "プロバイダーを切り替え";
325
+ readonly moreModels: "その他のモデル";
326
+ readonly selectModel: "モデルを選択";
327
+ readonly switchModel: "モデルを切り替え";
328
+ readonly noModelsAvailable: "利用可能なモデルがありません";
329
+ };
330
+ };
331
+ readonly ko: {
332
+ readonly stream: {};
333
+ readonly message: {
334
+ readonly thinking: "생각 중";
335
+ };
336
+ readonly actions: {
337
+ readonly copy: "복사";
338
+ };
339
+ readonly model: {
340
+ readonly loadingModels: "모델 로드 중...";
341
+ readonly switchProvider: "프로바이더 전환";
342
+ readonly moreModels: "더 많은 모델";
343
+ readonly selectModel: "모델 선택";
344
+ readonly switchModel: "모델 전환";
345
+ readonly noModelsAvailable: "사용 가능한 모델이 없습니다";
346
+ };
347
+ };
348
+ readonly "pt-BR": {
349
+ readonly stream: {};
350
+ readonly message: {
351
+ readonly thinking: "Pensando";
352
+ };
353
+ readonly actions: {
354
+ readonly copy: "Copiar";
355
+ };
356
+ readonly model: {
357
+ readonly loadingModels: "Carregando modelos...";
358
+ readonly switchProvider: "Mudar provider";
359
+ readonly moreModels: "Mais modelos";
360
+ readonly selectModel: "Selecionar modelo";
361
+ readonly switchModel: "Mudar modelo";
362
+ readonly noModelsAvailable: "Nenhum modelo disponível";
363
+ };
364
+ };
365
+ readonly ru: {
366
+ readonly stream: {};
367
+ readonly message: {
368
+ readonly thinking: "Думаю";
369
+ };
370
+ readonly actions: {
371
+ readonly copy: "Копировать";
372
+ };
373
+ readonly model: {
374
+ readonly loadingModels: "Загрузка моделей...";
375
+ readonly switchProvider: "Переключить provider";
376
+ readonly moreModels: "Больше моделей";
377
+ readonly selectModel: "Выбрать модель";
378
+ readonly switchModel: "Переключить модель";
379
+ readonly noModelsAvailable: "Нет доступных моделей";
380
+ };
381
+ };
382
+ readonly "zh-CN": {
383
+ readonly stream: {
384
+ readonly codex: {
385
+ readonly worked: "已处理";
386
+ readonly workedFor: "已处理 {{duration}}";
387
+ readonly editedFilesCount_one: "已编辑 {{count}} 个文件";
388
+ readonly editedFilesCount_other: "已编辑 {{count}} 个文件";
389
+ readonly viewChanges: "查看更改";
390
+ readonly hideChanges: "收起更改";
391
+ readonly changedLines: "更改行数";
392
+ readonly showMore: "展开显示";
393
+ readonly showLess: "收起显示";
394
+ readonly thought: "已思考";
395
+ readonly thoughtFor: "思考了 {{duration}}";
396
+ readonly running: "正在运行";
397
+ readonly ran: "已运行";
398
+ readonly runningCommand: "正在运行命令";
399
+ readonly ranCommandGeneric: "已运行命令";
400
+ readonly searching: "正在搜索";
401
+ readonly searched: "已搜索";
402
+ readonly forDetail: "{{detail}}";
403
+ readonly searchingFiles: "正在搜索文件";
404
+ readonly searchedFiles: "已搜索文件";
405
+ readonly searchingWeb: "正在搜索网页";
406
+ readonly searchedWeb: "已搜索网页";
407
+ readonly readLabel: "已读取";
408
+ readonly readFiles: "已读取文件";
409
+ readonly editingLabel: "正在编辑";
410
+ readonly editedLabel: "已编辑";
411
+ readonly editingFiles: "正在编辑文件";
412
+ readonly editedFiles: "已编辑文件";
413
+ readonly deletingLabel: "正在删除";
414
+ readonly deletedLabel: "已删除";
415
+ readonly deletingFiles: "正在删除文件";
416
+ readonly deletedFiles: "已删除文件";
417
+ readonly movingLabel: "正在移动";
418
+ readonly movedLabel: "已移动";
419
+ readonly movingFiles: "正在移动文件";
420
+ readonly movedFiles: "已移动文件";
421
+ readonly subagentWorking: "{{name}} 已开始工作";
422
+ readonly subagentFinished: "{{name}} 已完成";
423
+ readonly contextCompacted: "上下文已压缩";
424
+ readonly audioOutput: "音频输出";
425
+ readonly exitCode: "退出码 {{code}}";
426
+ readonly summary: {
427
+ readonly read: {
428
+ readonly leading: "已读取文件";
429
+ readonly following: "读取了文件";
430
+ };
431
+ readonly edit: {
432
+ readonly leading: "已编辑文件";
433
+ readonly following: "编辑了文件";
434
+ };
435
+ readonly delete: {
436
+ readonly leading: "已删除文件";
437
+ readonly following: "删除了文件";
438
+ };
439
+ readonly move: {
440
+ readonly leading: "已移动文件";
441
+ readonly following: "移动了文件";
442
+ };
443
+ readonly search: {
444
+ readonly leading: "已搜索文件";
445
+ readonly following: "搜索了文件";
446
+ };
447
+ readonly execute: {
448
+ readonly leading_one: "已运行命令";
449
+ readonly leading_other: "已运行命令";
450
+ readonly following_one: "运行了命令";
451
+ readonly following_other: "运行了命令";
452
+ };
453
+ readonly fetch: {
454
+ readonly leading: "已搜索网页";
455
+ readonly following: "搜索了网页";
456
+ };
457
+ readonly mcp: {
458
+ readonly leading_one: "已调用工具";
459
+ readonly leading_other: "已调用工具";
460
+ readonly following_one: "调用了工具";
461
+ readonly following_other: "调用了工具";
462
+ };
463
+ readonly other: {
464
+ readonly leading_one: "已调用工具";
465
+ readonly leading_other: "已调用工具";
466
+ readonly following_one: "调用了工具";
467
+ readonly following_other: "调用了工具";
468
+ };
469
+ };
470
+ };
471
+ };
472
+ readonly message: {
473
+ readonly thinking: "思考中";
474
+ };
475
+ readonly actions: {
476
+ readonly copy: "复制";
477
+ };
478
+ readonly model: {
479
+ readonly loadingModels: "加载模型中...";
480
+ readonly switchProvider: "切换服务商";
481
+ readonly moreModels: "更多模型";
482
+ readonly selectModel: "选择模型";
483
+ readonly switchModel: "切换模型";
484
+ readonly noModelsAvailable: "暂无可用模型";
485
+ };
486
+ };
487
+ };
488
+ export type TranslationResources = Record<string, Record<string, object>>;
489
+ export declare function withChatResources(resources: TranslationResources): TranslationResources;
@@ -0,0 +1 @@
1
+ var d={ar:{stream:{codex:{worked:"تمت المعالجة",workedFor:"تمت المعالجة لمدة {{duration}}",editedFilesCount_one:"تم تعديل {{count}} ملف",editedFilesCount_other:"تم تعديل {{count}} ملفات",viewChanges:"عرض التغييرات",hideChanges:"إخفاء التغييرات",changedLines:"الأسطر المتغيرة",showMore:"عرض المزيد",showLess:"عرض أقل",thought:"تم التفكير",thoughtFor:"تم التفكير لمدة {{duration}}",running:"جارٍ التشغيل",ran:"تم التشغيل",runningCommand:"جارٍ تشغيل الأمر",ranCommandGeneric:"تم تشغيل الأمر",searching:"جارٍ البحث",searched:"تم البحث",forDetail:"عن {{detail}}",searchingFiles:"جارٍ البحث في الملفات",searchedFiles:"تم البحث في الملفات",searchingWeb:"جارٍ البحث في الويب",searchedWeb:"تم البحث في الويب",readLabel:"تمت قراءة",readFiles:"تمت قراءة الملفات",editingLabel:"جارٍ تعديل",editedLabel:"تم تعديل",editingFiles:"جارٍ تعديل الملفات",editedFiles:"تم تعديل الملفات",deletingLabel:"جارٍ حذف",deletedLabel:"تم حذف",deletingFiles:"جارٍ حذف الملفات",deletedFiles:"تم حذف الملفات",movingLabel:"جارٍ نقل",movedLabel:"تم نقل",movingFiles:"جارٍ نقل الملفات",movedFiles:"تم نقل الملفات",subagentWorking:"بدأ {{name}} العمل",subagentFinished:"أنهى {{name}} العمل",contextCompacted:"تم ضغط السياق",audioOutput:"مخرج صوتي",exitCode:"رمز الخروج {{code}}",summary:{read:{leading:"تمت قراءة الملفات",following:"وقراءة الملفات"},edit:{leading:"تم تعديل الملفات",following:"وتعديل الملفات"},delete:{leading:"تم حذف الملفات",following:"وحذف الملفات"},move:{leading:"تم نقل الملفات",following:"ونقل الملفات"},search:{leading:"تم البحث في الملفات",following:"والبحث في الملفات"},execute:{leading_one:"تم تشغيل أمر",leading_other:"تم تشغيل أوامر",following_one:"وتشغيل أمر",following_other:"وتشغيل أوامر"},fetch:{leading:"تم البحث في الويب",following:"والبحث في الويب"},mcp:{leading_one:"تم استدعاء أداة",leading_other:"تم استدعاء أدوات",following_one:"واستدعاء أداة",following_other:"واستدعاء أدوات"},other:{leading_one:"تم استدعاء أداة",leading_other:"تم استدعاء أدوات",following_one:"واستدعاء أداة",following_other:"واستدعاء أدوات"}}}},message:{thinking:"التفكير"},actions:{copy:"ينسخ"},model:{loadingModels:"جارٍ تحميل النماذج...",switchProvider:"مزود التبديل",moreModels:"المزيد من النماذج",selectModel:"حدد النموذج",switchModel:"نموذج التبديل",noModelsAvailable:"لا توجد نماذج متاحة"}},de:{stream:{},message:{thinking:"Denkt nach"},actions:{copy:"Kopieren"},model:{loadingModels:"Lädt Modelle...",switchProvider:"Provider wechseln",moreModels:"Mehr Modelle",selectModel:"Modell auswählen",switchModel:"Modell wechseln",noModelsAvailable:"Keine Modelle verfügbar"}},en:{stream:{codex:{worked:"Worked",workedFor:"Worked for {{duration}}",editedFilesCount_one:"Edited {{count}} file",editedFilesCount_other:"Edited {{count}} files",viewChanges:"View changes",hideChanges:"Hide changes",changedLines:"Changed lines",showMore:"Show more",showLess:"Show less",thought:"Thought",thoughtFor:"Thought for {{duration}}",running:"Running",ran:"Ran",runningCommand:"Running command",ranCommandGeneric:"Ran command",searching:"Searching",searched:"Searched",forDetail:"for {{detail}}",searchingFiles:"Searching for files",searchedFiles:"Searched for files",searchingWeb:"Searching the web",searchedWeb:"Searched the web",readLabel:"Read",readFiles:"Read files",editingLabel:"Editing",editedLabel:"Edited",editingFiles:"Editing files",editedFiles:"Edited files",deletingLabel:"Deleting",deletedLabel:"Deleted",deletingFiles:"Deleting files",deletedFiles:"Deleted files",movingLabel:"Moving",movedLabel:"Moved",movingFiles:"Moving files",movedFiles:"Moved files",subagentWorking:"{{name}} started working",subagentFinished:"{{name}} finished",contextCompacted:"Context compacted",audioOutput:"Audio output",exitCode:"Exit code {{code}}",summary:{read:{leading:"Read files",following:"read files"},edit:{leading:"Edited files",following:"edited files"},delete:{leading:"Deleted files",following:"deleted files"},move:{leading:"Moved files",following:"moved files"},search:{leading:"Searched files",following:"searched files"},execute:{leading_one:"Ran a command",leading_other:"Ran commands",following_one:"ran a command",following_other:"ran commands"},fetch:{leading:"Searched the web",following:"searched the web"},mcp:{leading_one:"Called a tool",leading_other:"Called tools",following_one:"called a tool",following_other:"called tools"},other:{leading_one:"Called a tool",leading_other:"Called tools",following_one:"called a tool",following_other:"called tools"}}}},message:{thinking:"Thinking"},actions:{copy:"Copy"},model:{loadingModels:"Loading models...",switchProvider:"Switch provider",moreModels:"More models",selectModel:"Select model",switchModel:"Switch model",noModelsAvailable:"No models available"}},es:{stream:{},message:{thinking:"Pensando"},actions:{copy:"Copiar"},model:{loadingModels:"Cargando modelos...",switchProvider:"Cambiar provider",moreModels:"Más modelos",selectModel:"Seleccionar modelo",switchModel:"Cambiar modelo",noModelsAvailable:"No hay modelos disponibles"}},fr:{stream:{},message:{thinking:"Réflexion"},actions:{copy:"Copier"},model:{loadingModels:"Chargement des modèles...",switchProvider:"Changer de provider",moreModels:"Plus de modèles",selectModel:"Sélectionner un modèle",switchModel:"Changer de modèle",noModelsAvailable:"Aucun modèle disponible"}},hi:{stream:{},message:{thinking:"सोच रहा है"},actions:{copy:"कॉपी करें"},model:{loadingModels:"मॉडल लोड हो रहे हैं...",switchProvider:"Provider बदलें",moreModels:"और मॉडल",selectModel:"मॉडल चुनें",switchModel:"मॉडल बदलें",noModelsAvailable:"कोई मॉडल उपलब्ध नहीं"}},id:{stream:{},message:{thinking:"Berpikir"},actions:{copy:"Salin"},model:{loadingModels:"Memuat model...",switchProvider:"Ganti provider",moreModels:"Model lainnya",selectModel:"Pilih model",switchModel:"Ganti model",noModelsAvailable:"Tidak ada model tersedia"}},it:{stream:{},message:{thinking:"Sto pensando"},actions:{copy:"Copia"},model:{loadingModels:"Caricamento modelli...",switchProvider:"Cambia provider",moreModels:"Altri modelli",selectModel:"Seleziona modello",switchModel:"Cambia modello",noModelsAvailable:"Nessun modello disponibile"}},ja:{stream:{},message:{thinking:"考え中"},actions:{copy:"コピー"},model:{loadingModels:"モデルを読み込み中...",switchProvider:"プロバイダーを切り替え",moreModels:"その他のモデル",selectModel:"モデルを選択",switchModel:"モデルを切り替え",noModelsAvailable:"利用可能なモデルがありません"}},ko:{stream:{},message:{thinking:"생각 중"},actions:{copy:"복사"},model:{loadingModels:"모델 로드 중...",switchProvider:"프로바이더 전환",moreModels:"더 많은 모델",selectModel:"모델 선택",switchModel:"모델 전환",noModelsAvailable:"사용 가능한 모델이 없습니다"}},"pt-BR":{stream:{},message:{thinking:"Pensando"},actions:{copy:"Copiar"},model:{loadingModels:"Carregando modelos...",switchProvider:"Mudar provider",moreModels:"Mais modelos",selectModel:"Selecionar modelo",switchModel:"Mudar modelo",noModelsAvailable:"Nenhum modelo disponível"}},ru:{stream:{},message:{thinking:"Думаю"},actions:{copy:"Копировать"},model:{loadingModels:"Загрузка моделей...",switchProvider:"Переключить provider",moreModels:"Больше моделей",selectModel:"Выбрать модель",switchModel:"Переключить модель",noModelsAvailable:"Нет доступных моделей"}},"zh-CN":{stream:{codex:{worked:"已处理",workedFor:"已处理 {{duration}}",editedFilesCount_one:"已编辑 {{count}} 个文件",editedFilesCount_other:"已编辑 {{count}} 个文件",viewChanges:"查看更改",hideChanges:"收起更改",changedLines:"更改行数",showMore:"展开显示",showLess:"收起显示",thought:"已思考",thoughtFor:"思考了 {{duration}}",running:"正在运行",ran:"已运行",runningCommand:"正在运行命令",ranCommandGeneric:"已运行命令",searching:"正在搜索",searched:"已搜索",forDetail:"{{detail}}",searchingFiles:"正在搜索文件",searchedFiles:"已搜索文件",searchingWeb:"正在搜索网页",searchedWeb:"已搜索网页",readLabel:"已读取",readFiles:"已读取文件",editingLabel:"正在编辑",editedLabel:"已编辑",editingFiles:"正在编辑文件",editedFiles:"已编辑文件",deletingLabel:"正在删除",deletedLabel:"已删除",deletingFiles:"正在删除文件",deletedFiles:"已删除文件",movingLabel:"正在移动",movedLabel:"已移动",movingFiles:"正在移动文件",movedFiles:"已移动文件",subagentWorking:"{{name}} 已开始工作",subagentFinished:"{{name}} 已完成",contextCompacted:"上下文已压缩",audioOutput:"音频输出",exitCode:"退出码 {{code}}",summary:{read:{leading:"已读取文件",following:"读取了文件"},edit:{leading:"已编辑文件",following:"编辑了文件"},delete:{leading:"已删除文件",following:"删除了文件"},move:{leading:"已移动文件",following:"移动了文件"},search:{leading:"已搜索文件",following:"搜索了文件"},execute:{leading_one:"已运行命令",leading_other:"已运行命令",following_one:"运行了命令",following_other:"运行了命令"},fetch:{leading:"已搜索网页",following:"搜索了网页"},mcp:{leading_one:"已调用工具",leading_other:"已调用工具",following_one:"调用了工具",following_other:"调用了工具"},other:{leading_one:"已调用工具",leading_other:"已调用工具",following_one:"调用了工具",following_other:"调用了工具"}}}},message:{thinking:"思考中"},actions:{copy:"复制"},model:{loadingModels:"加载模型中...",switchProvider:"切换服务商",moreModels:"更多模型",selectModel:"选择模型",switchModel:"切换模型",noModelsAvailable:"暂无可用模型"}}};function n(e){let o={...e};for(let[l,i]of Object.entries(d))o[l]={...e[l],alwithChat:i};return o}export{d as chatLocales,n as withChatResources};
@@ -0,0 +1,19 @@
1
+ import type { SearchSourceMatch } from "./literal-matches.js";
2
+ export type { SearchSourceMatch } from "./literal-matches.js";
3
+ export declare function findChatScrollContainer(sessionId: string | null): HTMLElement | null;
4
+ export declare function scrollChatElementIntoView(el: HTMLElement, align?: "center" | "start"): void;
5
+ export { collectMatches } from "./dom-matches.js";
6
+ export interface ChatSearchProps {
7
+ getViewport: () => HTMLElement | null;
8
+ findSourceMatches?: (query: string) => SearchSourceMatch[];
9
+ revealTurn?: (turnKey: string, signal: AbortSignal) => Promise<void>;
10
+ subscribeOpen?: (open: () => void) => () => void;
11
+ labels: {
12
+ search: string;
13
+ placeholder: string;
14
+ previous?: string;
15
+ next?: string;
16
+ };
17
+ placement?: "header" | "body";
18
+ }
19
+ export declare function ChatSearch({ getViewport, findSourceMatches, revealTurn, subscribeOpen, labels, placement, }: ChatSearchProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as b,jsxs as G,Fragment as Y}from"react/jsx-runtime";import{SearchIcon as Z}from"lucide-react";import{useCallback as N,useEffect as f,useMemo as O,useRef as S,useState as E}from"react";import{Button as V}from"../ui/button.js";import{FindBar as tt}from"./find-bar.js";import{cn as et}from"cn";import{collectMatches as P}from"./dom-matches.js";import{collectMatches as mt}from"./dom-matches.js";var z="chat-search",K="chat-search-current",D=150;function at(e){let r=e===null?"":e;return[...document.querySelectorAll("[data-chat-scroll]")].find((c)=>c.dataset.chatScroll===r)??null}var rt=12;function Q(e,r="center"){let c=e.closest("[data-chat-scroll]");if(!c)return;let d=e.getBoundingClientRect(),g=c.getBoundingClientRect(),y=r==="start"?rt:(c.clientHeight-d.height)/2;c.scrollTo({top:c.scrollTop+(d.top-g.top)-y,behavior:"smooth"})}function B(e){let r=e.startContainer.parentElement;if(!r)return;Q(r)}var R=new Map;function U(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(R.size===0){CSS.highlights.delete(z),CSS.highlights.delete(K);return}let e=[...R.values()];CSS.highlights.set(z,new Highlight(...e.flatMap((r)=>r.all))),CSS.highlights.set(K,new Highlight(...e.flatMap((r)=>r.current?[r.current]:[])))}function nt(){let e=Symbol();return{clearHighlights(){R.delete(e),U()},applyHighlights(r,c){R.set(e,{all:r,current:c}),U()}}}function ft({getViewport:e,findSourceMatches:r,revealTurn:c,subscribeOpen:d,labels:g,placement:y="header"}){let{clearHighlights:h,applyHighlights:T}=O(nt,[]),m=r!==void 0,[l,I]=E(!1),[i,L]=E(""),u=O(()=>r?r(i.trim()):[],[r,i]),[F,M]=E(0),[J,x]=E(0),p=S([]),w=S(0),s=S(null),j=S(null),q=S(null);f(()=>{if(!d)return;return d(()=>{I(!0);let t=q.current;if(t!==null)t.focus(),t.select()})},[d]);let _=N(async(o,t)=>{let n=u[o];if(n===void 0)return;let a=e();if(a===null)throw Error("Chat scroll container is missing");if(c)await c(n.turnKey,t);if(t.aborted)return;let C=a.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(C===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(!c)Q(C,"start");if(await new Promise((X)=>requestAnimationFrame(()=>X())),t.aborted)return;let k=P(C,i.trim());p.current=k;let H=k[n.occurrenceInTurn];if(T(k,H===void 0?null:H),H!==void 0)B(H)},[u,e,i,c]),A=S(_);f(()=>{A.current=_},[_]);let v=N(()=>{I(!1),L(""),w.current=0,s.current?.abort(),s.current=null,h(),p.current=[]},[]);f(()=>{if(!l)return;let o=(t)=>{if(t.key==="Escape"&&j.current?.contains(document.activeElement))t.preventDefault(),v()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[l,v]),f(()=>{if(!l||!i.trim()){h(),p.current=[],M(0),x(0),w.current=0;return}let o=setTimeout(()=>{if(m)return;let t=e();if(!t)return;let n=P(t,i);if(p.current=n,M(n.length),x(0),T(n,n[0]??null),n[0])B(n[0])},D);return()=>{clearTimeout(o),h()}},[m,l,i,e]),f(()=>{if(!l||!m||!i.trim())return;let o=new AbortController;s.current?.abort(),s.current=o;let t=setTimeout(()=>{p.current=[],w.current=0,M(u.length),x(0),h(),A.current(0,o.signal)},D);return()=>{if(o.abort(),s.current===o)s.current=null;clearTimeout(t),h()}},[u.length,m,l,i]),f(()=>()=>{s.current?.abort(),h()},[]),f(()=>{if(!l)h()},[l]);let W=N((o)=>{if(m){if(u.length===0)return;let n=(w.current+(o?-1:1)+u.length)%u.length;w.current=n,x(n),s.current?.abort();let a=new AbortController;s.current=a,A.current(n,a.signal);return}let t=p.current;if(!t.length)return;x((n)=>{let a=(n+(o?-1:1)+t.length)%t.length,C=t[a];return T(t,C),B(C),a})},[u.length,m]);return G(Y,{children:[y==="header"&&b(V,{variant:"ghost",size:"icon-sm",title:g.search,onClick:()=>l?v():I(!0),children:b(Z,{})}),l&&G("div",{"data-chat-search":!0,ref:j,className:et("bg-background border-b",y==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[b(tt,{ref:q,value:i,onChange:L,onFind:W,onClose:v,placeholder:g.placeholder,prevTitle:g.previous,nextTitle:g.next}),i.trim()&&b("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:F===0?"0 / 0":`${J+1} / ${F}`})]})]})}export{ft as ChatSearch,mt as collectMatches,at as findChatScrollContainer,Q as scrollChatElementIntoView};
@@ -0,0 +1 @@
1
+ export declare function collectMatches(root: HTMLElement, query: string): Range[];
@@ -0,0 +1 @@
1
+ import{literalMatches as D}from"./literal-matches.js";function g(u,f){if(!f)return[];let h=[],s="",n=[],a=()=>{let t=0,e=0;for(let{start:r,end:o}of D(s,f)){while(t<n.length&&n[t].end<=r)t++;e=Math.max(e,t);while(e<n.length&&n[e].end<o)e++;let l=n[t],c=n[e];if(!l||!c)throw Error("Search text offset has no DOM node");let i=document.createRange();i.setStart(l.node,r-l.start),i.setEnd(c.node,o-c.start),h.push(i)}s="",n=[]},d=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),E=(t)=>{if(t.nodeType===Node.TEXT_NODE){let r=t.parentElement;if(!r||r.offsetParent===null&&r.tagName!=="BODY")return;let o=t.nodeValue??"";n.push({node:t,start:s.length,end:s.length+o.length}),s+=o;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){a();return}if(t.tagName==="BR"){a();return}let e=d.has(t.tagName);if(e)a();for(let r of t.childNodes)E(r);if(e)a()};return E(u),a(),h}export{g as collectMatches};
@@ -0,0 +1,14 @@
1
+ import { type Ref } from "react";
2
+ export interface FindBarProps {
3
+ ref?: Ref<HTMLInputElement>;
4
+ value: string;
5
+ onChange: (v: string) => void;
6
+ onFind: (backwards: boolean) => void;
7
+ onClose: () => void;
8
+ placeholder?: string;
9
+ autoFocusOpen?: boolean;
10
+ prevTitle?: string;
11
+ nextTitle?: string;
12
+ className?: string;
13
+ }
14
+ export declare function FindBar({ ref, value, onChange, onFind, onClose, placeholder, autoFocusOpen, prevTitle, nextTitle, className, }: FindBarProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as r,jsxs as h}from"react/jsx-runtime";import{ChevronDownIcon as z,ChevronUpIcon as v,XIcon as x}from"lucide-react";import{useEffect as N,useImperativeHandle as b,useRef as g}from"react";import{Button as i}from"../ui/button.js";import{Input as k}from"../ui/input.js";import{cn as w}from"cn";function D({ref:f,value:s,onChange:m,onFind:n,onClose:o,placeholder:d,autoFocusOpen:a=!0,prevTitle:c,nextTitle:l,className:p}){let t=g(null);b(f,()=>{if(t.current===null)throw Error("FindBar input is not mounted");return t.current},[]),N(()=>{if(!a)return;let e=t.current;if(e===null)throw Error("FindBar input is not mounted");e.focus(),e.select()},[a]);let u=!s;return h("div",{className:w("border-border flex h-9 shrink-0 items-center gap-1 border-b px-2",p),children:[r(k,{ref:t,value:s,onChange:(e)=>m(e.target.value),placeholder:d,className:"h-7 text-xs",onKeyDown:(e)=>{if(e.key==="Escape"){e.preventDefault(),o();return}if(e.key==="Enter"){if(e.preventDefault(),s)n(e.shiftKey)}}}),r(i,{size:"icon",variant:"ghost",className:"size-6",disabled:u,onClick:()=>n(!0),title:c?`${c} (⇧↵)`:"⇧↵",children:r(v,{className:"size-3.5"})}),r(i,{size:"icon",variant:"ghost",className:"size-6",disabled:u,onClick:()=>n(!1),title:l?`${l} (↵)`:"↵",children:r(z,{className:"size-3.5"})}),r(i,{size:"icon",variant:"ghost",className:"size-6",onClick:o,title:"Esc",children:r(x,{className:"size-3.5"})})]})}export{D as FindBar};
@@ -0,0 +1,12 @@
1
+ export declare function literalMatches(text: string, query: string): Generator<{
2
+ start: number;
3
+ end: number;
4
+ }>;
5
+ export interface SearchSourceMatch {
6
+ turnKey: string;
7
+ occurrenceInTurn: number;
8
+ }
9
+ export declare function findTextSourceMatches(turns: Iterable<{
10
+ turnKey: string;
11
+ segments: Iterable<string>;
12
+ }>, query: string): SearchSourceMatch[];
@@ -0,0 +1 @@
1
+ function*s(o,t){if(t.length===0)return;let n=new RegExp(t.replace(/[.*+?^{}()|[\]\\$]/g,"\\$&"),"giu");for(let e of o.matchAll(n))yield{start:e.index,end:e.index+e[0].length}}function i(o,t){if(t.length===0)return[];let n=[];for(let{turnKey:e,segments:c}of o){let r=0;for(let f of c)for(let l of s(f,t))n.push({turnKey:e,occurrenceInTurn:r}),r+=1}return n}export{i as findTextSourceMatches,s as literalMatches};