mirror of
http://192.168.0.88:13333/lywsvip/openclaw-zero-token.git
synced 2026-05-21 02:16:13 +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
45 lines
1.6 KiB
TypeScript
45 lines
1.6 KiB
TypeScript
import { spawnSync } from "node:child_process";
|
|
import fs from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
import { withTempHome } from "./helpers/temp-home.ts";
|
|
|
|
describe("cli json stdout contract", () => {
|
|
it("keeps `update status --json` stdout parseable even with legacy doctor preflight inputs", async () => {
|
|
await withTempHome(
|
|
async (tempHome) => {
|
|
const legacyDir = path.join(tempHome, ".clawdbot");
|
|
await fs.mkdir(legacyDir, { recursive: true });
|
|
await fs.writeFile(path.join(legacyDir, "clawdbot.json"), "{}", "utf8");
|
|
|
|
const env = {
|
|
...process.env,
|
|
HOME: tempHome,
|
|
USERPROFILE: tempHome,
|
|
OPENCLAW_TEST_FAST: "1",
|
|
};
|
|
delete env.OPENCLAW_HOME;
|
|
delete env.OPENCLAW_STATE_DIR;
|
|
delete env.OPENCLAW_CONFIG_PATH;
|
|
delete env.VITEST;
|
|
|
|
const entry = path.resolve(process.cwd(), "openclaw.mjs");
|
|
const result = spawnSync(
|
|
process.execPath,
|
|
[entry, "update", "status", "--json", "--timeout", "1"],
|
|
{ cwd: process.cwd(), env, encoding: "utf8" },
|
|
);
|
|
|
|
expect(result.status).toBe(0);
|
|
const stdout = result.stdout.trim();
|
|
expect(stdout.length).toBeGreaterThan(0);
|
|
expect(() => JSON.parse(stdout)).not.toThrow();
|
|
expect(stdout).not.toContain("Doctor warnings");
|
|
expect(stdout).not.toContain("Doctor changes");
|
|
expect(stdout).not.toContain("Config invalid");
|
|
},
|
|
{ prefix: "openclaw-json-e2e-" },
|
|
);
|
|
});
|
|
});
|