Dashboard › opencode › Distillation
a04e1eb6-a4fc-4bce-8169-88538aeb8bbc["lore_tm_v1_FeZHGanL62z8VGK3ySFb2R9pA5WgdAubLOIjG9xdNyo","lore_tm_v1_qoehYE1e1V6B0OIy3w0HBkzcBHNU-j09CLst0Ttn8kY","lore_tm_v1_0fsKvUoXNk1LSREgsYhGTgzvO4SPgZk5-S2a0vzkS-Y","lore_tm_v1_uLCWV6-X6c7kXanfJqW8stVA26m3eZXOdhhVvgKX-mI","lore_tm_v1_AlBGHl-Rc638tB_rjlFzS_7jl_FJDQFXvBWcu14tJXM","lore_tm_v1_6-lSNQoKLuPEyYlLlJfsQEaUAXcPA2poNURlDSGJdOM","lore_tm_v1_3lbOuDLdCEoIylD8ISKNOKmpcoIejj6smb7_Nb58GzU","lore_tm_v1_-KOcd4fjbQWAcEtPJbHiM9mxlngwN8X1mmK1JX1l20Q","lore_tm_v1_p5eL5unxP2zH8wdIqnrVfy9ak4uyJNB-l0ZmW9F5aUs","lore_tm_v1_R85sSvLkySZxAT9tjQ-cNzQuZ71kqwxovIBNpUbmTwo","lore_tm_v1_gAq1jJh0dbzj9SJIm7D_bsXnr2tcwwGRdlVr_NMvmPs","lore_tm_v1_a3vfVt-XAqUByhsPZBkAd9SQIH6_p2_pzL1ekhZylHI","lore_tm_v1_JEOr-eO4VklQWlAS9oqjg7xIjFOkK1v1BoHl_xaUDiY","lore_tm_v1_4U38eW_MMFHb6ua5Q7b0S5HVulVMjUurC2nFALEW9r4","lore_tm_v1_UjjLGVmACydvPUO33hehlyxP6EYIWQRke8ryedzXKoY"]
Date: September 9, 2026
log (file + sink, with stderr only when not silenced), making them visible via lore logs.x-lore-git-remote only from the git remote paired with the current project path, never from a different project’s earlier plugin call./home/byk/Code/opencode-lore/packages/opencode/src/index.ts, LORE_UPSTREAM_EXTRA_HEADERS is parsed line-by-line using the first : separator; blank or malformed lines are skipped, names/values are trimmed, and shouldForwardUpstreamExtraHeader(name) prevents clobbering gateway-managed headers.getHeaders() adds gatewayAccessHeadersForRemote(gatewayBase), x-lore-project from currentProject.path, and the path-paired x-lore-git-remote; startup logs include routing through ${gatewayBase} and dashboard: ${gatewayBase}/ui.log.error("init failed: ...") before rethrowing, because the host plugin loader may catch and swallow the exception; the error remains available through the file/Sentry sink and lore logs./home/byk/Code/opencode-lore/packages/opencode/src/index.ts must export only LorePlugin and its same-reference default export. Helpers belong in ./internal.ts; OpenCode’s legacy loader invokes every function export as a plugin and rejects non-function exports. The invariant is guarded by the "plugin entry module export shape" test in test/index.test.ts.const.recall result and continue within the same turn rather than ending on the recall invocation.oxfmt format checks, and run oxlint; surface exact failure/warning counts, diagnose hangs or failures rather than merely retrying, inspect diffs, and report commit hashes. Bundle debug-ID injection and absent SENTRY_AUTH_TOKEN are expected conditions./home/byk/Code/opencode-lore/packages/gateway/src/cli/start.ts, internalProbeFetch(url, init) uses nodeHttpFetch for loopback URLs to bypass WHATWG’s browser forbidden-port list, while non-loopback URLs retain normal fetch transport semantics.probeGatewayIdentityDetailed(baseURL, token, timeoutMs = 1500) calls /_lore/control with authorization: Bearer ${token} and accepts only an OK JSON response with status === "ok", service === "lore", and a positive safe-integer numeric pid; outcomes are "authenticated", "rejected", "timeout", or "unavailable".probeGatewayIdentity(baseURL, token, timeoutMs = 1500) is a compatibility wrapper returning the authenticated { pid } identity or null.probeGatewayProcessStatus(record, timeoutMs = 1500) probes all record.hosts concurrently and returns "authenticated" if any authenticated identity has pid === record.pid; otherwise precedence is "timeout" over "rejected" over "unavailable".probeGatewayStatus(baseURL, timeoutMs = 1500) probes /health and preserves four public-health states: an OK response is "healthy", a non-OK response or non-refusal transport failure is "error", abort is "timeout", and recursively verified ECONNREFUSED—including an AggregateError whose nonempty errors are all refusals—is "not-running".probeGateway(baseURL, timeoutMs = 1500) is the non-destructive boolean compatibility wrapper and returns true only when probeGatewayStatus() returns "healthy".probeUrlFor(host, port) maps bind-all hosts 0.0.0.0 → 127.0.0.1 and :: → ::1, then brackets IPv6 using bracketHost, producing valid URLs such as http://[::1]:3207.probeGatewayProcessHost(record, timeoutMs = 1500) authenticates every bound host concurrently and returns the first original record.hosts[index] whose identity PID matches record.pid, or null; probeGatewayProcess() returns whether such a host exists.requestGatewayShutdown(record, timeoutMs = 1500) sends graceful shutdown requests to the token-authenticated /_lore/control endpoint across the record’s hosts using internalProbeFetch.{ readonly id: string; readonly setup: (context: PluginContext) => Promise<void> | void }; define(plugin) returns the plugin unchanged, and PluginDomain exposes asynchronous add(plugin) and remove(id).PluginContext contains options, agent, aisdk, catalog, command, integration, plugin, reference, and skill; agent, catalog, command, integration, reference, and skill include Reload./home/byk/Code/opencode/packages/core/src/config/plugin/external.ts discovers sorted {plugin,plugins}/*.{ts,js} files, dynamically imports each entrypoint, validates it with PluginModule, reads only .default, converts Promise plugins through PluginPromise.fromPromise(value) unless the value already has "effect", and registers them with ctx.plugin.add({ id, effect }); individual load failures are suppressed with Effect.ignoreCause./home/byk/Code/opencode/packages/core/src/plugin/promise.ts adapts Promise plugins to the Effect-only host with fromPromise(plugin), preserving the plugin scope for registration disposal and captured fiber context for boot-time batching.fromPromise(plugin), hook registration runs with Effect.runPromiseWith(context)(Scope.provide(scope)(effect)) and returns a Promise Registration whose dispose() executes the host registration’s Effect in the captured context.Effect.promise(() => Promise.resolve(callback(draft))); it adapts agent, aisdk.sdk, aisdk.language, catalog, command, integration, reference, and skill, including each applicable reload() method.fromPromise(input) before host.plugin.add(child); removal maps to host.plugin.remove(id). The plugin’s asynchronous setup(context2) is awaited inside the Effect./home/byk/Code/opencode-lore/packages/gateway/src/index.ts publicly 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 migrated commands and falls back to _cli during the migration window.process.argv[1] with __filename in CJS or fileURLToPath(import.meta.url) in ESM, returning false on error. When directly executed, it dynamically imports commandStart and runs commandStart({ quiet: true }), defaulting to start rather than run because embedded execution has no TTY and should not auto-launch an agent./home/byk/Code/opencode-lore/packages/gateway/script/bundle.ts uses packages/gateway/src/index.ts as an entry point and generates dist/index.d.cts; /home/byk/Code/opencode-lore/packages/gateway/script/build.ts generates index.bun.js containing export * from "../src/index.ts";.