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

Function executeInstructionsLoadedHooks

src/utils/hooks.ts:4339–4373  ·  view source on GitHub ↗
(
  filePath: string,
  memoryType: InstructionsMemoryType,
  loadReason: InstructionsLoadReason,
  options?: {
    globs?: string[]
    triggerFilePath?: string
    parentFilePath?: string
    timeoutMs?: number
  },
)

Source from the content-addressed store, hash-verified

4337 * attachments.ts)
4338 */
4339export async function executeInstructionsLoadedHooks(
4340 filePath: string,
4341 memoryType: InstructionsMemoryType,
4342 loadReason: InstructionsLoadReason,
4343 options?: {
4344 globs?: string[]
4345 triggerFilePath?: string
4346 parentFilePath?: string
4347 timeoutMs?: number
4348 },
4349): Promise<void> {
4350 const {
4351 globs,
4352 triggerFilePath,
4353 parentFilePath,
4354 timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
4355 } = options ?? {}
4356
4357 const hookInput: InstructionsLoadedHookInput = {
4358 ...createBaseHookInput(undefined),
4359 hook_event_name: 'InstructionsLoaded',
4360 file_path: filePath,
4361 memory_type: memoryType,
4362 load_reason: loadReason,
4363 globs,
4364 trigger_file_path: triggerFilePath,
4365 parent_file_path: parentFilePath,
4366 }
4367
4368 await executeHooksOutsideREPL({
4369 hookInput,
4370 timeoutMs,
4371 matchQuery: loadReason,
4372 })
4373}
4374
4375/** Result of an elicitation hook execution (non-REPL path). */
4376export type ElicitationHookResult = {

Callers 2

memoryFilesToAttachmentsFunction · 0.85
claudemd.tsFile · 0.85

Calls 2

createBaseHookInputFunction · 0.85
executeHooksOutsideREPLFunction · 0.85

Tested by

no test coverage detected