Dashboard › opencode › Distillation
7c3c04d3-db55-47c0-acea-6c4b7b3f7348["lore_tm_v1_AK47gDiSeFjZw5e5YgH9pT3WLlXp8A8UH82Q9_BHcus","lore_tm_v1_JoF2rWitXIcly8XvixuqFPC-lGMTiXJ-yBSKuIXo8fQ","lore_tm_v1_s-KkRL1kr2qGYSf6Wl6S8mUTduDXQjHozDFrnuAIS9o","lore_tm_v1_QzZ1s06G-gmcQT4fvRC5I2FNLRrNmWggOms1Z7CwqUU","lore_tm_v1_eU_TvEqmZACsnk48ZxRo_qG6z_1f-Xab9wYVr34wq7Q"]
/home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/module.ts; standalone server-file sources are admitted only through legacy auto-discovery.--local flag “always disables remote mode,” mirroring hosted mode; in startGatewayLocked() in /home/byk/Code/opencode-lore/packages/gateway/src/cli/start.ts, opts.local === true sets both config.remoteGateway = false and config.remoteGatewayAutoDetected = false./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/module.ts defines PluginModule.make, which watches plugin dependencies through Watcher.Service, recursively selects the nearest existing ancestor using watchTarget(file), publishes changes through PubSub.unbounded<void>(), and disposes createPluginSources(...) on release./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/module.ts, load() treats path.isAbsolute(operation.target) as local; package targets use npm.resolve(operation.target) when options?.install === false and otherwise npm.add(operation.target)./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/module.ts preserves legacy standalone files by mapping a local file to { server: pathToFileURL(operation.target).href }; directory sources use Host.resolve(installed ?? { directory: operation.target }).options?.install === false) and lacks a server entrypoint, load() returns { pending: true as const }; otherwise a missing entrypoint raises PluginModule.LoadError with Plugin entrypoint not found: ${operation.target}.id and either effect or setup; schema failures produce PluginModule.LoadError with message Plugin must export a default definition with an id and an effect or setup function. Setup-style plugins are converted using PluginPromise.fromPromise(value).features.tui and features.rpc when corresponding host entrypoints exist, calculate revision as JSON.stringify([operation, loaded.version]), distinguish local and package sources, and invoke plugin.effect({ ...host, options: operation.options })./home/byk/Code/opencode-v2-pilot/packages/plugin/src/host.ts defines optional server, tui, and rpc entrypoints. Host.resolve(target) searches server subpaths in order ["server", ""], then ["tui"], then ["rpc"]; it suppresses only ENOENT, ENOTDIR, MODULE_NOT_FOUND, ERR_MODULE_NOT_FOUND, ERR_PACKAGE_PATH_NOT_EXPORTED, and ERR_UNSUPPORTED_DIR_IMPORT, rethrowing other resolution errors.startGateway() in /home/byk/Code/opencode-lore/packages/gateway/src/cli/start.ts runs startGatewayLocked() under withLifecycleLock("gateway-start", ...); its default port fallback order is exactly 3207 → 5673 → 0, where 0 requests an OS-assigned random port.quiet: true to avoid stdout/stderr writes corrupting a full-screen TUI; quiet notices use file-based, terminal-suppressed log.warn, while lore start uses console.error("[lore] ...").local: true because hosted mode is process-wide and disables filesystem operations in @loreai/core; enabling it in the shared process breaks getGitRemote(), .lore.md import, config loading, and file watching.startGatewayLocked() is: explicit opts.local sets config.hostedMode = !opts.local; otherwise, absent LORE_HOSTED_MODE, lore start defaults config.hostedMode = true; an explicit environment value remains as handled by loadConfig().opts.local === true disables it; otherwise explicit LORE_REMOTE_GATEWAY or LORE_HOSTED_MODE environment values win; with no flag or explicit environment variable, lore start preserves bind-address auto-detection or defaults config.remoteGateway = true and config.remoteGatewayCommandDefault = true.assertGatewayAccessConfigured(config) runs only after CLI/environment/default mode precedence is fully applied, allowing --local to opt out before access invariants are checked.io.authenticate(record); successful reuse returns owned: false, the persisted record.token as managementToken, and a no-op shutdown.0; for fixed candidates they probe deduplicated hosts comprising "127.0.0.1", config.hosts, and matching process-record hosts. A reachable but unauthenticated occupant is treated as foreign, causing an explicit-port error or fallback to the next default port.Port ${candidatePort} is already in use by another process (not an authenticated lore gateway). Use --port / LORE_LISTEN_PORT to pick a different port.controlToken to the port and process records; GatewayProcessRecord version 2 stores pid, port, hosts, token, and processIdentity. When currentProcessIdentity() is unavailable, identity falls back to unverified:${controlToken}.AggregateError is raised with message Gateway publication failed and the live listener could not be closed; discovery evidence was retained.shutdownPromise, runs under withLifecycleLock("gateway-shutdown", ...), stops accepting work before resetting pipeline state, then settles temporal embeddings, settles document embeddings, resets the embedding provider, shuts down the vector pool, and closes the DB before removing discovery records.EMBED_DRAIN_DEADLINE_MS for temporal/document embedding settlement, VECTOR_POOL_SHUTDOWN_DEADLINE_MS for vector-pool shutdown, and a lifecycle-lock timeout of Math.max(1, Math.floor(SHUTDOWN_DEADLINE_MS / 2)).Database close warning: ... but does not wedge shutdown or retain an otherwise stale process record; discovery removal requires matching pid, token, and processIdentity./port\b.*\bin use/i or /EADDRINUSE/i, re-reads and authenticates the exact persisted owner, and never treats public /health reachability as proof of Lore gateway identity.