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

Function pluginSource

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

Source from the content-addressed store, hash-verified

54const INDEX_FILES = ["index.ts", "index.tsx", "index.js", "index.mjs", "index.cjs"]
55
56export function pluginSource(spec: string): PluginSource {
57 if (isPathPluginSpec(spec)) return "file"
58 return "npm"
59}
60
61function resolveExportPath(raw: string, dir: string) {
62 if (raw.startsWith("file://")) return fileURLToPath(raw)

Callers 5

attemptFunction · 0.90
loadExternalFunction · 0.90
entryCoreFunction · 0.90
resolvePluginEntrypointFunction · 0.85
createPluginEntryFunction · 0.85

Calls 1

isPathPluginSpecFunction · 0.85

Tested by

no test coverage detected