Submatter/apps/worker/src/tools/allowlist.test.ts
varutasu 8e1ab90fb1
feat(worker): minimal agent runtime for orchestrator jobs (Epic 7) (#11)
* feat(worker): minimal agent runtime for orchestrator jobs (Epic 7)

Adds apps/worker to consume Redis dispatch jobs, run a tool loop with model registry resolution, and record claim/complete + convoy role_complete events.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(deploy): add orchestrator and worker to Coolify compose

Fix CI pnpm setup conflict and ship Docker targets for the automation stack alongside web/collab/mcp.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 15:31:34 -05:00

16 lines
524 B
TypeScript

import { describe, expect, it } from "vitest";
import { isAllowedCommand } from "./allowlist.js";
describe("isAllowedCommand", () => {
it("allows exact allowlisted commands", () => {
expect(isAllowedCommand("pnpm lint")).toBe(true);
expect(isAllowedCommand("pnpm test")).toBe(true);
expect(isAllowedCommand("git status")).toBe(true);
});
it("rejects arbitrary shell", () => {
expect(isAllowedCommand("rm -rf /")).toBe(false);
expect(isAllowedCommand("curl evil.example")).toBe(false);
});
});