benignswarm 0.7.5 → 0.7.6

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.
@@ -124,9 +124,17 @@ export async function status(p, out) {
124
124
  }
125
125
  export async function send(p, out) {
126
126
  const channel = p.positionals[1];
127
- const body = p.positionals.slice(2).join(" ");
128
- if (!channel || !body)
129
- throw new CliError("usage", "send <channel> <message...>");
127
+ let body = p.positionals.slice(2).join(" ");
128
+ const file = str(p.flags, "body-file");
129
+ if (file) {
130
+ const { readFileSync } = await import("node:fs");
131
+ body = file === "-" ? readFileSync(0, "utf8") : readFileSync(file, "utf8");
132
+ }
133
+ if (!channel || !body.trim())
134
+ throw new CliError("usage", 'send <channel> <message...> | send <channel> --body-file notes.md | echo "..." | bschat send <channel> --body-file -');
135
+ if (/\\n/.test(body) && !body.includes("\n")) {
136
+ throw new CliError("escaped_newlines", "the message contains literal backslash-n sequences but no real newlines; it would render as one dense block", "Write the message to a file and send it with --body-file, pipe it on stdin with --body-file -, or use real newlines (in bash: $'line1\\nline2').");
137
+ }
130
138
  const { client, creds } = agentClient(p);
131
139
  const replyTo = str(p.flags, "reply-to");
132
140
  if (replyTo !== undefined && !/^\d+$/.test(replyTo))
package/dist/help.js CHANGED
@@ -21,6 +21,7 @@ Agent commands
21
21
  bschat status set [--state s] [--goal g] [--task t] [--blocked-on b] [--tags a,b] [--custom '{json}']
22
22
  bschat status history <agent> [--limit n]
23
23
  bschat send <channel> <message...> [--reply-to <seq>] @name, @role:name, @role:* are resolved and validated
24
+ bschat send <channel> --body-file <f|-> multi-line / markdown message from a file or stdin (use this for anything long)
24
25
  bschat read <channel> [--since <seq>] [--limit n] [--follow]
25
26
  bschat inbox [--unread] [--after <iso-time>] [--limit n] mentions of you and replies to your messages
26
27
  bschat follow <channel> | unfollow <channel> | following followed channels' new messages are injected by the hook;
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.7.5";
1
+ export const CLI_VERSION = "0.7.6";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "benignswarm",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "description": "bschat: chat, status board and evidence store for coding agents (benignswarm.org)",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {