@wirecat/cli-core 1.0.0 → 1.2.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 (111) hide show
  1. package/CHANGELOG.md +144 -0
  2. package/THIRD_PARTY_NOTICES +43 -0
  3. package/dist/background/daily-archive-timer.d.ts +1 -1
  4. package/dist/cli/account-remove.d.ts +3 -0
  5. package/dist/cli/account-remove.js +1 -1
  6. package/dist/cli/documents/index.d.ts +2 -1
  7. package/dist/cli/documents/index.js +4 -1
  8. package/dist/cli/documents/words.d.ts +1 -1
  9. package/dist/cli/domain-lists-command.d.ts +16 -0
  10. package/dist/cli/domain-lists-command.js +88 -0
  11. package/dist/cli/index.d.ts +4 -3
  12. package/dist/cli/index.js +4 -3
  13. package/dist/cli/messenger/conversation-answers.d.ts +2 -0
  14. package/dist/cli/messenger/message-answers.d.ts +2 -0
  15. package/dist/cli/messenger/message-items.js +2 -0
  16. package/dist/cli/messenger/message-writes.d.ts +4 -0
  17. package/dist/cli/messenger/search-answers.js +2 -0
  18. package/dist/cli/model-catalogue-command.d.ts +6 -0
  19. package/dist/cli/model-catalogue-command.js +1 -1
  20. package/dist/cli/oauth-session.d.ts +38 -4
  21. package/dist/cli/oauth-session.js +72 -25
  22. package/dist/cli/shared-command-exports.d.ts +4 -0
  23. package/dist/cli/shared-command-exports.js +6 -0
  24. package/dist/cli/token-session.d.ts +9 -3
  25. package/dist/cli/token-session.js +34 -3
  26. package/dist/domain/domain-lists.d.ts +86 -0
  27. package/dist/domain/domain-lists.js +110 -0
  28. package/dist/domain/free-mail-domains.generated.d.ts +1 -0
  29. package/dist/domain/free-mail-domains.generated.js +4 -0
  30. package/dist/domain/models.d.ts +5 -0
  31. package/dist/domain/organization-sectors.d.ts +9 -3
  32. package/dist/domain/organization-sectors.generated.d.ts +1 -0
  33. package/dist/domain/organization-sectors.generated.js +1 -0
  34. package/dist/domain/organization-sectors.js +16 -3
  35. package/dist/domain/person-kinds.d.ts +6 -1
  36. package/dist/domain/person-kinds.js +5 -0
  37. package/dist/entities/contact-context.d.ts +4 -0
  38. package/dist/entities/conversation-results.d.ts +4 -0
  39. package/dist/entities/domain-list.d.ts +27 -0
  40. package/dist/entities/domain-list.js +28 -0
  41. package/dist/entities/evidence.d.ts +16 -0
  42. package/dist/entities/index.d.ts +56 -2
  43. package/dist/entities/index.js +3 -1
  44. package/dist/entities/knowledge-lists.d.ts +1 -1
  45. package/dist/entities/listener.d.ts +8 -0
  46. package/dist/entities/message-change.d.ts +2 -0
  47. package/dist/entities/message-context.d.ts +6 -0
  48. package/dist/entities/message-write.d.ts +8 -0
  49. package/dist/entities/message.d.ts +4 -0
  50. package/dist/entities/message.js +4 -0
  51. package/dist/entities/store-records.d.ts +2 -0
  52. package/dist/errors/reasons.js +20 -2
  53. package/dist/mail/cli/index.js +1 -1
  54. package/dist/mail/headers.d.ts +2 -0
  55. package/dist/mail/headers.js +2 -1
  56. package/dist/mail/mail-types.d.ts +48 -0
  57. package/dist/mail/mail-types.js +218 -0
  58. package/dist/mail/read.js +1 -0
  59. package/dist/mail/sort-rules.d.ts +58 -0
  60. package/dist/mail/sort-rules.js +79 -0
  61. package/dist/oauth/index.d.ts +1 -1
  62. package/dist/oauth/storage.d.ts +10 -2
  63. package/dist/oauth/storage.js +23 -9
  64. package/dist/search/lucene/registry.js +24 -0
  65. package/dist/services/domain-lists-download.d.ts +26 -0
  66. package/dist/services/domain-lists-download.js +155 -0
  67. package/dist/services/messages-search.js +1 -1
  68. package/dist/services/metadata.d.ts +1 -1
  69. package/dist/store/areas.d.ts +3 -1
  70. package/dist/store/areas.js +2 -0
  71. package/dist/store/index.d.ts +2 -2
  72. package/dist/store/index.js +1 -1
  73. package/dist/store/people.d.ts +18 -9
  74. package/dist/store/people.js +8 -7
  75. package/dist/store/public.d.ts +1 -1
  76. package/dist/store/public.js +1 -1
  77. package/dist/store/queries.js +9 -2
  78. package/dist/store/sqlite/accounts.js +3 -1
  79. package/dist/store/sqlite/domain-organizations.d.ts +7 -4
  80. package/dist/store/sqlite/domain-organizations.js +94 -36
  81. package/dist/store/sqlite/email-types.d.ts +87 -0
  82. package/dist/store/sqlite/email-types.js +296 -0
  83. package/dist/store/sqlite/emails.d.ts +14 -2
  84. package/dist/store/sqlite/emails.js +32 -12
  85. package/dist/store/sqlite/identities.d.ts +4 -1
  86. package/dist/store/sqlite/identities.js +11 -2
  87. package/dist/store/sqlite/identity-rekey.js +2 -0
  88. package/dist/store/sqlite/lucene-fields.d.ts +6 -0
  89. package/dist/store/sqlite/lucene-fields.js +10 -0
  90. package/dist/store/sqlite/lucene.js +6 -0
  91. package/dist/store/sqlite/mail-sorting.d.ts +122 -0
  92. package/dist/store/sqlite/mail-sorting.js +482 -0
  93. package/dist/store/sqlite/manifest.js +6 -0
  94. package/dist/store/sqlite/merged-persons.d.ts +3 -2
  95. package/dist/store/sqlite/merged-persons.js +5 -3
  96. package/dist/store/sqlite/migrations.generated.js +76 -0
  97. package/dist/store/sqlite/people-list.d.ts +1 -6
  98. package/dist/store/sqlite/people-list.js +97 -42
  99. package/dist/store/sqlite/person-links.js +13 -3
  100. package/dist/store/sqlite/person-match-scan.js +5 -2
  101. package/dist/store/sqlite/schema/mail-sorting.d.ts +384 -0
  102. package/dist/store/sqlite/schema/mail-sorting.js +31 -0
  103. package/dist/store/sqlite/schema/sender-bots.d.ts +56 -0
  104. package/dist/store/sqlite/schema/sender-bots.js +9 -1
  105. package/dist/store/sqlite/schema.d.ts +66 -1
  106. package/dist/store/sqlite/schema.js +9 -1
  107. package/dist/store/sqlite/sender-bots.d.ts +89 -15
  108. package/dist/store/sqlite/sender-bots.js +417 -136
  109. package/dist/store/sqlite/sender-signals.d.ts +11 -4
  110. package/dist/store/sqlite/sender-signals.js +14 -10
  111. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,150 @@ 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
