style: format code

This commit is contained in:
Peter Steinberger
2026-01-18 19:36:46 +00:00
parent 601a052216
commit 690bb192e6
9 changed files with 33 additions and 31 deletions

View File

@@ -25,8 +25,7 @@ export function resolveAnnounceTargetFromKey(sessionKey: string): AnnounceTarget
const id = rest.join(":").trim(); const id = rest.join(":").trim();
if (!id) return null; if (!id) return null;
if (!channelRaw) return null; if (!channelRaw) return null;
const normalizedChannel = const normalizedChannel = normalizeAnyChannelId(channelRaw) ?? normalizeChatChannelId(channelRaw);
normalizeAnyChannelId(channelRaw) ?? normalizeChatChannelId(channelRaw);
const channel = normalizedChannel ?? channelRaw.toLowerCase(); const channel = normalizedChannel ?? channelRaw.toLowerCase();
const kindTarget = (() => { const kindTarget = (() => {
if (!normalizedChannel) return id; if (!normalizedChannel) return id;

View File

@@ -122,7 +122,10 @@ function formatZonedTimestamp(date: Date, timeZone?: string): string | undefined
return `${yyyy}-${mm}-${dd} ${hh}:${min}${tz ? ` ${tz}` : ""}`; return `${yyyy}-${mm}-${dd} ${hh}:${min}${tz ? ` ${tz}` : ""}`;
} }
function formatTimestamp(ts: number | Date | undefined, options?: EnvelopeFormatOptions): string | undefined { function formatTimestamp(
ts: number | Date | undefined,
options?: EnvelopeFormatOptions,
): string | undefined {
if (!ts) return undefined; if (!ts) return undefined;
const resolved = normalizeEnvelopeOptions(options); const resolved = normalizeEnvelopeOptions(options);
if (!resolved.includeTimestamp) return undefined; if (!resolved.includeTimestamp) return undefined;

View File

@@ -93,7 +93,15 @@ describe("gateway SIGTERM", () => {
child = spawn( child = spawn(
bunBin, bunBin,
["src/entry.ts", "gateway", "--port", String(port), "--bind", "loopback", "--allow-unconfigured"], [
"src/entry.ts",
"gateway",
"--port",
String(port),
"--bind",
"loopback",
"--allow-unconfigured",
],
{ {
cwd: process.cwd(), cwd: process.cwd(),
env: { env: {

View File

@@ -60,8 +60,8 @@ describe("promptDefaultModel", () => {
const options = select.mock.calls[0]?.[0]?.options ?? []; const options = select.mock.calls[0]?.[0]?.options ?? [];
expect(options.some((opt) => opt.value === "openrouter/auto")).toBe(false); expect(options.some((opt) => opt.value === "openrouter/auto")).toBe(false);
expect( expect(options.some((opt) => opt.value === "openrouter/meta-llama/llama-3.3-70b:free")).toBe(
options.some((opt) => opt.value === "openrouter/meta-llama/llama-3.3-70b:free"), true,
).toBe(true); );
}); });
}); });

View File

@@ -378,8 +378,7 @@ const FIELD_HELP: Record<string, string> = {
'Timezone for message envelopes ("utc", "local", "user", or an IANA timezone string).', 'Timezone for message envelopes ("utc", "local", "user", or an IANA timezone string).',
"agents.defaults.envelopeTimestamp": "agents.defaults.envelopeTimestamp":
'Include absolute timestamps in message envelopes ("on" or "off").', 'Include absolute timestamps in message envelopes ("on" or "off").',
"agents.defaults.envelopeElapsed": "agents.defaults.envelopeElapsed": 'Include elapsed time in message envelopes ("on" or "off").',
'Include elapsed time in message envelopes ("on" or "off").',
"agents.defaults.models": "Configured model catalog (keys are full provider/model IDs).", "agents.defaults.models": "Configured model catalog (keys are full provider/model IDs).",
"agents.defaults.memorySearch": "agents.defaults.memorySearch":
"Vector search over MEMORY.md and memory/*.md (per-agent overrides supported).", "Vector search over MEMORY.md and memory/*.md (per-agent overrides supported).",

View File

@@ -33,9 +33,7 @@ describe("applyExclusiveSlotSelection", () => {
expect(result.warnings).toContain( expect(result.warnings).toContain(
'Exclusive slot "memory" switched from "memory-core" to "memory".', 'Exclusive slot "memory" switched from "memory-core" to "memory".',
); );
expect(result.warnings).toContain( expect(result.warnings).toContain('Disabled other "memory" slot plugins: memory-core.');
'Disabled other "memory" slot plugins: memory-core.',
);
}); });
it("does nothing when the slot already matches", () => { it("does nothing when the slot already matches", () => {

View File

@@ -76,9 +76,7 @@ export function applyExclusiveSlotSelection(params: {
} }
if (disabledIds.length > 0) { if (disabledIds.length > 0) {
warnings.push( warnings.push(`Disabled other "${slotKey}" slot plugins: ${disabledIds.sort().join(", ")}.`);
`Disabled other "${slotKey}" slot plugins: ${disabledIds.sort().join(", ")}.`,
);
} }
const changed = prevSlot !== params.selectedId || disabledIds.length > 0; const changed = prevSlot !== params.selectedId || disabledIds.length > 0;

View File

@@ -1,8 +1,5 @@
import { resolveMessagePrefix } from "../../../agents/identity.js"; import { resolveMessagePrefix } from "../../../agents/identity.js";
import { import { formatInboundEnvelope, type EnvelopeFormatOptions } from "../../../auto-reply/envelope.js";
formatInboundEnvelope,
type EnvelopeFormatOptions,
} from "../../../auto-reply/envelope.js";
import type { loadConfig } from "../../../config/config.js"; import type { loadConfig } from "../../../config/config.js";
import type { WebInboundMsg } from "../types.js"; import type { WebInboundMsg } from "../types.js";