2026-06-21 12:05:49 +00:00
|
|
|
import type { Effect, Scope } from "effect"
|
2026-06-22 23:06:57 +00:00
|
|
|
import type { PluginContext } from "./context.js"
|
2026-06-21 12:05:49 +00:00
|
|
|
|
2026-06-22 23:06:57 +00:00
|
|
|
export interface Plugin {
|
2026-06-21 12:05:49 +00:00
|
|
|
readonly id: string
|
2026-06-22 23:06:57 +00:00
|
|
|
readonly effect: (context: PluginContext) => Effect.Effect<void, never, Scope.Scope>
|
2026-06-21 12:05:49 +00:00
|
|
|
}
|
|
|
|
|
|
2026-06-22 23:06:57 +00:00
|
|
|
export function define(plugin: Plugin) {
|
2026-06-21 12:05:49 +00:00
|
|
|
return plugin
|
|
|
|
|
}
|
2026-06-22 23:06:57 +00:00
|
|
|
|
2026-06-23 00:10:29 +00:00
|
|
|
export interface PluginDomain {
|
|
|
|
|
readonly add: (plugin: Plugin) => Effect.Effect<void>
|
|
|
|
|
readonly remove: (id: string) => Effect.Effect<void>
|
2026-06-22 23:06:57 +00:00
|
|
|
}
|