mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 12:07:40 +00:00
refactor: rename hooks docs and add tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: session-memory
|
||||
description: "Save session context to memory when /new command is issued"
|
||||
homepage: https://docs.clawd.bot/internal-hooks#session-memory
|
||||
homepage: https://docs.clawd.bot/hooks#session-memory
|
||||
metadata:
|
||||
{
|
||||
"clawdbot":
|
||||
|
||||
@@ -11,7 +11,7 @@ import os from "node:os";
|
||||
import type { ClawdbotConfig } from "../../../config/config.js";
|
||||
import { resolveAgentWorkspaceDir } from "../../../agents/agent-scope.js";
|
||||
import { resolveAgentIdFromSessionKey } from "../../../routing/session-key.js";
|
||||
import type { InternalHookHandler } from "../../internal-hooks.js";
|
||||
import type { HookHandler } from "../../hooks.js";
|
||||
|
||||
/**
|
||||
* Read recent messages from session file for slug generation
|
||||
@@ -57,7 +57,7 @@ async function getRecentSessionContent(sessionFilePath: string): Promise<string
|
||||
/**
|
||||
* Save session context to memory when /new command is triggered
|
||||
*/
|
||||
const saveSessionToMemory: InternalHookHandler = async (event) => {
|
||||
const saveSessionToMemory: HookHandler = async (event) => {
|
||||
// Only trigger on 'new' command
|
||||
if (event.type !== "command" || event.action !== "new") {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user