Dashboard › opencode › Distillation
1358da66-ba1f-4e04-b53b-87c56fd38241["lore_tm_v1_OdXVeA2GAkicwPgoWoCkRVl3aEWixb0qqDHTjJky5uc","lore_tm_v1_ud1Jcs6Gr_3p0pW3M1BEj7slTJcyWVlC7vfu9SrNWD8","lore_tm_v1__DE1DK-swBam8GEa2wvZQEl7CfeWjGwFzoZzY87AWT0","lore_tm_v1_LUe0RfP5lLJcQaVSbrbqXS79mZ9FZ7n24HSRhCWLwVc","lore_tm_v1_hRKsMmjohT_nZtxsoeHSlfoLxIAsUhXjWNsycR1Qq_o","lore_tm_v1_HAQfjBFyccGuoKc4E5j_JRmEPruN868C1gIB6JFEHUU"]
Date: Sep 9, 2026
/home/byk/Code/opencode/packages/plugin/src/v2/options.ts contains one line: export type PluginOptions = Readonly<Record<string, any>>.define found 100 displayed matches with more available. Event.define(...) is used throughout /home/byk/Code/opencode/packages/schema, including test/event.test.ts, src/worktree-event.ts, src/workspace-event.ts, src/vcs-event.ts, src/tui-event.ts, src/session-status-event.ts, src/session-event.ts, src/session-compaction-event.ts, src/server-event.ts, src/mcp-event.ts, src/installation-event.ts, and src/ide-event.ts; local define(...) calls also appear in src/v1/session.ts, src/v1/question.ts, src/v1/permission.ts, src/v1/legacy-event.ts, src/session-todo.ts, src/reference.ts, src/question.ts, src/pty.ts, src/project.ts, src/project-directories.ts, src/plugin.ts, src/permission.ts, src/models-dev.ts, src/integration.ts, src/filesystem.ts, src/filesystem-watcher.ts, and src/catalog.ts.define-related search hits include /home/byk/Code/opencode/packages/plugin/src/v2/promise/plugin.ts, provider definitions in /home/byk/Code/opencode/packages/llm/src/providers/openai-compatible.ts, and TUI plugin types imported from @opencode-ai/plugin/tui by /home/byk/Code/opencode/packages/tui/src/feature-plugins/builtins.ts./home/byk/Code/opencode/packages/core/src/plugin/ includes models-dev.ts, internal.ts, variant.ts, skill.ts, provider.ts, promise.ts, host.ts, command.ts, agent.ts, and layer-map.example.ts./home/byk/Code/opencode/packages/core/src/plugin/provider/ includes github-copilot.ts, zenmux.ts, xai.ts, vercel.ts, venice.ts, togetherai.ts, snowflake-cortex.ts, sap-ai-core.ts, perplexity.ts, openrouter.ts, opencode.ts, openai.ts, openai-compatible.ts, nvidia.ts, mistral.ts, llmgateway.ts, kilo.ts, groq.ts, google.ts, google-vertex.ts, gitlab.ts, gateway.ts, dynamic.ts, deepinfra.ts, cohere.ts, cloudflare-workers-ai.ts, cloudflare-ai-gateway.ts, cerebras.ts, azure.ts, anthropic.ts, amazon-bedrock.ts, and alibaba.ts./home/byk/Code/opencode/packages/core/src/plugin/provider/openai-compatible.ts defines OpenAICompatiblePlugin with ID "openai-compatible" via the internal define(...). Its outer Effect.fn(function* (ctx) { ... }) registers an AI SDK handler through ctx.aisdk.sdk(...).evt.sdk is already populated or when evt.package does not include "@ai-sdk/openai-compatible". Otherwise it preserves explicit includeUsage: false, sets evt.options.includeUsage = true for every other value, dynamically imports @ai-sdk/openai-compatible, and assigns evt.sdk = mod.createOpenAICompatible(evt.options as any)./home/byk/Code/opencode/packages/core/src/plugin/internal.ts exports itself as PluginInternal, imports PluginContext from @opencode-ai/plugin/v2/effect, and defines an internal Plugin<R = never> interface whose effect returns Effect.Effect<void, never, R | Scope.Scope>. Its generic define<R>(plugin: Plugin<R>) returns the input unchanged.Requirements in /home/byk/Code/opencode/packages/core/src/plugin/internal.ts is the union of AgentV2.Service, Catalog.Service, CommandV2.Service, Config.Service, EventV2.Service, FileSystem.Service, FSUtil.Service, Global.Service, HttpClient.HttpClient, Integration.Service, Location.Service, ModelsDev.Service, Npm.Service, Reference.Service, and SkillV2.Service./home/byk/Code/opencode/packages/core/src/plugin/internal.ts uses Layer.effectDiscard(Effect.gen(...)) to acquire services explicitly. Its local add<R>(input: Plugin<R>) wraps each plugin effect with Effect.provideService(...) for Catalog.Service, CommandV2.Service, Integration.Service, AgentV2.Service, Config.Service, Location.Service, ModelsDev.Service, Npm.Service, EventV2.Service, FSUtil.Service, FileSystem.Service, Global.Service, HttpClient.HttpClient, SkillV2.Service, and Reference.Service, then calls plugin.add(PluginV2.ID.make(loaded.id), loaded.effect).State.batch(Effect.gen(...)) registration order in /home/byk/Code/opencode/packages/core/src/plugin/internal.ts lines 108–115 is: 1. ConfigReferencePlugin.Plugin, 2. AgentPlugin.Plugin, 3. CommandPlugin.Plugin, 4. SkillPlugin.Plugin, 5. ModelsDevPlugin, 6. ConfigAgentPlugin.Plugin; the file continues beyond the displayed line 115./home/byk/Code/opencode/.lore.md records a PluginModule compatibility trap: legacy async function exports may look valid because older OpenCode loaders invoke function exports, but V2 PluginModule.load() requires one default { id, setup } or { id, effect } definition. Configured local targets must be directories with discoverable server or index entrypoints; standalone files work only through auto-discovery./home/byk/Code/opencode/packages/plugin/src/v2/promise/README.md describes the Promise plugin API as the async/await equivalent of @opencode-ai/plugin/v2/effect, with the same two in-process capabilities./home/byk/Code/opencode/packages/plugin/src/v2/effect/README.md demonstrates importing define from @opencode-ai/plugin/v2/effect and defining a plugin with effect: Effect.fn(function* (ctx) { ... })./home/byk/Code/opencode/packages/plugin/src/v2/effect/PLAN.md states Effect plugins import @opencode-ai/plugin/v2/effect, not @opencode-ai/core, and plans to define PluginHost domain capabilities in @opencode-ai/plugin/v2/effect.