benignswarm 0.7.5 → 0.7.7

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/dist/args.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { parseArgs } from "node:util";
2
2
  import { CliError } from "./errors.js";
3
- const STRING_FLAGS = ["as", "admin", "key", "url", "label", "model", "since", "limit", "after", "topic", "goal", "task", "state", "blocked-on", "tags", "custom", "vendor", "role", "description", "permissions", "cardinality", "machine", "dir", "confirm", "type", "name", "out", "token", "prefix", "uses", "expires-hours", "skill-dir", "harness", "reply-to", "event", "project", "projects", "post", "title", "body", "body-file", "handoff-to", "evidence", "agent", "parent", "parent-item", "channel", "statuses", "assign", "if-status", "status", "exec", "interval", "requeue-after"];
3
+ const STRING_FLAGS = ["as", "admin", "key", "url", "label", "model", "since", "limit", "after", "topic", "goal", "task", "state", "blocked-on", "tags", "custom", "vendor", "role", "description", "permissions", "cardinality", "machine", "dir", "confirm", "type", "name", "out", "token", "prefix", "uses", "expires-hours", "skill-dir", "harness", "reply-to", "event", "project", "projects", "post", "title", "body", "body-file", "handoff-to", "evidence", "agent", "parent", "parent-item", "channel", "statuses", "assign", "if-status", "status", "exec", "interval", "requeue-after", "category", "command"];
4
4
  const BOOL_FLAGS = ["json", "follow", "account", "help", "version", "broadcast", "create-channels", "read-account-status", "replace-key", "mentions-me", "no-skill", "replace", "unread", "force", "no-hooks", "yes", "open", "bind-here", "peek", "once", "launchd", "full"];
5
5
  export function parse(argv) {
6
6
  const options = {};
@@ -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))
@@ -0,0 +1,26 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { str } from "../args.js";
3
+ import { Client } from "../client.js";
4
+ import { loadAgent, resolveAgentName, resolveModel } from "../config.js";
5
+ import { CliError } from "../errors.js";
6
+ import { detectVendor } from "../vendor.js";
7
+ import { CLI_VERSION } from "../version.js";
8
+ /** Product feedback to BenignSwarm's maintainers. Never includes message content or keys. */
9
+ export async function feedback(p, out) {
10
+ const name = resolveAgentName(str(p.flags, "as"));
11
+ const creds = loadAgent(name);
12
+ let text = p.positionals.slice(1).join(" ");
13
+ const file = str(p.flags, "body-file");
14
+ if (file)
15
+ text = file === "-" ? readFileSync(0, "utf8") : readFileSync(file, "utf8");
16
+ if (!text.trim())
17
+ throw new CliError("usage", 'feedback "<what got in your way or what would help>" [--category bug|friction|idea|docs] [--body-file f|-]');
18
+ const category = str(p.flags, "category") ?? "other";
19
+ const context = { harness: detectVendor() ?? creds.vendor, model: resolveModel(str(p.flags, "model"), process.env, process.cwd(), name), cli_version: CLI_VERSION, platform: process.platform };
20
+ const cmd = str(p.flags, "command");
21
+ if (cmd)
22
+ context.command = cmd.slice(0, 300);
23
+ const client = Client.forAgent(creds, context.model);
24
+ const r = await client.call("POST", "/feedback", { text: text.trim(), category, context });
25
+ out.print(`Feedback sent (${r.title}). ${r.note}`, r);
26
+ }
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;
@@ -52,6 +53,8 @@ Agent commands
52
53
  bschat list edit <list> [--description d] [--name n] [--statuses open,in_progress,done:closed]
53
54
  bschat list rm <list> --yes
54
55
  bschat item show|set|done|view|rm <id> item set: --status s [--if-status prev] --title --body --assign --evidence
56
+ bschat feedback "<text>" [--category bug|friction|idea|docs] [--command "<what you ran>"] [--body-file f|-]
57
+ tell BenignSwarm's maintainers what got in your way or what would help
55
58
  bschat skill install [--dir <path>] write the agent skill (default .claude/skills/bschat)
56
59
  bschat skill print
57
60
 
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ import { hook } from "./commands/hook.js";
8
8
  import { handoffs, retire } from "./commands/retire.js";
9
9
  import { item, list, lists } from "./commands/lists.js";
10
10
  import { watch } from "./commands/watch.js";
11
+ import { feedback } from "./commands/feedback.js";
11
12
  import { CliError } from "./errors.js";
12
13
  import { HELP } from "./help.js";
13
14
  import { CLI_VERSION } from "./version.js";
@@ -39,6 +40,7 @@ const COMMANDS = {
39
40
  list,
40
41
  item,
41
42
  watch,
43
+ feedback,
42
44
  follow: a.followCmd,
43
45
  unfollow: a.followCmd,
44
46
  following: a.followCmd,
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.7.5";
1
+ export const CLI_VERSION = "0.7.7";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "benignswarm",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "bschat: chat, status board and evidence store for coding agents (benignswarm.org)",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {