Skip to content

Open-source AI coworkers that each get a computer of their own: a browser, files and tools, with every action decided before it happens and recorded after. Bring any AG-UI agent.

Read the example package by a path the host accepts, not a URL pathname (#394)

kevin1a021ee1b7c3
diff --git a/app/tests/skill-creator-slug.test.ts b/app/tests/skill-creator-slug.test.ts
index a67460f5..fa4f790b 100644
--- a/app/tests/skill-creator-slug.test.ts
+++ b/app/tests/skill-creator-slug.test.ts
@@ -1,5 +1,6 @@
import { describe, expect, test } from "bun:test";
import { readFileSync } from "node:fs";
+import { fileURLToPath } from "node:url";
import { parse } from "yaml";
import { SKILL_CREATOR_SLUG } from "@/lib/skills/proposal";
@@ -15,7 +16,9 @@ import { SKILL_CREATOR_SLUG } from "@/lib/skills/proposal";
* Read from the file rather than from a fixture, because the file is what ships.
*/
-const packageDir = new URL("../../examples/fintech", import.meta.url).pathname;
+const packageDir = fileURLToPath(
+ new URL("../../examples/fintech", import.meta.url),
+);
const shipped = parse(readFileSync(`${packageDir}/skills.yaml`, "utf8")) as {
skills: { slug: string; title: string; instructions: string }[];
diff --git a/server/tests/tenant-package.test.ts b/server/tests/tenant-package.test.ts
index d0ab517f..819eb555 100644
--- a/server/tests/tenant-package.test.ts
+++ b/server/tests/tenant-package.test.ts
@@ -1,5 +1,6 @@
import { afterAll, afterEach, describe, expect, test } from "bun:test";
import { randomUUID } from "node:crypto";
+import { fileURLToPath } from "node:url";
import { and, eq } from "drizzle-orm";
import { createDatabase } from "../src/db/client";
import {
@@ -288,7 +289,7 @@ describe("tenant YAML validation", () => {
test("loads the mounted fintech package without a theme file", async () => {
const tenantPackage = await loadTenantPackage(
- new URL("../../examples/fintech", import.meta.url).pathname,
+ fileURLToPath(new URL("../../examples/fintech", import.meta.url)),
);
expect(tenantPackage.tenantId).toBe("openbot");