The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { describe, expect, it } from "vitest";
import { googleSheetsRobotEmailFromEnv } from "../services/tool-access.js";
describe("Google Sheets app gallery availability", () => {
it("reads the robot email from inline service-account JSON", () => {
expect(googleSheetsRobotEmailFromEnv({
GOOGLE_SHEETS_SERVICE_ACCOUNT_JSON: JSON.stringify({
client_email: "[email protected]",
private_key: "secret",
}),
})).toEqual({
available: true,
robotEmail: "[email protected]",
});
});
it("reads the robot email from a service-account JSON file path", () => {
const dir = mkdtempSync(join(tmpdir(), "paperclip-sheets-"));
try {
const path = join(dir, "service-account.json");
writeFileSync(path, JSON.stringify({ client_email: "[email protected]" }));
expect(googleSheetsRobotEmailFromEnv({
GOOGLE_SHEETS_SERVICE_ACCOUNT_JSON_PATH: path,
})).toEqual({
available: true,
robotEmail: "[email protected]",
});
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
it("fails closed when no robot email is configured", () => {
expect(googleSheetsRobotEmailFromEnv({})).toMatchObject({
available: false,
reason: "Google Sheets is not available on this instance yet.",
});
});
});