fix(web): annotate group replies with sender

This commit is contained in:
Peter Steinberger
2025-12-03 13:25:34 +00:00
parent f68714ec8e
commit edc894f6c7
8 changed files with 79 additions and 55 deletions

View File

@@ -15,6 +15,7 @@ import { applyTemplate, type TemplateContext } from "./templating.js";
import {
formatToolAggregate,
shortenMeta,
shortenPath,
TOOL_RESULT_FLUSH_COUNT,
TOOL_RESULT_DEBOUNCE_MS,
} from "./tool-meta.js";
@@ -439,7 +440,7 @@ export async function runCommandReply(
const textBlocks = Array.isArray(msg.content)
? (msg.content as Array<{ type?: string; text?: string }>)
.filter((c) => c?.type === "text" && typeof c.text === "string")
.map((c) => c.text.trim())
.map((c) => (c.text ?? "").trim())
.filter(Boolean)
: [];
if (textBlocks.length === 0) return;

View File

@@ -26,7 +26,6 @@ import {
} from "./templating.js";
import { isAudio, transcribeInboundAudio } from "./transcription.js";
import type { GetReplyOptions, ReplyPayload } from "./types.js";
import { triggerWarelayRestart } from "../infra/restart.js";
export type { GetReplyOptions, ReplyPayload } from "./types.js";

View File

@@ -1,7 +1,7 @@
export const TOOL_RESULT_DEBOUNCE_MS = 500;
export const TOOL_RESULT_FLUSH_COUNT = 5;
function shortenPath(p: string): string {
export function shortenPath(p: string): string {
const home = process.env.HOME;
if (home && (p === home || p.startsWith(`${home}/`)))
return p.replace(home, "~");