refactor: rename to openclaw

This commit is contained in:
Peter Steinberger
2026-01-30 03:15:10 +01:00
parent 4583f88626
commit 9a7160786a
2357 changed files with 16688 additions and 16788 deletions

View File

@@ -1,4 +1,4 @@
import type { MoltbotConfig } from "../config/config.js";
import type { OpenClawConfig } from "../config/config.js";
import { describe, expect, it, vi } from "vitest";
@@ -8,7 +8,7 @@ describe("noteMacLaunchctlGatewayEnvOverrides", () => {
it("prints clear unsetenv instructions for token override", async () => {
const noteFn = vi.fn();
const getenv = vi.fn(async (name: string) =>
name === "CLAWDBOT_GATEWAY_TOKEN" ? "launchctl-token" : undefined,
name === "OPENCLAW_GATEWAY_TOKEN" ? "launchctl-token" : undefined,
);
const cfg = {
gateway: {
@@ -16,25 +16,25 @@ describe("noteMacLaunchctlGatewayEnvOverrides", () => {
token: "config-token",
},
},
} as MoltbotConfig;
} as OpenClawConfig;
await noteMacLaunchctlGatewayEnvOverrides(cfg, { platform: "darwin", getenv, noteFn });
expect(noteFn).toHaveBeenCalledTimes(1);
expect(getenv).toHaveBeenCalledTimes(2);
expect(getenv).toHaveBeenCalledTimes(6);
const [message, title] = noteFn.mock.calls[0] ?? [];
expect(title).toBe("Gateway (macOS)");
expect(message).toContain("launchctl environment overrides detected");
expect(message).toContain("CLAWDBOT_GATEWAY_TOKEN");
expect(message).toContain("launchctl unsetenv CLAWDBOT_GATEWAY_TOKEN");
expect(message).not.toContain("CLAWDBOT_GATEWAY_PASSWORD");
expect(message).toContain("OPENCLAW_GATEWAY_TOKEN");
expect(message).toContain("launchctl unsetenv OPENCLAW_GATEWAY_TOKEN");
expect(message).not.toContain("OPENCLAW_GATEWAY_PASSWORD");
});
it("does nothing when config has no gateway credentials", async () => {
const noteFn = vi.fn();
const getenv = vi.fn(async () => "launchctl-token");
const cfg = {} as MoltbotConfig;
const cfg = {} as OpenClawConfig;
await noteMacLaunchctlGatewayEnvOverrides(cfg, { platform: "darwin", getenv, noteFn });
@@ -51,7 +51,7 @@ describe("noteMacLaunchctlGatewayEnvOverrides", () => {
token: "config-token",
},
},
} as MoltbotConfig;
} as OpenClawConfig;
await noteMacLaunchctlGatewayEnvOverrides(cfg, { platform: "linux", getenv, noteFn });