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

Function executeSessionStartHooks

src/utils/hooks.ts:3871–3896  ·  view source on GitHub ↗
(
  source: 'startup' | 'resume' | 'clear' | 'compact',
  sessionId?: string,
  agentType?: string,
  model?: string,
  signal?: AbortSignal,
  timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
  forceSyncExecution?: boolean,
)

Source from the content-addressed store, hash-verified

3869 * @returns Async generator that yields progress messages and hook results
3870 */
3871export async function* executeSessionStartHooks(
3872 source: 'startup' | 'resume' | 'clear' | 'compact',
3873 sessionId?: string,
3874 agentType?: string,
3875 model?: string,
3876 signal?: AbortSignal,
3877 timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
3878 forceSyncExecution?: boolean,
3879): AsyncGenerator<AggregatedHookResult> {
3880 const hookInput: SessionStartHookInput = {
3881 ...createBaseHookInput(undefined, sessionId),
3882 hook_event_name: 'SessionStart',
3883 source,
3884 agent_type: agentType,
3885 model,
3886 }
3887
3888 yield* executeHooks({
3889 hookInput,
3890 toolUseID: randomUUID(),
3891 matchQuery: source,
3892 signal,
3893 timeoutMs,
3894 forceSyncExecution,
3895 })
3896}
3897
3898/**
3899 * Execute setup hooks if configured

Callers 1

processSessionStartHooksFunction · 0.85

Calls 3

randomUUIDFunction · 0.90
createBaseHookInputFunction · 0.85
executeHooksFunction · 0.85

Tested by

no test coverage detected