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

Function getLegacyPlugins

packages/opencode/src/plugin/index.ts:95–108  ·  view source on GitHub ↗
(mod: Record<string, unknown>)

Source from the content-addressed store, hash-verified

93}
94
95function getLegacyPlugins(mod: Record<string, unknown>) {
96 const seen = new Set<unknown>()
97 const result: PluginInstance[] = []
98
99 for (const entry of Object.values(mod)) {
100 if (seen.has(entry)) continue
101 seen.add(entry)
102 const plugin = getServerPlugin(entry)
103 if (!plugin) throw new TypeError("Plugin export is not a function")
104 result.push(plugin)
105 }
106
107 return result
108}
109
110async function applyPlugin(load: PluginLoader.Loaded, input: PluginInput, hooks: Hooks[]) {
111 const plugin = readV1Plugin(load.mod, load.spec, "server", "detect")

Callers 1

applyPluginFunction · 0.85

Calls 4

getServerPluginFunction · 0.85
pushMethod · 0.80
addMethod · 0.65
valuesMethod · 0.45

Tested by

no test coverage detected