Dashboard › opencode › Distillation
afbe4d75-460f-4a4b-8817-39032b26860a["lore_tm_v1_HkDvH4ekciL2zKz_myCMubaTZZUgT7X_utoJyKhndGw","lore_tm_v1_wg3aelIVaPL6-aivlbr94JDVvNO434uORTjfrIhPrVM"]
/home/byk/Code/opencode-lore/packages/gateway/src/index.ts imports ../instrument and fileURLToPath from node:url./home/byk/Code/opencode-lore/packages/gateway/src/index.ts exports loadConfig, DEFAULT_PORTS, DEFAULT_PORT, GatewayConfig, startServer, handleRequest, resetPipelineState, readPortFile, readGatewayProcessFile, startGateway, probeGateway, probeGatewayProcess, probeGatewayProcessHost, probeUrlFor, GatewayHandle, and StartOptions.runCli from ./cli/cli and legacy _cli from ./cli/main; runCli handles help, version, whoami, logs, stop, log, and diff, while falling back to _cli() for commands not yet migrated.__filename is always defined in CJS bundles and Node.js CJS.isMainModule in a try/catch: when typeof __filename === "string", it compares process.argv[1] === __filename; otherwise, for ESM under Bun or tsx, it compares process.argv[1] === fileURLToPath(import.meta.url); errors produce false.packages/gateway/script/bundle.ts rewrites import.meta.url to an injected import_meta_url shim from packages/gateway/script/import-meta-url.js; the CJS import.meta.url branch is unreachable because __filename is always defined there, but the shim avoids esbuild’s empty-import-meta warning./home/byk/Code/opencode-lore/packages/gateway/src/index.ts is the main module, it dynamically imports commandStart from ./cli/start and invokes commandStart({ quiet: true }); direct execution defaults to start, not run, because embedded server launch has no TTY and should not auto-detect or auto-launch agents./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/aisdk.ts imports LanguageModelV3 from @ai-sdk/provider, Model from @opencode/schema/model, and ModelHooks from ./registration.js.AISDKHooks in /home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/aisdk.ts has sdk and language hook payloads. sdk contains readonly model: Model.Info, readonly package: string, readonly options: Record<string, any>, and optional mutable sdk?: any; language contains readonly model: Model.Info, readonly sdk: any, readonly options: Record<string, any>, and optional mutable language?: LanguageModelV3.AISDKDomain in /home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/aisdk.ts exposes readonly hook: ModelHooks<AISDKHooks>.