mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 21:24:31 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
---
|
||||
name: soul-evil
|
||||
description: "Swap SOUL.md with SOUL_EVIL.md during a purge window or by random chance"
|
||||
homepage: https://docs.molt.bot/hooks/soul-evil
|
||||
homepage: https://docs.openclaw.ai/hooks/soul-evil
|
||||
metadata:
|
||||
{
|
||||
"moltbot":
|
||||
"openclaw":
|
||||
{
|
||||
"emoji": "😈",
|
||||
"events": ["agent:bootstrap"],
|
||||
"requires": { "config": ["hooks.internal.entries.soul-evil.enabled"] },
|
||||
"install": [{ "id": "bundled", "kind": "bundled", "label": "Bundled with Moltbot" }],
|
||||
"install": [{ "id": "bundled", "kind": "bundled", "label": "Bundled with OpenClaw" }],
|
||||
},
|
||||
}
|
||||
---
|
||||
@@ -31,7 +31,7 @@ You can change the filename via hook config.
|
||||
|
||||
## Configuration
|
||||
|
||||
Add this to your config (`~/.clawdbot/moltbot.json`):
|
||||
Add this to your config (`~/.openclaw/openclaw.json`):
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -67,5 +67,5 @@ Add this to your config (`~/.clawdbot/moltbot.json`):
|
||||
## Enable
|
||||
|
||||
```bash
|
||||
moltbot hooks enable soul-evil
|
||||
openclaw hooks enable soul-evil
|
||||
```
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# SOUL Evil Hook
|
||||
|
||||
Small persona swap hook for Clawdbot.
|
||||
Small persona swap hook for OpenClaw.
|
||||
|
||||
Docs: https://docs.molt.bot/hooks/soul-evil
|
||||
Docs: https://docs.openclaw.ai/hooks/soul-evil
|
||||
|
||||
## Setup
|
||||
|
||||
1. `clawdbot hooks enable soul-evil`
|
||||
1. `openclaw hooks enable soul-evil`
|
||||
2. Create `SOUL_EVIL.md` next to `SOUL.md` in your agent workspace
|
||||
3. Configure `hooks.internal.entries.soul-evil` (see docs)
|
||||
|
||||
@@ -5,19 +5,19 @@ import { describe, expect, it } from "vitest";
|
||||
import handler from "./handler.js";
|
||||
import { createHookEvent } from "../../hooks.js";
|
||||
import type { AgentBootstrapHookContext } from "../../hooks.js";
|
||||
import type { MoltbotConfig } from "../../../config/config.js";
|
||||
import type { OpenClawConfig } from "../../../config/config.js";
|
||||
import { makeTempWorkspace, writeWorkspaceFile } from "../../../test-helpers/workspace.js";
|
||||
|
||||
describe("soul-evil hook", () => {
|
||||
it("skips subagent sessions", async () => {
|
||||
const tempDir = await makeTempWorkspace("moltbot-soul-");
|
||||
const tempDir = await makeTempWorkspace("openclaw-soul-");
|
||||
await writeWorkspaceFile({
|
||||
dir: tempDir,
|
||||
name: "SOUL_EVIL.md",
|
||||
content: "chaotic",
|
||||
});
|
||||
|
||||
const cfg: MoltbotConfig = {
|
||||
const cfg: OpenClawConfig = {
|
||||
hooks: {
|
||||
internal: {
|
||||
entries: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MoltbotConfig } from "../../../config/config.js";
|
||||
import type { OpenClawConfig } from "../../../config/config.js";
|
||||
import { isSubagentSessionKey } from "../../../routing/session-key.js";
|
||||
import { resolveHookConfig } from "../../config.js";
|
||||
import { isAgentBootstrapEvent, type HookHandler } from "../../hooks.js";
|
||||
@@ -11,7 +11,7 @@ const soulEvilHook: HookHandler = async (event) => {
|
||||
|
||||
const context = event.context;
|
||||
if (context.sessionKey && isSubagentSessionKey(context.sessionKey)) return;
|
||||
const cfg = context.cfg as MoltbotConfig | undefined;
|
||||
const cfg = context.cfg as OpenClawConfig | undefined;
|
||||
const hookConfig = resolveHookConfig(cfg, HOOK_KEY);
|
||||
if (!hookConfig || hookConfig.enabled === false) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user