mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-11 23:03:53 +08:00
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
import fs from "node:fs";
|
|
import { describe, expect, it } from "vitest";
|
|
import { validateJsonSchemaValue } from "../../../src/plugins/schema-validator.js";
|
|
|
|
const manifest = JSON.parse(
|
|
fs.readFileSync(new URL("../openclaw.plugin.json", import.meta.url), "utf-8"),
|
|
) as { configSchema: Record<string, unknown> };
|
|
const manifestConfigSchemaCacheKey = "qqbot.manifest.config-schema";
|
|
|
|
describe("qqbot manifest schema", () => {
|
|
it("accepts top-level speech overrides", () => {
|
|
const result = validateJsonSchemaValue({
|
|
schema: manifest.configSchema,
|
|
cacheKey: manifestConfigSchemaCacheKey,
|
|
value: {
|
|
tts: {
|
|
provider: "openai",
|
|
baseUrl: "https://example.com/v1",
|
|
apiKey: "tts-key",
|
|
model: "gpt-4o-mini-tts",
|
|
voice: "alloy",
|
|
authStyle: "api-key",
|
|
queryParams: {
|
|
format: "wav",
|
|
},
|
|
speed: 1.1,
|
|
},
|
|
stt: {
|
|
provider: "openai",
|
|
baseUrl: "https://example.com/v1",
|
|
apiKey: "stt-key",
|
|
model: "whisper-1",
|
|
},
|
|
},
|
|
});
|
|
|
|
expect(result.ok).toBe(true);
|
|
});
|
|
|
|
it("accepts defaultAccount", () => {
|
|
const result = validateJsonSchemaValue({
|
|
schema: manifest.configSchema,
|
|
cacheKey: manifestConfigSchemaCacheKey,
|
|
value: {
|
|
defaultAccount: "bot2",
|
|
accounts: {
|
|
bot2: {
|
|
appId: "654321",
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
expect(result.ok).toBe(true);
|
|
});
|
|
});
|