Files
openclaw/src/plugins/host-hook-turn-types.ts
EVA 1adaa28dc8 [plugin sdk] Add generic plugin host-hook contracts (#72287)
Merged via squash.

Prepared head SHA: 68e5f2ce19
Co-authored-by: 100yenadmin <239388517+100yenadmin@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-27 17:07:02 -07:00

50 lines
1.2 KiB
TypeScript

import type { AgentMessage } from "@mariozechner/pi-agent-core";
import type { PluginJsonValue } from "./host-hook-json.js";
export type PluginNextTurnInjectionPlacement = "prepend_context" | "append_context";
export type PluginNextTurnInjection = {
sessionKey: string;
text: string;
idempotencyKey?: string;
placement?: PluginNextTurnInjectionPlacement;
ttlMs?: number;
metadata?: PluginJsonValue;
};
export type PluginNextTurnInjectionRecord = Omit<PluginNextTurnInjection, "sessionKey"> & {
id: string;
pluginId: string;
pluginName?: string;
createdAt: number;
placement: PluginNextTurnInjectionPlacement;
};
export type PluginNextTurnInjectionEnqueueResult = {
enqueued: boolean;
id: string;
sessionKey: string;
};
export type PluginAgentTurnPrepareEvent = {
prompt: string;
messages: AgentMessage[] | unknown[];
queuedInjections: PluginNextTurnInjectionRecord[];
};
export type PluginAgentTurnPrepareResult = {
prependContext?: string;
appendContext?: string;
};
export type PluginHeartbeatPromptContributionEvent = {
sessionKey?: string;
agentId?: string;
heartbeatName?: string;
};
export type PluginHeartbeatPromptContributionResult = {
prependContext?: string;
appendContext?: string;
};