MCPcopy Create free account
hub / github.com/continuedev/continue / executeHandler

Function executeHandler

extensions/cli/src/hooks/hookRunner.ts:210–243  ·  view source on GitHub ↗
(
  handler: HookHandler,
  input: HookInput,
  cwd: string,
)

Source from the content-addressed store, hash-verified

208}
209
210async function executeHandler(
211 handler: HookHandler,
212 input: HookInput,
213 cwd: string,
214): Promise<HookExecutionResult> {
215 switch (handler.type) {
216 case "command":
217 return executeCommandHook(handler, input, cwd);
218 case "http":
219 return executeHttpHook(handler, input);
220 case "prompt":
221 case "agent":
222 // Prompt and agent hooks are not yet implemented
223 logger.debug(
224 `Hook type "${handler.type}" is not yet supported, skipping`,
225 );
226 return {
227 output: null,
228 stdout: "",
229 stderr: "",
230 exitCode: 0,
231 blocked: false,
232 };
233 default:
234 logger.warn(`Unknown hook handler type: ${(handler as any).type}`);
235 return {
236 output: null,
237 stdout: "",
238 stderr: "",
239 exitCode: 0,
240 blocked: false,
241 };
242 }
243}
244
245function getHandlerDedupeKey(handler: HookHandler): string {
246 switch (handler.type) {

Callers 1

runHooksFunction · 0.85

Calls 4

executeCommandHookFunction · 0.85
executeHttpHookFunction · 0.85
warnMethod · 0.80
debugMethod · 0.45

Tested by

no test coverage detected