@wirecat/cli-core 0.618.0 → 0.619.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 (274) hide show
  1. package/CHANGELOG.md +339 -1
  2. package/README.md +1 -1
  3. package/THIRD_PARTY_NOTICES +3 -0
  4. package/dist/background/daily-archive-timer.d.ts +1 -1
  5. package/dist/background/deliver.d.ts +5 -2
  6. package/dist/background/deliver.js +30 -12
  7. package/dist/background/report/render.d.ts +3 -1
  8. package/dist/background/report/render.js +3 -1
  9. package/dist/calendar/cli/answers.d.ts +1 -0
  10. package/dist/calendar/cli/answers.js +6 -1
  11. package/dist/calendar/cli/index.js +2 -14
  12. package/dist/calendar/cli/people-link.d.ts +3 -0
  13. package/dist/calendar/cli/people-link.js +23 -0
  14. package/dist/calendar/index.d.ts +1 -1
  15. package/dist/calendar/index.js +1 -1
  16. package/dist/calendar/mcp/index.d.ts +12 -12
  17. package/dist/cli/base-stages-command.d.ts +22 -0
  18. package/dist/cli/base-stages-command.js +174 -0
  19. package/dist/cli/command-runs.d.ts +2 -0
  20. package/dist/cli/command-runs.js +3 -1
  21. package/dist/cli/config-command.js +6 -1
  22. package/dist/cli/context.js +1 -0
  23. package/dist/cli/group-lock.d.ts +42 -0
  24. package/dist/cli/group-lock.js +130 -0
  25. package/dist/cli/index.d.ts +7 -2
  26. package/dist/cli/index.js +7 -2
  27. package/dist/cli/messenger/backfill-command.js +27 -15
  28. package/dist/cli/messenger/contacts-command.js +10 -3
  29. package/dist/cli/messenger/context.js +1 -0
  30. package/dist/cli/messenger/doctor-command.js +3 -1
  31. package/dist/cli/messenger/models-command.js +1 -1
  32. package/dist/cli/messenger/store-maintenance-command.d.ts +22 -2
  33. package/dist/cli/messenger/store-maintenance-command.js +9 -4
  34. package/dist/cli/model-catalogue-command.d.ts +3 -1
  35. package/dist/cli/model-catalogue-command.js +46 -2
  36. package/dist/cli/profile.d.ts +8 -0
  37. package/dist/cli/profile.js +25 -0
  38. package/dist/cli/program.js +2 -0
  39. package/dist/cli/runs/search-query.d.ts +1 -1
  40. package/dist/cli/runs/search-query.js +4 -0
  41. package/dist/cli/runs/search.d.ts +5 -1
  42. package/dist/cli/runs/search.js +12 -1
  43. package/dist/cli/search-left-out.d.ts +6 -1
  44. package/dist/cli/search-left-out.js +9 -4
  45. package/dist/cli/settings.d.ts +8 -0
  46. package/dist/cli/settings.js +17 -2
  47. package/dist/cli/shared-command-exports.d.ts +16 -0
  48. package/dist/cli/store-recover.d.ts +3 -3
  49. package/dist/cli/store-recover.js +26 -26
  50. package/dist/cli/store-settings.d.ts +2 -0
  51. package/dist/cli/store-settings.js +37 -9
  52. package/dist/crm/cli/index.js +38 -6
  53. package/dist/crm/group-hint.d.ts +8 -0
  54. package/dist/crm/group-hint.js +13 -0
  55. package/dist/crm/source.d.ts +12 -1
  56. package/dist/crm/sync.d.ts +31 -2
  57. package/dist/crm/sync.js +110 -3
  58. package/dist/crm/testing/acme-scenario.d.ts +40 -0
  59. package/dist/crm/testing/acme-scenario.js +170 -0
  60. package/dist/crm/testing/index.d.ts +1 -0
  61. package/dist/crm/testing/index.js +1 -0
  62. package/dist/crm/testing/source-contract.js +12 -0
  63. package/dist/crm/testing/source.d.ts +2 -0
  64. package/dist/crm/testing/source.js +1 -0
  65. package/dist/domain/addresses.d.ts +13 -0
  66. package/dist/domain/addresses.js +63 -0
  67. package/dist/domain/categories.d.ts +3 -0
  68. package/dist/domain/categories.js +2 -0
  69. package/dist/domain/crm.d.ts +23 -0
  70. package/dist/domain/crm.js +7 -0
  71. package/dist/domain/mentions.d.ts +2 -12
  72. package/dist/domain/mentions.js +2 -19
  73. package/dist/domain/orders.d.ts +8 -1
  74. package/dist/domain/orders.js +6 -2
  75. package/dist/domain/phones.d.ts +26 -0
  76. package/dist/domain/phones.js +48 -0
  77. package/dist/domain/record-types.d.ts +1 -1
  78. package/dist/domain/record-types.js +1 -0
  79. package/dist/domain/records.d.ts +5 -0
  80. package/dist/domain/ref-summaries.d.ts +39 -0
  81. package/dist/domain/ref-summaries.js +51 -3
  82. package/dist/domain/relations.d.ts +12 -2
  83. package/dist/domain/relations.js +14 -3
  84. package/dist/domain/vcard.d.ts +2 -2
  85. package/dist/domain/vcard.js +4 -10
  86. package/dist/embeddings/models.d.ts +11 -3
  87. package/dist/embeddings/models.js +28 -4
  88. package/dist/entities/business-context.d.ts +149 -0
  89. package/dist/entities/business-context.js +192 -0
  90. package/dist/entities/contact-activity.d.ts +2 -0
  91. package/dist/entities/contact-activity.js +7 -1
  92. package/dist/entities/contact-context.d.ts +157 -0
  93. package/dist/entities/contact-context.js +2 -0
  94. package/dist/entities/deal.d.ts +10 -0
  95. package/dist/entities/deal.js +2 -0
  96. package/dist/entities/index.d.ts +23 -3
  97. package/dist/entities/index.js +5 -0
  98. package/dist/entities/mention.d.ts +4 -3
  99. package/dist/entities/mention.js +2 -1
  100. package/dist/entities/message-transfer.d.ts +4 -2
  101. package/dist/entities/message-transfer.js +2 -2
  102. package/dist/entities/model.d.ts +2 -2
  103. package/dist/entities/model.js +1 -1
  104. package/dist/entities/relationship.d.ts +4 -0
  105. package/dist/entities/relationship.js +4 -0
  106. package/dist/errors/reasons.js +37 -4
  107. package/dist/fetch/page.js +2 -1
  108. package/dist/index.d.ts +3 -2
  109. package/dist/index.js +3 -2
  110. package/dist/meetings/context-store.d.ts +2 -0
  111. package/dist/meetings/findings-rules.d.ts +4 -0
  112. package/dist/meetings/findings-rules.js +5 -2
  113. package/dist/meetings/result-items.d.ts +1 -0
  114. package/dist/meetings/result-items.js +1 -0
  115. package/dist/models/index.js +22 -5
  116. package/dist/runs/events.d.ts +11 -1
  117. package/dist/runs/events.js +3 -1
  118. package/dist/runs/log-attributes.js +4 -0
  119. package/dist/runs/log-events.js +2 -0
  120. package/dist/runs/recording.d.ts +3 -0
  121. package/dist/runs/recording.js +36 -12
  122. package/dist/runs/run.d.ts +12 -3
  123. package/dist/runs/run.js +32 -13
  124. package/dist/search/account-list.d.ts +6 -0
  125. package/dist/search/account-list.js +9 -3
  126. package/dist/search/groups.d.ts +68 -0
  127. package/dist/search/groups.js +172 -0
  128. package/dist/services/account-groups.d.ts +28 -0
  129. package/dist/services/account-groups.js +89 -0
  130. package/dist/services/archive.d.ts +7 -1
  131. package/dist/services/archive.js +19 -3
  132. package/dist/services/business-context.d.ts +113 -0
  133. package/dist/services/business-context.js +156 -0
  134. package/dist/services/communications.d.ts +50 -0
  135. package/dist/services/communications.js +140 -0
  136. package/dist/services/deal-context.d.ts +90 -0
  137. package/dist/services/deal-context.js +131 -0
  138. package/dist/services/deps.d.ts +2 -0
  139. package/dist/services/enrichment.d.ts +7 -2
  140. package/dist/services/enrichment.js +46 -5
  141. package/dist/services/events-search.js +2 -1
  142. package/dist/services/group-guard.d.ts +28 -0
  143. package/dist/services/group-guard.js +131 -0
  144. package/dist/services/index.d.ts +15 -2
  145. package/dist/services/index.js +9 -2
  146. package/dist/services/ingest.d.ts +12 -0
  147. package/dist/services/ingest.js +4 -0
  148. package/dist/services/meaning-model.d.ts +7 -0
  149. package/dist/services/meaning-model.js +20 -0
  150. package/dist/services/meeting-context.d.ts +6 -1
  151. package/dist/services/meeting-context.js +12 -5
  152. package/dist/services/message-resolution.js +2 -3
  153. package/dist/services/messages-meaning.js +4 -5
  154. package/dist/services/messages-search.d.ts +5 -1
  155. package/dist/services/messages-search.js +1 -1
  156. package/dist/services/model-downloads.d.ts +1 -1
  157. package/dist/services/model-downloads.js +6 -4
  158. package/dist/services/money-context.d.ts +73 -0
  159. package/dist/services/money-context.js +77 -0
  160. package/dist/services/notes-search.d.ts +4 -1
  161. package/dist/services/notes-search.js +19 -7
  162. package/dist/services/organization-context.d.ts +80 -0
  163. package/dist/services/organization-context.js +154 -0
  164. package/dist/services/people.d.ts +22 -6
  165. package/dist/services/people.js +38 -8
  166. package/dist/services/person-business.d.ts +43 -0
  167. package/dist/services/person-business.js +67 -0
  168. package/dist/services/person-context.d.ts +9 -1
  169. package/dist/services/person-context.js +5 -3
  170. package/dist/services/proposals/kinds/identity-link.d.ts +4 -0
  171. package/dist/services/proposals/kinds/identity-link.js +48 -0
  172. package/dist/services/proposals/kinds/orders.js +1 -1
  173. package/dist/services/proposals/registry.js +2 -0
  174. package/dist/services/search-kind.d.ts +12 -5
  175. package/dist/services/search-kind.js +49 -10
  176. package/dist/services/text-model-choice.js +1 -1
  177. package/dist/store/accounts.d.ts +18 -0
  178. package/dist/store/accounts.js +18 -3
  179. package/dist/store/damage.d.ts +43 -10
  180. package/dist/store/damage.js +119 -36
  181. package/dist/store/decisions.js +3 -1
  182. package/dist/store/evidence-findings.d.ts +14 -0
  183. package/dist/store/evidence-findings.js +2 -0
  184. package/dist/store/exports.d.ts +2 -1
  185. package/dist/store/identity-links.d.ts +92 -0
  186. package/dist/store/identity-links.js +6 -0
  187. package/dist/store/index.d.ts +11 -5
  188. package/dist/store/index.js +5 -2
  189. package/dist/store/journal.d.ts +10 -0
  190. package/dist/store/journal.js +33 -0
  191. package/dist/store/marks.d.ts +19 -1
  192. package/dist/store/marks.js +23 -1
  193. package/dist/store/people.d.ts +22 -0
  194. package/dist/store/people.js +15 -1
  195. package/dist/store/sqlite/accounts.js +2 -0
  196. package/dist/store/sqlite/base-stages.d.ts +122 -0
  197. package/dist/store/sqlite/base-stages.js +443 -0
  198. package/dist/store/sqlite/base-suggest.d.ts +13 -0
  199. package/dist/store/sqlite/base-suggest.js +62 -0
  200. package/dist/store/sqlite/business-contracts.js +10 -1
  201. package/dist/store/sqlite/crm-settings.d.ts +12 -2
  202. package/dist/store/sqlite/crm-settings.js +56 -13
  203. package/dist/store/sqlite/crm.d.ts +13 -1
  204. package/dist/store/sqlite/crm.js +20 -4
  205. package/dist/store/sqlite/deals.d.ts +33 -0
  206. package/dist/store/sqlite/deals.js +42 -4
  207. package/dist/store/sqlite/decision-requests.js +7 -3
  208. package/dist/store/sqlite/email-index.js +8 -4
  209. package/dist/store/sqlite/evidence-findings.js +29 -5
  210. package/dist/store/sqlite/findings-core.js +4 -2
  211. package/dist/store/sqlite/identity-link-rows.d.ts +50 -0
  212. package/dist/store/sqlite/identity-link-rows.js +146 -0
  213. package/dist/store/sqlite/identity-proposals.d.ts +53 -0
  214. package/dist/store/sqlite/identity-proposals.js +234 -0
  215. package/dist/store/sqlite/knowledge.js +2 -2
  216. package/dist/store/sqlite/link-kinds.d.ts +1 -0
  217. package/dist/store/sqlite/link-kinds.js +1 -0
  218. package/dist/store/sqlite/link-row.d.ts +6 -0
  219. package/dist/store/sqlite/link-row.js +35 -0
  220. package/dist/store/sqlite/link-source.d.ts +10 -0
  221. package/dist/store/sqlite/link-source.js +16 -0
  222. package/dist/store/sqlite/manifest.js +1 -0
  223. package/dist/store/sqlite/meeting-context-links.js +9 -6
  224. package/dist/store/sqlite/memories.js +9 -7
  225. package/dist/store/sqlite/mentions.d.ts +4 -1
  226. package/dist/store/sqlite/mentions.js +14 -9
  227. package/dist/store/sqlite/migrations.generated.js +8 -0
  228. package/dist/store/sqlite/notes.d.ts +1 -2
  229. package/dist/store/sqlite/notes.js +4 -29
  230. package/dist/store/sqlite/open-store.js +3 -0
  231. package/dist/store/sqlite/open.js +11 -2
  232. package/dist/store/sqlite/orders.d.ts +2 -0
  233. package/dist/store/sqlite/orders.js +9 -3
  234. package/dist/store/sqlite/organization-categories.d.ts +18 -0
  235. package/dist/store/sqlite/organization-categories.js +34 -0
  236. package/dist/store/sqlite/organizations.d.ts +5 -1
  237. package/dist/store/sqlite/organizations.js +14 -4
  238. package/dist/store/sqlite/person-links.d.ts +19 -4
  239. package/dist/store/sqlite/person-links.js +49 -11
  240. package/dist/store/sqlite/person-match-scan.d.ts +13 -0
  241. package/dist/store/sqlite/person-match-scan.js +251 -0
  242. package/dist/store/sqlite/person-matcher.d.ts +16 -0
  243. package/dist/store/sqlite/person-matcher.js +32 -0
  244. package/dist/store/sqlite/proposed-actions.js +6 -0
  245. package/dist/store/sqlite/record-matching.d.ts +2 -8
  246. package/dist/store/sqlite/record-matching.js +8 -40
  247. package/dist/store/sqlite/record-projectors-phone.js +2 -1
  248. package/dist/store/sqlite/record-relationships.d.ts +52 -0
  249. package/dist/store/sqlite/record-relationships.js +243 -0
  250. package/dist/store/sqlite/record-run.d.ts +5 -0
  251. package/dist/store/sqlite/record-run.js +62 -2
  252. package/dist/store/sqlite/record-writes.d.ts +1 -1
  253. package/dist/store/sqlite/record-writes.js +4 -2
  254. package/dist/store/sqlite/records.js +27 -2
  255. package/dist/store/sqlite/ref-accounts.d.ts +13 -0
  256. package/dist/store/sqlite/ref-accounts.js +117 -0
  257. package/dist/store/sqlite/ref-summaries.js +5 -1
  258. package/dist/store/sqlite/relation-list.d.ts +4 -1
  259. package/dist/store/sqlite/relation-list.js +18 -2
  260. package/dist/store/sqlite/relation-proposals.d.ts +6 -0
  261. package/dist/store/sqlite/relation-proposals.js +3 -0
  262. package/dist/store/sqlite/relation-roles.js +12 -6
  263. package/dist/store/sqlite/reported-relations.d.ts +11 -1
  264. package/dist/store/sqlite/reported-relations.js +59 -18
  265. package/dist/store/sqlite/schema.d.ts +32 -0
  266. package/dist/store/sqlite/schema.js +3 -0
  267. package/dist/store/sqlite/transaction.js +11 -1
  268. package/dist/store/store.d.ts +3 -0
  269. package/dist/store/store.js +5 -0
  270. package/dist/store/write-events.d.ts +18 -0
  271. package/dist/store/write-events.js +88 -0
  272. package/package.json +3 -3
  273. package/parity.json +11 -4
  274. package/schemas/records-envelope.v1.schema.json +3 -0