+ ## 1.2.0 — 25.11.2026
9
+
10
+ ### Added
11
+
12
+ - **Mail sorting rules (store version 77).** `store.mail.sorting` keeps the owner's and the program's rules over mail:
13
+ `add` (with `dryRun`), `rules`, `remove`, `undo`, `reset` and `scopes`, all experimental. A rule names its scope,
14
+ one mail, a List-Id, a subject pattern, an address or a registrable domain, and says whether it sorts past mail too
15
+ (`applyTo: "all"`) or only mail dated from now on (`"new"`). The first scope that has a rule wins, in that order, then
16
+ the header classifier; within a scope the owner's rule beats the program's and the newest wins, and a domain rule may
17
+ beat the address rules (`overAddresses`). A rule sets the mail type, makes the sender a bot or a person through
18
+ `moveToBot` and `moveToPerson`, or files the sender under an organization. An email a rule typed has `typeSignal`
19
+ `rule:<id>`. A domain rule on a free-mail or throwaway domain is the owner's only and is set only with the `confirm`
20
+ of a dry run that shows how many addresses and emails it touches. Removing or undoing a rule types its mail again and
21
+ moves its senders back. Not the storage `store.mail.rules`.
22
+ - **`tokenSessionCommand`, `oauthSessionCommand` and `fileMirrorsCommand` are marked as cli-core's own commands**,
23
+ as `appDoctorCommand` is. `commands --json` gives them `origin: "cli-core"`, so the `reserved-shared-command` lint
24
+ rule (WC-CMD-34) stops warning on the CLIs that mount them. A CLI changes them only through their options: an
25
+ option, a description or an annotation added to the returned command afterwards stops the run with
26
+ `contract.unacknowledged-override`. No CLI does that today.
27
+ - **`accountRemoveCommand` takes `effects`.** A CLI whose removal reaches no service passes `LOCAL_WRITE` here,
28
+ instead of annotating the returned command. asterisk, beeline, notion and yandex-disk annotate it today, so
29
+ `accountRemoveCommand` stays unmarked until they pass `effects`.
30
+ - **Mail search filters by mail type and reach.** `type:` takes one of the [mail types](docs/dev/GLOSSARY.md#mail-types)
31
+ and `reach:` takes `direct`, `group` or `broadcast`, in the query itself, so a page is never short:
32
+ `memo search mail 'type:order OR type:bill'`, `memo search mail 'invoice -type:promotion reach:direct'`. A search
33
+ that names either field first types the mail the store has not typed yet, 5,000 emails per write; on 100,000
34
+ untyped emails the first such search after an upgrade takes seconds, later ones the usual milliseconds. A store
35
+ opened read-only works the missing types out in memory for that search. tg and max refuse both as mail fields.
36
+ - **Email hits show their type and reach**: `email.mail_type` and `email.reach` in `--json`, and both on the hit's
37
+ line in mail's text output. In the API they are `MailFields.mailType` and `MailFields.reach` (experimental).
38
+ - **`SENDER_BOT_PREFIX` is exported from `@wirecat/cli-core/store`, and `MAIL_TYPES`, `MailType`, `REACHES` and
39
+ `Reach` from `@wirecat/cli-core/store/areas`** (experimental), so a CLI no longer copies them.
40
+
41
+ ### Changed — experimental
42
+
43
+ - **A sender of a newsletter only is a bot, a human author too.** The owner's ruling of 25.11.2026, in place of the
44
+ earlier one that kept a human-written newsletter a person. A person all of whose mail came from a list (List-Id,
45
+ List-Unsubscribe, a one-click unsubscribe, a Feedback-ID, bulk `Precedence` or the bulk box), with no tie to the
46
+ owner, no messenger identity and no discussion list among their mail, moves to a bot with the reason
47
+ `newsletter-only` on the next people list; `kindSignals` names `newsletter-only`. Its mail stays typed `newsletter`:
48
+ a newsletter's bot is not a program for the mail types. A rule's newsletter bot goes back to a person once the owner
49
+ writes to it, as before, and also once a mail written to the owner alone (no list headers, at most a small group in
50
+ To and Cc) comes from it; the newsletter's own mail keeps reach `broadcast`. The owner's `moveToPerson` and
51
+ `moveToBot` and the sorting rules still win. The people list works out every kind again once after the upgrade.
52
+
53
+ ### Fixed
54
+
55
+ - **Parity checks the CLIs that moved to cli-core 1.0 again.** They are off the known-broken list now. Five stay on it
56
+ until 2026-12-02 because their main is still on 0.x: drive, gcal, bitrix24, wordpress and ydisk. cli-template is
57
+ back on it for #3365, which made the session commands cli-core's own: its MCP snapshot still lists them, and it
58
+ adopts that with the next release.
59
+ - **`oauthSessionCommand` signs in when the sign-in and the token share one host.** Zoom (`zoom.us`) and Google
60
+ (`oauth2.googleapis.com`) list one host for two of their addresses, and `session start` refused with
61
+ `configuration_error: "zoom.us" is listed twice`. Each host is now allowed once.
62
+
63
+ ## 1.1.0 — 25.11.2026
64
+
65
+ ### Added
66
+
67
+ - **`store.people.listBots` and `showBot`** read the sender bots: by name, by part of a name, address or username, or by
68
+ the organization they send for (`organization:<id>`). `showBot` adds every move to or from the bot. memo and Desktop
69
+ build their bots list on them.
70
+ - **The domain-list pack: more organizations get a sector, and the lists update without a release.**
71
+ `domainListsCommand` (experimental) gives a CLI `domain-lists update` and `domain-lists list`. `update` downloads the
72
+ newest pack from WireCat's GitHub release `domain-lists`, each file checked by sha256 the way `models download` checks
73
+ a model, and swaps the pack folder whole. The first pack holds UT1's sector and webmail lists (CC BY-SA 4.0, their
74
+ own files), the FDIC-insured US banks, UT1's malware and cryptojacking hosts, and Stop Forum Spam's toxic domains,
75
+ which each computer fetches from Stop Forum Spam itself because its terms forbid redistribution. Each source carries
76
+ its licence, credit and class: `commercial-ok`, or `non-commercial`, which WireCat may use and a paid service may
77
+ not; `--commercial-only` leaves those out. Sender domains are matched on this computer only, never sent anywhere.
78
+ Two sectors come from the pack, `gaming_gambling` and `adult`. UT1's webmail providers never make an organization.
79
+ Spam and malware lists never set a sector: the lookup reports them apart, for exact host names only, and nothing
80
+ reads them yet. `.github/workflows/domain-lists.yml` builds and publishes the pack weekly.
81
+ - **About 23,000 more free-mail providers are never an organization.** Built in from microlink's free-email-domains
82
+ (MIT), less the domains Wikidata calls an organization, such as `sky.com` or `orange.fr`, whose own bills come from
83
+ that domain. An organization already made on a domain that is now free mail stays.
84
+ - **Each email has a type of its own, apart from its sender (store version 76).** `Email.mailType` is one of
85
+ `auto_reply`, `security`, `calendar`, `travel`, `event_ticket`, `order`, `shipping`, `bill`, `social_notification`,
86
+ `discussion_list`, `newsletter`, `promotion`, `system_alert`, `account_notice`, `personal` or `other`, worked out
87
+ locally from the stored headers, recipients, attachment types, schema.org markup in a kept HTML body, the sender's bot
88
+ and its organization's sector, and whether the owner wrote to the sender. `Email.reach` (`direct`, `group`,
89
+ `broadcast`) is worked out per email too, and `Email.typeSignal` says what decided the type. They are kept on the
90
+ email and cleared by triggers when what decides them changes; a store's existing mail gets them in batches on the
91
+ first read that filters by them. The words are in the [glossary](docs/dev/GLOSSARY.md#mail-types).
92
+ - **`store.mail.emails` filters by `types` and `reaches`**, and **`store.mail.mailSenders`** lists the senders of
93
+ incoming mail with their mail counted by type and reach: a sender is listed when any of its mail passes the filter,
94
+ so a shop that sends receipts and sales shows under both. Both are experimental.
95
+ - **`oauthSessionCommand` takes the sign-ins a CLI kept before**, so zm and drive can move to it with nobody signing
96
+ in again. All new options are optional:
97
+ - `codec` is the entry's format (`zoomTokenCodec`, `driveSessionCodec`). The standard one stays the default.
98
+ - `legacyAccounts(env, profile)` names where older versions kept a profile's sign-in, as an account or as a service
99
+ and an account. The first read copies it to `oauth:<provider>:<profile>`. `session end` removes it too. A run with
100
+ moved folders only reads it.
101
+ - `startOptions` adds options to `session start`, such as a client or the scopes to ask. `preset` reads them from
102
+ `command.opts()`.
103
+ - `preset` may be async. In `session start` it also gets the sign-in steps, so it can ask for a missing client id
104
+ with `--answer-stdin`.
105
+ - `verify` may return `extra`, which the codec saves in the entry at sign-in (drive's `principal`).
106
+ - `afterSignIn(command, signedIn)` runs once the sign-in is kept. It gets the profile, the account and the client
107
+ the sign-in used, so a CLI can save that client beside it (WC-SECR-25).
108
+ - `profiles(env)` is the list `session list` names, for a CLI that keeps its profiles in its own config.
109
+ - **`session start --answer-stdin`** in every CLI built on `oauthSessionCommand`. With `--json` it asks for the
110
+ redirected address as a `needs` line when the browser does not come back to this computer.
111
+ - **`session status` gives `expires_at`**, when the access token runs out. A refresh moves it on.
112
+ - **`session list` rows have `state`**: `saved`, `missing` or `unknown`, in `oauthSessionCommand` and
113
+ `tokenSessionCommand`. When the keyring cannot be reached, or an entry cannot be read, the row is `signed_in: null`
114
+ and `state: "unknown"` and the list still answers. One warning names the cause, and `session status` says more.
115
+ - **`storageOf`, `timeLimit` and `withTimeLimit` are exported** from `@wirecat/cli-core/cli`, so CLIs stop keeping
116
+ copies of them.
117
+ - **`credentialStorage` reads an older entry under another service** (`legacyAccounts: [{ service, account }]`). It
118
+ copies an entry it found in the private file within the file, never into the keyring. `remove` removes the older
119
+ entries too, except in a run with moved folders, so the next read does not sign the profile in again.
120
+
121
+ ### Changed — experimental
122
+
123
+ - **Bots are their own entity, apart from people (store version 75).** A sender bot (`sender-bot:<id>`) now holds its
124
+ identities itself, in `sender_bot_identities`: an identity belongs to one person or one bot, never both. Its messages
125
+ and mail keep pointing at the identity. A bot never appears in `people.list`, its counts, `people.similar` or
126
+ `people.ties`; `people list kind:automated` keeps the people a name or a bulk mailbox marks. The upgrade moves every
127
+ version 74 bot's identities off its person row. That row stays, hidden, so a move back gives its uid back, and its
128
+ `person:` ref still names the bot in a move. `minCompatible` stays 73: triggers keep a 1.0 build from giving a bot's
129
+ identity a person again, and the next list settles a bot such a build sorts.
130
+ - **`SenderBot` describes the bot itself**: its name, identities, organization, author, reason, counts, reach and
131
+ signals, and no longer `person`. `moveToPerson` gives each identity back to the person it came from unless `person` is
132
+ named. Both moves take `sender-bot:<id>`, `person:<uid>` or an identity.
133
+ - **`people.list` rows lose `bot`**, and `KindSignal` loses `owner-choice`: no listed row is a bot.
134
+ - **A sector from the rules is changed or removed when a newer list no longer gives it.** Rules mark their sector
135
+ `metadata.sector_by = 'rules'`; a sector with any other `sector_by` is the owner's and stays. When the built-in table
136
+ or the pack changes, the next kind pass works out every organization's sector again. An organization's `sector` can
137
+ now also be `gaming_gambling` or `adult`.
138
+
139
+ ### Fixed
140
+
141
+ - **`tokenSessionCommand`'s `session list` no longer fails for every profile when one sign-in cannot be read**, from
142
+ a keyring this run cannot reach or a broken entry. That profile is `unknown` and the others are listed. WireCat
143
+ Desktop reads its profiles from this list.
144
+ - **A generated `api` command refuses an empty required argument before it sends anything.** `linear api issue-delete
145
+ --id "" --yes` used to send the request, and Linear's answer left the write unconfirmed (exit 14,
146
+ `outcome.unknown`). Now a required path, query or header parameter, or a required GraphQL variable from a flag
147
+ or from `--body`, that is empty or only spaces stops the command with exit 2 (`validation_error`, reason `input.invalid`),
148
+ naming the flag, and nothing is sent. An empty path parameter could otherwise reach another endpoint (`/posts/`).
149
+ `serviceApiWriter` refuses the same for code. A bot API's body field is still sent empty: Telegram's `setWebhook`
150
+ takes an empty `url` to remove the hook.
151
+
8
152
  ## 1.0.0 — 25.11.2026
9
153
 
10
154
  ### Added
@@ -806,3 +806,46 @@ restrictions (https://ai.google.dev/gemma/prohibited_use_policy).
806
806
  The domain-to-sector table (src/domain/organization-sectors.generated.ts) is built from Wikidata
807
807
  (https://www.wikidata.org), whose structured data is available under CC0 1.0
808
808
  (https://creativecommons.org/publicdomain/zero/1.0/). The export date is in the file's header.
809
+
810
+ The order of the checks and two sender patterns in src/mail/mail-types.ts are ported from Zero's header classifier
811
+ (https://github.com/Mail-0/Zero, apps/server/src/lib/imap/categorize.ts at commit
812
+ 4b642dfd9890a1fdcb1b98a177fe74ca3142c445), under the MIT License:
813
+
814
+ MIT License
815
+
816
+ Copyright (c) 2025 Zero Email
817
+
818
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
819
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
820
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
821
+ persons to whom the Software is furnished to do so, subject to the following conditions:
822
+
823
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
824
+ Software.
825
+
826
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
827
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
828
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
829
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
830
+ The free-mail provider list (src/domain/free-mail-domains.generated.ts) is derived from free-email-domains
831
+ (https://github.com/microlinkhq/free-email-domains), under the MIT License:
832
+
833
+ The MIT License (MIT)
834
+
835
+ Copyright © 2017 Microlink <hello@microlink.io> (microlink.io)
836
+
837
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
838
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
839
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
840
+ persons to whom the Software is furnished to do so, subject to the following conditions:
841
+
842
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
843
+ Software.
844
+
845
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
846
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
847
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
848
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
849
+
850
+ The domain-list pack that `domain-lists update` downloads is not part of this package. Each of its sources keeps its
851
+ own licence, credit and licence class, listed in the pack's manifest.json and by `domain-lists list`.
@@ -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;
28
27
  name: string;
29
28
  installed: boolean;
30
29
  active: boolean;
31
30
  servicePath: string;
32
31
  timerPath: string;
32
+ action?: undefined;
33
33
  } | {
34
34
  active?: undefined;
35
35
  name: string;
@@ -1,4 +1,5 @@
1
1
  import { type CredentialsOptions, type KeyringStore } from "@wirecat/cli-base";
2
+ import type { Effects } from "@wirecat/cli-base/standards";
2
3
  import { Command } from "commander";
3
4
  import { type ServerSystem } from "../background/system.js";
4
5
  import { type Unit } from "../background/units.js";
@@ -75,6 +76,8 @@ export interface AccountRemoveOptions {
75
76
  resolveSettings?: (flags: GlobalFlags, options?: ResolveOptions) => Settings;
76
77
  /** The owner's own home; unset, the account's from the user database. A test names its sandbox. */
77
78
  ownerHome?: string;
79
+ /** A CLI whose removal reaches no service says so here (`LOCAL_WRITE`), not by annotating the command after. */
80
+ effects?: Effects;
78
81
  }
79
82
  /** Inside the tool's own folders and not one of them: a hook's mistake must not reach the home folder. */
80
83
  export declare const insideOwnFolders: (app: AppIdentity, env: NodeJS.ProcessEnv, extra: readonly string[]) => (path: string) => string;
@@ -114,7 +114,7 @@ const removeSections = (path, sections) => {
114
114
  * every entry, file and section it would remove.
115
115
  */
116
116
  export const accountRemoveCommand = (app, removal, options = {}) => logsInOrOut(annotate(new Command("remove"), {
117
- effects: REMOTE_WRITE,
117
+ effects: options.effects ?? REMOTE_WRITE,
118
118
  mcp: false,
119
119
  output: { entity: "account_removal" },
120
120
  examples: [
@@ -13,7 +13,7 @@ export { addDocumentCatalogCommands, CATALOG_FIELDS, type CatalogTree, type Cata
13
13
  export { addLocalDocumentCommands, type ImportedDocument, type LocalDocumentCommands } from "./documents.js";
14
14
  export { type FileConflictCommands, type FileConflictConnection, fileConflictsCommand } from "./file-conflicts.js";
15
15
  export { addFileEditCommands, type FileEditCommands } from "./file-edit.js";
16
- export { type FileMirrorCommands, type FileMirrorRemote, type FileMirrorWrite, fileMirrorsCommand, } from "./file-mirrors.js";
16
+ export type { FileMirrorCommands, FileMirrorRemote, FileMirrorWrite } from "./file-mirrors.js";
17
17
  export { addFileUpdateCommand, type FileUpdateCommands, type FileUpdatePort } from "./file-update.js";
18
18
  export { addDocumentFolderCommands, type DocumentFolderCommands } from "./folders.js";
19
19
  export { addDocumentHistoryCommands, DOCUMENT_HISTORY_SETTINGS, type DocumentHistoryCommands, type DocumentHistoryPort, keepVersionsForDays, } from "./history.js";
@@ -47,3 +47,4 @@ export declare const addDocumentCommands: <S>(program: Command, options: Documen
47
47
  export { claimDocumentAccount, DOCUMENT_SCAN_SETTINGS, type DocumentLibraryOptions, type DocumentLibraryTools, type DocumentSourceRun, type DocumentSyncOutcome, type DocumentSyncStep, type DocumentWarning, documentLibrary, documentLibraryCommands, documentProfile, } from "./library.js";
48
48
  export { type DocumentCall, type DocumentFileMap, type DocumentManifest, parseDocumentManifest, } from "./manifest/manifest.js";
49
49
  export { type DocumentManifestSourceOptions, type DocumentManifestTools, type DocumentSlots, documentSourceFromManifest, type ManifestDocumentSource, } from "./manifest/source.js";
50
+ export declare const fileMirrorsCommand: (helpers: import("./file-mirrors.js").FileMirrorCommands) => Command;
@@ -1,5 +1,8 @@
1
+ import { honoursDryRun } from "../dry-run-guard.js";
2
+ import { sharedCommand } from "../shared-contracts.js";
1
3
  import { addDocumentCatalogCommands } from "./catalog.js";
2
4
  import { addLocalDocumentCommands } from "./documents.js";
5
+ import { fileMirrorsCommand as fileMirrorsCommandDefinition } from "./file-mirrors.js";
3
6
  import { addDocumentFolderCommands } from "./folders.js";
4
7
  import { addDocumentHistoryCommands } from "./history.js";
5
8
  import { addDocumentKnowledgeCommands } from "./knowledge.js";
@@ -11,7 +14,6 @@ export { addDocumentCatalogCommands, CATALOG_FIELDS, catalogId, catalogOutput, c
11
14
  export { addLocalDocumentCommands } from "./documents.js";
12
15
  export { fileConflictsCommand } from "./file-conflicts.js";
13
16
  export { addFileEditCommands } from "./file-edit.js";
14
- export { fileMirrorsCommand, } from "./file-mirrors.js";
15
17
  export { addFileUpdateCommand } from "./file-update.js";
16
18
  export { addDocumentFolderCommands } from "./folders.js";
17
19
  export { addDocumentHistoryCommands, DOCUMENT_HISTORY_SETTINGS, keepVersionsForDays, } from "./history.js";
@@ -43,3 +45,4 @@ export const addDocumentCommands = (program, options) => {
43
45
  export { claimDocumentAccount, DOCUMENT_SCAN_SETTINGS, documentLibrary, documentLibraryCommands, documentProfile, } from "./library.js";
44
46
  export { parseDocumentManifest, } from "./manifest/manifest.js";
45
47
  export { documentSourceFromManifest, } from "./manifest/source.js";
48
+ export const fileMirrorsCommand = honoursDryRun(sharedCommand(fileMirrorsCommandDefinition));
@@ -58,8 +58,8 @@ export interface CopyAge {
58
58
  }
59
59
  export declare const ageOf: (lastSync: string | undefined, now?: number) => CopyAge;
60
60
  export declare const staleCopy: (provider: string, lastSync: string | undefined, now?: number) => {
61
- next?: undefined;
62
61
  missing?: undefined;
62
+ next?: undefined;
63
63
  meta?: undefined;
64
64
  } | {
65
65
  missing: {
@@ -0,0 +1,16 @@
1
+ import { Command } from "commander";
2
+ import type { AppIdentity } from "../ports/app.js";
3
+ import type { Fetch } from "../speech/install.js";
4
+ import { type Body } from "./envelope.js";
5
+ export interface DomainListsCommandOptions {
6
+ env: () => NodeJS.ProcessEnv;
7
+ output: (answer: Body, command: Command) => void;
8
+ diagnostic: (line: string) => void;
9
+ offline?: () => boolean;
10
+ fetch?: Fetch;
11
+ }
12
+ /**
13
+ * `domain-lists`: the pack of bank, shop, news and spam lists matched against sender domains on this computer, kept
14
+ * apart from the package so it updates without a release. Downloaded like a model: whole, checked by sha256.
15
+ */
16
+ export declare const domainListsCommand: (app: AppIdentity, options: DomainListsCommandOptions) => Command;
@@ -0,0 +1,88 @@
1
+ import { CliError } from "@wirecat/cli-base";
2
+ import { annotate } from "@wirecat/cli-base/commands";
3
+ import { Command } from "commander";
4
+ import { domainListsDirectory, installedPack, listFile } from "../domain/domain-lists.js";
5
+ import { updateDomainLists } from "../services/domain-lists-download.js";
6
+ import { stepLines } from "../terminal/step-lines.js";
7
+ import { FETCH, LOCAL_READ, NO_EFFECTS } from "./effects.js";
8
+ import { listOf } from "./envelope.js";
9
+ import { downloadProgress } from "./model-catalogue-command.js";
10
+ const itemsOf = (pack, env) => pack === undefined
11
+ ? []
12
+ : pack.sources.flatMap((source) => {
13
+ const file = pack.files[source.id];
14
+ if (file === undefined)
15
+ return [];
16
+ return [
17
+ {
18
+ id: source.id,
19
+ title: source.title,
20
+ signal: source.signal,
21
+ class: source.class,
22
+ licence: source.licence,
23
+ licence_url: source.licence_url,
24
+ attribution: source.attribution,
25
+ homepage: source.homepage,
26
+ upstream: source.upstream === true,
27
+ lines: file.lines,
28
+ tags: source.tags ?? {},
29
+ version: pack.version,
30
+ installed_at: pack.installed_at,
31
+ sha256: file.sha256,
32
+ path: listFile(domainListsDirectory(env), source.id),
33
+ },
34
+ ];
35
+ });
36
+ /**
37
+ * `domain-lists`: the pack of bank, shop, news and spam lists matched against sender domains on this computer, kept
38
+ * apart from the package so it updates without a release. Downloaded like a model: whole, checked by sha256.
39
+ */
40
+ export const domainListsCommand = (app, options) => {
41
+ const lists = annotate(new Command("domain-lists"), { effects: NO_EFFECTS }).description("lists of bank, shop, news and spam domains that give organizations their sector, matched on this computer");
42
+ annotate(lists.command("list"), {
43
+ effects: LOCAL_READ,
44
+ output: { entity: "domain_list" },
45
+ examples: [`${app.command} domain-lists list`],
46
+ })
47
+ .description("the lists downloaded here, with their licence, licence class and size")
48
+ .option("--json", "print JSON")
49
+ .action(function () {
50
+ const env = options.env();
51
+ const items = itemsOf(installedPack(env), env);
52
+ if (items.length === 0)
53
+ options.diagnostic(`no domain lists yet: \`${app.command} domain-lists update\` downloads them`);
54
+ options.output(listOf("domain-lists list", { items, limit: Math.max(1, items.length), has_more: false }), this);
55
+ });
56
+ annotate(lists.command("update"), {
57
+ effects: FETCH,
58
+ output: { entity: "domain_list" },
59
+ examples: [`${app.command} domain-lists update`, `${app.command} domain-lists update --commercial-only`],
60
+ })
61
+ .description("download the newest pack from WireCat's GitHub release, each file checked by sha256; lists that may not be " +
62
+ "redistributed come whole from their own source. No sender is ever sent anywhere")
63
+ .option("--commercial-only", "leave out lists whose terms forbid commercial use, and remove those already here")
64
+ .option("--offline", "refuse a download that needs the network")
65
+ .option("--json", "print JSON")
66
+ .action(async function (given) {
67
+ if (options.offline?.() || this.optsWithGlobals().offline)
68
+ throw new CliError("permission_error", "updating the domain lists needs the network; --offline was requested", {
69
+ reason: "domain-lists.offline",
70
+ });
71
+ const env = options.env();
72
+ const bytes = downloadProgress(stepLines(options.diagnostic, Boolean(this.optsWithGlobals().json)), "domain-lists");
73
+ const done = await updateDomainLists({
74
+ env,
75
+ commercialOnly: given.commercialOnly === true,
76
+ progress: options.diagnostic,
77
+ bytes,
78
+ ...(options.fetch ? { fetch: options.fetch } : {}),
79
+ });
80
+ options.diagnostic(done.updated
81
+ ? `domain lists ${done.pack.version} in place${done.previous ? ` (was ${done.previous})` : ""}; ` +
82
+ "organizations take their sectors from them the next time a sync sorts a new sender"
83
+ : `domain lists ${done.pack.version} are already the newest`);
84
+ const items = itemsOf(done.pack, env);
85
+ options.output(listOf("domain-lists update", { items, limit: Math.max(1, items.length), has_more: false }), this);
86
+ });
87
+ return lists;
88
+ };
@@ -11,6 +11,7 @@ export { syncProgress } from "../entities/store-records.js";
11
11
  export { isCliFailure, isCommanderFailure, storeDamaged } from "../errors/failures.js";
12
12
  export { type AppErrors, failureContext } from "../errors/reasons.js";
13
13
  export { linkFetch } from "../http/link-fetch.js";
14
+ export { type TimeLimit, timeLimit, withTimeLimit } from "../http/time-limit.js";
14
15
  export { mailFindingFieldsHelp } from "../mail/findings.js";
15
16
  export { botInstructions } from "../mcp/bot/instructions.js";
16
17
  export type { BotServerOptions, RunBotCommand } from "../mcp/bot/server.js";
@@ -142,7 +143,7 @@ export { type Saving, stored } from "./messenger/stored.js";
142
143
  export { dateOrNone } from "./messenger/tasks-command.js";
143
144
  export { MODEL_CATALOGUE_QUERY, type ModelCatalogueOptions } from "./model-catalogue-command.js";
144
145
  export { writeNewFile } from "./new-file.js";
145
- export { type OAuthEnvironment, type OAuthPreset, type OAuthPresetOptions, type OAuthSessionOptions, oauthFlowOf, oauthPreset, oauthSessionCommand, } from "./oauth-session.js";
146
+ export { type OAuthEnvironment, type OAuthPreset, type OAuthPresetOptions, type OAuthSessionOptions, type OAuthSignedIn, oauthFlowOf, oauthPreset, } from "./oauth-session.js";
146
147
  export { pagingOf, positiveCount, window, withPaging } from "./paging.js";
147
148
  export { notLocalPaths } from "./path-options.js";
148
149
  export { type CommandPermissions, type ConditionalKey, commandPathKey, commandPermissions, knownBeside, knownPermissionKeys, type PermissionKeyOf, type PermissionKeySource, refuseUnknownPermissionKeys, unknownPermissionIssues, unknownPermissionKeys, } from "./permission-keys.js";
@@ -163,12 +164,12 @@ export { type DeclaredSetting, type SettingRow, settingRows, withSettingDefaults
163
164
  export { type Config, type Configuration, count, first, flag, fromFile, type GlobalFlags, NONE_NAMED, namedProfile, type ProfileKind, plain, type ResolveOptions, type Settings, type SettingsExtension, type SettingsExtensionContext, type Source, settingsFor, } from "./settings.js";
164
165
  export { type PermissionAnswer, readSetupAnswers, type SetupAnswers, setupPermissionCeiling } from "./setup-answers.js";
165
166
  export { AGENTS, type Agent, agentFor, screenFor } from "./setup-screen.js";
166
- export { accountCommand, addMeetingBatchCommand, addMeetingPreparationCommand, addMeetingProjectCandidatesCommand, addMeetingSeriesInventoryCommand, addStoreMaintenanceCommands, appCompleteCommand, appDoctorCommand, appMcpCommand, attachmentsCommand, botAdminsCommand, botCommand, botMcpCommand, botMembersCommand, botMessagesCommand, callsCommand, chatsCommand, commandsCommand, completeCommand, configCommand, contactsCommand, conversationsCommand, deleteCommand, doctorCommand, editCommand, floodCommand, forwardCommand, generatedApiCommand, guideCommand, imagesCommand, inboxCommand, markReadCommand, mcpCommand, mentionsCommand, messagesCommand, messengerSessionCommands, metadataCommand, modelCatalogueCommand, modelsCommand, pinCommand, pollsCommand, projectsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, runsCommand, scheduleCommand, scheduleCommandFor, searchCommand, searchesCommand, sendCommand, sendsCommand, serveCommand, serverCommand, serviceApiCommand, setupCommand, skillCommand, starCommands, statsCommand, stickersCommand, storeCommand, tagsCommand, tasksCommand, tasksStatsCommand, templatesCommand, topicsCommand, unpinCommand, upgradeCommand, watchCommand, } from "./shared-command-exports.js";
167
+ export { accountCommand, addMeetingBatchCommand, addMeetingPreparationCommand, addMeetingProjectCandidatesCommand, addMeetingSeriesInventoryCommand, addStoreMaintenanceCommands, appCompleteCommand, appDoctorCommand, appMcpCommand, attachmentsCommand, botAdminsCommand, botCommand, botMcpCommand, botMembersCommand, botMessagesCommand, callsCommand, chatsCommand, commandsCommand, completeCommand, configCommand, contactsCommand, conversationsCommand, deleteCommand, doctorCommand, domainListsCommand, editCommand, floodCommand, forwardCommand, generatedApiCommand, guideCommand, imagesCommand, inboxCommand, markReadCommand, mcpCommand, mentionsCommand, messagesCommand, messengerSessionCommands, metadataCommand, modelCatalogueCommand, modelsCommand, oauthSessionCommand, pinCommand, pollsCommand, projectsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, runsCommand, scheduleCommand, scheduleCommandFor, searchCommand, searchesCommand, sendCommand, sendsCommand, serveCommand, serverCommand, serviceApiCommand, setupCommand, skillCommand, starCommands, statsCommand, stickersCommand, storeCommand, tagsCommand, tasksCommand, tasksStatsCommand, templatesCommand, topicsCommand, unpinCommand, upgradeCommand, watchCommand, } from "./shared-command-exports.js";
167
168
  export { hasSharedContract, overrideSharedContract } from "./shared-contracts.js";
168
169
  export { runnable, withSafety } from "./steps.js";
169
170
  export { type StoreInfo, sharedStoreCommand, storeInfo, storeInfoCommand } from "./store-info.js";
170
171
  export { type RecoveryCheck, type RecoveryRun, recoveryNotes, storeRecoverCommand, storeRecoveryCheck, storeRecoveryRun, } from "./store-recover.js";
171
172
  export { changeStoreSetting, isStoreSetting, STORE_SETTINGS, storeSettings } from "./store-settings.js";
172
173
  export type { TemplatesOptions } from "./templates-command.js";
173
- export { type ManifestVerifyOptions, manifestVerify, signedInSite, type TokenSessionOptions, tokenSessionCommand, } from "./token-session.js";
174
+ export { type ManifestVerifyOptions, manifestVerify, signedInSite, storageOf, type TokenSessionOptions, tokenSessionCommand, } from "./token-session.js";
174
175
  export { restartServers, type UpgradeContext } from "./upgrade-command.js";
package/dist/cli/index.js CHANGED
@@ -11,6 +11,7 @@ export { syncProgress } from "../entities/store-records.js";
11
11
  export { isCliFailure, isCommanderFailure, storeDamaged } from "../errors/failures.js";
12
12
  export { failureContext } from "../errors/reasons.js";
13
13
  export { linkFetch } from "../http/link-fetch.js";
14
+ export { timeLimit, withTimeLimit } from "../http/time-limit.js";
14
15
  export { mailFindingFieldsHelp } from "../mail/findings.js";
15
16
  export { botInstructions } from "../mcp/bot/instructions.js";
16
17
  export { callMeetingPreparationTool, meetingPreparationTool } from "../mcp/meeting-preparation.js";
@@ -131,7 +132,7 @@ export { stored } from "./messenger/stored.js";
131
132
  export { dateOrNone } from "./messenger/tasks-command.js";
132
133
  export { MODEL_CATALOGUE_QUERY } from "./model-catalogue-command.js";
133
134
  export { writeNewFile } from "./new-file.js";
134
- export { oauthFlowOf, oauthPreset, oauthSessionCommand, } from "./oauth-session.js";
135
+ export { oauthFlowOf, oauthPreset, } from "./oauth-session.js";
135
136
  export { pagingOf, positiveCount, window, withPaging } from "./paging.js";
136
137
  export { notLocalPaths } from "./path-options.js";
137
138
  export { commandPathKey, commandPermissions, knownBeside, knownPermissionKeys, refuseUnknownPermissionKeys, unknownPermissionIssues, unknownPermissionKeys, } from "./permission-keys.js";
@@ -152,11 +153,11 @@ export { settingRows, withSettingDefaults } from "./setting-defaults.js";
152
153
  export { count, first, flag, fromFile, NONE_NAMED, namedProfile, plain, settingsFor, } from "./settings.js";
153
154
  export { readSetupAnswers, setupPermissionCeiling } from "./setup-answers.js";
154
155
  export { AGENTS, agentFor, screenFor } from "./setup-screen.js";
155
- export { accountCommand, addMeetingBatchCommand, addMeetingPreparationCommand, addMeetingProjectCandidatesCommand, addMeetingSeriesInventoryCommand, addStoreMaintenanceCommands, appCompleteCommand, appDoctorCommand, appMcpCommand, attachmentsCommand, botAdminsCommand, botCommand, botMcpCommand, botMembersCommand, botMessagesCommand, callsCommand, chatsCommand, commandsCommand, completeCommand, configCommand, contactsCommand, conversationsCommand, deleteCommand, doctorCommand, editCommand, floodCommand, forwardCommand, generatedApiCommand, guideCommand, imagesCommand, inboxCommand, markReadCommand, mcpCommand, mentionsCommand, messagesCommand, messengerSessionCommands, metadataCommand, modelCatalogueCommand, modelsCommand, pinCommand, pollsCommand, projectsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, runsCommand, scheduleCommand, scheduleCommandFor, searchCommand, searchesCommand, sendCommand, sendsCommand, serveCommand, serverCommand, serviceApiCommand, setupCommand, skillCommand, starCommands, statsCommand, stickersCommand, storeCommand, tagsCommand, tasksCommand, tasksStatsCommand, templatesCommand, topicsCommand, unpinCommand, upgradeCommand, watchCommand, } from "./shared-command-exports.js";
156
+ export { accountCommand, addMeetingBatchCommand, addMeetingPreparationCommand, addMeetingProjectCandidatesCommand, addMeetingSeriesInventoryCommand, addStoreMaintenanceCommands, appCompleteCommand, appDoctorCommand, appMcpCommand, attachmentsCommand, botAdminsCommand, botCommand, botMcpCommand, botMembersCommand, botMessagesCommand, callsCommand, chatsCommand, commandsCommand, completeCommand, configCommand, contactsCommand, conversationsCommand, deleteCommand, doctorCommand, domainListsCommand, editCommand, floodCommand, forwardCommand, generatedApiCommand, guideCommand, imagesCommand, inboxCommand, markReadCommand, mcpCommand, mentionsCommand, messagesCommand, messengerSessionCommands, metadataCommand, modelCatalogueCommand, modelsCommand, oauthSessionCommand, pinCommand, pollsCommand, projectsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, runsCommand, scheduleCommand, scheduleCommandFor, searchCommand, searchesCommand, sendCommand, sendsCommand, serveCommand, serverCommand, serviceApiCommand, setupCommand, skillCommand, starCommands, statsCommand, stickersCommand, storeCommand, tagsCommand, tasksCommand, tasksStatsCommand, templatesCommand, topicsCommand, unpinCommand, upgradeCommand, watchCommand, } from "./shared-command-exports.js";
156
157
  export { hasSharedContract, overrideSharedContract } from "./shared-contracts.js";
157
158
  export { runnable, withSafety } from "./steps.js";
158
159
  export { sharedStoreCommand, storeInfo, storeInfoCommand } from "./store-info.js";
159
160
  export { recoveryNotes, storeRecoverCommand, storeRecoveryCheck, storeRecoveryRun, } from "./store-recover.js";
160
161
  export { changeStoreSetting, isStoreSetting, STORE_SETTINGS, storeSettings } from "./store-settings.js";
161
- export { manifestVerify, signedInSite, tokenSessionCommand, } from "./token-session.js";
162
+ export { manifestVerify, signedInSite, storageOf, tokenSessionCommand, } from "./token-session.js";
162
163
  export { restartServers } from "./upgrade-command.js";
@@ -243,6 +243,8 @@ export declare const conversationShown: (account: AccountKey, { summary, message
243
243
  thread: string;
244
244
  read: boolean | null;
245
245
  flagged: boolean | null;
246
+ mail_type?: string | undefined;
247
+ reach?: string | undefined;
246
248
  sender_score?: {
247
249
  score: number;
248
250
  signals: string[];
@@ -220,6 +220,8 @@ export declare const threadAnswer: ({ items, ...thread }: ThreadContext, reader:
220
220
  thread: string;
221
221
  read: boolean | null;
222
222
  flagged: boolean | null;
223
+ mail_type?: string | undefined;
224
+ reach?: string | undefined;
223
225
  sender_score?: {
224
226
  score: number;
225
227
  signals: string[];
@@ -85,6 +85,8 @@ export const messageItem = (message, reader) => {
85
85
  thread: message.email.thread,
86
86
  read: message.email.read,
87
87
  flagged: message.email.flagged,
88
+ mail_type: message.email.mailType,
89
+ reach: message.email.reach,
88
90
  sender_score: message.email.senderScore,
89
91
  },
90
92
  provider_metadata: message.providerMetadata,
@@ -224,6 +224,8 @@ export declare const writtenAnswer: ({ operationId, sendId, message, messages, s
224
224
  thread: string;
225
225
  read: boolean | null;
226
226
  flagged: boolean | null;
227
+ mail_type?: string | undefined;
228
+ reach?: string | undefined;
227
229
  sender_score?: {
228
230
  score: number;
229
231
  signals: string[];
@@ -453,6 +455,8 @@ export declare const writtenAnswer: ({ operationId, sendId, message, messages, s
453
455
  thread: string;
454
456
  read: boolean | null;
455
457
  flagged: boolean | null;
458
+ mail_type?: string | undefined;
459
+ reach?: string | undefined;
456
460
  sender_score?: {
457
461
  score: number;
458
462
  signals: string[];
@@ -73,6 +73,8 @@ export const messageHitItem = (hit, query = "") => {
73
73
  thread: hit.email.thread,
74
74
  read: hit.email.read,
75
75
  flagged: hit.email.flagged,
76
+ mail_type: hit.email.mailType,
77
+ reach: hit.email.reach,
76
78
  sender_score: hit.email.senderScore,
77
79
  }
78
80
  : undefined,
@@ -3,6 +3,7 @@ import { Command } from "commander";
3
3
  import { type TextModel } from "../embeddings/models.js";
4
4
  import type { AppIdentity } from "../ports/app.js";
5
5
  import { type TextModelSwitch } from "../services/text-model-choice.js";
6
+ import { stepLines } from "../terminal/step-lines.js";
6
7
  import { type Body } from "./envelope.js";
7
8
  /** @experimental */
8
9
  export declare const MODEL_CATALOGUE_QUERY: import("@wirecat/cli-base/query").QueryRegistry;
@@ -26,6 +27,11 @@ export interface ModelCatalogueOptions {
26
27
  }
27
28
  /** Provider composition supplies I/O and supported kinds; parsing, receipts and download policy stay shared. */
28
29
  export declare const modelCatalogueCommand: (app: AppIdentity, options: ModelCatalogueOptions) => Command;
30
+ /**
31
+ * `{"event":"progress","step":"download",…}` on stderr under --json, for a window to draw a bar by: at most every half
32
+ * second, but always the first line and the last.
33
+ */
34
+ export declare const downloadProgress: (emit: ReturnType<typeof stepLines>, label: string) => (done: number, total: number) => void;
29
35
  /** One text model as `models list`, `download`, `use` and `add` print it, in every CLI. */
30
36
  export declare const textModelItem: (model: TextModel, env: NodeJS.ProcessEnv) => {
31
37
  id: string;
@@ -205,7 +205,7 @@ const PROGRESS_EVERY_MS = 500;
205
205
  * `{"event":"progress","step":"download",…}` on stderr under --json, for a window to draw a bar by: at most every half
206
206
  * second, but always the first line and the last.
207
207
  */
208
- const downloadProgress = (emit, label) => {
208
+ export const downloadProgress = (emit, label) => {
209
209
  let last = Number.NEGATIVE_INFINITY;
210
210
  return (done, total) => {
211
211
  const now = Date.now();