@wirecat/cli-core 0.499.0 → 0.501.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 +48 -0
- package/dist/calendar/mcp/index.d.ts +12 -12
- package/dist/cli/envelope.d.ts +11 -1
- package/dist/cli/envelope.js +15 -3
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/meeting-preparation-answer.d.ts +8 -0
- package/dist/cli/meeting-preparation-projects.d.ts +8 -0
- package/dist/cli/meeting-preparation-read.d.ts +8 -0
- package/dist/cli/meeting-series-inventory-read.d.ts +8 -0
- package/dist/cli/messenger/messages-search-command.js +4 -1
- package/dist/cli/messenger/search-answers.d.ts +3 -0
- package/dist/cli/messenger/search-answers.js +6 -0
- package/dist/cli/messenger/search-command.js +4 -1
- package/dist/domain/knowledge.d.ts +1 -1
- package/dist/domain/knowledge.js +1 -1
- package/dist/entities/fact.d.ts +15 -1
- package/dist/entities/fact.js +6 -1
- package/dist/entities/fields.d.ts +11 -0
- package/dist/entities/fields.js +11 -0
- package/dist/entities/index.d.ts +49 -1
- package/dist/entities/meeting-preparation.d.ts +8 -0
- package/dist/entities/meeting-series-inventory.d.ts +8 -0
- package/dist/entities/memory.d.ts +14 -0
- package/dist/entities/memory.js +6 -1
- package/dist/mcp/meeting-preparation.d.ts +8 -0
- package/dist/mcp/meeting-series-inventory.d.ts +8 -0
- package/dist/meetings/mcp/index.d.ts +15 -15
- package/dist/meetings/project-evidence-answer.d.ts +8 -0
- package/dist/search/total.d.ts +13 -0
- package/dist/search/total.js +14 -0
- package/dist/services/index.d.ts +2 -1
- package/dist/services/index.js +2 -1
- package/dist/services/messages-archive-search.js +13 -3
- package/dist/services/messages-discovery.d.ts +6 -0
- package/dist/services/messages-discovery.js +14 -11
- package/dist/services/messages-search.d.ts +5 -0
- package/dist/services/messages-search.js +22 -0
- package/dist/services/messages.d.ts +3 -0
- package/dist/services/notes-search.d.ts +14 -2
- package/dist/services/notes-search.js +101 -19
- package/dist/store/index.d.ts +1 -0
- package/dist/store/project-transfer/request.d.ts +1 -1
- package/dist/store/project-transfer/schema.d.ts +2 -2
- package/dist/store/project-transfer/snapshot-model.d.ts +2 -2
- package/dist/store/queries.d.ts +2 -0
- package/dist/store/queries.js +1 -0
- package/dist/store/sqlite/evidence-sources.d.ts +23 -0
- package/dist/store/sqlite/evidence-sources.js +59 -0
- package/dist/store/sqlite/facts.d.ts +16 -0
- package/dist/store/sqlite/facts.js +39 -5
- package/dist/store/sqlite/lucene.d.ts +5 -0
- package/dist/store/sqlite/lucene.js +17 -0
- package/dist/store/sqlite/memories.d.ts +28 -0
- package/dist/store/sqlite/memories.js +62 -3
- package/dist/store/sqlite/note-search.d.ts +18 -0
- package/dist/store/sqlite/note-search.js +40 -4
- package/dist/store/sqlite/project-transfer/snapshot.d.ts +1 -1
- package/package.json +3 -3
package/dist/entities/index.d.ts
CHANGED
|
@@ -5340,9 +5340,11 @@ export declare const ENTITIES: {
|
|
|
5340
5340
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
5341
5341
|
readonly kind: v.PicklistSchema<readonly ["fact", "statement", "question", "decision", "promise"], undefined>;
|
|
5342
5342
|
readonly text: v.StringSchema<undefined>;
|
|
5343
|
-
readonly status: v.PicklistSchema<readonly ["proposed", "accepted", "superseded", "reversed"], undefined>;
|
|
5343
|
+
readonly status: v.PicklistSchema<readonly ["proposed", "accepted", "superseded", "reversed", "rejected"], undefined>;
|
|
5344
5344
|
readonly project: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5345
5345
|
readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
5346
|
+
readonly subject_name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
5347
|
+
readonly subject_is_owner: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
5346
5348
|
readonly occurred_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
5347
5349
|
readonly supersedes: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
5348
5350
|
readonly author: v.StrictObjectSchema<{
|
|
@@ -5358,6 +5360,16 @@ export declare const ENTITIES: {
|
|
|
5358
5360
|
readonly scope: v.NullableSchema<v.PicklistSchema<readonly ["personal", "work"], undefined>, undefined>;
|
|
5359
5361
|
readonly origin: v.PicklistSchema<["owner", "agent"], undefined>;
|
|
5360
5362
|
readonly evidence: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
5363
|
+
readonly sources: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
5364
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
5365
|
+
readonly kind: v.StringSchema<undefined>;
|
|
5366
|
+
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5367
|
+
readonly sender: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5368
|
+
readonly at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
5369
|
+
readonly excerpt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5370
|
+
readonly tool: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5371
|
+
readonly missing: v.BooleanSchema<undefined>;
|
|
5372
|
+
}, undefined>, undefined>, undefined>;
|
|
5361
5373
|
readonly created_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
5362
5374
|
readonly updated_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
5363
5375
|
}, undefined>;
|
|
@@ -5367,6 +5379,8 @@ export declare const ENTITIES: {
|
|
|
5367
5379
|
readonly kind: v.PicklistSchema<readonly ["summary", "digest", "preference"], undefined>;
|
|
5368
5380
|
readonly text: v.StringSchema<undefined>;
|
|
5369
5381
|
readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
5382
|
+
readonly subject_name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
5383
|
+
readonly subject_is_owner: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
5370
5384
|
readonly author: v.StrictObjectSchema<{
|
|
5371
5385
|
readonly type: v.PicklistSchema<["person", "bot"], undefined>;
|
|
5372
5386
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
@@ -5378,6 +5392,16 @@ export declare const ENTITIES: {
|
|
|
5378
5392
|
readonly scope: v.PicklistSchema<readonly ["personal", "work"], undefined>;
|
|
5379
5393
|
readonly supersedes: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
5380
5394
|
readonly evidence: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
5395
|
+
readonly sources: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
5396
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
5397
|
+
readonly kind: v.StringSchema<undefined>;
|
|
5398
|
+
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5399
|
+
readonly sender: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5400
|
+
readonly at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
5401
|
+
readonly excerpt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5402
|
+
readonly tool: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5403
|
+
readonly missing: v.BooleanSchema<undefined>;
|
|
5404
|
+
}, undefined>, undefined>, undefined>;
|
|
5381
5405
|
readonly last_verified_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
5382
5406
|
readonly created_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
5383
5407
|
readonly updated_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
@@ -5505,11 +5529,19 @@ export declare const ENTITIES: {
|
|
|
5505
5529
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
5506
5530
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
5507
5531
|
readonly next_page: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 2, undefined>]>, undefined>;
|
|
5532
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
5533
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
5534
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
5535
|
+
}, undefined>, undefined>;
|
|
5508
5536
|
}, undefined>, v.StrictObjectSchema<{
|
|
5509
5537
|
readonly mode: v.LiteralSchema<"cursor", undefined>;
|
|
5510
5538
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
5511
5539
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
5512
5540
|
readonly next_cursor: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>, undefined>;
|
|
5541
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
5542
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
5543
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
5544
|
+
}, undefined>, undefined>;
|
|
5513
5545
|
}, undefined>], undefined>;
|
|
5514
5546
|
readonly fingerprint: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
5515
5547
|
readonly limits: v.StrictObjectSchema<{
|
|
@@ -5665,11 +5697,19 @@ export declare const ENTITIES: {
|
|
|
5665
5697
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
5666
5698
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
5667
5699
|
readonly next_page: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 2, undefined>]>, undefined>;
|
|
5700
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
5701
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
5702
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
5703
|
+
}, undefined>, undefined>;
|
|
5668
5704
|
}, undefined>, v.StrictObjectSchema<{
|
|
5669
5705
|
readonly mode: v.LiteralSchema<"cursor", undefined>;
|
|
5670
5706
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
5671
5707
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
5672
5708
|
readonly next_cursor: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>, undefined>;
|
|
5709
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
5710
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
5711
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
5712
|
+
}, undefined>, undefined>;
|
|
5673
5713
|
}, undefined>], undefined>;
|
|
5674
5714
|
readonly coverage: v.StrictObjectSchema<{
|
|
5675
5715
|
readonly archive_completeness: v.LiteralSchema<"unknown", undefined>;
|
|
@@ -6028,11 +6068,19 @@ export declare const ENTITIES: {
|
|
|
6028
6068
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
6029
6069
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
6030
6070
|
readonly next_page: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 2, undefined>]>, undefined>;
|
|
6071
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
6072
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
6073
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
6074
|
+
}, undefined>, undefined>;
|
|
6031
6075
|
}, undefined>, v.StrictObjectSchema<{
|
|
6032
6076
|
readonly mode: v.LiteralSchema<"cursor", undefined>;
|
|
6033
6077
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
6034
6078
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
6035
6079
|
readonly next_cursor: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>, undefined>;
|
|
6080
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
6081
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
6082
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
6083
|
+
}, undefined>, undefined>;
|
|
6036
6084
|
}, undefined>], undefined>;
|
|
6037
6085
|
readonly coverage: v.StrictObjectSchema<{
|
|
6038
6086
|
readonly archive_completeness: v.LiteralSchema<"unknown", undefined>;
|
|
@@ -345,11 +345,19 @@ export declare const meetingPreparation: v.StrictObjectSchema<{
|
|
|
345
345
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
346
346
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
347
347
|
readonly next_page: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 2, undefined>]>, undefined>;
|
|
348
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
349
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
350
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
351
|
+
}, undefined>, undefined>;
|
|
348
352
|
}, undefined>, v.StrictObjectSchema<{
|
|
349
353
|
readonly mode: v.LiteralSchema<"cursor", undefined>;
|
|
350
354
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
351
355
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
352
356
|
readonly next_cursor: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>, undefined>;
|
|
357
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
358
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
359
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
360
|
+
}, undefined>, undefined>;
|
|
353
361
|
}, undefined>], undefined>;
|
|
354
362
|
readonly coverage: v.StrictObjectSchema<{
|
|
355
363
|
readonly archive_completeness: v.LiteralSchema<"unknown", undefined>;
|
|
@@ -19,11 +19,19 @@ export declare const meetingSeriesInventory: v.StrictObjectSchema<{
|
|
|
19
19
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
20
20
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
21
21
|
readonly next_page: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 2, undefined>]>, undefined>;
|
|
22
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
23
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
24
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
25
|
+
}, undefined>, undefined>;
|
|
22
26
|
}, undefined>, v.StrictObjectSchema<{
|
|
23
27
|
readonly mode: v.LiteralSchema<"cursor", undefined>;
|
|
24
28
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
25
29
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
26
30
|
readonly next_cursor: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>, undefined>;
|
|
31
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
32
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
33
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
34
|
+
}, undefined>, undefined>;
|
|
27
35
|
}, undefined>], undefined>;
|
|
28
36
|
readonly fingerprint: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
29
37
|
readonly limits: v.StrictObjectSchema<{
|
|
@@ -5,6 +5,9 @@ export declare const memory: v.StrictObjectSchema<{
|
|
|
5
5
|
readonly kind: v.PicklistSchema<readonly ["summary", "digest", "preference"], undefined>;
|
|
6
6
|
readonly text: v.StringSchema<undefined>;
|
|
7
7
|
readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
8
|
+
/** What the subject is called; `null` for the owner and for a row with no name. */
|
|
9
|
+
readonly subject_name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
10
|
+
readonly subject_is_owner: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
8
11
|
readonly author: v.StrictObjectSchema<{
|
|
9
12
|
readonly type: v.PicklistSchema<["person", "bot"], undefined>;
|
|
10
13
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
@@ -16,6 +19,17 @@ export declare const memory: v.StrictObjectSchema<{
|
|
|
16
19
|
readonly scope: v.PicklistSchema<readonly ["personal", "work"], undefined>;
|
|
17
20
|
readonly supersedes: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
18
21
|
readonly evidence: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
22
|
+
/** With `--sources`: each piece of evidence read back. */
|
|
23
|
+
readonly sources: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
24
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
25
|
+
readonly kind: v.StringSchema<undefined>;
|
|
26
|
+
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
27
|
+
readonly sender: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
28
|
+
readonly at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
29
|
+
readonly excerpt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
30
|
+
readonly tool: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
31
|
+
readonly missing: v.BooleanSchema<undefined>;
|
|
32
|
+
}, undefined>, undefined>, undefined>;
|
|
19
33
|
readonly last_verified_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
20
34
|
readonly created_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
21
35
|
readonly updated_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
package/dist/entities/memory.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { MEMORY_KINDS, MEMORY_SCOPES, MEMORY_STATUSES } from "../domain/knowledge.js";
|
|
3
|
-
import { author, id, reference, text, time } from "./fields.js";
|
|
3
|
+
import { author, evidenceSource, id, reference, text, time } from "./fields.js";
|
|
4
4
|
export const memory = v.strictObject({
|
|
5
5
|
ref: reference,
|
|
6
6
|
id,
|
|
7
7
|
kind: v.picklist(MEMORY_KINDS),
|
|
8
8
|
text,
|
|
9
9
|
subject: v.nullable(reference),
|
|
10
|
+
/** What the subject is called; `null` for the owner and for a row with no name. */
|
|
11
|
+
subject_name: v.optional(v.nullable(text)),
|
|
12
|
+
subject_is_owner: v.optional(v.boolean()),
|
|
10
13
|
author,
|
|
11
14
|
model: v.nullable(text),
|
|
12
15
|
confidence: v.nullable(v.number()),
|
|
@@ -14,6 +17,8 @@ export const memory = v.strictObject({
|
|
|
14
17
|
scope: v.picklist(MEMORY_SCOPES),
|
|
15
18
|
supersedes: v.nullable(reference),
|
|
16
19
|
evidence: v.array(reference),
|
|
20
|
+
/** With `--sources`: each piece of evidence read back. */
|
|
21
|
+
sources: v.optional(v.array(evidenceSource)),
|
|
17
22
|
last_verified_at: v.nullable(time),
|
|
18
23
|
created_at: time,
|
|
19
24
|
updated_at: time,
|
|
@@ -412,11 +412,19 @@ export declare const callMeetingPreparationTool: (read: MeetingPreparationReader
|
|
|
412
412
|
limit: number;
|
|
413
413
|
has_more: boolean;
|
|
414
414
|
next_page?: number | undefined;
|
|
415
|
+
total?: {
|
|
416
|
+
value: number;
|
|
417
|
+
relation: "eq" | "gte";
|
|
418
|
+
} | undefined;
|
|
415
419
|
} | {
|
|
416
420
|
mode: "cursor";
|
|
417
421
|
limit: number;
|
|
418
422
|
has_more: boolean;
|
|
419
423
|
next_cursor?: string | undefined;
|
|
424
|
+
total?: {
|
|
425
|
+
value: number;
|
|
426
|
+
relation: "eq" | "gte";
|
|
427
|
+
} | undefined;
|
|
420
428
|
};
|
|
421
429
|
coverage: {
|
|
422
430
|
archive_completeness: "unknown";
|
|
@@ -81,11 +81,19 @@ export declare const callMeetingSeriesInventoryTool: (read: MeetingSeriesInvento
|
|
|
81
81
|
limit: number;
|
|
82
82
|
has_more: boolean;
|
|
83
83
|
next_page?: number | undefined;
|
|
84
|
+
total?: {
|
|
85
|
+
value: number;
|
|
86
|
+
relation: "eq" | "gte";
|
|
87
|
+
} | undefined;
|
|
84
88
|
} | {
|
|
85
89
|
mode: "cursor";
|
|
86
90
|
limit: number;
|
|
87
91
|
has_more: boolean;
|
|
88
92
|
next_cursor?: string | undefined;
|
|
93
|
+
total?: {
|
|
94
|
+
value: number;
|
|
95
|
+
relation: "eq" | "gte";
|
|
96
|
+
} | undefined;
|
|
89
97
|
};
|
|
90
98
|
fingerprint: string;
|
|
91
99
|
limits: {
|
|
@@ -38,6 +38,7 @@ export declare const meetingTools: ({
|
|
|
38
38
|
max_read_bytes?: undefined;
|
|
39
39
|
cursor?: undefined;
|
|
40
40
|
} | {
|
|
41
|
+
limit?: undefined;
|
|
41
42
|
event_id?: undefined;
|
|
42
43
|
series_id?: undefined;
|
|
43
44
|
page?: undefined;
|
|
@@ -53,11 +54,11 @@ export declare const meetingTools: ({
|
|
|
53
54
|
format?: undefined;
|
|
54
55
|
transcript_id?: undefined;
|
|
55
56
|
query?: undefined;
|
|
56
|
-
limit?: undefined;
|
|
57
57
|
scan_limit?: undefined;
|
|
58
58
|
max_read_bytes?: undefined;
|
|
59
59
|
cursor?: undefined;
|
|
60
60
|
} | {
|
|
61
|
+
limit?: undefined;
|
|
61
62
|
event_id?: undefined;
|
|
62
63
|
series_id?: undefined;
|
|
63
64
|
page?: undefined;
|
|
@@ -75,11 +76,11 @@ export declare const meetingTools: ({
|
|
|
75
76
|
format?: undefined;
|
|
76
77
|
transcript_id?: undefined;
|
|
77
78
|
query?: undefined;
|
|
78
|
-
limit?: undefined;
|
|
79
79
|
scan_limit?: undefined;
|
|
80
80
|
max_read_bytes?: undefined;
|
|
81
81
|
cursor?: undefined;
|
|
82
82
|
} | {
|
|
83
|
+
limit?: undefined;
|
|
83
84
|
event_id?: undefined;
|
|
84
85
|
series_id?: undefined;
|
|
85
86
|
page?: undefined;
|
|
@@ -101,7 +102,6 @@ export declare const meetingTools: ({
|
|
|
101
102
|
minimum: number;
|
|
102
103
|
};
|
|
103
104
|
query?: undefined;
|
|
104
|
-
limit?: undefined;
|
|
105
105
|
scan_limit?: undefined;
|
|
106
106
|
max_read_bytes?: undefined;
|
|
107
107
|
cursor?: undefined;
|
|
@@ -188,6 +188,7 @@ export declare const meetingTools: ({
|
|
|
188
188
|
max_read_bytes?: undefined;
|
|
189
189
|
cursor?: undefined;
|
|
190
190
|
} | {
|
|
191
|
+
limit?: undefined;
|
|
191
192
|
event_id?: undefined;
|
|
192
193
|
series_id?: undefined;
|
|
193
194
|
page?: undefined;
|
|
@@ -203,11 +204,11 @@ export declare const meetingTools: ({
|
|
|
203
204
|
format?: undefined;
|
|
204
205
|
transcript_id?: undefined;
|
|
205
206
|
query?: undefined;
|
|
206
|
-
limit?: undefined;
|
|
207
207
|
scan_limit?: undefined;
|
|
208
208
|
max_read_bytes?: undefined;
|
|
209
209
|
cursor?: undefined;
|
|
210
210
|
} | {
|
|
211
|
+
limit?: undefined;
|
|
211
212
|
event_id?: undefined;
|
|
212
213
|
series_id?: undefined;
|
|
213
214
|
page?: undefined;
|
|
@@ -225,11 +226,11 @@ export declare const meetingTools: ({
|
|
|
225
226
|
format?: undefined;
|
|
226
227
|
transcript_id?: undefined;
|
|
227
228
|
query?: undefined;
|
|
228
|
-
limit?: undefined;
|
|
229
229
|
scan_limit?: undefined;
|
|
230
230
|
max_read_bytes?: undefined;
|
|
231
231
|
cursor?: undefined;
|
|
232
232
|
} | {
|
|
233
|
+
limit?: undefined;
|
|
233
234
|
event_id?: undefined;
|
|
234
235
|
series_id?: undefined;
|
|
235
236
|
page?: undefined;
|
|
@@ -251,7 +252,6 @@ export declare const meetingTools: ({
|
|
|
251
252
|
minimum: number;
|
|
252
253
|
};
|
|
253
254
|
query?: undefined;
|
|
254
|
-
limit?: undefined;
|
|
255
255
|
scan_limit?: undefined;
|
|
256
256
|
max_read_bytes?: undefined;
|
|
257
257
|
cursor?: undefined;
|
|
@@ -338,6 +338,7 @@ export declare const meetingTools: ({
|
|
|
338
338
|
max_read_bytes?: undefined;
|
|
339
339
|
cursor?: undefined;
|
|
340
340
|
} | {
|
|
341
|
+
limit?: undefined;
|
|
341
342
|
event_id?: undefined;
|
|
342
343
|
series_id?: undefined;
|
|
343
344
|
page?: undefined;
|
|
@@ -353,11 +354,11 @@ export declare const meetingTools: ({
|
|
|
353
354
|
format?: undefined;
|
|
354
355
|
transcript_id?: undefined;
|
|
355
356
|
query?: undefined;
|
|
356
|
-
limit?: undefined;
|
|
357
357
|
scan_limit?: undefined;
|
|
358
358
|
max_read_bytes?: undefined;
|
|
359
359
|
cursor?: undefined;
|
|
360
360
|
} | {
|
|
361
|
+
limit?: undefined;
|
|
361
362
|
event_id?: undefined;
|
|
362
363
|
series_id?: undefined;
|
|
363
364
|
page?: undefined;
|
|
@@ -375,11 +376,11 @@ export declare const meetingTools: ({
|
|
|
375
376
|
format?: undefined;
|
|
376
377
|
transcript_id?: undefined;
|
|
377
378
|
query?: undefined;
|
|
378
|
-
limit?: undefined;
|
|
379
379
|
scan_limit?: undefined;
|
|
380
380
|
max_read_bytes?: undefined;
|
|
381
381
|
cursor?: undefined;
|
|
382
382
|
} | {
|
|
383
|
+
limit?: undefined;
|
|
383
384
|
event_id?: undefined;
|
|
384
385
|
series_id?: undefined;
|
|
385
386
|
page?: undefined;
|
|
@@ -401,7 +402,6 @@ export declare const meetingTools: ({
|
|
|
401
402
|
minimum: number;
|
|
402
403
|
};
|
|
403
404
|
query?: undefined;
|
|
404
|
-
limit?: undefined;
|
|
405
405
|
scan_limit?: undefined;
|
|
406
406
|
max_read_bytes?: undefined;
|
|
407
407
|
cursor?: undefined;
|
|
@@ -488,6 +488,7 @@ export declare const meetingTools: ({
|
|
|
488
488
|
max_read_bytes?: undefined;
|
|
489
489
|
cursor?: undefined;
|
|
490
490
|
} | {
|
|
491
|
+
limit?: undefined;
|
|
491
492
|
event_id?: undefined;
|
|
492
493
|
series_id?: undefined;
|
|
493
494
|
page?: undefined;
|
|
@@ -503,11 +504,11 @@ export declare const meetingTools: ({
|
|
|
503
504
|
format?: undefined;
|
|
504
505
|
transcript_id?: undefined;
|
|
505
506
|
query?: undefined;
|
|
506
|
-
limit?: undefined;
|
|
507
507
|
scan_limit?: undefined;
|
|
508
508
|
max_read_bytes?: undefined;
|
|
509
509
|
cursor?: undefined;
|
|
510
510
|
} | {
|
|
511
|
+
limit?: undefined;
|
|
511
512
|
event_id?: undefined;
|
|
512
513
|
series_id?: undefined;
|
|
513
514
|
page?: undefined;
|
|
@@ -525,11 +526,11 @@ export declare const meetingTools: ({
|
|
|
525
526
|
format?: undefined;
|
|
526
527
|
transcript_id?: undefined;
|
|
527
528
|
query?: undefined;
|
|
528
|
-
limit?: undefined;
|
|
529
529
|
scan_limit?: undefined;
|
|
530
530
|
max_read_bytes?: undefined;
|
|
531
531
|
cursor?: undefined;
|
|
532
532
|
} | {
|
|
533
|
+
limit?: undefined;
|
|
533
534
|
event_id?: undefined;
|
|
534
535
|
series_id?: undefined;
|
|
535
536
|
page?: undefined;
|
|
@@ -551,7 +552,6 @@ export declare const meetingTools: ({
|
|
|
551
552
|
minimum: number;
|
|
552
553
|
};
|
|
553
554
|
query?: undefined;
|
|
554
|
-
limit?: undefined;
|
|
555
555
|
scan_limit?: undefined;
|
|
556
556
|
max_read_bytes?: undefined;
|
|
557
557
|
cursor?: undefined;
|
|
@@ -638,6 +638,7 @@ export declare const meetingTools: ({
|
|
|
638
638
|
max_read_bytes?: undefined;
|
|
639
639
|
cursor?: undefined;
|
|
640
640
|
} | {
|
|
641
|
+
limit?: undefined;
|
|
641
642
|
event_id?: undefined;
|
|
642
643
|
series_id?: undefined;
|
|
643
644
|
page?: undefined;
|
|
@@ -653,11 +654,11 @@ export declare const meetingTools: ({
|
|
|
653
654
|
format?: undefined;
|
|
654
655
|
transcript_id?: undefined;
|
|
655
656
|
query?: undefined;
|
|
656
|
-
limit?: undefined;
|
|
657
657
|
scan_limit?: undefined;
|
|
658
658
|
max_read_bytes?: undefined;
|
|
659
659
|
cursor?: undefined;
|
|
660
660
|
} | {
|
|
661
|
+
limit?: undefined;
|
|
661
662
|
event_id?: undefined;
|
|
662
663
|
series_id?: undefined;
|
|
663
664
|
page?: undefined;
|
|
@@ -675,11 +676,11 @@ export declare const meetingTools: ({
|
|
|
675
676
|
format?: undefined;
|
|
676
677
|
transcript_id?: undefined;
|
|
677
678
|
query?: undefined;
|
|
678
|
-
limit?: undefined;
|
|
679
679
|
scan_limit?: undefined;
|
|
680
680
|
max_read_bytes?: undefined;
|
|
681
681
|
cursor?: undefined;
|
|
682
682
|
} | {
|
|
683
|
+
limit?: undefined;
|
|
683
684
|
event_id?: undefined;
|
|
684
685
|
series_id?: undefined;
|
|
685
686
|
page?: undefined;
|
|
@@ -701,7 +702,6 @@ export declare const meetingTools: ({
|
|
|
701
702
|
minimum: number;
|
|
702
703
|
};
|
|
703
704
|
query?: undefined;
|
|
704
|
-
limit?: undefined;
|
|
705
705
|
scan_limit?: undefined;
|
|
706
706
|
max_read_bytes?: undefined;
|
|
707
707
|
cursor?: undefined;
|
|
@@ -60,11 +60,19 @@ export declare const meetingProjectEvidence: v.StrictObjectSchema<{
|
|
|
60
60
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
61
61
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
62
62
|
readonly next_page: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 2, undefined>]>, undefined>;
|
|
63
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
64
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
65
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
66
|
+
}, undefined>, undefined>;
|
|
63
67
|
}, undefined>, v.StrictObjectSchema<{
|
|
64
68
|
readonly mode: v.LiteralSchema<"cursor", undefined>;
|
|
65
69
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
66
70
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
67
71
|
readonly next_cursor: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>, undefined>;
|
|
72
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
73
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
74
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
75
|
+
}, undefined>, undefined>;
|
|
68
76
|
}, undefined>], undefined>;
|
|
69
77
|
readonly coverage: v.StrictObjectSchema<{
|
|
70
78
|
readonly archive_completeness: v.LiteralSchema<"unknown", undefined>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** How many records match a search, every page together, shaped as Elasticsearch's `hits.total`. */
|
|
2
|
+
export interface SearchTotal {
|
|
3
|
+
value: number;
|
|
4
|
+
/** `eq`: the exact count. `gte`: at least `value`; counting stopped at the cap or could not be done cheaply. */
|
|
5
|
+
relation: "eq" | "gte";
|
|
6
|
+
}
|
|
7
|
+
/** Matches counted at most, as Elasticsearch's default `track_total_hits`; past it the total is `gte`. */
|
|
8
|
+
export declare const TOTAL_CAP = 10000;
|
|
9
|
+
/**
|
|
10
|
+
* A total from a count capped at `TOTAL_CAP` (`undefined` when it could not be counted), never below what the pages
|
|
11
|
+
* already showed: `shown` hits, and one more when `hasMore`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const totalOf: (count: number | undefined, shown: number, hasMore: boolean, exact?: boolean) => SearchTotal;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Matches counted at most, as Elasticsearch's default `track_total_hits`; past it the total is `gte`. */
|
|
2
|
+
export const TOTAL_CAP = 10_000;
|
|
3
|
+
/**
|
|
4
|
+
* A total from a count capped at `TOTAL_CAP` (`undefined` when it could not be counted), never below what the pages
|
|
5
|
+
* already showed: `shown` hits, and one more when `hasMore`.
|
|
6
|
+
*/
|
|
7
|
+
export const totalOf = (count, shown, hasMore, exact = true) => {
|
|
8
|
+
const least = shown + (hasMore ? 1 : 0);
|
|
9
|
+
if (count === undefined || count < least)
|
|
10
|
+
return { value: least, relation: "gte" };
|
|
11
|
+
if (count > TOTAL_CAP)
|
|
12
|
+
return { value: TOTAL_CAP, relation: "gte" };
|
|
13
|
+
return { value: count, relation: exact ? "eq" : "gte" };
|
|
14
|
+
};
|
package/dist/services/index.d.ts
CHANGED
|
@@ -142,6 +142,7 @@ export declare const servicesFor: (deps: ServiceDeps) => Services;
|
|
|
142
142
|
export { entriesOfList, type ListContext, type ListedEntry } from "../search/account-list.js";
|
|
143
143
|
export { FIELD_VERSION, QUERY_FIELDS, QUERY_OPERATORS, validateAst } from "../search/lucene/registry.js";
|
|
144
144
|
export { QUERY_LIMITS, QUERY_VERSION } from "../search/lucene/types.js";
|
|
145
|
+
export { type SearchTotal, TOTAL_CAP } from "../search/total.js";
|
|
145
146
|
export { TASK_KINDS, TASK_ORIGINS, type TaskKind, type TaskOrigin } from "../tasks/index.js";
|
|
146
147
|
export type { AdminFound, AdminQuery, AdminSelection, AdminStatisticsService } from "./admin-statistics.js";
|
|
147
148
|
export { adminStatisticsService } from "./admin-statistics.js";
|
|
@@ -170,7 +171,7 @@ export type { MeaningLane, MeaningSkipped } from "./messages-discovery.js";
|
|
|
170
171
|
export { meaningLane } from "./messages-meaning.js";
|
|
171
172
|
export type { QueryMetadata, SearchCoverage } from "./messages-search.js";
|
|
172
173
|
export { metadataService } from "./metadata.js";
|
|
173
|
-
export { embedEvents, embedMail, embedNotes, type FoundNote, type LinkedRecord, type NotesEmbedded, type NotesEmbedOptions, type NotesFound, type NotesFoundOf, type NotesQuery, type NotesSearchRequest, nearestNotes, searchNotes, searchNotesOf, searchNotesQuery, storeQuery, } from "./notes-search.js";
|
|
174
|
+
export { embedEvents, embedMail, embedNotes, type FoundNote, type LinkedRecord, type NotesEmbedded, type NotesEmbedOptions, type NotesFound, type NotesFoundOf, type NotesQuery, type NotesSearchRequest, nearestNotes, RANK_WITHIN, searchNotes, searchNotesOf, searchNotesQuery, storeQuery, } from "./notes-search.js";
|
|
174
175
|
export { type PackageUpgradeOutcome, type PackageUpgradePorts, type PackageUpgradeResult, type ServerRestarts, upgradePackage, } from "./package-upgrade.js";
|
|
175
176
|
export { type PersonMeetingContext, type PersonMeetingContextItem, type PersonMeetingContextOptions, type PersonMeetingReadStore, personMeetingContext, } from "./person-meeting-context.js";
|
|
176
177
|
export { privatePeopleService } from "./private-people.js";
|
package/dist/services/index.js
CHANGED
|
@@ -107,6 +107,7 @@ export const servicesFor = (deps) => {
|
|
|
107
107
|
export { entriesOfList } from "../search/account-list.js";
|
|
108
108
|
export { FIELD_VERSION, QUERY_FIELDS, QUERY_OPERATORS, validateAst } from "../search/lucene/registry.js";
|
|
109
109
|
export { QUERY_LIMITS, QUERY_VERSION } from "../search/lucene/types.js";
|
|
110
|
+
export { TOTAL_CAP } from "../search/total.js";
|
|
110
111
|
export { TASK_KINDS, TASK_ORIGINS } from "../tasks/index.js";
|
|
111
112
|
export { adminStatisticsService } from "./admin-statistics.js";
|
|
112
113
|
export { GAP_BOUNDS, gapsService } from "./archive-gaps.js";
|
|
@@ -128,7 +129,7 @@ export { proposeMeetingTask } from "./meeting-task-proposal.js";
|
|
|
128
129
|
export { createTaskFromMeeting, readMeetingTask, } from "./meeting-tasks.js";
|
|
129
130
|
export { meaningLane } from "./messages-meaning.js";
|
|
130
131
|
export { metadataService } from "./metadata.js";
|
|
131
|
-
export { embedEvents, embedMail, embedNotes, nearestNotes, searchNotes, searchNotesOf, searchNotesQuery, storeQuery, } from "./notes-search.js";
|
|
132
|
+
export { embedEvents, embedMail, embedNotes, nearestNotes, RANK_WITHIN, searchNotes, searchNotesOf, searchNotesQuery, storeQuery, } from "./notes-search.js";
|
|
132
133
|
export { upgradePackage, } from "./package-upgrade.js";
|
|
133
134
|
export { personMeetingContext, } from "./person-meeting-context.js";
|
|
134
135
|
export { privatePeopleService } from "./private-people.js";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { CliError } from "@wirecat/cli-base";
|
|
1
|
+
import { CliError, isCliError } from "@wirecat/cli-base";
|
|
2
2
|
import { parseLocator } from "../domain/locator.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { TOTAL_CAP, totalOf } from "../search/total.js";
|
|
4
|
+
import { discoveryRequest, searchDiscovery } from "./messages-discovery.js";
|
|
5
|
+
import { countLucene, searchLucene, statsLucene } from "./messages-search.js";
|
|
5
6
|
import { readThreadContext, threadBounds } from "./thread-context.js";
|
|
6
7
|
/** How long a search may spend building the word index, then the stems, first (phase 2 plan S3: about 200 ms). */
|
|
7
8
|
export const SEARCH_FILL_MS = 200;
|
|
@@ -48,8 +49,17 @@ export const searchStore = async (store, account, request, messenger = {}, meani
|
|
|
48
49
|
if (!Number.isInteger(offset) || offset < 0 || offset > MAX_SEARCH_OFFSET)
|
|
49
50
|
throw new CliError("validation_error", `offset takes a whole number from 0 to ${MAX_SEARCH_OFFSET}`);
|
|
50
51
|
const found = await searchPage(store, account, { ...request, limit: request.limit + offset }, messenger, meaning, rerank);
|
|
52
|
+
const discovery = found.query?.discovery;
|
|
53
|
+
const total = discovery
|
|
54
|
+
? totalOf(discovery.candidates, found.items.length, found.hasMore, !discovery.truncated)
|
|
55
|
+
: totalOf(await countLucene(store, account, { ...(request.discover ? discoveryRequest(request) : request), limit: request.limit + offset }, messenger, TOTAL_CAP).catch((error) => {
|
|
56
|
+
if (isCliError(error) && error.details.reason === "query.too-large")
|
|
57
|
+
return undefined;
|
|
58
|
+
throw error;
|
|
59
|
+
}), found.items.length, found.hasMore);
|
|
51
60
|
return {
|
|
52
61
|
...found,
|
|
62
|
+
total,
|
|
53
63
|
items: found.items.slice(offset),
|
|
54
64
|
...(found.hasMore && offset + request.limit <= MAX_SEARCH_OFFSET ? { nextOffset: offset + request.limit } : {}),
|
|
55
65
|
};
|
|
@@ -55,6 +55,12 @@ export type MeaningLane = (question: string, accounts: AccountKey[], embedders?:
|
|
|
55
55
|
} | {
|
|
56
56
|
skipped: MeaningSkipped;
|
|
57
57
|
}>;
|
|
58
|
+
/**
|
|
59
|
+
* The query discovery searches. A question's own "?" would parse as a one-character wildcard and send it to strict
|
|
60
|
+
* search (BUG-395); the colon of a time or ratio ("22:00", "1:1") would parse as a field and fail the whole search,
|
|
61
|
+
* and escaped it is syntax again, so it splits the numbers (BUG-450). A quoted timestamp keeps its colons (BUG-458).
|
|
62
|
+
*/
|
|
63
|
+
export declare const discoveryRequest: (asked: SearchQuery) => SearchQuery;
|
|
58
64
|
export declare const searchDiscovery: (store: MessageStore, account: AccountKey, asked: SearchQuery, messenger?: Partial<Pick<MessengerTraits, "savedChatId" | "app" | "history" | "provider">>, meaning?: MeaningLane, rerank?: RerankLane) => Promise<SearchFound>;
|
|
59
65
|
/** The nearest messages the question's filters allow, as hits, nearest first. */
|
|
60
66
|
export declare const nearEligible: (store: MessageStore, account: AccountKey, request: SearchQuery, messenger: Partial<Pick<MessengerTraits, "savedChatId" | "app" | "history" | "provider">>, ranked: MeaningRanked, scope: string) => Promise<(FoundMessage & {
|
|
@@ -28,18 +28,21 @@ const FOLLOW_UPS_PER_HIT = 2;
|
|
|
28
28
|
const RARE_AT = 3;
|
|
29
29
|
/** Later messages read per hit before the search's filters; the latest that pass are kept. */
|
|
30
30
|
const FOLLOW_UP_CANDIDATES = 20;
|
|
31
|
+
/**
|
|
32
|
+
* The query discovery searches. A question's own "?" would parse as a one-character wildcard and send it to strict
|
|
33
|
+
* search (BUG-395); the colon of a time or ratio ("22:00", "1:1") would parse as a field and fail the whole search,
|
|
34
|
+
* and escaped it is syntax again, so it splits the numbers (BUG-450). A quoted timestamp keeps its colons (BUG-458).
|
|
35
|
+
*/
|
|
36
|
+
export const discoveryRequest = (asked) => asked.ast !== undefined || asked.exact || !asked.text
|
|
37
|
+
? asked
|
|
38
|
+
: {
|
|
39
|
+
...asked,
|
|
40
|
+
text: asked.text
|
|
41
|
+
.replace(/(?<=\p{L})\?(?=\s|$)/gu, "")
|
|
42
|
+
.replace(/"(?:[^"\\]|\\.)*"|(?<=\d):(?=\d)/gu, (found) => (found === ":" ? " " : found)),
|
|
43
|
+
};
|
|
31
44
|
export const searchDiscovery = async (store, account, asked, messenger = {}, meaning, rerank) => {
|
|
32
|
-
|
|
33
|
-
// colon of a time or ratio ("22:00", "1:1") would parse as a field and fail the whole search, and escaped it is
|
|
34
|
-
// syntax again, so it splits the numbers (BUG-450). A quoted timestamp keeps its colons (BUG-458).
|
|
35
|
-
const request = asked.ast !== undefined || asked.exact || !asked.text
|
|
36
|
-
? asked
|
|
37
|
-
: {
|
|
38
|
-
...asked,
|
|
39
|
-
text: asked.text
|
|
40
|
-
.replace(/(?<=\p{L})\?(?=\s|$)/gu, "")
|
|
41
|
-
.replace(/"(?:[^"\\]|\\.)*"|(?<=\d):(?=\d)/gu, (found) => (found === ":" ? " " : found)),
|
|
42
|
-
};
|
|
45
|
+
const request = discoveryRequest(asked);
|
|
43
46
|
const original = await prepareLucene(store, account, request, messenger);
|
|
44
47
|
const text = request.text ?? "";
|
|
45
48
|
const plan = planQuestion(text, request.ast !== undefined || !!request.exact || !!request.newest);
|