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

Function resolvePackageFile

packages/opencode/src/plugin/shared.ts:89–97  ·  view source on GitHub ↗
(spec: string, raw: string, kind: string, pkg: PluginPackage)

Source from the content-addressed store, hash-verified

87}
88
89function resolvePackageFile(spec: string, raw: string, kind: string, pkg: PluginPackage) {
90 const resolved = resolveExportPath(raw, pkg.dir)
91 const root = Filesystem.resolve(pkg.dir)
92 const next = Filesystem.resolve(resolved)
93 if (!Filesystem.contains(root, next)) {
94 throw new Error(`Plugin ${spec} resolved ${kind} entry outside plugin directory`)
95 }
96 return next
97}
98
99function resolvePackagePath(spec: string, raw: string, kind: PluginKind, pkg: PluginPackage) {
100 return pathToFileURL(resolvePackageFile(spec, raw, kind, pkg)).href

Callers 2

resolvePackagePathFunction · 0.85
readPackageThemesFunction · 0.85

Calls 1

resolveExportPathFunction · 0.85

Tested by

no test coverage detected