mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-07 20:22:54 +00:00
* refactor: extract gateway client package * chore: drop generated gateway package artifacts * refactor: move gateway protocol package * refactor: remove old gateway protocol tree * test: keep auth compat split in run mode * test: expose gateway wrapper options for internals * fix: watch moved gateway package sources * test: normalize slash command import guard * chore: teach knip gateway package entries * ci: route gateway client package checks * fix: reuse ipaddr for gateway client hosts * fix: sync gateway protocol usage schema
36 lines
1008 B
TypeScript
36 lines
1008 B
TypeScript
import type { SessionsPatchParams } from "../../packages/gateway-protocol/src/index.js";
|
|
import type { SessionEntry } from "../config/sessions.js";
|
|
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
|
import {
|
|
hasInternalHookListeners,
|
|
triggerInternalHook,
|
|
type SessionPatchHookContext,
|
|
type SessionPatchHookEvent,
|
|
} from "../hooks/internal-hooks.js";
|
|
|
|
export function triggerSessionPatchHook(params: {
|
|
cfg: OpenClawConfig;
|
|
sessionEntry: SessionEntry;
|
|
sessionKey: string;
|
|
patch: SessionsPatchParams;
|
|
}): void {
|
|
if (!hasInternalHookListeners("session", "patch")) {
|
|
return;
|
|
}
|
|
|
|
const hookContext: SessionPatchHookContext = structuredClone({
|
|
sessionEntry: params.sessionEntry,
|
|
patch: params.patch,
|
|
cfg: params.cfg,
|
|
});
|
|
const hookEvent: SessionPatchHookEvent = {
|
|
type: "session",
|
|
action: "patch",
|
|
sessionKey: params.sessionKey,
|
|
context: hookContext,
|
|
timestamp: new Date(),
|
|
messages: [],
|
|
};
|
|
void triggerInternalHook(hookEvent);
|
|
}
|