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

Function resolvePluginTarget

packages/opencode/src/plugin/shared.ts:207–213  ·  view source on GitHub ↗
(spec: string)

Source from the content-addressed store, hash-verified

205}
206
207export async function resolvePluginTarget(spec: string) {
208 if (isPathPluginSpec(spec)) return resolvePathPluginTarget(spec)
209 const hit = parse(spec)
210 const pkg = hit?.name && hit.raw === hit.name ? `${hit.name}@latest` : spec
211 const result = await Npm.add(pkg)
212 return result.directory
213}
214
215export async function readPluginPackage(target: string): Promise<PluginPackage> {
216 const file = target.startsWith("file://") ? fileURLToPath(target) : target

Callers 3

resolveFunction · 0.90
install.tsFile · 0.90
plug.tsFile · 0.90

Calls 4

isPathPluginSpecFunction · 0.85
resolvePathPluginTargetFunction · 0.85
parseFunction · 0.70
addMethod · 0.65

Tested by

no test coverage detected