refactor: rename clawdbot to moltbot with legacy compat

This commit is contained in:
Peter Steinberger
2026-01-27 12:19:58 +00:00
parent 83460df96f
commit 6d16a658e5
1839 changed files with 11250 additions and 11199 deletions

View File

@@ -15,12 +15,12 @@ describe("canvas host", () => {
const out = injectCanvasLiveReload("<html><body>Hello</body></html>");
expect(out).toContain(CANVAS_WS_PATH);
expect(out).toContain("location.reload");
expect(out).toContain("clawdbotCanvasA2UIAction");
expect(out).toContain("clawdbotSendUserAction");
expect(out).toContain("moltbotCanvasA2UIAction");
expect(out).toContain("moltbotSendUserAction");
});
it("creates a default index.html when missing", async () => {
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-canvas-"));
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-canvas-"));
const server = await startCanvasHost({
runtime: defaultRuntime,
@@ -35,7 +35,7 @@ describe("canvas host", () => {
const html = await res.text();
expect(res.status).toBe(200);
expect(html).toContain("Interactive test page");
expect(html).toContain("clawdbotSendUserAction");
expect(html).toContain("moltbotSendUserAction");
expect(html).toContain(CANVAS_WS_PATH);
} finally {
await server.close();
@@ -44,7 +44,7 @@ describe("canvas host", () => {
});
it("skips live reload injection when disabled", async () => {
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-canvas-"));
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-canvas-"));
await fs.writeFile(path.join(dir, "index.html"), "<html><body>no-reload</body></html>", "utf8");
const server = await startCanvasHost({
@@ -72,7 +72,7 @@ describe("canvas host", () => {
});
it("serves canvas content from the mounted base path", async () => {
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-canvas-"));
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-canvas-"));
await fs.writeFile(path.join(dir, "index.html"), "<html><body>v1</body></html>", "utf8");
const handler = await createCanvasHostHandler({
@@ -117,7 +117,7 @@ describe("canvas host", () => {
});
it("reuses a handler without closing it twice", async () => {
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-canvas-"));
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-canvas-"));
await fs.writeFile(path.join(dir, "index.html"), "<html><body>v1</body></html>", "utf8");
const handler = await createCanvasHostHandler({
@@ -150,7 +150,7 @@ describe("canvas host", () => {
});
it("serves HTML with injection and broadcasts reload on file changes", async () => {
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-canvas-"));
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-canvas-"));
const index = path.join(dir, "index.html");
await fs.writeFile(index, "<html><body>v1</body></html>", "utf8");
@@ -201,7 +201,7 @@ describe("canvas host", () => {
}, 20_000);
it("serves the gateway-hosted A2UI scaffold", async () => {
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-canvas-"));
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-canvas-"));
const server = await startCanvasHost({
runtime: defaultRuntime,
@@ -212,18 +212,18 @@ describe("canvas host", () => {
});
try {
const res = await fetch(`http://127.0.0.1:${server.port}/__clawdbot__/a2ui/`);
const res = await fetch(`http://127.0.0.1:${server.port}/__moltbot__/a2ui/`);
const html = await res.text();
expect(res.status).toBe(200);
expect(html).toContain("clawdbot-a2ui-host");
expect(html).toContain("clawdbotCanvasA2UIAction");
expect(html).toContain("moltbot-a2ui-host");
expect(html).toContain("moltbotCanvasA2UIAction");
const bundleRes = await fetch(
`http://127.0.0.1:${server.port}/__clawdbot__/a2ui/a2ui.bundle.js`,
`http://127.0.0.1:${server.port}/__moltbot__/a2ui/a2ui.bundle.js`,
);
const js = await bundleRes.text();
expect(bundleRes.status).toBe(200);
expect(js).toContain("clawdbotA2UI");
expect(js).toContain("moltbotA2UI");
} finally {
await server.close();
await fs.rm(dir, { recursive: true, force: true });