style: run oxfmt
This commit is contained in:
@@ -121,7 +121,10 @@ function mergeRecord<T>(
|
|||||||
return { ...base, ...override };
|
return { ...base, ...override };
|
||||||
}
|
}
|
||||||
|
|
||||||
function mergeAuthProfileStores(base: AuthProfileStore, override: AuthProfileStore): AuthProfileStore {
|
function mergeAuthProfileStores(
|
||||||
|
base: AuthProfileStore,
|
||||||
|
override: AuthProfileStore,
|
||||||
|
): AuthProfileStore {
|
||||||
if (
|
if (
|
||||||
Object.keys(override.profiles).length === 0 &&
|
Object.keys(override.profiles).length === 0 &&
|
||||||
!override.order &&
|
!override.order &&
|
||||||
|
|||||||
@@ -30,7 +30,11 @@ const fsp = fs.promises;
|
|||||||
const skillsLogger = createSubsystemLogger("skills");
|
const skillsLogger = createSubsystemLogger("skills");
|
||||||
const skillCommandDebugOnce = new Set<string>();
|
const skillCommandDebugOnce = new Set<string>();
|
||||||
|
|
||||||
function debugSkillCommandOnce(messageKey: string, message: string, meta?: Record<string, unknown>) {
|
function debugSkillCommandOnce(
|
||||||
|
messageKey: string,
|
||||||
|
message: string,
|
||||||
|
meta?: Record<string, unknown>,
|
||||||
|
) {
|
||||||
if (skillCommandDebugOnce.has(messageKey)) return;
|
if (skillCommandDebugOnce.has(messageKey)) return;
|
||||||
skillCommandDebugOnce.add(messageKey);
|
skillCommandDebugOnce.add(messageKey);
|
||||||
skillsLogger.debug(message, meta);
|
skillsLogger.debug(message, meta);
|
||||||
|
|||||||
@@ -127,7 +127,8 @@ export function createCanvasTool(): AnyAgentTool {
|
|||||||
return jsonResult({ ok: true });
|
return jsonResult({ ok: true });
|
||||||
}
|
}
|
||||||
case "snapshot": {
|
case "snapshot": {
|
||||||
const formatRaw = typeof params.outputFormat === "string" ? params.outputFormat.toLowerCase() : "png";
|
const formatRaw =
|
||||||
|
typeof params.outputFormat === "string" ? params.outputFormat.toLowerCase() : "png";
|
||||||
const format = formatRaw === "jpg" || formatRaw === "jpeg" ? "jpeg" : "png";
|
const format = formatRaw === "jpg" || formatRaw === "jpeg" ? "jpeg" : "png";
|
||||||
const maxWidth =
|
const maxWidth =
|
||||||
typeof params.maxWidth === "number" && Number.isFinite(params.maxWidth)
|
typeof params.maxWidth === "number" && Number.isFinite(params.maxWidth)
|
||||||
|
|||||||
@@ -88,8 +88,7 @@ export async function setSyntheticApiKey(key: string, agentDir?: string) {
|
|||||||
|
|
||||||
export const ZAI_DEFAULT_MODEL_REF = "zai/glm-4.7";
|
export const ZAI_DEFAULT_MODEL_REF = "zai/glm-4.7";
|
||||||
export const OPENROUTER_DEFAULT_MODEL_REF = "openrouter/auto";
|
export const OPENROUTER_DEFAULT_MODEL_REF = "openrouter/auto";
|
||||||
export const VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF =
|
export const VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF = "vercel-ai-gateway/anthropic/claude-opus-4.5";
|
||||||
"vercel-ai-gateway/anthropic/claude-opus-4.5";
|
|
||||||
|
|
||||||
export async function setZaiApiKey(key: string, agentDir?: string) {
|
export async function setZaiApiKey(key: string, agentDir?: string) {
|
||||||
// Write to resolved agent dir so gateway finds credentials on startup.
|
// Write to resolved agent dir so gateway finds credentials on startup.
|
||||||
|
|||||||
@@ -63,9 +63,7 @@ describe("onboard (non-interactive): Vercel AI Gateway", () => {
|
|||||||
agents?: { defaults?: { model?: { primary?: string } } };
|
agents?: { defaults?: { model?: { primary?: string } } };
|
||||||
};
|
};
|
||||||
|
|
||||||
expect(cfg.auth?.profiles?.["vercel-ai-gateway:default"]?.provider).toBe(
|
expect(cfg.auth?.profiles?.["vercel-ai-gateway:default"]?.provider).toBe("vercel-ai-gateway");
|
||||||
"vercel-ai-gateway",
|
|
||||||
);
|
|
||||||
expect(cfg.auth?.profiles?.["vercel-ai-gateway:default"]?.mode).toBe("api_key");
|
expect(cfg.auth?.profiles?.["vercel-ai-gateway:default"]?.mode).toBe("api_key");
|
||||||
expect(cfg.agents?.defaults?.model?.primary).toBe(
|
expect(cfg.agents?.defaults?.model?.primary).toBe(
|
||||||
"vercel-ai-gateway/anthropic/claude-opus-4.5",
|
"vercel-ai-gateway/anthropic/claude-opus-4.5",
|
||||||
|
|||||||
@@ -266,9 +266,7 @@ export const registerTelegramHandlers = ({
|
|||||||
senderUsername,
|
senderUsername,
|
||||||
})
|
})
|
||||||
) {
|
) {
|
||||||
logVerbose(
|
logVerbose(`Blocked telegram group message from ${senderId} (groupPolicy: allowlist)`);
|
||||||
`Blocked telegram group message from ${senderId} (groupPolicy: allowlist)`,
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,14 +56,11 @@ export function isTelegramInlineButtonsEnabled(params: {
|
|||||||
return resolveTelegramInlineButtonsScope(params) !== "off";
|
return resolveTelegramInlineButtonsScope(params) !== "off";
|
||||||
}
|
}
|
||||||
return accountIds.some(
|
return accountIds.some(
|
||||||
(accountId) =>
|
(accountId) => resolveTelegramInlineButtonsScope({ cfg: params.cfg, accountId }) !== "off",
|
||||||
resolveTelegramInlineButtonsScope({ cfg: params.cfg, accountId }) !== "off",
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resolveTelegramTargetChatType(
|
export function resolveTelegramTargetChatType(target: string): "direct" | "group" | "unknown" {
|
||||||
target: string,
|
|
||||||
): "direct" | "group" | "unknown" {
|
|
||||||
const trimmed = target.trim();
|
const trimmed = target.trim();
|
||||||
if (!trimmed) return "unknown";
|
if (!trimmed) return "unknown";
|
||||||
if (/^-?\d+$/.test(trimmed)) {
|
if (/^-?\d+$/.test(trimmed)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user