style: format code
This commit is contained in:
@@ -25,8 +25,7 @@ export function resolveAnnounceTargetFromKey(sessionKey: string): AnnounceTarget
|
||||
const id = rest.join(":").trim();
|
||||
if (!id) return null;
|
||||
if (!channelRaw) return null;
|
||||
const normalizedChannel =
|
||||
normalizeAnyChannelId(channelRaw) ?? normalizeChatChannelId(channelRaw);
|
||||
const normalizedChannel = normalizeAnyChannelId(channelRaw) ?? normalizeChatChannelId(channelRaw);
|
||||
const channel = normalizedChannel ?? channelRaw.toLowerCase();
|
||||
const kindTarget = (() => {
|
||||
if (!normalizedChannel) return id;
|
||||
|
||||
@@ -122,7 +122,10 @@ function formatZonedTimestamp(date: Date, timeZone?: string): string | undefined
|
||||
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;
|
||||
const resolved = normalizeEnvelopeOptions(options);
|
||||
if (!resolved.includeTimestamp) return undefined;
|
||||
|
||||
@@ -93,7 +93,15 @@ describe("gateway SIGTERM", () => {
|
||||
|
||||
child = spawn(
|
||||
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(),
|
||||
env: {
|
||||
|
||||
@@ -60,8 +60,8 @@ describe("promptDefaultModel", () => {
|
||||
|
||||
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/meta-llama/llama-3.3-70b:free"),
|
||||
).toBe(true);
|
||||
expect(options.some((opt) => opt.value === "openrouter/meta-llama/llama-3.3-70b:free")).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -378,8 +378,7 @@ const FIELD_HELP: Record<string, string> = {
|
||||
'Timezone for message envelopes ("utc", "local", "user", or an IANA timezone string).',
|
||||
"agents.defaults.envelopeTimestamp":
|
||||
'Include absolute timestamps in message envelopes ("on" or "off").',
|
||||
"agents.defaults.envelopeElapsed":
|
||||
'Include elapsed time in message envelopes ("on" or "off").',
|
||||
"agents.defaults.envelopeElapsed": 'Include elapsed time in message envelopes ("on" or "off").',
|
||||
"agents.defaults.models": "Configured model catalog (keys are full provider/model IDs).",
|
||||
"agents.defaults.memorySearch":
|
||||
"Vector search over MEMORY.md and memory/*.md (per-agent overrides supported).",
|
||||
|
||||
@@ -33,9 +33,7 @@ describe("applyExclusiveSlotSelection", () => {
|
||||
expect(result.warnings).toContain(
|
||||
'Exclusive slot "memory" switched from "memory-core" to "memory".',
|
||||
);
|
||||
expect(result.warnings).toContain(
|
||||
'Disabled other "memory" slot plugins: memory-core.',
|
||||
);
|
||||
expect(result.warnings).toContain('Disabled other "memory" slot plugins: memory-core.');
|
||||
});
|
||||
|
||||
it("does nothing when the slot already matches", () => {
|
||||
|
||||
@@ -76,9 +76,7 @@ export function applyExclusiveSlotSelection(params: {
|
||||
}
|
||||
|
||||
if (disabledIds.length > 0) {
|
||||
warnings.push(
|
||||
`Disabled other "${slotKey}" slot plugins: ${disabledIds.sort().join(", ")}.`,
|
||||
);
|
||||
warnings.push(`Disabled other "${slotKey}" slot plugins: ${disabledIds.sort().join(", ")}.`);
|
||||
}
|
||||
|
||||
const changed = prevSlot !== params.selectedId || disabledIds.length > 0;
|
||||
|
||||
@@ -404,18 +404,18 @@ export async function prepareSlackMessage(params: {
|
||||
limit: ctx.historyLimit,
|
||||
currentMessage: combinedBody,
|
||||
formatEntry: (entry) =>
|
||||
formatInboundEnvelope({
|
||||
channel: "Slack",
|
||||
from: roomLabel,
|
||||
timestamp: entry.timestamp,
|
||||
body: `${entry.body}${
|
||||
entry.messageId ? ` [id:${entry.messageId} channel:${message.channel}]` : ""
|
||||
}`,
|
||||
chatType: "channel",
|
||||
senderLabel: entry.sender,
|
||||
envelope: envelopeOptions,
|
||||
}),
|
||||
});
|
||||
formatInboundEnvelope({
|
||||
channel: "Slack",
|
||||
from: roomLabel,
|
||||
timestamp: entry.timestamp,
|
||||
body: `${entry.body}${
|
||||
entry.messageId ? ` [id:${entry.messageId} channel:${message.channel}]` : ""
|
||||
}`,
|
||||
chatType: "channel",
|
||||
senderLabel: entry.sender,
|
||||
envelope: envelopeOptions,
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
const slackTo = isDirectMessage ? `user:${message.user}` : `channel:${message.channel}`;
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import { resolveMessagePrefix } from "../../../agents/identity.js";
|
||||
import {
|
||||
formatInboundEnvelope,
|
||||
type EnvelopeFormatOptions,
|
||||
} from "../../../auto-reply/envelope.js";
|
||||
import { formatInboundEnvelope, type EnvelopeFormatOptions } from "../../../auto-reply/envelope.js";
|
||||
import type { loadConfig } from "../../../config/config.js";
|
||||
import type { WebInboundMsg } from "../types.js";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user