viberag 0.3.2 → 0.4.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 (209) hide show
  1. package/README.md +2 -2
  2. package/dist/cli/app.d.ts +3 -0
  3. package/dist/cli/app.js +100 -102
  4. package/dist/cli/commands/handlers.d.ts +8 -6
  5. package/dist/cli/commands/handlers.js +90 -32
  6. package/dist/cli/commands/useCommands.d.ts +20 -0
  7. package/dist/cli/commands/useCommands.js +189 -0
  8. package/dist/cli/commands/useRagCommands.d.ts +2 -5
  9. package/dist/cli/commands/useRagCommands.js +11 -18
  10. package/dist/cli/components/InitWizard.js +66 -27
  11. package/dist/cli/components/McpSetupWizard.js +23 -4
  12. package/dist/cli/components/SlotRow.d.ts +22 -0
  13. package/dist/cli/components/SlotRow.js +55 -0
  14. package/dist/cli/components/StatusBar.d.ts +14 -0
  15. package/dist/cli/components/StatusBar.js +156 -0
  16. package/dist/cli/contexts/DaemonStatusContext.d.ts +38 -0
  17. package/dist/cli/contexts/DaemonStatusContext.js +106 -0
  18. package/dist/cli/hooks/useStatusPolling.d.ts +34 -0
  19. package/dist/cli/hooks/useStatusPolling.js +121 -0
  20. package/dist/cli/store/app/selectors.d.ts +87 -0
  21. package/dist/cli/store/app/selectors.js +28 -0
  22. package/dist/cli/store/app/slice.d.ts +1013 -0
  23. package/dist/cli/store/app/slice.js +112 -0
  24. package/dist/cli/store/hooks.d.ts +22 -0
  25. package/dist/cli/store/hooks.js +17 -0
  26. package/dist/cli/store/store.d.ts +17 -0
  27. package/dist/cli/store/store.js +18 -0
  28. package/dist/cli/store/wizard/selectors.d.ts +115 -0
  29. package/dist/cli/store/wizard/selectors.js +36 -0
  30. package/dist/cli/store/wizard/slice.d.ts +523 -0
  31. package/dist/cli/store/wizard/slice.js +119 -0
  32. package/dist/cli/utils/error-handler.d.ts +55 -0
  33. package/dist/cli/utils/error-handler.js +92 -0
  34. package/dist/client/auto-start.d.ts +42 -0
  35. package/dist/client/auto-start.js +250 -0
  36. package/dist/client/connection.d.ts +48 -0
  37. package/dist/client/connection.js +200 -0
  38. package/dist/client/index.d.ts +93 -0
  39. package/dist/client/index.js +209 -0
  40. package/dist/client/types.d.ts +105 -0
  41. package/dist/client/types.js +7 -0
  42. package/dist/common/components/SlotRow.d.ts +22 -0
  43. package/dist/common/components/SlotRow.js +53 -0
  44. package/dist/common/components/StatusBar.js +82 -31
  45. package/dist/common/types.d.ts +12 -13
  46. package/dist/daemon/handlers.d.ts +15 -0
  47. package/dist/daemon/handlers.js +157 -0
  48. package/dist/daemon/index.d.ts +21 -0
  49. package/dist/daemon/index.js +123 -0
  50. package/dist/daemon/lib/chunker/bounded-channel.d.ts +51 -0
  51. package/dist/daemon/lib/chunker/bounded-channel.js +138 -0
  52. package/dist/daemon/lib/chunker/index.d.ts +135 -0
  53. package/dist/daemon/lib/chunker/index.js +1370 -0
  54. package/dist/daemon/lib/chunker/types.d.ts +77 -0
  55. package/dist/daemon/lib/chunker/types.js +50 -0
  56. package/dist/daemon/lib/config.d.ts +73 -0
  57. package/dist/daemon/lib/config.js +149 -0
  58. package/dist/daemon/lib/constants.d.ts +75 -0
  59. package/dist/daemon/lib/constants.js +114 -0
  60. package/dist/daemon/lib/gitignore.d.ts +57 -0
  61. package/dist/daemon/lib/gitignore.js +246 -0
  62. package/dist/daemon/lib/logger.d.ts +51 -0
  63. package/dist/daemon/lib/logger.js +167 -0
  64. package/dist/daemon/lib/manifest.d.ts +58 -0
  65. package/dist/daemon/lib/manifest.js +116 -0
  66. package/dist/daemon/lib/merkle/diff.d.ts +32 -0
  67. package/dist/daemon/lib/merkle/diff.js +107 -0
  68. package/dist/daemon/lib/merkle/hash.d.ts +40 -0
  69. package/dist/daemon/lib/merkle/hash.js +180 -0
  70. package/dist/daemon/lib/merkle/index.d.ts +71 -0
  71. package/dist/daemon/lib/merkle/index.js +309 -0
  72. package/dist/daemon/lib/merkle/node.d.ts +55 -0
  73. package/dist/daemon/lib/merkle/node.js +82 -0
  74. package/dist/daemon/lifecycle.d.ts +50 -0
  75. package/dist/daemon/lifecycle.js +142 -0
  76. package/dist/daemon/owner.d.ts +175 -0
  77. package/dist/daemon/owner.js +609 -0
  78. package/dist/daemon/protocol.d.ts +100 -0
  79. package/dist/daemon/protocol.js +163 -0
  80. package/dist/daemon/providers/api-utils.d.ts +130 -0
  81. package/dist/daemon/providers/api-utils.js +248 -0
  82. package/dist/daemon/providers/gemini.d.ts +39 -0
  83. package/dist/daemon/providers/gemini.js +205 -0
  84. package/dist/daemon/providers/index.d.ts +14 -0
  85. package/dist/daemon/providers/index.js +14 -0
  86. package/dist/daemon/providers/local-4b.d.ts +28 -0
  87. package/dist/daemon/providers/local-4b.js +51 -0
  88. package/dist/daemon/providers/local.d.ts +36 -0
  89. package/dist/daemon/providers/local.js +166 -0
  90. package/dist/daemon/providers/mistral.d.ts +35 -0
  91. package/dist/daemon/providers/mistral.js +160 -0
  92. package/dist/daemon/providers/mock.d.ts +35 -0
  93. package/dist/daemon/providers/mock.js +69 -0
  94. package/dist/daemon/providers/openai.d.ts +41 -0
  95. package/dist/daemon/providers/openai.js +190 -0
  96. package/dist/daemon/providers/types.d.ts +68 -0
  97. package/dist/daemon/providers/types.js +6 -0
  98. package/dist/daemon/providers/validate.d.ts +30 -0
  99. package/dist/daemon/providers/validate.js +162 -0
  100. package/dist/daemon/server.d.ts +79 -0
  101. package/dist/daemon/server.js +293 -0
  102. package/dist/daemon/services/index.d.ts +11 -0
  103. package/dist/daemon/services/index.js +16 -0
  104. package/dist/daemon/services/indexing.d.ts +117 -0
  105. package/dist/daemon/services/indexing.js +573 -0
  106. package/dist/daemon/services/search/filters.d.ts +21 -0
  107. package/dist/daemon/services/search/filters.js +106 -0
  108. package/dist/daemon/services/search/fts.d.ts +32 -0
  109. package/dist/daemon/services/search/fts.js +61 -0
  110. package/dist/daemon/services/search/hybrid.d.ts +17 -0
  111. package/dist/daemon/services/search/hybrid.js +58 -0
  112. package/dist/daemon/services/search/index.d.ts +108 -0
  113. package/dist/daemon/services/search/index.js +417 -0
  114. package/dist/daemon/services/search/types.d.ts +126 -0
  115. package/dist/daemon/services/search/types.js +4 -0
  116. package/dist/daemon/services/search/vector.d.ts +25 -0
  117. package/dist/daemon/services/search/vector.js +44 -0
  118. package/dist/daemon/services/storage/index.d.ts +110 -0
  119. package/dist/daemon/services/storage/index.js +378 -0
  120. package/dist/daemon/services/storage/schema.d.ts +24 -0
  121. package/dist/daemon/services/storage/schema.js +51 -0
  122. package/dist/daemon/services/storage/types.d.ts +105 -0
  123. package/dist/daemon/services/storage/types.js +71 -0
  124. package/dist/daemon/services/types.d.ts +192 -0
  125. package/dist/daemon/services/types.js +53 -0
  126. package/dist/daemon/services/watcher.d.ts +98 -0
  127. package/dist/daemon/services/watcher.js +386 -0
  128. package/dist/daemon/state.d.ts +119 -0
  129. package/dist/daemon/state.js +161 -0
  130. package/dist/mcp/index.d.ts +1 -1
  131. package/dist/mcp/index.js +44 -60
  132. package/dist/mcp/server.d.ts +10 -14
  133. package/dist/mcp/server.js +75 -74
  134. package/dist/mcp/services/lazy-loader.d.ts +23 -0
  135. package/dist/mcp/services/lazy-loader.js +34 -0
  136. package/dist/mcp/warmup.d.ts +3 -3
  137. package/dist/mcp/warmup.js +39 -40
  138. package/dist/mcp/watcher.d.ts +5 -7
  139. package/dist/mcp/watcher.js +73 -64
  140. package/dist/rag/config/index.d.ts +2 -0
  141. package/dist/rag/constants.d.ts +30 -0
  142. package/dist/rag/constants.js +38 -0
  143. package/dist/rag/embeddings/api-utils.d.ts +121 -0
  144. package/dist/rag/embeddings/api-utils.js +259 -0
  145. package/dist/rag/embeddings/gemini.d.ts +4 -12
  146. package/dist/rag/embeddings/gemini.js +22 -72
  147. package/dist/rag/embeddings/index.d.ts +5 -3
  148. package/dist/rag/embeddings/index.js +5 -2
  149. package/dist/rag/embeddings/local-4b.d.ts +2 -2
  150. package/dist/rag/embeddings/local-4b.js +1 -1
  151. package/dist/rag/embeddings/local.d.ts +10 -3
  152. package/dist/rag/embeddings/local.js +58 -12
  153. package/dist/rag/embeddings/mistral.d.ts +4 -12
  154. package/dist/rag/embeddings/mistral.js +22 -72
  155. package/dist/rag/embeddings/mock.d.ts +35 -0
  156. package/dist/rag/embeddings/mock.js +69 -0
  157. package/dist/rag/embeddings/openai.d.ts +11 -13
  158. package/dist/rag/embeddings/openai.js +47 -75
  159. package/dist/rag/embeddings/types.d.ts +27 -1
  160. package/dist/rag/embeddings/validate.d.ts +9 -1
  161. package/dist/rag/embeddings/validate.js +17 -4
  162. package/dist/rag/index.d.ts +2 -2
  163. package/dist/rag/index.js +1 -1
  164. package/dist/rag/indexer/bounded-channel.d.ts +51 -0
  165. package/dist/rag/indexer/bounded-channel.js +138 -0
  166. package/dist/rag/indexer/indexer.d.ts +4 -14
  167. package/dist/rag/indexer/indexer.js +246 -169
  168. package/dist/rag/indexer/types.d.ts +1 -0
  169. package/dist/rag/logger/index.d.ts +22 -0
  170. package/dist/rag/logger/index.js +78 -1
  171. package/dist/rag/manifest/index.js +1 -2
  172. package/dist/rag/search/index.js +1 -1
  173. package/dist/rag/storage/schema.d.ts +2 -4
  174. package/dist/rag/storage/schema.js +3 -5
  175. package/dist/store/app/selectors.d.ts +87 -0
  176. package/dist/store/app/selectors.js +28 -0
  177. package/dist/store/app/slice.d.ts +1013 -0
  178. package/dist/store/app/slice.js +112 -0
  179. package/dist/store/hooks.d.ts +22 -0
  180. package/dist/store/hooks.js +17 -0
  181. package/dist/store/index.d.ts +12 -0
  182. package/dist/store/index.js +18 -0
  183. package/dist/store/indexing/listeners.d.ts +25 -0
  184. package/dist/store/indexing/listeners.js +46 -0
  185. package/dist/store/indexing/selectors.d.ts +195 -0
  186. package/dist/store/indexing/selectors.js +69 -0
  187. package/dist/store/indexing/slice.d.ts +309 -0
  188. package/dist/store/indexing/slice.js +113 -0
  189. package/dist/store/slot-progress/listeners.d.ts +23 -0
  190. package/dist/store/slot-progress/listeners.js +33 -0
  191. package/dist/store/slot-progress/selectors.d.ts +67 -0
  192. package/dist/store/slot-progress/selectors.js +36 -0
  193. package/dist/store/slot-progress/slice.d.ts +246 -0
  194. package/dist/store/slot-progress/slice.js +70 -0
  195. package/dist/store/store.d.ts +17 -0
  196. package/dist/store/store.js +18 -0
  197. package/dist/store/warmup/selectors.d.ts +109 -0
  198. package/dist/store/warmup/selectors.js +44 -0
  199. package/dist/store/warmup/slice.d.ts +137 -0
  200. package/dist/store/warmup/slice.js +72 -0
  201. package/dist/store/watcher/selectors.d.ts +115 -0
  202. package/dist/store/watcher/selectors.js +52 -0
  203. package/dist/store/watcher/slice.d.ts +269 -0
  204. package/dist/store/watcher/slice.js +100 -0
  205. package/dist/store/wizard/selectors.d.ts +115 -0
  206. package/dist/store/wizard/selectors.js +36 -0
  207. package/dist/store/wizard/slice.d.ts +523 -0
  208. package/dist/store/wizard/slice.js +119 -0
  209. package/package.json +10 -2
