mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-25 04:35:37 -04:00
17 lines
465 B
TypeScript
17 lines
465 B
TypeScript
import type { Effect, Scope } from "effect"
|
|
import type { PluginContext } from "./context.js"
|
|
|
|
export interface Plugin<R = Scope.Scope> {
|
|
readonly id: string
|
|
readonly effect: (context: PluginContext) => Effect.Effect<void, never, R>
|
|
}
|
|
|
|
export function define<R = Scope.Scope>(plugin: Plugin<R>) {
|
|
return plugin
|
|
}
|
|
|
|
export interface PluginDomain {
|
|
readonly add: (plugin: Plugin) => Effect.Effect<void>
|
|
readonly remove: (id: string) => Effect.Effect<void>
|
|
}
|