@leemour/cli-messaging 0.76.0 → 0.78.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/app.d.ts +2 -0
- package/dist/cli/app.d.ts.map +1 -1
- package/dist/cli/app.js.map +1 -1
- package/dist/cli/messenger/archive-commands.js +1 -0
- package/dist/cli/messenger/archive-commands.js.map +1 -1
- package/dist/cli/messenger/guard-commands.js +2 -2
- package/dist/cli/messenger/guard-commands.js.map +1 -1
- package/dist/cli/messenger/hearing-command.d.ts +4 -1
- package/dist/cli/messenger/hearing-command.d.ts.map +1 -1
- package/dist/cli/messenger/hearing-command.js +14 -2
- package/dist/cli/messenger/hearing-command.js.map +1 -1
- package/dist/cli/messenger/inbox.d.ts.map +1 -1
- package/dist/cli/messenger/inbox.js +8 -4
- package/dist/cli/messenger/inbox.js.map +1 -1
- package/dist/cli/messenger/mcp-command.d.ts +3 -1
- package/dist/cli/messenger/mcp-command.d.ts.map +1 -1
- package/dist/cli/messenger/mcp-command.js +29 -19
- package/dist/cli/messenger/mcp-command.js.map +1 -1
- package/dist/cli/messenger/messages-command.d.ts.map +1 -1
- package/dist/cli/messenger/messages-command.js +33 -11
- package/dist/cli/messenger/messages-command.js.map +1 -1
- package/dist/cli/messenger/messages-scheduled-command.d.ts.map +1 -1
- package/dist/cli/messenger/messages-scheduled-command.js +1 -0
- package/dist/cli/messenger/messages-scheduled-command.js.map +1 -1
- package/dist/cli/messenger/review.d.ts.map +1 -1
- package/dist/cli/messenger/review.js +17 -4
- package/dist/cli/messenger/review.js.map +1 -1
- package/dist/cli/messenger/watch-command.d.ts.map +1 -1
- package/dist/cli/messenger/watch-command.js +1 -0
- package/dist/cli/messenger/watch-command.js.map +1 -1
- package/dist/cli/paging.d.ts +3 -1
- package/dist/cli/paging.d.ts.map +1 -1
- package/dist/cli/paging.js +9 -2
- package/dist/cli/paging.js.map +1 -1
- package/dist/cli/runs/command.js +2 -2
- package/dist/cli/runs/command.js.map +1 -1
- package/dist/mcp/instructions.d.ts +3 -6
- package/dist/mcp/instructions.d.ts.map +1 -1
- package/dist/mcp/instructions.js +10 -12
- package/dist/mcp/instructions.js.map +1 -1
- package/dist/mcp/server.d.ts +6 -4
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +41 -26
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool.d.ts +9 -3
- package/dist/mcp/tool.d.ts.map +1 -1
- package/dist/mcp/tool.js +5 -2
- package/dist/mcp/tool.js.map +1 -1
- package/dist/mcp/tools/chats-read.d.ts.map +1 -1
- package/dist/mcp/tools/chats-read.js +1 -0
- package/dist/mcp/tools/chats-read.js.map +1 -1
- package/dist/mcp/tools/inbox.d.ts.map +1 -1
- package/dist/mcp/tools/inbox.js +3 -1
- package/dist/mcp/tools/inbox.js.map +1 -1
- package/dist/mcp/tools/messages-send.d.ts.map +1 -1
- package/dist/mcp/tools/messages-send.js +10 -5
- package/dist/mcp/tools/messages-send.js.map +1 -1
- package/dist/mcp/tools/messages.d.ts.map +1 -1
- package/dist/mcp/tools/messages.js +3 -1
- package/dist/mcp/tools/messages.js.map +1 -1
- package/dist/mcp/tools/review.d.ts.map +1 -1
- package/dist/mcp/tools/review.js +20 -6
- package/dist/mcp/tools/review.js.map +1 -1
- package/dist/render/messages.d.ts +1 -1
- package/dist/render/messages.d.ts.map +1 -1
- package/dist/render/messages.js +10 -8
- package/dist/render/messages.js.map +1 -1
- package/dist/sends/upload.d.ts +18 -1
- package/dist/sends/upload.d.ts.map +1 -1
- package/dist/sends/upload.js +22 -0
- package/dist/sends/upload.js.map +1 -1
- package/dist/speech/hearing.d.ts +1 -1
- package/dist/speech/hearing.d.ts.map +1 -1
- package/dist/speech/hearing.js +7 -2
- package/dist/speech/hearing.js.map +1 -1
- package/dist/store/sqlite/drizzle/bun.js +1 -1
- package/dist/store/sqlite/drizzle/core.d.ts +2 -2
- package/dist/store/sqlite/drizzle/core.d.ts.map +1 -1
- package/dist/store/sqlite/drizzle/core.js +12 -1
- package/dist/store/sqlite/drizzle/core.js.map +4 -4
- package/dist/store/sqlite/drizzle/node.js +1 -1
- package/dist/store/sqlite/drizzle/{shared-CH747VCJ.js → shared-JAIU3GYB.js} +4 -1
- package/dist/store/sqlite/messages.d.ts +1 -0
- package/dist/store/sqlite/messages.d.ts.map +1 -1
- package/dist/store/sqlite/messages.js +40 -2
- package/dist/store/sqlite/messages.js.map +1 -1
- package/dist/store/sqlite/reads.d.ts +751 -0
- package/dist/store/sqlite/reads.d.ts.map +1 -0
- package/dist/store/sqlite/reads.js +177 -0
- package/dist/store/sqlite/reads.js.map +1 -0
- package/dist/store/sqlite/search.d.ts +496 -0
- package/dist/store/sqlite/search.d.ts.map +1 -0
- package/dist/store/sqlite/search.js +131 -0
- package/dist/store/sqlite/search.js.map +1 -0
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +20 -271
- package/dist/store/store.js.map +1 -1
- package/package.json +1 -1
- package/parity.json +6 -18
- /package/dist/store/sqlite/drizzle/{shared-CH747VCJ.js.map → shared-JAIU3GYB.js.map} +0 -0
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ provider has travels in `providerMetadata`.
|
|
|
20
20
|
| `.` | `Chat`, `Message`, `Contact`, `Page`… · `formatLocator` / `parseLocator` · `renderMessages` · `pickChat` / `pickPerson` |
|
|
21
21
|
| `./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` |
|
|
22
22
|
| `./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 |
|
|
23
|
-
| `./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 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;
|
|
23
|
+
| `./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 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
24
|
|
|
25
25
|
⚠ **Errors are recognised by shape, not by class** (`isCliFailure`). A package linked during
|
|
26
26
|
development brings its own copy of cli-core, and an error built by one copy is not an `instanceof`
|
package/dist/cli/app.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export interface AppIdentity {
|
|
|
10
10
|
version: string;
|
|
11
11
|
/** Where a problem report goes — a new-issue page. `doctor report create` names it. */
|
|
12
12
|
issues?: string;
|
|
13
|
+
/** The language of the transcript a person reads: its day headings and the word for "you". `ru-RU` when unset. */
|
|
14
|
+
locale?: string;
|
|
13
15
|
}
|
|
14
16
|
export declare const envName: (app: AppIdentity, name: string) => string;
|
|
15
17
|
//# sourceMappingURL=app.d.ts.map
|
package/dist/cli/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/cli/app.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,MAAM,WAAW,WAAW;IAC1B,0FAA0F;IAC1F,OAAO,EAAE,MAAM,CAAA;IACf,uFAAuF;IACvF,OAAO,EAAE,MAAM,CAAA;IACf,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,OAAO,QAAS,WAAW,QAAQ,MAAM,KAAG,MAAoC,CAAA"}
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/cli/app.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,MAAM,WAAW,WAAW;IAC1B,0FAA0F;IAC1F,OAAO,EAAE,MAAM,CAAA;IACf,uFAAuF;IACvF,OAAO,EAAE,MAAM,CAAA;IACf,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kHAAkH;IAClH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,OAAO,QAAS,WAAW,QAAQ,MAAM,KAAG,MAAoC,CAAA"}
|
package/dist/cli/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/cli/app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/cli/app.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAgB,EAAE,IAAY,EAAU,EAAE,CAAC,GAAG,GAAG,CAAC,SAAS,IAAI,IAAI,EAAE,CAAA"}
|
|
@@ -82,6 +82,7 @@ const exportCommand = (messenger) => new Command("export")
|
|
|
82
82
|
senderColors: context.settings.senderColors,
|
|
83
83
|
profile: context.profile,
|
|
84
84
|
provider: messenger.provider,
|
|
85
|
+
locale: messenger.app.locale,
|
|
85
86
|
}));
|
|
86
87
|
context.renderer.note(`${messages.length} messages`);
|
|
87
88
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive-commands.js","sourceRoot":"","sources":["../../../src/cli/messenger/archive-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,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AAE,OAAO,CAAC,QAAQ,CAAC,YAAY;YAC3C,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ;YAC5B,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,MAAM;SAC7B,CAAC,CACH,CAAA;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,WAAW,CAAC,CAAA;AACtD,CAAC,CAAC,CAAA"}
|
|
@@ -3,7 +3,7 @@ import { annotate } from "@leemour/cli-core/commands";
|
|
|
3
3
|
import { Command } from "commander";
|
|
4
4
|
import { SendJournal, sendsPathFor } from "../../sends/journal.js";
|
|
5
5
|
import { RecipientList, recipientsPathFor } from "../../sends/recipients.js";
|
|
6
|
-
import { renderPage } from "../paging.js";
|
|
6
|
+
import { positiveCount, renderPage } from "../paging.js";
|
|
7
7
|
import { messengerContext } from "./context.js";
|
|
8
8
|
/**
|
|
9
9
|
* The chats this profile may send to. Off until the first `add`; `clear` deletes it, which turns it off again. It stops
|
|
@@ -61,7 +61,7 @@ export const recipientsCommand = (messenger) => {
|
|
|
61
61
|
/** Every attempt to send from this profile, kept whatever `--record` says. Never the text. */
|
|
62
62
|
export const sendsCommand = (messenger) => new Command("sends").description("every attempt to send from this profile — never the text").addCommand(new Command("list")
|
|
63
63
|
.description("attempts to send, newest first: sent, refused, failed, or not known")
|
|
64
|
-
.option("--limit <n>", "how many to show", (
|
|
64
|
+
.option("--limit <n>", "how many to show", positiveCount("--limit"))
|
|
65
65
|
.action(async function () {
|
|
66
66
|
const context = messengerContext(this, messenger);
|
|
67
67
|
const { settings, renderer, env } = context;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guard-commands.js","sourceRoot":"","sources":["../../../src/cli/messenger/guard-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BA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AC,MAAM,KAAK,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,QAAQ,CAAC,OAAO,iCAAiC,CAAC,CAAA;AACvG,CAAC,CAAC,CACL,CAAA"}
|
|
@@ -2,11 +2,14 @@ import type { Message } from "../../domain/models.js";
|
|
|
2
2
|
import { type Hearing } from "../../speech/hearing.js";
|
|
3
3
|
import type { Messenger, MessengerContext } from "./context.js";
|
|
4
4
|
export declare const TRANSCRIBE_OPTION: readonly ["--transcribe", "turn voice messages not heard yet into text — by the messenger, or a model on this machine; can take minutes"];
|
|
5
|
+
export declare const MODEL_OPTION: readonly ["--model <id>", "which downloaded speech model hears them, with --transcribe; `models audio list` shows them"];
|
|
6
|
+
/** `--model` chooses who hears what `--transcribe` asks for; alone it would quietly do nothing. */
|
|
7
|
+
export declare const modelWith: (transcribe: boolean | undefined, model: string | undefined) => string | undefined;
|
|
5
8
|
/**
|
|
6
9
|
* Kept transcripts on every read; new ones with `--transcribe`, over a connection of their own once
|
|
7
10
|
* the messages are read. `undefined` when there is no voice message, and then no file is opened.
|
|
8
11
|
*/
|
|
9
|
-
export declare const hearForCommand: (context: MessengerContext, messenger: Messenger, messages: readonly Message[], transcribe: boolean) => Promise<Hearing | undefined>;
|
|
12
|
+
export declare const hearForCommand: (context: MessengerContext, messenger: Messenger, messages: readonly Message[], transcribe: boolean, model?: string) => Promise<Hearing | undefined>;
|
|
10
13
|
export { heard as heardItems } from "../../speech/hearing.js";
|
|
11
14
|
/** The messages as a person reads them: the transcript under the text. */
|
|
12
15
|
export declare const spokenItems: <T extends Message>(messages: readonly T[], hearing: Hearing | undefined) => T[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hearing-command.d.ts","sourceRoot":"","sources":["../../../src/cli/messenger/hearing-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hearing-command.d.ts","sourceRoot":"","sources":["../../../src/cli/messenger/hearing-command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,KAAK,OAAO,EAAyD,MAAM,yBAAyB,CAAA;AAE7G,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE/D,eAAO,MAAM,iBAAiB,YAC5B,cAAc,EACd,8GAA8G,CACtG,CAAA;AAEV,eAAO,MAAM,YAAY,YACvB,cAAc,EACd,6FAA6F,CACrF,CAAA;AAEV,mGAAmG;AACnG,eAAO,MAAM,SAAS,eAAgB,OAAO,GAAG,SAAS,SAAS,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,SAK/F,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,YAChB,gBAAgB,aACd,SAAS,YACV,SAAS,OAAO,EAAE,cAChB,OAAO,UACX,MAAM,KACb,OAAO,CAAC,OAAO,GAAG,SAAS,CAyB7B,CAAA;AAED,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAE7D,0EAA0E;AAC1E,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,OAAO,YAAY,SAAS,CAAC,EAAE,WAAW,OAAO,GAAG,SAAS,KAAG,CAAC,EACH,CAAA;AAEpG,gEAAgE;AAChE,eAAO,MAAM,aAAa,YAAa,OAAO,GAAG,SAAS,cAAc,OAAO;;;;CACxB,CAAA"}
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
+
import { CliError } from "@leemour/cli-core";
|
|
1
2
|
import { hearVoices, isVoice, openKept, spoken, withTranscript } from "../../speech/hearing.js";
|
|
2
3
|
import { choose } from "../../speech/transcribe.js";
|
|
3
4
|
export const TRANSCRIBE_OPTION = [
|
|
4
5
|
"--transcribe",
|
|
5
6
|
"turn voice messages not heard yet into text — by the messenger, or a model on this machine; can take minutes",
|
|
6
7
|
];
|
|
8
|
+
export const MODEL_OPTION = [
|
|
9
|
+
"--model <id>",
|
|
10
|
+
"which downloaded speech model hears them, with --transcribe; `models audio list` shows them",
|
|
11
|
+
];
|
|
12
|
+
/** `--model` chooses who hears what `--transcribe` asks for; alone it would quietly do nothing. */
|
|
13
|
+
export const modelWith = (transcribe, model) => {
|
|
14
|
+
if (model !== undefined && transcribe !== true) {
|
|
15
|
+
throw new CliError("validation_error", "--model picks who hears voice messages with --transcribe; add --transcribe");
|
|
16
|
+
}
|
|
17
|
+
return model;
|
|
18
|
+
};
|
|
7
19
|
/**
|
|
8
20
|
* Kept transcripts on every read; new ones with `--transcribe`, over a connection of their own once
|
|
9
21
|
* the messages are read. `undefined` when there is no voice message, and then no file is opened.
|
|
10
22
|
*/
|
|
11
|
-
export const hearForCommand = async (context, messenger, messages, transcribe) => {
|
|
23
|
+
export const hearForCommand = async (context, messenger, messages, transcribe, model) => {
|
|
12
24
|
if (!messages.some(isVoice))
|
|
13
25
|
return undefined;
|
|
14
26
|
const offline = context.settings.offline;
|
|
@@ -18,7 +30,7 @@ export const hearForCommand = async (context, messenger, messages, transcribe) =
|
|
|
18
30
|
try {
|
|
19
31
|
const hearing = await hearVoices(messenger, messages, kept, transcribe && !offline
|
|
20
32
|
? {
|
|
21
|
-
choice: choose(messenger, context.settings, {}, context.env),
|
|
33
|
+
choice: choose(messenger, context.settings, model === undefined ? {} : { model }, context.env),
|
|
22
34
|
connect: (work) => context.withMessenger(work),
|
|
23
35
|
}
|
|
24
36
|
: undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hearing-command.js","sourceRoot":"","sources":["../../../src/cli/messenger/hearing-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hearing-command.js","sourceRoot":"","sources":["../../../src/cli/messenger/hearing-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAgB,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7G,OAAO,EAAE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F,CAAA;AAiBD;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,cAAe,SAAS,KAAG,OA8F9C,CAAA"}
|
|
@@ -3,8 +3,9 @@ import { join } from "node:path";
|
|
|
3
3
|
import { CliError, resolvePaths, writeSecurely } from "@leemour/cli-core";
|
|
4
4
|
import { Command } from "commander";
|
|
5
5
|
import { renderMessages } from "../../render/messages.js";
|
|
6
|
+
import { positiveCount } from "../paging.js";
|
|
6
7
|
import { messengerContext } from "./context.js";
|
|
7
|
-
import { heardItems, hearForCommand, hearingFields, spokenItems, TRANSCRIBE_OPTION } from "./hearing-command.js";
|
|
8
|
+
import { heardItems, hearForCommand, hearingFields, MODEL_OPTION, modelWith, spokenItems, TRANSCRIBE_OPTION, } from "./hearing-command.js";
|
|
8
9
|
/**
|
|
9
10
|
* **At most this many history reads per `inbox`**, as in max-cli: a person opening twenty chats in
|
|
10
11
|
* one burst is already more than a person does, and the rest are named in `skipped`, not lost.
|
|
@@ -130,11 +131,13 @@ export const inboxCommand = (messenger) => new Command("inbox")
|
|
|
130
131
|
.description("other people's unread messages in every chat; --new for what arrived since the last check")
|
|
131
132
|
.option("--new", "what arrived since the last check, each message once — for scheduled runs")
|
|
132
133
|
.option("--since <time>", "what arrived after this ISO 8601 time, or 2h / 1d ago; the saved point stays put")
|
|
133
|
-
.option("--limit <n>", "at most this many per chat, the newest", (
|
|
134
|
+
.option("--limit <n>", "at most this many per chat, the newest", positiveCount("--limit"))
|
|
134
135
|
.option("--all", "muted and archived chats too — left out unless they mention you or reply to you")
|
|
135
136
|
.option(...TRANSCRIBE_OPTION)
|
|
137
|
+
.option(...MODEL_OPTION)
|
|
136
138
|
.action(async function () {
|
|
137
|
-
const { new: fresh, since, all, transcribe, } = this.opts();
|
|
139
|
+
const { new: fresh, since, all, transcribe, model, } = this.opts();
|
|
140
|
+
const hearWith = modelWith(transcribe, model);
|
|
138
141
|
const context = messengerContext(this, messenger);
|
|
139
142
|
const { app } = messenger;
|
|
140
143
|
const { settings, renderer, format, streams, env } = context;
|
|
@@ -165,7 +168,7 @@ export const inboxCommand = (messenger) => new Command("inbox")
|
|
|
165
168
|
if (inbox.partial)
|
|
166
169
|
renderer.note(`only the ${CHAT_WINDOW} newest chats were looked at; an older one may have more`);
|
|
167
170
|
const read = inbox.chats.flatMap((chat) => chat.messages.map((message) => ({ ...message, chatTitle: chat.title })));
|
|
168
|
-
const hearing = await hearForCommand(context, messenger, read, transcribe === true);
|
|
171
|
+
const hearing = await hearForCommand(context, messenger, read, transcribe === true, hearWith);
|
|
169
172
|
const messages = heardItems(read, hearing);
|
|
170
173
|
if (format === "jsonl")
|
|
171
174
|
renderer.stream(messages);
|
|
@@ -187,6 +190,7 @@ export const inboxCommand = (messenger) => new Command("inbox")
|
|
|
187
190
|
senderColors: settings.senderColors,
|
|
188
191
|
profile: context.profile,
|
|
189
192
|
provider: messenger.provider,
|
|
193
|
+
locale: messenger.app.locale,
|
|
190
194
|
}));
|
|
191
195
|
}
|
|
192
196
|
if (fresh && since === undefined && inbox.until !== undefined && inbox.until !== inbox.since) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../../src/cli/messenger/inbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,OAAO,EAAkB,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../../src/cli/messenger/inbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAA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,SAAS,EAAE,QAAQ,CAAC,MAAM;YAC1B,YAAY,EAAE,QAAQ,CAAC,YAAY;YACnC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ;YAC5B,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,MAAM;SAC7B,CAAC,CACH,CAAA;IACH,CAAC;IAED,IAAI,KAAK,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;QAC7F,aAAa,CACX,YAAY,CAAC,GAAG,EAAE,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,EACxC,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,EACnD,KAAK,CACN,CAAA;IACH,CAAC;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -10,8 +10,10 @@ export interface McpEnvironment extends BaseEnvironment {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export interface McpFlags {
|
|
13
|
-
allowSend?: boolean;
|
|
14
13
|
confirmSend?: boolean;
|
|
14
|
+
allowDangerous?: boolean;
|
|
15
|
+
yes?: boolean;
|
|
16
|
+
allowSend?: boolean;
|
|
15
17
|
allowMarkRead?: boolean;
|
|
16
18
|
allowDelete?: boolean;
|
|
17
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-command.d.ts","sourceRoot":"","sources":["../../../src/cli/messenger/mcp-command.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,KAAK,WAAW,EAAW,MAAM,WAAW,CAAA;AACrD,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,cAAc,CAAA;AAE/D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QAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAiCpE,CAAA"}
|
|
@@ -5,32 +5,40 @@ import { Command } from "commander";
|
|
|
5
5
|
import { envName } from "../app.js";
|
|
6
6
|
import { environmentOf } from "../context.js";
|
|
7
7
|
import { messengerContext } from "./context.js";
|
|
8
|
+
/** They decided which tools were offered; the profile's permissions do now. Kept so a configured agent still starts. */
|
|
9
|
+
const RETIRED = ["allowSend", "allowMarkRead", "allowDelete"];
|
|
8
10
|
const withFlags = (command) => command
|
|
9
|
-
.option("--
|
|
10
|
-
.option("--
|
|
11
|
-
.option("--allow-
|
|
12
|
-
.option("--allow-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
.option("--confirm-send", "show the owner every write in a form from the server first")
|
|
12
|
+
.option("--allow-dangerous", "no form before a deletion whose permission level is ask")
|
|
13
|
+
.option("--allow-send", "no longer used — the profile's permissions decide; kept so an old setup still starts")
|
|
14
|
+
.option("--allow-mark-read", "no longer used — the profile's permissions decide")
|
|
15
|
+
.option("--allow-delete", "no longer used — the profile's permissions decide");
|
|
16
|
+
const retiredNote = (app, flags) => {
|
|
17
|
+
const given = RETIRED.filter((flag) => flags[flag] === true);
|
|
18
|
+
if (given.length === 0)
|
|
19
|
+
return undefined;
|
|
20
|
+
const names = given.map((flag) => `--${flag.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`);
|
|
21
|
+
return (`${names.join(", ")} no longer decide${given.length === 1 ? "s" : ""} anything: the profile's permissions do — ` +
|
|
22
|
+
`\`${app.command} config show permissions\``);
|
|
18
23
|
};
|
|
19
24
|
export const mcpCommand = (messenger) => {
|
|
20
25
|
const { app } = messenger;
|
|
21
26
|
const command = withFlags(new Command("mcp").description(`serve this profile to an agent over MCP, on stdin and stdout — \`claude mcp add ${app.command} -- ${app.command} mcp\``)).action(async function () {
|
|
22
|
-
const
|
|
27
|
+
const flags = this.optsWithGlobals();
|
|
28
|
+
const context = messengerContext(this, messenger);
|
|
29
|
+
const note = retiredNote(app, flags);
|
|
30
|
+
if (note)
|
|
31
|
+
context.renderer.warn(note);
|
|
23
32
|
// Loaded here, not at the top: every other command would otherwise pay for the SDK.
|
|
24
33
|
const { serveOverStdio } = await import("../../mcp/server.js");
|
|
25
|
-
await serveOverStdio(this,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
allowDelete: allowDelete === true,
|
|
34
|
+
await serveOverStdio(this, context, messenger, {
|
|
35
|
+
confirmSend: flags.confirmSend === true,
|
|
36
|
+
yes: flags.yes === true,
|
|
37
|
+
allowDangerous: flags.allowDangerous === true,
|
|
30
38
|
});
|
|
31
39
|
});
|
|
32
40
|
command.addCommand(withFlags(new Command("config").description("print the mcpServers entry for Claude Desktop, Cursor and others, with full paths; writes nothing")).action(async function () {
|
|
33
|
-
const flags =
|
|
41
|
+
const flags = this.optsWithGlobals();
|
|
34
42
|
const { renderer, settings, format, streams, env } = messengerContext(this, messenger);
|
|
35
43
|
const given = environmentOf(this).mcp ?? {};
|
|
36
44
|
const entry = serverEntry(app, {
|
|
@@ -47,6 +55,9 @@ export const mcpCommand = (messenger) => {
|
|
|
47
55
|
renderer.result(entry.config);
|
|
48
56
|
if (entry.warning)
|
|
49
57
|
renderer.note(entry.warning);
|
|
58
|
+
const note = retiredNote(app, flags);
|
|
59
|
+
if (note)
|
|
60
|
+
renderer.warn(note);
|
|
50
61
|
}));
|
|
51
62
|
return command;
|
|
52
63
|
};
|
|
@@ -77,10 +88,9 @@ export const serverEntry = (app, { profile, flags = {}, execPath, scriptPath, en
|
|
|
77
88
|
scriptPath,
|
|
78
89
|
...(profile === "default" ? [] : [profile]),
|
|
79
90
|
"mcp",
|
|
80
|
-
...(flags.allowSend ? ["--allow-send"] : []),
|
|
81
91
|
...(flags.confirmSend ? ["--confirm-send"] : []),
|
|
82
|
-
...(flags.
|
|
83
|
-
...(flags.
|
|
92
|
+
...(flags.allowDangerous ? ["--allow-dangerous"] : []),
|
|
93
|
+
...(flags.yes ? ["--yes"] : []),
|
|
84
94
|
],
|
|
85
95
|
...(Object.keys(directories).length > 0 ? { env: directories } : {}),
|
|
86
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-command.js","sourceRoot":"","sources":["../../../src/cli/messenger/mcp-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAoB,OAAO,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,EAAwB,aAAa,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAkB,gBAAgB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"mcp-command.js","sourceRoot":"","sources":["../../../src/cli/messenger/mcp-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAoB,OAAO,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,EAAwB,aAAa,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAkB,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAgB/D,wHAAwH;AACxH,MAAM,OAAO,GAAG,CAAC,WAAW,EAAE,eAAe,EAAE,aAAa,CAAU,CAAA;AAEtE,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAW,EAAE,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QAAQ,kFAAkF,EAAE;YAC5G,CAAC,CAAC,EAAE,CAAC;KACR,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages-command.d.ts","sourceRoot":"","sources":["../../../src/cli/messenger/messages-command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"messages-command.d.ts","sourceRoot":"","sources":["../../../src/cli/messenger/messages-command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOnC,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,cAAc,CAAA;AAmB/D,6FAA6F;AAC7F,eAAO,MAAM,eAAe,cAAe,SAAS,KAAG,OA0KtD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,cAAe,SAAS,KAAG,OAqB7C,CAAA"}
|
|
@@ -4,11 +4,12 @@ import { Command } from "commander";
|
|
|
4
4
|
import { isLocator, parseLocator } from "../../domain/locator.js";
|
|
5
5
|
import { sendTime } from "../../domain/send-time.js";
|
|
6
6
|
import { renderMessages } from "../../render/messages.js";
|
|
7
|
-
import {
|
|
7
|
+
import { readAttachments } from "../../sends/upload.js";
|
|
8
|
+
import { positiveCount } from "../paging.js";
|
|
8
9
|
import { afterOf, oneDirection } from "./after.js";
|
|
9
10
|
import { messengerContext } from "./context.js";
|
|
10
11
|
import { downloadSubcommand } from "./download-command.js";
|
|
11
|
-
import { heardItems, hearForCommand, hearingFields, spokenItems, TRANSCRIBE_OPTION } from "./hearing-command.js";
|
|
12
|
+
import { heardItems, hearForCommand, hearingFields, MODEL_OPTION, modelWith, spokenItems, TRANSCRIBE_OPTION, } from "./hearing-command.js";
|
|
12
13
|
import { deleteCommand } from "./messages-delete-command.js";
|
|
13
14
|
import { editCommand } from "./messages-edit-command.js";
|
|
14
15
|
import { forwardCommand } from "./messages-forward-command.js";
|
|
@@ -23,21 +24,33 @@ export const messagesCommand = (messenger) => {
|
|
|
23
24
|
.command("list")
|
|
24
25
|
.description("a chat's messages, oldest to newest")
|
|
25
26
|
.argument("<chat>", messenger.chatArgument)
|
|
26
|
-
.option("--limit <n>", "how many", (
|
|
27
|
+
.option("--limit <n>", "how many", positiveCount("--limit"))
|
|
27
28
|
.option("--before <id>", "only messages older than this message id")
|
|
28
29
|
.option("--after <id-or-time>", "only messages newer than this message id, ISO 8601 time, or 2h / 1d ago")
|
|
29
30
|
.option(...TRANSCRIBE_OPTION)
|
|
31
|
+
.option(...MODEL_OPTION)
|
|
32
|
+
.option("--mark-read", "also mark the chat read up to the newest message shown; the other person sees it")
|
|
30
33
|
.action(async function (chat) {
|
|
31
34
|
const context = messengerContext(this, messenger);
|
|
32
|
-
const { before, after, transcribe } = this.opts();
|
|
35
|
+
const { before, after, transcribe, model, markRead } = this.opts();
|
|
33
36
|
oneDirection(before, after);
|
|
37
|
+
const hearWith = modelWith(transcribe, model);
|
|
38
|
+
if (markRead && context.settings.offline) {
|
|
39
|
+
throw new CliError("validation_error", "--mark-read tells the messenger; not with --offline");
|
|
40
|
+
}
|
|
34
41
|
const { limit } = context.settings;
|
|
35
42
|
const page = await context.withServices((services) => services.messages.list(chat, {
|
|
36
43
|
limit,
|
|
37
44
|
...(before === undefined ? {} : { before }),
|
|
38
45
|
...(after === undefined ? {} : { after: afterOf(after) }),
|
|
39
46
|
}));
|
|
40
|
-
const hearing = await hearForCommand(context, messenger, page.items, transcribe === true);
|
|
47
|
+
const hearing = await hearForCommand(context, messenger, page.items, transcribe === true, hearWith);
|
|
48
|
+
const newest = page.items.at(-1);
|
|
49
|
+
const marked = markRead && newest
|
|
50
|
+
? await context.withServices((services) => services.chats.markRead({ chat, until: newest.id }))
|
|
51
|
+
: undefined;
|
|
52
|
+
if (marked)
|
|
53
|
+
context.renderer.note(`marked read up to ${marked.until}`);
|
|
41
54
|
const next = (items) => after === undefined ? `older messages: --before ${items[0]?.id}` : `newer messages: --after ${items.at(-1)?.id}`;
|
|
42
55
|
if (context.format === "pretty") {
|
|
43
56
|
// Straight to stdout: the pretty renderer keeps every string to one line, and a feed is many.
|
|
@@ -47,6 +60,7 @@ export const messagesCommand = (messenger) => {
|
|
|
47
60
|
senderColors: context.settings.senderColors,
|
|
48
61
|
profile: context.profile,
|
|
49
62
|
provider: messenger.provider,
|
|
63
|
+
locale: messenger.app.locale,
|
|
50
64
|
}));
|
|
51
65
|
if (page.hasMore)
|
|
52
66
|
context.renderer.note(next(page.items));
|
|
@@ -63,6 +77,7 @@ export const messagesCommand = (messenger) => {
|
|
|
63
77
|
limit,
|
|
64
78
|
hasMore: page.hasMore,
|
|
65
79
|
...hearingFields(hearing, transcribe === true),
|
|
80
|
+
...(marked ? { markedRead: { operationId: marked.operationId, until: marked.until } } : {}),
|
|
66
81
|
});
|
|
67
82
|
});
|
|
68
83
|
const readWindow = async (command, chat, message, window) => {
|
|
@@ -76,6 +91,7 @@ export const messagesCommand = (messenger) => {
|
|
|
76
91
|
senderColors: context.settings.senderColors,
|
|
77
92
|
profile: context.profile,
|
|
78
93
|
provider: messenger.provider,
|
|
94
|
+
locale: messenger.app.locale,
|
|
79
95
|
}));
|
|
80
96
|
}
|
|
81
97
|
else if (context.format === "jsonl")
|
|
@@ -88,7 +104,7 @@ export const messagesCommand = (messenger) => {
|
|
|
88
104
|
.description("search the local store — what was read, fetched or kept by serve; never asks the messenger")
|
|
89
105
|
.argument("<text...>", "every word must appear, as a word or the start of one: квартир finds квартира")
|
|
90
106
|
.option("--chat <chat>", `only this chat: ${messenger.chatArgument}`)
|
|
91
|
-
.option("--limit <n>", "how many", (
|
|
107
|
+
.option("--limit <n>", "how many", positiveCount("--limit"))
|
|
92
108
|
.option("--regex", "the words are one regular expression, case-insensitive, tested against every stored text")
|
|
93
109
|
.action(async function (words) {
|
|
94
110
|
const context = messengerContext(this, messenger);
|
|
@@ -108,6 +124,7 @@ export const messagesCommand = (messenger) => {
|
|
|
108
124
|
senderColors: context.settings.senderColors,
|
|
109
125
|
profile: context.profile,
|
|
110
126
|
provider: messenger.provider,
|
|
127
|
+
locale: messenger.app.locale,
|
|
111
128
|
})}`)
|
|
112
129
|
.join("\n"));
|
|
113
130
|
if (page.items.length === 0)
|
|
@@ -164,6 +181,8 @@ export const sendCommand = (messenger) => annotate(new Command("send"), { mutate
|
|
|
164
181
|
.option("--md, --markdown", "read **bold**, _italic_, ~~struck~~ and `code` in the text; \\ keeps a mark literal")
|
|
165
182
|
.option("--file <path>", "attach a file; the text becomes its caption")
|
|
166
183
|
.option("--photo <path>", "attach a .jpg, .png or .webp as a photo; the text becomes its caption")
|
|
184
|
+
.option("--as-file", "send the --file as a file to download, a video included")
|
|
185
|
+
.option("--voice <path>", "send an Ogg Opus file as a voice message, alone, with no text")
|
|
167
186
|
.option("--allow-any-file", "send a file even from a hidden folder, ~/.ssh or this CLI's own folders")
|
|
168
187
|
.option("--at <time>", "let the messenger send it later, even with this machine off: 2026-09-25T09:00 (local time), or 30m, 2h, 1d from now")
|
|
169
188
|
.action(async function (chat, text) {
|
|
@@ -171,16 +190,19 @@ export const sendCommand = (messenger) => annotate(new Command("send"), { mutate
|
|
|
171
190
|
});
|
|
172
191
|
const sendText = async (command, messenger, chat, text) => {
|
|
173
192
|
const context = messengerContext(command, messenger);
|
|
174
|
-
const { replyTo: typedReplyTo, sendId, silent, preview, markdown, at, file, photo, allowAnyFile, } = command.opts();
|
|
193
|
+
const { replyTo: typedReplyTo, sendId, silent, preview, markdown, at, file, photo, voice, asFile, allowAnyFile, } = command.opts();
|
|
175
194
|
const scheduledFor = at === undefined ? undefined : sendTime(at);
|
|
176
195
|
const replyTo = typedReplyTo?.trim();
|
|
177
196
|
if (replyTo === "")
|
|
178
197
|
throw new CliError("validation_error", "--reply-to needs the id of the message to answer");
|
|
179
198
|
const read = { app: messenger.app, env: context.env, anyFile: allowAnyFile === true };
|
|
180
|
-
const attachments =
|
|
181
|
-
...(photo === undefined ?
|
|
182
|
-
...(file === undefined ?
|
|
183
|
-
|
|
199
|
+
const attachments = await readAttachments({
|
|
200
|
+
...(photo === undefined ? {} : { photo }),
|
|
201
|
+
...(file === undefined ? {} : { file }),
|
|
202
|
+
...(voice === undefined ? {} : { voice }),
|
|
203
|
+
...(text === undefined ? {} : { text }),
|
|
204
|
+
asFile: asFile === true,
|
|
205
|
+
}, read);
|
|
184
206
|
const body = text ?? (attachments.length > 0 ? "" : await readAll(context.stdin));
|
|
185
207
|
if (body.trim() === "" && attachments.length === 0) {
|
|
186
208
|
throw new CliError("validation_error", "nothing to send — give the text or pipe it in");
|