index.ts (432B)
1 import type { Plugin } from "@opencode/plugin"; 2 3 import type { OpenpodContext } from "../context"; 4 5 import { wrap } from "./wrap"; 6 7 export async function registerShell( 8 ctx: Plugin.Context, 9 deps: OpenpodContext, 10 ): Promise<void> { 11 const { logger } = deps; 12 13 logger.log("registering create.before"); 14 15 await ctx.shell.hook("create.before", async (event) => { 16 event.command = wrap(deps, event.cwd, event.command); 17 }); 18 }