MCPcopy Create free account
hub / github.com/freecodexyz/free-code / getHookDefinitionsForTelemetry

Function getHookDefinitionsForTelemetry

src/utils/hooks.ts:5005–5022  ·  view source on GitHub ↗
(
  matchedHooks: MatchedHook[],
)

Source from the content-addressed store, hash-verified

5003}
5004
5005function getHookDefinitionsForTelemetry(
5006 matchedHooks: MatchedHook[],
5007): Array<{ type: string; command?: string; prompt?: string; name?: string }> {
5008 return matchedHooks.map(({ hook }) => {
5009 if (hook.type === 'command') {
5010 return { type: 'command', command: hook.command }
5011 } else if (hook.type === 'prompt') {
5012 return { type: 'prompt', prompt: hook.prompt }
5013 } else if (hook.type === 'http') {
5014 return { type: 'http', command: hook.url }
5015 } else if (hook.type === 'function') {
5016 return { type: 'function', name: 'function' }
5017 } else if (hook.type === 'callback') {
5018 return { type: 'callback', name: 'callback' }
5019 }
5020 return { type: 'unknown' }
5021 })
5022}

Callers 1

executeHooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected