(
filePath: string,
memoryType: InstructionsMemoryType,
loadReason: InstructionsLoadReason,
options?: {
globs?: string[]
triggerFilePath?: string
parentFilePath?: string
timeoutMs?: number
},
)
| 4428 | * attachments.ts) |
| 4429 | */ |
| 4430 | export async function executeInstructionsLoadedHooks( |
| 4431 | filePath: string, |
| 4432 | memoryType: InstructionsMemoryType, |
| 4433 | loadReason: InstructionsLoadReason, |
| 4434 | options?: { |
| 4435 | globs?: string[] |
| 4436 | triggerFilePath?: string |
| 4437 | parentFilePath?: string |
| 4438 | timeoutMs?: number |
| 4439 | }, |
| 4440 | ): Promise<void> { |
| 4441 | const { |
| 4442 | globs, |
| 4443 | triggerFilePath, |
| 4444 | parentFilePath, |
| 4445 | timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS, |
| 4446 | } = options ?? {} |
| 4447 | |
| 4448 | const hookInput: InstructionsLoadedHookInput = { |
| 4449 | ...createBaseHookInput(undefined), |
| 4450 | hook_event_name: 'InstructionsLoaded', |
| 4451 | file_path: filePath, |
| 4452 | memory_type: memoryType, |
| 4453 | load_reason: loadReason, |
| 4454 | globs, |
| 4455 | trigger_file_path: triggerFilePath, |
| 4456 | parent_file_path: parentFilePath, |
| 4457 | } |
| 4458 | |
| 4459 | await executeHooksOutsideREPL({ |
| 4460 | hookInput, |
| 4461 | timeoutMs, |
| 4462 | matchQuery: loadReason, |
| 4463 | }) |
| 4464 | } |
| 4465 | |
| 4466 | /** Result of an elicitation hook execution (non-REPL path). */ |
| 4467 | export type ElicitationHookResult = { |
no test coverage detected