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,7 +1,7 @@
import fs from "node:fs/promises";
import path from "node:path";
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
import { createMoltbotTools } from "../agents/moltbot-tools.js";
import { createOpenClawTools } from "../agents/openclaw-tools.js";
import { resolveSessionTranscriptPath } from "../config/sessions.js";
import { emitAgentEvent } from "../infra/agent-events.js";
import {
@@ -19,25 +19,25 @@ let prevGatewayPort: string | undefined;
let prevGatewayToken: string | undefined;
beforeAll(async () => {
prevGatewayPort = process.env.CLAWDBOT_GATEWAY_PORT;
prevGatewayToken = process.env.CLAWDBOT_GATEWAY_TOKEN;
prevGatewayPort = process.env.OPENCLAW_GATEWAY_PORT;
prevGatewayToken = process.env.OPENCLAW_GATEWAY_TOKEN;
gatewayPort = await getFreePort();
process.env.CLAWDBOT_GATEWAY_PORT = String(gatewayPort);
process.env.CLAWDBOT_GATEWAY_TOKEN = "test-token";
process.env.OPENCLAW_GATEWAY_PORT = String(gatewayPort);
process.env.OPENCLAW_GATEWAY_TOKEN = "test-token";
server = await startGatewayServer(gatewayPort);
});
afterAll(async () => {
await server.close();
if (prevGatewayPort === undefined) {
delete process.env.CLAWDBOT_GATEWAY_PORT;
delete process.env.OPENCLAW_GATEWAY_PORT;
} else {
process.env.CLAWDBOT_GATEWAY_PORT = prevGatewayPort;
process.env.OPENCLAW_GATEWAY_PORT = prevGatewayPort;
}
if (prevGatewayToken === undefined) {
delete process.env.CLAWDBOT_GATEWAY_TOKEN;
delete process.env.OPENCLAW_GATEWAY_TOKEN;
} else {
process.env.CLAWDBOT_GATEWAY_TOKEN = prevGatewayToken;
process.env.OPENCLAW_GATEWAY_TOKEN = prevGatewayToken;
}
});
@@ -86,7 +86,7 @@ describe("sessions_send gateway loopback", () => {
});
});
const tool = createMoltbotTools().find((candidate) => candidate.name === "sessions_send");
const tool = createOpenClawTools().find((candidate) => candidate.name === "sessions_send");
if (!tool) throw new Error("missing sessions_send tool");
const result = await tool.execute("call-loopback", {
@@ -151,7 +151,7 @@ describe("sessions_send label lookup", () => {
timeoutMs: 5000,
});
const tool = createMoltbotTools().find((candidate) => candidate.name === "sessions_send");
const tool = createOpenClawTools().find((candidate) => candidate.name === "sessions_send");
if (!tool) throw new Error("missing sessions_send tool");
// Send using label instead of sessionKey
@@ -171,7 +171,7 @@ describe("sessions_send label lookup", () => {
});
it("returns error when label not found", { timeout: 60_000 }, async () => {
const tool = createMoltbotTools().find((candidate) => candidate.name === "sessions_send");
const tool = createOpenClawTools().find((candidate) => candidate.name === "sessions_send");
if (!tool) throw new Error("missing sessions_send tool");
const result = await tool.execute("call-missing-label", {
@@ -185,7 +185,7 @@ describe("sessions_send label lookup", () => {
});
it("returns error when neither sessionKey nor label provided", { timeout: 60_000 }, async () => {
const tool = createMoltbotTools().find((candidate) => candidate.name === "sessions_send");
const tool = createOpenClawTools().find((candidate) => candidate.name === "sessions_send");
if (!tool) throw new Error("missing sessions_send tool");
const result = await tool.execute("call-no-key", {