@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/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,54 @@ 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
|
+
|
|
38
|
+
## 0.500.0 — 31.10.2026
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- **A memory or fact can be forgotten for good.** `store.memories.remove(ref)` and `store.facts.remove(ref)` erase the
|
|
43
|
+
row, every link from or to it, its tags, and its words, pieces and vectors in the search indexes, in one write. The
|
|
44
|
+
words indexes are merged and freed pages zeroed (`secure_delete`), so the text is not left in the file; the
|
|
45
|
+
write-ahead log is emptied when no reader holds it. A record that replaced it no longer names it (`supersedes:
|
|
46
|
+
null`). Removing a fact also erases the soft-deleted memory it was migrated from in version 2, which still held its
|
|
47
|
+
text. Both answer `{ ref, removed: true, links }`, where `links` counts the links erased.
|
|
48
|
+
- **`store.facts.reject(ref)`** turns down a proposed fact: `FACT_STATUSES` gains `rejected`.
|
|
49
|
+
- **`store.memories.sources(ref)` and `store.facts.sources(ref)`** read each evidence link back as an `EvidenceSource`:
|
|
50
|
+
`ref`, `kind`, `title`, `sender`, `at`, `excerpt` (280 characters at most), `tool` and `missing`. A source deleted
|
|
51
|
+
since is still listed, `missing: true` with no excerpt, where `evidence` leaves it out; `ref` is `null` when its row
|
|
52
|
+
is gone from the store.
|
|
53
|
+
- **`Memory` and `Fact` carry `subjectName` and `subjectIsOwner`.** A person is named by their name, else the
|
|
54
|
+
owner's alias for them, else an identity's name; a project or organization by its name. The owner has no name in the
|
|
55
|
+
store, so `subjectName` is `null` and `subjectIsOwner` is `true`. The `memory` and `fact` entities gain optional
|
|
56
|
+
`subject_name`, `subject_is_owner` and `sources`.
|
|
57
|
+
|
|
10
58
|
## 0.499.0 — 31.10.2026
|
|
11
59
|
|
|
12
60
|
### 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("");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const FACT_TYPES: readonly ["fact", "statement", "question", "decision", "promise"];
|
|
2
|
-
export declare const FACT_STATUSES: readonly ["proposed", "accepted", "superseded", "reversed"];
|
|
2
|
+
export declare const FACT_STATUSES: readonly ["proposed", "accepted", "superseded", "reversed", "rejected"];
|
|
3
3
|
export declare const MEMORY_KINDS: readonly ["summary", "digest", "preference"];
|
|
4
4
|
export declare const MEMORY_STATUSES: readonly ["proposed", "confirmed", "stale", "superseded"];
|
|
5
5
|
export declare const MEMORY_SCOPES: readonly ["personal", "work"];
|
package/dist/domain/knowledge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TASK_KINDS } from "../tasks/index.js";
|
|
2
2
|
export const FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
|
|
3
|
-
export const FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed"];
|
|
3
|
+
export const FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed", "rejected"];
|
|
4
4
|
export const MEMORY_KINDS = ["summary", "digest", "preference"];
|
|
5
5
|
export const MEMORY_STATUSES = ["proposed", "confirmed", "stale", "superseded"];
|
|
6
6
|
export const MEMORY_SCOPES = ["personal", "work"];
|
package/dist/entities/fact.d.ts
CHANGED
|
@@ -4,9 +4,12 @@ export declare const fact: v.StrictObjectSchema<{
|
|
|
4
4
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
5
5
|
readonly kind: v.PicklistSchema<readonly ["fact", "statement", "question", "decision", "promise"], undefined>;
|
|
6
6
|
readonly text: v.StringSchema<undefined>;
|
|
7
|
-
readonly status: v.PicklistSchema<readonly ["proposed", "accepted", "superseded", "reversed"], undefined>;
|
|
7
|
+
readonly status: v.PicklistSchema<readonly ["proposed", "accepted", "superseded", "reversed", "rejected"], undefined>;
|
|
8
8
|
readonly project: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
9
9
|
readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
10
|
+
/** What the subject is called; `null` for the owner and for a row with no name. */
|
|
11
|
+
readonly subject_name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
12
|
+
readonly subject_is_owner: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
10
13
|
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>;
|
|
11
14
|
readonly supersedes: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
12
15
|
readonly author: v.StrictObjectSchema<{
|
|
@@ -24,6 +27,17 @@ export declare const fact: v.StrictObjectSchema<{
|
|
|
24
27
|
/** Who recorded it: the owner, or an agent whose fact waits as proposed. */
|
|
25
28
|
readonly origin: v.PicklistSchema<["owner", "agent"], undefined>;
|
|
26
29
|
readonly evidence: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
30
|
+
/** With `--sources`: each piece of evidence read back. */
|
|
31
|
+
readonly sources: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
32
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
33
|
+
readonly kind: v.StringSchema<undefined>;
|
|
34
|
+
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
35
|
+
readonly sender: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
36
|
+
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>;
|
|
37
|
+
readonly excerpt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
38
|
+
readonly tool: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
39
|
+
readonly missing: v.BooleanSchema<undefined>;
|
|
40
|
+
}, undefined>, undefined>, undefined>;
|
|
27
41
|
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`">]>;
|
|
28
42
|
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`">]>;
|
|
29
43
|
}, undefined>;
|
package/dist/entities/fact.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { FACT_STATUSES, FACT_TYPES, MEMORY_SCOPES } 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 fact = v.strictObject({
|
|
5
5
|
ref: reference,
|
|
6
6
|
id,
|
|
@@ -9,6 +9,9 @@ export const fact = v.strictObject({
|
|
|
9
9
|
status: v.picklist(FACT_STATUSES),
|
|
10
10
|
project: v.nullable(text),
|
|
11
11
|
subject: v.nullable(reference),
|
|
12
|
+
/** What the subject is called; `null` for the owner and for a row with no name. */
|
|
13
|
+
subject_name: v.optional(v.nullable(text)),
|
|
14
|
+
subject_is_owner: v.optional(v.boolean()),
|
|
12
15
|
occurred_at: v.nullable(time),
|
|
13
16
|
supersedes: v.nullable(reference),
|
|
14
17
|
author,
|
|
@@ -19,6 +22,8 @@ export const fact = v.strictObject({
|
|
|
19
22
|
/** Who recorded it: the owner, or an agent whose fact waits as proposed. */
|
|
20
23
|
origin: v.picklist(["owner", "agent"]),
|
|
21
24
|
evidence: v.array(reference),
|
|
25
|
+
/** With `--sources`: each piece of evidence read back. */
|
|
26
|
+
sources: v.optional(v.array(evidenceSource)),
|
|
22
27
|
created_at: time,
|
|
23
28
|
updated_at: time,
|
|
24
29
|
});
|
|
@@ -10,6 +10,17 @@ export declare const count: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>
|
|
|
10
10
|
/** Fields of an answer item someone other than the owner wrote, as dotted paths: an agent reads them as data. */
|
|
11
11
|
export declare const untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
12
12
|
export declare const providerMetadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
13
|
+
/** A reference a memory or fact rests on, read back; `missing` once it was deleted since. */
|
|
14
|
+
export declare const evidenceSource: v.StrictObjectSchema<{
|
|
15
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
16
|
+
readonly kind: v.StringSchema<undefined>;
|
|
17
|
+
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
18
|
+
readonly sender: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
19
|
+
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>;
|
|
20
|
+
readonly excerpt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
21
|
+
readonly tool: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
22
|
+
readonly missing: v.BooleanSchema<undefined>;
|
|
23
|
+
}, undefined>;
|
|
13
24
|
export declare const author: v.StrictObjectSchema<{
|
|
14
25
|
readonly type: v.PicklistSchema<["person", "bot"], undefined>;
|
|
15
26
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
package/dist/entities/fields.js
CHANGED
|
@@ -10,6 +10,17 @@ export const count = v.pipe(v.number(), v.integer(), v.minValue(0));
|
|
|
10
10
|
/** Fields of an answer item someone other than the owner wrote, as dotted paths: an agent reads them as data. */
|
|
11
11
|
export const untrusted = v.optional(v.array(text));
|
|
12
12
|
export const providerMetadata = v.optional(v.record(v.string(), v.unknown()));
|
|
13
|
+
/** A reference a memory or fact rests on, read back; `missing` once it was deleted since. */
|
|
14
|
+
export const evidenceSource = v.strictObject({
|
|
15
|
+
ref: v.nullable(reference),
|
|
16
|
+
kind: text,
|
|
17
|
+
title: v.nullable(text),
|
|
18
|
+
sender: v.nullable(text),
|
|
19
|
+
at: v.nullable(time),
|
|
20
|
+
excerpt: v.nullable(text),
|
|
21
|
+
tool: v.nullable(text),
|
|
22
|
+
missing: v.boolean(),
|
|
23
|
+
});
|
|
13
24
|
export const author = v.strictObject({
|
|
14
25
|
type: v.picklist(["person", "bot"]),
|
|
15
26
|
id,
|