mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-26 13:25:13 +00:00
19 lines
726 B
TypeScript
19 lines
726 B
TypeScript
export type InternalHookEventType = "command" | "session" | "agent" | "gateway" | "message";
|
|
|
|
export interface InternalHookEvent {
|
|
/** The type of event (command, session, agent, gateway, etc.) */
|
|
type: InternalHookEventType;
|
|
/** The specific action within the type (e.g., 'new', 'reset', 'stop') */
|
|
action: string;
|
|
/** The session key this event relates to */
|
|
sessionKey: string;
|
|
/** Additional context specific to the event */
|
|
context: Record<string, unknown>;
|
|
/** Timestamp when the event occurred */
|
|
timestamp: Date;
|
|
/** Messages to send back to the user (hooks can push to this array) */
|
|
messages: string[];
|
|
}
|
|
|
|
export type InternalHookHandler = (event: InternalHookEvent) => Promise<void> | void;
|