






















@@ -170,17 +170,19 @@ Currently supported events:
170170- **command:stop**: `/stop` command
171171- **agent:bootstrap**: Before workspace bootstrap files are injected
172172- **gateway:startup**: Gateway startup (after channels start)
173-174-More event types coming soon (session lifecycle, agent errors, etc.).
173+- **session:compact:before**: Pre-compaction snapshot before the embedded runner rewrites session context
174+- **session:compact:after**: Post-compaction snapshot after the runner replaces session context
175+- **message:received**: Inbound channel message accepted for dispatch
176+- **message:sent**: Outbound channel message delivered (canonical payload only)
175177176178## Handler API
177179178180Hook handlers receive an `InternalHookEvent` object:
179181180182```typescript
181183interface InternalHookEvent {
182- type: "command" | "session" | "agent" | "gateway";
183- action: string; // e.g., 'new', 'reset', 'stop'
184+ type: "command" | "session" | "agent" | "gateway" | "message";
185+ action: string; // e.g., 'new', 'reset', 'stop', 'compact:before', 'received', 'sent'
184186 sessionKey: string;
185187 context: Record<string, unknown>;
186188 timestamp: Date;
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。