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

@@ -10,7 +10,7 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { resolveTwitchToken, type TwitchTokenSource } from "./token.js";
import type { MoltbotConfig } from "clawdbot/plugin-sdk";
import type { OpenClawConfig } from "openclaw/plugin-sdk";
describe("token", () => {
// Multi-account config for testing non-default accounts
@@ -29,7 +29,7 @@ describe("token", () => {
},
},
},
} as unknown as MoltbotConfig;
} as unknown as OpenClawConfig;
// Simplified single-account config
const mockSimplifiedConfig = {
@@ -39,7 +39,7 @@ describe("token", () => {
accessToken: "oauth:config-token",
},
},
} as unknown as MoltbotConfig;
} as unknown as OpenClawConfig;
beforeEach(() => {
vi.clearAllMocks();
@@ -47,7 +47,7 @@ describe("token", () => {
afterEach(() => {
vi.restoreAllMocks();
delete process.env.CLAWDBOT_TWITCH_ACCESS_TOKEN;
delete process.env.OPENCLAW_TWITCH_ACCESS_TOKEN;
});
describe("resolveTwitchToken", () => {
@@ -66,7 +66,7 @@ describe("token", () => {
});
it("should prioritize config token over env var (simplified config)", () => {
process.env.CLAWDBOT_TWITCH_ACCESS_TOKEN = "oauth:env-token";
process.env.OPENCLAW_TWITCH_ACCESS_TOKEN = "oauth:env-token";
const result = resolveTwitchToken(mockSimplifiedConfig, { accountId: "default" });
@@ -76,7 +76,7 @@ describe("token", () => {
});
it("should use env var when config token is empty (simplified config)", () => {
process.env.CLAWDBOT_TWITCH_ACCESS_TOKEN = "oauth:env-token";
process.env.OPENCLAW_TWITCH_ACCESS_TOKEN = "oauth:env-token";
const configWithEmptyToken = {
channels: {
@@ -85,7 +85,7 @@ describe("token", () => {
accessToken: "",
},
},
} as unknown as MoltbotConfig;
} as unknown as OpenClawConfig;
const result = resolveTwitchToken(configWithEmptyToken, { accountId: "default" });
@@ -101,7 +101,7 @@ describe("token", () => {
accessToken: "",
},
},
} as unknown as MoltbotConfig;
} as unknown as OpenClawConfig;
const result = resolveTwitchToken(configWithoutToken, { accountId: "default" });
@@ -110,7 +110,7 @@ describe("token", () => {
});
it("should not use env var for non-default accounts (multi-account)", () => {
process.env.CLAWDBOT_TWITCH_ACCESS_TOKEN = "oauth:env-token";
process.env.OPENCLAW_TWITCH_ACCESS_TOKEN = "oauth:env-token";
const configWithoutToken = {
channels: {
@@ -123,7 +123,7 @@ describe("token", () => {
},
},
},
} as unknown as MoltbotConfig;
} as unknown as OpenClawConfig;
const result = resolveTwitchToken(configWithoutToken, { accountId: "secondary" });
@@ -139,7 +139,7 @@ describe("token", () => {
accounts: {},
},
},
} as unknown as MoltbotConfig;
} as unknown as OpenClawConfig;
const result = resolveTwitchToken(configWithoutAccount, { accountId: "nonexistent" });
@@ -150,7 +150,7 @@ describe("token", () => {
it("should handle missing Twitch config section", () => {
const configWithoutSection = {
channels: {},
} as unknown as MoltbotConfig;
} as unknown as OpenClawConfig;
const result = resolveTwitchToken(configWithoutSection, { accountId: "default" });