> ## Documentation Index
> Fetch the complete documentation index at: https://cognitio-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Interface: HookEntry<Event>

> Generated from the public TypeScript API.

A hook callback with an optional tool matcher, deadline and asynchronous-notification flag.

## Type Parameters

### Event

`Event` *extends* [`HookEventName`](../type-aliases/HookEventName) = [`HookEventName`](../type-aliases/HookEventName)

## Properties

### async?

```ts theme={null}
optional async?: boolean;
```

***

### callback

```ts theme={null}
callback: (payload) =>
  | void
  | HookResult
| Promise<void | HookResult>;
```

The SDK-local event handler. Decision fields are honored only for supported event types.

Handle an event in the SDK process.

#### Parameters

##### payload

[`HookEventPayload`](HookEventPayload)\<`Event`>

Event data and cancellation signal.

#### Returns

\| `void`
\| [`HookResult`](HookResult)
\| `Promise`\<`void` | [`HookResult`](HookResult)>

Optional event-specific modifications or decisions.

***

### matcher?

```ts theme={null}
optional matcher?: string | RegExp;
```

***

### timeoutMs?

```ts theme={null}
optional timeoutMs?: number;
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.