mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-17 15:43:19 +08:00
重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
This commit is contained in:
parent
4a23b715a2
commit
dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions
141
openclaw/test/official-channel-catalog.test.ts
Normal file
141
openclaw/test/official-channel-catalog.test.ts
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
buildOfficialChannelCatalog,
|
||||
OFFICIAL_CHANNEL_CATALOG_RELATIVE_PATH,
|
||||
writeOfficialChannelCatalog,
|
||||
} from "../scripts/write-official-channel-catalog.mjs";
|
||||
import { bundledPluginRoot } from "./helpers/bundled-plugin-paths.js";
|
||||
import { cleanupTempDirs, makeTempRepoRoot, writeJsonFile } from "./helpers/temp-repo.js";
|
||||
|
||||
const tempDirs: string[] = [];
|
||||
|
||||
function makeRepoRoot(prefix: string): string {
|
||||
return makeTempRepoRoot(tempDirs, prefix);
|
||||
}
|
||||
|
||||
function writeJson(filePath: string, value: unknown): void {
|
||||
writeJsonFile(filePath, value);
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
cleanupTempDirs(tempDirs);
|
||||
});
|
||||
|
||||
describe("buildOfficialChannelCatalog", () => {
|
||||
it("includes publishable official channel plugins and skips non-publishable entries", () => {
|
||||
const repoRoot = makeRepoRoot("openclaw-official-channel-catalog-");
|
||||
writeJson(path.join(repoRoot, "extensions", "whatsapp", "package.json"), {
|
||||
name: "@openclaw/whatsapp",
|
||||
version: "2026.3.23",
|
||||
description: "OpenClaw WhatsApp channel plugin",
|
||||
openclaw: {
|
||||
channel: {
|
||||
id: "whatsapp",
|
||||
label: "WhatsApp",
|
||||
selectionLabel: "WhatsApp (QR link)",
|
||||
detailLabel: "WhatsApp Web",
|
||||
docsPath: "/channels/whatsapp",
|
||||
blurb: "works with your own number; recommend a separate phone + eSIM.",
|
||||
},
|
||||
install: {
|
||||
npmSpec: "@openclaw/whatsapp",
|
||||
localPath: bundledPluginRoot("whatsapp"),
|
||||
defaultChoice: "npm",
|
||||
},
|
||||
release: {
|
||||
publishToNpm: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
writeJson(path.join(repoRoot, "extensions", "local-only", "package.json"), {
|
||||
name: "@openclaw/local-only",
|
||||
openclaw: {
|
||||
channel: {
|
||||
id: "local-only",
|
||||
label: "Local Only",
|
||||
selectionLabel: "Local Only",
|
||||
docsPath: "/channels/local-only",
|
||||
blurb: "dev only",
|
||||
},
|
||||
install: {
|
||||
localPath: bundledPluginRoot("local-only"),
|
||||
},
|
||||
release: {
|
||||
publishToNpm: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(buildOfficialChannelCatalog({ repoRoot })).toEqual({
|
||||
entries: [
|
||||
{
|
||||
name: "@openclaw/whatsapp",
|
||||
version: "2026.3.23",
|
||||
description: "OpenClaw WhatsApp channel plugin",
|
||||
openclaw: {
|
||||
channel: {
|
||||
id: "whatsapp",
|
||||
label: "WhatsApp",
|
||||
selectionLabel: "WhatsApp (QR link)",
|
||||
detailLabel: "WhatsApp Web",
|
||||
docsPath: "/channels/whatsapp",
|
||||
blurb: "works with your own number; recommend a separate phone + eSIM.",
|
||||
},
|
||||
install: {
|
||||
npmSpec: "@openclaw/whatsapp",
|
||||
defaultChoice: "npm",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it("writes the official catalog under dist", () => {
|
||||
const repoRoot = makeRepoRoot("openclaw-official-channel-catalog-write-");
|
||||
writeJson(path.join(repoRoot, "extensions", "whatsapp", "package.json"), {
|
||||
name: "@openclaw/whatsapp",
|
||||
openclaw: {
|
||||
channel: {
|
||||
id: "whatsapp",
|
||||
label: "WhatsApp",
|
||||
selectionLabel: "WhatsApp",
|
||||
docsPath: "/channels/whatsapp",
|
||||
blurb: "wa",
|
||||
},
|
||||
install: {
|
||||
npmSpec: "@openclaw/whatsapp",
|
||||
},
|
||||
release: {
|
||||
publishToNpm: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
writeOfficialChannelCatalog({ repoRoot });
|
||||
|
||||
const outputPath = path.join(repoRoot, OFFICIAL_CHANNEL_CATALOG_RELATIVE_PATH);
|
||||
expect(fs.existsSync(outputPath)).toBe(true);
|
||||
expect(JSON.parse(fs.readFileSync(outputPath, "utf8"))).toEqual({
|
||||
entries: [
|
||||
{
|
||||
name: "@openclaw/whatsapp",
|
||||
openclaw: {
|
||||
channel: {
|
||||
id: "whatsapp",
|
||||
label: "WhatsApp",
|
||||
selectionLabel: "WhatsApp",
|
||||
docsPath: "/channels/whatsapp",
|
||||
blurb: "wa",
|
||||
},
|
||||
install: {
|
||||
npmSpec: "@openclaw/whatsapp",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue