auto-reply: enrich chat status

This commit is contained in:
Peter Steinberger committed 2025-12-07 16:53:33 +00:00
1 parent 1f0ee9837b
commit e2c6546b61
9 files changed
+283 -1

No files matched your search

+27
View File
@@ -22,6 +22,9 @@ import {
type MsgContext,
type TemplateContext,
} from "./templating.js";
import { buildStatusMessage } from "./status.js";
import { resolveHeartbeatSeconds } from "../web/reconnect.js";
import { getWebAuthAgeMs, webAuthExists } from "../web/session.js";
import {
normalizeThinkLevel,
normalizeVerboseLevel,
@@ -503,6 +506,30 @@ export async function getReplyFromConfig(
};
}
if (
rawBodyNormalized === "/status" ||
rawBodyNormalized === "status" ||
rawBodyNormalized.startsWith("/status ")
) {
const webLinked = await webAuthExists();
const webAuthAgeMs = getWebAuthAgeMs();
const heartbeatSeconds = resolveHeartbeatSeconds(cfg, undefined);
const statusText = buildStatusMessage({
reply,
sessionEntry,
sessionKey,
sessionScope,
storePath,
resolvedThink: resolvedThinkLevel,
resolvedVerbose: resolvedVerboseLevel,
webLinked,
webAuthAgeMs,
heartbeatSeconds,
});
cleanupTyping();
return { text: statusText };
}
const abortRequested =
reply?.mode === "command" && isAbortTrigger(rawBodyNormalized);