Avatar Customization + Update Agent Brain (#23)

Co-authored-by: iamlukethedev <iamlukethedev@users.noreply.github.com>
This commit is contained in:
Luke The Dev
2026-03-20 23:05:14 -05:00
committed by GitHub
parent a5b0895dd8
commit 65c2b9cf85
39 changed files with 2803 additions and 551 deletions
+27 -7
View File
@@ -47,18 +47,18 @@ describe("studio settings route", () => {
const response = await GET();
const body = (await response.json()) as {
settings?: { gateway?: { url?: string; token?: string } | null };
localGatewayDefaults?: { url?: string; token?: string } | null;
settings?: { gateway?: { url?: string; tokenConfigured?: boolean } | null };
localGatewayDefaults?: { url?: string; tokenConfigured?: boolean } | null;
};
expect(response.status).toBe(200);
expect(body.localGatewayDefaults).toEqual({
url: "ws://localhost:18791",
token: "local-token",
tokenConfigured: true,
});
expect(body.settings?.gateway).toEqual({
url: "ws://localhost:18791",
token: "local-token",
tokenConfigured: true,
});
});
@@ -82,6 +82,11 @@ describe("studio settings route", () => {
const patch = {
gateway: { url: "ws://example.test:1234", token: "t" },
office: {
"ws://example.test:1234": {
title: "Orbit Control",
},
},
};
const putResponse = await PUT({
@@ -91,16 +96,31 @@ describe("studio settings route", () => {
const getResponse = await GET();
const body = (await getResponse.json()) as {
settings?: { gateway?: { url?: string; token?: string } | null };
settings?: {
gateway?: { url?: string; tokenConfigured?: boolean } | null;
office?: Record<string, { title?: string }>;
};
};
expect(getResponse.status).toBe(200);
expect(body.settings?.gateway).toEqual({ url: "ws://example.test:1234", token: "t" });
expect(body.settings?.gateway).toEqual({
url: "ws://example.test:1234",
tokenConfigured: true,
});
expect(body.settings?.office?.["ws://example.test:1234"]).toEqual({
title: "Orbit Control",
});
const settingsPath = path.join(tempDir, "claw3d", "settings.json");
expect(fs.existsSync(settingsPath)).toBe(true);
const raw = fs.readFileSync(settingsPath, "utf8");
const parsed = JSON.parse(raw) as { gateway?: { url?: string; token?: string } | null };
const parsed = JSON.parse(raw) as {
gateway?: { url?: string; token?: string } | null;
office?: Record<string, { title?: string }>;
};
expect(parsed.gateway).toEqual({ url: "ws://example.test:1234", token: "t" });
expect(parsed.office?.["ws://example.test:1234"]).toEqual({
title: "Orbit Control",
});
});
});