@wirecat/cli-core 0.673.0 → 0.675.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 +63 -0
- package/dist/background/daily-archive-timer.d.ts +1 -1
- package/dist/cli/config-command.d.ts +6 -0
- package/dist/cli/config-command.js +1 -1
- package/dist/cli/first-run.js +2 -1
- package/dist/cli/help/sections.js +1 -0
- package/dist/cli/index.d.ts +3 -1
- package/dist/cli/index.js +3 -1
- package/dist/cli/messenger/projects-command.js +12 -4
- package/dist/cli/messenger/search-command.js +3 -1
- package/dist/cli/option-hints.d.ts +2 -0
- package/dist/cli/option-hints.js +4 -2
- package/dist/cli/project-evidence.js +1 -1
- package/dist/cli/project-status.js +1 -1
- package/dist/cli/settings.d.ts +1 -0
- package/dist/cli/settings.js +6 -3
- package/dist/cli/setup-command.d.ts +4 -0
- package/dist/cli/setup-command.js +394 -0
- package/dist/cli/shared-command-exports.d.ts +6 -0
- package/dist/cli/shared-command-exports.js +2 -0
- package/dist/cli/unknown-profile.js +1 -1
- package/dist/crm/cli/index.js +1 -0
- package/dist/entities/recorded-meeting.d.ts +2 -0
- package/dist/entities/recorded-meeting.js +3 -0
- package/dist/errors/reasons.js +7 -0
- package/dist/kit/index.d.ts +1 -0
- package/dist/kit/index.js +1 -0
- package/dist/meetings/answers.d.ts +1 -0
- package/dist/meetings/index.d.ts +3 -2
- package/dist/meetings/index.js +2 -1
- package/dist/meetings/item.d.ts +17 -1
- package/dist/meetings/item.js +16 -0
- package/dist/meetings/model.d.ts +23 -0
- package/dist/meetings/model.js +2 -1
- package/dist/meetings/pull.js +1 -0
- package/dist/meetings/store.d.ts +1 -1
- package/dist/oauth/storage.js +3 -1
- package/dist/services/metadata.d.ts +1 -1
- package/dist/services/person-meetings.d.ts +3 -0
- package/dist/services/person-meetings.js +3 -1
- package/dist/services/project-purposes.d.ts +1 -1
- package/dist/services/project-purposes.js +2 -2
- package/dist/setup/answers.d.ts +58 -0
- package/dist/setup/answers.js +194 -0
- package/dist/setup/define.d.ts +60 -0
- package/dist/setup/define.js +214 -0
- package/dist/setup/document.d.ts +205 -0
- package/dist/setup/document.js +215 -0
- package/dist/setup/files.d.ts +6 -0
- package/dist/setup/files.js +46 -0
- package/dist/store/index.d.ts +1 -0
- package/dist/store/people.d.ts +14 -0
- package/dist/store/people.js +8 -1
- package/dist/store/sqlite/facts.d.ts +28 -4
- package/dist/store/sqlite/facts.js +56 -6
- package/dist/store/sqlite/identity-rekey.d.ts +46 -0
- package/dist/store/sqlite/identity-rekey.js +191 -0
- package/dist/store/sqlite/manifest.js +1 -0
- package/dist/store/sqlite/meeting-reads.js +1 -1
- package/dist/store/sqlite/meeting-values.d.ts +2 -1
- package/dist/store/sqlite/meeting-values.js +23 -1
- package/dist/store/sqlite/meetings.js +10 -3
- package/dist/store/sqlite/migrations.generated.js +9 -0
- package/dist/store/sqlite/note-search.js +2 -2
- package/dist/store/sqlite/notes.d.ts +3 -1
- package/dist/store/sqlite/notes.js +8 -6
- package/dist/store/sqlite/schema.d.ts +153 -0
- package/dist/store/sqlite/schema.js +12 -0
- package/dist/store/sqlite/things.d.ts +2 -0
- package/dist/store/sqlite/things.js +5 -0
- package/dist/store/sqlite/vectors.js +5 -3
- package/dist/terminal/sign-in-steps.d.ts +12 -1
- package/dist/terminal/sign-in-steps.js +3 -3
- package/package.json +2 -2
- package/parity.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,69 @@ 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
|
+
## 0.675.0 — 16.11.2026
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **`--from` on a search names the sender, not a date.** `search all`, `search messages` and `search conversations`
|
|
13
|
+
answer `--from`, `--sender` and `--author` with `from:<sender>` in the query (in `--filter` for conversations),
|
|
14
|
+
as `from:me` finds what the owner wrote. 0.672.0 answered `--from` with where the dates go.
|
|
15
|
+
- **`search conversations` no longer spends seconds working out which chats are behind.** The check behind the
|
|
16
|
+
"changed since the last build" hint read every chunk of the store once per built chat, because SQLite chose the
|
|
17
|
+
wrong table to start from. It now reads only the chat's own conversations. On a store with about 950,000 messages a
|
|
18
|
+
warm search went from about 12 s to about 3 s. `conversations status` and `conversations embed` use the same query
|
|
19
|
+
and are faster too.
|
|
20
|
+
|
|
21
|
+
## 0.674.0 — 16.11.2026
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- **`store.people.rekeyIdentities(provider, pairs, { lockMs, by })`** moves a provider's identities from old
|
|
26
|
+
external ids to new ones, such as a phone number written another way; each pair is `{ from, to, phone? }`. With the
|
|
27
|
+
new id not stored, the identity takes it and the phone (`renamed`). With it stored, the old identity merges into it
|
|
28
|
+
(`merged`): its person merges with the kept one's (the owner's person stays), and every row that points at it moves,
|
|
29
|
+
found from the foreign keys to `identities` and the `<x>_type = 'identity'` pointers, so a table added later is
|
|
30
|
+
covered too. A row the kept identity already has under a unique key folds into that twin, which keeps its values and
|
|
31
|
+
takes the ones it lacks; a pair that would drop a row is refused (`identity.merge-conflict`) and left as it was.
|
|
32
|
+
Proposals that name the identity follow it. A missing `from` or `from` equal to `to` is `unchanged`, an empty `to`
|
|
33
|
+
is `skipped`, so a second run is all `unchanged`. Each pair is its own savepoint; a pass stops after `lockMs` (250 by
|
|
34
|
+
default) and says how far it got in `taken`. Then the phone rule links the renamed and merged identities to the
|
|
35
|
+
people with their number, as a meetings sync does.
|
|
36
|
+
- **A removed fact is logged, never its content** (store version 67, `fact_removals`). `store.facts.remove(ref, by,
|
|
37
|
+
reason?)` writes one row per removal: the fact's id, the reference of what it was about, who removed it (`owner` or
|
|
38
|
+
`agent`, with the agent's handle), when, and the reason. The fact's text and value are not copied: removing still
|
|
39
|
+
forgets them. `store.facts.removed({ limit, offset })` reads the log, newest first.
|
|
40
|
+
- **`store.facts.reverse(ref, by, reason?)` keeps the reason** on the reversed decision, read back as `reversal`
|
|
41
|
+
(`by`, `bot`, `at`, `reason`).
|
|
42
|
+
- **A phone call's fields on its meeting** (store version 67, `meetings.direction` and `client_phone`). A phone-line
|
|
43
|
+
source sets `SourceMeeting.call` (`direction`, `in` or `out`, and `clientPhone`) and marks the participant who took
|
|
44
|
+
or made the call with the role `manager`. `meetings list`, `meetings show` and the `meetings` arrays of the deal,
|
|
45
|
+
lead, person and organization contexts then carry `call`: `direction`, `manager` (`name`, `person`) and
|
|
46
|
+
`client_phone`. A meeting has no `call`; zoom and the other meeting sources change nothing.
|
|
47
|
+
- **A note read gives back its first subject** (`Note.subject`). `addNote` keeps the first `about` on the note, not as
|
|
48
|
+
a link, so an export that writes a note's links could not see it; `null` for a note to self, a note about the
|
|
49
|
+
owner, and a document.
|
|
50
|
+
- **"Name a profile" carries a reason**, `profile.missing`, so a caller matches the reason and not the text.
|
|
51
|
+
- **A CLI describes its connection flow as data, and WireCat Desktop draws it.** `defineSetup({ app, configuration,
|
|
52
|
+
start, steps, texts, check })` builds a WireCat setup document (version 1) and checks it at once: every step
|
|
53
|
+
reachable, every setting declared, every text in English, the reserved roles and display classes, the limits.
|
|
54
|
+
`setupCommand(setup)` gives the CLI `setup show` (the document; with a profile its values, a secret only as
|
|
55
|
+
`{ set: true }`), `setup apply` (`--dry-run` checks the answers on stdin per input with each setting's own schema and
|
|
56
|
+
saves nothing), `setup run apply --json --answer-stdin` (Desktop's step: the CLI's check, then the settings and the
|
|
57
|
+
secrets saved, nothing when the check fails) and `<profile> setup`, the same questions in the terminal. Answers on
|
|
58
|
+
steps the path does not visit are dropped. The JSON Schema and three example documents are the fixture Desktop
|
|
59
|
+
copies, `test/fixtures/setup-v1/`; `setupFileProblems` checks the flow's images from the CLI's own test. See
|
|
60
|
+
`docs/setup.md`.
|
|
61
|
+
- **`settingsFor(…).settingSchema(key)`** gives one profile setting's own valibot schema, to check a single value.
|
|
62
|
+
|
|
63
|
+
### Changed — may break callers
|
|
64
|
+
|
|
65
|
+
- **`projects evidence` and `projects status` take `--purposes`** for the comma list of purposes to read, as the
|
|
66
|
+
family's flags name a list. `--purpose` still works, hidden from help, the command
|
|
67
|
+
catalogue and MCP, and is deprecated: it goes in a later version. A refusal of an unknown purpose names
|
|
68
|
+
`details.param: "purposes"`.
|
|
69
|
+
- **`Note` has a required `subject`.** Code that builds a `Note` itself adds it.
|
|
70
|
+
|
|
8
71
|
## 0.673.0 — 16.11.2026
|
|
9
72
|
|
|
10
73
|
### Added
|
|
@@ -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;
|
|
@@ -24,3 +24,9 @@ export declare const configCommand: (app: AppIdentity, config: Configuration, {
|
|
|
24
24
|
* comes as `permissions.<key>` or inside a whole `permissions` object.
|
|
25
25
|
*/
|
|
26
26
|
export declare const refuseUnknownKey: (command: Command, setting: string, value: string, permissionKey?: PermissionKeySource) => void;
|
|
27
|
+
/**
|
|
28
|
+
* An agent may hold `mcp.authority` or `bot.api` and change other settings, but never the key that let it in: on any
|
|
29
|
+
* profile, in the defaults, or by replacing `permissions` whole. Only the owner, in a terminal, turns it on or off
|
|
30
|
+
* (NEED-1662, NEED-1679).
|
|
31
|
+
*/
|
|
32
|
+
export declare const refuseGuardedKey: (setting: string, value: string | undefined, ownerOnly: OwnerOnlySettings) => void;
|
|
@@ -245,7 +245,7 @@ export const refuseUnknownKey = (command, setting, value, permissionKey) => {
|
|
|
245
245
|
* profile, in the defaults, or by replacing `permissions` whole. Only the owner, in a terminal, turns it on or off
|
|
246
246
|
* (NEED-1662, NEED-1679).
|
|
247
247
|
*/
|
|
248
|
-
const refuseGuardedKey = (setting, value, ownerOnly) => {
|
|
248
|
+
export const refuseGuardedKey = (setting, value, ownerOnly) => {
|
|
249
249
|
if (ownerOnly.settings?.includes(setting))
|
|
250
250
|
throw new CliError("permission_error", `an agent cannot change ${setting} — the owner sets it in a terminal`, {
|
|
251
251
|
setting,
|
package/dist/cli/first-run.js
CHANGED
|
@@ -213,7 +213,8 @@ export const setupAtStart = async (start) => {
|
|
|
213
213
|
command: start.command,
|
|
214
214
|
env: start.env,
|
|
215
215
|
contentLanguages: start.contentLanguages,
|
|
216
|
-
|
|
216
|
+
// `setup describe` and `setup apply` are a program's; only the bare walk-through asks everything again.
|
|
217
|
+
all: start.path.length === 1 && start.path[0] === "setup",
|
|
217
218
|
io: {
|
|
218
219
|
ask: async (prompt) => (await import("../terminal/prompt.js")).readSecret(prompt, { input, echo: true }),
|
|
219
220
|
say: (text) => process.stderr.write(`${text}\n`),
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -45,6 +45,8 @@ export { withoutPhone } from "../services/people.js";
|
|
|
45
45
|
export { unanswered } from "../services/questions.js";
|
|
46
46
|
export { openRequestTask } from "../services/task-rules.js";
|
|
47
47
|
export { TASK_PAIR_QUERY, TASK_QUERY } from "../services/tasks.js";
|
|
48
|
+
export { defineSetup, type Setup, type SetupCheck, type SetupCheckInput, type SetupDefinition, setupProblems, } from "../setup/define.js";
|
|
49
|
+
export { type Asset as SetupAsset, BLOCK_ROLES, BLOCK_TYPES, type Block as SetupBlock, BUILT_IN_ACTIONS, type Condition as SetupCondition, DISPLAY_CLASSES, INPUT_KINDS, SETUP_FORMAT, SETUP_LIMITS, SETUP_PATTERNS, SETUP_VERSION, type SetupDocument, type Step as SetupStep, setupDocumentSchema, setupJsonSchema, } from "../setup/document.js";
|
|
48
50
|
export { answerStdinOption, type Need, type SignInSteps, type SignInStepsOptions, signInSteps, } from "../terminal/sign-in-steps.js";
|
|
49
51
|
export { type AccountRemoval, type AccountRemovalContext, type AccountRemoveOptions, type AccountSecrets, accountRemoveCommand, mayRevoke, type SignedOut, } from "./account-remove.js";
|
|
50
52
|
export { liftOptionsAfterDashes } from "./after-dashes.js";
|
|
@@ -151,7 +153,7 @@ export { type DeclaredSetting, type SettingRow, settingRows, withSettingDefaults
|
|
|
151
153
|
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";
|
|
152
154
|
export { type PermissionAnswer, readSetupAnswers, type SetupAnswers, setupPermissionCeiling } from "./setup-answers.js";
|
|
153
155
|
export { AGENTS, type Agent, agentFor, screenFor } from "./setup-screen.js";
|
|
154
|
-
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, metadataCommand, modelCatalogueCommand, modelsCommand, pinCommand, pollsCommand, projectsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, runsCommand, scheduleCommand, scheduleCommandFor, searchCommand, searchesCommand, sendCommand, sendsCommand, serveCommand, serverCommand, 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, editCommand, floodCommand, forwardCommand, generatedApiCommand, guideCommand, imagesCommand, inboxCommand, markReadCommand, mcpCommand, mentionsCommand, messagesCommand, metadataCommand, modelCatalogueCommand, modelsCommand, pinCommand, pollsCommand, projectsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, runsCommand, scheduleCommand, scheduleCommandFor, searchCommand, searchesCommand, sendCommand, sendsCommand, serveCommand, serverCommand, setupCommand, skillCommand, starCommands, statsCommand, stickersCommand, storeCommand, tagsCommand, tasksCommand, tasksStatsCommand, templatesCommand, topicsCommand, unpinCommand, upgradeCommand, watchCommand, } from "./shared-command-exports.js";
|
|
155
157
|
export { assertSharedContracts, customizeSharedCommand, hasSharedContract, overrideSharedContract, type SharedContractOverride, sharedContractOverrides, sharedContracts, } from "./shared-contracts.js";
|
|
156
158
|
export { runnable, withSafety } from "./steps.js";
|
|
157
159
|
export { type StoreInfo, sharedStoreCommand, storeInfo, storeInfoCommand } from "./store-info.js";
|
package/dist/cli/index.js
CHANGED
|
@@ -40,6 +40,8 @@ export { withoutPhone } from "../services/people.js";
|
|
|
40
40
|
export { unanswered } from "../services/questions.js";
|
|
41
41
|
export { openRequestTask } from "../services/task-rules.js";
|
|
42
42
|
export { TASK_PAIR_QUERY, TASK_QUERY } from "../services/tasks.js";
|
|
43
|
+
export { defineSetup, setupProblems, } from "../setup/define.js";
|
|
44
|
+
export { BLOCK_ROLES, BLOCK_TYPES, BUILT_IN_ACTIONS, DISPLAY_CLASSES, INPUT_KINDS, SETUP_FORMAT, SETUP_LIMITS, SETUP_PATTERNS, SETUP_VERSION, setupDocumentSchema, setupJsonSchema, } from "../setup/document.js";
|
|
43
45
|
export { answerStdinOption, signInSteps, } from "../terminal/sign-in-steps.js";
|
|
44
46
|
export { accountRemoveCommand, mayRevoke, } from "./account-remove.js";
|
|
45
47
|
export { liftOptionsAfterDashes } from "./after-dashes.js";
|
|
@@ -140,7 +142,7 @@ export { settingRows, withSettingDefaults } from "./setting-defaults.js";
|
|
|
140
142
|
export { count, first, flag, fromFile, NONE_NAMED, namedProfile, plain, settingsFor, } from "./settings.js";
|
|
141
143
|
export { readSetupAnswers, setupPermissionCeiling } from "./setup-answers.js";
|
|
142
144
|
export { AGENTS, agentFor, screenFor } from "./setup-screen.js";
|
|
143
|
-
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, metadataCommand, modelCatalogueCommand, modelsCommand, pinCommand, pollsCommand, projectsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, runsCommand, scheduleCommand, scheduleCommandFor, searchCommand, searchesCommand, sendCommand, sendsCommand, serveCommand, serverCommand, skillCommand, starCommands, statsCommand, stickersCommand, storeCommand, tagsCommand, tasksCommand, tasksStatsCommand, templatesCommand, topicsCommand, unpinCommand, upgradeCommand, watchCommand, } from "./shared-command-exports.js";
|
|
145
|
+
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, metadataCommand, modelCatalogueCommand, modelsCommand, pinCommand, pollsCommand, projectsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, runsCommand, scheduleCommand, scheduleCommandFor, searchCommand, searchesCommand, sendCommand, sendsCommand, serveCommand, serverCommand, setupCommand, skillCommand, starCommands, statsCommand, stickersCommand, storeCommand, tagsCommand, tasksCommand, tasksStatsCommand, templatesCommand, topicsCommand, unpinCommand, upgradeCommand, watchCommand, } from "./shared-command-exports.js";
|
|
144
146
|
export { assertSharedContracts, customizeSharedCommand, hasSharedContract, overrideSharedContract, sharedContractOverrides, sharedContracts, } from "./shared-contracts.js";
|
|
145
147
|
export { runnable, withSafety } from "./steps.js";
|
|
146
148
|
export { sharedStoreCommand, storeInfo, storeInfoCommand } from "./store-info.js";
|
|
@@ -62,6 +62,12 @@ const archiveFetcher = (withServices, messenger) => {
|
|
|
62
62
|
},
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
+
/** The purposes asked: `--purposes`, and the hidden `--purpose` it replaced, kept for one version. */
|
|
66
|
+
const purposesAsked = (options) => [
|
|
67
|
+
...options.purposes,
|
|
68
|
+
...(options.purpose ?? []),
|
|
69
|
+
];
|
|
70
|
+
const oldPurpose = () => new Option("--purpose <purposes>", "replaced by --purposes; kept for one version").argParser(purposeList).hideHelp();
|
|
65
71
|
const purposeHelp = (messenger) => `the linked chats' purposes to read, comma separated (${(messenger.purposes?.purposes ?? BUILT_IN_PURPOSES).join(", ")}), ` +
|
|
66
72
|
"or all; the configured defaults if not given, and a chat left out is counted, never dropped silently";
|
|
67
73
|
/** Off MCP: a tool call ends at about a minute, too soon for a sync, which would fail the whole answer. */
|
|
@@ -91,7 +97,8 @@ export const projectsCommand = (messenger) => {
|
|
|
91
97
|
.option("--alias <name>", "another name of the project, searched on its own; repeat for more", collect, [])
|
|
92
98
|
.option("--context-query <words>", "more words that all appear in one text; repeat for another", collect, [])
|
|
93
99
|
.option("--contact <person>", "a name to search, or person:<id> to read what that person wrote", collect, [])
|
|
94
|
-
.option("--
|
|
100
|
+
.option("--purposes <purposes>", purposeHelp(messenger), purposeList, [])
|
|
101
|
+
.addOption(oldPurpose())
|
|
95
102
|
.option("--include-proposed", "also read chats and members proposed for the project and not yet confirmed; each item they bring is marked")
|
|
96
103
|
.option("--since-time <time>", "how far back: days (90d, at most 730d) or a start date (2026-09-01)", "60d")
|
|
97
104
|
.option("--before-time <time>", "fixed exclusive end: ISO 8601 timestamp with UTC offset")
|
|
@@ -121,7 +128,7 @@ export const projectsCommand = (messenger) => {
|
|
|
121
128
|
...(options.contact.length ? { people: options.contact } : {}),
|
|
122
129
|
...(options.maxPages === undefined ? {} : { maxReads: options.maxPages }),
|
|
123
130
|
...(options.cursor === undefined ? {} : { checkpoint: options.cursor }),
|
|
124
|
-
...(options.
|
|
131
|
+
...(purposesAsked(options).length ? { purposes: purposesAsked(options) } : {}),
|
|
125
132
|
...(messenger.purposes ? { purposeConfig: messenger.purposes } : {}),
|
|
126
133
|
...(options.includeProposed ? { includeProposed: true } : {}),
|
|
127
134
|
...(fetcher ? { fetcher, maxFetchMs, onFetchProgress: progressNote(context.renderer.note) } : {}),
|
|
@@ -167,7 +174,8 @@ const statusCommand = (messenger) => answerEntity(annotate(new Command("status")
|
|
|
167
174
|
.argument("<project>", "an existing project's id, key, exact name or alias")
|
|
168
175
|
.option("--since-time <time>", "how far back: days (60d, at most 730d) or a start date (2026-09-01)", "60d")
|
|
169
176
|
.option("--before-time <time>", "fixed exclusive end: ISO 8601 timestamp with UTC offset")
|
|
170
|
-
.option("--
|
|
177
|
+
.option("--purposes <purposes>", purposeHelp(messenger), purposeList, [])
|
|
178
|
+
.addOption(oldPurpose())
|
|
171
179
|
.option("--context-query <words>", "words that all appear in one text; reports their last mention per side. Repeat for another", collect, [])
|
|
172
180
|
.action(async function (project) {
|
|
173
181
|
const options = this.opts();
|
|
@@ -181,7 +189,7 @@ const statusCommand = (messenger) => answerEntity(annotate(new Command("status")
|
|
|
181
189
|
...projectWindowOf(options.sinceTime),
|
|
182
190
|
...(options.beforeTime === undefined ? {} : { asOf: projectCutoffTime(options.beforeTime) }),
|
|
183
191
|
contextQueries: options.contextQuery,
|
|
184
|
-
...(options.
|
|
192
|
+
...(purposesAsked(options).length ? { purposes: purposesAsked(options) } : {}),
|
|
185
193
|
...(messenger.purposes ? { purposeConfig: messenger.purposes } : {}),
|
|
186
194
|
});
|
|
187
195
|
});
|
|
@@ -5,7 +5,7 @@ import { SAVE_HELP } from "../../meetings/index.js";
|
|
|
5
5
|
import { searchNotesOf } from "../../services/notes-search.js";
|
|
6
6
|
import { LOCAL_READ, REMOTE_READ } from "../effects.js";
|
|
7
7
|
import { renderAnswer } from "../envelope.js";
|
|
8
|
-
import { AROUND_HINT, END_FLAGS, hintsFor, START_FLAGS, withOptionHints } from "../option-hints.js";
|
|
8
|
+
import { AROUND_HINT, END_FLAGS, hintsFor, SENDER_FLAGS, START_FLAGS, withOptionHints } from "../option-hints.js";
|
|
9
9
|
import { positiveCount } from "../paging.js";
|
|
10
10
|
import { runsSearchCommand } from "../runs/search-command.js";
|
|
11
11
|
import { commandAt } from "../steps.js";
|
|
@@ -198,6 +198,7 @@ export const searchCommand = (messenger, { topics = false } = {}) => {
|
|
|
198
198
|
: {
|
|
199
199
|
"--chat": `search in one chat with chat:<chat> in the query: search ${path} 'chat:<chat> words'`,
|
|
200
200
|
"--around": AROUND_HINT,
|
|
201
|
+
...hintsFor(SENDER_FLAGS, `the sender goes in the query: search ${path} 'from:<sender> words' (from:me for you)`),
|
|
201
202
|
}),
|
|
202
203
|
...(path === "all" ? {} : { "--only": ONLY_HINT }),
|
|
203
204
|
});
|
|
@@ -209,6 +210,7 @@ export const searchCommand = (messenger, { topics = false } = {}) => {
|
|
|
209
210
|
...hintsFor(END_FLAGS, "put the end in the filter: --filter 'date<2026-10-20'"),
|
|
210
211
|
"--around": AROUND_HINT,
|
|
211
212
|
"--only": ONLY_HINT,
|
|
213
|
+
...hintsFor(SENDER_FLAGS, "the sender goes in the filter: --filter 'from:<sender>' (from:me for you)"),
|
|
212
214
|
});
|
|
213
215
|
return search;
|
|
214
216
|
};
|
|
@@ -9,4 +9,6 @@ export declare const hintsFor: (flags: readonly string[], hint: string) => Recor
|
|
|
9
9
|
/** Date flags agents guess; commander would suggest an unrelated near name (`--since` → `--source`). */
|
|
10
10
|
export declare const START_FLAGS: string[];
|
|
11
11
|
export declare const END_FLAGS: string[];
|
|
12
|
+
/** In a message search `--from` means the sender, as `from:` does in the query, never a date. */
|
|
13
|
+
export declare const SENDER_FLAGS: string[];
|
|
12
14
|
export declare const AROUND_HINT: string;
|
package/dist/cli/option-hints.js
CHANGED
|
@@ -16,7 +16,9 @@ export const withOptionHints = (command, hints) => {
|
|
|
16
16
|
/** The same hint for each of these flags. */
|
|
17
17
|
export const hintsFor = (flags, hint) => Object.fromEntries(flags.map((flag) => [flag, hint]));
|
|
18
18
|
/** Date flags agents guess; commander would suggest an unrelated near name (`--since` → `--source`). */
|
|
19
|
-
export const START_FLAGS = ["--since", "--after", "--
|
|
20
|
-
export const END_FLAGS = ["--until", "--before", "--
|
|
19
|
+
export const START_FLAGS = ["--since", "--after", "--since-date", "--after-date", "--start"];
|
|
20
|
+
export const END_FLAGS = ["--until", "--before", "--until-date", "--before-date", "--end"];
|
|
21
|
+
/** In a message search `--from` means the sender, as `from:` does in the query, never a date. */
|
|
22
|
+
export const SENDER_FLAGS = ["--from", "--sender", "--author"];
|
|
21
23
|
export const AROUND_HINT = "read the messages either side of one: messages context <hit ref> --before-n 5 --after-n 5 " +
|
|
22
24
|
"(or messages context <chat> <message>)";
|
|
@@ -78,7 +78,7 @@ export const withSyncCommands = (found, sync, read) => ({
|
|
|
78
78
|
/** One line for a chat left out by its purpose: what it holds in the window and how to read it. */
|
|
79
79
|
const leftOutLine = (one, read) => `${one.title ? `«${one.title}» (${one.ref})` : one.ref}, purpose ${one.purpose}` +
|
|
80
80
|
`${one.proposed ? `, proposed ${one.proposed}` : ""}, not read: ${heldInWindow(one)}` +
|
|
81
|
-
(read ? `; read it: ${read}` : `; add --
|
|
81
|
+
(read ? `; read it: ${read}` : `; add --purposes ${one.purpose} to read it here`);
|
|
82
82
|
const purposeHintLine = (hint) => `${hint.chat} gave ${hint.items} of ${hint.of} items by membership alone; if it is not a work chat, ask the owner ` +
|
|
83
83
|
`to set its purpose: memo relationships update ${hint.relationship} --purpose <purpose>`;
|
|
84
84
|
const LABELS = {
|
|
@@ -107,7 +107,7 @@ export const heldInWindow = (one) => one.messages && one.firstAt && one.lastAt
|
|
|
107
107
|
? `${one.messages} message${one.messages === 1 ? "" : "s"} ${day(one.firstAt)}…${day(one.lastAt)}`
|
|
108
108
|
: "no messages in the window";
|
|
109
109
|
const leftOutWhy = (one, read) => `${one.chat}, purpose ${one.purpose}, not read: ${heldInWindow(one)}` +
|
|
110
|
-
(read ? `; read it: ${read}` : "; add its purpose to --
|
|
110
|
+
(read ? `; read it: ${read}` : "; add its purpose to --purposes to read it");
|
|
111
111
|
const missingOf = (found, hints) => {
|
|
112
112
|
const held = found.chats.filter((chat) => partial(found, chat));
|
|
113
113
|
const [first] = held;
|
package/dist/cli/settings.d.ts
CHANGED
|
@@ -241,6 +241,7 @@ export declare const fromFile: <T>(settings: Pick<Settings, "configured" | "shar
|
|
|
241
241
|
export declare const settingsFor: <T extends object = Record<never, never>>(app: AppIdentity, extension?: SettingsExtension<T>) => {
|
|
242
242
|
resolveSettings: (flags?: GlobalFlags, options?: ResolveOptions) => Settings & T;
|
|
243
243
|
configuredProfiles: (options?: ResolveOptions) => string[];
|
|
244
|
+
settingSchema: (key: string) => v.GenericSchema | undefined;
|
|
244
245
|
changeSetting: (path: string, { profile, setting, value, kind, root, }: {
|
|
245
246
|
profile: string | undefined;
|
|
246
247
|
setting: string;
|
package/dist/cli/settings.js
CHANGED
|
@@ -198,14 +198,14 @@ export class NoProfileHere extends CliError {
|
|
|
198
198
|
app;
|
|
199
199
|
constructor(app) {
|
|
200
200
|
super("validation_error", `name a profile: there is none on this computer yet — create one with \`${app.command} personal setup\` ` +
|
|
201
|
-
"(any name in place of personal)", { profiles: [] });
|
|
201
|
+
"(any name in place of personal)", { reason: "profile.missing", profiles: [] });
|
|
202
202
|
this.app = app;
|
|
203
203
|
}
|
|
204
204
|
/** `words`: the command that was typed, without its arguments, so the suggestion runs as written. */
|
|
205
205
|
withoutSetup(words) {
|
|
206
206
|
const command = words ? `${this.app.command} personal ${words}` : `${this.app.command} personal …`;
|
|
207
207
|
return new CliError("validation_error", `name a profile: there is none on this computer yet — any name works, such as \`${command}\` ` +
|
|
208
|
-
`(or set ${envName(this.app, "PROFILE")})`, { profiles: [] });
|
|
208
|
+
`(or set ${envName(this.app, "PROFILE")})`, { reason: "profile.missing", profiles: [] });
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
/** The first candidate that is set, and which layer it came from. */
|
|
@@ -306,7 +306,7 @@ export const settingsFor = (app, extension = {}) => {
|
|
|
306
306
|
const here = profilesOf(config, env);
|
|
307
307
|
if (here.length === 0)
|
|
308
308
|
throw new NoProfileHere(app);
|
|
309
|
-
throw new CliError("validation_error", `name a profile: \`${app.command} <profile> …\` — profiles here: ${here.join(", ")} (or set ${PROFILE})`, { profiles: here });
|
|
309
|
+
throw new CliError("validation_error", `name a profile: \`${app.command} <profile> …\` — profiles here: ${here.join(", ")} (or set ${PROFILE})`, { reason: "profile.missing", profiles: here });
|
|
310
310
|
};
|
|
311
311
|
const profilesOf = (config, env) => profilesHere(app, [...namedProfiles(config), ...(extension.profiles?.(env) ?? [])], env);
|
|
312
312
|
const botsOf = (config, env) => [...new Set([...Object.keys(config.bot?.profiles ?? {}), ...registryProfiles(app, env)])].sort();
|
|
@@ -589,9 +589,12 @@ export const settingsFor = (app, extension = {}) => {
|
|
|
589
589
|
saveConfigFile(path, config);
|
|
590
590
|
return added;
|
|
591
591
|
};
|
|
592
|
+
/** One profile setting's own schema, for a check of a single value (a setup answer); `undefined` for none. */
|
|
593
|
+
const settingSchema = (key) => Object.hasOwn(profileEntries, key) ? profileEntries[key] : undefined;
|
|
592
594
|
return {
|
|
593
595
|
resolveSettings,
|
|
594
596
|
configuredProfiles,
|
|
597
|
+
settingSchema,
|
|
595
598
|
changeSetting,
|
|
596
599
|
migrate,
|
|
597
600
|
declaredSettings,
|