@wirecat/cli-core 0.617.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.
- package/CHANGELOG.md +406 -1
- package/README.md +1 -1
- package/THIRD_PARTY_NOTICES +3 -0
- package/dist/background/backfill.d.ts +21 -0
- package/dist/background/backfill.js +41 -0
- package/dist/background/daily-archive-timer.d.ts +1 -1
- package/dist/background/deliver.d.ts +5 -2
- package/dist/background/deliver.js +30 -12
- package/dist/background/report/messages.js +4 -1
- package/dist/background/report/render.d.ts +3 -1
- package/dist/background/report/render.js +3 -1
- package/dist/background/report/view.js +4 -1
- package/dist/background/schedules.d.ts +17 -0
- package/dist/background/schedules.js +21 -8
- package/dist/calendar/cli/answers.d.ts +1 -0
- package/dist/calendar/cli/answers.js +6 -1
- package/dist/calendar/cli/index.js +2 -14
- package/dist/calendar/cli/people-link.d.ts +3 -0
- package/dist/calendar/cli/people-link.js +23 -0
- package/dist/calendar/index.d.ts +1 -1
- package/dist/calendar/index.js +1 -1
- package/dist/calendar/mcp/index.d.ts +12 -12
- package/dist/cli/base-stages-command.d.ts +22 -0
- package/dist/cli/base-stages-command.js +174 -0
- package/dist/cli/command-runs.d.ts +2 -0
- package/dist/cli/command-runs.js +3 -1
- package/dist/cli/config-command.js +6 -1
- package/dist/cli/context.d.ts +5 -0
- package/dist/cli/context.js +1 -0
- package/dist/cli/group-lock.d.ts +42 -0
- package/dist/cli/group-lock.js +130 -0
- package/dist/cli/index.d.ts +10 -4
- package/dist/cli/index.js +10 -4
- package/dist/cli/messenger/backfill-command.js +27 -15
- package/dist/cli/messenger/contacts-command.js +10 -3
- package/dist/cli/messenger/context.js +1 -0
- package/dist/cli/messenger/doctor-command.js +3 -1
- package/dist/cli/messenger/models-command.js +1 -1
- package/dist/cli/messenger/serve-command.js +24 -2
- package/dist/cli/messenger/serve-outdated.d.ts +22 -0
- package/dist/cli/messenger/serve-outdated.js +100 -0
- package/dist/cli/messenger/store-maintenance-command.d.ts +22 -2
- package/dist/cli/messenger/store-maintenance-command.js +9 -4
- package/dist/cli/model-catalogue-command.d.ts +3 -1
- package/dist/cli/model-catalogue-command.js +46 -2
- package/dist/cli/profile.d.ts +8 -0
- package/dist/cli/profile.js +25 -0
- package/dist/cli/program.js +2 -0
- package/dist/cli/runs/search-query.d.ts +1 -1
- package/dist/cli/runs/search-query.js +4 -0
- package/dist/cli/runs/search.d.ts +5 -1
- package/dist/cli/runs/search.js +12 -1
- package/dist/cli/schedule/schedule-command.d.ts +9 -0
- package/dist/cli/schedule/schedule-command.js +13 -0
- package/dist/cli/search-left-out.d.ts +6 -1
- package/dist/cli/search-left-out.js +9 -4
- package/dist/cli/settings.d.ts +8 -0
- package/dist/cli/settings.js +17 -2
- package/dist/cli/shared-command-exports.d.ts +16 -0
- package/dist/cli/store-recover.d.ts +3 -3
- package/dist/cli/store-recover.js +47 -23
- package/dist/cli/store-settings.d.ts +2 -0
- package/dist/cli/store-settings.js +37 -9
- package/dist/crm/cli/index.js +38 -6
- package/dist/crm/group-hint.d.ts +8 -0
- package/dist/crm/group-hint.js +13 -0
- package/dist/crm/source.d.ts +12 -1
- package/dist/crm/sync.d.ts +31 -2
- package/dist/crm/sync.js +110 -3
- package/dist/crm/testing/acme-scenario.d.ts +40 -0
- package/dist/crm/testing/acme-scenario.js +170 -0
- package/dist/crm/testing/index.d.ts +1 -0
- package/dist/crm/testing/index.js +1 -0
- package/dist/crm/testing/source-contract.js +12 -0
- package/dist/crm/testing/source.d.ts +2 -0
- package/dist/crm/testing/source.js +1 -0
- package/dist/domain/addresses.d.ts +13 -0
- package/dist/domain/addresses.js +63 -0
- package/dist/domain/categories.d.ts +3 -0
- package/dist/domain/categories.js +2 -0
- package/dist/domain/crm.d.ts +23 -0
- package/dist/domain/crm.js +7 -0
- package/dist/domain/links.d.ts +17 -4
- package/dist/domain/links.js +20 -7
- package/dist/domain/mentions.d.ts +2 -12
- package/dist/domain/mentions.js +2 -19
- package/dist/domain/orders.d.ts +8 -1
- package/dist/domain/orders.js +6 -2
- package/dist/domain/phones.d.ts +26 -0
- package/dist/domain/phones.js +48 -0
- package/dist/domain/record-types.d.ts +1 -1
- package/dist/domain/record-types.js +1 -0
- package/dist/domain/records.d.ts +5 -0
- package/dist/domain/ref-summaries.d.ts +39 -0
- package/dist/domain/ref-summaries.js +51 -3
- package/dist/domain/relations.d.ts +27 -2
- package/dist/domain/relations.js +37 -3
- package/dist/domain/vcard.d.ts +2 -2
- package/dist/domain/vcard.js +4 -10
- package/dist/embeddings/models.d.ts +11 -3
- package/dist/embeddings/models.js +28 -4
- package/dist/entities/business-context.d.ts +149 -0
- package/dist/entities/business-context.js +192 -0
- package/dist/entities/contact-activity.d.ts +2 -0
- package/dist/entities/contact-activity.js +7 -1
- package/dist/entities/contact-context.d.ts +157 -0
- package/dist/entities/contact-context.js +2 -0
- package/dist/entities/deal.d.ts +10 -0
- package/dist/entities/deal.js +2 -0
- package/dist/entities/index.d.ts +23 -3
- package/dist/entities/index.js +5 -0
- package/dist/entities/mention.d.ts +4 -3
- package/dist/entities/mention.js +2 -1
- package/dist/entities/message-transfer.d.ts +4 -2
- package/dist/entities/message-transfer.js +2 -2
- package/dist/entities/model.d.ts +2 -2
- package/dist/entities/model.js +1 -1
- package/dist/entities/relationship.d.ts +4 -0
- package/dist/entities/relationship.js +4 -0
- package/dist/errors/reasons.js +44 -4
- package/dist/fetch/page.js +2 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/meetings/context-store.d.ts +2 -0
- package/dist/meetings/findings-rules.d.ts +4 -0
- package/dist/meetings/findings-rules.js +5 -2
- package/dist/meetings/mcp/index.d.ts +15 -15
- package/dist/meetings/result-items.d.ts +1 -0
- package/dist/meetings/result-items.js +1 -0
- package/dist/models/index.js +22 -5
- package/dist/runs/events.d.ts +11 -1
- package/dist/runs/events.js +3 -1
- package/dist/runs/log-attributes.js +4 -0
- package/dist/runs/log-events.js +2 -0
- package/dist/runs/recording.d.ts +3 -0
- package/dist/runs/recording.js +36 -12
- package/dist/runs/run.d.ts +12 -3
- package/dist/runs/run.js +32 -13
- package/dist/search/account-list.d.ts +6 -0
- package/dist/search/account-list.js +9 -3
- package/dist/search/groups.d.ts +68 -0
- package/dist/search/groups.js +172 -0
- package/dist/services/account-groups.d.ts +28 -0
- package/dist/services/account-groups.js +89 -0
- package/dist/services/archive.d.ts +7 -1
- package/dist/services/archive.js +19 -3
- package/dist/services/business-context.d.ts +113 -0
- package/dist/services/business-context.js +156 -0
- package/dist/services/communications.d.ts +50 -0
- package/dist/services/communications.js +140 -0
- package/dist/services/deal-context.d.ts +90 -0
- package/dist/services/deal-context.js +131 -0
- package/dist/services/deps.d.ts +2 -0
- package/dist/services/enrichment.d.ts +7 -2
- package/dist/services/enrichment.js +46 -5
- package/dist/services/events-search.js +2 -1
- package/dist/services/group-guard.d.ts +28 -0
- package/dist/services/group-guard.js +131 -0
- package/dist/services/index.d.ts +15 -2
- package/dist/services/index.js +9 -2
- package/dist/services/ingest.d.ts +12 -0
- package/dist/services/ingest.js +4 -0
- package/dist/services/link-scorers/chat-senders.js +39 -29
- package/dist/services/link-scorers/member-chats.js +4 -3
- package/dist/services/link-scorers/member-dialog.js +5 -7
- package/dist/services/link-scorers/scan.js +17 -8
- package/dist/services/link-scorers/shared.d.ts +6 -2
- package/dist/services/link-scorers/shared.js +6 -2
- package/dist/services/link-scorers/types.d.ts +2 -0
- package/dist/services/meaning-model.d.ts +7 -0
- package/dist/services/meaning-model.js +20 -0
- package/dist/services/meeting-context.d.ts +6 -1
- package/dist/services/meeting-context.js +12 -5
- package/dist/services/message-resolution.js +2 -3
- package/dist/services/messages-meaning.js +4 -5
- package/dist/services/messages-search.d.ts +5 -1
- package/dist/services/messages-search.js +1 -1
- package/dist/services/model-downloads.d.ts +1 -1
- package/dist/services/model-downloads.js +6 -4
- package/dist/services/money-context.d.ts +73 -0
- package/dist/services/money-context.js +77 -0
- package/dist/services/notes-search.d.ts +4 -1
- package/dist/services/notes-search.js +19 -7
- package/dist/services/organization-context.d.ts +80 -0
- package/dist/services/organization-context.js +154 -0
- package/dist/services/people.d.ts +22 -6
- package/dist/services/people.js +38 -8
- package/dist/services/person-business.d.ts +43 -0
- package/dist/services/person-business.js +67 -0
- package/dist/services/person-context.d.ts +9 -1
- package/dist/services/person-context.js +5 -3
- package/dist/services/proposals/kinds/identity-link.d.ts +4 -0
- package/dist/services/proposals/kinds/identity-link.js +48 -0
- package/dist/services/proposals/kinds/orders.js +1 -1
- package/dist/services/proposals/registry.js +2 -0
- package/dist/services/search-kind.d.ts +12 -5
- package/dist/services/search-kind.js +49 -10
- package/dist/services/text-model-choice.js +1 -1
- package/dist/store/accounts.d.ts +18 -0
- package/dist/store/accounts.js +18 -3
- package/dist/store/damage.d.ts +43 -10
- package/dist/store/damage.js +119 -36
- package/dist/store/decisions.js +3 -1
- package/dist/store/evidence-findings.d.ts +14 -0
- package/dist/store/evidence-findings.js +2 -0
- package/dist/store/exports.d.ts +2 -1
- package/dist/store/identity-links.d.ts +92 -0
- package/dist/store/identity-links.js +6 -0
- package/dist/store/index.d.ts +11 -5
- package/dist/store/index.js +5 -2
- package/dist/store/journal.d.ts +10 -0
- package/dist/store/journal.js +33 -0
- package/dist/store/marks.d.ts +19 -1
- package/dist/store/marks.js +23 -1
- package/dist/store/migrations.d.ts +1 -1
- package/dist/store/migrations.js +35 -12
- package/dist/store/people.d.ts +22 -0
- package/dist/store/people.js +15 -1
- package/dist/store/recover.d.ts +34 -0
- package/dist/store/recover.js +188 -6
- package/dist/store/refill.d.ts +28 -0
- package/dist/store/refill.js +120 -0
- package/dist/store/sqlite/accounts.js +2 -0
- package/dist/store/sqlite/base-stages.d.ts +122 -0
- package/dist/store/sqlite/base-stages.js +443 -0
- package/dist/store/sqlite/base-suggest.d.ts +13 -0
- package/dist/store/sqlite/base-suggest.js +62 -0
- package/dist/store/sqlite/business-contracts.js +10 -1
- package/dist/store/sqlite/clients.d.ts +7 -3
- package/dist/store/sqlite/clients.js +11 -7
- package/dist/store/sqlite/crm-settings.d.ts +12 -2
- package/dist/store/sqlite/crm-settings.js +56 -13
- package/dist/store/sqlite/crm.d.ts +13 -1
- package/dist/store/sqlite/crm.js +20 -4
- package/dist/store/sqlite/deals.d.ts +33 -0
- package/dist/store/sqlite/deals.js +42 -4
- package/dist/store/sqlite/decision-requests.js +7 -3
- package/dist/store/sqlite/email-index.js +17 -15
- package/dist/store/sqlite/evidence-findings.js +29 -5
- package/dist/store/sqlite/findings-core.js +4 -2
- package/dist/store/sqlite/identity-link-rows.d.ts +50 -0
- package/dist/store/sqlite/identity-link-rows.js +146 -0
- package/dist/store/sqlite/identity-proposals.d.ts +53 -0
- package/dist/store/sqlite/identity-proposals.js +234 -0
- package/dist/store/sqlite/knowledge.js +5 -3
- package/dist/store/sqlite/link-kinds.d.ts +1 -0
- package/dist/store/sqlite/link-kinds.js +1 -0
- package/dist/store/sqlite/link-row.d.ts +6 -0
- package/dist/store/sqlite/link-row.js +35 -0
- package/dist/store/sqlite/link-source.d.ts +10 -0
- package/dist/store/sqlite/link-source.js +16 -0
- package/dist/store/sqlite/manifest.js +1 -0
- package/dist/store/sqlite/meeting-context-links.js +9 -6
- package/dist/store/sqlite/memories.js +9 -7
- package/dist/store/sqlite/mentions.d.ts +4 -1
- package/dist/store/sqlite/mentions.js +14 -9
- package/dist/store/sqlite/migrations.generated.js +8 -0
- package/dist/store/sqlite/note-index.js +9 -7
- package/dist/store/sqlite/notes.d.ts +2 -3
- package/dist/store/sqlite/notes.js +6 -29
- package/dist/store/sqlite/open-store.js +3 -0
- package/dist/store/sqlite/open.js +11 -2
- package/dist/store/sqlite/orders.d.ts +2 -0
- package/dist/store/sqlite/orders.js +9 -3
- package/dist/store/sqlite/organization-categories.d.ts +18 -0
- package/dist/store/sqlite/organization-categories.js +34 -0
- package/dist/store/sqlite/organizations.d.ts +5 -1
- package/dist/store/sqlite/organizations.js +14 -4
- package/dist/store/sqlite/person-links.d.ts +19 -4
- package/dist/store/sqlite/person-links.js +49 -11
- package/dist/store/sqlite/person-match-scan.d.ts +13 -0
- package/dist/store/sqlite/person-match-scan.js +251 -0
- package/dist/store/sqlite/person-matcher.d.ts +16 -0
- package/dist/store/sqlite/person-matcher.js +32 -0
- package/dist/store/sqlite/proposed-actions.js +6 -0
- package/dist/store/sqlite/record-matching.d.ts +2 -8
- package/dist/store/sqlite/record-matching.js +8 -40
- package/dist/store/sqlite/record-projectors-phone.js +2 -1
- package/dist/store/sqlite/record-relationships.d.ts +52 -0
- package/dist/store/sqlite/record-relationships.js +243 -0
- package/dist/store/sqlite/record-run.d.ts +5 -0
- package/dist/store/sqlite/record-run.js +62 -2
- package/dist/store/sqlite/record-writes.d.ts +1 -1
- package/dist/store/sqlite/record-writes.js +4 -2
- package/dist/store/sqlite/records.js +27 -2
- package/dist/store/sqlite/ref-accounts.d.ts +13 -0
- package/dist/store/sqlite/ref-accounts.js +117 -0
- package/dist/store/sqlite/ref-summaries.js +5 -1
- package/dist/store/sqlite/relation-list.d.ts +4 -1
- package/dist/store/sqlite/relation-list.js +20 -2
- package/dist/store/sqlite/relation-proposals.d.ts +18 -1
- package/dist/store/sqlite/relation-proposals.js +53 -11
- package/dist/store/sqlite/relation-roles.js +12 -6
- package/dist/store/sqlite/reported-relations.d.ts +11 -1
- package/dist/store/sqlite/reported-relations.js +59 -18
- package/dist/store/sqlite/schema.d.ts +32 -0
- package/dist/store/sqlite/schema.js +3 -0
- package/dist/store/sqlite/transaction.d.ts +13 -0
- package/dist/store/sqlite/transaction.js +33 -15
- package/dist/store/store.d.ts +3 -0
- package/dist/store/store.js +5 -0
- package/dist/store/write-events.d.ts +18 -0
- package/dist/store/write-events.js +88 -0
- package/package.json +3 -3
- package/parity.json +11 -4
- package/schemas/records-envelope.v1.schema.json +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,390 @@ 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
|
-
##
|
|
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.
|
|
325
|
+
|
|
326
|
+
## 0.618.0 — 09.11.2026
|
|
327
|
+
|
|
328
|
+
### Added
|
|
329
|
+
|
|
330
|
+
- **Links open a person and a project.** The v1 link grammar takes `person/<id>` and `project/<key>`
|
|
331
|
+
(`https://wirecat.dev/o#/v1/person/77`, `wirecat://open/v1/project/ACME%20site`), and `linkFor` builds them from a
|
|
332
|
+
report item's `person:<id>` and `project:<key>` refs; a project key is one encoded part. An item still opens where
|
|
333
|
+
it happened first: a person or a project ref gives its one link only when no other ref does
|
|
334
|
+
(`refsForLink(refs)`, exported). `test/fixtures/links-v1.json` has the new cases; the bounce page and WireCat
|
|
335
|
+
Desktop need them too before such a link opens there.
|
|
336
|
+
- **An agent schedule's run for a past day (`backfillSchedule`, `backfillScheduleRun`).** It runs the schedule's
|
|
337
|
+
agent as its timer does, with the same harness, flags, per-run cap and an input of the host's, and keeps the run in
|
|
338
|
+
`runs/` under the time it is given (`2026-11-05T07-30-00Z.md`, `.log`, `.jsonl`), with `"backfill": true` in its
|
|
339
|
+
`.report.json`; the report is rendered as of that time. It sends nothing, shows no notice, and leaves `last.json`,
|
|
340
|
+
`latest.md` and `latest.txt` as they are; its cost counts in today's `spend.json`. The count of runs a schedule keeps
|
|
341
|
+
(30) no longer removes a backfilled run, which is older than the runs around it. `readSchedule`, `scheduleFile`,
|
|
342
|
+
`spentToday` and `SCHEDULE_DEFAULTS` are exported from `@wirecat/cli-core/cli` for a host's own checks.
|
|
343
|
+
- **A person's engagement on a project.** `engagement` on a person's `member-of` a project: `none`, `low`,
|
|
344
|
+
`medium` or `high`, how much the owner deals with that person himself, not how active the person is; absent means
|
|
345
|
+
unknown. `relate` and `updateRelation` take it (`null` clears it), an agent's change is a `relationship_update`
|
|
346
|
+
proposal as for a role, and every relationship read carries it. It is refused on any other relationship
|
|
347
|
+
(`relationship.engagement-ends`). `byEngagement` and `engagementRank` order links high, medium, unknown, low,
|
|
348
|
+
none; `ENGAGEMENT_LEVELS` lists the levels.
|
|
349
|
+
- **A role note beside the role.** `roleNote`, up to 200 characters, says what the role means on this link in the
|
|
350
|
+
owner's words, while the role itself stays one of its list. `relate` and `updateRelation` take it; `null` clears it.
|
|
351
|
+
|
|
352
|
+
### Fixed
|
|
353
|
+
|
|
354
|
+
- **`store recover run` no longer says nothing was lost when it cannot know.** Before the copy it compares
|
|
355
|
+
each plain index of the damaged file with its table: entries the table no longer holds are rows a stale page cut
|
|
356
|
+
off, reported per table in `lost` as `gone_at_least` with the index in `seen_in`. Rows lost from a table and its
|
|
357
|
+
indexes alike leave no trace, so the notes never say "no table lost a row": they give the lower bound, or say the
|
|
358
|
+
loss is unknown, with the last deep check that passed (`last_known_good`). On six stores the cli-testing integrity
|
|
359
|
+
harness broke, it says at least 50, 200, 50 and 265 messages are gone where 50, 241, 50 and 291 are, and "unknown"
|
|
360
|
+
on the two stores whose lost rows never reached the file.
|
|
361
|
+
- **`store recover run` keeps rows that `.recover` found on pages no table claims.** It dropped them with the rest of
|
|
362
|
+
its lost-and-found table; each one now goes back into the one data table whose columns its values fit (`placed`,
|
|
363
|
+
per table), and only the rest are dropped. 9 committed messages came back on one R1 store.
|
|
364
|
+
- **After `store recover run`, the next ordinary sync fetches again what the damage may have taken.** A messenger
|
|
365
|
+
sync jumps over every stretch the store marks as fetched, so a hole inside one stayed for good. The recovery now
|
|
366
|
+
forgets what was fetched from a day before the last deep check that passed (all of it when none is on record): each
|
|
367
|
+
chat's held stretches end at its last message sent before then, and each mail folder keeps as listed only the UIDs
|
|
368
|
+
up to its last email from before then. `refetch` in the answer says how many chats and mail folders per account,
|
|
369
|
+
and the notes say what cannot come back: what only the store held, and WhatsApp history the phone does not push
|
|
370
|
+
again. Nothing on any service is asked or changed by the recovery. On the T1-roles store the cli-testing harness
|
|
371
|
+
broke with a hole of 291 messages inside a chat, one ordinary sync brought all of them back; without this, 200
|
|
372
|
+
were still missing after 25 syncs.
|
|
373
|
+
- **A `serve` no longer runs on after the store or the installed package moved past it.** Every minute it
|
|
374
|
+
checks whether the store's format is one its build can no longer write, or whether a newer version of its own
|
|
375
|
+
package is installed on disk; then it logs one error, `serve.outdated`, and exits 3, which its unit
|
|
376
|
+
(`Restart=on-failure`) answers by starting the installed build. A wa serve had stored nothing for a day on 0.30.0
|
|
377
|
+
after 0.33.0 moved the store to format 57. `outdatedReason`, `watchOutdated` and `ownPackageRoot` from
|
|
378
|
+
`@wirecat/cli-core/cli`, for a CLI with a serve of its own.
|
|
379
|
+
- **Busy sync runs no longer fail with "database is locked".** Each writable open read the schema version under the
|
|
380
|
+
write lock, without the retry other writes use, so with several tools syncing at once it gave up after 5 s. A
|
|
381
|
+
current store is now checked without the lock, and a migration takes it with the retry. Listing mail pieces to
|
|
382
|
+
embed (`mail.chunksToEmbed`, and mail search) wrote its queue bookkeeping outside a transaction; it now reads
|
|
383
|
+
first and writes through the store's transaction only when there is work. A write that had to wait for the lock
|
|
384
|
+
leaves it free for 2 ms after it commits, so a waiter gets in between one process's back-to-back writes.
|
|
385
|
+
- **The real error of a failed write is shown.** When SQLite had already rolled a transaction back itself (an I/O
|
|
386
|
+
error, a full disk), the store's own rollback failed with "cannot rollback - no transaction is active", and that
|
|
387
|
+
message replaced the real one.
|
|
388
|
+
- **`relationships scan` reads each chat once, however many times it spreads.** Each of its up to 4 passes read every
|
|
389
|
+
chat found so far again (up to 2 000 messages each) and looked up every sender's person again, so a project with
|
|
390
|
+
confirmed links took about three times longer than one without: 4.9–5.8 s against 1.6–1.9 s on a synthetic store
|
|
391
|
+
of 2 600 chats. A scan now keeps what it read until it ends: 0.6–0.8 s on the same store, with the same proposals.
|
|
9
392
|
|
|
10
393
|
## 0.617.0 — 08.11.2026
|
|
11
394
|
|
|
@@ -106,6 +489,28 @@ shape of this file.
|
|
|
106
489
|
- **`account remove` is in the messenger parity manifest** (`parity.json`), with `--keep-data`, `--delete-data`
|
|
107
490
|
and `--dry-run`, so tg, max and wa can adopt it without failing `parity:check`.
|
|
108
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
|
+
|
|
109
514
|
## 0.614.0 — 08.11.2026
|
|
110
515
|
|
|
111
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
|
|
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.
|
package/THIRD_PARTY_NOTICES
CHANGED
|
@@ -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).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AppIdentity } from "../ports/app.js";
|
|
2
|
+
import { type StoredTemplates } from "./report/render.js";
|
|
3
|
+
import { type AgentCli, type LastRun } from "./schedules.js";
|
|
4
|
+
import type { ServerSystem } from "./system.js";
|
|
5
|
+
/**
|
|
6
|
+
* One past day's run of an agent schedule, as its timer would have made it at `at`: the same harness, flags, per-run
|
|
7
|
+
* cap and input, the report rendered as of `at` and kept in `runs/` under that time, with `"backfill": true` in its
|
|
8
|
+
* `.report.json`. It sends nothing, shows no notice, and leaves `last.json` and `latest.*` as they are; its cost counts
|
|
9
|
+
* in today's spend, as any run's does.
|
|
10
|
+
*/
|
|
11
|
+
export declare const backfillSchedule: (app: AppIdentity, system: ServerSystem, env: NodeJS.ProcessEnv, file: string, { at, input, now, signal, killAfterMs, agentRuns, ownerLanguage, reportTemplates, }: {
|
|
12
|
+
at: Date;
|
|
13
|
+
/** What the agent reads on its stdin before its first turn: here, which day it writes and the window it reads. */
|
|
14
|
+
input?: string;
|
|
15
|
+
now?: () => Date;
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
killAfterMs?: number;
|
|
18
|
+
agentRuns?: readonly AgentCli[];
|
|
19
|
+
ownerLanguage?: (env: NodeJS.ProcessEnv) => Promise<string>;
|
|
20
|
+
reportTemplates?: (env: NodeJS.ProcessEnv) => StoredTemplates;
|
|
21
|
+
}) => Promise<LastRun>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { CliError } from "@wirecat/cli-base";
|
|
4
|
+
import { prepareReport } from "./report/render.js";
|
|
5
|
+
import { attemptSchedule, KILL_AFTER_MS, readSchedule, sharedLinks } from "./schedules.js";
|
|
6
|
+
/**
|
|
7
|
+
* One past day's run of an agent schedule, as its timer would have made it at `at`: the same harness, flags, per-run
|
|
8
|
+
* cap and input, the report rendered as of `at` and kept in `runs/` under that time, with `"backfill": true` in its
|
|
9
|
+
* `.report.json`. It sends nothing, shows no notice, and leaves `last.json` and `latest.*` as they are; its cost counts
|
|
10
|
+
* in today's spend, as any run's does.
|
|
11
|
+
*/
|
|
12
|
+
export const backfillSchedule = async (app, system, env, file, { at, input, now = () => new Date(), signal, killAfterMs = KILL_AFTER_MS, agentRuns = [], ownerLanguage = async () => "ru", reportTemplates, }) => {
|
|
13
|
+
const schedule = readSchedule(file);
|
|
14
|
+
if (schedule.kind !== "agent")
|
|
15
|
+
throw new CliError("validation_error", `${schedule.name} runs a command, not an agent; only an agent's report is built for a past day`);
|
|
16
|
+
const folder = join(file, "..");
|
|
17
|
+
mkdirSync(join(folder, "runs"), { recursive: true, mode: 0o700 });
|
|
18
|
+
const last = (await attemptSchedule(app, system, env, schedule, folder, {
|
|
19
|
+
now,
|
|
20
|
+
signal,
|
|
21
|
+
killAfterMs,
|
|
22
|
+
agentRuns,
|
|
23
|
+
agentInput: input === undefined ? undefined : async () => input,
|
|
24
|
+
at,
|
|
25
|
+
}));
|
|
26
|
+
if (last.exitCode !== 0)
|
|
27
|
+
return last;
|
|
28
|
+
const runEnv = { ...env, ...schedule.environment };
|
|
29
|
+
const prepared = await prepareReport(readFileSync(last.output, "utf8"), {
|
|
30
|
+
language: await ownerLanguage(runEnv).catch(() => "ru"),
|
|
31
|
+
now: at.getTime(),
|
|
32
|
+
links: sharedLinks(runEnv),
|
|
33
|
+
env: runEnv,
|
|
34
|
+
...(reportTemplates ? { templates: reportTemplates(runEnv) } : {}),
|
|
35
|
+
});
|
|
36
|
+
if (!prepared)
|
|
37
|
+
return last;
|
|
38
|
+
if (prepared.document)
|
|
39
|
+
writeFileSync(last.output.replace(/\.md$/, ".report.json"), `${JSON.stringify({ ...JSON.parse(prepared.document), backfill: true }, null, 2)}\n`, { mode: 0o600 });
|
|
40
|
+
return { ...last, report: prepared.run };
|
|
41
|
+
};
|
|
@@ -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
|
|
32
|
-
* one line sent in place of a report that failed its check is
|
|
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
|
|
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 [
|
|
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
|
|
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:
|
|
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
|
-
|
|
187
|
-
ran.code !== 0 &&
|
|
202
|
+
const refused = ran.code !== 0 &&
|
|
188
203
|
ran.code !== TIMED_OUT &&
|
|
189
|
-
|
|
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
|