fix: apply ESM __dirname shim to src/tools/compose-permissions.ts
Apra Fleet is an open-source MCP server
Brought to you by:
apralabs
Originally created by: kumaakh
Identified during review of PR [#166].
src/tools/compose-permissions.ts:63 uses bare __dirname outside a try/catch. In dev mode via tsx, this throws ReferenceError: __dirname is not defined if compose_permissions is invoked.
Fix: apply the same ESM shim added to install.ts in [#33]:
import { fileURLToPath } from 'url';
import { dirname } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Low priority — only affects dev mode. SEA binary is unaffected. Can be batched with next polish sprint.
Originally posted by: kumaakh
Fixed in main: The ESM __dirname shim was applied to src/tools/compose-permissions.ts in PR [#174] (commit 98b348f). The ileURLToPath/dirname shim mirrors the pattern from install.ts so indProfilesDir() works correctly under sx (ESM) without throwing ReferenceError: __dirname is not defined.
Related
Tickets:
#174Ticket changed by: kumaakh