MCPcopy Create free account
hub / github.com/Tencent/teamai-cli / removeOpencodeAgentHook

Function removeOpencodeAgentHook

src/opencode-hooks.ts:282–294  ·  view source on GitHub ↗
(opts: {
  slug: string;
  baseDir: string;
  scope: 'project' | 'user';
})

Source from the content-addressed store, hash-verified

280
281/** Remove a server-pushed agent-hook plugin file for OpenCode. */
282export async function removeOpencodeAgentHook(opts: {
283 slug: string;
284 baseDir: string;
285 scope: 'project' | 'user';
286}): Promise<void> {
287 assertSafeSlug(opts.slug);
288 const dir = resolveOpencodePluginDir(opts.baseDir, opts.scope);
289 const file = path.join(dir, `teamai-agent-${opts.slug}.ts`);
290 if (await pathExists(file)) {
291 await remove(file);
292 log.success(`Removed OpenCode agent hook [${opts.slug}] from ${file}`);
293 }
294}

Callers 3

runHookRuleCommandFunction · 0.85
removeAllAgentHooksFunction · 0.85

Calls 4

assertSafeSlugFunction · 0.85
resolveOpencodePluginDirFunction · 0.85
pathExistsFunction · 0.85
removeFunction · 0.70

Tested by

no test coverage detected