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

Function getHookDefinitionsForTelemetry

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

Source from the content-addressed store, hash-verified

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

Callers 1

executeHooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected