@wirecat/cli-core 0.500.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 +28 -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/entities/index.d.ts +24 -0
- package/dist/entities/meeting-preparation.d.ts +8 -0
- package/dist/entities/meeting-series-inventory.d.ts +8 -0
- 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/queries.d.ts +2 -0
- package/dist/store/queries.js +1 -0
- package/dist/store/sqlite/lucene.d.ts +5 -0
- package/dist/store/sqlite/lucene.js +17 -0
- package/dist/store/sqlite/note-search.d.ts +18 -0
- package/dist/store/sqlite/note-search.js +40 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,34 @@ shape of this file.
|
|
|
7
7
|
|
|
8
8
|
## Unreleased
|
|
9
9
|
|
|
10
|
+
## 0.501.0 — 31.10.2026
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Search answers say how many match in all: `page.total`.** `search notes` and `search messages` add
|
|
15
|
+
`page.total: { value, relation }` to `--json`, and `NotesFound.total` / `SearchFound.total` carry it to a tool that
|
|
16
|
+
builds its own answer (drive prints it as `item.total`; memo's notes, messages and mail pass it on with their next
|
|
17
|
+
release). It is shaped as Elasticsearch's `hits.total`: `relation` is `eq` for an exact count and `gte` for a lower bound. The terminal adds a line such as
|
|
18
|
+
`showing 1–20 of 144` (`144+` for a lower bound). Notes count every note the words find plus every note found by
|
|
19
|
+
meaning; messages count the strict query's matches, or discovery's candidates with `--discover`. Counting stops at
|
|
20
|
+
10,000 (`TOTAL_CAP`, Elasticsearch's default), and a query whose leaves are checked row by row (a preset, a
|
|
21
|
+
pattern) gets the lower bound the page proves. New: `SearchTotal`, `NotesFound.total`, `SearchFound.total`,
|
|
22
|
+
`NoteSearch.matchingRefs` (refs only, no note read), `NoteSearch.scoreNotes` and `QueriesStore.countMatches`;
|
|
23
|
+
`listOf` takes `total`, and `shownOf(shown, offset, total)` from `@wirecat/cli-core/cli` writes the terminal line.
|
|
24
|
+
|
|
25
|
+
### Changed — may break callers
|
|
26
|
+
|
|
27
|
+
- **cli-core needs `@wirecat/cli-base` 0.67.** The peer range moves from `>=0.65.0 <0.66.0` to `>=0.67.0 <0.68.0`. A
|
|
28
|
+
CLI that pins cli-base moves its pin with this release. cli-base 0.67 adds `page.total` to the list envelope.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- **Search by meaning inside a filter ranks the filter's own notes.** With a filter that holds at most 2,000 notes
|
|
33
|
+
(`RANK_WITHIN`), `search notes` scores every one of them by meaning, instead of taking the 50 nearest notes overall
|
|
34
|
+
and dropping those outside the filter. On the owner's store, Drive's `budget date>=30d` went from 7 hits to a full
|
|
35
|
+
page of 20, and 50 of the 144 documents in the date range match in all; no hit falls outside the filter, as
|
|
36
|
+
before. A larger filter keeps the old way, as does one the store cannot list cheaply.
|
|
37
|
+
|
|
10
38
|
## 0.500.0 — 31.10.2026
|
|
11
39
|
|
|
12
40
|
### Added
|
|
@@ -10,13 +10,13 @@ export declare const calendarTools: ({
|
|
|
10
10
|
inputSchema: {
|
|
11
11
|
type: string;
|
|
12
12
|
properties: {
|
|
13
|
-
limit?: undefined;
|
|
14
13
|
account_id: {
|
|
15
14
|
type: string;
|
|
16
15
|
minimum: number;
|
|
17
16
|
};
|
|
18
17
|
words?: undefined;
|
|
19
18
|
timezone?: undefined;
|
|
19
|
+
limit?: undefined;
|
|
20
20
|
event?: undefined;
|
|
21
21
|
} | {
|
|
22
22
|
account_id: {
|
|
@@ -38,9 +38,9 @@ export declare const calendarTools: ({
|
|
|
38
38
|
};
|
|
39
39
|
event?: undefined;
|
|
40
40
|
} | {
|
|
41
|
-
limit?: undefined;
|
|
42
41
|
words?: undefined;
|
|
43
42
|
timezone?: undefined;
|
|
43
|
+
limit?: undefined;
|
|
44
44
|
event: {
|
|
45
45
|
type: string;
|
|
46
46
|
minLength: number;
|
|
@@ -50,9 +50,9 @@ export declare const calendarTools: ({
|
|
|
50
50
|
minimum: number;
|
|
51
51
|
};
|
|
52
52
|
} | {
|
|
53
|
-
limit?: undefined;
|
|
54
53
|
words?: undefined;
|
|
55
54
|
timezone?: undefined;
|
|
55
|
+
limit?: undefined;
|
|
56
56
|
event?: undefined;
|
|
57
57
|
account_id?: undefined;
|
|
58
58
|
};
|
|
@@ -71,13 +71,13 @@ export declare const calendarTools: ({
|
|
|
71
71
|
inputSchema: {
|
|
72
72
|
type: string;
|
|
73
73
|
properties: {
|
|
74
|
-
limit?: undefined;
|
|
75
74
|
account_id: {
|
|
76
75
|
type: string;
|
|
77
76
|
minimum: number;
|
|
78
77
|
};
|
|
79
78
|
words?: undefined;
|
|
80
79
|
timezone?: undefined;
|
|
80
|
+
limit?: undefined;
|
|
81
81
|
event?: undefined;
|
|
82
82
|
} | {
|
|
83
83
|
account_id: {
|
|
@@ -99,9 +99,9 @@ export declare const calendarTools: ({
|
|
|
99
99
|
};
|
|
100
100
|
event?: undefined;
|
|
101
101
|
} | {
|
|
102
|
-
limit?: undefined;
|
|
103
102
|
words?: undefined;
|
|
104
103
|
timezone?: undefined;
|
|
104
|
+
limit?: undefined;
|
|
105
105
|
event: {
|
|
106
106
|
type: string;
|
|
107
107
|
minLength: number;
|
|
@@ -111,9 +111,9 @@ export declare const calendarTools: ({
|
|
|
111
111
|
minimum: number;
|
|
112
112
|
};
|
|
113
113
|
} | {
|
|
114
|
-
limit?: undefined;
|
|
115
114
|
words?: undefined;
|
|
116
115
|
timezone?: undefined;
|
|
116
|
+
limit?: undefined;
|
|
117
117
|
event?: undefined;
|
|
118
118
|
account_id?: undefined;
|
|
119
119
|
};
|
|
@@ -132,13 +132,13 @@ export declare const calendarTools: ({
|
|
|
132
132
|
inputSchema: {
|
|
133
133
|
type: string;
|
|
134
134
|
properties: {
|
|
135
|
-
limit?: undefined;
|
|
136
135
|
account_id: {
|
|
137
136
|
type: string;
|
|
138
137
|
minimum: number;
|
|
139
138
|
};
|
|
140
139
|
words?: undefined;
|
|
141
140
|
timezone?: undefined;
|
|
141
|
+
limit?: undefined;
|
|
142
142
|
event?: undefined;
|
|
143
143
|
} | {
|
|
144
144
|
account_id: {
|
|
@@ -160,9 +160,9 @@ export declare const calendarTools: ({
|
|
|
160
160
|
};
|
|
161
161
|
event?: undefined;
|
|
162
162
|
} | {
|
|
163
|
-
limit?: undefined;
|
|
164
163
|
words?: undefined;
|
|
165
164
|
timezone?: undefined;
|
|
165
|
+
limit?: undefined;
|
|
166
166
|
event: {
|
|
167
167
|
type: string;
|
|
168
168
|
minLength: number;
|
|
@@ -172,9 +172,9 @@ export declare const calendarTools: ({
|
|
|
172
172
|
minimum: number;
|
|
173
173
|
};
|
|
174
174
|
} | {
|
|
175
|
-
limit?: undefined;
|
|
176
175
|
words?: undefined;
|
|
177
176
|
timezone?: undefined;
|
|
177
|
+
limit?: undefined;
|
|
178
178
|
event?: undefined;
|
|
179
179
|
account_id?: undefined;
|
|
180
180
|
};
|
|
@@ -193,13 +193,13 @@ export declare const calendarTools: ({
|
|
|
193
193
|
inputSchema: {
|
|
194
194
|
type: string;
|
|
195
195
|
properties: {
|
|
196
|
-
limit?: undefined;
|
|
197
196
|
account_id: {
|
|
198
197
|
type: string;
|
|
199
198
|
minimum: number;
|
|
200
199
|
};
|
|
201
200
|
words?: undefined;
|
|
202
201
|
timezone?: undefined;
|
|
202
|
+
limit?: undefined;
|
|
203
203
|
event?: undefined;
|
|
204
204
|
} | {
|
|
205
205
|
account_id: {
|
|
@@ -221,9 +221,9 @@ export declare const calendarTools: ({
|
|
|
221
221
|
};
|
|
222
222
|
event?: undefined;
|
|
223
223
|
} | {
|
|
224
|
-
limit?: undefined;
|
|
225
224
|
words?: undefined;
|
|
226
225
|
timezone?: undefined;
|
|
226
|
+
limit?: undefined;
|
|
227
227
|
event: {
|
|
228
228
|
type: string;
|
|
229
229
|
minLength: number;
|
|
@@ -233,9 +233,9 @@ export declare const calendarTools: ({
|
|
|
233
233
|
minimum: number;
|
|
234
234
|
};
|
|
235
235
|
} | {
|
|
236
|
-
limit?: undefined;
|
|
237
236
|
words?: undefined;
|
|
238
237
|
timezone?: undefined;
|
|
238
|
+
limit?: undefined;
|
|
239
239
|
event?: undefined;
|
|
240
240
|
account_id?: undefined;
|
|
241
241
|
};
|
package/dist/cli/envelope.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Renderer, type RenderFormat, type Streams } from "@wirecat/cli-base";
|
|
2
|
-
import { type ItemEnvelope, type ListEnvelope, type Meta, type Missing, type NextStep, type StepInput } from "@wirecat/cli-base/standards";
|
|
2
|
+
import { type ItemEnvelope, type ListEnvelope, type Meta, type Missing, type NextStep, type StepInput, type Total } from "@wirecat/cli-base/standards";
|
|
3
3
|
import type { Command } from "commander";
|
|
4
4
|
import * as v from "valibot";
|
|
5
5
|
export type ListBody<T> = Omit<ListEnvelope<T>, "meta"> & {
|
|
@@ -19,6 +19,8 @@ export interface ListInput<T> {
|
|
|
19
19
|
paging?: "cursor";
|
|
20
20
|
/** The page shown, from 1, for a list paged by `--page`. */
|
|
21
21
|
page?: number;
|
|
22
|
+
/** How many match, every page together, for a search that counts them. */
|
|
23
|
+
total?: Total;
|
|
22
24
|
/** The command's own arguments and query, so `page.next` reruns the same list. */
|
|
23
25
|
args?: Record<string, unknown>;
|
|
24
26
|
next?: NextStep[];
|
|
@@ -33,11 +35,19 @@ export declare const answerSchema: (item?: v.GenericSchema) => v.UnionSchema<[v.
|
|
|
33
35
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
34
36
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
35
37
|
readonly next_page: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 2, undefined>]>, undefined>;
|
|
38
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
39
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
40
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
41
|
+
}, undefined>, undefined>;
|
|
36
42
|
}, undefined>, v.StrictObjectSchema<{
|
|
37
43
|
readonly mode: v.LiteralSchema<"cursor", undefined>;
|
|
38
44
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
39
45
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
40
46
|
readonly next_cursor: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>, undefined>;
|
|
47
|
+
readonly total: v.OptionalSchema<v.StrictObjectSchema<{
|
|
48
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
49
|
+
readonly relation: v.PicklistSchema<["eq", "gte"], undefined>;
|
|
50
|
+
}, undefined>, undefined>;
|
|
41
51
|
}, undefined>], undefined>;
|
|
42
52
|
readonly next: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.VariantSchema<"kind", [v.StrictObjectSchema<{
|
|
43
53
|
readonly kind: v.LiteralSchema<"command", undefined>;
|
package/dist/cli/envelope.js
CHANGED
|
@@ -14,7 +14,7 @@ const capped = (steps) => (steps.length > 0 ? { next: steps.slice(0, MAX_NEXT_ST
|
|
|
14
14
|
* page where the source has no cursor.
|
|
15
15
|
*/
|
|
16
16
|
export const listOf = (command, input) => {
|
|
17
|
-
const { items, limit, has_more, cursor, paging, page, args = {}, next = [], missing, meta } = input;
|
|
17
|
+
const { items, limit, has_more, cursor, paging, page, total, args = {}, next = [], missing, meta } = input;
|
|
18
18
|
const byCursor = paging === "cursor" || cursor !== undefined;
|
|
19
19
|
const more = has_more
|
|
20
20
|
? [
|
|
@@ -28,8 +28,20 @@ export const listOf = (command, input) => {
|
|
|
28
28
|
const body = {
|
|
29
29
|
items,
|
|
30
30
|
page: byCursor
|
|
31
|
-
? {
|
|
32
|
-
|
|
31
|
+
? {
|
|
32
|
+
mode: "cursor",
|
|
33
|
+
limit,
|
|
34
|
+
has_more,
|
|
35
|
+
...(has_more && cursor !== undefined ? { next_cursor: cursor } : {}),
|
|
36
|
+
...(total ? { total } : {}),
|
|
37
|
+
}
|
|
38
|
+
: {
|
|
39
|
+
mode: "page",
|
|
40
|
+
limit,
|
|
41
|
+
has_more,
|
|
42
|
+
...(has_more ? { next_page: (page ?? 1) + 1 } : {}),
|
|
43
|
+
...(total ? { total } : {}),
|
|
44
|
+
},
|
|
33
45
|
...capped([...more, ...next]),
|
|
34
46
|
...(missing && missing.length > 0 ? { missing } : {}),
|
|
35
47
|
...(meta ? { meta } : {}),
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ export { httpTokenFile, type McpEnvironment, type McpHost, serverEntry } from ".
|
|
|
96
96
|
export { type MessageItem, messageItem, type ReadMessage } from "./messenger/message-items.js";
|
|
97
97
|
export { type ModeProblem, type PrivateFiles, privateFiles, withSqliteSidecars } from "./messenger/private-files.js";
|
|
98
98
|
export { buildReport as buildDoctorReport, type Report as DoctorReport, type ReportContext as DoctorReportContext, reportFileName as doctorReportFileName, } from "./messenger/report.js";
|
|
99
|
-
export { allAnswer, allHitItem, coverageGaps, type HitItem, type MessageHitItem, messageHitItem, type NoteHitItem, noteHitItem, } from "./messenger/search-answers.js";
|
|
99
|
+
export { allAnswer, allHitItem, coverageGaps, type HitItem, type MessageHitItem, messageHitItem, type NoteHitItem, noteHitItem, shownOf, } from "./messenger/search-answers.js";
|
|
100
100
|
export { SEARCHES_QUERY } from "./messenger/searches-command.js";
|
|
101
101
|
export { servingProfiles } from "./messenger/serve-command.js";
|
|
102
102
|
export { DAY_MS, FIRST_FETCH_MS, type MemberFetches, memberFetches } from "./messenger/serve-members.js";
|
package/dist/cli/index.js
CHANGED
|
@@ -87,7 +87,7 @@ export { httpTokenFile, serverEntry } from "./messenger/mcp-command.js";
|
|
|
87
87
|
export { messageItem } from "./messenger/message-items.js";
|
|
88
88
|
export { privateFiles, withSqliteSidecars } from "./messenger/private-files.js";
|
|
89
89
|
export { buildReport as buildDoctorReport, reportFileName as doctorReportFileName, } from "./messenger/report.js";
|
|
90
|
-
export { allAnswer, allHitItem, coverageGaps, messageHitItem, noteHitItem, } from "./messenger/search-answers.js";
|
|
90
|
+
export { allAnswer, allHitItem, coverageGaps, messageHitItem, noteHitItem, shownOf, } from "./messenger/search-answers.js";
|
|
91
91
|
export { SEARCHES_QUERY } from "./messenger/searches-command.js";
|
|
92
92
|
export { servingProfiles } from "./messenger/serve-command.js";
|
|
93
93
|
export { DAY_MS, FIRST_FETCH_MS, memberFetches } from "./messenger/serve-members.js";
|
|
@@ -345,11 +345,19 @@ export declare const meetingPreparationAnswer: (packet: MeetingPreparation) => i
|
|
|
345
345
|
limit: number;
|
|
346
346
|
has_more: boolean;
|
|
347
347
|
next_page?: number | undefined;
|
|
348
|
+
total?: {
|
|
349
|
+
value: number;
|
|
350
|
+
relation: "eq" | "gte";
|
|
351
|
+
} | undefined;
|
|
348
352
|
} | {
|
|
349
353
|
mode: "cursor";
|
|
350
354
|
limit: number;
|
|
351
355
|
has_more: boolean;
|
|
352
356
|
next_cursor?: string | undefined;
|
|
357
|
+
total?: {
|
|
358
|
+
value: number;
|
|
359
|
+
relation: "eq" | "gte";
|
|
360
|
+
} | undefined;
|
|
353
361
|
};
|
|
354
362
|
coverage: {
|
|
355
363
|
archive_completeness: "unknown";
|
|
@@ -65,11 +65,19 @@ export declare const mapPreparationProjectEvidence: (section: NonNullable<Meetin
|
|
|
65
65
|
limit: number;
|
|
66
66
|
has_more: boolean;
|
|
67
67
|
next_page?: number | undefined;
|
|
68
|
+
total?: {
|
|
69
|
+
value: number;
|
|
70
|
+
relation: "eq" | "gte";
|
|
71
|
+
} | undefined;
|
|
68
72
|
} | {
|
|
69
73
|
mode: "cursor";
|
|
70
74
|
limit: number;
|
|
71
75
|
has_more: boolean;
|
|
72
76
|
next_cursor?: string | undefined;
|
|
77
|
+
total?: {
|
|
78
|
+
value: number;
|
|
79
|
+
relation: "eq" | "gte";
|
|
80
|
+
} | undefined;
|
|
73
81
|
};
|
|
74
82
|
coverage: {
|
|
75
83
|
archive_completeness: "unknown";
|
|
@@ -374,11 +374,19 @@ export declare const readMeetingPreparation: (read: MeetingPreparationReader, in
|
|
|
374
374
|
limit: number;
|
|
375
375
|
has_more: boolean;
|
|
376
376
|
next_page?: number | undefined;
|
|
377
|
+
total?: {
|
|
378
|
+
value: number;
|
|
379
|
+
relation: "eq" | "gte";
|
|
380
|
+
} | undefined;
|
|
377
381
|
} | {
|
|
378
382
|
mode: "cursor";
|
|
379
383
|
limit: number;
|
|
380
384
|
has_more: boolean;
|
|
381
385
|
next_cursor?: string | undefined;
|
|
386
|
+
total?: {
|
|
387
|
+
value: number;
|
|
388
|
+
relation: "eq" | "gte";
|
|
389
|
+
} | undefined;
|
|
382
390
|
};
|
|
383
391
|
coverage: {
|
|
384
392
|
archive_completeness: "unknown";
|
|
@@ -34,11 +34,19 @@ export declare const readMeetingSeriesInventory: (read: MeetingSeriesInventoryRe
|
|
|
34
34
|
limit: number;
|
|
35
35
|
has_more: boolean;
|
|
36
36
|
next_page?: number | undefined;
|
|
37
|
+
total?: {
|
|
38
|
+
value: number;
|
|
39
|
+
relation: "eq" | "gte";
|
|
40
|
+
} | undefined;
|
|
37
41
|
} | {
|
|
38
42
|
mode: "cursor";
|
|
39
43
|
limit: number;
|
|
40
44
|
has_more: boolean;
|
|
41
45
|
next_cursor?: string | undefined;
|
|
46
|
+
total?: {
|
|
47
|
+
value: number;
|
|
48
|
+
relation: "eq" | "gte";
|
|
49
|
+
} | undefined;
|
|
42
50
|
};
|
|
43
51
|
fingerprint: string;
|
|
44
52
|
limits: {
|
|
@@ -12,7 +12,7 @@ import { renderAnswer } from "../envelope.js";
|
|
|
12
12
|
import { positiveCount } from "../paging.js";
|
|
13
13
|
import { archiveSummary } from "./archive-summary.js";
|
|
14
14
|
import { messengerContext } from "./context.js";
|
|
15
|
-
import { meaningNote, messagesAnswer, offsetOf } from "./search-answers.js";
|
|
15
|
+
import { meaningNote, messagesAnswer, offsetOf, shownOf } from "./search-answers.js";
|
|
16
16
|
import { backendOptions, backendRequest, noteServer } from "./search-backend-options.js";
|
|
17
17
|
import { syncOptions, syncRequest, syncsFirst } from "./search-sync-options.js";
|
|
18
18
|
import { threadOptions, threadRequest } from "./thread-options.js";
|
|
@@ -184,6 +184,9 @@ const searchAction = (messenger) => async function (given) {
|
|
|
184
184
|
if (elsewhere.length > 0) {
|
|
185
185
|
context.renderer.note(`hits in ${elsewhere.join(", ")} open in that messenger's own CLI, by the locator: messages context msg:…`);
|
|
186
186
|
}
|
|
187
|
+
const shown = shownOf(found.items.length, offsetOf(page, limit) ?? 0, found.total);
|
|
188
|
+
if (shown)
|
|
189
|
+
context.renderer.note(shown);
|
|
187
190
|
if (found.items.length === 0)
|
|
188
191
|
context.renderer.note(found.server && !found.server.skipped
|
|
189
192
|
? "nothing found in the local store or on the messenger's server"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Missing, NextStep } from "@wirecat/cli-base/standards";
|
|
2
2
|
import type { InferOutput } from "valibot";
|
|
3
3
|
import type { ENTITIES } from "../../entities/index.js";
|
|
4
|
+
import type { SearchTotal } from "../../search/total.js";
|
|
4
5
|
import type { ChatCoverage } from "../../services/chat-coverage.js";
|
|
5
6
|
import type { FoundMessage, SearchFound } from "../../services/messages.js";
|
|
6
7
|
import type { MeaningSkipped } from "../../services/messages-discovery.js";
|
|
@@ -33,6 +34,8 @@ export interface Paging {
|
|
|
33
34
|
/** The query and options `page.next` repeats. */
|
|
34
35
|
again?: Record<string, unknown>;
|
|
35
36
|
}
|
|
37
|
+
/** "showing 20 of 144", for the human view under a page of hits; `+` when the total is a lower bound. */
|
|
38
|
+
export declare const shownOf: (shown: number, offset: number, total: SearchTotal | undefined) => string | undefined;
|
|
36
39
|
/** `search messages` and `search mail`, CLI and MCP alike. */
|
|
37
40
|
export declare const messagesAnswer: (command: string, found: SearchFound, { limit, page, again }: Paging, query?: string) => ListBody<MessageHitItem>;
|
|
38
41
|
export declare const noteHitItem: (hit: FoundNote) => NoteHitItem;
|
|
@@ -227,6 +227,10 @@ const pictureItems = (found) => {
|
|
|
227
227
|
untrusted: ["sender_name"],
|
|
228
228
|
}));
|
|
229
229
|
};
|
|
230
|
+
/** "showing 20 of 144", for the human view under a page of hits; `+` when the total is a lower bound. */
|
|
231
|
+
export const shownOf = (shown, offset, total) => total === undefined || shown === 0
|
|
232
|
+
? undefined
|
|
233
|
+
: `showing ${offset + 1}–${offset + shown} of ${total.value}${total.relation === "gte" ? "+" : ""}`;
|
|
230
234
|
/** `search messages` and `search mail`, CLI and MCP alike. */
|
|
231
235
|
export const messagesAnswer = (command, found, { limit, page, again }, query = "") => {
|
|
232
236
|
const accounts = found.coverage?.accounts ?? found.accounts ?? [];
|
|
@@ -235,6 +239,7 @@ export const messagesAnswer = (command, found, { limit, page, again }, query = "
|
|
|
235
239
|
limit,
|
|
236
240
|
has_more: found.hasMore && (page ?? 1) * limit <= MAX_SEARCH_OFFSET,
|
|
237
241
|
page: page ?? 1,
|
|
242
|
+
...(found.total ? { total: found.total } : {}),
|
|
238
243
|
...(again ? { args: again } : {}),
|
|
239
244
|
...gapsOf(found),
|
|
240
245
|
meta: metaOf(accounts, found.skipped, coverageGaps(found).missing.length > 0),
|
|
@@ -297,6 +302,7 @@ export const notesAnswer = (command, found, { limit, page, again }, exact = fals
|
|
|
297
302
|
limit,
|
|
298
303
|
has_more: found.has_more && found.next_offset !== undefined,
|
|
299
304
|
page: page ?? 1,
|
|
305
|
+
total: found.total,
|
|
300
306
|
...(again ? { args: again } : {}),
|
|
301
307
|
...meaningGap(found.meaning_skipped, exact),
|
|
302
308
|
meta: metaOf(found.accounts, found.skipped),
|
|
@@ -11,7 +11,7 @@ import { commandAt } from "../steps.js";
|
|
|
11
11
|
import { messengerContext } from "./context.js";
|
|
12
12
|
import { conversationsSearchCommand } from "./conversations-command.js";
|
|
13
13
|
import { messagesSearchCommand } from "./messages-search-command.js";
|
|
14
|
-
import { allAnswer, meaningNote, notesAnswer, offsetOf, SOURCE_SEARCHED, } from "./search-answers.js";
|
|
14
|
+
import { allAnswer, meaningNote, notesAnswer, offsetOf, SOURCE_SEARCHED, shownOf, } from "./search-answers.js";
|
|
15
15
|
import { backendOptions, backendRequest, noteServer } from "./search-backend-options.js";
|
|
16
16
|
import { topicsSearchCommand } from "./topics-command.js";
|
|
17
17
|
const onlyOf = (value) => {
|
|
@@ -150,6 +150,9 @@ const notesCommand = (messenger) => annotate(new Command("notes"), { effects: LO
|
|
|
150
150
|
renderAnswer(this, context, notesAnswer("search notes", found, { limit, page: options.page ?? 1, again }), () => {
|
|
151
151
|
if (found.hits.length === 0)
|
|
152
152
|
context.renderer.note("no note matches");
|
|
153
|
+
const shown = shownOf(found.hits.length, ((options.page ?? 1) - 1) * limit, found.total);
|
|
154
|
+
if (shown)
|
|
155
|
+
context.renderer.note(shown);
|
|
153
156
|
return found.hits
|
|
154
157
|
.map((hit) => `${singleLine(hit.title ?? hit.path ?? hit.ref)} ${hit.ref} (${hit.found_by.join(", ")})${hit.url ? `\n ${singleLine(hit.url)}` : ""}\n ${singleLine(hit.excerpt)}\n`)
|
|
155
158
|
.join("");
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -5529,11 +5529,19 @@ export declare const ENTITIES: {
|
|
|
5529
5529
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
5530
5530
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
5531
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>;
|
|
5532
5536
|
}, undefined>, v.StrictObjectSchema<{
|
|
5533
5537
|
readonly mode: v.LiteralSchema<"cursor", undefined>;
|
|
5534
5538
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
5535
5539
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
5536
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>;
|
|
5537
5545
|
}, undefined>], undefined>;
|
|
5538
5546
|
readonly fingerprint: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
5539
5547
|
readonly limits: v.StrictObjectSchema<{
|
|
@@ -5689,11 +5697,19 @@ export declare const ENTITIES: {
|
|
|
5689
5697
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
5690
5698
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
5691
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>;
|
|
5692
5704
|
}, undefined>, v.StrictObjectSchema<{
|
|
5693
5705
|
readonly mode: v.LiteralSchema<"cursor", undefined>;
|
|
5694
5706
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
5695
5707
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
5696
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>;
|
|
5697
5713
|
}, undefined>], undefined>;
|
|
5698
5714
|
readonly coverage: v.StrictObjectSchema<{
|
|
5699
5715
|
readonly archive_completeness: v.LiteralSchema<"unknown", undefined>;
|
|
@@ -6052,11 +6068,19 @@ export declare const ENTITIES: {
|
|
|
6052
6068
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
6053
6069
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
6054
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>;
|
|
6055
6075
|
}, undefined>, v.StrictObjectSchema<{
|
|
6056
6076
|
readonly mode: v.LiteralSchema<"cursor", undefined>;
|
|
6057
6077
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
6058
6078
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
6059
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>;
|
|
6060
6084
|
}, undefined>], undefined>;
|
|
6061
6085
|
readonly coverage: v.StrictObjectSchema<{
|
|
6062
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<{
|
|
@@ -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: {
|