mirror of
http://192.168.0.88:13333/lywsvip/openclaw-zero-token.git
synced 2026-06-03 07:30:36 +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
57 lines
1.8 KiB
TypeScript
57 lines
1.8 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import type { OpenClawConfig } from "../config/config.js";
|
|
import {
|
|
applyLocalSetupWorkspaceConfig,
|
|
ONBOARDING_DEFAULT_DM_SCOPE,
|
|
ONBOARDING_DEFAULT_TOOLS_PROFILE,
|
|
} from "./onboard-config.js";
|
|
|
|
describe("applyLocalSetupWorkspaceConfig", () => {
|
|
it("defaults local setup tool profile to coding", () => {
|
|
expect(ONBOARDING_DEFAULT_TOOLS_PROFILE).toBe("coding");
|
|
});
|
|
|
|
it("sets secure dmScope default when unset", () => {
|
|
const baseConfig: OpenClawConfig = {};
|
|
const result = applyLocalSetupWorkspaceConfig(baseConfig, "/tmp/workspace");
|
|
|
|
expect(result.session?.dmScope).toBe(ONBOARDING_DEFAULT_DM_SCOPE);
|
|
expect(result.gateway?.mode).toBe("local");
|
|
expect(result.agents?.defaults?.workspace).toBe("/tmp/workspace");
|
|
expect(result.tools?.profile).toBe(ONBOARDING_DEFAULT_TOOLS_PROFILE);
|
|
});
|
|
|
|
it("preserves existing dmScope when already configured", () => {
|
|
const baseConfig: OpenClawConfig = {
|
|
session: {
|
|
dmScope: "main",
|
|
},
|
|
};
|
|
const result = applyLocalSetupWorkspaceConfig(baseConfig, "/tmp/workspace");
|
|
|
|
expect(result.session?.dmScope).toBe("main");
|
|
});
|
|
|
|
it("preserves explicit non-main dmScope values", () => {
|
|
const baseConfig: OpenClawConfig = {
|
|
session: {
|
|
dmScope: "per-account-channel-peer",
|
|
},
|
|
};
|
|
const result = applyLocalSetupWorkspaceConfig(baseConfig, "/tmp/workspace");
|
|
|
|
expect(result.session?.dmScope).toBe("per-account-channel-peer");
|
|
});
|
|
|
|
it("preserves an explicit tools.profile when already configured", () => {
|
|
const baseConfig: OpenClawConfig = {
|
|
tools: {
|
|
profile: "full",
|
|
},
|
|
};
|
|
const result = applyLocalSetupWorkspaceConfig(baseConfig, "/tmp/workspace");
|
|
|
|
expect(result.tools?.profile).toBe("full");
|
|
});
|
|
});
|