From 153c298a46453b21fb4e41250e52fac2d290e05f Mon Sep 17 00:00:00 2001 From: Dhruv Sharma Date: Tue, 31 Mar 2026 13:45:54 +0530 Subject: [PATCH] fix: resolve plugin-registry.json from package root createRequire resolves relative to the compiled dist/lib/ directory where the JSON file doesn't exist. Use readFileSync with a path resolved from the package root (../../src/assets/) which works from both src/lib/ and dist/lib/. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/cli/src/lib/plugin-marketplace.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/lib/plugin-marketplace.ts b/packages/cli/src/lib/plugin-marketplace.ts index 8f059bc33..0cd226ab0 100644 --- a/packages/cli/src/lib/plugin-marketplace.ts +++ b/packages/cli/src/lib/plugin-marketplace.ts @@ -1,12 +1,14 @@ import { existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs"; -import { createRequire } from "node:module"; import { homedir } from "node:os"; import { dirname, isAbsolute, join, resolve } from "node:path"; -import { pathToFileURL } from "node:url"; +import { fileURLToPath, pathToFileURL } from "node:url"; import type { InstalledPluginConfig, PluginModule, PluginSlot } from "@composio/ao-core"; -const require = createRequire(import.meta.url); -const registryData = require("../assets/plugin-registry.json") as unknown[]; +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +// Resolve registry from package root (works from both src/lib/ and dist/lib/) +const registryPath = resolve(__dirname, "../../src/assets/plugin-registry.json"); +const registryData = JSON.parse(readFileSync(registryPath, "utf-8")) as unknown[]; export interface MarketplacePluginEntry { id: string;