@wirecat/cli-core 0.547.0 → 0.549.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 +228 -0
- package/dist/calendar/cli/answers.d.ts +7 -2
- package/dist/calendar/cli/answers.js +12 -4
- package/dist/calendar/cli/index.d.ts +10 -1
- package/dist/calendar/cli/index.js +18 -11
- package/dist/calendar/cli/search-all.d.ts +17 -0
- package/dist/calendar/cli/search-all.js +72 -0
- package/dist/calendar/feeds.d.ts +19 -0
- package/dist/calendar/feeds.js +52 -9
- package/dist/calendar/source.d.ts +10 -2
- package/dist/calendar/sync.d.ts +2 -0
- package/dist/calendar/sync.js +10 -6
- package/dist/calendar/testing/memory.js +39 -0
- package/dist/cli/answer-entity.d.ts +4 -0
- package/dist/cli/answer-entity.js +5 -0
- package/dist/cli/bot/context.d.ts +2 -0
- package/dist/cli/compact.d.ts +41 -0
- package/dist/cli/compact.js +313 -0
- package/dist/cli/context.d.ts +11 -2
- package/dist/cli/context.js +15 -6
- package/dist/cli/envelope.d.ts +5 -1
- package/dist/cli/envelope.js +15 -4
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/messenger/search-command.d.ts +10 -0
- package/dist/cli/messenger/search-command.js +19 -13
- package/dist/cli/messenger/store-maintenance-command.d.ts +1 -1
- package/dist/cli/program.d.ts +3 -0
- package/dist/cli/program.js +7 -1
- package/dist/domain/providers.d.ts +3 -0
- package/dist/domain/providers.js +20 -4
- package/dist/domain/ref-arguments.js +3 -7
- package/dist/domain/ref-summaries.d.ts +56 -0
- package/dist/domain/ref-summaries.js +63 -0
- package/dist/entities/index.d.ts +11 -0
- package/dist/entities/relationship.d.ts +2 -0
- package/dist/entities/relationship.js +2 -0
- package/dist/entities/task-results.d.ts +10 -0
- package/dist/entities/task-results.js +1 -0
- package/dist/errors/reasons.js +1 -0
- package/dist/meetings/event-store.d.ts +10 -0
- package/dist/meetings/testing/event-store-contract.js +36 -0
- package/dist/output-detail.js +9 -5
- package/dist/output.d.ts +5 -1
- package/dist/output.js +29 -4
- package/dist/services/proposals/kinds/relationship-update.d.ts +4 -0
- package/dist/services/proposals/kinds/relationship-update.js +53 -0
- package/dist/services/proposals/registry.js +2 -0
- package/dist/store/decisions.d.ts +3 -1
- package/dist/store/decisions.js +7 -1
- package/dist/store/index.d.ts +2 -1
- package/dist/store/sqlite/accounts.d.ts +8 -0
- package/dist/store/sqlite/accounts.js +2 -2
- package/dist/store/sqlite/calendar-forget.d.ts +17 -0
- package/dist/store/sqlite/calendar-forget.js +68 -0
- package/dist/store/sqlite/calendar.js +8 -0
- package/dist/store/sqlite/evidence-sources.d.ts +2 -2
- package/dist/store/sqlite/evidence-sources.js +41 -77
- package/dist/store/sqlite/knowledge.d.ts +17 -23
- package/dist/store/sqlite/knowledge.js +13 -13
- package/dist/store/sqlite/manifest.js +2 -0
- package/dist/store/sqlite/migrations.generated.js +12 -0
- package/dist/store/sqlite/notes.d.ts +5 -0
- package/dist/store/sqlite/notes.js +6 -2
- package/dist/store/sqlite/open-store.js +2 -0
- package/dist/store/sqlite/proposed-actions.d.ts +1 -1
- package/dist/store/sqlite/proposed-actions.js +10 -2
- package/dist/store/sqlite/ref-summaries.d.ts +17 -0
- package/dist/store/sqlite/ref-summaries.js +378 -0
- package/dist/store/sqlite/relation-proposals.d.ts +40 -0
- package/dist/store/sqlite/relation-proposals.js +88 -1
- package/dist/store/sqlite/schema.d.ts +16 -0
- package/dist/store/sqlite/schema.js +1 -0
- package/dist/store/sqlite/suggested-links.d.ts +10 -0
- package/dist/store/sqlite/suggested-links.js +68 -0
- package/dist/store/store.d.ts +3 -0
- package/dist/store/store.js +5 -0
- package/package.json +3 -3
- package/parity.json +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,212 @@ shape of this file.
|
|
|
7
7
|
|
|
8
8
|
## Unreleased
|
|
9
9
|
|
|
10
|
+
## 0.549.0 — 02.11.2026
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **A calendar CLI can mount `search all`.** Given `app` (its identity) beside `messages`, `addCalendarCommands` adds
|
|
15
|
+
`search all` beside `search events`: calendar events, messages from the other WireCat tools and notes in the shared
|
|
16
|
+
store, and a meeting account's transcripts only when `--source` names one, ranked together as a messenger's
|
|
17
|
+
`search all` ranks them. It takes the same `--only`, `--source`, `--max-meetings`, `--limit`, `--page`, `--exact`
|
|
18
|
+
and `--timezone` (`searchAllOptions`, now shared with the messenger's), refuses mail as the messenger's does, and
|
|
19
|
+
answers each account it read in `meta.accounts`. Without a messenger server it reads the local store only. A process
|
|
20
|
+
locked to one profile reads only its own calendar and refuses `--source`. `CalendarCommandDeps` gains `app`, `note`
|
|
21
|
+
(the "searched:" and "not searched:" lines for a person) and a `view` argument to `write`, the text a person reads.
|
|
22
|
+
- **A server's refused SEARCH fails that folder, not the run, and proves nothing.** A mail source throws
|
|
23
|
+
`mail.search-refused` (`SEARCH_REFUSED`, `searchRefused`) when the server answers SEARCH with NO or BAD. `syncMail`
|
|
24
|
+
reads the other folders, answers `state: "partial"` with `refusedFolders`, and for the refused folder marks no mail
|
|
25
|
+
deleted, changes no membership, moves no resume point and leaves `mail_coverage` as it was. Before, a mail source that
|
|
26
|
+
read the refusal as "nothing found" made the folder look empty.
|
|
27
|
+
- **Server search reads big mail text-first, and the next sync completes it.** A candidate is read up to
|
|
28
|
+
`SERVER_BOUNDS.textBytes` (256 KiB, `fetchRaw(items, { bytes })`); one cut short is stored with its text and no
|
|
29
|
+
attachments, marked `metadata.partial`, and `meta.issues` says `search.server-partial`. `syncMail` then reads up to
|
|
30
|
+
100 partial emails whole and clears the mark (`partial: { completed, left }`; `completePartial: false` skips it).
|
|
31
|
+
`MailStore.partialEmails` lists them. No store migration: the mark is a JSON key older builds ignore.
|
|
32
|
+
- **`readClientFile` (from `@wirecat/cli-core/oauth`) reads a user's own Google Desktop OAuth client file** (the
|
|
33
|
+
`{ "installed": { client_id, client_secret } }` JSON from Google's console). It refuses a file other users can read
|
|
34
|
+
(`sign-in.client-file-open`) and a file of the wrong shape (`sign-in.client-file-invalid`), and never puts the file's
|
|
35
|
+
contents in an error. gcal, drive and mail each kept a copy of this reader.
|
|
36
|
+
- **`openBrowser(url, browser?)` is exported from `@wirecat/cli-core/cli`**, so a CLI that does not start through
|
|
37
|
+
`startCli` opens the sign-in page the same way: `open`, `rundll32` or `xdg-open`, or the named browser.
|
|
38
|
+
- **iCalendar feeds as read-only calendars.** With `deps.feeds` (`icsFeeds`), `calendars add <url> [--title]` follows a
|
|
39
|
+
public holiday calendar, a sports schedule or a published `.ics` address, and `calendars remove <calendar>` stops.
|
|
40
|
+
`sync` reads each feed after the provider (`syncWithFeeds`), so its events show in `events list`,
|
|
41
|
+
`search events`, `overlapping:` and `events remind`. Repeating events are expanded here (`expandSeries`: RRULE in
|
|
42
|
+
the event's own zone, RDATE, EXDATE and overrides). The address is a secret input, kept by the CLI and never
|
|
43
|
+
printed; a fetch follows redirects only to https and stops at 10 MB and 30 s. `readIcs` takes
|
|
44
|
+
`{ overrides: true }` and returns the calendar's `name`. See `docs/dev/CALENDARS.md`, "Feeds".
|
|
45
|
+
- **History limits for pushed history, per profile.** A messenger whose history is pushed (`history: "store"`,
|
|
46
|
+
WhatsApp) saves one-to-one chats back `history_dialog_days` (1095 by default), groups of more than two people back
|
|
47
|
+
`history_group_days` (365) and nothing of a group above `history_group_members_max` people (50); at most 1095 days.
|
|
48
|
+
The chat row stays, so the chat is still listed. Live messages, `messages sync` and what the store already holds are
|
|
49
|
+
never dropped. `messages sync <chat> --full-history` fetches a chat and keeps its pushed history in full from then on
|
|
50
|
+
(`history_included` in the answer). `ChatsStore` gains `historySkips`, `historyShapes`, `recordHistorySkips` and
|
|
51
|
+
`setHistoryIncluded`; `Saving` takes `historyLimits`.
|
|
52
|
+
- **Helpers for reading money and questions in a chat, for the project status work.** `amountsOf(text)` returns
|
|
53
|
+
every amount in a text, in order (`amountOf` is its first). `MONEY_REQUEST`, `MONEY_DONE` and `PROMISE` word lists
|
|
54
|
+
(ru, en, es) with `moneyClassesOf(text)` say which a text uses. `questions(messages, { asker: "owner" })` lists the
|
|
55
|
+
owner's own questions and whether anyone but the owner answered them, by a reply or by speaking next; the default,
|
|
56
|
+
`"others"`, is what it did before. `linkedChatsOf` is exported, now with each link's `role`, and so is
|
|
57
|
+
`AGENDA_DEFAULTS`, the silence `tasks agenda` waits before it lists a chat.
|
|
58
|
+
- **A command's own history handler learns whether each batch reached the store**: `HistoryBatchHandler` takes
|
|
59
|
+
`saved`, a promise of the same `true` or `false` the messenger gets, so a link can count only what was kept.
|
|
60
|
+
- **Every messenger command that takes a chat or a message also takes the reference other WireCat CLIs print**:
|
|
61
|
+
`chat:<provider>/<account>/<chat>` wherever a chat is named (`messages list chat:max/34871122/63488582`, bot
|
|
62
|
+
commands too), and `msg:<provider>/<account>/<chat>/<message>` wherever a chat or a message is, online and offline. A person lookup takes `contact:<provider>/<id>`. A reference of another
|
|
63
|
+
account is refused, naming the account it belongs to and the profiles of this CLI the store saw on it; it never
|
|
64
|
+
switches account. One of another messenger is refused with the command that opens it (`open it with tg <profile>
|
|
65
|
+
messages list chat:telegram/…`), and another kind (`document:413` given as a chat) with what the argument takes.
|
|
66
|
+
- **`event:<id>` and `meeting:<account>/<meeting>[/<transcript>[/<cue>]]` parse with `parseReference`** and
|
|
67
|
+
`canonicalReference`, as every other kind: `event:N` was printed by the calendar and person answers and could not be
|
|
68
|
+
read back. The kinds are one table, `REF_KINDS`; `looksLikeReference(text)` tells a reference from a title such as
|
|
69
|
+
`Note: plan`. Reference errors carry a reason: `ref.malformed`, `ref.unknown-kind` (with the kind meant:
|
|
70
|
+
`"doc:413" … did you mean document:413?`), `ref.wrong-kind`, `ref.wrong-provider`, `ref.wrong-account`.
|
|
71
|
+
- **`messages list` reads a window bounded on both sides, offline too.** The query takes a start and an end,
|
|
72
|
+
`'date>=2026-10-01 date<2026-10-20'` or `'date:[2026-10-01 TO 2026-10-19]'`, and `id>` with `date<`. A start reads
|
|
73
|
+
forward, oldest first, and stops at the end; an end alone reads back from it, newest page first, as before.
|
|
74
|
+
`--offline` and a messenger whose history is read from the store (WhatsApp) now answer both ways from the store
|
|
75
|
+
instead of refusing. A forward cursor carries the end, `after:<id>~<epoch ms>`, so the next page stops at the same
|
|
76
|
+
place. `--since`, `--since-time`, `--until`, `--until-time`, `--after-time` and `--before-time` on `messages list`
|
|
77
|
+
fail with the query form to type instead. The store's `messages()` window takes `after` (a message or a moment)
|
|
78
|
+
and `until`.
|
|
79
|
+
- **One proposal inbox behind one check: `proposalRegistry(store, policy)`, `ProposalKind`, `parseProposalIds`
|
|
80
|
+
(`@wirecat/cli-core/services`) and `mayDecide` (`@wirecat/cli-core/store`).** The registry lists every pending
|
|
81
|
+
proposal newest first across kinds (`relationship`, `key_document`, `fact`, `memory`, `findings` for evidence
|
|
82
|
+
findings, and `action` for every other stored proposal), and decides many ids at once, each on its own: the answer
|
|
83
|
+
lists `decided` and `refused`, and one refusal never undoes the others. A new kind registers itself with its id
|
|
84
|
+
`prefix` or the `stored` proposal kinds it owns; nothing else changes. `parseProposalIds` reads
|
|
85
|
+
`17070-17079,fact:500-502,17080/f2` and refuses a range across prefixes. Unconfirmed agent and rule links show as
|
|
86
|
+
`link:<id>` (relationships) and `key:<id>` (key documents) until the store moves them.
|
|
87
|
+
- **`knowledge.proposeRelation(scope, input, by)`**: an agent's or a rule's relationship is a stored `relationship`
|
|
88
|
+
proposal for the owner, not a link; the same pending pair returns the proposal already held. Removing a link to a
|
|
89
|
+
project, or rejecting any suggested link, leaves a rejected `relationship` proposal, so a later scan can skip it.
|
|
90
|
+
- **`proposedActions.list({ kinds, except, project, proposedBy })`**, `proposedBy` on `facts.list` and
|
|
91
|
+
`memories.list`, `order: "created"` on `facts.list`, and the bot's `kind` (`agent` or `rule`) on the author of a
|
|
92
|
+
proposed action, a fact, a memory and an evidence findings batch; bots may have the kind `rule`, and an `Author` may
|
|
93
|
+
name it.
|
|
94
|
+
- **`knowledge.decideLinkProposal(id, decision)`** decides a stored `relationship` or `key_document` proposal, and
|
|
95
|
+
**`knowledge.decideSuggestedLink(id, decision)`** an older unconfirmed link, each in one transaction: the link and
|
|
96
|
+
the decision land together or not at all. A decision's `reason` is kept: on a rejected proposal as its result, on a
|
|
97
|
+
fact in `metadata.decision`, on an evidence findings receipt.
|
|
98
|
+
- **`store.refs.summaries(refs, { excerpt? })` says what any ref names**, a page at a time: kind, title, what holds
|
|
99
|
+
it, when, provider, account, the CLI that opens it and whether it is `available`, `deleted` or `unavailable`. One
|
|
100
|
+
statement per kind present, offline. A malformed ref comes back `unknown`, never thrown, so one bad row cannot fail
|
|
101
|
+
a page. Titles hold no message text; `{ excerpt: true }` adds at most 280 characters. Read once per page.
|
|
102
|
+
- **`refLabel(summary)` and `openOf(summary, { profilesFor, local? })`** (`./cli`): the one label
|
|
103
|
+
(`Chat «Title» (MAX)`) and the command that opens a ref. `openOf` never picks a profile: with none or several,
|
|
104
|
+
`argv` keeps `<profile>` and `profiles` lists the choices. Kinds no CLI owns open with the caller's `local` words.
|
|
105
|
+
- **`ProviderEntry.opens`**: the read command that opens each kind of ref (`{ document: "documents show" }`). A CLI
|
|
106
|
+
writes it with `registerProvider`; tg, max and wa open `chat`, `message` and `contact` from the built-ins. A kind
|
|
107
|
+
this build does not know is dropped, so an older build still reads a newer entry.
|
|
108
|
+
- **A relationship's purpose (store version 44).** `links.purpose`, read as `purpose` on a relationship, a link and
|
|
109
|
+
the `relationship` entity, says what a chat is for in a project; `null` means `work`. The store keeps no list of
|
|
110
|
+
purposes: the caller checks one against its config. `relate` and `proposeRelation` take `purpose`.
|
|
111
|
+
- **`knowledge.updateRelation(scope, id, { role?, purpose?, by })`** sets a relationship's role and purpose; `null`
|
|
112
|
+
clears one. The owner's change applies; an agent's is a `relationship_update` proposal, listed and decided through
|
|
113
|
+
the proposal registry, and `knowledge.decideRelationUpdate(id, decision)` decides it in one transaction.
|
|
114
|
+
|
|
115
|
+
### Changed — may break callers
|
|
116
|
+
|
|
117
|
+
- **`SERVER_BOUNDS.maxMessageBytes`, `ServerSearched.tooLarge` and `search.server-too-large` are gone**: a big
|
|
118
|
+
candidate is no longer left on the server; see `textBytes`, `ServerSearched.partial` and `search.server-partial`.
|
|
119
|
+
- **An option after `--` is read as the option.** `messages sync -- -100 --json` now syncs `-100` and answers in JSON;
|
|
120
|
+
it failed with "too many arguments". After `--`, a word that is exactly one of the command's options, its own or a
|
|
121
|
+
global one (`--json`, `--limit 5`, `--json=id`), moves in front of `--`; every other word stays a positional. A
|
|
122
|
+
negative id needs no `--` at all. Commands that take free text keep every word after `--` literal: `messages send` and
|
|
123
|
+
`edit` (also the bot's), `polls create`, `topics create`, `chats create`, `chats folders create`, `contacts rename`,
|
|
124
|
+
`contacts aliases set`, `messages press`, `bot commands set`, `schedule command`, `events remind`, `complete`, and the
|
|
125
|
+
notes templates. Mark such a command with `annotate(command, { literal_after_dashes: true })`; MCP calls are never
|
|
126
|
+
lifted. A script that passed the literal word `--json` as a positional of another command now gets the option instead.
|
|
127
|
+
- **A write to a calendar the account may only read refuses before anything is asked or journaled**
|
|
128
|
+
(`calendar.read-only`): create, quick add, import, update, delete, respond and move, for a feed and for a provider's
|
|
129
|
+
`reader` or `free-busy` calendar alike. Before, only the target of a move was checked; the provider refused the rest.
|
|
130
|
+
`calendars busy` and `search --backend server` leave feed calendars out.
|
|
131
|
+
- **A locator of another account or messenger is refused with a new text and a reason.** `messages show`, `context`,
|
|
132
|
+
`link` and `download` said "that locator belongs to another account; select its profile first" or "…belongs to
|
|
133
|
+
another messenger"; they now say `<ref> belongs to account <id>; profile <name> is account <id>` (`ref.wrong-account`)
|
|
134
|
+
or `<ref> is a <messenger> message; open it with …` (`ref.wrong-provider`). A script matching the old text matches
|
|
135
|
+
the reason instead.
|
|
136
|
+
- **A text of the form `<kind>:<no spaces>` given as a chat is read as a reference**, so a chat titled `note:plan` is
|
|
137
|
+
no longer found by that title; give its id or a part of the title.
|
|
138
|
+
- The provider seeds of `telegram`, `max` and `whatsapp` name their CLI (`command: tg`, `max`, `wa`), which a
|
|
139
|
+
provider clash message now shows (`telegram (messages, from tg)`).
|
|
140
|
+
- **Every decide method takes who decides, a `Decider`** (`"owner"` or `{ bot, model?, reason }`):
|
|
141
|
+
`facts.accept(ref, by)`, `facts.reject(ref, by)`, `memories.confirm(ref, by)`, `knowledge.confirmRelation(scope, id,
|
|
142
|
+
by)`, `knowledge.removeRelation(scope, id, by)`, `proposedActions.approve(id, by, result?)`,
|
|
143
|
+
`proposedActions.reject(id, by)`, `approveAsTask(store, id, by)`, and `by` is now required in
|
|
144
|
+
`evidenceFindings.review` and `meetingFindings.review`. `DocumentKnowledge.fact` and `.memory` take `by` for a
|
|
145
|
+
`confirm`, and `memories.markStale(ref, by)` and `.memory(…, "stale", by)` take it too: marking an agent's memory
|
|
146
|
+
stale is how it is turned down. `knowledge.relate` needs `by`: the owner's relationship is a link, an agent's is a
|
|
147
|
+
`relationship` proposal it returns instead. `notes.addLink` refuses any confirmed link without `by: "owner"`, so an
|
|
148
|
+
agent writes `confirmed: false` (the task service now does). `notes.removeLink(id, by)`, `facts.reverse(ref, by)`,
|
|
149
|
+
`facts.remove(ref, by)` and `memories.remove(ref, by)` take who removes; the document port's `addMemory` needs
|
|
150
|
+
`author`, `addFact` and `addLink` need `by`, with no owner default. `proposalRegistry(store)` takes no policy: the
|
|
151
|
+
host sets it once with `openStore({ decisions })`, and `store.decisionPolicy` is what the registry and every store
|
|
152
|
+
check read. A host passes the owner only when the owner runs the command, and
|
|
153
|
+
the agent's bot and reason otherwise.
|
|
154
|
+
An agent's confirmation of a relationship is recorded in the link's provenance, and of a fact or proposal as its
|
|
155
|
+
decider.
|
|
156
|
+
- **Evidence sources read through `store.refs`.** `memories.sources`, `facts.sources` and `evidenceFindings.sources`
|
|
157
|
+
keep their shape; a contact now says `kind: "contact"` (was `identity`), a mail ref the store lacks says `email`
|
|
158
|
+
(was `message`), and kinds that had no title before (person, project, task, chat…) now have one.
|
|
159
|
+
- **Unconfirmed agent and rule links move into proposals (store version 44).** The first writable open after the
|
|
160
|
+
upgrade turns each into a `relationship` or `key_document` proposal with its bot, reason and time, and deletes the
|
|
161
|
+
link; Drive's editor links stay. Only the owner decides a moved one, since its bot came from free text. An older
|
|
162
|
+
build no longer lists or confirms these as relationships, and a project transfer no longer carries them. Decide them
|
|
163
|
+
through the proposal registry by their new ids; `link:<id>` and `key:<id>` remain only for suggestions an older
|
|
164
|
+
build writes later.
|
|
165
|
+
|
|
166
|
+
### Fixed
|
|
167
|
+
|
|
168
|
+
- **A sum written in groups of three read as the wrong amount: `50 000 ₽` was `0` and `4 300 ₽` was `300`**, because
|
|
169
|
+
only the last group was read. Groups after a space, a no-break or thin space, a dot or a comma (`50 000`,
|
|
170
|
+
`1.200 €`, `$1,200`) are one number now, a decimal part after them is kept (`5 000.50 ₽`), and amounts keep two
|
|
171
|
+
decimals instead of a whole number (`15.5 eur` was 16). This is the amount the duplicate check compares between
|
|
172
|
+
two tasks, so a reminder worded with a grouped sum is no longer compared on the wrong figure.
|
|
173
|
+
- **`page.next` of `messages list` and `messages comments` runs as written.** It repeated the query's `id`/`date`
|
|
174
|
+
bound beside `--cursor`, which the command refuses as two starting points; it now keeps only `topic:` and
|
|
175
|
+
`starred:`.
|
|
176
|
+
- **An inclusive start keeps a message sent exactly at it.** `messages list 'date>=2026-10-01'` skipped a message
|
|
177
|
+
sent at the first millisecond of the day, and `date<="…"` one sent at that moment.
|
|
178
|
+
|
|
179
|
+
### Security
|
|
180
|
+
|
|
181
|
+
- **An agent can no longer decide its own proposal.** Before, `facts.accept`/`reject`,
|
|
182
|
+
`memories.confirm`, `knowledge.confirmRelation`, `proposedActions.approve`/`reject`, `approveAsTask` and both
|
|
183
|
+
findings reviews never asked who decided, so over MCP an agent could confirm what it had proposed itself. Every one
|
|
184
|
+
of them, and the registry, now runs `mayDecide`: the owner always may; an agent needs a reason
|
|
185
|
+
(`proposal.reason-required`), is refused its own bot's proposal (`proposal.own`), a rule scorer's proposal and one
|
|
186
|
+
that names no author (`proposal.owner-only`), and every decision when the host turns agent decisions off
|
|
187
|
+
(`proposals.agent-decisions-off`). An agent can no longer add a memory already `confirmed`, mark its own memory
|
|
188
|
+
stale, write a confirmed project link itself, or remove a link. A link records only free-text provenance, which
|
|
189
|
+
anyone can write, so only the owner decides an unconfirmed link or removes a link; the rejected record a removal
|
|
190
|
+
leaves names who removed it. Findings an agent accepted for the owner record that agent, not the owner. Only the
|
|
191
|
+
owner removes or reverses an accepted fact or another bot's memory; an agent withdraws only its own row while it is
|
|
192
|
+
proposed. Turning agent decisions off now holds for every store method, not only the registry, and a bot is the
|
|
193
|
+
same bot whatever its letter case (`Claude-Code` is `claude-code`).
|
|
194
|
+
|
|
195
|
+
## 0.548.0 — 02.11.2026
|
|
196
|
+
|
|
197
|
+
### Added
|
|
198
|
+
|
|
199
|
+
- **A feed is asked whether it changed.** `sync` sends a feed the last answer's `ETag` / `Last-Modified` back as
|
|
200
|
+
`If-None-Match` / `If-Modified-Since`, and a `304` keeps every stored event without reading the feed again
|
|
201
|
+
(`feeds[].unchanged` in the answer). The validators are the feed calendar's sync token in the store, valid for one
|
|
202
|
+
window: the first sync of a new day, and `sync --rescan`, read the feed in full. `fetchFeedIfChanged` is exported;
|
|
203
|
+
a `fullListOnly` source now gets its last token in `changes()`, and a page may say `unchanged: true`.
|
|
204
|
+
- **`calendars add` warns once on stderr for an `http://` feed**: the feed and any token in its address travel
|
|
205
|
+
unencrypted. It is still allowed; `webcal://` and `https://` do not warn.
|
|
206
|
+
|
|
207
|
+
### Changed — may break callers
|
|
208
|
+
|
|
209
|
+
- **`calendars remove` deletes a feed's events instead of cancelling them**, with the calendar row, its cursor, the
|
|
210
|
+
events and series only it held, their links, tags, search words and vectors, and people only it had seen. An event
|
|
211
|
+
another calendar also holds stays with that copy. The answer's `events` counts the events deleted. A new
|
|
212
|
+
`EventStore.forgetCalendar(calendarId, now)` does it: an `EventStore` written outside cli-core must add it
|
|
213
|
+
(`memoryEventStore` and the SQLite store have it, and `eventStoreContract` checks it). `calendars unsync` is
|
|
214
|
+
unchanged.
|
|
215
|
+
|
|
10
216
|
## 0.547.0 — 02.11.2026
|
|
11
217
|
|
|
12
218
|
### Added
|
|
@@ -87,6 +293,22 @@ shape of this file.
|
|
|
87
293
|
**`knowledge.decideSuggestedLink(id, decision)`** an older unconfirmed link, each in one transaction: the link and
|
|
88
294
|
the decision land together or not at all. A decision's `reason` is kept: on a rejected proposal as its result, on a
|
|
89
295
|
fact in `metadata.decision`, on an evidence findings receipt.
|
|
296
|
+
- **`--compact`: one line per item for an agent, from the same answer `--json` prints.** `messages list <chat>
|
|
297
|
+
--compact` prints `#<id> · 10-01 09:12 · Анна · <text>` under one header line that names the shared ref prefix
|
|
298
|
+
(`ref: msg:max/500/-1001/<id>`), what every row has in common (the chat's title), the date span and the zone. Rows
|
|
299
|
+
from several chats keep their whole refs. Text stays on one line with control and direction characters made
|
|
300
|
+
visible, and is cut at 400 characters with `…(+N)`; `--full` keeps it whole. The paging, `missing`, the next steps
|
|
301
|
+
and an incomplete answer follow as `# more:`, `# missing:`, `# next:` and `# complete: false` lines on stdout, and
|
|
302
|
+
each command line in them carries `--compact` again. On 1 000 messages of one chat it is about 48 % of the JSON
|
|
303
|
+
bytes; the texts alone are 40 %. `--compact` with `--json`, `--json=…`, `--jsonl` or `--brief` fails with
|
|
304
|
+
`validation_error` (`output.conflict`); it never prompts, and exits with the code JSON would. MCP keeps JSON.
|
|
305
|
+
- **Every command that answers through `renderAnswer` gets it.** A command draws with its own row
|
|
306
|
+
(`answerEntity(cmd, name, schema, { row })`), its app's (`rows: { name: shape }` in the program definition,
|
|
307
|
+
which also draws an app entity listed inside one thing), the shared one in `SHARED_ROWS` (`message`,
|
|
308
|
+
`message.summary`, `message.hit`, `chat`), or the generic row: key, ref or id · title, name or path · state,
|
|
309
|
+
status or due date · text. A record or a list is never printed as a column's value. `RowShape` is data, and `compactText(body, shape,
|
|
310
|
+
options)` is pure, for an app that prints its own answers.
|
|
311
|
+
- What a command prints without `renderAnswer` stays JSON under `--compact`.
|
|
90
312
|
|
|
91
313
|
### Changed — may break callers
|
|
92
314
|
|
|
@@ -129,6 +351,8 @@ shape of this file.
|
|
|
129
351
|
the agent's bot and reason otherwise.
|
|
130
352
|
An agent's confirmation of a relationship is recorded in the link's provenance, and of a fact or proposal as its
|
|
131
353
|
decider.
|
|
354
|
+
- **cli-core now needs `@wirecat/cli-base` 0.74.0**, which holds the `--compact` switch's name. A CLI that pins
|
|
355
|
+
cli-base bumps it to 0.74.0 together with cli-core.
|
|
132
356
|
|
|
133
357
|
### Fixed
|
|
134
358
|
|
|
@@ -142,6 +366,10 @@ shape of this file.
|
|
|
142
366
|
`starred:`.
|
|
143
367
|
- **An inclusive start keeps a message sent exactly at it.** `messages list 'date>=2026-10-01'` skipped a message
|
|
144
368
|
sent at the first millisecond of the day, and `date<="…"` one sent at that moment.
|
|
369
|
+
- **`--brief` now cuts a messenger search hit.** It only knew mail's camelCase hits, so `search messages --brief` in
|
|
370
|
+
tg, max and wa printed every field; it now keeps `ref`, `chat_title`, `timestamp`, `sender_name`, `excerpt` and
|
|
371
|
+
`score`. The default and `--full` answers are unchanged. Commands that print through `outputFor` now honour
|
|
372
|
+
`--brief` and `--full` too, and refuse them together as the others do.
|
|
145
373
|
|
|
146
374
|
### Security
|
|
147
375
|
|
|
@@ -24,7 +24,7 @@ export declare const calendarFeed: v.StrictObjectSchema<{
|
|
|
24
24
|
readonly events: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
25
25
|
readonly hint: v.StringSchema<undefined>;
|
|
26
26
|
}, undefined>;
|
|
27
|
-
/** `calendars remove`: the feed's calendar,
|
|
27
|
+
/** `calendars remove`: the feed's calendar, gone, how many stored entries were deleted, and how many events with them. */
|
|
28
28
|
export declare const calendarFeedRemoval: v.StrictObjectSchema<{
|
|
29
29
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
30
30
|
readonly external_id: v.StringSchema<undefined>;
|
|
@@ -35,6 +35,7 @@ export declare const calendarFeedRemoval: v.StrictObjectSchema<{
|
|
|
35
35
|
readonly synced: v.BooleanSchema<undefined>;
|
|
36
36
|
readonly seen_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
37
|
readonly removed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
38
|
+
readonly events: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
38
39
|
}, undefined>;
|
|
39
40
|
export declare const calendarBusy: v.StrictObjectSchema<{
|
|
40
41
|
readonly start: 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`">]>;
|
|
@@ -100,11 +101,15 @@ export declare const calendarSync: v.StrictObjectSchema<{
|
|
|
100
101
|
readonly embedded: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
101
102
|
readonly left: v.BooleanSchema<undefined>;
|
|
102
103
|
}, undefined>, undefined>;
|
|
103
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Each feed's events as read, and how many it could not take (`syncWithFeeds`); `unchanged` when the feed answered
|
|
106
|
+
* 304 and the counts are those of the read before.
|
|
107
|
+
*/
|
|
104
108
|
readonly feeds: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
105
109
|
readonly calendar_id: v.NumberSchema<undefined>;
|
|
106
110
|
readonly events: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
107
111
|
readonly skipped: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
112
|
+
readonly unchanged: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
|
|
108
113
|
}, undefined>, undefined>, undefined>;
|
|
109
114
|
}, undefined>;
|
|
110
115
|
export declare const calendarSyncProgress: v.StrictObjectSchema<{
|
|
@@ -21,8 +21,8 @@ export const calendar = v.strictObject({
|
|
|
21
21
|
});
|
|
22
22
|
/** `calendars add`: the feed's calendar, how many events the feed holds now, and the sync to run next. */
|
|
23
23
|
export const calendarFeed = v.strictObject({ ...calendar.entries, events: count, hint: text });
|
|
24
|
-
/** `calendars remove`: the feed's calendar,
|
|
25
|
-
export const calendarFeedRemoval = v.strictObject({ ...calendar.entries, removed: count });
|
|
24
|
+
/** `calendars remove`: the feed's calendar, gone, how many stored entries were deleted, and how many events with them. */
|
|
25
|
+
export const calendarFeedRemoval = v.strictObject({ ...calendar.entries, removed: count, events: count });
|
|
26
26
|
const busyRow = v.strictObject({
|
|
27
27
|
/** One of the account's calendars, by its id; or `person`, by the address asked. */
|
|
28
28
|
calendar: v.optional(id),
|
|
@@ -72,8 +72,16 @@ export const calendarSync = v.strictObject({
|
|
|
72
72
|
hint: v.optional(text),
|
|
73
73
|
/** What `sync --embed` embedded: `embedEvents`' answer. */
|
|
74
74
|
embeddings: v.optional(v.strictObject({ model: text, embedded: count, left: v.boolean() })),
|
|
75
|
-
/**
|
|
76
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Each feed's events as read, and how many it could not take (`syncWithFeeds`); `unchanged` when the feed answered
|
|
77
|
+
* 304 and the counts are those of the read before.
|
|
78
|
+
*/
|
|
79
|
+
feeds: v.optional(v.array(v.strictObject({
|
|
80
|
+
calendar_id: v.number(),
|
|
81
|
+
events: count,
|
|
82
|
+
skipped: count,
|
|
83
|
+
unchanged: v.optional(v.literal(true)),
|
|
84
|
+
}))),
|
|
77
85
|
});
|
|
78
86
|
export const calendarSyncProgress = v.strictObject({
|
|
79
87
|
calendar_id: id,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Command } from "commander";
|
|
2
2
|
import type { EventStore } from "../../meetings/index.js";
|
|
3
|
+
import type { AppIdentity } from "../../ports/app.js";
|
|
3
4
|
import type { AccountKey, MessageStore } from "../../store/store.js";
|
|
4
5
|
import { type CalendarFeeds } from "../feeds.js";
|
|
5
6
|
import type { CalendarExpander, CalendarSource } from "../source.js";
|
|
@@ -39,7 +40,15 @@ export interface CalendarCommandDeps {
|
|
|
39
40
|
embedded: number;
|
|
40
41
|
left: boolean;
|
|
41
42
|
}>;
|
|
42
|
-
|
|
43
|
+
/** `view` is the text a person reads in place of the default rendering, where a command has one. */
|
|
44
|
+
write: (value: unknown, format: "json" | "jsonl" | "text", view?: () => string) => void;
|
|
45
|
+
/** A line for the person beside the answer, never in it: which accounts `search all` read and which it skipped. */
|
|
46
|
+
note?: (text: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* The CLI itself. With it and `messages`, `search` also has `all`: messages, notes, events and named meetings in the
|
|
49
|
+
* shared store, as a messenger's `search all`.
|
|
50
|
+
*/
|
|
51
|
+
app?: AppIdentity;
|
|
43
52
|
now?: () => number;
|
|
44
53
|
/** The zone `today`, `week` and a bare date are read in; the computer's when absent. */
|
|
45
54
|
timezone?: string;
|
|
@@ -3,7 +3,7 @@ import { annotate, sharedCommand } from "@wirecat/cli-base/commands";
|
|
|
3
3
|
import { timezoneOf } from "@wirecat/cli-base/query";
|
|
4
4
|
import { clockMeta } from "@wirecat/cli-base/standards";
|
|
5
5
|
import { Argument, InvalidArgumentError, Option } from "commander";
|
|
6
|
-
import { environmentOf, runBudgetOf } from "../../cli/context.js";
|
|
6
|
+
import { environmentOf, outputFor, runBudgetOf } from "../../cli/context.js";
|
|
7
7
|
import { honoursDryRun } from "../../cli/dry-run-guard.js";
|
|
8
8
|
import { changesStore, ownerOnlyOption, writesFileOnlyWith } from "../../cli/effects.js";
|
|
9
9
|
import { queryTerms, withQuery } from "../../cli/list-query.js";
|
|
@@ -14,7 +14,7 @@ import { searchEvents } from "../../services/events-search.js";
|
|
|
14
14
|
import { dateWindow } from "../../services/moment.js";
|
|
15
15
|
import { linkPeople } from "../../services/people.js";
|
|
16
16
|
import { BUSY_QUERY, BUSY_QUERY_NOTE, busyAnswer, busyQuery, workingHoursOf } from "../busy.js";
|
|
17
|
-
import { isFeedCalendar, syncWithFeeds } from "../feeds.js";
|
|
17
|
+
import { isFeedCalendar, isPlainHttp, syncWithFeeds } from "../feeds.js";
|
|
18
18
|
import { eventPreparation, nextMeeting, PREPARE_MESSAGES } from "../prepare.js";
|
|
19
19
|
import { accountsMeta, CALENDAR_UNTRUSTED_FIELDS, calendarIn, calendarItem, EVENTS_QUERY, EVENTS_QUERY_NOTE, EXPORT_MAX, eventAnswer, eventIdOf, eventOf, eventsAnswer, eventsFilter, eventsIcs, peopleAnswer, resolveAnswer, reviewsAnswer, sourceAccounts, weekFilter, } from "../reads.js";
|
|
20
20
|
import { REPEAT_HELP } from "../recurrence.js";
|
|
@@ -23,6 +23,7 @@ import { calendarStatus } from "../sync.js";
|
|
|
23
23
|
import { createEvent, createEventFromText, deleteEvent, EVENT_RESPONSES, IMPORT_MAX, importEvents, moveEvent, respondToEvent, updateEvent, } from "../writes.js";
|
|
24
24
|
import { CALENDARS_QUERY, declareCalendarAnswers, PEOPLE_QUERY } from "./answers.js";
|
|
25
25
|
import { addRemind } from "./remind.js";
|
|
26
|
+
import { addSearchAll } from "./search-all.js";
|
|
26
27
|
const LOCAL_READ = { remote: "none", local: "read" };
|
|
27
28
|
const LOCAL_WRITE = { remote: "none", local: "write" };
|
|
28
29
|
const FETCH = { remote: "read", local: "write" };
|
|
@@ -30,8 +31,6 @@ const REMOTE_READ = { remote: "read", local: "none" };
|
|
|
30
31
|
const LOCAL_OR_REMOTE_READ = { remote: "read", local: "read" };
|
|
31
32
|
const REMOTE_WRITE = { remote: "write", local: "write" };
|
|
32
33
|
const GROUP = { remote: "none", local: "none" };
|
|
33
|
-
/** Every time a store can hold, for marking all of a calendar's entries at once. */
|
|
34
|
-
const EVERYWHERE = { from: -8.64e15, to: 8.64e15 };
|
|
35
34
|
/** How many pieces one `sync --embed` embeds, as drive's. */
|
|
36
35
|
const EMBED_MAX = 600;
|
|
37
36
|
// A list's marker goes on each item: a host's list envelope is strict and `--jsonl` prints only the items.
|
|
@@ -130,6 +129,9 @@ const addCalendarCommandsDefinition = (program, deps) => {
|
|
|
130
129
|
if (command.optsWithGlobals().offline)
|
|
131
130
|
throw new CliError("permission_error", "calendars add reads the feed; leave out --offline");
|
|
132
131
|
const { calendar, events } = await feeds().add(url, opts.title === undefined ? {} : { title: opts.title });
|
|
132
|
+
if (isPlainHttp(url))
|
|
133
|
+
outputFor(command).renderer.warn("this feed's address starts with http://, so the feed and any token in its address travel unencrypted; " +
|
|
134
|
+
"use https:// if the server offers it");
|
|
133
135
|
const [saved] = await deps.store.saveCalendars(deps.accountId, [calendar], now());
|
|
134
136
|
print({
|
|
135
137
|
...calendarItem(saved),
|
|
@@ -138,7 +140,8 @@ const addCalendarCommandsDefinition = (program, deps) => {
|
|
|
138
140
|
}, command);
|
|
139
141
|
});
|
|
140
142
|
example(annotate(calendars.command("remove"), { effects: LOCAL_WRITE, mcp: false })
|
|
141
|
-
.description("stop following a feed calendars add added: its address is forgotten and its stored events
|
|
143
|
+
.description("stop following a feed calendars add added: its address is forgotten and its stored events are deleted, " +
|
|
144
|
+
"not cancelled. Only a feed; calendars unsync stops a provider's calendar")
|
|
142
145
|
.argument("<calendar>", "the feed calendar's id, its ics: id, or its title"), "calendars remove 7").action(async (reference, _opts, command) => {
|
|
143
146
|
const calendar = await calendarIn(deps.store, deps.accountId, reference);
|
|
144
147
|
if (!isFeedCalendar(calendar))
|
|
@@ -146,9 +149,8 @@ const addCalendarCommandsDefinition = (program, deps) => {
|
|
|
146
149
|
reason: "feed.not-a-feed",
|
|
147
150
|
});
|
|
148
151
|
await feeds().remove(calendar.externalId);
|
|
149
|
-
await deps.store.
|
|
150
|
-
|
|
151
|
-
print({ ...calendarItem({ ...calendar, synced: false }), removed }, command);
|
|
152
|
+
const { entries, events } = await deps.store.forgetCalendar(calendar.id, now());
|
|
153
|
+
print({ ...calendarItem({ ...calendar, synced: false }), removed: entries, events }, command);
|
|
152
154
|
});
|
|
153
155
|
}
|
|
154
156
|
if (deps.freeBusy)
|
|
@@ -342,9 +344,14 @@ const addCalendarCommandsDefinition = (program, deps) => {
|
|
|
342
344
|
});
|
|
343
345
|
if (deps.writes)
|
|
344
346
|
addRemind(events, deps.writes, { deps, now, zone, print, example });
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
|
|
347
|
+
const app = deps.messages ? deps.app : undefined;
|
|
348
|
+
const searches = annotate(program
|
|
349
|
+
.command("search")
|
|
350
|
+
.description(app
|
|
351
|
+
? "find stored things by text: events, or all of messages, notes and events"
|
|
352
|
+
: "find stored things by text: events"), { effects: GROUP });
|
|
353
|
+
if (app)
|
|
354
|
+
addSearchAll(searches, { deps, app, zone, messages, example });
|
|
348
355
|
const search = example(annotate(searches.command("events"), { effects: deps.serverSearch ? LOCAL_OR_REMOTE_READ : LOCAL_READ })
|
|
349
356
|
.description(deps.serverSearch
|
|
350
357
|
? "find stored events by words, and by meaning when its model is downloaded; with --backend server, ask " +
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import type { AppIdentity } from "../../ports/app.js";
|
|
3
|
+
import type { CalendarCommandDeps } from "./index.js";
|
|
4
|
+
interface SearchAllHelpers {
|
|
5
|
+
/** Read through, never copied: a CLI's deps may be getters that work only once a profile is open. */
|
|
6
|
+
deps: CalendarCommandDeps;
|
|
7
|
+
app: AppIdentity;
|
|
8
|
+
zone: () => string;
|
|
9
|
+
messages: (what: string) => NonNullable<CalendarCommandDeps["messages"]>;
|
|
10
|
+
example: (command: Command, ...lines: string[]) => Command;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* `search all` beside `search events`: the messenger's shared search over the store, without a messenger server.
|
|
14
|
+
* Events are the calendar's own kind and always read; meeting transcripts only when `--source` names a meeting account.
|
|
15
|
+
*/
|
|
16
|
+
export declare const addSearchAll: (searches: Command, { deps, app, zone, messages, example }: SearchAllHelpers) => void;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { CliError } from "@wirecat/cli-base";
|
|
2
|
+
import { annotate } from "@wirecat/cli-base/commands";
|
|
3
|
+
import { Command } from "commander";
|
|
4
|
+
import { LOCAL_READ } from "../../cli/effects.js";
|
|
5
|
+
import { historySkipsOf } from "../../cli/messenger/history-gaps.js";
|
|
6
|
+
import { allAnswer, offsetOf, SOURCE_SEARCHED } from "../../cli/messenger/search-answers.js";
|
|
7
|
+
import { searchAllLine, searchAllOptions } from "../../cli/messenger/search-command.js";
|
|
8
|
+
import { SAVE_HELP } from "../../meetings/index.js";
|
|
9
|
+
import { meaningLane } from "../../services/messages-meaning.js";
|
|
10
|
+
import { searchAllWithMeetings } from "../../services/search-all-meetings.js";
|
|
11
|
+
const DEFAULT_LIMIT = 20;
|
|
12
|
+
/**
|
|
13
|
+
* `search all` beside `search events`: the messenger's shared search over the store, without a messenger server.
|
|
14
|
+
* Events are the calendar's own kind and always read; meeting transcripts only when `--source` names a meeting account.
|
|
15
|
+
*/
|
|
16
|
+
export const addSearchAll = (searches, { deps, app, zone, messages, example }) => {
|
|
17
|
+
const all = annotate(new Command("all"), { effects: LOCAL_READ, partial: true, output: { entity: "hit" } })
|
|
18
|
+
.summary("search stored messages, notes, calendar events and selected meeting transcripts")
|
|
19
|
+
.description("search calendar events, messages from the other WireCat tools and notes in the local store, and a meeting " +
|
|
20
|
+
"account's transcripts when --source names one — best match first; not mail (the separate memo CLI " +
|
|
21
|
+
"searches it: memo search mail). Use it when you do not know where something was written; search events " +
|
|
22
|
+
"reads the calendar with all its fields")
|
|
23
|
+
.argument("<query...>", 'strict Lucene query: words, "phrases", AND/OR/NOT, field groups and date ranges')
|
|
24
|
+
.addHelpText("after", SAVE_HELP)
|
|
25
|
+
.addHelpText("after", "--json: the list is items; each result's reference is ref, with its kind.");
|
|
26
|
+
searches.addCommand(searchAllOptions(all));
|
|
27
|
+
example(all, "search all roadmap", 'search all "quarterly review" --source telegram,gcal --json');
|
|
28
|
+
all.action(async (words, _opts, leaf) => {
|
|
29
|
+
const opts = leaf.opts();
|
|
30
|
+
if (deps.locked && opts.source !== undefined)
|
|
31
|
+
throw new CliError("permission_error", "this process is locked to one profile; search all reads its own calendar only, without --source", { reason: "profile.locked" });
|
|
32
|
+
const store = messages("search all");
|
|
33
|
+
const limit = opts.limit ?? DEFAULT_LIMIT;
|
|
34
|
+
const offset = offsetOf(opts.page, limit);
|
|
35
|
+
const env = deps.writes?.env ?? process.env;
|
|
36
|
+
const found = await searchAllWithMeetings(store, deps.account, {
|
|
37
|
+
text: words.join(" "),
|
|
38
|
+
limit,
|
|
39
|
+
...(offset === undefined ? {} : { offset }),
|
|
40
|
+
...(opts.exact ? { exact: true } : {}),
|
|
41
|
+
timezone: opts.timezone ?? zone(),
|
|
42
|
+
env,
|
|
43
|
+
only: opts.only ?? SOURCE_SEARCHED,
|
|
44
|
+
...(opts.source === undefined ? {} : { source: opts.source }),
|
|
45
|
+
...(opts.maxMeetings === undefined ? {} : { maxMeetings: opts.maxMeetings }),
|
|
46
|
+
...(deps.locked ? { scope: { events: [deps.account] } } : {}),
|
|
47
|
+
}, { app }, undefined, meaningLane({ env, messenger: { app }, store: async () => store }));
|
|
48
|
+
const note = deps.note ?? (() => undefined);
|
|
49
|
+
const globals = leaf.optsWithGlobals();
|
|
50
|
+
const format = globals.json ? "json" : globals.jsonl ? "jsonl" : "text";
|
|
51
|
+
if (format === "text")
|
|
52
|
+
note(`searched: ${found.accounts.map(({ provider, account }) => `${provider}:${account}`).join(", ") || "nothing"}`);
|
|
53
|
+
for (const { resource, source, reason } of found.skipped)
|
|
54
|
+
note(`${resource ?? source} not searched: ${reason}`);
|
|
55
|
+
if (found.notes?.meaningSkipped)
|
|
56
|
+
note(`notes by words only: ${found.notes.meaningSkipped}`);
|
|
57
|
+
if (found.events?.meaningSkipped)
|
|
58
|
+
note(`events by words only: ${found.events.meaningSkipped}`);
|
|
59
|
+
const again = {
|
|
60
|
+
query: words.join(" "),
|
|
61
|
+
...(opts.only === undefined ? {} : { only: opts.only.join(",") }),
|
|
62
|
+
...(opts.source === undefined ? {} : { source: opts.source }),
|
|
63
|
+
...(opts.maxMeetings === undefined ? {} : { max_meetings: opts.maxMeetings }),
|
|
64
|
+
...(opts.exact ? { exact: true } : {}),
|
|
65
|
+
...(opts.timezone === undefined ? {} : { timezone: opts.timezone }),
|
|
66
|
+
};
|
|
67
|
+
if (!found.items.length)
|
|
68
|
+
note("nothing found in what the local store holds");
|
|
69
|
+
const skips = await historySkipsOf(store, found.accounts).catch(() => []);
|
|
70
|
+
deps.write(allAnswer("search all", found, { limit, page: opts.page ?? 1, again }, opts.exact === true, skips), format, () => found.items.map(searchAllLine).join(""));
|
|
71
|
+
});
|
|
72
|
+
};
|
package/dist/calendar/feeds.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export interface FeedSyncStats {
|
|
|
28
28
|
calendarId: number;
|
|
29
29
|
events: number;
|
|
30
30
|
skipped: number;
|
|
31
|
+
/** The feed answered 304: nothing was read again, and the counts are those of the read before. */
|
|
32
|
+
unchanged?: true;
|
|
31
33
|
}
|
|
32
34
|
/** The profile's iCalendar feeds: a source the engine expands locally, and how one is added and forgotten. */
|
|
33
35
|
export interface CalendarFeeds {
|
|
@@ -47,6 +49,8 @@ export interface CalendarFeeds {
|
|
|
47
49
|
}
|
|
48
50
|
/** `webcal://` is `https://`: calendar apps write it so a click opens them, and the feed itself is served over https. */
|
|
49
51
|
export declare const feedAddress: (text: string) => URL;
|
|
52
|
+
/** An `http://` address: allowed, but the feed and any token in its address travel unencrypted. */
|
|
53
|
+
export declare const isPlainHttp: (text: string) => boolean;
|
|
50
54
|
export interface FetchFeedOptions {
|
|
51
55
|
/** Names the feed in errors; the address never appears in one. */
|
|
52
56
|
name: string;
|
|
@@ -54,11 +58,26 @@ export interface FetchFeedOptions {
|
|
|
54
58
|
signal?: AbortSignal;
|
|
55
59
|
limits?: FeedLimits;
|
|
56
60
|
}
|
|
61
|
+
/** The last answer's `ETag` and `Last-Modified`, sent back so the server can say the feed has not changed. */
|
|
62
|
+
export interface FeedValidators {
|
|
63
|
+
etag: string | null;
|
|
64
|
+
lastModified: string | null;
|
|
65
|
+
}
|
|
57
66
|
/**
|
|
58
67
|
* The feed's text: http or https, each redirect followed by hand and only to https, the body cut off at its limit and
|
|
59
68
|
* the request at its time. Errors name the feed and the status, never the address, which may hold a token.
|
|
60
69
|
*/
|
|
61
70
|
export declare const fetchFeed: (address: string, options: FetchFeedOptions) => Promise<string>;
|
|
71
|
+
/**
|
|
72
|
+
* `fetchFeed` that sends `since` as `If-None-Match` and `If-Modified-Since`: `"unchanged"` when the server answers 304,
|
|
73
|
+
* otherwise the text and the validators to send next time.
|
|
74
|
+
*/
|
|
75
|
+
export declare const fetchFeedIfChanged: (address: string, options: FetchFeedOptions & {
|
|
76
|
+
since?: FeedValidators;
|
|
77
|
+
}) => Promise<{
|
|
78
|
+
text: string;
|
|
79
|
+
validators: FeedValidators;
|
|
80
|
+
} | "unchanged">;
|
|
62
81
|
/** One feed event in the neutral words, its text cleaned as an invitation's is: feed text is somebody else's. */
|
|
63
82
|
export declare const feedEntry: (event: IcsEvent, zone: string) => EntryInput;
|
|
64
83
|
export interface FeedRead {
|