feat: add cross-context messaging resolver

Co-authored-by: Thinh Dinh <tobalsan@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-01-17 03:17:08 +00:00
parent 1481a3d90f
commit 46015a3dd8
23 changed files with 859 additions and 60 deletions

View File

@@ -0,0 +1,18 @@
import type { Command } from "commander";
import type { MessageCliHelpers } from "./helpers.js";
export function registerMessageBroadcastCommand(message: Command, helpers: MessageCliHelpers) {
helpers
.withMessageBase(
message.command("broadcast").description("Broadcast a message to multiple targets"),
)
.requiredOption(
"--targets <target...>",
"Targets to broadcast to (repeatable, accepts names or ids)",
)
.option("--message <text>", "Message to send")
.option("--media <url>", "Media URL")
.action(async (options: Record<string, unknown>) => {
await helpers.runMessageAction("broadcast", options);
});
}

View File

@@ -18,6 +18,7 @@ import { registerMessageReactionsCommands } from "./message/register.reactions.j
import { registerMessageReadEditDeleteCommands } from "./message/register.read-edit-delete.js";
import { registerMessageSendCommand } from "./message/register.send.js";
import { registerMessageThreadCommands } from "./message/register.thread.js";
import { registerMessageBroadcastCommand } from "./message/register.broadcast.js";
export function registerMessageCommands(program: Command, ctx: ProgramContext) {
const message = program
@@ -41,6 +42,7 @@ ${theme.muted("Docs:")} ${formatDocsLink("/cli/message", "docs.clawd.bot/cli/mes
const helpers = createMessageCliHelpers(message, ctx.messageChannelOptions);
registerMessageSendCommand(message, helpers);
registerMessageBroadcastCommand(message, helpers);
registerMessagePollCommand(message, helpers);
registerMessageReactionsCommands(message, helpers);
registerMessageReadEditDeleteCommands(message, helpers);