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

Function deactivatePluginEntry

packages/opencode/src/plugin/tui/runtime.ts:502–514  ·  view source on GitHub ↗
(state: RuntimeState, plugin: PluginEntry, persist: boolean)

Source from the content-addressed store, hash-verified

500}
501
502async function deactivatePluginEntry(state: RuntimeState, plugin: PluginEntry, persist: boolean) {
503 plugin.enabled = false
504 if (persist) writePluginEnabledState(state.api, plugin.id, false)
505 if (!plugin.scope) {
506 state.view.update({ status: listPluginStatus(state) })
507 return true
508 }
509 const scope = plugin.scope
510 plugin.scope = undefined
511 await scope.dispose()
512 state.view.update({ status: listPluginStatus(state) })
513 return true
514}
515
516async function activatePluginEntry(state: RuntimeState, plugin: PluginEntry, persist: boolean) {
517 plugin.enabled = true

Callers 2

deactivatePluginByIdFunction · 0.85
disposeFunction · 0.85

Calls 4

writePluginEnabledStateFunction · 0.85
listPluginStatusFunction · 0.85
updateMethod · 0.65
disposeMethod · 0.45

Tested by

no test coverage detected