@leemour/cli-messaging 0.116.0 → 0.117.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/README.md CHANGED
@@ -21,7 +21,7 @@ provider has travels in `providerMetadata`.
21
21
  | `.` | `Chat`, `Message`, `Contact`, `Page`… · `formatLocator` / `parseLocator` · `renderMessages` · `pickChat` / `pickPerson` |
22
22
  | `./store` | `openCache` — `node:sqlite` under Node, `bun:sqlite` under Bun, WAL and a busy timeout on both · `openStore` — the shared message store, every method async: one file for every messenger (`MESSAGING_STORE` overrides where), forward-only migrations with `min_compatible`, every sender an identity with a person of their own, edits kept as revisions, a message by its id, deletions kept as tombstones, trigram search · `find` — by text, by sender, or both; `together` for the chats where every sender wrote, `perChat` to cap each chat · `savePeople` and `people` — usernames and bot flags, and a `PeopleLookup` for `pickPerson` |
23
23
  | `./sends` | the send guard: a level per command path (`permissions`: deny, readonly, ask, allow — `readOnly` and `allow` read as levels), a recipient list, an hourly limit, and a journal of every attempt that never holds the text; `newSendId` for a send's identity across retries |
24
- | `./cli` | the command skeleton: `run` (never throws, returns an exit code), the global flags, `settingsFor` (flag → environment → file → default, one strict file schema with each CLI's own fields), the profile as the first word, `--timeout` that closes what a command holds, paging, and run records: `--record` keeps a run's ids and timings (never content), a failure is kept unless `--no-record`, and `runsCommand` gives `runs list\|show\|path` · `configCommand(app, config)` shows and changes the settings with where each came from · `completeCommand(messenger, config, options?)` gives shell completion, account-scoped chat and person ids from the store and never a connection; `options.sources` can supply local suggestions for a separate command group · `storeSummary(env)` gives its local store diagnostics to consumers retaining their own doctor command · `doctorCommand(messenger)` reports the installation's state from disk (the store, the account, sends, runs, the messenger's own checks), and connects only with `--online`; `doctor report create` writes that, the failed run and the recent sends to a file with every id a label · `skillCommand(app, url)` prints the CLI's own SKILL.md for an agent (`skill show`) · `commandsCommand(app)` describes every command as JSON, with `contract` (`CONTRACT`, the major version of the output types) and which commands write · the shared read commands: a CLI describes its messenger once (`Messenger`: its app, a `connect` that returns a `MessengerAdapter`, how `me` maps to a chat) and gets `accountCommand`, `chatsCommand` (`list`, `show`), `contactsCommand` (`list`, `show`) `recipientsCommand`, `sendsCommand`, `watchCommand` (new messages as they arrive, `--jsonl`, until Ctrl-C or `--timeout`; `--events` adds edits, deletions and reactions, each kept in the store), `storeCommand` (the local store: `store fetch` puts a chat's history into it, resumable, FloodWait-aware, `--since` to stop at a time, `--background` for a detached job that `store jobs list|show|cancel` follow, `--estimate` to only price what is left from the store alone; `store status` what it holds; `store export` a chat's messages out of it, as JSON or `--format markdown`; `store clear --left` deletes the chats the account has left; `store info`, `store check`, `store migrate`, `store backup` and `store restore` look after the file itself — its size and schema, whether it is healthy and which chats are behind, bringing it up to this build, and a copy to go back to), `inboxCommand` (other people's unread messages in every chat, or with `--new` what arrived since the last check — each message once, the point moved only by a run that printed; copied from max-cli), `serveCommand` (keeps the store current until stopped — one per profile by a lock file, catch-up on, started by a person, `server start` or a unit), `serverCommand` (`server start|stop|restart|status|logs`: `serve` in the background, as max-cli's `server`; `install|uninstall` add a systemd user unit or a launchd agent per profile, and `install` starts nothing), and `messagesCommand` (`list`, `show`, `context`, `search` over the store by any three letters inside a word, or `--regex`, `send` through the send guard (`--reply-to`, `--silent`, `--no-preview`, `--md`, `--file` and `--photo` with the text as the caption, and `--at` to send later, with `scheduled` listing the queue), `edit` of the owner's own message, `forward` to another chat and `pin`/`unpin` through it too (the adapter's optional `edit`, `forward`, `pin` and `unpin`), and `delete` — at most 10, for the owner unless `--for-everyone`; it asks first by default, and `--allow-dangerous` is the yes · `reactionsCommand` (`add`, `remove`: the owner's reaction on a message, through the guard; the adapter's optional `react`) · `pollsCommand` (`show` a poll with its answer ids, `vote` by id or `--retract`, `close` the owner's own, `create` one — a vote guarded as a reaction, closing as an edit, a new poll as a message with a send id); a `msg:` locator names a message) — every read saved to the store, `--offline` answered from it, each call a run event · `mcpCommand(messenger)` serves the profile to an agent over MCP on stdin and stdout (copied from max-cli: one connection held for minutes, one call at a time, read tools named `<cli>_<command words>` answering what `--json` prints, `<cli>_status` without connecting; the write tools — `<cli>_messages_send`, `_edit`, `_forward`, `_pin`, `_unpin`, `_delete`, `<cli>_reactions_add`, `_remove`, `<cli>_chats_mark_read`, `<cli>_polls_vote`, `_close` and `_create` — are offered by the profile's `permissions` and run through the same guard as their commands; a write at level `ask` shows the owner a form first (`--allow-dangerous` or `--yes` skips it), `--confirm-send` puts every write through the form, and `messages_delete` never deletes for everyone), and `mcp config` prints the entry for a desktop client |
24
+ | `./cli` | the command skeleton: `run` (never throws, returns an exit code), the global flags, `settingsFor` (flag → environment → file → default, one strict file schema with each CLI's own fields), the profile as the first word, `--timeout` that closes what a command holds, paging, and run records: `--record` keeps a run's ids and timings (never content), a failure is kept unless `--no-record`, and `runsCommand` gives `runs list\|show\|path` · `configCommand(app, config)` shows and changes the settings with where each came from · `completeCommand(messenger, config, options?)` gives shell completion, account-scoped chat and person ids from the store and never a connection; `options.sources` can supply local suggestions for a separate command group and `options.account` can read an existing local account binding · `storeSummary(env)` gives its local store diagnostics to consumers retaining their own doctor command · `doctorCommand(messenger)` reports the installation's state from disk (the store, the account, sends, runs, the messenger's own checks), and connects only with `--online`; `doctor report create` writes that, the failed run and the recent sends to a file with every id a label · `skillCommand(app, url)` prints the CLI's own SKILL.md for an agent (`skill show`) · `commandsCommand(app)` describes every command as JSON, with `contract` (`CONTRACT`, the major version of the output types) and which commands write · the shared read commands: a CLI describes its messenger once (`Messenger`: its app, a `connect` that returns a `MessengerAdapter`, how `me` maps to a chat) and gets `accountCommand`, `chatsCommand` (`list`, `show`), `contactsCommand` (`list`, `show`) `recipientsCommand`, `sendsCommand`, `watchCommand` (new messages as they arrive, `--jsonl`, until Ctrl-C or `--timeout`; `--events` adds edits, deletions and reactions, each kept in the store), `storeCommand` (the local store: `store fetch` puts a chat's history into it, resumable, FloodWait-aware, `--since` to stop at a time, `--background` for a detached job that `store jobs list|show|cancel` follow, `--estimate` to only price what is left from the store alone; `store status` what it holds; `store export` a chat's messages out of it, as JSON or `--format markdown`; `store clear --left` deletes the chats the account has left; `store info`, `store check`, `store migrate`, `store backup` and `store restore` look after the file itself — its size and schema, whether it is healthy and which chats are behind, bringing it up to this build, and a copy to go back to), `inboxCommand` (other people's unread messages in every chat, or with `--new` what arrived since the last check — each message once, the point moved only by a run that printed; copied from max-cli), `serveCommand` (keeps the store current until stopped — one per profile by a lock file, catch-up on, started by a person, `server start` or a unit), `serverCommand` (`server start|stop|restart|status|logs`: `serve` in the background, as max-cli's `server`; `install|uninstall` add a systemd user unit or a launchd agent per profile, and `install` starts nothing), and `messagesCommand` (`list`, `show`, `context`, `search` over the store by any three letters inside a word, or `--regex`, `send` through the send guard (`--reply-to`, `--silent`, `--no-preview`, `--md`, `--file` and `--photo` with the text as the caption, and `--at` to send later, with `scheduled` listing the queue), `edit` of the owner's own message, `forward` to another chat and `pin`/`unpin` through it too (the adapter's optional `edit`, `forward`, `pin` and `unpin`), and `delete` — at most 10, for the owner unless `--for-everyone`; it asks first by default, and `--allow-dangerous` is the yes · `reactionsCommand` (`add`, `remove`: the owner's reaction on a message, through the guard; the adapter's optional `react`) · `pollsCommand` (`show` a poll with its answer ids, `vote` by id or `--retract`, `close` the owner's own, `create` one — a vote guarded as a reaction, closing as an edit, a new poll as a message with a send id); a `msg:` locator names a message) — every read saved to the store, `--offline` answered from it, each call a run event · `mcpCommand(messenger)` serves the profile to an agent over MCP on stdin and stdout (copied from max-cli: one connection held for minutes, one call at a time, read tools named `<cli>_<command words>` answering what `--json` prints, `<cli>_status` without connecting; the write tools — `<cli>_messages_send`, `_edit`, `_forward`, `_pin`, `_unpin`, `_delete`, `<cli>_reactions_add`, `_remove`, `<cli>_chats_mark_read`, `<cli>_polls_vote`, `_close` and `_create` — are offered by the profile's `permissions` and run through the same guard as their commands; a write at level `ask` shows the owner a form first (`--allow-dangerous` or `--yes` skips it), `--confirm-send` puts every write through the form, and `messages_delete` never deletes for everyone), and `mcp config` prints the entry for a desktop client |
25
25
  | `./testing` | the adapter kit — **not stable yet**, so it may change in any release: `fakeAdapter(seed)`, a messenger in memory with every method group, for command tests; `contractCases({ connect })`, the port's promises as cases any test runner runs over an adapter; `contractSeed`, the chats and messages they read. How to write an adapter and run them: [the adapter guide](docs/dev/ADAPTERS.md) |
26
26
 
27
27
  ⚠ **Errors are recognised by shape, not by class** (`isCliFailure`). A package linked during
@@ -3,6 +3,7 @@ import { Command } from "commander";
3
3
  import type { Configuration } from "../settings.js";
4
4
  import type { Messenger } from "./context.js";
5
5
  export interface CompletionOptions {
6
+ account?: (profile: string, env: NodeJS.ProcessEnv) => string | undefined;
6
7
  sources?: (profile: string, words: string[], env: NodeJS.ProcessEnv) => CompletionSources | undefined;
7
8
  }
8
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"complete-command.d.ts","sourceRoot":"","sources":["../../../src/cli/messenger/complete-command.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAA+C,MAAM,8BAA8B,CAAA;AAClH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAI7C,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,KAAK,iBAAiB,GAAG,SAAS,CAAA;CACtG;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,cACf,SAAS,UACZ,IAAI,CAAC,aAAa,EAAE,oBAAoB,CAAC,YACxC,iBAAiB,KACzB,OA2DG,CAAA"}
1
+ {"version":3,"file":"complete-command.d.ts","sourceRoot":"","sources":["../../../src/cli/messenger/complete-command.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAA+C,MAAM,8BAA8B,CAAA;AAClH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAI7C,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,KAAK,MAAM,GAAG,SAAS,CAAA;IACzE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,KAAK,iBAAiB,GAAG,SAAS,CAAA;CACtG;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,cACf,SAAS,UACZ,IAAI,CAAC,aAAa,EAAE,oBAAoB,CAAC,YACxC,iBAAiB,KACzB,OA0DG,CAAA"}
@@ -44,7 +44,7 @@ export const completeCommand = (messenger, config, options = {}) => new Command(
44
44
  const lock = env[envName(app, "PROFILE_LOCK")];
45
45
  const wanted = profile ?? lock ?? env[envName(app, "PROFILE")] ?? DEFAULT_PROFILE;
46
46
  const custom = readable(wanted, lock) ? options.sources?.(wanted, rest, env) : undefined;
47
- const account = !custom && readable(wanted, lock) ? recalledAccount(app, messenger.provider, wanted, env) : undefined;
47
+ const account = !custom && readable(wanted, lock) ? accountOf(messenger, wanted, env, options) : undefined;
48
48
  const store = account && existsSync(storePath(env)) ? await openStore({ env }).catch(() => undefined) : undefined;
49
49
  try {
50
50
  // Read up front: `suggest` asks its sources synchronously, and the store answers asynchronously.
@@ -71,6 +71,12 @@ export const completeCommand = (messenger, config, options = {}) => new Command(
71
71
  await store?.close();
72
72
  }
73
73
  });
74
+ const accountOf = (messenger, profile, env, options) => {
75
+ if (!options.account)
76
+ return recalledAccount(messenger.app, messenger.provider, profile, env);
77
+ const id = options.account(profile, env);
78
+ return id === undefined ? undefined : { provider: messenger.provider, account: id };
79
+ };
74
80
  /** A half-typed or odd first word, or another profile than a locked one, gets no names rather than an error. */
75
81
  const readable = (profile, lock) => {
76
82
  if (lock && profile !== lock)
@@ -1 +1 @@
1
- {"version":3,"file":"complete-command.js","sourceRoot":"","sources":["../../../src/cli/messenger/complete-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EAA0B,iBAAiB,EAAmB,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAClH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAErG,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAG/C,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAA;AAMpD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAoB,EACpB,MAAiD,EACjD,OAAO,GAAsB,EAAE,EACtB,EAAE,CACX,IAAI,OAAO,CAAC,UAAU,CAAC;KACpB,WAAW,CAAC,uBAAuB,SAAS,CAAC,GAAG,CAAC,OAAO,6CAA6C,CAAC;KACtG,Q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,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/C,CAAA;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,eAAe,GAAG,CAAC,KAAa,EAAgB,EAAE,CACtD,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAEtF,MAAM,YAAY,GAAG,CAAC,MAAiD,EAAE,GAAsB,EAAY,EAAE;IAC3G,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,kBAAkB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leemour/cli-messaging",
3
- "version": "0.116.0",
3
+ "version": "0.117.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": "MIT",
6
6
  "author": "Viacheslav Ptsarev",
package/parity.json CHANGED
@@ -204,6 +204,11 @@
204
204
  "value": "<kind>",
205
205
  "meaning": "only chats of this kind: dialog, group, channel or saved"
206
206
  },
207
+ "--language": {
208
+ "value": "<lucene|legacy>",
209
+ "meaning": "the query language: strict Lucene or legacy discovery",
210
+ "default": "lucene"
211
+ },
207
212
  "--last": {
208
213
  "value": "<n>",
209
214
  "meaning": "stop once the newest n messages are held; not with --since",
@@ -434,6 +439,11 @@
434
439
  "value": "<duration>",
435
440
  "meaning": "give up on the whole command after this — 30s, 2m, 500ms"
436
441
  },
442
+ "--timezone": {
443
+ "value": "<zone>",
444
+ "meaning": "the IANA timezone for calendar date boundaries",
445
+ "default": "system IANA timezone"
446
+ },
437
447
  "--title": {
438
448
  "value": "<title>",
439
449
  "meaning": "the new name — of a chat or a folder"
@@ -1645,6 +1655,13 @@
1645
1655
  "options": {
1646
1656
  "--chat": "all",
1647
1657
  "--context": "all",
1658
+ "--language": {
1659
+ "in": [],
1660
+ "planned": {
1661
+ "max": "search A1",
1662
+ "tg": "search A1"
1663
+ }
1664
+ },
1648
1665
  "--limit": "all",
1649
1666
  "--newest": "all",
1650
1667
  "--regex": {
@@ -1654,7 +1671,14 @@
1654
1671
  "tg": "T6"
1655
1672
  }
1656
1673
  },
1657
- "--source": "all"
1674
+ "--source": "all",
1675
+ "--timezone": {
1676
+ "in": [],
1677
+ "planned": {
1678
+ "max": "search A1",
1679
+ "tg": "search A1"
1680
+ }
1681
+ }
1658
1682
  }
1659
1683
  },
1660
1684
  "messages send": {