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

Function executeSubagentStartHooks

src/utils/hooks.ts:3936–3956  ·  view source on GitHub ↗
(
  agentId: string,
  agentType: string,
  signal?: AbortSignal,
  timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
)

Source from the content-addressed store, hash-verified

3934 * @returns Async generator that yields progress messages and hook results
3935 */
3936export async function* executeSubagentStartHooks(
3937 agentId: string,
3938 agentType: string,
3939 signal?: AbortSignal,
3940 timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
3941): AsyncGenerator<AggregatedHookResult> {
3942 const hookInput: SubagentStartHookInput = {
3943 ...createBaseHookInput(undefined),
3944 hook_event_name: 'SubagentStart',
3945 agent_id: agentId,
3946 agent_type: agentType,
3947 }
3948
3949 yield* executeHooks({
3950 hookInput,
3951 toolUseID: randomUUID(),
3952 matchQuery: agentType,
3953 signal,
3954 timeoutMs,
3955 })
3956}
3957
3958/**
3959 * Execute pre-compact hooks if configured

Callers 1

runAgentFunction · 0.85

Calls 3

randomUUIDFunction · 0.90
createBaseHookInputFunction · 0.85
executeHooksFunction · 0.85

Tested by

no test coverage detected