(
filePath: string,
memoryType: InstructionsMemoryType,
loadReason: InstructionsLoadReason,
options?: {
globs?: string[]
triggerFilePath?: string
parentFilePath?: string
timeoutMs?: number
},
)
| 4492 | * attachments.ts) |
| 4493 | */ |
| 4494 | export async function executeInstructionsLoadedHooks( |
| 4495 | filePath: string, |
| 4496 | memoryType: InstructionsMemoryType, |
| 4497 | loadReason: InstructionsLoadReason, |
| 4498 | options?: { |
| 4499 | globs?: string[] |
| 4500 | triggerFilePath?: string |
| 4501 | parentFilePath?: string |
| 4502 | timeoutMs?: number |
| 4503 | }, |
| 4504 | ): Promise<void> { |
| 4505 | const { |
| 4506 | globs, |
| 4507 | triggerFilePath, |
| 4508 | parentFilePath, |
| 4509 | timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS, |
| 4510 | } = options ?? {} |
| 4511 | |
| 4512 | const hookInput: InstructionsLoadedHookInput = { |
| 4513 | ...createBaseHookInput(undefined), |
| 4514 | hook_event_name: 'InstructionsLoaded', |
| 4515 | file_path: filePath, |
| 4516 | memory_type: memoryType, |
| 4517 | load_reason: loadReason, |
| 4518 | globs, |
| 4519 | trigger_file_path: triggerFilePath, |
| 4520 | parent_file_path: parentFilePath, |
| 4521 | } |
| 4522 | |
| 4523 | await executeHooksOutsideREPL({ |
| 4524 | hookInput, |
| 4525 | timeoutMs, |
| 4526 | matchQuery: loadReason, |
| 4527 | }) |
| 4528 | } |
| 4529 | |
| 4530 | /** Result of an elicitation hook execution (non-REPL path). */ |
| 4531 | export type ElicitationHookResult = { |
no test coverage detected