mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 05:54:43 +00:00
plugin-sdk: expose onAgentEvent + onSessionTranscriptUpdate via PluginRuntime.events
This commit is contained in:
committed by
Peter Steinberger
parent
3e6451f2d8
commit
980388fcf0
@@ -71,6 +71,7 @@ import { shouldLogVerbose } from "../../globals.js";
|
||||
import { monitorIMessageProvider } from "../../imessage/monitor.js";
|
||||
import { probeIMessage } from "../../imessage/probe.js";
|
||||
import { sendMessageIMessage } from "../../imessage/send.js";
|
||||
import { onAgentEvent } from "../../infra/agent-events.js";
|
||||
import { getChannelActivity, recordChannelActivity } from "../../infra/channel-activity.js";
|
||||
import { enqueueSystemEvent } from "../../infra/system-events.js";
|
||||
import {
|
||||
@@ -109,6 +110,7 @@ import {
|
||||
} from "../../pairing/pairing-store.js";
|
||||
import { runCommandWithTimeout } from "../../process/exec.js";
|
||||
import { resolveAgentRoute } from "../../routing/resolve-route.js";
|
||||
import { onSessionTranscriptUpdate } from "../../sessions/transcript-events.js";
|
||||
import { monitorSignalProvider } from "../../signal/index.js";
|
||||
import { probeSignal } from "../../signal/probe.js";
|
||||
import { sendMessageSignal } from "../../signal/send.js";
|
||||
@@ -248,6 +250,10 @@ export function createPluginRuntime(): PluginRuntime {
|
||||
stt: { transcribeAudioFile },
|
||||
tools: createRuntimeTools(),
|
||||
channel: createRuntimeChannel(),
|
||||
events: {
|
||||
onAgentEvent,
|
||||
onSessionTranscriptUpdate,
|
||||
},
|
||||
logging: createRuntimeLogging(),
|
||||
state: { resolveStateDir },
|
||||
};
|
||||
|
||||
@@ -92,6 +92,9 @@ type MediaKindFromMime = typeof import("../../media/constants.js").mediaKindFrom
|
||||
type IsVoiceCompatibleAudio = typeof import("../../media/audio.js").isVoiceCompatibleAudio;
|
||||
type GetImageMetadata = typeof import("../../media/image-ops.js").getImageMetadata;
|
||||
type ResizeToJpeg = typeof import("../../media/image-ops.js").resizeToJpeg;
|
||||
type OnAgentEvent = typeof import("../../infra/agent-events.js").onAgentEvent;
|
||||
type OnSessionTranscriptUpdate =
|
||||
typeof import("../../sessions/transcript-events.js").onSessionTranscriptUpdate;
|
||||
type CreateMemoryGetTool = typeof import("../../agents/tools/memory-tool.js").createMemoryGetTool;
|
||||
type CreateMemorySearchTool =
|
||||
typeof import("../../agents/tools/memory-tool.js").createMemorySearchTool;
|
||||
@@ -366,6 +369,10 @@ export type PluginRuntime = {
|
||||
monitorLineProvider: MonitorLineProvider;
|
||||
};
|
||||
};
|
||||
events: {
|
||||
onAgentEvent: OnAgentEvent;
|
||||
onSessionTranscriptUpdate: OnSessionTranscriptUpdate;
|
||||
};
|
||||
logging: {
|
||||
shouldLogVerbose: ShouldLogVerbose;
|
||||
getChildLogger: (
|
||||
|
||||
Reference in New Issue
Block a user