@leemour/cli-messaging 0.114.0 → 0.116.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 +1 -1
- package/dist/cli/index.d.ts +3 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/messenger/complete-command.d.ts +5 -1
- package/dist/cli/messenger/complete-command.d.ts.map +1 -1
- package/dist/cli/messenger/complete-command.js +18 -9
- package/dist/cli/messenger/complete-command.js.map +1 -1
- package/package.json +1 -1
- package/parity.json +99 -60
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)` gives shell completion, chat ids from the store and never a connection · `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 · `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
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export { accountFileFor, rememberAccount } from "./messenger/accounts.js";
|
|
|
27
27
|
export { storeCommand } from "./messenger/archive-commands.js";
|
|
28
28
|
export { chatsCommand } from "./messenger/chats-command.js";
|
|
29
29
|
export { markReadCommand } from "./messenger/chats-read-command.js";
|
|
30
|
-
export { completeCommand } from "./messenger/complete-command.js";
|
|
30
|
+
export { type CompletionOptions, completeCommand } from "./messenger/complete-command.js";
|
|
31
31
|
export { contactsCommand } from "./messenger/contacts-command.js";
|
|
32
32
|
export { type ConnectOptions, type Fetching, type Messenger, type MessengerContext, messengerContext, } from "./messenger/context.js";
|
|
33
33
|
export { conversationsCommand } from "./messenger/conversations-command.js";
|
|
@@ -47,6 +47,8 @@ export { reactionsCommand } from "./messenger/reactions-command.js";
|
|
|
47
47
|
export { reviewCommand } from "./messenger/review.js";
|
|
48
48
|
export { serveCommand, servingProfiles } from "./messenger/serve-command.js";
|
|
49
49
|
export { type Running, type ServerOptions, type ServerProcess, type ServerSystem, serverCommand, } from "./messenger/server-command.js";
|
|
50
|
+
export { storeSummary } from "./messenger/store-maintenance-command.js";
|
|
51
|
+
export { type Saving, stored } from "./messenger/stored.js";
|
|
50
52
|
export { topicsCommand } from "./messenger/topics-command.js";
|
|
51
53
|
export { watchCommand } from "./messenger/watch-command.js";
|
|
52
54
|
export { listed, renderList, renderPage, window, withPaging } from "./paging.js";
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAC9G,OAAO,EACL,SAAS,EACT,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,IAAI,IAAI,eAAe,EACvB,IAAI,IAAI,OAAO,EACf,MAAM,IAAI,SAAS,EACnB,KAAK,UAAU,IAAI,aAAa,EAChC,KAAK,IAAI,QAAQ,EACjB,KAAK,IAAI,QAAQ,EACjB,MAAM,IAAI,SAAS,EACnB,IAAI,IAAI,OAAO,EACf,UAAU,GACX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAChF,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACvG,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,KAAK,WAAW,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,kB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AAU,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAChF,OAAO,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,MAAM,EACN,iBAAiB,GAClB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAC/G,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EACL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,gBAAgB,EAChB,KAAK,YAAY,EACjB,WAAW,EACX,KAAK,YAAY,GAClB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,OAAO,EACP,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,QAAQ,EACR,cAAc,EACd,UAAU,GACX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,KAAK,WAAW,EAChB,UAAU,EACV,UAAU,EACV,OAAO,EACP,QAAQ,GACT,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,EACL,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,aAAa,EACb,KAAK,EACL,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,WAAW,GACZ,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/cli/index.js
CHANGED
|
@@ -45,6 +45,8 @@ export { reactionsCommand } from "./messenger/reactions-command.js";
|
|
|
45
45
|
export { reviewCommand } from "./messenger/review.js";
|
|
46
46
|
export { serveCommand, servingProfiles } from "./messenger/serve-command.js";
|
|
47
47
|
export { serverCommand, } from "./messenger/server-command.js";
|
|
48
|
+
export { storeSummary } from "./messenger/store-maintenance-command.js";
|
|
49
|
+
export { stored } from "./messenger/stored.js";
|
|
48
50
|
export { topicsCommand } from "./messenger/topics-command.js";
|
|
49
51
|
export { watchCommand } from "./messenger/watch-command.js";
|
|
50
52
|
export { listed, renderList, renderPage, window, withPaging } from "./paging.js";
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAyB,WAAW,EAAE,eAAe,EAAsB,MAAM,sBAAsB,CAAA;AAC9G,OAAO,EACL,SAAS,EAGT,IAAI,IAAI,eAAe,EACvB,IAAI,IAAI,OAAO,EACf,MAAM,IAAI,SAAS,EAEnB,KAAK,IAAI,QAAQ,EACjB,KAAK,IAAI,QAAQ,EACjB,MAAM,IAAI,SAAS,EACnB,IAAI,IAAI,OAAO,EACf,UAAU,GACX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEhF,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACvG,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAoB,OAAO,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAmB,UAAU,EAAE,QAAQ,EA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AAI,EACJ,QAAQ,EAGR,aAAa,EACb,KAAK,EAKL,WAAW,GACZ,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { type CompletionSources } from "@leemour/cli-core/completion";
|
|
1
2
|
import { Command } from "commander";
|
|
2
3
|
import type { Configuration } from "../settings.js";
|
|
3
4
|
import type { Messenger } from "./context.js";
|
|
5
|
+
export interface CompletionOptions {
|
|
6
|
+
sources?: (profile: string, words: string[], env: NodeJS.ProcessEnv) => CompletionSources | undefined;
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
9
|
* `tg complete zsh` prints the script a shell sources; the script then runs `tg complete -- <words>`
|
|
6
10
|
* on every Tab, and this answers from the command registry.
|
|
@@ -8,5 +12,5 @@ import type { Messenger } from "./context.js";
|
|
|
8
12
|
* ⚠ **A Tab never connects and never creates anything.** Names come from the message store if it
|
|
9
13
|
* exists — no store, no names — and nothing goes to stderr: a shell shows whatever it is given.
|
|
10
14
|
*/
|
|
11
|
-
export declare const completeCommand: (messenger: Messenger, config: Configuration) => Command;
|
|
15
|
+
export declare const completeCommand: (messenger: Messenger, config: Pick<Configuration, "configuredProfiles">, options?: CompletionOptions) => Command;
|
|
12
16
|
//# sourceMappingURL=complete-command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complete-command.d.ts","sourceRoot":"","sources":["../../../src/cli/messenger/complete-command.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -18,7 +18,7 @@ const SHELLS = ["zsh", "bash", "fish", "powershell"];
|
|
|
18
18
|
* ⚠ **A Tab never connects and never creates anything.** Names come from the message store if it
|
|
19
19
|
* exists — no store, no names — and nothing goes to stderr: a shell shows whatever it is given.
|
|
20
20
|
*/
|
|
21
|
-
export const completeCommand = (messenger, config) => new Command("complete")
|
|
21
|
+
export const completeCommand = (messenger, config, options = {}) => new Command("complete")
|
|
22
22
|
.description(`shell completion: \`${messenger.app.command} complete zsh\` prints the script to source`)
|
|
23
23
|
.argument("[words...]")
|
|
24
24
|
.allowUnknownOption()
|
|
@@ -43,16 +43,27 @@ export const completeCommand = (messenger, config) => new Command("complete")
|
|
|
43
43
|
const { profile, rest } = words.length > 1 ? liftProfile(words, commandWords(root)) : { profile: undefined, rest: words };
|
|
44
44
|
const lock = env[envName(app, "PROFILE_LOCK")];
|
|
45
45
|
const wanted = profile ?? lock ?? env[envName(app, "PROFILE")] ?? DEFAULT_PROFILE;
|
|
46
|
-
const
|
|
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
48
|
const store = account && existsSync(storePath(env)) ? await openStore({ env }).catch(() => undefined) : undefined;
|
|
48
49
|
try {
|
|
49
50
|
// Read up front: `suggest` asks its sources synchronously, and the store answers asynchronously.
|
|
50
51
|
const chats = store && account ? (await store.chats(account, { limit: 500 })).items : [];
|
|
52
|
+
const people = store && account ? (await store.people(account.provider, { account: account.account })).all() : [];
|
|
53
|
+
const known = new Map(people.map((person) => [person.id, { value: person.id, description: singleLine(person.name ?? "") }]));
|
|
54
|
+
for (const chat of chats.filter((chat) => chat.kind === "dialog")) {
|
|
55
|
+
const id = messenger.partnerOf ? messenger.partnerOf(chat) : chat.id;
|
|
56
|
+
if (id !== undefined && !known.has(id))
|
|
57
|
+
known.set(id, { value: id, description: singleLine(chat.title ?? "") });
|
|
58
|
+
}
|
|
51
59
|
const suggestions = suggest({
|
|
52
60
|
commands: describeProgram(root),
|
|
53
61
|
globalOptions: describeOptions(root),
|
|
54
62
|
words: rest.length > 0 ? rest : [""],
|
|
55
|
-
sources:
|
|
63
|
+
sources: {
|
|
64
|
+
...sourcesFrom(chats, [...known.values()], profile === undefined, () => profileNames(config, env)),
|
|
65
|
+
...custom,
|
|
66
|
+
},
|
|
56
67
|
});
|
|
57
68
|
streams.data(formatSuggestions(suggestions));
|
|
58
69
|
}
|
|
@@ -72,11 +83,11 @@ const readable = (profile, lock) => {
|
|
|
72
83
|
return false;
|
|
73
84
|
}
|
|
74
85
|
};
|
|
75
|
-
const sourcesFrom = (stored, atTheStart, profiles) => {
|
|
86
|
+
const sourcesFrom = (stored, people, atTheStart, profiles) => {
|
|
76
87
|
const chats = () => chatSuggestions(stored);
|
|
77
|
-
const
|
|
88
|
+
const persons = () => people;
|
|
78
89
|
return {
|
|
79
|
-
arguments: { chat: chats, person:
|
|
90
|
+
arguments: { chat: chats, person: persons },
|
|
80
91
|
options: { chat: chats },
|
|
81
92
|
...(atTheStart ? { firstWord: profiles } : {}),
|
|
82
93
|
};
|
|
@@ -86,9 +97,7 @@ const sourcesFrom = (stored, atTheStart, profiles) => {
|
|
|
86
97
|
* given, and a title is whatever somebody else typed — so the id is the word, and the title rides
|
|
87
98
|
* along as a description, on one line: bash splits the answer on newlines.
|
|
88
99
|
*/
|
|
89
|
-
const chatSuggestions = (chats
|
|
90
|
-
.filter((chat) => kind === undefined || chat.kind === kind)
|
|
91
|
-
.map((chat) => ({ value: chat.id, description: singleLine(chat.title ?? "") }));
|
|
100
|
+
const chatSuggestions = (chats) => chats.map((chat) => ({ value: chat.id, description: singleLine(chat.title ?? "") }));
|
|
92
101
|
const profileNames = (config, env) => {
|
|
93
102
|
try {
|
|
94
103
|
return config.configuredProfiles({ env });
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"complete-command.js","sourceRoot":"","sources":["../../../src/cli/messenger/complete-command.ts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name": "@leemour/cli-messaging",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.116.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
|
@@ -181,8 +181,8 @@
|
|
|
181
181
|
"note": "the shared `store export` takes `jsonl` or `markdown`, max's own takes `jsonl` or `md` (e4)"
|
|
182
182
|
},
|
|
183
183
|
"--from": {
|
|
184
|
-
"value": "<
|
|
185
|
-
"meaning": "
|
|
184
|
+
"value": "<who|link>",
|
|
185
|
+
"meaning": "sender to match in bot messages search; starting message link in tg bot store fetch"
|
|
186
186
|
},
|
|
187
187
|
"--history": {
|
|
188
188
|
"meaning": "the people added also see the messages from before they came"
|
|
@@ -813,47 +813,20 @@
|
|
|
813
813
|
"in": "all"
|
|
814
814
|
},
|
|
815
815
|
"bot store": {
|
|
816
|
-
"in":
|
|
817
|
-
"planned": {
|
|
818
|
-
"tg": "P8"
|
|
819
|
-
}
|
|
816
|
+
"in": "all"
|
|
820
817
|
},
|
|
821
818
|
"bot store fetch": {
|
|
822
|
-
"in":
|
|
823
|
-
"planned": {
|
|
824
|
-
"tg": "P8"
|
|
825
|
-
},
|
|
819
|
+
"in": "all",
|
|
826
820
|
"options": {
|
|
827
|
-
"--
|
|
828
|
-
"in": ["
|
|
829
|
-
"
|
|
830
|
-
"tg": "P8"
|
|
831
|
-
}
|
|
832
|
-
},
|
|
833
|
-
"--limit": {
|
|
834
|
-
"in": ["max"],
|
|
835
|
-
"planned": {
|
|
836
|
-
"tg": "P8"
|
|
837
|
-
}
|
|
838
|
-
},
|
|
839
|
-
"--page-size": {
|
|
840
|
-
"in": ["max"],
|
|
841
|
-
"planned": {
|
|
842
|
-
"tg": "P8"
|
|
843
|
-
}
|
|
844
|
-
},
|
|
845
|
-
"--pause": {
|
|
846
|
-
"in": ["max"],
|
|
847
|
-
"planned": {
|
|
848
|
-
"tg": "P8"
|
|
849
|
-
}
|
|
821
|
+
"--from": {
|
|
822
|
+
"in": ["tg"],
|
|
823
|
+
"reason": "Telegram bots read message numbers and need a starting link when none is known; MAX pages chat history directly"
|
|
850
824
|
},
|
|
851
|
-
"--
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
}
|
|
825
|
+
"--last": "all",
|
|
826
|
+
"--limit": "all",
|
|
827
|
+
"--page-size": "all",
|
|
828
|
+
"--pause": "all",
|
|
829
|
+
"--since-time": "all"
|
|
857
830
|
}
|
|
858
831
|
},
|
|
859
832
|
"bot uploads": {
|
|
@@ -1451,45 +1424,111 @@
|
|
|
1451
1424
|
},
|
|
1452
1425
|
"mcp doctor": {
|
|
1453
1426
|
"in": [],
|
|
1427
|
+
"planned": {
|
|
1428
|
+
"max": "local MCP setup",
|
|
1429
|
+
"tg": "local MCP setup"
|
|
1430
|
+
},
|
|
1454
1431
|
"options": {
|
|
1455
1432
|
"--allow-dangerous": {
|
|
1456
|
-
"in": [
|
|
1433
|
+
"in": [],
|
|
1434
|
+
"planned": {
|
|
1435
|
+
"tg": "local MCP setup"
|
|
1436
|
+
},
|
|
1457
1437
|
"reason": "tg profiles use a separate dangerous-write override"
|
|
1458
1438
|
},
|
|
1459
|
-
"--allow-delete":
|
|
1460
|
-
|
|
1439
|
+
"--allow-delete": {
|
|
1440
|
+
"in": [],
|
|
1441
|
+
"planned": {
|
|
1442
|
+
"max": "local MCP setup",
|
|
1443
|
+
"tg": "local MCP setup"
|
|
1444
|
+
}
|
|
1445
|
+
},
|
|
1446
|
+
"--allow-mark-read": {
|
|
1447
|
+
"in": [],
|
|
1448
|
+
"planned": {
|
|
1449
|
+
"max": "local MCP setup",
|
|
1450
|
+
"tg": "local MCP setup"
|
|
1451
|
+
}
|
|
1452
|
+
},
|
|
1461
1453
|
"--allow-moderate": {
|
|
1462
|
-
"in": [
|
|
1454
|
+
"in": [],
|
|
1455
|
+
"planned": {
|
|
1456
|
+
"max": "local MCP setup"
|
|
1457
|
+
},
|
|
1463
1458
|
"reason": "max MCP offers a moderation flag"
|
|
1464
1459
|
},
|
|
1465
|
-
"--allow-send":
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1460
|
+
"--allow-send": {
|
|
1461
|
+
"in": [],
|
|
1462
|
+
"planned": {
|
|
1463
|
+
"max": "local MCP setup",
|
|
1464
|
+
"tg": "local MCP setup"
|
|
1465
|
+
}
|
|
1466
|
+
},
|
|
1467
|
+
"--confirm-send": {
|
|
1468
|
+
"in": [],
|
|
1469
|
+
"planned": {
|
|
1470
|
+
"max": "local MCP setup",
|
|
1471
|
+
"tg": "local MCP setup"
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1471
1474
|
}
|
|
1472
1475
|
},
|
|
1473
1476
|
"mcp setup": {
|
|
1474
1477
|
"in": [],
|
|
1478
|
+
"planned": {
|
|
1479
|
+
"max": "local MCP setup",
|
|
1480
|
+
"tg": "local MCP setup"
|
|
1481
|
+
},
|
|
1475
1482
|
"options": {
|
|
1476
1483
|
"--allow-dangerous": {
|
|
1477
|
-
"in": [
|
|
1484
|
+
"in": [],
|
|
1485
|
+
"planned": {
|
|
1486
|
+
"tg": "local MCP setup"
|
|
1487
|
+
},
|
|
1478
1488
|
"reason": "tg profiles use a separate dangerous-write override"
|
|
1479
1489
|
},
|
|
1480
|
-
"--allow-delete":
|
|
1481
|
-
|
|
1490
|
+
"--allow-delete": {
|
|
1491
|
+
"in": [],
|
|
1492
|
+
"planned": {
|
|
1493
|
+
"max": "local MCP setup",
|
|
1494
|
+
"tg": "local MCP setup"
|
|
1495
|
+
}
|
|
1496
|
+
},
|
|
1497
|
+
"--allow-mark-read": {
|
|
1498
|
+
"in": [],
|
|
1499
|
+
"planned": {
|
|
1500
|
+
"max": "local MCP setup",
|
|
1501
|
+
"tg": "local MCP setup"
|
|
1502
|
+
}
|
|
1503
|
+
},
|
|
1482
1504
|
"--allow-moderate": {
|
|
1483
|
-
"in": [
|
|
1505
|
+
"in": [],
|
|
1506
|
+
"planned": {
|
|
1507
|
+
"max": "local MCP setup"
|
|
1508
|
+
},
|
|
1484
1509
|
"reason": "max MCP offers a moderation flag"
|
|
1485
1510
|
},
|
|
1486
|
-
"--allow-send":
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1511
|
+
"--allow-send": {
|
|
1512
|
+
"in": [],
|
|
1513
|
+
"planned": {
|
|
1514
|
+
"max": "local MCP setup",
|
|
1515
|
+
"tg": "local MCP setup"
|
|
1516
|
+
}
|
|
1517
|
+
},
|
|
1518
|
+
"--allow-writes": {
|
|
1519
|
+
"in": [],
|
|
1520
|
+
"planned": {
|
|
1521
|
+
"max": "local MCP setup",
|
|
1522
|
+
"tg": "local MCP setup"
|
|
1523
|
+
}
|
|
1524
|
+
},
|
|
1525
|
+
"--confirm-send": {
|
|
1526
|
+
"in": [],
|
|
1527
|
+
"planned": {
|
|
1528
|
+
"max": "local MCP setup",
|
|
1529
|
+
"tg": "local MCP setup"
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1493
1532
|
}
|
|
1494
1533
|
},
|
|
1495
1534
|
"messages": {
|