@@ -0,0 +1,1013 @@
1
+ /**
2
+ * Redux slice for app-level state.
3
+ *
4
+ * Centralizes output items, initialization status, and index stats
5
+ * that were previously managed via React useState in app.tsx.
6
+ */
7
+ import { type PayloadAction } from '@reduxjs/toolkit';
8
+ import type { OutputItem, IndexDisplayStats, AppStatus, SearchResultsData } from '../../common/types.js';
9
+ export interface AppState {
10
+ /** Initialization status: undefined = loading, false = not initialized, true = initialized */
11
+ isInitialized: boolean | undefined;
12
+ /** Index statistics: undefined = loading, null = no manifest, {...} = stats */
13
+ indexStats: IndexDisplayStats | null | undefined;
14
+ /** Current app status for the status bar */
15
+ appStatus: AppStatus;
16
+ /** Output items displayed in the CLI */
17
+ outputItems: OutputItem[];
18
+ /** Next ID for output items */
19
+ nextOutputId: number;
20
+ }
21
+ export declare const appSlice: import("@reduxjs/toolkit").Slice<AppState, {
22
+ /**
23
+ * Set initialization status.
24
+ */
25
+ setInitialized: (state: {
26
+ isInitialized: boolean | undefined;
27
+ indexStats: {
28
+ totalFiles: number;
29
+ totalChunks: number;
30
+ } | null | undefined;
31
+ appStatus: {
32
+ state: "ready";
33
+ } | {
34
+ state: "searching";
35
+ } | {
36
+ state: "warning";
37
+ message: string;
38
+ };
39
+ outputItems: ({
40
+ id: string;
41
+ type: "user";
42
+ content: string;
43
+ } | {
44
+ id: string;
45
+ type: "system";
46
+ content: string;
47
+ } | {
48
+ id: string;
49
+ type: "welcome";
50
+ content: string;
51
+ } | {
52
+ id: string;
53
+ type: "search-results";
54
+ data: {
55
+ query: string;
56
+ elapsedMs: number;
57
+ results: {
58
+ type: string;
59
+ name: string;
60
+ filepath: string;
61
+ filename: string;
62
+ startLine: number;
63
+ endLine: number;
64
+ score: number;
65
+ text: string;
66
+ }[];
67
+ };
68
+ })[];
69
+ nextOutputId: number;
70
+ }, action: PayloadAction<boolean>) => void;
71
+ /**
72
+ * Reset to uninitialized (after clean).
73
+ */
74
+ resetInitialized: (state: {
75
+ isInitialized: boolean | undefined;
76
+ indexStats: {
77
+ totalFiles: number;
78
+ totalChunks: number;
79
+ } | null | undefined;
80
+ appStatus: {
81
+ state: "ready";
82
+ } | {
83
+ state: "searching";
84
+ } | {
85
+ state: "warning";
86
+ message: string;
87
+ };
88
+ outputItems: ({
89
+ id: string;
90
+ type: "user";
91
+ content: string;
92
+ } | {
93
+ id: string;
94
+ type: "system";
95
+ content: string;
96
+ } | {
97
+ id: string;
98
+ type: "welcome";
99
+ content: string;
100
+ } | {
101
+ id: string;
102
+ type: "search-results";
103
+ data: {
104
+ query: string;
105
+ elapsedMs: number;
106
+ results: {
107
+ type: string;
108
+ name: string;
109
+ filepath: string;
110
+ filename: string;
111
+ startLine: number;
112
+ endLine: number;
113
+ score: number;
114
+ text: string;
115
+ }[];
116
+ };
117
+ })[];
118
+ nextOutputId: number;
119
+ }) => void;
120
+ /**
121
+ * Set index statistics.
122
+ */
123
+ setIndexStats: (state: {
124
+ isInitialized: boolean | undefined;
125
+ indexStats: {
126
+ totalFiles: number;
127
+ totalChunks: number;
128
+ } | null | undefined;
129
+ appStatus: {
130
+ state: "ready";
131
+ } | {
132
+ state: "searching";
133
+ } | {
134
+ state: "warning";
135
+ message: string;
136
+ };
137
+ outputItems: ({
138
+ id: string;
139
+ type: "user";
140
+ content: string;
141
+ } | {
142
+ id: string;
143
+ type: "system";
144
+ content: string;
145
+ } | {
146
+ id: string;
147
+ type: "welcome";
148
+ content: string;
149
+ } | {
150
+ id: string;
151
+ type: "search-results";
152
+ data: {
153
+ query: string;
154
+ elapsedMs: number;
155
+ results: {
156
+ type: string;
157
+ name: string;
158
+ filepath: string;
159
+ filename: string;
160
+ startLine: number;
161
+ endLine: number;
162
+ score: number;
163
+ text: string;
164
+ }[];
165
+ };
166
+ })[];
167
+ nextOutputId: number;
168
+ }, action: PayloadAction<IndexDisplayStats | null>) => void;
169
+ /**
170
+ * Set app status for status bar.
171
+ */
172
+ setAppStatus: (state: {
173
+ isInitialized: boolean | undefined;
174
+ indexStats: {
175
+ totalFiles: number;
176
+ totalChunks: number;
177
+ } | null | undefined;
178
+ appStatus: {
179
+ state: "ready";
180
+ } | {
181
+ state: "searching";
182
+ } | {
183
+ state: "warning";
184
+ message: string;
185
+ };
186
+ outputItems: ({
187
+ id: string;
188
+ type: "user";
189
+ content: string;
190
+ } | {
191
+ id: string;
192
+ type: "system";
193
+ content: string;
194
+ } | {
195
+ id: string;
196
+ type: "welcome";
197
+ content: string;
198
+ } | {
199
+ id: string;
200
+ type: "search-results";
201
+ data: {
202
+ query: string;
203
+ elapsedMs: number;
204
+ results: {
205
+ type: string;
206
+ name: string;
207
+ filepath: string;
208
+ filename: string;
209
+ startLine: number;
210
+ endLine: number;
211
+ score: number;
212
+ text: string;
213
+ }[];
214
+ };
215
+ })[];
216
+ nextOutputId: number;
217
+ }, action: PayloadAction<AppStatus>) => void;
218
+ /**
219
+ * Reset app status to ready.
220
+ */
221
+ setReady: (state: {
222
+ isInitialized: boolean | undefined;
223
+ indexStats: {
224
+ totalFiles: number;
225
+ totalChunks: number;
226
+ } | null | undefined;
227
+ appStatus: {
228
+ state: "ready";
229
+ } | {
230
+ state: "searching";
231
+ } | {
232
+ state: "warning";
233
+ message: string;
234
+ };
235
+ outputItems: ({
236
+ id: string;
237
+ type: "user";
238
+ content: string;
239
+ } | {
240
+ id: string;
241
+ type: "system";
242
+ content: string;
243
+ } | {
244
+ id: string;
245
+ type: "welcome";
246
+ content: string;
247
+ } | {
248
+ id: string;
249
+ type: "search-results";
250
+ data: {
251
+ query: string;
252
+ elapsedMs: number;
253
+ results: {
254
+ type: string;
255
+ name: string;
256
+ filepath: string;
257
+ filename: string;
258
+ startLine: number;
259
+ endLine: number;
260
+ score: number;
261
+ text: string;
262
+ }[];
263
+ };
264
+ })[];
265
+ nextOutputId: number;
266
+ }) => void;
267
+ /**
268
+ * Set searching status.
269
+ * Note: Indexing status is derived from the indexing slice (synced from daemon).
270
+ */
271
+ setSearching: (state: {
272
+ isInitialized: boolean | undefined;
273
+ indexStats: {
274
+ totalFiles: number;
275
+ totalChunks: number;
276
+ } | null | undefined;
277
+ appStatus: {
278
+ state: "ready";
279
+ } | {
280
+ state: "searching";
281
+ } | {
282
+ state: "warning";
283
+ message: string;
284
+ };
285
+ outputItems: ({
286
+ id: string;
287
+ type: "user";
288
+ content: string;
289
+ } | {
290
+ id: string;
291
+ type: "system";
292
+ content: string;
293
+ } | {
294
+ id: string;
295
+ type: "welcome";
296
+ content: string;
297
+ } | {
298
+ id: string;
299
+ type: "search-results";
300
+ data: {
301
+ query: string;
302
+ elapsedMs: number;
303
+ results: {
304
+ type: string;
305
+ name: string;
306
+ filepath: string;
307
+ filename: string;
308
+ startLine: number;
309
+ endLine: number;
310
+ score: number;
311
+ text: string;
312
+ }[];
313
+ };
314
+ })[];
315
+ nextOutputId: number;
316
+ }) => void;
317
+ /**
318
+ * Set warning status with message.
319
+ */
320
+ setWarning: (state: {
321
+ isInitialized: boolean | undefined;
322
+ indexStats: {
323
+ totalFiles: number;
324
+ totalChunks: number;
325
+ } | null | undefined;
326
+ appStatus: {
327
+ state: "ready";
328
+ } | {
329
+ state: "searching";
330
+ } | {
331
+ state: "warning";
332
+ message: string;
333
+ };
334
+ outputItems: ({
335
+ id: string;
336
+ type: "user";
337
+ content: string;
338
+ } | {
339
+ id: string;
340
+ type: "system";
341
+ content: string;
342
+ } | {
343
+ id: string;
344
+ type: "welcome";
345
+ content: string;
346
+ } | {
347
+ id: string;
348
+ type: "search-results";
349
+ data: {
350
+ query: string;
351
+ elapsedMs: number;
352
+ results: {
353
+ type: string;
354
+ name: string;
355
+ filepath: string;
356
+ filename: string;
357
+ startLine: number;
358
+ endLine: number;
359
+ score: number;
360
+ text: string;
361
+ }[];
362
+ };
363
+ })[];
364
+ nextOutputId: number;
365
+ }, action: PayloadAction<string>) => void;
366
+ /**
367
+ * Add a user or system output item.
368
+ */
369
+ addOutput: (state: {
370
+ isInitialized: boolean | undefined;
371
+ indexStats: {
372
+ totalFiles: number;
373
+ totalChunks: number;
374
+ } | null | undefined;
375
+ appStatus: {
376
+ state: "ready";
377
+ } | {
378
+ state: "searching";
379
+ } | {
380
+ state: "warning";
381
+ message: string;
382
+ };
383
+ outputItems: ({
384
+ id: string;
385
+ type: "user";
386
+ content: string;
387
+ } | {
388
+ id: string;
389
+ type: "system";
390
+ content: string;
391
+ } | {
392
+ id: string;
393
+ type: "welcome";
394
+ content: string;
395
+ } | {
396
+ id: string;
397
+ type: "search-results";
398
+ data: {
399
+ query: string;
400
+ elapsedMs: number;
401
+ results: {
402
+ type: string;
403
+ name: string;
404
+ filepath: string;
405
+ filename: string;
406
+ startLine: number;
407
+ endLine: number;
408
+ score: number;
409
+ text: string;
410
+ }[];
411
+ };
412
+ })[];
413
+ nextOutputId: number;
414
+ }, action: PayloadAction<{
415
+ type: "user" | "system";
416
+ content: string;
417
+ }>) => void;
418
+ /**
419
+ * Add search results output item.
420
+ */
421
+ addSearchResults: (state: {
422
+ isInitialized: boolean | undefined;
423
+ indexStats: {
424
+ totalFiles: number;
425
+ totalChunks: number;
426
+ } | null | undefined;
427
+ appStatus: {
428
+ state: "ready";
429
+ } | {
430
+ state: "searching";
431
+ } | {
432
+ state: "warning";
433
+ message: string;
434
+ };
435
+ outputItems: ({
436
+ id: string;
437
+ type: "user";
438
+ content: string;
439
+ } | {
440
+ id: string;
441
+ type: "system";
442
+ content: string;
443
+ } | {
444
+ id: string;
445
+ type: "welcome";
446
+ content: string;
447
+ } | {
448
+ id: string;
449
+ type: "search-results";
450
+ data: {
451
+ query: string;
452
+ elapsedMs: number;
453
+ results: {
454
+ type: string;
455
+ name: string;
456
+ filepath: string;
457
+ filename: string;
458
+ startLine: number;
459
+ endLine: number;
460
+ score: number;
461
+ text: string;
462
+ }[];
463
+ };
464
+ })[];
465
+ nextOutputId: number;
466
+ }, action: PayloadAction<SearchResultsData>) => void;
467
+ /**
468
+ * Clear all output items.
469
+ */
470
+ clearOutput: (state: {
471
+ isInitialized: boolean | undefined;
472
+ indexStats: {
473
+ totalFiles: number;
474
+ totalChunks: number;
475
+ } | null | undefined;
476
+ appStatus: {
477
+ state: "ready";
478
+ } | {
479
+ state: "searching";
480
+ } | {
481
+ state: "warning";
482
+ message: string;
483
+ };
484
+ outputItems: ({
485
+ id: string;
486
+ type: "user";
487
+ content: string;
488
+ } | {
489
+ id: string;
490
+ type: "system";
491
+ content: string;
492
+ } | {
493
+ id: string;
494
+ type: "welcome";
495
+ content: string;
496
+ } | {
497
+ id: string;
498
+ type: "search-results";
499
+ data: {
500
+ query: string;
501
+ elapsedMs: number;
502
+ results: {
503
+ type: string;
504
+ name: string;
505
+ filepath: string;
506
+ filename: string;
507
+ startLine: number;
508
+ endLine: number;
509
+ score: number;
510
+ text: string;
511
+ }[];
512
+ };
513
+ })[];
514
+ nextOutputId: number;
515
+ }) => void;
516
+ }, "app", "app", import("@reduxjs/toolkit").SliceSelectors<AppState>>;
517
+ export declare const AppActions: import("@reduxjs/toolkit").CaseReducerActions<{
518
+ /**
519
+ * Set initialization status.
520
+ */
521
+ setInitialized: (state: {
522
+ isInitialized: boolean | undefined;
523
+ indexStats: {
524
+ totalFiles: number;
525
+ totalChunks: number;
526
+ } | null | undefined;
527
+ appStatus: {
528
+ state: "ready";
529
+ } | {
530
+ state: "searching";
531
+ } | {
532
+ state: "warning";
533
+ message: string;
534
+ };
535
+ outputItems: ({
536
+ id: string;
537
+ type: "user";
538
+ content: string;
539
+ } | {
540
+ id: string;
541
+ type: "system";
542
+ content: string;
543
+ } | {
544
+ id: string;
545
+ type: "welcome";
546
+ content: string;
547
+ } | {
548
+ id: string;
549
+ type: "search-results";
550
+ data: {
551
+ query: string;
552
+ elapsedMs: number;
553
+ results: {
554
+ type: string;
555
+ name: string;
556
+ filepath: string;
557
+ filename: string;
558
+ startLine: number;
559
+ endLine: number;
560
+ score: number;
561
+ text: string;
562
+ }[];
563
+ };
564
+ })[];
565
+ nextOutputId: number;
566
+ }, action: PayloadAction<boolean>) => void;
567
+ /**
568
+ * Reset to uninitialized (after clean).
569
+ */
570
+ resetInitialized: (state: {
571
+ isInitialized: boolean | undefined;
572
+ indexStats: {
573
+ totalFiles: number;
574
+ totalChunks: number;
575
+ } | null | undefined;
576
+ appStatus: {
577
+ state: "ready";
578
+ } | {
579
+ state: "searching";
580
+ } | {
581
+ state: "warning";
582
+ message: string;
583
+ };
584
+ outputItems: ({
585
+ id: string;
586
+ type: "user";
587
+ content: string;
588
+ } | {
589
+ id: string;
590
+ type: "system";
591
+ content: string;
592
+ } | {
593
+ id: string;
594
+ type: "welcome";
595
+ content: string;
596
+ } | {
597
+ id: string;
598
+ type: "search-results";
599
+ data: {
600
+ query: string;
601
+ elapsedMs: number;
602
+ results: {
603
+ type: string;
604
+ name: string;
605
+ filepath: string;
606
+ filename: string;
607
+ startLine: number;
608
+ endLine: number;
609
+ score: number;
610
+ text: string;
611
+ }[];
612
+ };
613
+ })[];
614
+ nextOutputId: number;
615
+ }) => void;
616
+ /**
617
+ * Set index statistics.
618
+ */
619
+ setIndexStats: (state: {
620
+ isInitialized: boolean | undefined;
621
+ indexStats: {
622
+ totalFiles: number;
623
+ totalChunks: number;
624
+ } | null | undefined;
625
+ appStatus: {
626
+ state: "ready";
627
+ } | {
628
+ state: "searching";
629
+ } | {
630
+ state: "warning";
631
+ message: string;
632
+ };
633
+ outputItems: ({
634
+ id: string;
635
+ type: "user";
636
+ content: string;
637
+ } | {
638
+ id: string;
639
+ type: "system";
640
+ content: string;
641
+ } | {
642
+ id: string;
643
+ type: "welcome";
644
+ content: string;
645
+ } | {
646
+ id: string;
647
+ type: "search-results";
648
+ data: {
649
+ query: string;
650
+ elapsedMs: number;
651
+ results: {
652
+ type: string;
653
+ name: string;
654
+ filepath: string;
655
+ filename: string;
656
+ startLine: number;
657
+ endLine: number;
658
+ score: number;
659
+ text: string;
660
+ }[];
661
+ };
662
+ })[];
663
+ nextOutputId: number;
664
+ }, action: PayloadAction<IndexDisplayStats | null>) => void;
665
+ /**
666
+ * Set app status for status bar.
667
+ */
668
+ setAppStatus: (state: {
669
+ isInitialized: boolean | undefined;
670
+ indexStats: {
671
+ totalFiles: number;
672
+ totalChunks: number;
673
+ } | null | undefined;
674
+ appStatus: {
675
+ state: "ready";
676
+ } | {
677
+ state: "searching";
678
+ } | {
679
+ state: "warning";
680
+ message: string;
681
+ };
682
+ outputItems: ({
683
+ id: string;
684
+ type: "user";
685
+ content: string;
686
+ } | {
687
+ id: string;
688
+ type: "system";
689
+ content: string;
690
+ } | {
691
+ id: string;
692
+ type: "welcome";
693
+ content: string;
694
+ } | {
695
+ id: string;
696
+ type: "search-results";
697
+ data: {
698
+ query: string;
699
+ elapsedMs: number;
700
+ results: {
701
+ type: string;
702
+ name: string;
703
+ filepath: string;
704
+ filename: string;
705
+ startLine: number;
706
+ endLine: number;
707
+ score: number;
708
+ text: string;
709
+ }[];
710
+ };
711
+ })[];
712
+ nextOutputId: number;
713
+ }, action: PayloadAction<AppStatus>) => void;
714
+ /**
715
+ * Reset app status to ready.
716
+ */
717
+ setReady: (state: {
718
+ isInitialized: boolean | undefined;
719
+ indexStats: {
720
+ totalFiles: number;
721
+ totalChunks: number;
722
+ } | null | undefined;
723
+ appStatus: {
724
+ state: "ready";
725
+ } | {
726
+ state: "searching";
727
+ } | {
728
+ state: "warning";
729
+ message: string;
730
+ };
731
+ outputItems: ({
732
+ id: string;
733
+ type: "user";
734
+ content: string;
735
+ } | {
736
+ id: string;
737
+ type: "system";
738
+ content: string;
739
+ } | {
740
+ id: string;
741
+ type: "welcome";
742
+ content: string;
743
+ } | {
744
+ id: string;
745
+ type: "search-results";
746
+ data: {
747
+ query: string;
748
+ elapsedMs: number;
749
+ results: {
750
+ type: string;
751
+ name: string;
752
+ filepath: string;
753
+ filename: string;
754
+ startLine: number;
755
+ endLine: number;
756
+ score: number;
757
+ text: string;
758
+ }[];
759
+ };
760
+ })[];
761
+ nextOutputId: number;
762
+ }) => void;
763
+ /**
764
+ * Set searching status.
765
+ * Note: Indexing status is derived from the indexing slice (synced from daemon).
766
+ */
767
+ setSearching: (state: {
768
+ isInitialized: boolean | undefined;
769
+ indexStats: {
770
+ totalFiles: number;
771
+ totalChunks: number;
772
+ } | null | undefined;
773
+ appStatus: {
774
+ state: "ready";
775
+ } | {
776
+ state: "searching";
777
+ } | {
778
+ state: "warning";
779
+ message: string;
780
+ };
781
+ outputItems: ({
782
+ id: string;
783
+ type: "user";
784
+ content: string;
785
+ } | {
786
+ id: string;
787
+ type: "system";
788
+ content: string;
789
+ } | {
790
+ id: string;
791
+ type: "welcome";
792
+ content: string;
793
+ } | {
794
+ id: string;
795
+ type: "search-results";
796
+ data: {
797
+ query: string;
798
+ elapsedMs: number;
799
+ results: {
800
+ type: string;
801
+ name: string;
802
+ filepath: string;
803
+ filename: string;
804
+ startLine: number;
805
+ endLine: number;
806
+ score: number;
807
+ text: string;
808
+ }[];
809
+ };
810
+ })[];
811
+ nextOutputId: number;
812
+ }) => void;
813
+ /**
814
+ * Set warning status with message.
815
+ */
816
+ setWarning: (state: {
817
+ isInitialized: boolean | undefined;
818
+ indexStats: {
819
+ totalFiles: number;
820
+ totalChunks: number;
821
+ } | null | undefined;
822
+ appStatus: {
823
+ state: "ready";
824
+ } | {
825
+ state: "searching";
826
+ } | {
827
+ state: "warning";
828
+ message: string;
829
+ };
830
+ outputItems: ({
831
+ id: string;
832
+ type: "user";
833
+ content: string;
834
+ } | {
835
+ id: string;
836
+ type: "system";
837
+ content: string;
838
+ } | {
839
+ id: string;
840
+ type: "welcome";
841
+ content: string;
842
+ } | {
843
+ id: string;
844
+ type: "search-results";
845
+ data: {
846
+ query: string;
847
+ elapsedMs: number;
848
+ results: {
849
+ type: string;
850
+ name: string;
851
+ filepath: string;
852
+ filename: string;
853
+ startLine: number;
854
+ endLine: number;
855
+ score: number;
856
+ text: string;
857
+ }[];
858
+ };
859
+ })[];
860
+ nextOutputId: number;
861
+ }, action: PayloadAction<string>) => void;
862
+ /**
863
+ * Add a user or system output item.
864
+ */
865
+ addOutput: (state: {
866
+ isInitialized: boolean | undefined;
867
+ indexStats: {
868
+ totalFiles: number;
869
+ totalChunks: number;
870
+ } | null | undefined;
871
+ appStatus: {
872
+ state: "ready";
873
+ } | {
874
+ state: "searching";
875
+ } | {
876
+ state: "warning";
877
+ message: string;
878
+ };
879
+ outputItems: ({
880
+ id: string;
881
+ type: "user";
882
+ content: string;
883
+ } | {
884
+ id: string;
885
+ type: "system";
886
+ content: string;
887
+ } | {
888
+ id: string;
889
+ type: "welcome";
890
+ content: string;
891
+ } | {
892
+ id: string;
893
+ type: "search-results";
894
+ data: {
895
+ query: string;
896
+ elapsedMs: number;
897
+ results: {
898
+ type: string;
899
+ name: string;
900
+ filepath: string;
901
+ filename: string;
902
+ startLine: number;
903
+ endLine: number;
904
+ score: number;
905
+ text: string;
906
+ }[];
907
+ };
908
+ })[];
909
+ nextOutputId: number;
910
+ }, action: PayloadAction<{
911
+ type: "user" | "system";
912
+ content: string;
913
+ }>) => void;
914
+ /**
915
+ * Add search results output item.
916
+ */
917
+ addSearchResults: (state: {
918
+ isInitialized: boolean | undefined;
919
+ indexStats: {
920
+ totalFiles: number;
921
+ totalChunks: number;
922
+ } | null | undefined;
923
+ appStatus: {
924
+ state: "ready";
925
+ } | {
926
+ state: "searching";
927
+ } | {
928
+ state: "warning";
929
+ message: string;
930
+ };
931
+ outputItems: ({
932
+ id: string;
933
+ type: "user";
934
+ content: string;
935
+ } | {
936
+ id: string;
937
+ type: "system";
938
+ content: string;
939
+ } | {
940
+ id: string;
941
+ type: "welcome";
942
+ content: string;
943
+ } | {
944
+ id: string;
945
+ type: "search-results";
946
+ data: {
947
+ query: string;
948
+ elapsedMs: number;
949
+ results: {
950
+ type: string;
951
+ name: string;
952
+ filepath: string;
953
+ filename: string;
954
+ startLine: number;
955
+ endLine: number;
956
+ score: number;
957
+ text: string;
958
+ }[];
959
+ };
960
+ })[];
961
+ nextOutputId: number;
962
+ }, action: PayloadAction<SearchResultsData>) => void;
963
+ /**
964
+ * Clear all output items.
965
+ */
966
+ clearOutput: (state: {
967
+ isInitialized: boolean | undefined;
968
+ indexStats: {
969
+ totalFiles: number;
970
+ totalChunks: number;
971
+ } | null | undefined;
972
+ appStatus: {
973
+ state: "ready";
974
+ } | {
975
+ state: "searching";
976
+ } | {
977
+ state: "warning";
978
+ message: string;
979
+ };
980
+ outputItems: ({
981
+ id: string;
982
+ type: "user";
983
+ content: string;
984
+ } | {
985
+ id: string;
986
+ type: "system";
987
+ content: string;
988
+ } | {
989
+ id: string;
990
+ type: "welcome";
991
+ content: string;
992
+ } | {
993
+ id: string;
994
+ type: "search-results";
995
+ data: {
996
+ query: string;
997
+ elapsedMs: number;
998
+ results: {
999
+ type: string;
1000
+ name: string;
1001
+ filepath: string;
1002
+ filename: string;
1003
+ startLine: number;
1004
+ endLine: number;
1005
+ score: number;
1006
+ text: string;
1007
+ }[];
1008
+ };
1009
+ })[];
1010
+ nextOutputId: number;
1011
+ }) => void;
1012
+ }, "app">;
1013
+ export declare const appReducer: import("redux").Reducer<AppState>;