mirror of
http://192.168.0.88:13333/lywsvip/openclaw-zero-token.git
synced 2026-05-19 08:48:01 +08:00
Major upgrade from e26988a38 to upstream v2026.3.28 (f9b107928).
Key changes:
- Upstream src/, ui/, extensions/ (89 bundled extensions)
- Zero-token web providers preserved in src/zero-token/
- AskOnce plugin restored and registered as CLI command
- Added missing packages: @anthropic-ai/vertex-sdk, @modelcontextprotocol/sdk
- Fixed tsconfig rootDir, skipLibCheck for plugin-sdk DTS build
- Added askonce to bundled plugin metadata and package.json exports
- Fixed AskOnce CLI command registration (missing commands metadata)
- Restored AskOnce adapter imports (correct 5-level relative paths)
- Removed stale migration artifacts from root directory
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import { readdirSync, readFileSync } from "node:fs";
|
|
import { dirname, resolve } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const ROOT_DIR = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
const REPO_ROOT = resolve(ROOT_DIR, "..");
|
|
const EXTENSIONS_DIR = resolve(REPO_ROOT, "extensions");
|
|
const CORE_PLUGIN_ENTRY_IMPORT_RE =
|
|
/import\s*\{[^}]*\bdefinePluginEntry\b[^}]*\}\s*from\s*"openclaw\/plugin-sdk\/core"/;
|
|
|
|
describe("plugin entry guardrails", () => {
|
|
it("keeps bundled extension entry modules off direct definePluginEntry imports from core", () => {
|
|
const failures: string[] = [];
|
|
|
|
for (const entry of readdirSync(EXTENSIONS_DIR, { withFileTypes: true })) {
|
|
if (!entry.isDirectory()) {
|
|
continue;
|
|
}
|
|
const indexPath = resolve(EXTENSIONS_DIR, entry.name, "index.ts");
|
|
try {
|
|
const source = readFileSync(indexPath, "utf8");
|
|
if (CORE_PLUGIN_ENTRY_IMPORT_RE.test(source)) {
|
|
failures.push(`extensions/${entry.name}/index.ts`);
|
|
}
|
|
} catch {
|
|
// Skip extensions without index.ts entry modules.
|
|
}
|
|
}
|
|
|
|
expect(failures).toEqual([]);
|
|
});
|
|
});
|