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

Function installPlugin

packages/opencode/src/plugin/install.ts:259–281  ·  view source on GitHub ↗
(spec: string, dep: InstallDeps = defaultInstallDeps)

Source from the content-addressed store, hash-verified

257}
258
259export async function installPlugin(spec: string, dep: InstallDeps = defaultInstallDeps): Promise<InstallResult> {
260 const target = await dep.resolve(spec).then(
261 (item) => ({
262 ok: true as const,
263 item,
264 }),
265 (error: unknown) => ({
266 ok: false as const,
267 error,
268 }),
269 )
270 if (!target.ok) {
271 return {
272 ok: false,
273 code: "install_failed",
274 error: target.error,
275 }
276 }
277 return {
278 ok: true,
279 target: target.item,
280 }
281}
282
283export async function readPluginManifest(target: string): Promise<ManifestResult> {
284 const pkg = await readPluginPackage(target).then(

Callers 1

createPlugTaskFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected