@wirecat/cli-core 0.671.0 → 0.672.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
CHANGED
|
@@ -5,6 +5,18 @@ 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.672.0 — 16.11.2026
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **An option an agent guesses on a search or a message read fails with the form that runs.** `search all`, `search
|
|
13
|
+
messages`, `search notes` and `search conversations` answer `--since`, `--after`, `--until`, `--before` (and
|
|
14
|
+
`--from`, `--to`) with where the date goes (`date>=…` in the query, or `--since-time` and `--filter` for
|
|
15
|
+
conversations), `--around` with `messages context <hit ref> --before-n 5 --after-n 5`, and `--only` with
|
|
16
|
+
`search all … --only`. `messages list`, `show` and `context` answer `--chat` with the chat as the first argument,
|
|
17
|
+
and `context` answers `--before` and `--after` with `--before-n` and `--after-n`. Before, commander said a bare
|
|
18
|
+
"unknown option", or suggested an unrelated near name (`--since` → `--source`); each guess cost an agent a call.
|
|
19
|
+
|
|
8
20
|
## 0.671.0 — 15.11.2026
|
|
9
21
|
|
|
10
22
|
### Changed — may break callers
|
|
@@ -12,7 +12,7 @@ import { modelWith, spoken } from "../../speech/hearing.js";
|
|
|
12
12
|
import { REMOTE_READ } from "../effects.js";
|
|
13
13
|
import { itemOf, listOf, renderAnswer } from "../envelope.js";
|
|
14
14
|
import { queryHelp } from "../list-query.js";
|
|
15
|
-
import { withOptionHints } from "../option-hints.js";
|
|
15
|
+
import { AROUND_HINT, END_FLAGS, hintsFor, START_FLAGS, withOptionHints } from "../option-hints.js";
|
|
16
16
|
import { positiveCount } from "../paging.js";
|
|
17
17
|
import { marksUntrusted } from "../untrusted-marks.js";
|
|
18
18
|
import { syncCommand } from "./backfill-command.js";
|
|
@@ -101,7 +101,11 @@ export const messagesCommand = (messenger) => {
|
|
|
101
101
|
}), () => renderMessages(spokenItems(page.items, hearing), viewOf(context, messenger)));
|
|
102
102
|
});
|
|
103
103
|
annotate(list, { output: { entity: "message" }, query: history });
|
|
104
|
-
withOptionHints(list,
|
|
104
|
+
withOptionHints(list, {
|
|
105
|
+
...hintsFor([...TIME_FLAGS, ...START_FLAGS, ...END_FLAGS], `messages list reads a window by its query: '${WINDOW_EXAMPLE}'`),
|
|
106
|
+
"--chat": CHAT_FIRST("list"),
|
|
107
|
+
"--around": AROUND_HINT,
|
|
108
|
+
});
|
|
105
109
|
const readWindow = async (command, chat, message, window) => {
|
|
106
110
|
const context = messengerContext(command, messenger);
|
|
107
111
|
const { found, reader } = await context.withServices(async (services) => ({
|
|
@@ -198,8 +202,18 @@ export const messagesCommand = (messenger) => {
|
|
|
198
202
|
messages.addCommand(commentsCommand(messenger));
|
|
199
203
|
messages.addCommand(linksCommand(messenger));
|
|
200
204
|
messages.addCommand(syncCommand(messenger));
|
|
205
|
+
for (const name of ["show", "context"]) {
|
|
206
|
+
const command = messages.commands.find((one) => one.name() === name);
|
|
207
|
+
if (command)
|
|
208
|
+
withOptionHints(command, {
|
|
209
|
+
"--chat": CHAT_FIRST(name),
|
|
210
|
+
"--around": name === "show" ? AROUND_HINT : "the window is around the message already; --before-n 5 --after-n 5",
|
|
211
|
+
...(name === "context" ? { "--before": "--before-n <n>", "--after": "--after-n <n>" } : {}),
|
|
212
|
+
});
|
|
213
|
+
}
|
|
201
214
|
return hideNever(messenger, messages);
|
|
202
215
|
};
|
|
216
|
+
const CHAT_FIRST = (name) => `the chat is the first argument: messages ${name} <chat>${name === "list" ? "" : " <message>, or a hit's msg: ref"}`;
|
|
203
217
|
/** Mail lives in the mail tables of the store, whichever messenger CLI reads it. */
|
|
204
218
|
const isMailLocator = (chat, message) => message === undefined && isLocator(chat) && parseLocator(chat).provider === "email";
|
|
205
219
|
const count = (value) => {
|
|
@@ -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 { withOptionHints } from "../option-hints.js";
|
|
8
|
+
import { AROUND_HINT, END_FLAGS, hintsFor, 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";
|
|
@@ -16,6 +16,7 @@ import { messagesSearchCommand } from "./messages-search-command.js";
|
|
|
16
16
|
import { allAnswer, meaningNote, notesAnswer, offsetOf, SOURCE_SEARCHED, shownOf, } from "./search-answers.js";
|
|
17
17
|
import { backendOptions, backendRequest, noteServer } from "./search-backend-options.js";
|
|
18
18
|
import { topicsSearchCommand } from "./topics-command.js";
|
|
19
|
+
const ONLY_HINT = "this search reads one kind already; --only belongs to search all: search all 'words' --only messages";
|
|
19
20
|
export const searchAllOnlyOf = (value, allowed = SOURCE_SEARCHED) => {
|
|
20
21
|
const chosen = value.split(",").map((one) => one.trim());
|
|
21
22
|
if (chosen.includes("mail"))
|
|
@@ -186,12 +187,28 @@ export const searchCommand = (messenger, { topics = false } = {}) => {
|
|
|
186
187
|
if (command)
|
|
187
188
|
annotate(command, { examples: [`${messenger.app.command} personal search ${path} ${args}`] });
|
|
188
189
|
}
|
|
189
|
-
for (const path of ["all", "messages"]) {
|
|
190
|
+
for (const path of ["all", "messages", "notes"]) {
|
|
190
191
|
const command = commandAt(search, path);
|
|
192
|
+
const dates = hintsFor([...START_FLAGS, ...END_FLAGS], `put the dates in the query: search ${path} 'words date>=2026-10-01 date<2026-10-20', or 'words date:7d'`);
|
|
191
193
|
if (command)
|
|
192
194
|
withOptionHints(command, {
|
|
193
|
-
|
|
195
|
+
...dates,
|
|
196
|
+
...(path === "notes"
|
|
197
|
+
? {}
|
|
198
|
+
: {
|
|
199
|
+
"--chat": `search in one chat with chat:<chat> in the query: search ${path} 'chat:<chat> words'`,
|
|
200
|
+
"--around": AROUND_HINT,
|
|
201
|
+
}),
|
|
202
|
+
...(path === "all" ? {} : { "--only": ONLY_HINT }),
|
|
194
203
|
});
|
|
195
204
|
}
|
|
205
|
+
const conversations = commandAt(search, "conversations");
|
|
206
|
+
if (conversations)
|
|
207
|
+
withOptionHints(conversations, {
|
|
208
|
+
...hintsFor(START_FLAGS, "--since-time 7d, or --since-time 2026-10-01"),
|
|
209
|
+
...hintsFor(END_FLAGS, "put the end in the filter: --filter 'date<2026-10-20'"),
|
|
210
|
+
"--around": AROUND_HINT,
|
|
211
|
+
"--only": ONLY_HINT,
|
|
212
|
+
});
|
|
196
213
|
return search;
|
|
197
214
|
};
|
|
@@ -4,3 +4,9 @@ import type { Command } from "commander";
|
|
|
4
4
|
* commander's bare "unknown option".
|
|
5
5
|
*/
|
|
6
6
|
export declare const withOptionHints: (command: Command, hints: Readonly<Record<string, string>>) => Command;
|
|
7
|
+
/** The same hint for each of these flags. */
|
|
8
|
+
export declare const hintsFor: (flags: readonly string[], hint: string) => Record<string, string>;
|
|
9
|
+
/** Date flags agents guess; commander would suggest an unrelated near name (`--since` → `--source`). */
|
|
10
|
+
export declare const START_FLAGS: string[];
|
|
11
|
+
export declare const END_FLAGS: string[];
|
|
12
|
+
export declare const AROUND_HINT: string;
|
package/dist/cli/option-hints.js
CHANGED
|
@@ -13,3 +13,10 @@ export const withOptionHints = (command, hints) => {
|
|
|
13
13
|
};
|
|
14
14
|
return command;
|
|
15
15
|
};
|
|
16
|
+
/** The same hint for each of these flags. */
|
|
17
|
+
export const hintsFor = (flags, hint) => Object.fromEntries(flags.map((flag) => [flag, hint]));
|
|
18
|
+
/** Date flags agents guess; commander would suggest an unrelated near name (`--since` → `--source`). */
|
|
19
|
+
export const START_FLAGS = ["--since", "--after", "--from", "--since-date", "--after-date", "--start"];
|
|
20
|
+
export const END_FLAGS = ["--until", "--before", "--to", "--until-date", "--before-date", "--end"];
|
|
21
|
+
export const AROUND_HINT = "read the messages either side of one: messages context <hit ref> --before-n 5 --after-n 5 " +
|
|
22
|
+
"(or messages context <chat> <message>)";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.672.0",
|
|
4
4
|
"description": "The messenger-neutral half of a messaging CLI: domain model, message locators, rendering, name resolution, the SQLite seam, the command skeleton and shared read commands, the send guard, run records and the message store",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|