Dashboard › opencode › Distillation
0625c6fe-f1e1-44f3-83eb-196868e2a632["lore_tm_v1_gMqjgbDOt-Dg5luhgI-yEA_NEvJ4YJ79-tOmaBu8nIs"]
__filename is always defined in CJS bundles and Node.js CJS. In /home/byk/Code/opencode-lore-v2/packages/gateway/src/index.ts lines 52–69, direct-execution detection first checks typeof __filename === "string" and compares process.argv[1] === __filename; otherwise the ESM path compares process.argv[1] === fileURLToPath(import.meta.url), returning false on error./home/byk/Code/opencode-lore-v2/packages/gateway/src/index.ts lines 54–59 documents script/bundle.ts rewriting import.meta.url to an injected import_meta_url shim from packages/gateway/script/import-meta-url.js; the import.meta.url branch is unreachable at CJS runtime because __filename is always defined there, while the shim preserves natural source and suppresses esbuild’s empty-import-meta warning./home/byk/Code/opencode-lore-v2/packages/gateway/src/index.ts exports loadConfig, DEFAULT_PORTS, DEFAULT_PORT, GatewayConfig, startServer, handleRequest, resetPipelineState, readPortFile, readGatewayProcessFile, startGateway, probeGateway, probeGatewayProcess, probeGatewayProcessHost, probeUrlFor, GatewayHandle, StartOptions, Stricli-driven runCli, and legacy _cli.