package/CHANGELOG.md CHANGED
@@ -5,7 +5,323 @@ Notable changes to `@wirecat/cli-core` (`@wirecat/cli-messaging` up to 0.261.0,
5
5
  minor version may break callers, and says how under "Changed — may break callers". `pnpm docs:check` checks the
6
6
  shape of this file.
7
7
 
8
- ## Unreleased
8
+ ## 0.619.0 — 09.11.2026
9
+
10
+ ### Added
11
+
12
+ - **`models keys set|remove <provider>` beside `models consents`** (with `modelCatalogueCommand({ enrichment: true })`):
13
+ the key write-time enrichment sends, kept in the tool's keyring entry `embeddings:<provider>` (a 0600 file when no
14
+ keyring is reachable). `set` reads it at a hidden prompt or from stdin, never as an argument, and answers
15
+ `{ provider, stored: true, source: "keyring" | "file" }`; `remove` answers `{ provider, removed, from }`. A run with
16
+ moved folders writes and removes its own temporary entry, never the shared one. `modelCatalogueCommand` takes
17
+ `stdin` for tests.
18
+ - **`reason_id` on a stopped or failed enrichment run**, from `ENRICHMENT_REASON_IDS`: `enrichment.no-key`,
19
+ `key-rejected`, `unreachable`, `rate-limited`, `bad-replies`, `cancelled`, `error`. The model gateway tags a refused
20
+ key (`model.key-rejected`, HTTP 401 or 403) and a provider it cannot reach (`model.unreachable`) in the error's
21
+ `reason`; the code and the message stay the same.
22
+
23
+ - **A report or message (the digest, the weekly gaps, a failed schedule's notice) goes to an email route as
24
+ HTML.** The `email` template's rendering is sent on stdin with `mail <profile> messages send --html` and the title
25
+ as the subject; mail-cli 0.21.0 adds the plain-text part. A mail-cli older than 0.21.0 refuses the flag, and the
26
+ message then goes as the `text` rendering, as before, with `delivery.html-fallback` in `last.json`. A report that
27
+ failed its check still mails its one line as text.
28
+ - **`identity_link` proposals: "these two are one person", which only the owner decides.** `people.proposeLink` opens
29
+ one, at most one open per pair of people, and refuses a pair the owner separated (`identity.separated`) or rejected
30
+ before (`identity.rejected`). `people.decideLink` and the proposal registry decide it: an agent is refused whatever
31
+ `agent_decisions` says (`proposal.owner-only`), and a confirm after the owner took an identity off either person is
32
+ refused with `identity.stale`. A merge keeps open proposals up to date: one whose two people became one, or a second
33
+ for the same pair, is deleted, and a live one takes the people and identities it names now. The generic
34
+ `proposedActions` paths refuse to stage or approve the kind. `people.linkProposals({ person, status, limit, offset
35
+ })` reads them, newest first, naming the people as they are now, with `hasMore`.
36
+ - **`people.scanMatches({ full })`, one pass of the people matcher.** The same email address joins people in every
37
+ scope. A phone number two people share joins them when a messenger (telegram, max, whatsapp) holds it and no
38
+ proposal ever named the pair, and otherwise opens an `identity_link` proposal; so do three to six people on one
39
+ number or one address, and a meeting guest's typed address. More than six is a shared line or mailbox and proposes
40
+ no one. It never acts over the owner's separation or rejection and records its merges as the rule's. It reads
41
+ outside any transaction and takes the write lock only per group; after the first pass it looks only at identities
42
+ changed since the last one, unless `full`. On 51,000 identities and 1,100 proposals a first pass takes 1.3–3.7 s and
43
+ a repeat 0.15–0.6 s, where a repeat took 20 s in one transaction before.
44
+ - **Quoted evidence and owner-only batches in evidence findings.** A finding's evidence may carry `quote`: staging
45
+ refuses it unless the words are in the cited text (`finding.quote-not-found`), and an accepted fact or task keeps
46
+ the quote on its evidence link. `evidenceFindings.stage(input, agent, { ownerOnly: true })` stages a batch only the
47
+ owner decides, even with `agent_decisions` on, and the batch says `ownerOnly`. `evidenceFindings.citable(ref)` reads
48
+ a record with the fingerprint to cite it, and `./store` exports `quoteKept`, the quote check itself. Findings without
49
+ a quote keep their fingerprints.
50
+ - **`relations.syncReported` takes `onOutcome`**, called once per relationship with `{ outcome, key, id }`: `added`,
51
+ `kept`, `restored`, `withdrawn`, `proposed` or `skipped`, the relationship's key (`kind|from|to|role`) and the link
52
+ that answers for it (`null` when proposed or skipped). An import that reports in parts counts each one once per run.
53
+ - **A relationship answers `sourceRoles`**: the source's own words for it off the role list
54
+ (`metadata.source_role`). The CRM sync stores them as a list. An older row that holds one word still reads as a list.
55
+ - **Person, organization and deal contexts with their business relationships.** `canonicalPersonContext` answers
56
+ for any `person:<uid>` — a CRM contact, a name with no identity, someone two accounts saw — reading every account
57
+ in scope, with a `business` section (organizations, reporting lines both ways, deals and leads, projects,
58
+ categories) and `coverage`. `organizationContext` gives an organization's people, customers, suppliers, partners,
59
+ projects, open deals, invoices, payments and orders, counts of messages, mail and meetings through its people, and
60
+ open tasks. `dealContext` gives a deal's or lead's stages, client, participants, owner, project, money reached by
61
+ project or counterparty, and its people's messages, mail and meetings in its lifetime marked `proposed`;
62
+ `dealBrief` is its compact form. Every relationship says its standing, every section is bounded, and the shared
63
+ entities `person_context`, `organization_context`, `deal_context` and `deal_context.brief` describe them.
64
+ `organizationsInCategory` lists clients, suppliers, partners or employers, derived from relationships.
65
+ `@wirecat/cli-core/crm/testing` exports `acmeScenario`, a synthetic store for these. See
66
+ `docs/dev/BUSINESS-CONTEXT.md`.
67
+ - **Stage history, a CRM deal's project, own organizations, orders by supplier, organizations by category.**
68
+ `deals.stages(ref)` lists every stage a deal or lead entered; `deals.setProject(ref, { project, by })` sets its
69
+ project, on a CRM copy too: the project is the store's own field, which the CRM sync never writes.
70
+ `knowledge.ownOrganizations()` lists the owner's companies, his own mark first, else the CRM's;
71
+ `orders.list({ supplier })`; `deals.list({ accounts })` (copies from those CRM accounts, the owner's own always);
72
+ `knowledge.organizations(query, { category, accounts })` keeps one category's, chosen
73
+ in SQL. A context's `coverage` names each CRM account's sync gaps (`crmGapsOf`) and each kind the profile denies
74
+ (`deniedKinds`: no deal or lead row, title or count is answered). A relationship (`knowledge.relations`) answers
75
+ the `account` that reported it and how a source `derived` it.
76
+ - **Account groups for memo's group word (WC-ACCT-13).** The default group is `all`: every account, never saved, so
77
+ a run with no group reads everything, as before. A group the owner saves (`account_groups.<name>`) is exactly its
78
+ list, `personal` like any other, and a group never saved does not exist. Groups and the lock are opt-in narrowing
79
+ for agents; the default still reads everything. `search notes` in a group reads memo's own notes beside the group's
80
+ folders, since they are the owner's.
81
+ - **`runGroup` and `scopeToGroup`.** memo lifts the first word with `liftProfile`, as every CLI does. `runGroup` takes
82
+ it, or `<PREFIX>_GROUP`; `all` means no restriction, and a word that is no group name is `validation_error`. Under
83
+ `<PREFIX>_GROUP_LOCK` it refuses any other group, `all` included, with `permission_error`; a lock of `all` locks
84
+ nothing. `scopeToGroup` turns a run's `--source` into the group: none becomes `group:<name>`, a bare provider or
85
+ kind keeps the group's accounts of it, and `all` anywhere in the list, an account outside the group or a write's
86
+ `--account` outside it is refused (`validation_error`, or `permission_error` under the lock), naming the entry as
87
+ typed. An empty group fails as `group <name> is empty`; an unknown one is `validation_error` with
88
+ `details.groups`, and `details.suggested` when profiles carry its name. From `@wirecat/cli-core/cli` and
89
+ `@wirecat/cli-core/services`; memo wires them in its own release.
90
+ - **Under `<PREFIX>_GROUP_LOCK` a run refuses what does not keep to the group (`permission_error`).** A command
91
+ runs only when it, or a command above it, is marked `groupAware(command)` (`@wirecat/cli-core/cli`); `help`,
92
+ `commands` and the other words that read no account still run. Every reference typed into the run, in an argument
93
+ or an option value (`msg:`, `chat:`, `deal:`, `person:`, `event:`, …), is checked by
94
+ `refuseOutsideGroup(command, { app, env, store? })`: account data that belongs only to accounts outside the group
95
+ is refused, such as a message, a chat, mail, a calendar event, a CRM row, or a person seen only by outside
96
+ accounts. What the owner made, with no account (memo's notes, projects, tasks, invoices, owner deals and
97
+ organizations, memories, facts), passes in every group. A bare id counts too, as `<kind>:<id>`, where the command
98
+ says its kind: `refKinds(command, { id: "organization", "--note": "note" })`, or an argument or `--<kind>` option
99
+ named after a kind (`<organization>`, `--project`). A command that declares no kinds has any other argument value
100
+ refused; `refKinds(command, {})` lets free text through. `store.refs.accounts(ref)` says which accounts a
101
+ reference's thing belongs to (`[]` for the owner's own); an event is its calendars' and meetings' accounts, a
102
+ folder's file is its folder (`notes:<id>`). `inGroupOf(context, group)` (services) is the membership test.
103
+ Group edits are refused under the lock, and `listAccountGroups` lists only the locked group.
104
+ - **What a locked run shows of proposals and evidence: `groupGuardOf(store, app, env)` and `lockedRegistry`**
105
+ (services). The guard says whether a reference is `visible` in the locked group (every part of its thing: a
106
+ proposed action is its own account and its target's, a suggested link its two ends), `keep`s the visible references
107
+ of a list and `strip`s outside ones from every `evidence` and `sources` array of an answer, counting them as
108
+ `out_of_scope`; a memory's or fact's own text stays. `lockedRegistry` wraps the proposal registry so a proposal whose
109
+ subject, object or action is outside the group is not listed, shown or decided (`permission_error`), and shown ones
110
+ keep only the group's evidence. `refKinds` takes `action` (`actions confirm 17`) and `proposal` (`review confirm
111
+ 17070,link:17,fact:512`), and `store.refs.ends(ref)` gives each part. A key-document suggestion (`key:9`) is its
112
+ link's two ends, so a Drive or mail document of an outside account is refused; a close suggestion (`close:Q-15`) is
113
+ its task's, the owner's, with its evidence stripped; any other proposal prefix is refused. Under the lock `listContextOf` holds only the
114
+ group's accounts, notes folders included.
115
+ - **Under `<PREFIX>_GROUP_LOCK`, `listContextOf` holds only the group's accounts**, so every `--source` reader fails
116
+ closed: a list, a bare provider or `all` resolves inside the group, and `search messages`, `search mail` and
117
+ `search notes` without `--source` read the group. A lock naming no saved group is `permission_error`. The lock is
118
+ read from the run's `env` only, never `process.env`: `groupLockOf(app, env)`, `listContextOf(…, env)`,
119
+ `listedAccounts(…, env)`, `env` on `prepareLucene`/`searchLucene`'s messenger, on `searchNotesOf` and on a
120
+ `GroupStore`. A caller that passes no `env` reads without a lock.
121
+ - **Group membership for a settings page: `listAccountGroups`, `addGroupMember`, `removeGroupMember`,
122
+ `moveGroupMember`** (services), over `store.accounts.changeAccountGroups`. The list gives each saved group, then
123
+ `all` with every account (reason `all`), each member with every saved entry that names it, its profile names in
124
+ every app, its reason (`setting`) and `also_in`, plus `duplicates` (allowed, shown) and `suggested`: a profile name
125
+ that another app's profile or a saved group shares, for an account not in that group; never applied. A member is
126
+ saved as `provider:account`, so renaming a profile changes nothing. memo's own notes (`notes:internal`) and an
127
+ unsaved running account are listed in no group. A remove takes out every entry that names only that account, and
128
+ refuses one that names others too; a move does that and the add in one write, deciding which entries go inside it;
129
+ a move from `all` is an add. `all`, `bots` and the caller's `reserved` words cannot name a group, and `config set
130
+ account_groups.all` and `.bots` are refused.
131
+ - **`deniedKindsOf(permissions, kinds, by, defaults?)`** (`@wirecat/cli-core/cli`, with `deniedKinds`): the kinds
132
+ `search all` leaves out under a CLI's own permission levels, such as memo's, without messenger profile settings.
133
+ - **The first CRM sync of an account no saved group lists answers `group_hint`**: ``add it to a work group:
134
+ `memo groups add work <provider>:<account>` `` (memo's command ships with it). Not when a saved group lists the
135
+ account, and not on later syncs. `hint` still carries "run sync again to continue".
136
+ - **A CRM sync copies only the owner's deals and leads by default.** The account setting
137
+ `crm.<provider>:<account>.scope` is `mine` (the default) or `all`; `crm.<provider>:<account>.unassigned` lists the
138
+ CRM's numeric user ids whose deals and leads count as nobody's, which `mine` also keeps, as it keeps those with no
139
+ assignee. Both are set with `settings set`, which refuses a malformed `unassigned` entry by name. Contacts and
140
+ companies are copied whole as before. A source opts in with `self()`, its sign-in's own user; the engine applies
141
+ the scope to every page (`CrmScope`: `{ mode: "all" }` or `{ mode: "mine", self, also }`, ids normalised by
142
+ `normalCrmUserId`), so a deal given to another user leaves the copy at the next sync. A narrower scope is applied in
143
+ the store by each row's assignee, with no list from the CRM; a wider one lists deals and leads in full again. The
144
+ sync answer carries `scope` and each kind's `out_of_scope`; a kind that failed on a setting names it (`setting`)
145
+ and the answer offers no retry.
146
+ - **`store status` says each deal and lead kind's scope without a sync**: `scope.setting` is the saved
147
+ `crm.<provider>:<account>.scope` (`mine` when never set; `scope.explicit` says whether the owner stored it), and
148
+ `scope.applied` the scope new pages are read under, `{ mode: "all" }` or `{ mode: "mine", users }` (the own user
149
+ and the unassigned ones), `null` before the first sync. `scope.held: true` while a held narrowing keeps stored rows
150
+ outside it. `applied` is `all` under `mine` when the CRM's CLI names no own user (`self()`): its sync copies
151
+ everything.
152
+ - **A default `mine` that would mark most of a kind deleted is held** (`crm.narrowing-held`, naming the own user and
153
+ the count, and `held: true` on the kind) until the owner sets the `scope` setting; `--rescan` does not lift it.
154
+ While held, new pages are read under `mine` and the stored rows are kept; a later `scope all` lists every deal
155
+ and lead again. `config set` of a CRM account's `scope`, `self` or `unassigned` stops an agent's run
156
+ (`permission_error`), a guard against a change by mistake rather than a boundary. `self()` must answer a numeric user id
157
+ (`invalid_response` otherwise), and `crmSourceContract` checks that such a source gives every deal and lead an
158
+ assignee.
159
+ - **One account's copy belongs to one CRM user.** The first sync of a source with `self()` stores it as
160
+ `crm.<provider>:<account>.self`; a sync signed in as another user is refused (`validation_error`, the setting in
161
+ `details.setting`) until the owner unsets it.
162
+ - **`writesWithOf(account, profilesFor)` and `storedProfilesFor(profiles)`** (`./cli`): which CLI and profile change a
163
+ CRM copy on its server, so memo's `deals list`, `leads list` and `pipelines list` can name the writer of each row as
164
+ `writes_with: { tool, account, profile, profiles, why }`. `tool` is the command that registered the row's provider;
165
+ `profile` is set only when exactly one of that CLI's profiles is recorded on the row's account, otherwise it is
166
+ `null` and `profiles` and `why` say what there is to choose. The owner's own row answers `null`. The profiles come
167
+ from the store's record, which every run of a CLI saves, so a profile appears once it has run with that account.
168
+ `profilesOn(profiles, app, key)` is the filter both use.
169
+ `writesWithOf(…, { allowed })` takes the caller's profile or group lock: a profile it forbids is never named, and
170
+ the one it leaves is the answer. A write already refuses a row of another account than its profile's live one
171
+ (`not_found`), so a profile re-pointed to another portal cannot change the old portal's rows.
172
+ - **Base stages of deals and of leads, and CRM stages mapped onto them (store version 60).** One editable base set
173
+ per kind; every other pipeline's stage, a CRM's or the owner's own, maps onto one of its stages, suggested by the store and confirmed by the owner, one by one
174
+ or all at once. Store version 60 adds `pipeline_stages.base_stage_id` and `base_confirmed` (columns only;
175
+ `minCompatible` stays 56). `baseStagesCommand(app, { open, output, accounts })` from `./cli` builds the `stages`
176
+ group for memo: `show <kind>` (the columns, with open rows and mapped CRM stages each, and `unsorted`), `create`,
177
+ `rename`, `move` and `remove` of a base stage, `list` (every stage outside the base sets with `base_stage`, `confirmed` and the CRM's own `external_id`, which a CRM CLI's move matches first; `account` and `external_id` `null` for an own pipeline; query
178
+ `kind:`, `pipeline:`, `confirmed:`), `set <stage> <base-stage>` and `confirm --pipeline <p> | --all`. `accounts`
179
+ narrows reads and confirms to the CRM accounts a run may see, such as a group lock's. Deal and lead rows gain
180
+ `base_stage {ref, name}`, `null` until confirmed. A new set is named in the owner's first language (Russian while
181
+ `owner_languages` is unset, Spanish, else English); the seeded `Leads` becomes the lead set with capitalised names. An
182
+ agent's `stages set` records a suggestion; `confirm` and the set's edits refuse an agent (`stage.owner-only`). On a
183
+ read-only store `stages show` reads the set its first use would make without writing it. A CRM CLI's `deals move <ref> stage:<id>` (and `leads move`) moves
184
+ to the one stage of the card's pipeline mapped to that base stage, and refuses several (`stage.choice-required`,
185
+ with `candidates`) or none (`stage.unmapped`) before anything is written. `store.baseStages` holds the same
186
+ operations.
187
+ - **The events list's query, from `@wirecat/cli-core/calendar`.** `EVENT_TYPES`, `EVENTS_QUERY`,
188
+ `EVENTS_QUERY_NOTE`, `eventsFilter` (with `accountIds` for several accounts), `eventsAnswer`, `eventOf`,
189
+ `eventAnswer`, `sourceAccounts` and the `ReadAccount` type, so a tool that lists the events of several calendar
190
+ accounts reads the same query and answer as `events list` instead of copying them.
191
+ - **A records import reports its relationships as links of its account.** A deal's or lead's people, a contract's
192
+ parties, a person's `member-of` and an organization's `customer-of` and `partner-of` go through
193
+ `relations.syncReported` per chunk, so a re-import keeps them, a changed role adds a link and withdraws the old one,
194
+ a delete withdraws them, `records map` moves them with the entity, and rejecting a proposed contract withdraws its
195
+ parties at once. A role comes only from its list: any other word is kept on a link without a role, in the list
196
+ `metadata.source_role`, and named in the receipt's new `notices` (`relationship.role-unlisted`). A person's
197
+ `fields.position` is `metadata.position`, never the role. The receipt adds `relationships` (`added`, `kept`,
198
+ `restored`, `withdrawn`, `proposed`, `skippedOwnerRejected`), each link counted once per run, and a relationship's
199
+ issue is an error coded `relationship.*`, naming its `record` when that record came in an earlier batch. The
200
+ links' `source` is `import:<provider>`, so an import and a CRM sync on the same account keep each other's.
201
+ - **A contract may be related to a person or an organization,** with the roles `customer`, `supplier`, `signatory`
202
+ and `guarantor` (`CONTRACT_ROLES`), a `contract` list the owner may add to like the others.
203
+ - **One damage report for every surface (`storeDamageReport`).** `store recover` prints what happened, the likely
204
+ causes each with the one command that tells more, the impact, that the services keep the originals, the last known
205
+ good and what may be lost, and the steps as `{command, why, destructive}`: the first stops the writers, the last is
206
+ the deep check. `--json` answers it as `report`, and `next` lists the steps' commands.
207
+ - **A deleted or replaced journal file is seen.** A writable open notes a `-shm` without its `-wal`, and the outermost
208
+ commit refuses (`store.journal-replaced`) once the `-wal` it opened with is gone or is another file, since writing
209
+ on into an unlinked journal while another process starts a fresh one damages the store. Both leave
210
+ `<store>.journal.json`, which the report names as the first likely cause and a deep check that passes removes.
211
+ - **Runs say what they wrote to the store.** Each outermost write transaction that commits logs one `store.write`
212
+ event per table and change, `{kind: "store", table, op, n}`: counts only, read from the statement text and SQLite's
213
+ change count, so every writer is covered and no CLI passes anything. A success that wrote the store is kept for
214
+ `keep_store_runs_for_days` (default 3) even where `record: false`, Desktop or a server would not keep it
215
+ (`kept_because_store`). Past 100 in a run, they are summed by table and change into one event each at its end; the
216
+ run lists its `tables`. `search runs kind:store table:emails` finds them.
217
+
218
+ ### Changed — may break callers
219
+
220
+ - **An enrichment run that sent records and got none back enriched is `failed`**, with a reason, not `done`. A run
221
+ with some enriched stays `done` or `stopped`; one that sent nothing (no key) stays `stopped`. The no-key reason names
222
+ `models keys set <provider>`.
223
+
224
+ - **EmbeddingGemma is the default text model**, not e5-small (`DEFAULT_TEXT_MODEL`). With no `models set`, embeds
225
+ and searches by meaning use it; e5-small and e5-large stay choosable. A machine that has e5-small and not
226
+ EmbeddingGemma keeps e5-small (`PREVIOUS_DEFAULT_TEXT_MODEL`). Once EmbeddingGemma is downloaded, syncs embed with
227
+ it, and search by meaning in notes, mail, messages and events keeps reading e5-small's vectors while the store holds
228
+ more of them (`meaningModel`); about 20 minutes of embedding for 10,000 pieces, a part per sync. A caller that
229
+ expected e5-small without choosing it sees `embeddinggemma` in missing-model steps.
230
+ - **`models download` no longer asks to accept EmbeddingGemma's terms.** The Gemma Terms of Use ask for a notice with
231
+ each copy: the download writes `NOTICE` beside the model's files, and `THIRD_PARTY_NOTICES` names it.
232
+ `--accept-terms` is ignored; `models list --json` keeps `licence` and `terms`.
233
+
234
+ - **`contacts link` and a calendar's `people link` from an agent's terminal open an `identity_link` proposal instead
235
+ of linking, and an agent's `contacts unlink` is refused (`identity.owner-only`).** The run is attributed as
236
+ `mentions confirm` attributes it (`actorOf`: `AI_AGENT`, `CLAUDECODE` and the other agents' variables, or an MCP
237
+ server's run). An agent's link needs `--reason` (`proposal.reason-required`), answers with the person unchanged and
238
+ the proposal's id in the new `proposal` field of `linked_person` and `calendar_linked_person`, and an agent's
239
+ `<person> me` is refused (`identity.owner-only`). The owner's run links and unlinks at once, as before; no flag makes
240
+ an agent's run the owner's. `linkPeople(store, account, person, other, { by, reason?, method? })`,
241
+ `PeopleService.link` and `PeopleService.unlink(person, { by })` take who runs it, with no default: pass
242
+ `actorOf(command)`, or `"owner"` only from a path that established the owner runs it.
243
+ - **The meeting context service writes an agent's `memory.add` and `fact.add` as proposals.** It stored both as the
244
+ owner's, the memory confirmed and the fact accepted, whoever ran it. With `author: "agent"`, or no `author`, the
245
+ memory waits as `proposed` and the fact as `proposed`, as the memory and fact stores keep every agent's; pass
246
+ `author: "owner"` when the owner runs the command.
247
+ - **An agent's mention confirm or meeting participant association no longer moves an identity.** Unless `by` is
248
+ `"owner"`, `confirmMention` to a person and `linkParticipantPerson` open an `identity_link` proposal and return its
249
+ id as `proposal`, so an owner's link is never replaced. Such a mention has the new status `proposed` (in
250
+ `MENTION_STATUSES`, `status:` and the `mention_decision` answer) until the owner decides: `linked` on confirm,
251
+ `found` again on reject. The association's `changed` is `false` and its `person_uid` the participant's current
252
+ person.
253
+ - **`createMeetingContextService(store, account, { author })` takes who runs it: `"owner"` or `"agent"`.** It linked
254
+ every participant as the owner's; an agent's `person.link` now opens a proposal. Left out, `author` is `"agent"`, so
255
+ a caller that does not say who runs it no longer moves an identity as the owner: pass `"owner"` when the owner runs
256
+ the command (`actorOf`).
257
+ - **`mergePerson` keeps the owner's person whichever side it is on, and gives the person that stays.**
258
+ `linkIdentities`, the same-address join at import, a confirmed proposal and the scan could each move every identity
259
+ of the owner onto a contact; the owner's uid now always stays.
260
+ - **One email address pattern: a local part, `@` and a dotted domain (`isEmailAddress`).** The same-address join at
261
+ import took an address with no dot in its domain; it no longer does.
262
+ - **At import, an address two or more other people have joins no one, and neither does a pair the owner rejected.**
263
+ The whole batch of `savePeople` is noted before any join, so one `office@` on many contacts stays shared; the scan
264
+ proposes those people instead.
265
+ - `DealsStore` gains `stages` and `setProject`, and `OrganizationsStore` (so `KnowledgeStore`) gains
266
+ `ownOrganizations`: a hand-written store or fake implementing them must add these.
267
+ - **`listContextOf` returns a `GroupContext`**, a `ListContext` with `membership`, and `group:all` names every
268
+ account in a `--source` list.
269
+ - **The sync of an account whose source names its own user narrows to `mine` on its first run after the upgrade**,
270
+ unless that would mark more than half of a kind deleted (then it is held until the owner sets the scope):
271
+ other users' deals and leads are marked deleted in the local copy. They leave lists and search, but their earlier
272
+ copy stays in the store file. `settings set crm.<provider>:<account>.scope all` brings them back.
273
+ - **An id list that is empty is held whatever the copy's size**: a small copy is no longer emptied by it without
274
+ `--rescan`.
275
+ - **`CrmCopies.scope`, `ownUser`, `saveOwnUser` and `removeOutOfScope` are new required members**, and
276
+ `CrmSyncReport.scope` and `CrmSyncResult.outOfScope` are new required fields: a hand-made store object or a strict
277
+ reader of the answer needs them.
278
+ - **Only `bin/release` edits `CHANGELOG.md`.** The `standards` check fails a pull request that changes it unless its
279
+ branch is one of bin/release's `release/*` branches, so a release pull request can no longer conflict and stall
280
+ `bin/release`. Move an entry to `changes/<branch>.md` (lower case, `/` as `-`) under the changelog's `###` headings
281
+ ([CLAUDE.md, "Committing"](CLAUDE.md#committing)).
282
+ - **`explainDamage` is now `storeDamageReport(findings)`**, with the shape above; `store recover --json` answers
283
+ `report` instead of `explanation`, and `doctor`'s `store.damage` takes the same shape, keeping `what` beside it
284
+ for now.
285
+ - **A pair of people the owner rejected is proposed again on new evidence.** It is still never joined
286
+ automatically, and the evidence the owner rejected never proposes it again. New evidence is a signal and pair of
287
+ identities none of its rejected proposals had: a phone-based proposal rejected, and later the same email on both
288
+ people, opens a fresh `identity_link` proposal from `scanMatches`, from `savePeople`'s same-address join, or from
289
+ `proposeLink`. Rejecting that one adds its evidence to the rejected set. A pair the owner separated stays blocked.
290
+ `identity.rejected` now means "rejected on this evidence".
291
+ - **A role address (`info@`, `hello@`, `support@`…) never joins people automatically**, at import or in a scan, even
292
+ when only two people have it: `scanMatches` proposes the pair instead, so results move from `merged` to `proposed`.
293
+ A no-reply address (`noreply@`, `mailer-daemon@`, `bounces@`…) neither joins nor proposes anyone. The whole local
294
+ part must be a role word, any case, past a `+tag` and `.`, `-` or `_`. `ROLE_ADDRESS_WORDS`, `isRoleAddress` and
295
+ `isNoReplyAddress` are exported from `@wirecat/cli-core`.
296
+ - **`messages sync --all` leaves out muted chats.** A chat the messenger reports muted (`muted`, with no
297
+ `mutedUntil` or one still ahead) is not read, so a sync of an account with many muted groups no longer downloads
298
+ them all. The answer counts them in `limited.muted` and leaves them out of `chats`, `items` and the progress total;
299
+ a note says how to read them. Messages already stored stay. A chat named (`messages sync <chat>`) is read as
300
+ before, and one kept in full with `--full-history` is read by `--all` too. To read them again, pass the new
301
+ `--with-muted` to `messages sync --all` for one run (a background job keeps it), or set the new profile setting
302
+ `history_muted` to true.
303
+
304
+ ### Fixed
305
+
306
+ - **A mail's vector names its sender at the end, not first.** Every mail piece began "Name: Subject", so search by
307
+ meaning took the sender for the topic of each email they wrote; the piece now ends "From: Name". Every store cuts its
308
+ mail again once (`mail_pieces_cut`), and the next syncs re-embed it: about 3 minutes for 10,000 mail pieces with
309
+ e5-small and about 20 with EmbeddingGemma on an 8-thread laptop.
310
+ - **EmbeddingGemma's catalogued speed is 5 chunks a second, not 2.** A memo sync bounds its chunks by this speed, so
311
+ one sync embedded 39 chunks and a five-minute timer run did seconds of work; it now takes 97.
312
+ - **A relationship the owner confirmed counts as `kept` when a source reports it again.** It counted nowhere.
313
+ - **A reported relationship no longer duplicates the owner's link for the role its source named.** When the owner
314
+ confirmed or overrode a no-role link whose `metadata.source_role` (one word or a list) holds a role, and a source
315
+ later reports that role on the same pair, `relations.syncReported` adds no second link: the owner's stays the answer.
316
+ - **`relations.syncReported` withdraws only the links its own writer wrote**: those whose `links.source` is the
317
+ call's `source`. A CRM sync (`crm`) and an import on one account no longer withdraw each other's links.
318
+ - **A role only withdrawn links hold can be removed.** `knowledge.removeRole` no longer counts them as uses.
319
+ - **A link `relations.syncReported` writes carries the caller's author** (`by.kind`), not always `rule`, and a link
320
+ it still reports unchanged is not written again, so a sync no longer queues its people for involvement every page.
321
+ - **Pruning old decision requests works on Node 22.16.** The query bound a numbered `?1`, which Node 22.16's
322
+ `node:sqlite` rejects with "column index out of range". The old-Node CI job now runs a prune.
323
+ - **Under `<PREFIX>_READ_ONLY`, a first run writes no starter `config.json`.** The settings are read as the defaults
324
+ instead, as for a dry run. Without the lock, the file is still written on a first run.
9
325
 
10
326
  ## 0.618.0 — 09.11.2026
11
327
 
@@ -173,6 +489,28 @@ shape of this file.
173
489
  - **`account remove` is in the messenger parity manifest** (`parity.json`), with `--keep-data`, `--delete-data`
174
490
  and `--dry-run`, so tg, max and wa can adopt it without failing `parity:check`.
175
491
 
492
+ ### Fixed
493
+
494
+ - **A proposal whose sources the owner verified no longer blocks confirming another correction.** Confirming a
495
+ correction refused with `memory.already-superseded` when a rival correction of the same memory was still proposed but
496
+ the owner had confirmed its source review, since that sets `lastVerifiedAt`. A rival now counts as having retired the
497
+ memory once it left `proposed`, so one confirmed and later marked stale or corrected still refuses a queued
498
+ proposal. Confirming a correction of a memory that is already superseded is the owner's alone.
499
+
500
+ ### Fixed
501
+
502
+ - **A vCard's phone region is read in either case.** `envelopeOfVcard` and `ingestVcard` with `region: "GB"` left a
503
+ national number unmatched, as only `gb` worked; they now lowercase it as the envelope's `options.phone_region` does.
504
+ - **A sale's title names its customer.** An order with `direction: "sale"` was titled by its supplier, the owner
505
+ (`Order O-55 · owner, …`); its title and ref summary now read `Order O-55 · to <customer>, …`, and its review row's
506
+ `object` is the customer. A purchase still names its supplier.
507
+
508
+ ### Fixed
509
+
510
+ - **A private Google document's refusal names the drive command that adds it.** `source.needs-sign-in` now says
511
+ `drive documents add <url> --profiles <names|all>` instead of only "through Drive". The reason and its code are
512
+ unchanged.
513
+
176
514
  ## 0.614.0 — 08.11.2026
177
515
 
178
516
  ### Added
package/README.md CHANGED
@@ -132,7 +132,7 @@ code and its document must agree. A search plan that reads an index once per mes
132
132
  seven more find candidates, labelled as candidates.
133
133
  - **Search by meaning, opt in.** Conversations are split into chunks and embedded locally by ONNX Runtime — native
134
134
  on Linux (glibc), Apple-silicon Macs and Windows once `models download` has fetched it, WebAssembly elsewhere, on
135
- Node and Bun alike — e5-small by default, or any OpenAI-compatible API with your own key, after
135
+ Node and Bun alike — EmbeddingGemma by default (e5-small to choose), or any OpenAI-compatible API with your own key, after
136
136
  you see the cost. Results by meaning and by words are merged by reciprocal rank fusion.
137
137
  - **The archive and the server together.** `--backend both` also asks the messenger's own search; its hits are saved
138
138
  and filtered by the same query, so nothing is counted twice. `--thread` brings the reply thread around a hit.
@@ -799,3 +799,6 @@ dealings in these Data Files or Software without prior written
799
799
  authorization of the copyright holder.
800
800
 
801
801
  SPDX-License-Identifier: Unicode-3.0
802
+
803
+ EmbeddingGemma (Google) is used under the Gemma Terms of Use, https://ai.google.dev/gemma/terms, including its use
804
+ restrictions (https://ai.google.dev/gemma/prohibited_use_policy).
@@ -24,12 +24,12 @@ export interface DailyArchiveTimerInput {
24
24
  }
25
25
  export declare const dailyArchiveTimer: (input: DailyArchiveTimerInput) => DailyArchiveTimer;
26
26
  export declare const manageDailyArchiveTimer: (plan: DailyArchiveTimer, action: "install" | "start" | "stop" | "status" | "uninstall", system: Pick<ServerSystem, "platform" | "run">, env: NodeJS.ProcessEnv, signal?: AbortSignal) => Promise<{
27
+ action?: undefined;
27
28
  name: string;
28
29
  installed: boolean;
29
30
  active: boolean;
30
31
  servicePath: string;
31
32
  timerPath: string;
32
- action?: undefined;
33
33
  } | {
34
34
  active?: undefined;
35
35
  name: string;
@@ -28,8 +28,9 @@ export declare const DELIVERY_REASONS: {
28
28
  export type DeliveryReason = (typeof DELIVERY_REASONS)[keyof typeof DELIVERY_REASONS];
29
29
  /**
30
30
  * One route's outcome, kept in `last.json`. `error` is the sending CLI's error code and reason id, never its message.
31
- * A send that went as plain text because Telegram refused the HTML is `ok` with the `html-fallback` reason, and the
32
- * one line sent in place of a report that failed its check is `ok` with `report-invalid`.
31
+ * A send that went as plain text because Telegram refused the HTML, or a mail-cli older than `--html` refused the
32
+ * flag, is `ok` with the `html-fallback` reason, and the one line sent in place of a report that failed its check is
33
+ * `ok` with `report-invalid`.
33
34
  */
34
35
  export interface Delivery {
35
36
  to: string;
@@ -56,6 +57,8 @@ export interface Parcel {
56
57
  }
57
58
  export interface RenderedParcel {
58
59
  telegram: string;
60
+ /** The email's HTML; without it, or when `mail` refuses `--html`, the email is `text`. */
61
+ email?: string;
59
62
  text: string;
60
63
  subject: string;
61
64
  /** The report failed its check and `text` is the one line that says so. */
@@ -60,16 +60,22 @@ export const headOf = (title, report, limit = CAPTION_CHARS) => {
60
60
  * more exact. Any other code (network_error, outcome_unknown, provider_error…) may mean the message arrived.
61
61
  */
62
62
  const REFUSED_CONTENT = "validation_error";
63
- const codeOf = (stderr) => {
63
+ const errorLineOf = (stderr) => {
64
64
  for (const line of stderr.split("\n").reverse()) {
65
65
  try {
66
- const { code } = JSON.parse(line).error ?? {};
66
+ const { code, message } = JSON.parse(line).error ?? {};
67
67
  if (typeof code === "string")
68
- return code;
68
+ return { code, message: typeof message === "string" ? message : "" };
69
69
  }
70
70
  catch { }
71
71
  }
72
72
  };
73
+ const codeOf = (stderr) => errorLineOf(stderr)?.code;
74
+ /** A mail-cli older than 0.21.0 has no `--html`, and commander refuses the flag before anything is sent. */
75
+ const refusesHtmlFlag = (stderr) => {
76
+ const error = errorLineOf(stderr);
77
+ return error?.code === REFUSED_CONTENT && error.message.includes("unknown option '--html'");
78
+ };
73
79
  /** Plain text for a bot when Telegram refused the HTML, cut where a line ends. */
74
80
  const plainFit = (text) => {
75
81
  if (text.length <= TELEGRAM_TEXT_CHARS)
@@ -82,7 +88,16 @@ const plainFit = (text) => {
82
88
  const renderedArgvOf = (program, route, rendered, plain = false) => {
83
89
  const lead = [program, route.profile, "--json", "--no-input"];
84
90
  if (route.kind === "email")
85
- return [...lead, "messages", "send", "--to", route.address, "--subject", rendered.subject];
91
+ return [
92
+ ...lead,
93
+ "messages",
94
+ "send",
95
+ ...(plain || rendered.email === undefined ? [] : ["--html"]),
96
+ "--to",
97
+ route.address,
98
+ "--subject",
99
+ rendered.subject,
100
+ ];
86
101
  return [
87
102
  ...lead,
88
103
  "bot",
@@ -174,21 +189,24 @@ export const deliver = async (system, env, routes, parcel, { find, errorOf, lock
174
189
  if (copy && parcel.file)
175
190
  copyFileSync(parcel.file.path, copy);
176
191
  const { [`${prefix}_PROFILE`]: _, ...childEnv } = env;
177
- const options = {
192
+ const mailInput = (plain) => rendered ? (plain ? rendered.text : (rendered.email ?? rendered.text)) : report.trim() ? report : parcel.title;
193
+ const options = (plain = false) => ({
178
194
  timeoutMs,
179
- ...(route.kind === "email" ? { input: rendered ? rendered.text : report.trim() ? report : parcel.title } : {}),
180
- };
195
+ ...(route.kind === "email" ? { input: mailInput(plain) } : {}),
196
+ });
181
197
  const argv = (plain = false) => rendered
182
198
  ? renderedArgvOf(program, route, rendered, plain)
183
199
  : argvOf(program, route, parcel.title, report, copy, plain);
184
- let ran = await system.run(argv(), childEnv, options);
200
+ let ran = await system.run(argv(), childEnv, options());
185
201
  let fellBack = "";
186
- if (route.kind === "telegram-bot" &&
187
- ran.code !== 0 &&
202
+ const refused = ran.code !== 0 &&
188
203
  ran.code !== TIMED_OUT &&
189
- codeOf(ran.stderr) === REFUSED_CONTENT) {
204
+ (route.kind === "telegram-bot"
205
+ ? codeOf(ran.stderr) === REFUSED_CONTENT
206
+ : rendered?.email !== undefined && refusesHtmlFlag(ran.stderr));
207
+ if (refused) {
190
208
  fellBack = errorOf(ran.stderr, ran.code);
191
- ran = await system.run(argv(true), childEnv, options);
209
+ ran = await system.run(argv(true), childEnv, options(true));
192
210
  }
193
211
  if (ran.code === 0) {
194
212
  out.push(rendered?.invalid
@@ -58,7 +58,9 @@ export interface ReportRun {
58
58
  }
59
59
  export interface PreparedReport {
60
60
  telegram: string;
61
- /** Plain text with web links: the email's plain part. */
61
+ /** HTML with inline CSS for `mail messages send --html`; absent for an invalid report, which goes as `text`. */
62
+ email?: string;
63
+ /** Plain text with web links: the email when the installed mail cannot send `--html`. */
62
64
  text: string;
63
65
  /** Plain text with app links (`wirecat://`), which a desktop terminal opens: `latest.txt`. */
64
66
  terminal: string;
@@ -255,9 +255,10 @@ export const prepareReport = async (answer, { language, now, timeZone, templates
255
255
  : {};
256
256
  const web = viewFor("web");
257
257
  const telegram = await renderReport(web, "telegram", templateOf(templates, "telegram"));
258
+ const email = await renderReport(web, "email", templateOf(templates, "email"));
258
259
  const text = await renderReport(web, "text", templateOf(templates, "text"));
259
260
  const terminal = await renderReport(viewFor("app"), "text", templateOf(templates, "text"));
260
- const renderings = [telegram, text, terminal];
261
+ const renderings = [telegram, email, text, terminal];
261
262
  const reasons = [
262
263
  ...(lookupFailed || renderings.some((one) => one.templateFailed) ? [REPORT_REASONS.templateFailed] : []),
263
264
  ...(renderings.some((one) => one.templateTags > 0) ? [REPORT_REASONS.templateTags] : []),
@@ -265,6 +266,7 @@ export const prepareReport = async (answer, { language, now, timeZone, templates
265
266
  const title = text.text.split("\n")[0] ?? "";
266
267
  return {
267
268
  telegram: telegram.text,
269
+ email: email.text,
268
270
  text: text.text,
269
271
  terminal: terminal.text,
270
272
  document: `${JSON.stringify(reportDocument(parsed.report), null, 2)}\n`,
@@ -487,6 +487,7 @@ export declare const calendarLinkedPerson: v.StrictObjectSchema<{
487
487
  readonly person: v.StringSchema<undefined>;
488
488
  readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
489
489
  readonly identities: v.ArraySchema<v.StringSchema<undefined>, undefined>;
490
+ readonly proposal: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
490
491
  }, undefined>;
491
492
  export declare const calendarLinkReview: v.StrictObjectSchema<{
492
493
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
@@ -238,7 +238,12 @@ export const calendarEventPreparation = v.strictObject({
238
238
  limits: v.strictObject({ people: count, messages: count, bytes: count }),
239
239
  untrusted,
240
240
  });
241
- export const calendarLinkedPerson = v.strictObject({ person: text, name: nullableText, identities: v.array(text) });
241
+ export const calendarLinkedPerson = v.strictObject({
242
+ person: text,
243
+ name: nullableText,
244
+ identities: v.array(text),
245
+ proposal: v.optional(text),
246
+ });
242
247
  export const calendarLinkReview = v.strictObject({
243
248
  id,
244
249
  entry_id: id,
@@ -14,7 +14,6 @@ import { secretInput } from "../../runs/run-context.js";
14
14
  import { searchEvents } from "../../services/events-search.js";
15
15
  import { dateWindow } from "../../services/moment.js";
16
16
  import { embedEvents } from "../../services/notes-search.js";
17
- import { linkPeople } from "../../services/people.js";
18
17
  import { BUSY_QUERY, BUSY_QUERY_NOTE, busyAnswer, busyQuery, workingHoursOf } from "../busy.js";
19
18
  import { isFeedCalendar, isPlainHttp, syncWithFeeds } from "../feeds.js";
20
19
  import { eventPreparation, nextMeeting, PREPARE_MESSAGES } from "../prepare.js";
@@ -27,6 +26,7 @@ import { CALENDARS_QUERY, declareCalendarAnswers, PEOPLE_QUERY } from "./answers
27
26
  import { hitsBody, itemBody, listBody, messagesOf, pathOf } from "./bodies.js";
28
27
  import { ICS_MAX_BYTES, readIcsFile, writeIcsFile } from "./files.js";
29
28
  import { localTimesView } from "./local-times.js";
29
+ import { addPeopleLink } from "./people-link.js";
30
30
  import { addRemind } from "./remind.js";
31
31
  import { addSearchAll } from "./search-all.js";
32
32
  const LOCAL_READ = { remote: "none", local: "read" };
@@ -444,19 +444,7 @@ const addCalendarCommandsDefinition = (program, options) => {
444
444
  return listBody(command, eachMarked(found, ATTENDEE_UNTRUSTED));
445
445
  });
446
446
  });
447
- example(annotate(people.command("link"), { effects: LOCAL_WRITE })
448
- .description("join an attendee to a person the owner knows elsewhere")
449
- .argument("<person>", "an attendee's address as email:<address>, or a person:<id>")
450
- .argument("<other>", "the same person in another tool, as <provider>:<person>, or me"), "people link email:ana@example.com telegram:12345").action(async (person, other, _opts, command) => {
451
- await within(command, async (run) => {
452
- const linked = await linkPeople(messagesOf(run, "people link"), run.account, person, other);
453
- return itemBody({
454
- person: `person:${linked.uid}`,
455
- name: linked.name,
456
- identities: linked.identities.map(({ provider, id }) => `${provider}:${id}`),
457
- });
458
- });
459
- });
447
+ addPeopleLink(people, { within, example });
460
448
  const links = annotate(program.command("links").description("calendar copies the rules could not join alone"), {
461
449
  effects: GROUP,
462
450
  });
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ import type { CommandHelpers } from "./index.js";
3
+ export declare const addPeopleLink: (people: Command, { within, example }: Pick<CommandHelpers, "within" | "example">) => Command;
@@ -0,0 +1,23 @@
1
+ import { annotate } from "@wirecat/cli-base/commands";
2
+ import { actorOf } from "../../cli/author.js";
3
+ import { LOCAL_WRITE } from "../../cli/effects.js";
4
+ import { linkPeople } from "../../services/people.js";
5
+ import { itemBody, messagesOf } from "./bodies.js";
6
+ export const addPeopleLink = (people, { within, example }) => example(annotate(people.command("link"), { effects: LOCAL_WRITE })
7
+ .description("join an attendee to a person the owner knows elsewhere")
8
+ .argument("<person>", "an attendee's address as email:<address>, or a person:<id>")
9
+ .argument("<other>", "the same person in another tool, as <provider>:<person>, or me")
10
+ .option("--reason <text>", "why they are one person; an agent's link is a proposal and needs it"), "people link email:ana@example.com telegram:12345").action(async (person, other, opts, command) => {
11
+ await within(command, async (run) => {
12
+ const linked = await linkPeople(messagesOf(run, "people link"), run.account, person, other, {
13
+ by: actorOf(command),
14
+ reason: opts.reason,
15
+ });
16
+ return itemBody({
17
+ person: `person:${linked.uid}`,
18
+ name: linked.name,
19
+ identities: linked.identities.map(({ provider, id }) => `${provider}:${id}`),
20
+ ...(linked.proposal === undefined ? {} : { proposal: linked.proposal }),
21
+ });
22
+ });
23
+ });