Versions 2 to 318
new file, 204 lines
1+// Groups: a project's named sets of agents and people, each with one shared history. abso groups lists them;
2+// abso group reads one, posts in it, and joins, leaves or changes it. The Issues Worker keeps them. Other agents'
4+
10+
12+
24+ if (e.kind === "removed") return `${head} removed ${e.who}${e.by === "abso" ? " (no longer in the project)" : ""}`;
31+
33+ return `${g.private ? "private" : "public"}, ${g.joinable ? "anyone in the project may join" : "members are added by its maker or a project owner"}`;
35+
38+ if (args.positionals.length > 0) throw new UsageError("abso groups takes nothing; abso group <name> reads one");
41+ if (groups.length === 0) return { text: "No groups yet. abso group new <name> makes one.", json: { groups } };
47+ ` @${g.name.padEnd(20)} ${plural(g.members, "member").padEnd(11)} ${g.private ? "private" : "public "}${g.joinable ? "" : ", added only"}${g.member ? " (you're in it)" : ""}`,
54+
55+const ACTIONS = ["post", "join", "leave", "add", "remove", "rename", "private", "joinable"] as const;
56+
62+
69+
71+ * abso group <name> [--post "..." [--reply N] [--news all|none|a,b] [--except a,b]] [--join | --leave | --add x |
72+ * --remove x | --rename new | --private on|off | --joinable on|off] [--before N] [--limit N] [--kind message|member|settings]
78+ throw new UsageError("abso group <name> reads a group; abso group new <name> makes one; abso groups lists them");
93+ text: `Made @${r.group.name} (${settingsWords(r.group)}), with ${members.join(", ")}. abso group ${r.group.name} --post "..." talks in it.`,
97+ if (second !== undefined) throw new UsageError(`abso group ${first} takes flags, not more words: --post "..." posts`);
100+ if (given.length > 1) throw new UsageError(`one change at a time: ${given.map((g) => `--${g}`).join(" and ")}`);
103+ for (const f of ["reply", "news", "except"]) if (args.flags.has(f)) throw new UsageError(`--${f} goes with --post`);
111+ if (text === undefined || text.trim() === "") throw new UsageError('--post "<words>" says what to post');
113+ if (reply !== undefined && !/^\d+$/.test(reply)) throw new UsageError("--reply is a message's number in the group");
116+ if (news !== undefined && except !== undefined) throw new UsageError("--news or --except, not both");
133+ text: `Posted ${r.event?.n} in @${r.group.name}${again}. ${heard.length === 0 ? "No news went out: it's in the history only." : `${heard.join(", ")} hear${heard.length === 1 ? "s" : ""} it.`}`,
156+ : `${action === "add" ? "Added" : "Removed"} ${who} ${action === "add" ? "to" : "from"} @${r.group.name}.`;
160+ action === "rename" ? { name: str(args, "rename") } : { [action]: onOff(str(args, action) ?? "", action) };
170+
175+ if (before !== undefined && !/^\d+$/.test(before)) throw new UsageError("--before is an event number");
176+ if (limit !== undefined && !(/^\d+$/.test(limit) && Number(limit) >= 1 && Number(limit) <= 100))
190+ `Members (${shown.members.length}): ${shown.members.map((m) => m.who).join(", ")}${shown.member ? "" : ". You're not in it."}`,
193+ ...(page.before === null ? [] : [`abso group ${g.name} --before ${page.before} reads further back.`]),
- MCP
- compare on this site's /mcp
- CLI
- abso diff 2 318 client/src/group-commands.ts --json
- JSON
- /christopher/abso-core/compare/2..318?file=client%2Fsrc%2Fgroup-commands.ts&format=json