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

Function readPluginPackage

packages/opencode/src/plugin/shared.ts:215–222  ·  view source on GitHub ↗
(target: string)

Source from the content-addressed store, hash-verified

213}
214
215export async function readPluginPackage(target: string): Promise<PluginPackage> {
216 const file = target.startsWith("file://") ? fileURLToPath(target) : target
217 const stat = await Filesystem.statAsync(file)
218 const dir = stat?.isDirectory() ? file : path.dirname(file)
219 const pkg = path.join(dir, "package.json")
220 const json = await Filesystem.readJson<Record<string, unknown>>(pkg)
221 return { dir, pkg, json }
222}
223
224export async function createPluginEntry(spec: string, target: string, kind: PluginKind): Promise<PluginEntry> {
225 const source = pluginSource(spec)

Callers 5

readPluginManifestFunction · 0.90
resolvePluginEntrypointFunction · 0.85
checkPluginCompatibilityFunction · 0.85
createPluginEntryFunction · 0.85
resolvePluginIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected