@tritard/waterbrother 0.16.70 → 0.16.71

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/gateway.js +43 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tritard/waterbrother",
3
- "version": "0.16.70",
3
+ "version": "0.16.71",
4
4
  "description": "Waterbrother: bring-your-own-model coding CLI with local tools, sessions, operator modes, and approval controls",
5
5
  "type": "module",
6
6
  "bin": {
package/src/gateway.js CHANGED
@@ -563,6 +563,34 @@ function parseTelegramAgentIntent(text = "") {
563
563
  const lowered = value.toLowerCase();
564
564
  if (!value) return null;
565
565
  if (/^(how|what|why|when|where|who)\b/.test(lowered)) return null;
566
+ const reviewPatterns = [
567
+ /^(?:have|ask|use)\s+(.+?)['’]s\s+(?:bot|terminal)\s+(?:to\s+)?review(?:\s+this)?\s*$/i,
568
+ /^(?:have|ask|use)\s+(.+?)\s+(?:bot|terminal)\s+(?:to\s+)?review(?:\s+this)?\s*$/i
569
+ ];
570
+ for (const pattern of reviewPatterns) {
571
+ const match = value.match(pattern);
572
+ if (!match) continue;
573
+ const target = String(match[1] || "").trim();
574
+ if (target) {
575
+ return { action: "agent-review", target, role: "reviewer" };
576
+ }
577
+ }
578
+
579
+ const executePatterns = [
580
+ /^(?:have|ask|use)\s+(.+?)['’]s\s+(?:bot|terminal)\s+(?:to\s+)?(?:take execution|execute|handle execution|take this)\s*$/i,
581
+ /^(?:have|ask|use)\s+(.+?)\s+(?:bot|terminal)\s+(?:to\s+)?(?:take execution|execute|handle execution|take this)\s*$/i,
582
+ /^(.+?)['’]s\s+(?:bot|terminal)\s+should\s+(?:take execution|execute|handle execution)\s*$/i,
583
+ /^(.+?)\s+(?:bot|terminal)\s+should\s+(?:take execution|execute|handle execution)\s*$/i
584
+ ];
585
+ for (const pattern of executePatterns) {
586
+ const match = value.match(pattern);
587
+ if (!match) continue;
588
+ const target = String(match[1] || "").trim();
589
+ if (target) {
590
+ return { action: "agent-execute", target, role: "executor" };
591
+ }
592
+ }
593
+
566
594
  const roleMatch = lowered.match(/\b(executor|reviewer|standby)\b/);
567
595
  const role = roleMatch?.[1] || "";
568
596
  if (!role) return null;
@@ -1620,16 +1648,28 @@ class TelegramGateway {
1620
1648
  actorId,
1621
1649
  actorName: actor.displayName || actorId
1622
1650
  });
1651
+ const runtimeLabel = targetAgent.provider && targetAgent.model ? `${targetAgent.provider}/${targetAgent.model}` : "unknown";
1652
+ const actionTitle = intent.action === "agent-review"
1653
+ ? "Roundtable reviewer assigned"
1654
+ : intent.action === "agent-execute"
1655
+ ? "Roundtable executor assigned"
1656
+ : "Roundtable terminal updated";
1657
+ const note = intent.action === "agent-review"
1658
+ ? "This sets the room reviewer role. It does not automatically run a review pass yet."
1659
+ : intent.action === "agent-execute"
1660
+ ? "This sets the room executor role. Claim/mode rules still control actual execution."
1661
+ : "";
1623
1662
  return {
1624
1663
  kind: "agent",
1625
1664
  project: nextProject,
1626
1665
  markup: [
1627
- "<b>Roundtable terminal updated</b>",
1666
+ `<b>${escapeTelegramHtml(actionTitle)}</b>`,
1628
1667
  `owner: <code>${escapeTelegramHtml(targetAgent.ownerName || targetAgent.ownerId || targetAgent.label || targetAgent.id || "-")}</code>`,
1629
1668
  `terminal: <code>${escapeTelegramHtml(targetAgent.label || targetAgent.id || "-")}</code>`,
1630
1669
  `role: <code>${escapeTelegramHtml(intent.role)}</code>`,
1631
- `runtime: <code>${escapeTelegramHtml(targetAgent.provider && targetAgent.model ? `${targetAgent.provider}/${targetAgent.model}` : "unknown")}</code>`,
1632
- `project: <code>${escapeTelegramHtml(nextProject.projectName || path.basename(session.cwd || this.cwd))}</code>`
1670
+ `runtime: <code>${escapeTelegramHtml(runtimeLabel)}</code>`,
1671
+ `project: <code>${escapeTelegramHtml(nextProject.projectName || path.basename(session.cwd || this.cwd))}</code>`,
1672
+ note
1633
1673
  ].join("\n")
1634
1674
  };
1635
1675
  }