@wirecat/cli-core 0.434.0 → 0.436.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.
- package/CHANGELOG.md +47 -0
- package/dist/cli/messenger/context.js +1 -0
- package/dist/cli/messenger/conversation-answers.d.ts +1 -0
- package/dist/cli/messenger/conversations-command.js +2 -2
- package/dist/cli/messenger/message-answers.d.ts +1 -0
- package/dist/cli/messenger/message-writes.d.ts +2 -0
- package/dist/cli/messenger/messages-search-command.js +6 -10
- package/dist/cli/messenger/models-command.js +34 -7
- package/dist/cli/messenger/search-answers.d.ts +3 -0
- package/dist/cli/messenger/search-answers.js +40 -8
- package/dist/cli/messenger/search-command.js +3 -1
- package/dist/cli/messenger/store-maintenance-command.js +7 -4
- package/dist/cli/model-catalogue-command.js +1 -1
- package/dist/cli/profile.d.ts +4 -1
- package/dist/cli/profile.js +22 -7
- package/dist/cli/program.js +8 -4
- package/dist/cli/settings.d.ts +4 -0
- package/dist/cli/settings.js +5 -0
- package/dist/cli/shared-command-exports.d.ts +4 -0
- package/dist/embeddings/child.js +15 -5
- package/dist/embeddings/embed.d.ts +16 -2
- package/dist/embeddings/embed.js +57 -28
- package/dist/embeddings/models.d.ts +18 -0
- package/dist/embeddings/models.js +69 -0
- package/dist/embeddings/process.d.ts +6 -1
- package/dist/embeddings/process.js +23 -7
- package/dist/embeddings/rerank.d.ts +10 -0
- package/dist/embeddings/rerank.js +31 -0
- package/dist/entities/conversation-results.d.ts +2 -0
- package/dist/entities/evidence.d.ts +8 -0
- package/dist/entities/index.d.ts +27 -1
- package/dist/entities/listener.d.ts +4 -0
- package/dist/entities/message-context.d.ts +3 -0
- package/dist/entities/message-write.d.ts +4 -0
- package/dist/entities/message.d.ts +2 -0
- package/dist/entities/message.js +2 -0
- package/dist/entities/model.d.ts +5 -2
- package/dist/entities/model.js +5 -2
- package/dist/entities/store-maintenance.d.ts +1 -0
- package/dist/entities/store-maintenance.js +8 -1
- package/dist/entities/store-records.d.ts +1 -0
- package/dist/mcp/tool.d.ts +1 -1
- package/dist/mcp/tool.js +1 -0
- package/dist/services/deps.d.ts +3 -0
- package/dist/services/embeddings-maintenance.d.ts +10 -2
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.js +1 -0
- package/dist/services/messages-archive-search.d.ts +2 -2
- package/dist/services/messages-archive-search.js +4 -4
- package/dist/services/messages-discovery.d.ts +33 -4
- package/dist/services/messages-discovery.js +88 -3
- package/dist/services/messages-meaning.d.ts +2 -1
- package/dist/services/messages-meaning.js +7 -3
- package/dist/services/messages-rerank.d.ts +7 -0
- package/dist/services/messages-rerank.js +42 -0
- package/dist/services/messages-search.d.ts +5 -0
- package/dist/services/messages.d.ts +6 -2
- package/dist/services/messages.js +4 -3
- package/dist/services/model-downloads.d.ts +3 -1
- package/dist/services/model-downloads.js +20 -1
- package/dist/services/notes-search.d.ts +7 -2
- package/dist/services/notes-search.js +7 -4
- package/dist/services/search-all-meetings.d.ts +3 -2
- package/dist/services/search-all-meetings.js +8 -8
- package/dist/services/search-all.d.ts +7 -1
- package/dist/services/search-all.js +109 -45
- package/dist/store/exports.d.ts +1 -1
- package/dist/store/exports.js +1 -1
- package/dist/store/sqlite/accounts.js +2 -2
- package/dist/store/sqlite/chats.d.ts +1 -1
- package/dist/store/sqlite/chats.js +11 -4
- package/dist/store/sqlite/document-pictures.js +2 -7
- package/dist/store/sqlite/email-index.d.ts +1 -3
- package/dist/store/sqlite/email-index.js +5 -21
- package/dist/store/sqlite/emails.js +4 -3
- package/dist/store/sqlite/image-chunks.d.ts +2 -2
- package/dist/store/sqlite/image-chunks.js +10 -13
- package/dist/store/sqlite/meeting-vectors.js +11 -9
- package/dist/store/sqlite/message-chunks.js +3 -8
- package/dist/store/sqlite/note-index.js +2 -7
- package/dist/store/sqlite/schema.d.ts +1 -1
- package/dist/store/sqlite/schema.js +1 -1
- package/dist/store/sqlite/vector-index.d.ts +9 -0
- package/dist/store/sqlite/vector-index.js +25 -0
- package/dist/store/sqlite/vectors.d.ts +2 -2
- package/dist/store/sqlite/vectors.js +11 -8
- package/package.json +1 -1
package/dist/entities/index.d.ts
CHANGED
|
@@ -255,6 +255,7 @@ export declare const ENTITIES: {
|
|
|
255
255
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
256
256
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
257
257
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
258
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
258
259
|
}, undefined>, undefined>;
|
|
259
260
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
260
261
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -442,6 +443,7 @@ export declare const ENTITIES: {
|
|
|
442
443
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
443
444
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
444
445
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
446
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
445
447
|
}, undefined>, undefined>;
|
|
446
448
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
447
449
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -634,6 +636,7 @@ export declare const ENTITIES: {
|
|
|
634
636
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
635
637
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
636
638
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
639
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
637
640
|
}, undefined>, undefined>;
|
|
638
641
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
639
642
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -1099,6 +1102,7 @@ export declare const ENTITIES: {
|
|
|
1099
1102
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1100
1103
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
1101
1104
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
1105
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
1102
1106
|
}, undefined>, undefined>;
|
|
1103
1107
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
1104
1108
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -1286,6 +1290,7 @@ export declare const ENTITIES: {
|
|
|
1286
1290
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1287
1291
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
1288
1292
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
1293
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
1289
1294
|
}, undefined>, undefined>;
|
|
1290
1295
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
1291
1296
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -1461,6 +1466,7 @@ export declare const ENTITIES: {
|
|
|
1461
1466
|
missing_terms: string[];
|
|
1462
1467
|
parent?: string | undefined;
|
|
1463
1468
|
found_by?: ("meaning" | "words")[] | undefined;
|
|
1469
|
+
reranker_score?: number | undefined;
|
|
1464
1470
|
} | undefined;
|
|
1465
1471
|
context?: {
|
|
1466
1472
|
ref: string;
|
|
@@ -1525,6 +1531,7 @@ export declare const ENTITIES: {
|
|
|
1525
1531
|
missing_terms: string[];
|
|
1526
1532
|
parent?: string | undefined;
|
|
1527
1533
|
found_by?: ("meaning" | "words")[] | undefined;
|
|
1534
|
+
reranker_score?: number | undefined;
|
|
1528
1535
|
} | undefined;
|
|
1529
1536
|
context?: {
|
|
1530
1537
|
ref: string;
|
|
@@ -1590,6 +1597,7 @@ export declare const ENTITIES: {
|
|
|
1590
1597
|
missing_terms: string[];
|
|
1591
1598
|
parent?: string | undefined;
|
|
1592
1599
|
found_by?: ("meaning" | "words")[] | undefined;
|
|
1600
|
+
reranker_score?: number | undefined;
|
|
1593
1601
|
} | undefined;
|
|
1594
1602
|
context?: {
|
|
1595
1603
|
ref: string;
|
|
@@ -1656,6 +1664,7 @@ export declare const ENTITIES: {
|
|
|
1656
1664
|
missing_terms: string[];
|
|
1657
1665
|
parent?: string | undefined;
|
|
1658
1666
|
found_by?: ("meaning" | "words")[] | undefined;
|
|
1667
|
+
reranker_score?: number | undefined;
|
|
1659
1668
|
} | undefined;
|
|
1660
1669
|
context?: {
|
|
1661
1670
|
ref: string;
|
|
@@ -1721,6 +1730,7 @@ export declare const ENTITIES: {
|
|
|
1721
1730
|
missing_terms: string[];
|
|
1722
1731
|
parent?: string | undefined;
|
|
1723
1732
|
found_by?: ("meaning" | "words")[] | undefined;
|
|
1733
|
+
reranker_score?: number | undefined;
|
|
1724
1734
|
} | undefined;
|
|
1725
1735
|
context?: {
|
|
1726
1736
|
ref: string;
|
|
@@ -1801,6 +1811,7 @@ export declare const ENTITIES: {
|
|
|
1801
1811
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1802
1812
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
1803
1813
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
1814
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
1804
1815
|
}, undefined>, undefined>;
|
|
1805
1816
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
1806
1817
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -1988,6 +1999,7 @@ export declare const ENTITIES: {
|
|
|
1988
1999
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1989
2000
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
1990
2001
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
2002
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
1991
2003
|
}, undefined>, undefined>;
|
|
1992
2004
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
1993
2005
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -2366,6 +2378,7 @@ export declare const ENTITIES: {
|
|
|
2366
2378
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
2367
2379
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
2368
2380
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
2381
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
2369
2382
|
}, undefined>, undefined>;
|
|
2370
2383
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
2371
2384
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -2553,6 +2566,7 @@ export declare const ENTITIES: {
|
|
|
2553
2566
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
2554
2567
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
2555
2568
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
2569
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
2556
2570
|
}, undefined>, undefined>;
|
|
2557
2571
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
2558
2572
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -2744,6 +2758,7 @@ export declare const ENTITIES: {
|
|
|
2744
2758
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
2745
2759
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
2746
2760
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
2761
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
2747
2762
|
}, undefined>, undefined>;
|
|
2748
2763
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
2749
2764
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -2931,6 +2946,7 @@ export declare const ENTITIES: {
|
|
|
2931
2946
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
2932
2947
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
2933
2948
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
2949
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
2934
2950
|
}, undefined>, undefined>;
|
|
2935
2951
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
2936
2952
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -7331,6 +7347,7 @@ export declare const ENTITIES: {
|
|
|
7331
7347
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
7332
7348
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
7333
7349
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
7350
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
7334
7351
|
}, undefined>, undefined>;
|
|
7335
7352
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
7336
7353
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -7518,6 +7535,7 @@ export declare const ENTITIES: {
|
|
|
7518
7535
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
7519
7536
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
7520
7537
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
7538
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
7521
7539
|
}, undefined>, undefined>;
|
|
7522
7540
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
7523
7541
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -7948,6 +7966,7 @@ export declare const ENTITIES: {
|
|
|
7948
7966
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
7949
7967
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
7950
7968
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
7969
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
7951
7970
|
}, undefined>, undefined>;
|
|
7952
7971
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
7953
7972
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -8426,6 +8445,7 @@ export declare const ENTITIES: {
|
|
|
8426
8445
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
8427
8446
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
8428
8447
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
8448
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
8429
8449
|
}, undefined>, undefined>;
|
|
8430
8450
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
8431
8451
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -9080,6 +9100,7 @@ export declare const ENTITIES: {
|
|
|
9080
9100
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
9081
9101
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
9082
9102
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
9103
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
9083
9104
|
}, undefined>, undefined>;
|
|
9084
9105
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
9085
9106
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -9794,6 +9815,7 @@ export declare const ENTITIES: {
|
|
|
9794
9815
|
readonly exists: v.LiteralSchema<true, undefined>;
|
|
9795
9816
|
readonly file_texts: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
9796
9817
|
readonly involvements: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
9818
|
+
readonly unused_vectors_dropped: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
9797
9819
|
}, undefined>], undefined>;
|
|
9798
9820
|
readonly store_backup: v.StrictObjectSchema<{
|
|
9799
9821
|
readonly path: v.StringSchema<undefined>;
|
|
@@ -9991,7 +10013,7 @@ export declare const ENTITIES: {
|
|
|
9991
10013
|
}, undefined>;
|
|
9992
10014
|
readonly model: v.StrictObjectSchema<{
|
|
9993
10015
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
9994
|
-
readonly kind: v.PicklistSchema<["audio", "text", "image"], undefined>;
|
|
10016
|
+
readonly kind: v.PicklistSchema<["audio", "text", "image", "reranker"], undefined>;
|
|
9995
10017
|
readonly title: v.StringSchema<undefined>;
|
|
9996
10018
|
readonly languages: v.StringSchema<undefined>;
|
|
9997
10019
|
readonly licence: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -10674,6 +10696,7 @@ export declare const ENTITIES: {
|
|
|
10674
10696
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
10675
10697
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
10676
10698
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
10699
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
10677
10700
|
}, undefined>, undefined>;
|
|
10678
10701
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
10679
10702
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -10861,6 +10884,7 @@ export declare const ENTITIES: {
|
|
|
10861
10884
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
10862
10885
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
10863
10886
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
10887
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
10864
10888
|
}, undefined>, undefined>;
|
|
10865
10889
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
10866
10890
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -11086,6 +11110,7 @@ export declare const ENTITIES: {
|
|
|
11086
11110
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
11087
11111
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
11088
11112
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
11113
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
11089
11114
|
}, undefined>, undefined>;
|
|
11090
11115
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
11091
11116
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -11273,6 +11298,7 @@ export declare const ENTITIES: {
|
|
|
11273
11298
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
11274
11299
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
11275
11300
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
11301
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
11276
11302
|
}, undefined>, undefined>;
|
|
11277
11303
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
11278
11304
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -32,6 +32,7 @@ export declare const watchedMessage: v.StrictObjectSchema<{
|
|
|
32
32
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
33
33
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
34
34
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
35
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
35
36
|
}, undefined>, undefined>;
|
|
36
37
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
37
38
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -511,6 +512,7 @@ export declare const messageEvent: v.VariantSchema<"event", [v.StrictObjectSchem
|
|
|
511
512
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
512
513
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
513
514
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
515
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
514
516
|
}, undefined>, undefined>;
|
|
515
517
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
516
518
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -1097,6 +1099,7 @@ export declare const watchItem: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
1097
1099
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1098
1100
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
1099
1101
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
1102
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
1100
1103
|
}, undefined>, undefined>;
|
|
1101
1104
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
1102
1105
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -1575,6 +1578,7 @@ export declare const watchItem: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
1575
1578
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1576
1579
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
1577
1580
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
1581
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
1578
1582
|
}, undefined>, undefined>;
|
|
1579
1583
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
1580
1584
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -37,6 +37,7 @@ export declare const messageThread: v.StrictObjectSchema<{
|
|
|
37
37
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
38
38
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
39
39
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
40
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
40
41
|
}, undefined>, undefined>;
|
|
41
42
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
42
43
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -248,6 +249,7 @@ export declare const messageContext: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
248
249
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
249
250
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
250
251
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
252
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
251
253
|
}, undefined>, undefined>;
|
|
252
254
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
253
255
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -440,6 +442,7 @@ export declare const messageContext: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
440
442
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
441
443
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
442
444
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
445
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
443
446
|
}, undefined>, undefined>;
|
|
444
447
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
445
448
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -33,6 +33,7 @@ export declare const messageWrite: v.StrictObjectSchema<{
|
|
|
33
33
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
34
34
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
35
35
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
36
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
36
37
|
}, undefined>, undefined>;
|
|
37
38
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
38
39
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -221,6 +222,7 @@ export declare const messageWrite: v.StrictObjectSchema<{
|
|
|
221
222
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
222
223
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
223
224
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
225
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
224
226
|
}, undefined>, undefined>;
|
|
225
227
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
226
228
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -417,6 +419,7 @@ export declare const messageSend: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
417
419
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
418
420
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
419
421
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
422
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
420
423
|
}, undefined>, undefined>;
|
|
421
424
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
422
425
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -605,6 +608,7 @@ export declare const messageSend: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
605
608
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
606
609
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
607
610
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
611
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
608
612
|
}, undefined>, undefined>;
|
|
609
613
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
610
614
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -44,6 +44,8 @@ export declare const message: v.StrictObjectSchema<{
|
|
|
44
44
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
45
45
|
/** Present when meaning was searched too: which of the two lists found it. */
|
|
46
46
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
47
|
+
/** Present when the reranker read it: its own score, higher is better. It ordered the first hits with `score`. */
|
|
48
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
47
49
|
}, undefined>, undefined>;
|
|
48
50
|
/** The messages around a search hit, or its thread, oldest first; the hit itself is among them. */
|
|
49
51
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
package/dist/entities/message.js
CHANGED
|
@@ -53,6 +53,8 @@ export const message = v.strictObject({
|
|
|
53
53
|
parent: v.optional(reference),
|
|
54
54
|
/** Present when meaning was searched too: which of the two lists found it. */
|
|
55
55
|
found_by: v.optional(v.array(v.picklist(["words", "meaning"]))),
|
|
56
|
+
/** Present when the reranker read it: its own score, higher is better. It ordered the first hits with `score`. */
|
|
57
|
+
reranker_score: v.optional(v.number()),
|
|
56
58
|
})),
|
|
57
59
|
/** The messages around a search hit, or its thread, oldest first; the hit itself is among them. */
|
|
58
60
|
context: v.optional(v.array(v.strictObject({ ref: reference, timestamp: time, sender_name: v.nullable(text), text }))),
|
package/dist/entities/model.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* A model that runs on this machine: speech for voice messages, text for meaning search, image for pictures,
|
|
4
|
+
* reranker for the order of `search messages --discover`.
|
|
5
|
+
*/
|
|
3
6
|
export declare const model: v.StrictObjectSchema<{
|
|
4
7
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
5
|
-
readonly kind: v.PicklistSchema<["audio", "text", "image"], undefined>;
|
|
8
|
+
readonly kind: v.PicklistSchema<["audio", "text", "image", "reranker"], undefined>;
|
|
6
9
|
readonly title: v.StringSchema<undefined>;
|
|
7
10
|
/** Which languages it reads, in words. */
|
|
8
11
|
readonly languages: v.StringSchema<undefined>;
|
package/dist/entities/model.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { count, id, text } from "./fields.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* A model that runs on this machine: speech for voice messages, text for meaning search, image for pictures,
|
|
5
|
+
* reranker for the order of `search messages --discover`.
|
|
6
|
+
*/
|
|
4
7
|
export const model = v.strictObject({
|
|
5
8
|
id,
|
|
6
|
-
kind: v.picklist(["audio", "text", "image"]),
|
|
9
|
+
kind: v.picklist(["audio", "text", "image", "reranker"]),
|
|
7
10
|
title: text,
|
|
8
11
|
/** Which languages it reads, in words. */
|
|
9
12
|
languages: text,
|
|
@@ -326,6 +326,7 @@ export declare const storeReindex: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
326
326
|
readonly exists: v.LiteralSchema<true, undefined>;
|
|
327
327
|
readonly file_texts: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
328
328
|
readonly involvements: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
329
|
+
readonly unused_vectors_dropped: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
329
330
|
}, undefined>], undefined>;
|
|
330
331
|
export declare const storeBackup: v.StrictObjectSchema<{
|
|
331
332
|
readonly path: v.StringSchema<undefined>;
|
|
@@ -137,7 +137,14 @@ export const storeMigration = v.union([
|
|
|
137
137
|
]);
|
|
138
138
|
export const storeReindex = v.union([
|
|
139
139
|
absent,
|
|
140
|
-
v.strictObject({
|
|
140
|
+
v.strictObject({
|
|
141
|
+
path: text,
|
|
142
|
+
exists: v.literal(true),
|
|
143
|
+
...indexed,
|
|
144
|
+
file_texts: count,
|
|
145
|
+
involvements: count,
|
|
146
|
+
unused_vectors_dropped: count,
|
|
147
|
+
}),
|
|
141
148
|
]);
|
|
142
149
|
export const storeBackup = v.strictObject({
|
|
143
150
|
path: text,
|
|
@@ -56,6 +56,7 @@ export declare const storeExport: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
56
56
|
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
57
57
|
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
58
58
|
readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
59
|
+
readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
59
60
|
}, undefined>, undefined>;
|
|
60
61
|
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
61
62
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
package/dist/mcp/tool.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface Defaults {
|
|
|
34
34
|
limit: number;
|
|
35
35
|
guard: SendGuard;
|
|
36
36
|
/** The profile's own entries, for a tool reading a setting of its own — `transcribeWith`. */
|
|
37
|
-
settings: Pick<Settings, "configured" | "shared" | "profile"> & Partial<Pick<Settings, "permissions" | "searchCatchUp" | "pictureSearch" | "offline">> & AISettings;
|
|
37
|
+
settings: Pick<Settings, "configured" | "shared" | "profile"> & Partial<Pick<Settings, "permissions" | "searchCatchUp" | "pictureSearch" | "searchReranker" | "offline">> & AISettings;
|
|
38
38
|
env: NodeJS.ProcessEnv;
|
|
39
39
|
keyring?: KeyringStore;
|
|
40
40
|
/** The server's open models, kept between `search_conversations` calls. */
|
package/dist/mcp/tool.js
CHANGED
|
@@ -166,6 +166,7 @@ const callRunner = ({ messenger, session, withStore, withServices, defaults, aro
|
|
|
166
166
|
profile: defaults.settings.profile,
|
|
167
167
|
env: defaults.env,
|
|
168
168
|
pictures: defaults.settings.pictureSearch,
|
|
169
|
+
reranker: defaults.settings.searchReranker,
|
|
169
170
|
};
|
|
170
171
|
return async (key, definition, args, ctx) => {
|
|
171
172
|
const path = commandOf(key, definition).split(" ");
|
package/dist/services/deps.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ export interface ServiceDeps {
|
|
|
41
41
|
searchCatchUp?: boolean;
|
|
42
42
|
/** This account has picture search on (`pictureSearch`): its images are embedded and searched by their pixels. */
|
|
43
43
|
pictures?: boolean;
|
|
44
|
+
/** Which reranker orders `--discover`'s first hits (`searchReranker`), or `off`; the default when unset. */
|
|
45
|
+
reranker?: string;
|
|
44
46
|
/** Opens the picture model; tests give a fake. */
|
|
45
47
|
pictureEmbedder?: () => Promise<import("../images/picture/embedder.js").PictureEmbedder>;
|
|
46
48
|
agentText?: true;
|
|
@@ -76,6 +78,7 @@ export declare const onlineDeps: (messenger: ServiceMessenger, adapter: Messenge
|
|
|
76
78
|
profile?: string;
|
|
77
79
|
env?: NodeJS.ProcessEnv;
|
|
78
80
|
pictures?: boolean;
|
|
81
|
+
reranker?: string;
|
|
79
82
|
}) => ServiceDeps;
|
|
80
83
|
/** Over the local store alone, for `--offline` and the tools that never ask the messenger. */
|
|
81
84
|
export declare const storedDeps: (messenger: ServiceMessenger, store: MessageStore, account: AccountKey, guard: SendGuard) => ServiceDeps;
|
|
@@ -9,8 +9,16 @@ export declare const REFRESH_BOUNDS: {
|
|
|
9
9
|
maxChats: number;
|
|
10
10
|
maxChunks: number;
|
|
11
11
|
};
|
|
12
|
+
/** Enough of the deps to find a local model and name the command that downloads it. */
|
|
13
|
+
export type ModelDeps = Pick<ServiceDeps, "env" | "embedders"> & {
|
|
14
|
+
messenger: {
|
|
15
|
+
app: {
|
|
16
|
+
command: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
12
20
|
export declare const notBuiltError: (deps: ServiceDeps, chatId: Id) => CliError;
|
|
13
|
-
export declare const embeddingTarget: (deps:
|
|
21
|
+
export declare const embeddingTarget: (deps: ModelDeps, choice?: ModelChoice) => {
|
|
14
22
|
id: string;
|
|
15
23
|
key: string;
|
|
16
24
|
dims: number;
|
|
@@ -39,7 +47,7 @@ export declare const embeddingTarget: (deps: ServiceDeps, choice?: ModelChoice)
|
|
|
39
47
|
export declare const readinessOf: (deps: ServiceDeps, chatId: Id | undefined, key: string, searchableOnly?: boolean) => Promise<ChatReadiness[]>;
|
|
40
48
|
type EmbeddingTarget = ReturnType<typeof embeddingTarget>;
|
|
41
49
|
/** The server's warm model when there is one, kept open after; otherwise opened here and closed. */
|
|
42
|
-
export declare const withEmbedder: <T>(deps:
|
|
50
|
+
export declare const withEmbedder: <T>(deps: ModelDeps, target: EmbeddingTarget, choice: ModelChoice | undefined, { threads }: {
|
|
43
51
|
threads?: number | undefined;
|
|
44
52
|
}, work: (embedder: Embedder) => Promise<T>) => Promise<T>;
|
|
45
53
|
export declare const embeddingsMaintenance: (deps: ServiceDeps) => Pick<EmbeddingsService, "status" | "embed" | "readiness" | "refresh" | "clear">;
|
package/dist/services/index.d.ts
CHANGED
|
@@ -164,6 +164,8 @@ export { type MeetingReadStore, type MeetingReferenceReadOptions, type ResolvedM
|
|
|
164
164
|
export { applyMeetingEmbedding, type MeetingEmbeddingApplyOptions, type MeetingSemanticOptions, proposeMeetingEmbedding, readMeetingSemantic, } from "./meeting-semantic.js";
|
|
165
165
|
export { type MeetingTaskProposal, proposeMeetingTask } from "./meeting-task-proposal.js";
|
|
166
166
|
export { type CreateMeetingTaskInput, createTaskFromMeeting, type MeetingTaskSourceView, type MeetingTaskStore, type MeetingTaskView, readMeetingTask, } from "./meeting-tasks.js";
|
|
167
|
+
export type { MeaningLane, MeaningSkipped } from "./messages-discovery.js";
|
|
168
|
+
export { meaningLane } from "./messages-meaning.js";
|
|
167
169
|
export type { QueryMetadata, SearchCoverage } from "./messages-search.js";
|
|
168
170
|
export { metadataService } from "./metadata.js";
|
|
169
171
|
export { embedMail, embedNotes, type FoundNote, type LinkedRecord, type NotesEmbedded, type NotesEmbedOptions, type NotesFound, type NotesFoundOf, type NotesQuery, type NotesSearchRequest, nearestNotes, searchNotes, searchNotesOf, searchNotesQuery, } from "./notes-search.js";
|
package/dist/services/index.js
CHANGED
|
@@ -124,6 +124,7 @@ export { resolveMeetingReference, } from "./meeting-reference.js";
|
|
|
124
124
|
export { applyMeetingEmbedding, proposeMeetingEmbedding, readMeetingSemantic, } from "./meeting-semantic.js";
|
|
125
125
|
export { proposeMeetingTask } from "./meeting-task-proposal.js";
|
|
126
126
|
export { createTaskFromMeeting, readMeetingTask, } from "./meeting-tasks.js";
|
|
127
|
+
export { meaningLane } from "./messages-meaning.js";
|
|
127
128
|
export { metadataService } from "./metadata.js";
|
|
128
129
|
export { embedMail, embedNotes, nearestNotes, searchNotes, searchNotesOf, searchNotesQuery, } from "./notes-search.js";
|
|
129
130
|
export { upgradePackage, } from "./package-upgrade.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AccountKey, MessageStore, StoredHit } from "../store/store.js";
|
|
2
2
|
import type { Saved } from "./message-resolution.js";
|
|
3
3
|
import type { SearchFound, SearchQuery } from "./messages.js";
|
|
4
|
-
import { type MeaningLane } from "./messages-discovery.js";
|
|
4
|
+
import { type MeaningLane, type RerankLane } from "./messages-discovery.js";
|
|
5
5
|
import { type MessageStats, type StatsGrouping } from "./messages-search.js";
|
|
6
6
|
/** How long a search may spend building the word index, then the stems, first (phase 2 plan S3: about 200 ms). */
|
|
7
7
|
export declare const SEARCH_FILL_MS = 200;
|
|
@@ -19,6 +19,6 @@ export declare const MAX_SEARCH_OFFSET = 1000;
|
|
|
19
19
|
* Search the store, one page at a time: `offset` skips the hits a page before held, and `nextOffset` says where
|
|
20
20
|
* the next page starts. A page is the hits up to `offset + limit` read again and cut, so deep pages cost more.
|
|
21
21
|
*/
|
|
22
|
-
export declare const searchStore: (store: MessageStore, account: AccountKey, request: SearchQuery, messenger?: Saved, meaning?: MeaningLane) => Promise<SearchFound>;
|
|
22
|
+
export declare const searchStore: (store: MessageStore, account: AccountKey, request: SearchQuery, messenger?: Saved, meaning?: MeaningLane, rerank?: RerankLane) => Promise<SearchFound>;
|
|
23
23
|
export declare const accountOf: (hit: StoredHit) => AccountKey;
|
|
24
24
|
export declare const keyOf: ({ provider, account }: AccountKey) => string;
|
|
@@ -43,18 +43,18 @@ export const MAX_SEARCH_OFFSET = 1000;
|
|
|
43
43
|
* Search the store, one page at a time: `offset` skips the hits a page before held, and `nextOffset` says where
|
|
44
44
|
* the next page starts. A page is the hits up to `offset + limit` read again and cut, so deep pages cost more.
|
|
45
45
|
*/
|
|
46
|
-
export const searchStore = async (store, account, request, messenger = {}, meaning) => {
|
|
46
|
+
export const searchStore = async (store, account, request, messenger = {}, meaning, rerank) => {
|
|
47
47
|
const offset = request.offset ?? 0;
|
|
48
48
|
if (!Number.isInteger(offset) || offset < 0 || offset > MAX_SEARCH_OFFSET)
|
|
49
49
|
throw new CliError("validation_error", `offset takes a whole number from 0 to ${MAX_SEARCH_OFFSET}`);
|
|
50
|
-
const found = await searchPage(store, account, { ...request, limit: request.limit + offset }, messenger, meaning);
|
|
50
|
+
const found = await searchPage(store, account, { ...request, limit: request.limit + offset }, messenger, meaning, rerank);
|
|
51
51
|
return {
|
|
52
52
|
...found,
|
|
53
53
|
items: found.items.slice(offset),
|
|
54
54
|
...(found.hasMore && offset + request.limit <= MAX_SEARCH_OFFSET ? { nextOffset: offset + request.limit } : {}),
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
-
const searchPage = async (store, account, request, messenger, meaning) => {
|
|
57
|
+
const searchPage = async (store, account, request, messenger, meaning, rerank) => {
|
|
58
58
|
if (request.signal?.aborted)
|
|
59
59
|
throw new CliError("validation_error", "search was aborted", { reason: "query.aborted", complete: false });
|
|
60
60
|
if (request.thread)
|
|
@@ -65,7 +65,7 @@ const searchPage = async (store, account, request, messenger, meaning) => {
|
|
|
65
65
|
throw new CliError("validation_error", "discovery searches the local archive; use backend archive");
|
|
66
66
|
await topUp(store);
|
|
67
67
|
const found = request.discover
|
|
68
|
-
? await searchDiscovery(store, account, { ...request, thread: undefined }, messenger, meaning)
|
|
68
|
+
? await searchDiscovery(store, account, { ...request, thread: undefined }, messenger, meaning, rerank)
|
|
69
69
|
: await searchLucene(store, account, request, messenger);
|
|
70
70
|
return withThreads(store, found, request);
|
|
71
71
|
};
|
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
import type { Id } from "../domain/models.js";
|
|
2
|
+
import type { WarmEmbedders } from "../embeddings/embed.js";
|
|
2
3
|
import type { MessengerTraits } from "../ports/traits.js";
|
|
3
4
|
import type { AccountKey, MessageStore } from "../store/store.js";
|
|
4
|
-
import type { SearchFound, SearchQuery } from "./messages.js";
|
|
5
|
+
import type { FoundMessage, SearchFound, SearchQuery } from "./messages.js";
|
|
5
6
|
/** How many of the messages nearest in meaning join the fusion: the benchmark's pool (performance/search/evidence-pipeline). */
|
|
6
7
|
export declare const MEANING_DEPTH = 100;
|
|
8
|
+
/** How many of discovery's first hits the reranker reads, and its share of their order: the benchmark's winner. */
|
|
9
|
+
export declare const RERANK_DEPTH = 50;
|
|
10
|
+
/**
|
|
11
|
+
* Scoring has its own clock, not the word search's 2 s: 50 pairs are bounded work, and BGE on WebAssembly takes
|
|
12
|
+
* ~7–10 s of it (cli-testing performance/search/evidence-pipeline, "In Core").
|
|
13
|
+
*/
|
|
14
|
+
export declare const RERANK_MILLISECONDS = 15000;
|
|
15
|
+
/** The reranker, opened; or why discovery keeps its own order. */
|
|
16
|
+
export type RerankLane = () => Promise<{
|
|
17
|
+
model: string;
|
|
18
|
+
score(question: string, passages: string[]): Promise<number[]>;
|
|
19
|
+
done(): Promise<void>;
|
|
20
|
+
} | {
|
|
21
|
+
skipped: RerankSkipped;
|
|
22
|
+
}>;
|
|
23
|
+
export interface RerankSkipped {
|
|
24
|
+
reason: string;
|
|
25
|
+
/** Absent when the model itself failed or the search ran out of time. */
|
|
26
|
+
step?: "models.download";
|
|
27
|
+
model: string;
|
|
28
|
+
}
|
|
7
29
|
export type MeaningRanked = (AccountKey & {
|
|
8
30
|
chatId: Id;
|
|
9
31
|
id: Id;
|
|
@@ -16,12 +38,19 @@ export interface MeaningSkipped {
|
|
|
16
38
|
step?: "models.download" | "conversations.rebuild";
|
|
17
39
|
model: string;
|
|
18
40
|
}
|
|
19
|
-
/**
|
|
20
|
-
|
|
41
|
+
/**
|
|
42
|
+
* The messages of these accounts nearest in meaning to the question, best first; or why there are none. `embedders`
|
|
43
|
+
* is the search's own, when another part of it loads the same model.
|
|
44
|
+
*/
|
|
45
|
+
export type MeaningLane = (question: string, accounts: AccountKey[], embedders?: Pick<WarmEmbedders, "get">) => Promise<{
|
|
21
46
|
model: string;
|
|
22
47
|
ranked: MeaningRanked;
|
|
23
48
|
partly?: MeaningSkipped;
|
|
24
49
|
} | {
|
|
25
50
|
skipped: MeaningSkipped;
|
|
26
51
|
}>;
|
|
27
|
-
export declare const searchDiscovery: (store: MessageStore, account: AccountKey, asked: SearchQuery, messenger?: Partial<Pick<MessengerTraits, "savedChatId" | "app" | "history" | "provider">>, meaning?: MeaningLane) => Promise<SearchFound>;
|
|
52
|
+
export declare const searchDiscovery: (store: MessageStore, account: AccountKey, asked: SearchQuery, messenger?: Partial<Pick<MessengerTraits, "savedChatId" | "app" | "history" | "provider">>, meaning?: MeaningLane, rerank?: RerankLane) => Promise<SearchFound>;
|
|
53
|
+
/** The nearest messages the question's filters allow, as hits, nearest first. */
|
|
54
|
+
export declare const nearEligible: (store: MessageStore, account: AccountKey, request: SearchQuery, messenger: Partial<Pick<MessengerTraits, "savedChatId" | "app" | "history" | "provider">>, ranked: MeaningRanked, scope: string) => Promise<(FoundMessage & {
|
|
55
|
+
cosine: number;
|
|
56
|
+
})[]>;
|