style: format code
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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: {
|
||||||
|
|||||||
@@ -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);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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).",
|
||||||
|
|||||||
@@ -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", () => {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -404,18 +404,18 @@ export async function prepareSlackMessage(params: {
|
|||||||
limit: ctx.historyLimit,
|
limit: ctx.historyLimit,
|
||||||
currentMessage: combinedBody,
|
currentMessage: combinedBody,
|
||||||
formatEntry: (entry) =>
|
formatEntry: (entry) =>
|
||||||
formatInboundEnvelope({
|
formatInboundEnvelope({
|
||||||
channel: "Slack",
|
channel: "Slack",
|
||||||
from: roomLabel,
|
from: roomLabel,
|
||||||
timestamp: entry.timestamp,
|
timestamp: entry.timestamp,
|
||||||
body: `${entry.body}${
|
body: `${entry.body}${
|
||||||
entry.messageId ? ` [id:${entry.messageId} channel:${message.channel}]` : ""
|
entry.messageId ? ` [id:${entry.messageId} channel:${message.channel}]` : ""
|
||||||
}`,
|
}`,
|
||||||
chatType: "channel",
|
chatType: "channel",
|
||||||
senderLabel: entry.sender,
|
senderLabel: entry.sender,
|
||||||
envelope: envelopeOptions,
|
envelope: envelopeOptions,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const slackTo = isDirectMessage ? `user:${message.user}` : `channel:${message.channel}`;
|
const slackTo = isDirectMessage ? `user:${message.user}` : `channel:${message.channel}`;
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user