style: biome formatting
This commit is contained in:
@@ -10,40 +10,36 @@ const LIVE = process.env.MINIMAX_LIVE_TEST === "1" || process.env.LIVE === "1";
|
|||||||
const describeLive = LIVE && MINIMAX_KEY ? describe : describe.skip;
|
const describeLive = LIVE && MINIMAX_KEY ? describe : describe.skip;
|
||||||
|
|
||||||
describeLive("minimax live", () => {
|
describeLive("minimax live", () => {
|
||||||
it(
|
it("returns assistant text", async () => {
|
||||||
"returns assistant text",
|
const model: Model<"openai-completions"> = {
|
||||||
async () => {
|
id: MINIMAX_MODEL,
|
||||||
const model: Model<"openai-completions"> = {
|
name: `MiniMax ${MINIMAX_MODEL}`,
|
||||||
id: MINIMAX_MODEL,
|
api: "openai-completions",
|
||||||
name: `MiniMax ${MINIMAX_MODEL}`,
|
provider: "minimax",
|
||||||
api: "openai-completions",
|
baseUrl: MINIMAX_BASE_URL,
|
||||||
provider: "minimax",
|
reasoning: false,
|
||||||
baseUrl: MINIMAX_BASE_URL,
|
input: ["text"],
|
||||||
reasoning: false,
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
||||||
input: ["text"],
|
contextWindow: 200000,
|
||||||
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
maxTokens: 8192,
|
||||||
contextWindow: 200000,
|
};
|
||||||
maxTokens: 8192,
|
const res = await completeSimple(
|
||||||
};
|
model,
|
||||||
const res = await completeSimple(
|
{
|
||||||
model,
|
messages: [
|
||||||
{
|
{
|
||||||
messages: [
|
role: "user",
|
||||||
{
|
content: "Reply with the word ok.",
|
||||||
role: "user",
|
timestamp: Date.now(),
|
||||||
content: "Reply with the word ok.",
|
},
|
||||||
timestamp: Date.now(),
|
],
|
||||||
},
|
},
|
||||||
],
|
{ apiKey: MINIMAX_KEY, maxTokens: 64 },
|
||||||
},
|
);
|
||||||
{ apiKey: MINIMAX_KEY, maxTokens: 64 },
|
const text = res.content
|
||||||
);
|
.filter((block) => block.type === "text")
|
||||||
const text = res.content
|
.map((block) => block.text.trim())
|
||||||
.filter((block) => block.type === "text")
|
.join(" ");
|
||||||
.map((block) => block.text.trim())
|
expect(text.length).toBeGreaterThan(0);
|
||||||
.join(" ");
|
}, 20000);
|
||||||
expect(text.length).toBeGreaterThan(0);
|
|
||||||
},
|
|
||||||
20000,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ import type { ClawdisConfig } from "../config/config.js";
|
|||||||
import { CONFIG_DIR } from "../utils.js";
|
import { CONFIG_DIR } from "../utils.js";
|
||||||
import {
|
import {
|
||||||
hasBinary,
|
hasBinary,
|
||||||
|
isBundledSkillAllowed,
|
||||||
isConfigPathTruthy,
|
isConfigPathTruthy,
|
||||||
loadWorkspaceSkillEntries,
|
loadWorkspaceSkillEntries,
|
||||||
resolveBundledAllowlist,
|
resolveBundledAllowlist,
|
||||||
resolveConfigPath,
|
resolveConfigPath,
|
||||||
resolveSkillConfig,
|
resolveSkillConfig,
|
||||||
resolveSkillsInstallPreferences,
|
resolveSkillsInstallPreferences,
|
||||||
isBundledSkillAllowed,
|
|
||||||
type SkillEntry,
|
type SkillEntry,
|
||||||
type SkillInstallSpec,
|
type SkillInstallSpec,
|
||||||
type SkillsInstallPreferences,
|
type SkillsInstallPreferences,
|
||||||
|
|||||||
@@ -223,9 +223,7 @@ export function resolveSkillConfig(
|
|||||||
function normalizeAllowlist(input: unknown): string[] | undefined {
|
function normalizeAllowlist(input: unknown): string[] | undefined {
|
||||||
if (!input) return undefined;
|
if (!input) return undefined;
|
||||||
if (!Array.isArray(input)) return undefined;
|
if (!Array.isArray(input)) return undefined;
|
||||||
const normalized = input
|
const normalized = input.map((entry) => String(entry).trim()).filter(Boolean);
|
||||||
.map((entry) => String(entry).trim())
|
|
||||||
.filter(Boolean);
|
|
||||||
return normalized.length > 0 ? normalized : undefined;
|
return normalized.length > 0 ? normalized : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ const LIVE = process.env.ZAI_LIVE_TEST === "1" || process.env.LIVE === "1";
|
|||||||
const describeLive = LIVE && ZAI_KEY ? describe : describe.skip;
|
const describeLive = LIVE && ZAI_KEY ? describe : describe.skip;
|
||||||
|
|
||||||
describeLive("zai live", () => {
|
describeLive("zai live", () => {
|
||||||
it(
|
it("returns assistant text", async () => {
|
||||||
"returns assistant text",
|
|
||||||
async () => {
|
|
||||||
const model = getModel("zai", "glm-4.7");
|
const model = getModel("zai", "glm-4.7");
|
||||||
const res = await completeSimple(
|
const res = await completeSimple(
|
||||||
model,
|
model,
|
||||||
@@ -29,7 +27,5 @@ describeLive("zai live", () => {
|
|||||||
.map((block) => block.text.trim())
|
.map((block) => block.text.trim())
|
||||||
.join(" ");
|
.join(" ");
|
||||||
expect(text.length).toBeGreaterThan(0);
|
expect(text.length).toBeGreaterThan(0);
|
||||||
},
|
}, 20000);
|
||||||
20000,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -427,7 +427,7 @@ export async function agentCommand(
|
|||||||
? discordTarget
|
? discordTarget
|
||||||
: deliveryProvider === "signal"
|
: deliveryProvider === "signal"
|
||||||
? signalTarget
|
? signalTarget
|
||||||
: undefined;
|
: undefined;
|
||||||
const message = `Delivery failed (${deliveryProvider}${deliveryTarget ? ` to ${deliveryTarget}` : ""}): ${String(err)}`;
|
const message = `Delivery failed (${deliveryProvider}${deliveryTarget ? ` to ${deliveryTarget}` : ""}): ${String(err)}`;
|
||||||
runtime.error?.(message);
|
runtime.error?.(message);
|
||||||
if (!runtime.error) runtime.log(message);
|
if (!runtime.error) runtime.log(message);
|
||||||
|
|||||||
@@ -86,9 +86,7 @@ export async function sendCommand(
|
|||||||
const result = await deps.sendMessageSignal(opts.to, opts.message, {
|
const result = await deps.sendMessageSignal(opts.to, opts.message, {
|
||||||
mediaUrl: opts.media,
|
mediaUrl: opts.media,
|
||||||
});
|
});
|
||||||
runtime.log(
|
runtime.log(success(`✅ Sent via signal. Message ID: ${result.messageId}`));
|
||||||
success(`✅ Sent via signal. Message ID: ${result.messageId}`),
|
|
||||||
);
|
|
||||||
if (opts.json) {
|
if (opts.json) {
|
||||||
runtime.log(
|
runtime.log(
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import { WebSocket } from "ws";
|
|||||||
import { agentCommand } from "../commands/agent.js";
|
import { agentCommand } from "../commands/agent.js";
|
||||||
import {
|
import {
|
||||||
CONFIG_PATH_CLAWDIS,
|
CONFIG_PATH_CLAWDIS,
|
||||||
STATE_DIR_CLAWDIS,
|
|
||||||
readConfigFileSnapshot,
|
readConfigFileSnapshot,
|
||||||
|
STATE_DIR_CLAWDIS,
|
||||||
writeConfigFile,
|
writeConfigFile,
|
||||||
} from "../config/config.js";
|
} from "../config/config.js";
|
||||||
import { emitAgentEvent } from "../infra/agent-events.js";
|
import { emitAgentEvent } from "../infra/agent-events.js";
|
||||||
@@ -2108,7 +2108,10 @@ describe("gateway server", () => {
|
|||||||
);
|
);
|
||||||
expect(res.ok).toBe(true);
|
expect(res.ok).toBe(true);
|
||||||
const payload = res.payload as
|
const payload = res.payload as
|
||||||
| { type?: unknown; snapshot?: { configPath?: string; stateDir?: string } }
|
| {
|
||||||
|
type?: unknown;
|
||||||
|
snapshot?: { configPath?: string; stateDir?: string };
|
||||||
|
}
|
||||||
| undefined;
|
| undefined;
|
||||||
expect(payload?.type).toBe("hello-ok");
|
expect(payload?.type).toBe("hello-ok");
|
||||||
expect(payload?.snapshot?.configPath).toBe(CONFIG_PATH_CLAWDIS);
|
expect(payload?.snapshot?.configPath).toBe(CONFIG_PATH_CLAWDIS);
|
||||||
|
|||||||
@@ -46,11 +46,11 @@ import { getStatusSummary } from "../commands/status.js";
|
|||||||
import {
|
import {
|
||||||
type ClawdisConfig,
|
type ClawdisConfig,
|
||||||
CONFIG_PATH_CLAWDIS,
|
CONFIG_PATH_CLAWDIS,
|
||||||
STATE_DIR_CLAWDIS,
|
|
||||||
isNixMode,
|
isNixMode,
|
||||||
loadConfig,
|
loadConfig,
|
||||||
parseConfigJson5,
|
parseConfigJson5,
|
||||||
readConfigFileSnapshot,
|
readConfigFileSnapshot,
|
||||||
|
STATE_DIR_CLAWDIS,
|
||||||
validateConfigObject,
|
validateConfigObject,
|
||||||
writeConfigFile,
|
writeConfigFile,
|
||||||
} from "../config/config.js";
|
} from "../config/config.js";
|
||||||
@@ -74,8 +74,6 @@ import {
|
|||||||
sendMessageDiscord,
|
sendMessageDiscord,
|
||||||
} from "../discord/index.js";
|
} from "../discord/index.js";
|
||||||
import { type DiscordProbe, probeDiscord } from "../discord/probe.js";
|
import { type DiscordProbe, probeDiscord } from "../discord/probe.js";
|
||||||
import { monitorSignalProvider, sendMessageSignal } from "../signal/index.js";
|
|
||||||
import { type SignalProbe, probeSignal } from "../signal/probe.js";
|
|
||||||
import { isVerbose } from "../globals.js";
|
import { isVerbose } from "../globals.js";
|
||||||
import { onAgentEvent } from "../infra/agent-events.js";
|
import { onAgentEvent } from "../infra/agent-events.js";
|
||||||
import { startGatewayBonjourAdvertiser } from "../infra/bonjour.js";
|
import { startGatewayBonjourAdvertiser } from "../infra/bonjour.js";
|
||||||
@@ -141,6 +139,8 @@ import { setCommandLaneConcurrency } from "../process/command-queue.js";
|
|||||||
import { runExec } from "../process/exec.js";
|
import { runExec } from "../process/exec.js";
|
||||||
import { monitorWebProvider, webAuthExists } from "../providers/web/index.js";
|
import { monitorWebProvider, webAuthExists } from "../providers/web/index.js";
|
||||||
import { defaultRuntime } from "../runtime.js";
|
import { defaultRuntime } from "../runtime.js";
|
||||||
|
import { monitorSignalProvider, sendMessageSignal } from "../signal/index.js";
|
||||||
|
import { probeSignal, type SignalProbe } from "../signal/probe.js";
|
||||||
import { monitorTelegramProvider } from "../telegram/monitor.js";
|
import { monitorTelegramProvider } from "../telegram/monitor.js";
|
||||||
import { probeTelegram, type TelegramProbe } from "../telegram/probe.js";
|
import { probeTelegram, type TelegramProbe } from "../telegram/probe.js";
|
||||||
import { sendMessageTelegram } from "../telegram/send.js";
|
import { sendMessageTelegram } from "../telegram/send.js";
|
||||||
@@ -4097,7 +4097,8 @@ export async function startGatewayServer(
|
|||||||
const signalHost = signalCfg?.httpHost?.trim() || "127.0.0.1";
|
const signalHost = signalCfg?.httpHost?.trim() || "127.0.0.1";
|
||||||
const signalPort = signalCfg?.httpPort ?? 8080;
|
const signalPort = signalCfg?.httpPort ?? 8080;
|
||||||
const signalBaseUrl =
|
const signalBaseUrl =
|
||||||
signalCfg?.httpUrl?.trim() || `http://${signalHost}:${signalPort}`;
|
signalCfg?.httpUrl?.trim() ||
|
||||||
|
`http://${signalHost}:${signalPort}`;
|
||||||
const signalConfigured = Boolean(signalCfg) && signalEnabled;
|
const signalConfigured = Boolean(signalCfg) && signalEnabled;
|
||||||
let signalProbe: SignalProbe | undefined;
|
let signalProbe: SignalProbe | undefined;
|
||||||
let signalLastProbeAt: number | null = null;
|
let signalLastProbeAt: number | null = null;
|
||||||
@@ -6518,9 +6519,9 @@ export async function startGatewayServer(
|
|||||||
await stopBrowserControlServerIfStarted().catch(() => {});
|
await stopBrowserControlServerIfStarted().catch(() => {});
|
||||||
}
|
}
|
||||||
await Promise.allSettled(
|
await Promise.allSettled(
|
||||||
[whatsappTask, telegramTask, signalTask].filter(
|
[whatsappTask, telegramTask, signalTask].filter(Boolean) as Array<
|
||||||
Boolean,
|
Promise<unknown>
|
||||||
) as Array<Promise<unknown>>,
|
>,
|
||||||
);
|
);
|
||||||
await new Promise<void>((resolve) => wss.close(() => resolve()));
|
await new Promise<void>((resolve) => wss.close(() => resolve()));
|
||||||
await new Promise<void>((resolve, reject) =>
|
await new Promise<void>((resolve, reject) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user