mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 18:58:26 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { describe, expect, test } from "vitest";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import type { SessionEntry } from "../config/sessions.js";
|
||||
import {
|
||||
capArrayByJsonBytes,
|
||||
@@ -46,7 +46,7 @@ describe("gateway session utils", () => {
|
||||
const cfg = {
|
||||
session: { mainKey: "work" },
|
||||
agents: { list: [{ id: "ops", default: true }] },
|
||||
} as MoltbotConfig;
|
||||
} as OpenClawConfig;
|
||||
expect(resolveSessionStoreKey({ cfg, sessionKey: "main" })).toBe("agent:ops:work");
|
||||
expect(resolveSessionStoreKey({ cfg, sessionKey: "work" })).toBe("agent:ops:work");
|
||||
expect(resolveSessionStoreKey({ cfg, sessionKey: "agent:ops:main" })).toBe("agent:ops:work");
|
||||
@@ -56,7 +56,7 @@ describe("gateway session utils", () => {
|
||||
const cfg = {
|
||||
session: { mainKey: "main" },
|
||||
agents: { list: [{ id: "ops", default: true }] },
|
||||
} as MoltbotConfig;
|
||||
} as OpenClawConfig;
|
||||
expect(resolveSessionStoreKey({ cfg, sessionKey: "discord:group:123" })).toBe(
|
||||
"agent:ops:discord:group:123",
|
||||
);
|
||||
@@ -69,7 +69,7 @@ describe("gateway session utils", () => {
|
||||
const cfg = {
|
||||
session: { scope: "global", mainKey: "work" },
|
||||
agents: { list: [{ id: "ops", default: true }] },
|
||||
} as MoltbotConfig;
|
||||
} as OpenClawConfig;
|
||||
expect(resolveSessionStoreKey({ cfg, sessionKey: "main" })).toBe("global");
|
||||
const target = resolveGatewaySessionStoreTarget({ cfg, key: "main" });
|
||||
expect(target.canonicalKey).toBe("global");
|
||||
@@ -79,14 +79,14 @@ describe("gateway session utils", () => {
|
||||
test("resolveGatewaySessionStoreTarget uses canonical key for main alias", () => {
|
||||
const storeTemplate = path.join(
|
||||
os.tmpdir(),
|
||||
"moltbot-session-utils",
|
||||
"openclaw-session-utils",
|
||||
"{agentId}",
|
||||
"sessions.json",
|
||||
);
|
||||
const cfg = {
|
||||
session: { mainKey: "main", store: storeTemplate },
|
||||
agents: { list: [{ id: "ops", default: true }] },
|
||||
} as MoltbotConfig;
|
||||
} as OpenClawConfig;
|
||||
const target = resolveGatewaySessionStoreTarget({ cfg, key: "main" });
|
||||
expect(target.canonicalKey).toBe("agent:ops:main");
|
||||
expect(target.storeKeys).toEqual(expect.arrayContaining(["agent:ops:main", "main"]));
|
||||
@@ -193,7 +193,7 @@ describe("listSessionsFromStore search", () => {
|
||||
const baseCfg = {
|
||||
session: { mainKey: "main" },
|
||||
agents: { list: [{ id: "main", default: true }] },
|
||||
} as MoltbotConfig;
|
||||
} as OpenClawConfig;
|
||||
|
||||
const makeStore = (): Record<string, SessionEntry> => ({
|
||||
"agent:main:work-project": {
|
||||
|
||||
Reference in New Issue
Block a user