mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 09:47:40 +00:00
feat(hooks): run boot.md on gateway startup
This commit is contained in:
@@ -47,6 +47,20 @@ Swaps injected `SOUL.md` content with `SOUL_EVIL.md` during a purge window or by
|
||||
clawdbot hooks enable soul-evil
|
||||
```
|
||||
|
||||
### 🚀 boot-md
|
||||
|
||||
Runs `BOOT.md` whenever the gateway starts (after channels start).
|
||||
|
||||
**Events**: `gateway:startup`
|
||||
**What it does**: Executes BOOT.md instructions via the agent runner.
|
||||
**Output**: Whatever the instructions request (for example, outbound messages).
|
||||
|
||||
**Enable**:
|
||||
|
||||
```bash
|
||||
clawdbot hooks enable boot-md
|
||||
```
|
||||
|
||||
## Hook Structure
|
||||
|
||||
Each hook is a directory containing:
|
||||
@@ -156,6 +170,7 @@ Currently supported events:
|
||||
- **command:reset**: `/reset` command
|
||||
- **command:stop**: `/stop` command
|
||||
- **agent:bootstrap**: Before workspace bootstrap files are injected
|
||||
- **gateway:startup**: Gateway startup (after channels start)
|
||||
|
||||
More event types coming soon (session lifecycle, agent errors, etc.).
|
||||
|
||||
@@ -165,7 +180,7 @@ Hook handlers receive an `InternalHookEvent` object:
|
||||
|
||||
```typescript
|
||||
interface InternalHookEvent {
|
||||
type: "command" | "session" | "agent";
|
||||
type: "command" | "session" | "agent" | "gateway";
|
||||
action: string; // e.g., 'new', 'reset', 'stop'
|
||||
sessionKey: string;
|
||||
context: Record<string, unknown>;
|
||||
|
||||
Reference in New Issue
Block a user