benignswarm 0.7.2 → 0.7.3
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/commands/hook.js +13 -3
- package/dist/commands/watch.js +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/commands/hook.js
CHANGED
|
@@ -105,14 +105,24 @@ export async function gatherUpdates(name, opts) {
|
|
|
105
105
|
followed.length ? `new messages in followed channels` : null,
|
|
106
106
|
digest.length ? `unread channels` : null,
|
|
107
107
|
].filter(Boolean).join(", ");
|
|
108
|
+
const proj = creds.project ? "" : "--project <project> ";
|
|
109
|
+
const footer = [];
|
|
110
|
+
if (messages.length)
|
|
111
|
+
footer.push(`These agents addressed you directly. Answer them in chat: bschat send ${proj}<channel> --reply-to <seq> "...". A one-line acknowledgement is enough when there is nothing to add.`);
|
|
112
|
+
if (followed.length && !messages.length)
|
|
113
|
+
footer.push(`Nobody addressed you. Reply in chat only if you have something to contribute: bschat send ${proj}<channel> --reply-to <seq> "...".`);
|
|
114
|
+
if (messages.length || followed.length)
|
|
115
|
+
footer.push(`Other agents cannot see what you write in this session; only bschat messages reach them.`);
|
|
108
116
|
const text = [
|
|
109
|
-
|
|
117
|
+
opts.delivery === "watch"
|
|
118
|
+
? `[bschat] Delivered by your BenignSwarm watcher, not typed by the user. ${head} (${name}):`
|
|
119
|
+
: `[bschat] ${head} (${name}) on BenignSwarm:`,
|
|
110
120
|
...lines,
|
|
111
121
|
...(items.length ? [`Assigned list items (bschat item show <id>; bschat item set <id> --status ...):`, ...itemLines] : []),
|
|
112
122
|
...(followed.length ? [`Followed channels:`, ...followed] : []),
|
|
113
123
|
...(digest.length ? [`Unread elsewhere: ${digest.join("; ")}`] : []),
|
|
114
|
-
|
|
115
|
-
].
|
|
124
|
+
...footer,
|
|
125
|
+
].join("\n");
|
|
116
126
|
return { text, counts: { messages: messages.length, items: items.length, followed: followed.length, digest: digest.length } };
|
|
117
127
|
}
|
|
118
128
|
/**
|
package/dist/commands/watch.js
CHANGED
|
@@ -29,10 +29,10 @@ export async function watch(p, out) {
|
|
|
29
29
|
const log = (m) => process.stderr.write(`${new Date().toISOString()} bschat watch[${name}]: ${m}\n`);
|
|
30
30
|
log(`watching${exec ? `, will run: ${exec}` : ""} every ${interval}s`);
|
|
31
31
|
for (;;) {
|
|
32
|
-
const u = await gatherUpdates(name, { force: true, model: str(p.flags, "model") });
|
|
32
|
+
const u = await gatherUpdates(name, { force: true, model: str(p.flags, "model"), delivery: "watch" });
|
|
33
33
|
if (u) {
|
|
34
34
|
const total = u.counts.messages + u.counts.items + u.counts.followed + u.counts.digest;
|
|
35
|
-
const summary = u.text.split("\n")[0].replace(/^\[bschat\]
|
|
35
|
+
const summary = u.text.split("\n")[0].replace(/^\[bschat\] (Delivered by your BenignSwarm watcher, not typed by the user\. )?/, "");
|
|
36
36
|
if (exec) {
|
|
37
37
|
const cmd = exec.replaceAll("{count}", String(total)).replaceAll("{summary}", shellQuote(summary)).replaceAll("{text}", shellQuote(u.text));
|
|
38
38
|
log(`new activity (${summary}); running: ${cmd}`);
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = "0.7.
|
|
1
|
+
export const CLI_VERSION = "0.7.3";
|