@wirecat/cli-core 0.545.0 → 0.547.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.
Files changed (175) hide show
  1. package/CHANGELOG.md +228 -0
  2. package/dist/calendar/busy.js +4 -1
  3. package/dist/calendar/cli/answers.d.ts +31 -0
  4. package/dist/calendar/cli/answers.js +8 -0
  5. package/dist/calendar/cli/index.d.ts +6 -0
  6. package/dist/calendar/cli/index.js +43 -4
  7. package/dist/calendar/cli/remind.js +2 -1
  8. package/dist/calendar/expand.d.ts +17 -0
  9. package/dist/calendar/expand.js +340 -0
  10. package/dist/calendar/feeds.d.ts +96 -0
  11. package/dist/calendar/feeds.js +324 -0
  12. package/dist/calendar/ics.d.ts +15 -4
  13. package/dist/calendar/ics.js +18 -7
  14. package/dist/calendar/index.d.ts +3 -1
  15. package/dist/calendar/index.js +2 -0
  16. package/dist/calendar/server-search.js +3 -1
  17. package/dist/calendar/writes.js +15 -4
  18. package/dist/cli/after-dashes.d.ts +16 -0
  19. package/dist/cli/after-dashes.js +41 -0
  20. package/dist/cli/bot/context.d.ts +1 -1
  21. package/dist/cli/bot/context.js +9 -1
  22. package/dist/cli/bot/messages.js +2 -0
  23. package/dist/cli/bot/setup.js +1 -0
  24. package/dist/cli/contract-templates.js +2 -2
  25. package/dist/cli/entry.d.ts +2 -0
  26. package/dist/cli/entry.js +3 -2
  27. package/dist/cli/index.d.ts +2 -1
  28. package/dist/cli/index.js +2 -1
  29. package/dist/cli/messenger/admin-commands.js +5 -1
  30. package/dist/cli/messenger/admin-contacts-command.js +5 -1
  31. package/dist/cli/messenger/admin-folders-command.js +5 -1
  32. package/dist/cli/messenger/complete-command.js +1 -0
  33. package/dist/cli/messenger/history-query.d.ts +10 -4
  34. package/dist/cli/messenger/history-query.js +87 -31
  35. package/dist/cli/messenger/messages-command.js +12 -23
  36. package/dist/cli/messenger/messages-comments-command.js +4 -2
  37. package/dist/cli/messenger/messages-edit-command.js +1 -0
  38. package/dist/cli/messenger/messages-press-command.js +1 -0
  39. package/dist/cli/messenger/messages-send-command.js +1 -0
  40. package/dist/cli/messenger/observed.js +2 -2
  41. package/dist/cli/messenger/polls-command.js +1 -0
  42. package/dist/cli/messenger/private-people-command.js +5 -1
  43. package/dist/cli/messenger/store-maintenance-command.d.ts +1 -1
  44. package/dist/cli/messenger/stored.js +56 -3
  45. package/dist/cli/messenger/topics-command.js +1 -1
  46. package/dist/cli/option-hints.d.ts +6 -0
  47. package/dist/cli/option-hints.js +15 -0
  48. package/dist/cli/program.js +17 -6
  49. package/dist/cli/schedule/schedule-command.js +1 -0
  50. package/dist/domain/message-link.d.ts +3 -0
  51. package/dist/domain/message-link.js +9 -14
  52. package/dist/domain/money-words.d.ts +11 -0
  53. package/dist/domain/money-words.js +38 -0
  54. package/dist/domain/providers.d.ts +2 -0
  55. package/dist/domain/providers.js +15 -3
  56. package/dist/domain/ref-arguments.d.ts +31 -0
  57. package/dist/domain/ref-arguments.js +79 -0
  58. package/dist/domain/references.d.ts +20 -2
  59. package/dist/domain/references.js +132 -47
  60. package/dist/errors/reasons.js +31 -1
  61. package/dist/index.d.ts +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mail/cli/index.js +4 -4
  64. package/dist/mail/index.d.ts +2 -0
  65. package/dist/mail/index.js +2 -0
  66. package/dist/mail/partial.d.ts +34 -0
  67. package/dist/mail/partial.js +94 -0
  68. package/dist/mail/server-search.js +17 -9
  69. package/dist/mail/source.d.ts +13 -2
  70. package/dist/mail/source.js +7 -1
  71. package/dist/mail/sync-types.d.ts +112 -0
  72. package/dist/mail/sync-types.js +1 -0
  73. package/dist/mail/sync.d.ts +4 -106
  74. package/dist/mail/sync.js +49 -4
  75. package/dist/mail/testing/fake.d.ts +3 -1
  76. package/dist/mail/testing/fake.js +10 -2
  77. package/dist/meetings/mcp/index.d.ts +15 -15
  78. package/dist/oauth/client-file.d.ts +14 -0
  79. package/dist/oauth/client-file.js +28 -0
  80. package/dist/oauth/index.d.ts +1 -0
  81. package/dist/oauth/index.js +1 -0
  82. package/dist/ports/messenger.d.ts +3 -2
  83. package/dist/resolve.d.ts +3 -1
  84. package/dist/resolve.js +8 -0
  85. package/dist/search/task-signature.d.ts +5 -1
  86. package/dist/search/task-signature.js +27 -9
  87. package/dist/services/agenda.d.ts +5 -0
  88. package/dist/services/agenda.js +3 -1
  89. package/dist/services/deps.d.ts +0 -2
  90. package/dist/services/deps.js +0 -2
  91. package/dist/services/documents/ingestion.js +1 -1
  92. package/dist/services/documents/knowledge.d.ts +10 -6
  93. package/dist/services/documents/knowledge.js +25 -11
  94. package/dist/services/index.d.ts +6 -1
  95. package/dist/services/index.js +6 -1
  96. package/dist/services/message-resolution.d.ts +4 -1
  97. package/dist/services/message-resolution.js +19 -3
  98. package/dist/services/messages.d.ts +2 -0
  99. package/dist/services/messages.js +40 -36
  100. package/dist/services/money-words.d.ts +3 -0
  101. package/dist/services/money-words.js +5 -0
  102. package/dist/services/proposal-tasks.d.ts +3 -2
  103. package/dist/services/proposal-tasks.js +5 -2
  104. package/dist/services/proposals/ids.d.ts +5 -0
  105. package/dist/services/proposals/ids.js +43 -0
  106. package/dist/services/proposals/index.d.ts +3 -0
  107. package/dist/services/proposals/index.js +2 -0
  108. package/dist/services/proposals/kinds/action.d.ts +7 -0
  109. package/dist/services/proposals/kinds/action.js +45 -0
  110. package/dist/services/proposals/kinds/fact.d.ts +4 -0
  111. package/dist/services/proposals/kinds/fact.js +43 -0
  112. package/dist/services/proposals/kinds/findings.d.ts +7 -0
  113. package/dist/services/proposals/kinds/findings.js +75 -0
  114. package/dist/services/proposals/kinds/key-document.d.ts +9 -0
  115. package/dist/services/proposals/kinds/key-document.js +75 -0
  116. package/dist/services/proposals/kinds/memory.d.ts +4 -0
  117. package/dist/services/proposals/kinds/memory.js +42 -0
  118. package/dist/services/proposals/kinds/relationship.d.ts +10 -0
  119. package/dist/services/proposals/kinds/relationship.js +82 -0
  120. package/dist/services/proposals/kinds/shared.d.ts +25 -0
  121. package/dist/services/proposals/kinds/shared.js +49 -0
  122. package/dist/services/proposals/registry.d.ts +9 -0
  123. package/dist/services/proposals/registry.js +129 -0
  124. package/dist/services/proposals/types.d.ts +85 -0
  125. package/dist/services/proposals/types.js +1 -0
  126. package/dist/services/questions.d.ts +7 -2
  127. package/dist/services/questions.js +13 -4
  128. package/dist/services/server-search.d.ts +7 -4
  129. package/dist/services/server-search.js +5 -2
  130. package/dist/services/stored-project-gathering.d.ts +9 -0
  131. package/dist/services/stored-project-gathering.js +9 -4
  132. package/dist/services/task-categories.d.ts +2 -0
  133. package/dist/services/task-categories.js +19 -8
  134. package/dist/services/tasks.js +8 -4
  135. package/dist/store/decisions.d.ts +65 -0
  136. package/dist/store/decisions.js +55 -0
  137. package/dist/store/evidence-findings.d.ts +6 -6
  138. package/dist/store/index.d.ts +4 -3
  139. package/dist/store/index.js +2 -1
  140. package/dist/store/meeting-findings.d.ts +2 -0
  141. package/dist/store/messages.d.ts +4 -9
  142. package/dist/store/sqlite/actors.d.ts +13 -2
  143. package/dist/store/sqlite/actors.js +24 -1
  144. package/dist/store/sqlite/email-locations.d.ts +16 -0
  145. package/dist/store/sqlite/email-locations.js +26 -0
  146. package/dist/store/sqlite/emails.d.ts +6 -2
  147. package/dist/store/sqlite/emails.js +2 -1
  148. package/dist/store/sqlite/evidence-findings.js +13 -3
  149. package/dist/store/sqlite/evidence-sources.js +2 -2
  150. package/dist/store/sqlite/facts.d.ts +16 -8
  151. package/dist/store/sqlite/facts.js +48 -15
  152. package/dist/store/sqlite/findings-core.d.ts +2 -1
  153. package/dist/store/sqlite/findings-core.js +4 -4
  154. package/dist/store/sqlite/identities.js +1 -1
  155. package/dist/store/sqlite/knowledge.d.ts +43 -7
  156. package/dist/store/sqlite/knowledge.js +62 -17
  157. package/dist/store/sqlite/meeting-findings.js +6 -6
  158. package/dist/store/sqlite/memories.d.ts +12 -8
  159. package/dist/store/sqlite/memories.js +33 -10
  160. package/dist/store/sqlite/notes.d.ts +5 -1
  161. package/dist/store/sqlite/notes.js +22 -6
  162. package/dist/store/sqlite/open-store.d.ts +4 -1
  163. package/dist/store/sqlite/open-store.js +8 -2
  164. package/dist/store/sqlite/open.d.ts +3 -0
  165. package/dist/store/sqlite/proposed-actions.d.ts +21 -8
  166. package/dist/store/sqlite/proposed-actions.js +29 -9
  167. package/dist/store/sqlite/reads.d.ts +13 -2
  168. package/dist/store/sqlite/reads.js +8 -4
  169. package/dist/store/sqlite/relation-proposals.d.ts +34 -0
  170. package/dist/store/sqlite/relation-proposals.js +114 -0
  171. package/dist/store/sqlite/things.d.ts +0 -1
  172. package/dist/store/sqlite/things.js +25 -24
  173. package/dist/store/store.d.ts +3 -0
  174. package/dist/store/store.js +2 -0
  175. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,234 @@ shape of this file.
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 0.547.0 — 02.11.2026
11
+
12
+ ### Added
13
+
14
+ - **A server's refused SEARCH fails that folder, not the run, and proves nothing.** A mail source throws
15
+ `mail.search-refused` (`SEARCH_REFUSED`, `searchRefused`) when the server answers SEARCH with NO or BAD. `syncMail`
16
+ reads the other folders, answers `state: "partial"` with `refusedFolders`, and for the refused folder marks no mail
17
+ deleted, changes no membership, moves no resume point and leaves `mail_coverage` as it was. Before, a mail source that
18
+ read the refusal as "nothing found" made the folder look empty.
19
+ - **Server search reads big mail text-first, and the next sync completes it.** A candidate is read up to
20
+ `SERVER_BOUNDS.textBytes` (256 KiB, `fetchRaw(items, { bytes })`); one cut short is stored with its text and no
21
+ attachments, marked `metadata.partial`, and `meta.issues` says `search.server-partial`. `syncMail` then reads up to
22
+ 100 partial emails whole and clears the mark (`partial: { completed, left }`; `completePartial: false` skips it).
23
+ `MailStore.partialEmails` lists them. No store migration: the mark is a JSON key older builds ignore.
24
+ - **`readClientFile` (from `@wirecat/cli-core/oauth`) reads a user's own Google Desktop OAuth client file** (the
25
+ `{ "installed": { client_id, client_secret } }` JSON from Google's console). It refuses a file other users can read
26
+ (`sign-in.client-file-open`) and a file of the wrong shape (`sign-in.client-file-invalid`), and never puts the file's
27
+ contents in an error. gcal, drive and mail each kept a copy of this reader.
28
+ - **`openBrowser(url, browser?)` is exported from `@wirecat/cli-core/cli`**, so a CLI that does not start through
29
+ `startCli` opens the sign-in page the same way: `open`, `rundll32` or `xdg-open`, or the named browser.
30
+ - **iCalendar feeds as read-only calendars.** With `deps.feeds` (`icsFeeds`), `calendars add <url> [--title]` follows a
31
+ public holiday calendar, a sports schedule or a published `.ics` address, and `calendars remove <calendar>` stops.
32
+ `sync` reads each feed after the provider (`syncWithFeeds`), so its events show in `events list`,
33
+ `search events`, `overlapping:` and `events remind`. Repeating events are expanded here (`expandSeries`: RRULE in
34
+ the event's own zone, RDATE, EXDATE and overrides). The address is a secret input, kept by the CLI and never
35
+ printed; a fetch follows redirects only to https and stops at 10 MB and 30 s. `readIcs` takes
36
+ `{ overrides: true }` and returns the calendar's `name`. See `docs/dev/CALENDARS.md`, "Feeds".
37
+ - **History limits for pushed history, per profile.** A messenger whose history is pushed (`history: "store"`,
38
+ WhatsApp) saves one-to-one chats back `history_dialog_days` (1095 by default), groups of more than two people back
39
+ `history_group_days` (365) and nothing of a group above `history_group_members_max` people (50); at most 1095 days.
40
+ The chat row stays, so the chat is still listed. Live messages, `messages sync` and what the store already holds are
41
+ never dropped. `messages sync <chat> --full-history` fetches a chat and keeps its pushed history in full from then on
42
+ (`history_included` in the answer). `ChatsStore` gains `historySkips`, `historyShapes`, `recordHistorySkips` and
43
+ `setHistoryIncluded`; `Saving` takes `historyLimits`.
44
+ - **Helpers for reading money and questions in a chat, for the project status work.** `amountsOf(text)` returns
45
+ every amount in a text, in order (`amountOf` is its first). `MONEY_REQUEST`, `MONEY_DONE` and `PROMISE` word lists
46
+ (ru, en, es) with `moneyClassesOf(text)` say which a text uses. `questions(messages, { asker: "owner" })` lists the
47
+ owner's own questions and whether anyone but the owner answered them, by a reply or by speaking next; the default,
48
+ `"others"`, is what it did before. `linkedChatsOf` is exported, now with each link's `role`, and so is
49
+ `AGENDA_DEFAULTS`, the silence `tasks agenda` waits before it lists a chat.
50
+ - **A command's own history handler learns whether each batch reached the store**: `HistoryBatchHandler` takes
51
+ `saved`, a promise of the same `true` or `false` the messenger gets, so a link can count only what was kept.
52
+ - **Every messenger command that takes a chat or a message also takes the reference other WireCat CLIs print**:
53
+ `chat:<provider>/<account>/<chat>` wherever a chat is named (`messages list chat:max/34871122/63488582`, bot
54
+ 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
55
+ account is refused, naming the account it belongs to and the profiles of this CLI the store saw on it; it never
56
+ switches account. One of another messenger is refused with the command that opens it (`open it with tg <profile>
57
+ messages list chat:telegram/…`), and another kind (`document:413` given as a chat) with what the argument takes.
58
+ - **`event:<id>` and `meeting:<account>/<meeting>[/<transcript>[/<cue>]]` parse with `parseReference`** and
59
+ `canonicalReference`, as every other kind: `event:N` was printed by the calendar and person answers and could not be
60
+ read back. The kinds are one table, `REF_KINDS`; `looksLikeReference(text)` tells a reference from a title such as
61
+ `Note: plan`. Reference errors carry a reason: `ref.malformed`, `ref.unknown-kind` (with the kind meant:
62
+ `"doc:413" … did you mean document:413?`), `ref.wrong-kind`, `ref.wrong-provider`, `ref.wrong-account`.
63
+ - **`messages list` reads a window bounded on both sides, offline too.** The query takes a start and an end,
64
+ `'date>=2026-10-01 date<2026-10-20'` or `'date:[2026-10-01 TO 2026-10-19]'`, and `id>` with `date<`. A start reads
65
+ forward, oldest first, and stops at the end; an end alone reads back from it, newest page first, as before.
66
+ `--offline` and a messenger whose history is read from the store (WhatsApp) now answer both ways from the store
67
+ instead of refusing. A forward cursor carries the end, `after:<id>~<epoch ms>`, so the next page stops at the same
68
+ place. `--since`, `--since-time`, `--until`, `--until-time`, `--after-time` and `--before-time` on `messages list`
69
+ fail with the query form to type instead. The store's `messages()` window takes `after` (a message or a moment)
70
+ and `until`.
71
+ - **One proposal inbox behind one check: `proposalRegistry(store, policy)`, `ProposalKind`, `parseProposalIds`
72
+ (`@wirecat/cli-core/services`) and `mayDecide` (`@wirecat/cli-core/store`).** The registry lists every pending
73
+ proposal newest first across kinds (`relationship`, `key_document`, `fact`, `memory`, `findings` for evidence
74
+ findings, and `action` for every other stored proposal), and decides many ids at once, each on its own: the answer
75
+ lists `decided` and `refused`, and one refusal never undoes the others. A new kind registers itself with its id
76
+ `prefix` or the `stored` proposal kinds it owns; nothing else changes. `parseProposalIds` reads
77
+ `17070-17079,fact:500-502,17080/f2` and refuses a range across prefixes. Unconfirmed agent and rule links show as
78
+ `link:<id>` (relationships) and `key:<id>` (key documents) until the store moves them.
79
+ - **`knowledge.proposeRelation(scope, input, by)`**: an agent's or a rule's relationship is a stored `relationship`
80
+ proposal for the owner, not a link; the same pending pair returns the proposal already held. Removing a link to a
81
+ project, or rejecting any suggested link, leaves a rejected `relationship` proposal, so a later scan can skip it.
82
+ - **`proposedActions.list({ kinds, except, project, proposedBy })`**, `proposedBy` on `facts.list` and
83
+ `memories.list`, `order: "created"` on `facts.list`, and the bot's `kind` (`agent` or `rule`) on the author of a
84
+ proposed action, a fact, a memory and an evidence findings batch; bots may have the kind `rule`, and an `Author` may
85
+ name it.
86
+ - **`knowledge.decideLinkProposal(id, decision)`** decides a stored `relationship` or `key_document` proposal, and
87
+ **`knowledge.decideSuggestedLink(id, decision)`** an older unconfirmed link, each in one transaction: the link and
88
+ the decision land together or not at all. A decision's `reason` is kept: on a rejected proposal as its result, on a
89
+ fact in `metadata.decision`, on an evidence findings receipt.
90
+
91
+ ### Changed — may break callers
92
+
93
+ - **`SERVER_BOUNDS.maxMessageBytes`, `ServerSearched.tooLarge` and `search.server-too-large` are gone**: a big
94
+ candidate is no longer left on the server; see `textBytes`, `ServerSearched.partial` and `search.server-partial`.
95
+ - **An option after `--` is read as the option.** `messages sync -- -100 --json` now syncs `-100` and answers in JSON;
96
+ it failed with "too many arguments". After `--`, a word that is exactly one of the command's options, its own or a
97
+ global one (`--json`, `--limit 5`, `--json=id`), moves in front of `--`; every other word stays a positional. A
98
+ negative id needs no `--` at all. Commands that take free text keep every word after `--` literal: `messages send` and
99
+ `edit` (also the bot's), `polls create`, `topics create`, `chats create`, `chats folders create`, `contacts rename`,
100
+ `contacts aliases set`, `messages press`, `bot commands set`, `schedule command`, `events remind`, `complete`, and the
101
+ notes templates. Mark such a command with `annotate(command, { literal_after_dashes: true })`; MCP calls are never
102
+ lifted. A script that passed the literal word `--json` as a positional of another command now gets the option instead.
103
+ - **A write to a calendar the account may only read refuses before anything is asked or journaled**
104
+ (`calendar.read-only`): create, quick add, import, update, delete, respond and move, for a feed and for a provider's
105
+ `reader` or `free-busy` calendar alike. Before, only the target of a move was checked; the provider refused the rest.
106
+ `calendars busy` and `search --backend server` leave feed calendars out.
107
+ - **A locator of another account or messenger is refused with a new text and a reason.** `messages show`, `context`,
108
+ `link` and `download` said "that locator belongs to another account; select its profile first" or "…belongs to
109
+ another messenger"; they now say `<ref> belongs to account <id>; profile <name> is account <id>` (`ref.wrong-account`)
110
+ or `<ref> is a <messenger> message; open it with …` (`ref.wrong-provider`). A script matching the old text matches
111
+ the reason instead.
112
+ - **A text of the form `<kind>:<no spaces>` given as a chat is read as a reference**, so a chat titled `note:plan` is
113
+ no longer found by that title; give its id or a part of the title.
114
+ - The provider seeds of `telegram`, `max` and `whatsapp` name their CLI (`command: tg`, `max`, `wa`), which a
115
+ provider clash message now shows (`telegram (messages, from tg)`).
116
+ - **Every decide method takes who decides, a `Decider`** (`"owner"` or `{ bot, model?, reason }`):
117
+ `facts.accept(ref, by)`, `facts.reject(ref, by)`, `memories.confirm(ref, by)`, `knowledge.confirmRelation(scope, id,
118
+ by)`, `knowledge.removeRelation(scope, id, by)`, `proposedActions.approve(id, by, result?)`,
119
+ `proposedActions.reject(id, by)`, `approveAsTask(store, id, by)`, and `by` is now required in
120
+ `evidenceFindings.review` and `meetingFindings.review`. `DocumentKnowledge.fact` and `.memory` take `by` for a
121
+ `confirm`, and `memories.markStale(ref, by)` and `.memory(…, "stale", by)` take it too: marking an agent's memory
122
+ stale is how it is turned down. `knowledge.relate` needs `by`: the owner's relationship is a link, an agent's is a
123
+ `relationship` proposal it returns instead. `notes.addLink` refuses any confirmed link without `by: "owner"`, so an
124
+ agent writes `confirmed: false` (the task service now does). `notes.removeLink(id, by)`, `facts.reverse(ref, by)`,
125
+ `facts.remove(ref, by)` and `memories.remove(ref, by)` take who removes; the document port's `addMemory` needs
126
+ `author`, `addFact` and `addLink` need `by`, with no owner default. `proposalRegistry(store)` takes no policy: the
127
+ host sets it once with `openStore({ decisions })`, and `store.decisionPolicy` is what the registry and every store
128
+ check read. A host passes the owner only when the owner runs the command, and
129
+ the agent's bot and reason otherwise.
130
+ An agent's confirmation of a relationship is recorded in the link's provenance, and of a fact or proposal as its
131
+ decider.
132
+
133
+ ### Fixed
134
+
135
+ - **A sum written in groups of three read as the wrong amount: `50 000 ₽` was `0` and `4 300 ₽` was `300`**, because
136
+ only the last group was read. Groups after a space, a no-break or thin space, a dot or a comma (`50 000`,
137
+ `1.200 €`, `$1,200`) are one number now, a decimal part after them is kept (`5 000.50 ₽`), and amounts keep two
138
+ decimals instead of a whole number (`15.5 eur` was 16). This is the amount the duplicate check compares between
139
+ two tasks, so a reminder worded with a grouped sum is no longer compared on the wrong figure.
140
+ - **`page.next` of `messages list` and `messages comments` runs as written.** It repeated the query's `id`/`date`
141
+ bound beside `--cursor`, which the command refuses as two starting points; it now keeps only `topic:` and
142
+ `starred:`.
143
+ - **An inclusive start keeps a message sent exactly at it.** `messages list 'date>=2026-10-01'` skipped a message
144
+ sent at the first millisecond of the day, and `date<="…"` one sent at that moment.
145
+
146
+ ### Security
147
+
148
+ - **An agent can no longer decide its own proposal.** Before, `facts.accept`/`reject`,
149
+ `memories.confirm`, `knowledge.confirmRelation`, `proposedActions.approve`/`reject`, `approveAsTask` and both
150
+ findings reviews never asked who decided, so over MCP an agent could confirm what it had proposed itself. Every one
151
+ of them, and the registry, now runs `mayDecide`: the owner always may; an agent needs a reason
152
+ (`proposal.reason-required`), is refused its own bot's proposal (`proposal.own`), a rule scorer's proposal and one
153
+ that names no author (`proposal.owner-only`), and every decision when the host turns agent decisions off
154
+ (`proposals.agent-decisions-off`). An agent can no longer add a memory already `confirmed`, mark its own memory
155
+ stale, write a confirmed project link itself, or remove a link. A link records only free-text provenance, which
156
+ anyone can write, so only the owner decides an unconfirmed link or removes a link; the rejected record a removal
157
+ leaves names who removed it. Findings an agent accepted for the owner record that agent, not the owner. Only the
158
+ owner removes or reverses an accepted fact or another bot's memory; an agent withdraws only its own row while it is
159
+ proposed. Turning agent decisions off now holds for every store method, not only the registry, and a bot is the
160
+ same bot whatever its letter case (`Claude-Code` is `claude-code`).
161
+
162
+ ## 0.546.0 — 02.11.2026
163
+
164
+ ### Added
165
+
166
+ - **`readClientFile` (from `@wirecat/cli-core/oauth`) reads a user's own Google Desktop OAuth client file** (the
167
+ `{ "installed": { client_id, client_secret } }` JSON from Google's console). It refuses a file other users can read
168
+ (`sign-in.client-file-open`) and a file of the wrong shape (`sign-in.client-file-invalid`), and never puts the file's
169
+ contents in an error. gcal, drive and mail each kept a copy of this reader.
170
+ - **`openBrowser(url, browser?)` is exported from `@wirecat/cli-core/cli`**, so a CLI that does not start through
171
+ `startCli` opens the sign-in page the same way: `open`, `rundll32` or `xdg-open`, or the named browser.
172
+ - **iCalendar feeds as read-only calendars.** With `deps.feeds` (`icsFeeds`), `calendars add <url> [--title]` follows a
173
+ public holiday calendar, a sports schedule or a published `.ics` address, and `calendars remove <calendar>` stops.
174
+ `sync` reads each feed after the provider (`syncWithFeeds`), so its events show in `events list`,
175
+ `search events`, `overlapping:` and `events remind`. Repeating events are expanded here (`expandSeries`: RRULE in
176
+ the event's own zone, RDATE, EXDATE and overrides). The address is a secret input, kept by the CLI and never
177
+ printed; a fetch follows redirects only to https and stops at 10 MB and 30 s. `readIcs` takes
178
+ `{ overrides: true }` and returns the calendar's `name`. See `docs/dev/CALENDARS.md`, "Feeds".
179
+ - **History limits for pushed history, per profile.** A messenger whose history is pushed (`history: "store"`,
180
+ WhatsApp) saves one-to-one chats back `history_dialog_days` (1095 by default), groups of more than two people back
181
+ `history_group_days` (365) and nothing of a group above `history_group_members_max` people (50); at most 1095 days.
182
+ The chat row stays, so the chat is still listed. Live messages, `messages sync` and what the store already holds are
183
+ never dropped. `messages sync <chat> --full-history` fetches a chat and keeps its pushed history in full from then on
184
+ (`history_included` in the answer). `ChatsStore` gains `historySkips`, `historyShapes`, `recordHistorySkips` and
185
+ `setHistoryIncluded`; `Saving` takes `historyLimits`.
186
+ - **Helpers for reading money and questions in a chat, for the project status work.** `amountsOf(text)` returns
187
+ every amount in a text, in order (`amountOf` is its first). `MONEY_REQUEST`, `MONEY_DONE` and `PROMISE` word lists
188
+ (ru, en, es) with `moneyClassesOf(text)` say which a text uses. `questions(messages, { asker: "owner" })` lists the
189
+ owner's own questions and whether anyone but the owner answered them, by a reply or by speaking next; the default,
190
+ `"others"`, is what it did before. `linkedChatsOf` is exported, now with each link's `role`, and so is
191
+ `AGENDA_DEFAULTS`, the silence `tasks agenda` waits before it lists a chat.
192
+ - **A command's own history handler learns whether each batch reached the store**: `HistoryBatchHandler` takes
193
+ `saved`, a promise of the same `true` or `false` the messenger gets, so a link can count only what was kept.
194
+ - **Every messenger command that takes a chat or a message also takes the reference other WireCat CLIs print**:
195
+ `chat:<provider>/<account>/<chat>` wherever a chat is named (`messages list chat:max/34871122/63488582`, bot
196
+ 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
197
+ account is refused, naming the account it belongs to and the profiles of this CLI the store saw on it; it never
198
+ switches account. One of another messenger is refused with the command that opens it (`open it with tg <profile>
199
+ messages list chat:telegram/…`), and another kind (`document:413` given as a chat) with what the argument takes.
200
+ - **`event:<id>` and `meeting:<account>/<meeting>[/<transcript>[/<cue>]]` parse with `parseReference`** and
201
+ `canonicalReference`, as every other kind: `event:N` was printed by the calendar and person answers and could not be
202
+ read back. The kinds are one table, `REF_KINDS`; `looksLikeReference(text)` tells a reference from a title such as
203
+ `Note: plan`. Reference errors carry a reason: `ref.malformed`, `ref.unknown-kind` (with the kind meant:
204
+ `"doc:413" … did you mean document:413?`), `ref.wrong-kind`, `ref.wrong-provider`, `ref.wrong-account`.
205
+
206
+ ### Changed — may break callers
207
+
208
+ - **An option after `--` is read as the option.** `messages sync -- -100 --json` now syncs `-100` and answers in JSON;
209
+ it failed with "too many arguments". After `--`, a word that is exactly one of the command's options, its own or a
210
+ global one (`--json`, `--limit 5`, `--json=id`), moves in front of `--`; every other word stays a positional. A
211
+ negative id needs no `--` at all. Commands that take free text keep every word after `--` literal: `messages send` and
212
+ `edit` (also the bot's), `polls create`, `topics create`, `chats create`, `chats folders create`, `contacts rename`,
213
+ `contacts aliases set`, `messages press`, `bot commands set`, `schedule command`, `events remind`, `complete`, and the
214
+ notes templates. Mark such a command with `annotate(command, { literal_after_dashes: true })`; MCP calls are never
215
+ lifted. A script that passed the literal word `--json` as a positional of another command now gets the option instead.
216
+ - **A write to a calendar the account may only read refuses before anything is asked or journaled**
217
+ (`calendar.read-only`): create, quick add, import, update, delete, respond and move, for a feed and for a provider's
218
+ `reader` or `free-busy` calendar alike. Before, only the target of a move was checked; the provider refused the rest.
219
+ `calendars busy` and `search --backend server` leave feed calendars out.
220
+ - **A locator of another account or messenger is refused with a new text and a reason.** `messages show`, `context`,
221
+ `link` and `download` said "that locator belongs to another account; select its profile first" or "…belongs to
222
+ another messenger"; they now say `<ref> belongs to account <id>; profile <name> is account <id>` (`ref.wrong-account`)
223
+ or `<ref> is a <messenger> message; open it with …` (`ref.wrong-provider`). A script matching the old text matches
224
+ the reason instead.
225
+ - **A text of the form `<kind>:<no spaces>` given as a chat is read as a reference**, so a chat titled `note:plan` is
226
+ no longer found by that title; give its id or a part of the title.
227
+ - The provider seeds of `telegram`, `max` and `whatsapp` name their CLI (`command: tg`, `max`, `wa`), which a
228
+ provider clash message now shows (`telegram (messages, from tg)`).
229
+
230
+ ### Fixed
231
+
232
+ - **A sum written in groups of three read as the wrong amount: `50 000 ₽` was `0` and `4 300 ₽` was `300`**, because
233
+ only the last group was read. Groups after a space, a no-break or thin space, a dot or a comma (`50 000`,
234
+ `1.200 €`, `$1,200`) are one number now, a decimal part after them is kept (`5 000.50 ₽`), and amounts keep two
235
+ decimals instead of a whole number (`15.5 eur` was 16). This is the amount the duplicate check compares between
236
+ two tasks, so a reminder worded with a grouped sum is no longer compared on the wrong figure.
237
+
10
238
  ## 0.545.0 — 02.11.2026
11
239
 
12
240
  ### Added
@@ -2,6 +2,7 @@ import { CliError } from "@wirecat/cli-base";
2
2
  import { dayBoundary, queryError, queryFieldsOf, zonedMoment, } from "@wirecat/cli-base/query";
3
3
  import { LIST_QUERY_GUIDE, listQuery, nativeTermLists, typedQuery } from "../cli/list-query.js";
4
4
  import { calendarBusy } from "./cli/answers.js";
5
+ import { isFeedCalendar } from "./feeds.js";
5
6
  import { calendarIn, plusDays, timeWindow } from "./reads.js";
6
7
  /** Google answers for 50 calendars at most (`calendarExpansionMax`, reference/freebusy/query). */
7
8
  const MOST = 50;
@@ -60,6 +61,8 @@ export const busyQuery = async (query, context) => {
60
61
  to = timeWindow(node, zone, now).upper;
61
62
  else if (field === "calendar") {
62
63
  const calendar = await calendarIn(context.store, context.accountId, node.value);
64
+ if (isFeedCalendar(calendar))
65
+ throw new CliError("validation_error", `calendar ${calendar.id} is a feed, which the provider has no busy times for; read it with events list`, { reason: "busy.feed" });
63
66
  if (!calendars.some(({ id }) => id === calendar.id))
64
67
  calendars.push(calendar);
65
68
  }
@@ -76,7 +79,7 @@ export const busyQuery = async (query, context) => {
76
79
  throw new CliError("validation_error", "the window ends before it starts");
77
80
  const asked = calendars.length
78
81
  ? calendars
79
- : (await context.store.calendars(context.accountId)).filter(({ synced, deletedAt }) => synced && !deletedAt);
82
+ : (await context.store.calendars(context.accountId)).filter((calendar) => calendar.synced && !calendar.deletedAt && !isFeedCalendar(calendar));
80
83
  if (asked.length === 0 && people.size === 0)
81
84
  throw new CliError("validation_error", "no calendar syncs yet; name one with calendar:<id>, or a person:<email>", {
82
85
  reason: "busy.no-calendars",
@@ -11,6 +11,31 @@ export declare const calendar: v.StrictObjectSchema<{
11
11
  readonly synced: v.BooleanSchema<undefined>;
12
12
  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>;
13
13
  }, undefined>;
14
+ /** `calendars add`: the feed's calendar, how many events the feed holds now, and the sync to run next. */
15
+ export declare const calendarFeed: v.StrictObjectSchema<{
16
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
17
+ readonly external_id: v.StringSchema<undefined>;
18
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
19
+ readonly timezone: v.NullableSchema<v.StringSchema<undefined>, undefined>;
20
+ readonly access_role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
21
+ readonly primary: v.BooleanSchema<undefined>;
22
+ readonly synced: v.BooleanSchema<undefined>;
23
+ 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>;
24
+ readonly events: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
25
+ readonly hint: v.StringSchema<undefined>;
26
+ }, undefined>;
27
+ /** `calendars remove`: the feed's calendar, no longer synced, and how many stored entries were marked deleted. */
28
+ export declare const calendarFeedRemoval: v.StrictObjectSchema<{
29
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
30
+ readonly external_id: v.StringSchema<undefined>;
31
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
32
+ readonly timezone: v.NullableSchema<v.StringSchema<undefined>, undefined>;
33
+ readonly access_role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
34
+ readonly primary: v.BooleanSchema<undefined>;
35
+ readonly synced: v.BooleanSchema<undefined>;
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
+ readonly removed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
38
+ }, undefined>;
14
39
  export declare const calendarBusy: v.StrictObjectSchema<{
15
40
  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`">]>;
16
41
  readonly end: 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`">]>;
@@ -75,6 +100,12 @@ export declare const calendarSync: v.StrictObjectSchema<{
75
100
  readonly embedded: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
76
101
  readonly left: v.BooleanSchema<undefined>;
77
102
  }, undefined>, undefined>;
103
+ /** Each feed's events as read, and how many it could not take (`syncWithFeeds`). */
104
+ readonly feeds: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
105
+ readonly calendar_id: v.NumberSchema<undefined>;
106
+ readonly events: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
107
+ readonly skipped: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
108
+ }, undefined>, undefined>, undefined>;
78
109
  }, undefined>;
79
110
  export declare const calendarSyncProgress: v.StrictObjectSchema<{
80
111
  readonly calendar_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
@@ -19,6 +19,10 @@ export const calendar = v.strictObject({
19
19
  synced: v.boolean(),
20
20
  seen_at: nullableTime,
21
21
  });
22
+ /** `calendars add`: the feed's calendar, how many events the feed holds now, and the sync to run next. */
23
+ export const calendarFeed = v.strictObject({ ...calendar.entries, events: count, hint: text });
24
+ /** `calendars remove`: the feed's calendar, no longer synced, and how many stored entries were marked deleted. */
25
+ export const calendarFeedRemoval = v.strictObject({ ...calendar.entries, removed: count });
22
26
  const busyRow = v.strictObject({
23
27
  /** One of the account's calendars, by its id; or `person`, by the address asked. */
24
28
  calendar: v.optional(id),
@@ -68,6 +72,8 @@ export const calendarSync = v.strictObject({
68
72
  hint: v.optional(text),
69
73
  /** What `sync --embed` embedded: `embedEvents`' answer. */
70
74
  embeddings: v.optional(v.strictObject({ model: text, embedded: count, left: v.boolean() })),
75
+ /** Each feed's events as read, and how many it could not take (`syncWithFeeds`). */
76
+ feeds: v.optional(v.array(v.strictObject({ calendar_id: v.number(), events: count, skipped: count }))),
71
77
  });
72
78
  export const calendarSyncProgress = v.strictObject({
73
79
  calendar_id: id,
@@ -237,6 +243,8 @@ const ANSWERS = {
237
243
  "calendars list": { name: "calendar", schema: calendar },
238
244
  "calendars sync": { name: "calendar", schema: calendar },
239
245
  "calendars unsync": { name: "calendar", schema: calendar },
246
+ "calendars add": { name: "calendar_feed", schema: calendarFeed },
247
+ "calendars remove": { name: "calendar_feed_removal", schema: calendarFeedRemoval },
240
248
  "calendars busy": { name: "calendar_busy", schema: calendarBusy },
241
249
  sync: { name: "calendar_sync", schema: calendarSync },
242
250
  "store status": { name: "calendar_sync_progress", schema: calendarSyncProgress },
@@ -1,6 +1,7 @@
1
1
  import { type Command } from "commander";
2
2
  import type { EventStore } from "../../meetings/index.js";
3
3
  import type { AccountKey, MessageStore } from "../../store/store.js";
4
+ import { type CalendarFeeds } from "../feeds.js";
4
5
  import type { CalendarExpander, CalendarSource } from "../source.js";
5
6
  import { type CalendarWrites } from "../writes.js";
6
7
  export interface CalendarCommandDeps {
@@ -27,6 +28,11 @@ export interface CalendarCommandDeps {
27
28
  serverSearch?: boolean;
28
29
  /** For a source with `expands: "local"`. */
29
30
  expand?: CalendarExpander;
31
+ /**
32
+ * The iCalendar feeds the profile follows, as read-only calendars of its account: mounts `calendars add|remove`,
33
+ * and `sync` and `calendars list` read them after the provider. Read only once a profile is open.
34
+ */
35
+ feeds?: CalendarFeeds;
30
36
  /** After `sync --embed`: embeds new events for search by meaning (`embedEvents`), as drive's `sync --embed`. */
31
37
  embed?: (max: number) => Promise<{
32
38
  model: string;
@@ -5,19 +5,21 @@ import { clockMeta } from "@wirecat/cli-base/standards";
5
5
  import { Argument, InvalidArgumentError, Option } from "commander";
6
6
  import { environmentOf, runBudgetOf } from "../../cli/context.js";
7
7
  import { honoursDryRun } from "../../cli/dry-run-guard.js";
8
- import { ownerOnlyOption, writesFileOnlyWith } from "../../cli/effects.js";
8
+ import { changesStore, ownerOnlyOption, writesFileOnlyWith } from "../../cli/effects.js";
9
9
  import { queryTerms, withQuery } from "../../cli/list-query.js";
10
10
  import { terminalAsker } from "../../cli/messenger/ask.js";
11
11
  import { lineOf } from "../../cli/steps.js";
12
+ import { secretInput } from "../../runs/run-context.js";
12
13
  import { searchEvents } from "../../services/events-search.js";
13
14
  import { dateWindow } from "../../services/moment.js";
14
15
  import { linkPeople } from "../../services/people.js";
15
16
  import { BUSY_QUERY, BUSY_QUERY_NOTE, busyAnswer, busyQuery, workingHoursOf } from "../busy.js";
17
+ import { isFeedCalendar, syncWithFeeds } from "../feeds.js";
16
18
  import { eventPreparation, nextMeeting, PREPARE_MESSAGES } from "../prepare.js";
17
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";
18
20
  import { REPEAT_HELP } from "../recurrence.js";
19
21
  import { bothSearchAnswer, serverSearchAnswer } from "../server-search.js";
20
- import { calendarStatus, syncCalendars } from "../sync.js";
22
+ import { calendarStatus } from "../sync.js";
21
23
  import { createEvent, createEventFromText, deleteEvent, EVENT_RESPONSES, IMPORT_MAX, importEvents, moveEvent, respondToEvent, updateEvent, } from "../writes.js";
22
24
  import { CALENDARS_QUERY, declareCalendarAnswers, PEOPLE_QUERY } from "./answers.js";
23
25
  import { addRemind } from "./remind.js";
@@ -28,6 +30,8 @@ const REMOTE_READ = { remote: "read", local: "none" };
28
30
  const LOCAL_OR_REMOTE_READ = { remote: "read", local: "read" };
29
31
  const REMOTE_WRITE = { remote: "write", local: "write" };
30
32
  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 };
31
35
  /** How many pieces one `sync --embed` embeds, as drive's. */
32
36
  const EMBED_MAX = 600;
33
37
  // A list's marker goes on each item: a host's list envelope is strict and `--jsonl` prints only the items.
@@ -95,7 +99,8 @@ const addCalendarCommandsDefinition = (program, deps) => {
95
99
  const calendars = annotate(program.command("calendars").description("the account's calendars"), { effects: GROUP });
96
100
  withQuery(example(annotate(calendars.command("list"), { effects: FETCH, offline: false }).description("list the account's calendars from the provider, and which of them sync"), "calendars list --json", "calendars list synced:true"), CALENDARS_QUERY).action(async (words, _opts, command) => {
97
101
  const terms = [...queryTerms(words, CALENDARS_QUERY, "calendars list")];
98
- const listed = await deps.store.saveCalendars(deps.accountId, await source().calendars(), now());
102
+ const found = [...(await source().calendars()), ...((await deps.feeds?.source.calendars()) ?? [])];
103
+ const listed = await deps.store.saveCalendars(deps.accountId, found, now());
99
104
  const items = listed
100
105
  .map(calendarItem)
101
106
  .filter((item) => terms.every(([field, value]) => String(item[field]) === value));
@@ -112,6 +117,40 @@ const addCalendarCommandsDefinition = (program, deps) => {
112
117
  await deps.store.setCalendarSynced(calendar.id, synced, now());
113
118
  print(calendarItem({ ...calendar, synced }), command);
114
119
  });
120
+ if (deps.feeds) {
121
+ const feeds = () => deps.feeds;
122
+ example(
123
+ // A fetch, but also a new secret and a new address every later sync reads: the read-only lock refuses it.
124
+ changesStore(annotate(calendars.command("add"), { effects: FETCH, offline: false, mcp: false }))
125
+ .description("follow an iCalendar feed, such as a holiday calendar or a published .ics address, as a read-only calendar " +
126
+ "of this profile; sync reads it again each time. The address is kept as a secret and never printed")
127
+ .summary("follow an iCalendar feed as a read-only calendar")
128
+ .addArgument(secretInput(new Argument("<url>", "the feed's https://, http:// or webcal:// address")))
129
+ .option("--title <title>", "the calendar's title; the feed's own name if not given"), "calendars add webcal://example.com/holidays.ics --title Holidays").action(async (url, opts, command) => {
130
+ if (command.optsWithGlobals().offline)
131
+ throw new CliError("permission_error", "calendars add reads the feed; leave out --offline");
132
+ const { calendar, events } = await feeds().add(url, opts.title === undefined ? {} : { title: opts.title });
133
+ const [saved] = await deps.store.saveCalendars(deps.accountId, [calendar], now());
134
+ print({
135
+ ...calendarItem(saved),
136
+ events,
137
+ hint: `run ${lineOf(command, "sync")} to store its events`,
138
+ }, command);
139
+ });
140
+ 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 go")
142
+ .argument("<calendar>", "the feed calendar's id, its ics: id, or its title"), "calendars remove 7").action(async (reference, _opts, command) => {
143
+ const calendar = await calendarIn(deps.store, deps.accountId, reference);
144
+ if (!isFeedCalendar(calendar))
145
+ throw new CliError("validation_error", `calendar ${calendar.id} is not a feed; calendars remove takes only feeds`, {
146
+ reason: "feed.not-a-feed",
147
+ });
148
+ await feeds().remove(calendar.externalId);
149
+ await deps.store.setCalendarSynced(calendar.id, false, now());
150
+ const removed = await deps.store.markUnseen(calendar.id, now() + 1, EVERYWHERE, now());
151
+ print({ ...calendarItem({ ...calendar, synced: false }), removed }, command);
152
+ });
153
+ }
115
154
  if (deps.freeBusy)
116
155
  example(withQuery(annotate(calendars.command("busy"), { effects: REMOTE_READ, offline: false }).description("when calendars and people are taken, asked of the provider and not stored; with --duration-minutes, " +
117
156
  "the free stretches they share"), BUSY_QUERY).addHelpText("after", BUSY_QUERY_NOTE), "calendars busy person:ana@example.com --json", "calendars busy start>=2026-11-02 end<=2026-11-06 person:ana@example.com --duration-minutes 30 " +
@@ -146,7 +185,7 @@ const addCalendarCommandsDefinition = (program, deps) => {
146
185
  if (command.optsWithGlobals().full)
147
186
  throw new CliError("validation_error", "sync starts over with --rescan; --full only widens output");
148
187
  const { signal } = environmentOf(command);
149
- const report = await syncCalendars(source(), deps.store, {
188
+ const report = await syncWithFeeds(source(), deps.feeds, deps.store, {
150
189
  accountId: deps.accountId,
151
190
  now: now(),
152
191
  budget: runBudgetOf(command, opts.maxPages),
@@ -14,7 +14,7 @@ import { CALENDAR_WRITE_DEFAULTS, EVENTS_REMIND_HOOK_KEY } from "../writer.js";
14
14
  const REMIND_MIN_MS = 60_000;
15
15
  const REMIND_MAX_MS = 86_400_000;
16
16
  export const addRemind = (events, writes, { deps, now, zone, print, example }) => {
17
- const remind = example(destroysNothing(annotate(events.command("remind"), { effects: FETCH, mcp: false }))
17
+ const remind = example(destroysNothing(annotate(events.command("remind"), { effects: FETCH, mcp: false, literal_after_dashes: true }))
18
18
  .description("tell once about each event that starts within --due-within: print it, or run your program for it with the " +
19
19
  "event as JSON on its standard input; for cron or a timer every few minutes, syncing first unless --offline")
20
20
  .summary("tell once about each event that starts soon, for a timer to run")
@@ -50,6 +50,7 @@ export const addRemind = (events, writes, { deps, now, zone, print, example }) =
50
50
  if (!opts.dryRun && deps.source && !command.optsWithGlobals().offline) {
51
51
  // A reminder from what the store already holds beats none: a failed sync is said in meta and the run goes on.
52
52
  try {
53
+ // Feeds wait for `sync`: a timer runs this every few minutes, and a feed's server is not Google.
53
54
  const report = await syncCalendars(deps.source, deps.store, {
54
55
  accountId: deps.accountId,
55
56
  now: at,
@@ -0,0 +1,17 @@
1
+ import type { EntryInput } from "../meetings/index.js";
2
+ import type { SyncWindow } from "./source.js";
3
+ /**
4
+ * A wall-clock time in `zone` as epoch ms. A time a clock change skips is read with the offset before the change, so it
5
+ * lands after it, and a repeated one takes its first moment (RFC 5545 §3.3.5): a slot is moved, never dropped.
6
+ */
7
+ export declare const localMoment: (date: string, time: string, zone: string) => number;
8
+ /** Why a series cannot be expanded here, or `null` when it can. */
9
+ export declare const unexpandable: (recurrence: readonly string[] | null | undefined) => string | null;
10
+ /**
11
+ * The slots of a series inside the window, as occurrences: its RRULE, plus RDATE, less EXDATE, which come back
12
+ * `cancelled` so a stored slot is cancelled. Times repeat in the series' own zone, so a weekly 10:00 stays 10:00
13
+ * across a clock change. An override (an iCalendar RECURRENCE-ID) takes the place of the slot it names.
14
+ */
15
+ export declare const expandSeries: (series: EntryInput, window: SyncWindow, overrides?: readonly (EntryInput & {
16
+ originalStartsAt: number;
17
+ })[]) => EntryInput[];