@tritard/waterbrother 0.16.103 → 0.16.105
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 +25 -3
package/package.json
CHANGED
package/src/gateway.js
CHANGED
|
@@ -519,7 +519,7 @@ function getAgentOwnerDisplay(agent = {}, fallback = "") {
|
|
|
519
519
|
const ownerId = cleanAgentDisplayValue(agent?.ownerId);
|
|
520
520
|
const label = cleanAgentDisplayValue(agent?.label);
|
|
521
521
|
const fallbackValue = cleanAgentDisplayValue(fallback);
|
|
522
|
-
return ownerName ||
|
|
522
|
+
return ownerName || fallbackValue || label || ownerId || "unknown";
|
|
523
523
|
}
|
|
524
524
|
|
|
525
525
|
function getAgentTerminalDisplay(agent = {}, fallback = "") {
|
|
@@ -536,9 +536,10 @@ function getAgentTerminalDisplay(agent = {}, fallback = "") {
|
|
|
536
536
|
function formatBridgeHostLabel(host = {}) {
|
|
537
537
|
const owner = String(host?.ownerName || host?.ownerId || "").trim();
|
|
538
538
|
const label = String(host?.label || "").trim();
|
|
539
|
+
const sessionSuffix = String(host?.sessionId || "").trim().slice(-6);
|
|
539
540
|
const runtime = host?.provider && host?.model ? `${host.provider}/${host.model}` : "";
|
|
540
541
|
const safeLabel = label && !/\bundefined\b/i.test(label) ? label : "";
|
|
541
|
-
const primary = owner || safeLabel || "live terminal";
|
|
542
|
+
const primary = owner || safeLabel || (sessionSuffix ? `terminal ${sessionSuffix}` : "live terminal");
|
|
542
543
|
return [primary, safeLabel && safeLabel !== owner ? `(${safeLabel})` : "", runtime ? `[${runtime}]` : ""].filter(Boolean).join(" ").trim();
|
|
543
544
|
}
|
|
544
545
|
|
|
@@ -2048,6 +2049,23 @@ class TelegramGateway {
|
|
|
2048
2049
|
if (!targetAgent) {
|
|
2049
2050
|
targetAgent = resolveProjectAgent(project, intent.target);
|
|
2050
2051
|
}
|
|
2052
|
+
if (targetAgent) {
|
|
2053
|
+
const liveHosts = await this.getLiveBridgeHosts({ cwd: session.cwd || this.cwd });
|
|
2054
|
+
const liveHost = findLiveHostForAgent(liveHosts, targetAgent);
|
|
2055
|
+
if (liveHost) {
|
|
2056
|
+
targetAgent = {
|
|
2057
|
+
...targetAgent,
|
|
2058
|
+
ownerId: String(liveHost.ownerId || targetAgent.ownerId || "").trim(),
|
|
2059
|
+
ownerName: String(liveHost.ownerName || targetAgent.ownerName || "").trim(),
|
|
2060
|
+
label: String(liveHost.label || targetAgent.label || "").trim(),
|
|
2061
|
+
surface: String(liveHost.surface || targetAgent.surface || "").trim(),
|
|
2062
|
+
provider: String(liveHost.provider || targetAgent.provider || "").trim(),
|
|
2063
|
+
model: String(liveHost.model || targetAgent.model || "").trim(),
|
|
2064
|
+
runtimeProfile: String(liveHost.runtimeProfile || targetAgent.runtimeProfile || "").trim(),
|
|
2065
|
+
sessionId: String(liveHost.sessionId || targetAgent.sessionId || "").trim()
|
|
2066
|
+
};
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2051
2069
|
if (!targetAgent && /^(?:this|my)(?:\s+(?:bot|terminal))?$/.test(normalizedTarget)) {
|
|
2052
2070
|
const host = await this.getLiveBridgeHost();
|
|
2053
2071
|
if (host) {
|
|
@@ -3570,7 +3588,11 @@ class TelegramGateway {
|
|
|
3570
3588
|
const linkedSession = await loadSession(sessionId);
|
|
3571
3589
|
const sessionCwd = linkedSession.cwd || this.cwd;
|
|
3572
3590
|
const linkedProject = await loadSharedProject(sessionCwd).catch(() => null);
|
|
3573
|
-
|
|
3591
|
+
const preflightText = text.startsWith("/") ? "" : this.stripBotMention(text);
|
|
3592
|
+
const preflightStateIntent = preflightText ? parseTelegramStateIntent(preflightText) : null;
|
|
3593
|
+
if (!preflightStateIntent) {
|
|
3594
|
+
await this.maybeAnnounceRoomAgentEvents(message, linkedProject);
|
|
3595
|
+
}
|
|
3574
3596
|
|
|
3575
3597
|
if (text === "/about") {
|
|
3576
3598
|
await this.sendMessage(
|