@tritard/waterbrother 0.16.87 → 0.16.89
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/package.json +1 -1
- package/src/gateway.js +22 -4
package/package.json
CHANGED
package/src/gateway.js
CHANGED
|
@@ -276,7 +276,7 @@ function buildTelegramDmOnboardingMarkup({ cwd = "", project = null, peer = null
|
|
|
276
276
|
const activeProject = project?.projectName || (cwd ? path.basename(cwd) : "");
|
|
277
277
|
return [
|
|
278
278
|
"<b>Waterbrother on Telegram</b>",
|
|
279
|
-
"
|
|
279
|
+
"This chat is a first-class Waterbrother surface. Ask questions, make changes, refine work, or share the current project into a team room.",
|
|
280
280
|
activeProject ? `current project: <code>${escapeTelegramHtml(activeProject)}</code>` : "",
|
|
281
281
|
cwd ? `cwd: <code>${escapeTelegramHtml(cwd)}</code>` : "",
|
|
282
282
|
peer?.sessionId ? `linked session: <code>${escapeTelegramHtml(peer.sessionId)}</code>` : "",
|
|
@@ -285,6 +285,7 @@ function buildTelegramDmOnboardingMarkup({ cwd = "", project = null, peer = null
|
|
|
285
285
|
"• ask <code>what project are you in?</code>",
|
|
286
286
|
"• say <code>make a test page in this project</code>",
|
|
287
287
|
"• say <code>share this project in my Telegram room</code>",
|
|
288
|
+
"• ask <code>what can I do here?</code>",
|
|
288
289
|
"",
|
|
289
290
|
"<b>Need the full command list?</b>",
|
|
290
291
|
"Use <code>/help</code>."
|
|
@@ -294,6 +295,8 @@ function buildTelegramDmOnboardingMarkup({ cwd = "", project = null, peer = null
|
|
|
294
295
|
function buildTelegramRoomOnboardingMarkup({ project = null, actorName = "", executor = {} } = {}) {
|
|
295
296
|
const participants = listProjectParticipants(project);
|
|
296
297
|
const agents = listProjectAgents(project);
|
|
298
|
+
const reviewer = chooseReviewerAgent(project);
|
|
299
|
+
const blockingReview = getLatestBlockingReviewPolicy(project);
|
|
297
300
|
return [
|
|
298
301
|
"<b>Roundtable room</b>",
|
|
299
302
|
actorName ? `${escapeTelegramHtml(actorName)} is talking to Waterbrother in the shared room for <code>${escapeTelegramHtml(project?.projectName || "this project")}</code>.` : "",
|
|
@@ -301,11 +304,14 @@ function buildTelegramRoomOnboardingMarkup({ project = null, actorName = "", exe
|
|
|
301
304
|
`participants: <code>${escapeTelegramHtml(String(participants.length || (project?.members || []).length || 0))}</code>`,
|
|
302
305
|
`agents: <code>${escapeTelegramHtml(String(agents.length || 0))}</code>`,
|
|
303
306
|
executor?.provider && executor?.model ? `active runtime: <code>${escapeTelegramHtml(`${executor.provider}/${executor.model}`)}</code>` : "",
|
|
307
|
+
reviewer ? `reviewer: <code>${escapeTelegramHtml(reviewer.ownerName || reviewer.label || reviewer.ownerId || reviewer.id || "unknown")}</code>` : "",
|
|
308
|
+
`blocking review: <code>${escapeTelegramHtml(blockingReview ? "yes" : "no")}</code>`,
|
|
304
309
|
"",
|
|
305
310
|
"<b>What you can do here</b>",
|
|
306
311
|
"• ask <code>what project is this chat bound to?</code>",
|
|
307
312
|
"• ask <code>who is in the room?</code>",
|
|
308
313
|
"• say <code>add Austin as editor</code>",
|
|
314
|
+
"• ask <code>which terminals are live?</code>",
|
|
309
315
|
"• in execute mode, address Waterbrother directly to build or change code",
|
|
310
316
|
"",
|
|
311
317
|
"Use <code>/help</code> for the full command list."
|
|
@@ -340,14 +346,22 @@ function buildTelegramAgentAnnouncementMarkup(event = {}) {
|
|
|
340
346
|
const label = String(meta.label || meta.agentId || "").trim() || "terminal";
|
|
341
347
|
const runtime = meta.provider && meta.model ? `${meta.provider}/${meta.model}` : "";
|
|
342
348
|
const title = meta.isNew ? "Roundtable terminal joined" : "Roundtable terminal updated";
|
|
349
|
+
const role = String(meta.role || "standby").trim() || "standby";
|
|
350
|
+
const roleGuidance = role === "executor"
|
|
351
|
+
? "This terminal is the selected executor and can take room work when it is live."
|
|
352
|
+
: role === "reviewer"
|
|
353
|
+
? "This terminal is the room reviewer and can be asked for a second opinion or blocking review."
|
|
354
|
+
: "This terminal is on standby until the room assigns it a more active role.";
|
|
343
355
|
return [
|
|
344
356
|
`<b>${escapeTelegramHtml(title)}</b>`,
|
|
345
357
|
`owner: <code>${escapeTelegramHtml(ownerName)}</code>`,
|
|
346
358
|
`terminal: <code>${escapeTelegramHtml(label)}</code>`,
|
|
347
|
-
`role: <code>${escapeTelegramHtml(
|
|
359
|
+
`role: <code>${escapeTelegramHtml(role)}</code>`,
|
|
348
360
|
`surface: <code>${escapeTelegramHtml(String(meta.surface || "unknown"))}</code>`,
|
|
349
361
|
runtime ? `runtime: <code>${escapeTelegramHtml(runtime)}</code>` : "",
|
|
350
|
-
meta.runtimeProfile ? `runtime profile: <code>${escapeTelegramHtml(String(meta.runtimeProfile || ""))}</code>` : ""
|
|
362
|
+
meta.runtimeProfile ? `runtime profile: <code>${escapeTelegramHtml(String(meta.runtimeProfile || ""))}</code>` : "",
|
|
363
|
+
roleGuidance,
|
|
364
|
+
"Examples: <code>which terminals are live?</code>, <code>have Austin's bot be reviewer</code>, <code>have Phillip's bot take execution</code>"
|
|
351
365
|
].filter(Boolean).join("\n");
|
|
352
366
|
}
|
|
353
367
|
|
|
@@ -1606,6 +1620,8 @@ class TelegramGateway {
|
|
|
1606
1620
|
const participants = listProjectParticipants(project);
|
|
1607
1621
|
const agents = listProjectAgents(project);
|
|
1608
1622
|
const executorAgent = agents.find((agent) => String(agent?.role || "").trim() === "executor") || null;
|
|
1623
|
+
const reviewerAgent = chooseReviewerAgent(project);
|
|
1624
|
+
const blockingReview = getLatestBlockingReviewPolicy(project);
|
|
1609
1625
|
return [
|
|
1610
1626
|
"<b>Roundtable room</b>",
|
|
1611
1627
|
`${escapeTelegramHtml(actor.displayName || actor.userId)} is now in <code>${escapeTelegramHtml(project.projectName || "this project")}</code> as <code>observer</code>.`,
|
|
@@ -1615,9 +1631,11 @@ class TelegramGateway {
|
|
|
1615
1631
|
: "active operator: <code>none</code>",
|
|
1616
1632
|
`participants: <code>${escapeTelegramHtml(String(participants.length || (project.members || []).length))}</code>`,
|
|
1617
1633
|
executorAgent ? `active terminal: <code>${escapeTelegramHtml(formatAgentLabel(executorAgent) || executorAgent.id)}</code>` : "",
|
|
1634
|
+
reviewerAgent ? `reviewer: <code>${escapeTelegramHtml(reviewerAgent.ownerName || reviewerAgent.label || reviewerAgent.ownerId || reviewerAgent.id || "unknown")}</code>` : "",
|
|
1635
|
+
`blocking review: <code>${escapeTelegramHtml(blockingReview ? "yes" : "no")}</code>`,
|
|
1618
1636
|
"As observer, you can ask questions, discuss plans, and review work here.",
|
|
1619
1637
|
"An owner can promote you to editor or owner conversationally.",
|
|
1620
|
-
"Examples: <code>what project is this chat bound to?</code>, <code>who is in the room?</code>, <code>what can I do here?</code>"
|
|
1638
|
+
"Examples: <code>what project is this chat bound to?</code>, <code>who is in the room?</code>, <code>which terminals are live?</code>, <code>what can I do here?</code>"
|
|
1621
1639
|
].filter(Boolean).join("\n");
|
|
1622
1640
|
}
|
|
1623
1641
|
|