Dashboard › opencode › Distillation
92edff30-cf6d-44a8-ab9e-30c3c5443613["lore_tm_v1_X_bdKdrGM29hvgGBSozGTlYyiI2_HDjTsjFOAmhh7IM","lore_tm_v1_v9IHvM_WPzOfW_DoZFQIB4RFs-1uOE3MgWfFwUN8WUM","lore_tm_v1_9o3i8hKIqs3JHb2TCuUs6H4dhfUcLxyu95C8QceAAiQ","lore_tm_v1_JDXczrmbf9uZXlng9EBC-aUHcSoXOdMM6ClnIVPboYA","lore_tm_v1_lL5ZIwkYEr5sbyqlW8kK5Y_V4WhVHPhfB1kzrsrnnKQ"]
packages/opencode/src/index.ts catches plugin initialization errors, derives detail as e.stack || e.message for Error instances or String(e) otherwise, logs log.error(\init failed: ${detail}`), then rethrows the original error; comments explain this preserves the root cause in the file and Sentry sinks, accessible through lore logs`, even when OpenCode’s plugin loader swallows the error and TUI stderr is silenced.packages/opencode/src/index.ts ends with export default LorePlugin; its warning says the module must export only LorePlugin and the same-reference default because OpenCode’s legacy plugin loader invokes every function export as a plugin and throws on any non-function export, dropping the plugin entirely. Helpers must remain in ./internal.ts, and the constraint is guarded by the "plugin entry module export shape" test in test/index.test.ts.packages/pi/src/index.ts line 79 calls log.silenceStderr() when inTestEnv is false.packages/opencode/test/tui-silence.test.ts documents and tests that plugin activation must call log.silenceStderr() so neither [lore] plugin output nor output from the in-process gateway reaches and corrupts the OpenCode TUI; the test resets stderr silencing with log.silenceStderr(false).packages/opencode/test/internal.test.ts includes stderr logging coverage: it spies on console.error, calls log.silenceStderr(false) to exercise the unsilenced log.error path, checks stderr.mock.calls, and restores both the spy and stderr silencing state.packages/gateway/package.json declares "main": "./dist/index.cjs" and "types": "./dist/index.d.cts"; its exports map also references "types": "./dist/index.d.cts".packages/gateway/package.json includes dev dependencies @types/bun at ^1.2.0, @types/qrcode-terminal at ^0.12.2, and @types/semver at ^7.7.1.