umbrella-context 0.1.39 → 0.1.41

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.
@@ -0,0 +1,502 @@
1
+ import { z } from "zod";
2
+ declare const SwarmConfigSchema: z.ZodObject<{
3
+ enrichment: z.ZodDefault<z.ZodObject<{
4
+ edges: z.ZodDefault<z.ZodArray<z.ZodObject<{
5
+ from: z.ZodString;
6
+ to: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ to: string;
9
+ from: string;
10
+ }, {
11
+ to: string;
12
+ from: string;
13
+ }>, "many">>;
14
+ enabled: z.ZodDefault<z.ZodBoolean>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ edges: {
17
+ to: string;
18
+ from: string;
19
+ }[];
20
+ enabled: boolean;
21
+ }, {
22
+ edges?: {
23
+ to: string;
24
+ from: string;
25
+ }[] | undefined;
26
+ enabled?: boolean | undefined;
27
+ }>>;
28
+ providers: z.ZodObject<{
29
+ gbrain: z.ZodOptional<z.ZodObject<{
30
+ enabled: z.ZodDefault<z.ZodBoolean>;
31
+ notesPath: z.ZodString;
32
+ readOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ readOnly: boolean;
35
+ enabled: boolean;
36
+ notesPath: string;
37
+ }, {
38
+ notesPath: string;
39
+ readOnly?: boolean | undefined;
40
+ enabled?: boolean | undefined;
41
+ }>>;
42
+ localMarkdown: z.ZodOptional<z.ZodObject<{
43
+ enabled: z.ZodDefault<z.ZodBoolean>;
44
+ folders: z.ZodDefault<z.ZodArray<z.ZodObject<{
45
+ followWikilinks: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
46
+ id: z.ZodString;
47
+ name: z.ZodString;
48
+ path: z.ZodString;
49
+ readOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ id: string;
52
+ name: string;
53
+ path: string;
54
+ followWikilinks: boolean;
55
+ readOnly: boolean;
56
+ }, {
57
+ id: string;
58
+ name: string;
59
+ path: string;
60
+ followWikilinks?: boolean | undefined;
61
+ readOnly?: boolean | undefined;
62
+ }>, "many">>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ folders: {
65
+ id: string;
66
+ name: string;
67
+ path: string;
68
+ followWikilinks: boolean;
69
+ readOnly: boolean;
70
+ }[];
71
+ enabled: boolean;
72
+ }, {
73
+ folders?: {
74
+ id: string;
75
+ name: string;
76
+ path: string;
77
+ followWikilinks?: boolean | undefined;
78
+ readOnly?: boolean | undefined;
79
+ }[] | undefined;
80
+ enabled?: boolean | undefined;
81
+ }>>;
82
+ memoryWiki: z.ZodOptional<z.ZodObject<{
83
+ enabled: z.ZodDefault<z.ZodBoolean>;
84
+ readOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
85
+ wikiPath: z.ZodString;
86
+ }, "strip", z.ZodTypeAny, {
87
+ readOnly: boolean;
88
+ enabled: boolean;
89
+ wikiPath: string;
90
+ }, {
91
+ wikiPath: string;
92
+ readOnly?: boolean | undefined;
93
+ enabled?: boolean | undefined;
94
+ }>>;
95
+ obsidian: z.ZodOptional<z.ZodObject<{
96
+ enabled: z.ZodDefault<z.ZodBoolean>;
97
+ readOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
98
+ vaultPath: z.ZodString;
99
+ }, "strip", z.ZodTypeAny, {
100
+ readOnly: boolean;
101
+ enabled: boolean;
102
+ vaultPath: string;
103
+ }, {
104
+ vaultPath: string;
105
+ readOnly?: boolean | undefined;
106
+ enabled?: boolean | undefined;
107
+ }>>;
108
+ umbrellaContext: z.ZodDefault<z.ZodObject<{
109
+ enabled: z.ZodDefault<z.ZodBoolean>;
110
+ }, "strip", z.ZodTypeAny, {
111
+ enabled: boolean;
112
+ }, {
113
+ enabled?: boolean | undefined;
114
+ }>>;
115
+ }, "strip", z.ZodTypeAny, {
116
+ umbrellaContext: {
117
+ enabled: boolean;
118
+ };
119
+ gbrain?: {
120
+ readOnly: boolean;
121
+ enabled: boolean;
122
+ notesPath: string;
123
+ } | undefined;
124
+ localMarkdown?: {
125
+ folders: {
126
+ id: string;
127
+ name: string;
128
+ path: string;
129
+ followWikilinks: boolean;
130
+ readOnly: boolean;
131
+ }[];
132
+ enabled: boolean;
133
+ } | undefined;
134
+ memoryWiki?: {
135
+ readOnly: boolean;
136
+ enabled: boolean;
137
+ wikiPath: string;
138
+ } | undefined;
139
+ obsidian?: {
140
+ readOnly: boolean;
141
+ enabled: boolean;
142
+ vaultPath: string;
143
+ } | undefined;
144
+ }, {
145
+ gbrain?: {
146
+ notesPath: string;
147
+ readOnly?: boolean | undefined;
148
+ enabled?: boolean | undefined;
149
+ } | undefined;
150
+ localMarkdown?: {
151
+ folders?: {
152
+ id: string;
153
+ name: string;
154
+ path: string;
155
+ followWikilinks?: boolean | undefined;
156
+ readOnly?: boolean | undefined;
157
+ }[] | undefined;
158
+ enabled?: boolean | undefined;
159
+ } | undefined;
160
+ memoryWiki?: {
161
+ wikiPath: string;
162
+ readOnly?: boolean | undefined;
163
+ enabled?: boolean | undefined;
164
+ } | undefined;
165
+ obsidian?: {
166
+ vaultPath: string;
167
+ readOnly?: boolean | undefined;
168
+ enabled?: boolean | undefined;
169
+ } | undefined;
170
+ umbrellaContext?: {
171
+ enabled?: boolean | undefined;
172
+ } | undefined;
173
+ }>;
174
+ routing: z.ZodDefault<z.ZodObject<{
175
+ cacheTtlMs: z.ZodDefault<z.ZodNumber>;
176
+ defaultMaxResults: z.ZodDefault<z.ZodNumber>;
177
+ }, "strip", z.ZodTypeAny, {
178
+ cacheTtlMs: number;
179
+ defaultMaxResults: number;
180
+ }, {
181
+ cacheTtlMs?: number | undefined;
182
+ defaultMaxResults?: number | undefined;
183
+ }>>;
184
+ version: z.ZodDefault<z.ZodLiteral<1>>;
185
+ }, "strip", z.ZodTypeAny, {
186
+ providers: {
187
+ umbrellaContext: {
188
+ enabled: boolean;
189
+ };
190
+ gbrain?: {
191
+ readOnly: boolean;
192
+ enabled: boolean;
193
+ notesPath: string;
194
+ } | undefined;
195
+ localMarkdown?: {
196
+ folders: {
197
+ id: string;
198
+ name: string;
199
+ path: string;
200
+ followWikilinks: boolean;
201
+ readOnly: boolean;
202
+ }[];
203
+ enabled: boolean;
204
+ } | undefined;
205
+ memoryWiki?: {
206
+ readOnly: boolean;
207
+ enabled: boolean;
208
+ wikiPath: string;
209
+ } | undefined;
210
+ obsidian?: {
211
+ readOnly: boolean;
212
+ enabled: boolean;
213
+ vaultPath: string;
214
+ } | undefined;
215
+ };
216
+ version: 1;
217
+ enrichment: {
218
+ edges: {
219
+ to: string;
220
+ from: string;
221
+ }[];
222
+ enabled: boolean;
223
+ };
224
+ routing: {
225
+ cacheTtlMs: number;
226
+ defaultMaxResults: number;
227
+ };
228
+ }, {
229
+ providers: {
230
+ gbrain?: {
231
+ notesPath: string;
232
+ readOnly?: boolean | undefined;
233
+ enabled?: boolean | undefined;
234
+ } | undefined;
235
+ localMarkdown?: {
236
+ folders?: {
237
+ id: string;
238
+ name: string;
239
+ path: string;
240
+ followWikilinks?: boolean | undefined;
241
+ readOnly?: boolean | undefined;
242
+ }[] | undefined;
243
+ enabled?: boolean | undefined;
244
+ } | undefined;
245
+ memoryWiki?: {
246
+ wikiPath: string;
247
+ readOnly?: boolean | undefined;
248
+ enabled?: boolean | undefined;
249
+ } | undefined;
250
+ obsidian?: {
251
+ vaultPath: string;
252
+ readOnly?: boolean | undefined;
253
+ enabled?: boolean | undefined;
254
+ } | undefined;
255
+ umbrellaContext?: {
256
+ enabled?: boolean | undefined;
257
+ } | undefined;
258
+ };
259
+ version?: 1 | undefined;
260
+ enrichment?: {
261
+ edges?: {
262
+ to: string;
263
+ from: string;
264
+ }[] | undefined;
265
+ enabled?: boolean | undefined;
266
+ } | undefined;
267
+ routing?: {
268
+ cacheTtlMs?: number | undefined;
269
+ defaultMaxResults?: number | undefined;
270
+ } | undefined;
271
+ }>;
272
+ export type SwarmConfig = z.infer<typeof SwarmConfigSchema>;
273
+ export type SwarmProviderType = "umbrella-context" | "umbrella-source" | "obsidian" | "local-markdown" | "gbrain" | "memory-wiki";
274
+ export type SwarmQueryHit = {
275
+ content: string;
276
+ id: string;
277
+ matchType: "graph" | "keyword";
278
+ provider: string;
279
+ providerLabel: string;
280
+ providerType: SwarmProviderType;
281
+ score: number;
282
+ source: string;
283
+ };
284
+ export type SwarmProviderMeta = {
285
+ available: boolean;
286
+ detail: string;
287
+ enrichedBy?: string;
288
+ enrichmentHints?: string[];
289
+ healthy: boolean;
290
+ latencyMs: number;
291
+ resultCount: number;
292
+ selected: boolean;
293
+ writable: boolean;
294
+ };
295
+ export type SwarmQueryResult = {
296
+ cached: boolean;
297
+ cacheTtlMs: number;
298
+ meta: {
299
+ enrichmentEdges: Array<{
300
+ from: string;
301
+ to: string;
302
+ }>;
303
+ providerCount: number;
304
+ providers: Record<string, SwarmProviderMeta>;
305
+ totalLatencyMs: number;
306
+ };
307
+ query: string;
308
+ results: SwarmQueryHit[];
309
+ };
310
+ export type SwarmStoreResult = {
311
+ fallback: boolean;
312
+ id?: string;
313
+ provider: string;
314
+ success: boolean;
315
+ targetType: SwarmProviderType;
316
+ };
317
+ export type SwarmStatusSummary = {
318
+ configPath: string;
319
+ configured: boolean;
320
+ healthyProviders: number;
321
+ providerCount: number;
322
+ writableProviders: number;
323
+ };
324
+ export declare function getSwarmConfigPath(cwd?: string): Promise<string>;
325
+ export declare function hasSwarmConfig(cwd?: string): Promise<boolean>;
326
+ export declare function loadSwarmConfig(cwd?: string): Promise<{
327
+ providers: {
328
+ umbrellaContext: {
329
+ enabled: boolean;
330
+ };
331
+ gbrain?: {
332
+ readOnly: boolean;
333
+ enabled: boolean;
334
+ notesPath: string;
335
+ } | undefined;
336
+ localMarkdown?: {
337
+ folders: {
338
+ id: string;
339
+ name: string;
340
+ path: string;
341
+ followWikilinks: boolean;
342
+ readOnly: boolean;
343
+ }[];
344
+ enabled: boolean;
345
+ } | undefined;
346
+ memoryWiki?: {
347
+ readOnly: boolean;
348
+ enabled: boolean;
349
+ wikiPath: string;
350
+ } | undefined;
351
+ obsidian?: {
352
+ readOnly: boolean;
353
+ enabled: boolean;
354
+ vaultPath: string;
355
+ } | undefined;
356
+ };
357
+ version: 1;
358
+ enrichment: {
359
+ edges: {
360
+ to: string;
361
+ from: string;
362
+ }[];
363
+ enabled: boolean;
364
+ };
365
+ routing: {
366
+ cacheTtlMs: number;
367
+ defaultMaxResults: number;
368
+ };
369
+ } | null>;
370
+ export declare function saveSwarmConfig(config: SwarmConfig, cwd?: string): Promise<void>;
371
+ export declare function ensureSwarmConfigForLinkedSources(cwd?: string): Promise<{
372
+ configPath: string;
373
+ created: boolean;
374
+ ready: boolean;
375
+ config?: undefined;
376
+ } | {
377
+ config: {
378
+ providers: {
379
+ umbrellaContext: {
380
+ enabled: boolean;
381
+ };
382
+ gbrain?: {
383
+ readOnly: boolean;
384
+ enabled: boolean;
385
+ notesPath: string;
386
+ } | undefined;
387
+ localMarkdown?: {
388
+ folders: {
389
+ id: string;
390
+ name: string;
391
+ path: string;
392
+ followWikilinks: boolean;
393
+ readOnly: boolean;
394
+ }[];
395
+ enabled: boolean;
396
+ } | undefined;
397
+ memoryWiki?: {
398
+ readOnly: boolean;
399
+ enabled: boolean;
400
+ wikiPath: string;
401
+ } | undefined;
402
+ obsidian?: {
403
+ readOnly: boolean;
404
+ enabled: boolean;
405
+ vaultPath: string;
406
+ } | undefined;
407
+ };
408
+ version: 1;
409
+ enrichment: {
410
+ edges: {
411
+ to: string;
412
+ from: string;
413
+ }[];
414
+ enabled: boolean;
415
+ };
416
+ routing: {
417
+ cacheTtlMs: number;
418
+ defaultMaxResults: number;
419
+ };
420
+ };
421
+ configPath: string;
422
+ created: boolean;
423
+ ready: boolean;
424
+ }>;
425
+ export declare function formatSwarmQueryText(result: SwarmQueryResult, options?: {
426
+ explain?: boolean;
427
+ }): string;
428
+ export declare function getSwarmStatusSummary(cwd?: string): Promise<SwarmStatusSummary>;
429
+ export declare function getSwarmStatus(cwd?: string): Promise<{
430
+ configured: boolean;
431
+ configPath: string;
432
+ enrichmentEdges: Array<{
433
+ from: string;
434
+ to: string;
435
+ }>;
436
+ providers: Array<{
437
+ id: string;
438
+ label: string;
439
+ type: SwarmProviderType;
440
+ available: boolean;
441
+ detail: string;
442
+ writable: boolean;
443
+ }>;
444
+ suggestions: string[];
445
+ }>;
446
+ export declare function executeSwarmQuery(query: string, opts?: {
447
+ explain?: boolean;
448
+ format?: "json" | "text";
449
+ maxResults?: number;
450
+ provider?: string;
451
+ }, cwd?: string): Promise<SwarmQueryResult>;
452
+ export declare function executeSwarmCurate(content: string, opts?: {
453
+ provider?: string;
454
+ }, cwd?: string): Promise<SwarmStoreResult>;
455
+ export declare function runSwarmOnboardWizard(cwd?: string): Promise<{
456
+ config: {
457
+ providers: {
458
+ umbrellaContext: {
459
+ enabled: boolean;
460
+ };
461
+ gbrain?: {
462
+ readOnly: boolean;
463
+ enabled: boolean;
464
+ notesPath: string;
465
+ } | undefined;
466
+ localMarkdown?: {
467
+ folders: {
468
+ id: string;
469
+ name: string;
470
+ path: string;
471
+ followWikilinks: boolean;
472
+ readOnly: boolean;
473
+ }[];
474
+ enabled: boolean;
475
+ } | undefined;
476
+ memoryWiki?: {
477
+ readOnly: boolean;
478
+ enabled: boolean;
479
+ wikiPath: string;
480
+ } | undefined;
481
+ obsidian?: {
482
+ readOnly: boolean;
483
+ enabled: boolean;
484
+ vaultPath: string;
485
+ } | undefined;
486
+ };
487
+ version: 1;
488
+ enrichment: {
489
+ edges: {
490
+ to: string;
491
+ from: string;
492
+ }[];
493
+ enabled: boolean;
494
+ };
495
+ routing: {
496
+ cacheTtlMs: number;
497
+ defaultMaxResults: number;
498
+ };
499
+ };
500
+ configPath: string;
501
+ }>;
502
+ export {};