chore: purge warelay references

This commit is contained in:
Peter Steinberger
2025-12-07 03:36:46 +00:00
parent 21dfbd0103
commit 6c3d3b98b8
26 changed files with 83 additions and 93 deletions

View File

@@ -355,7 +355,7 @@ describe("runCommandReply (pi)", () => {
});
it("parses MEDIA tokens and respects mediaMaxMb for local files", async () => {
const tmp = path.join(os.tmpdir(), `warelay-test-${Date.now()}.bin`);
const tmp = path.join(os.tmpdir(), `clawdis-test-${Date.now()}.bin`);
const bigBuffer = Buffer.alloc(2 * 1024 * 1024, 1);
await fs.writeFile(tmp, bigBuffer);

View File

@@ -26,7 +26,7 @@ describe("transcribeInboundAudio", () => {
it("downloads mediaUrl to temp file and returns transcript", async () => {
const tmpBuf = Buffer.from("audio-bytes");
const tmpFile = path.join(os.tmpdir(), `warelay-audio-${Date.now()}.ogg`);
const tmpFile = path.join(os.tmpdir(), `clawdis-audio-${Date.now()}.ogg`);
await fs.writeFile(tmpFile, tmpBuf);
const fetchMock = vi.fn(async () => ({

View File

@@ -30,7 +30,7 @@ const configSpy = vi.spyOn(configModule, "loadConfig");
function makeStorePath() {
return path.join(
os.tmpdir(),
`warelay-agent-test-${Date.now()}-${Math.random()}.json`,
`clawdis-agent-test-${Date.now()}-${Math.random()}.json`,
);
}

View File

@@ -5,7 +5,7 @@ import { PassThrough } from "node:stream";
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
const realOs = await vi.importActual<typeof import("node:os")>("node:os");
const HOME = path.join(realOs.tmpdir(), "warelay-home-redirect");
const HOME = path.join(realOs.tmpdir(), "clawdis-home-redirect");
const mockRequest = vi.fn();
vi.doMock("node:os", () => ({

View File

@@ -4,7 +4,7 @@ import sharp from "sharp";
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
const realOs = await vi.importActual<typeof import("node:os")>("node:os");
const HOME = path.join(realOs.tmpdir(), "warelay-home-test");
const HOME = path.join(realOs.tmpdir(), "clawdis-home-test");
vi.mock("node:os", () => ({
default: { homedir: () => HOME, tmpdir: () => realOs.tmpdir() },
@@ -25,7 +25,7 @@ describe("media store", () => {
it("creates and returns media directory", async () => {
const dir = await store.ensureMediaDir();
expect(dir).toContain("warelay-home-test");
expect(dir).toContain("clawdis-home-test");
const stat = await fs.stat(dir);
expect(stat.isDirectory()).toBe(true);
});

View File

@@ -37,7 +37,7 @@ describe("withWhatsAppPrefix", () => {
describe("ensureDir", () => {
it("creates nested directory", async () => {
const tmp = await fs.promises.mkdtemp(
path.join(os.tmpdir(), "warelay-test-"),
path.join(os.tmpdir(), "clawdis-test-"),
);
const target = path.join(tmp, "nested", "dir");
await ensureDir(target);

View File

@@ -71,5 +71,5 @@ export function sleep(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
// Fixed configuration root; legacy ~/.warelay is no longer used.
// Fixed configuration root; legacy ~/.clawdis is no longer used.
export const CONFIG_DIR = path.join(os.homedir(), ".clawdis");

View File

@@ -28,7 +28,7 @@ import {
const makeSessionStore = async (
entries: Record<string, unknown> = {},
): Promise<{ storePath: string; cleanup: () => Promise<void> }> => {
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "warelay-session-"));
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdis-session-"));
const storePath = path.join(dir, "sessions.json");
await fs.writeFile(storePath, JSON.stringify(entries));
return {
@@ -229,7 +229,7 @@ describe("runWebHeartbeatOnce", () => {
it("does not refresh updatedAt when heartbeat is skipped", async () => {
const tmpDir = await fs.mkdtemp(
path.join(os.tmpdir(), "warelay-heartbeat-"),
path.join(os.tmpdir(), "clawdis-heartbeat-"),
);
const storePath = path.join(tmpDir, "sessions.json");
const now = Date.now();
@@ -269,7 +269,7 @@ describe("runWebHeartbeatOnce", () => {
it("heartbeat reuses existing session id when last inbound is present", async () => {
const tmpDir = await fs.mkdtemp(
path.join(os.tmpdir(), "warelay-heartbeat-session-"),
path.join(os.tmpdir(), "clawdis-heartbeat-session-"),
);
const storePath = path.join(tmpDir, "sessions.json");
const sessionId = "sess-keep";
@@ -319,7 +319,7 @@ describe("runWebHeartbeatOnce", () => {
it("heartbeat honors session-id override and seeds store", async () => {
const tmpDir = await fs.mkdtemp(
path.join(os.tmpdir(), "warelay-heartbeat-override-"),
path.join(os.tmpdir(), "clawdis-heartbeat-override-"),
);
const storePath = path.join(tmpDir, "sessions.json");
await fs.writeFile(storePath, JSON.stringify({}));
@@ -527,7 +527,7 @@ describe("web auto-reply", () => {
it("skips reply heartbeat when requests are running", async () => {
const tmpDir = await fs.mkdtemp(
path.join(os.tmpdir(), "warelay-heartbeat-queue-"),
path.join(os.tmpdir(), "clawdis-heartbeat-queue-"),
);
const storePath = path.join(tmpDir, "sessions.json");
await fs.writeFile(storePath, JSON.stringify({}));
@@ -1126,7 +1126,7 @@ describe("web auto-reply", () => {
it("emits heartbeat logs with connection metadata", async () => {
vi.useFakeTimers();
const logPath = `/tmp/warelay-heartbeat-${crypto.randomUUID()}.log`;
const logPath = `/tmp/clawdis-heartbeat-${crypto.randomUUID()}.log`;
setLoggerOverride({ level: "trace", file: logPath });
const runtime = {
@@ -1168,7 +1168,7 @@ describe("web auto-reply", () => {
});
it("logs outbound replies to file", async () => {
const logPath = `/tmp/warelay-log-test-${crypto.randomUUID()}.log`;
const logPath = `/tmp/clawdis-log-test-${crypto.randomUUID()}.log`;
setLoggerOverride({ level: "trace", file: logPath });
let capturedOnMessage:
@@ -1362,7 +1362,7 @@ describe("web auto-reply", () => {
sendMedia: vi.fn(),
});
// HEARTBEAT_OK should NOT have prefix - warelay needs exact match
// HEARTBEAT_OK should NOT have prefix - clawdis needs exact match
expect(reply).toHaveBeenCalledWith(HEARTBEAT_TOKEN);
resetLoadConfigMock();
});

View File

@@ -18,7 +18,7 @@ vi.mock("../config/config.js", () => ({
const HOME = path.join(
os.tmpdir(),
`warelay-inbound-media-${crypto.randomUUID()}`,
`clawdis-inbound-media-${crypto.randomUUID()}`,
);
process.env.HOME = HOME;

View File

@@ -27,7 +27,7 @@ describe("web media loading", () => {
.jpeg({ quality: 95 })
.toBuffer();
const file = path.join(os.tmpdir(), `warelay-media-${Date.now()}.jpg`);
const file = path.join(os.tmpdir(), `clawdis-media-${Date.now()}.jpg`);
tmpFiles.push(file);
await fs.writeFile(file, buffer);
@@ -45,7 +45,7 @@ describe("web media loading", () => {
})
.png()
.toBuffer();
const wrongExt = path.join(os.tmpdir(), `warelay-media-${Date.now()}.bin`);
const wrongExt = path.join(os.tmpdir(), `clawdis-media-${Date.now()}.bin`);
tmpFiles.push(wrongExt);
await fs.writeFile(wrongExt, pngBuffer);

View File

@@ -169,7 +169,7 @@ describe("web monitor inbox", () => {
it("logs inbound bodies to file", async () => {
const logPath = path.join(
os.tmpdir(),
`warelay-log-test-${crypto.randomUUID()}.log`,
`clawdis-log-test-${crypto.randomUUID()}.log`,
);
setLoggerOverride({ level: "trace", file: logPath });