MCPcopy Index your code
hub / github.com/anomalyco/opencode / applyPlugin

Function applyPlugin

packages/opencode/src/plugin/index.ts:110–121  ·  view source on GitHub ↗
(load: PluginLoader.Loaded, input: PluginInput, hooks: Hooks[])

Source from the content-addressed store, hash-verified

108}
109
110async function applyPlugin(load: PluginLoader.Loaded, input: PluginInput, hooks: Hooks[]) {
111 const plugin = readV1Plugin(load.mod, load.spec, "server", "detect")
112 if (plugin) {
113 await resolvePluginId(load.source, load.spec, load.target, readPluginId(plugin.id, load.spec), load.pkg)
114 hooks.push(await (plugin as PluginModule).server(input, load.options))
115 return
116 }
117
118 for (const server of getLegacyPlugins(load.mod)) {
119 hooks.push(await server(input, load.options))
120 }
121}
122
123const layer = Layer.effect(
124 Service,

Callers 1

index.tsFile · 0.85

Calls 6

readV1PluginFunction · 0.90
resolvePluginIdFunction · 0.90
readPluginIdFunction · 0.90
getLegacyPluginsFunction · 0.85
pushMethod · 0.80
serverFunction · 0.50

Tested by

no test coverage detected