Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ shape of this file.

## Unreleased

### Fixed

- **A WhatsApp chat id works unquoted in a query.** `chat:133…@lid` and `chat:120…@g.us` parse as one term; before,
`@lid` was refused with `query.unsupported-operator`. The fix is in cli-base 0.47.3, so cli-core now needs
`@wirecat/cli-base >=0.47.3`: a CLI pinned to 0.47.0–0.47.2 must raise its own cli-base pin with this release.
Emails in the `email` field help and the search docs are unquoted too.

## 0.374.0 — 20.10.2026

### Added
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/STANDARD.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ table. "Not" lists the words a term replaces. How `cli-dev lint` runs over a CLI
| `--by` | `<group>` | choice | what the answer counts or groups by: a field or a calendar unit | |
| `--context` | `<n>` | count | how many messages before and after each hit | messages |
| `--events` | | switch | also print edits, deletions and other changes; every line names its event | |
| `--qr-file` | `<png>` | path | write the login QR code to this PNG instead of drawing it | |
| `--all-versions` | | switch | also the earlier versions a newer one replaced | |
| `--measure` | `<name>` | choice | the metric a ranking is ordered by | |
| `--newest` | | switch | newest first instead of best first | |
Expand Down Expand Up @@ -483,6 +482,7 @@ table. "Not" lists the words a term replaces. How `cli-dev lint` runs over a CLI
| `--render` | `<mode>` | choice | how returned cell values are represented: formatted display values, unformatted values or formulas | |
| `--context-source` | `<id=cursor>` | string | explicitly selected communications source, optionally with its scoped continuation cursor; repeat for more sources | |
| `--context-query` | `<words>` | string | literal words to find within the communications selected for preparation | |
| `--alias` | `<name>` | string | another name of the thing, searched as its own alternative beside its name; repeat for more | |
| `--context-since-time` | `<time>` | time | inclusive start of the selected communications window used for preparation | |
| `--context-before-time` | `<time>` | time | exclusive end of the selected communications window used for preparation | |
| `--account` | `<account>` | string | the account to use; never assumed | |
Expand Down
2 changes: 1 addition & 1 deletion docs/mentions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Search messages by a mention:

```sh
tg work search messages phone:"8 900 000-00-01" # any spelling: +7…, 8…, with spaces or dashes
tg work search messages email:"ana@example.com" # quoted: @ is an operator in the query language
tg work search messages email:ana@example.com # the address, lower-cased
tg work search messages domain:google.com # docs.google.com, drive.google.com, google.com
tg work search messages url:"https://example.com/a" # the link without utm_*, fbclid and the #part
tg work search messages link:"/price" # any link that contains this text
Expand Down
2 changes: 1 addition & 1 deletion docs/search/query-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ enum или unsupported сочетание дают ошибку, а не пус
| `author` | kw | contained, folded as text is; notes and files only | `author:ivanov` | term, phrase |
| `keyword` | kw | whole keyword, folded as text is; notes and files only | `keyword:invoices` | term, phrase |
| `phone` | kw | a phone found in the text, written any way; a number without + is read in phone_countries | `phone:"8 900 000-00-01"` | term, phrase |
| `email` | kw | an address found in the text, lower-cased; quoted, since @ is an operator | `email:"ana@example.com"` | term, phrase |
| `email` | kw | an address found in the text, lower-cased | `email:ana@example.com` | term, phrase |
| `url` | kw | a link found in the text, without utm_*, fbclid and the fragment | `url:"https://example.com/a"` | term, phrase |
| `domain` | kw | the site of a link or an address in the text; docs.google.com means google.com | `domain:google.com` | term, phrase |
| `link` | kw | a part of a link, quoted; Latin letters in any case; in mail also the body of a letter with a tracking link | `link:"click?id=1"` | term, phrase |
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
"@types/node": "^22.20.4",
"@types/pngjs": "6.0.5",
"@vitest/coverage-v8": "^5.0.2",
"@wirecat/cli-base": "0.47.0",
"@wirecat/cli-base": "0.47.3",
"commander": "15.0.0",
"cspell": "10.3.6",
"drizzle-kit": "1.0.0-rc.4",
Expand All @@ -222,7 +222,7 @@
},
"peerDependencies": {
"@napi-rs/canvas": ">=0.1.69 <2",
"@wirecat/cli-base": ">=0.47.0 <0.48.0",
"@wirecat/cli-base": ">=0.47.3 <0.48.0",
"commander": ">=15"
},
"bin": {
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/search/lucene/registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ describe("versioned structured AST and field registry", () => {
expect(validateFields(ast)).toBe(ast)
expect(QUERY_FIELDS.map(({ name }) => name)).toContain("body")
})
it("takes a WhatsApp chat id unquoted and still refuses minimum-should-match", () => {
for (const id of ["133713371337@lid", "120363000000000000@g.us"])
expect(validateFields(parseLucene(`chat:${id}`)).root).toMatchObject({
field: "chat",
operator: "term",
value: id,
})
expect(reason(() => validateFields(parseLucene("(alpha beta)@2")))).toBe("query.unsupported-operator")
})
it("refuses the camelCase tree cli-base built before 0.26", () => {
const span = { start: 0, end: 1 }
const range = { kind: "predicate", field: "date", operator: "range", value: "a", upper: "b", span }
Expand Down
2 changes: 1 addition & 1 deletion src/search/lucene/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export const QUERY_FIELDS: readonly MessageField[] = [
'phone:"8 900 000-00-01"',
"a phone found in the text, written any way; a number without + is read in phone_countries",
],
["email", 'email:"ana@example.com"', "an address found in the text, lower-cased; quoted, since @ is an operator"],
["email", "email:ana@example.com", "an address found in the text, lower-cased"],
["url", 'url:"https://example.com/a"', "a link found in the text, without utm_*, fbclid and the fragment"],
["domain", "domain:google.com", "the site of a link or an address in the text; docs.google.com means google.com"],
[
Expand Down
Loading