mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-30 11:40:19 +00:00
feat(plugins): expose requestHeartbeatNow on plugin runtime
Add requestHeartbeatNow to PluginRuntime.system so extensions can trigger an immediate heartbeat wake without importing internal modules. This enables extensions to inject a system event and wake the agent in one step — useful for inbound message handlers that use the heartbeat model (e.g. agent-to-agent DMs via Nostr). Changes: - src/plugins/runtime/types.ts: add RequestHeartbeatNow type alias and requestHeartbeatNow to PluginRuntime.system - src/plugins/runtime/index.ts: import and wire requestHeartbeatNow into createPluginRuntime()
This commit is contained in:
committed by
Peter Steinberger
parent
11e1363d2d
commit
40e5c6a18d
@@ -73,6 +73,7 @@ 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 { requestHeartbeatNow } from "../../infra/heartbeat-wake.js";
|
||||
import { enqueueSystemEvent } from "../../infra/system-events.js";
|
||||
import {
|
||||
listLineAccountIds,
|
||||
@@ -269,6 +270,7 @@ function createRuntimeConfig(): PluginRuntime["config"] {
|
||||
function createRuntimeSystem(): PluginRuntime["system"] {
|
||||
return {
|
||||
enqueueSystemEvent,
|
||||
requestHeartbeatNow,
|
||||
runCommandWithTimeout,
|
||||
formatNativeDependencyHint,
|
||||
};
|
||||
|
||||
@@ -84,6 +84,7 @@ type WriteConfigFile = typeof import("../../config/config.js").writeConfigFile;
|
||||
type RecordChannelActivity = typeof import("../../infra/channel-activity.js").recordChannelActivity;
|
||||
type GetChannelActivity = typeof import("../../infra/channel-activity.js").getChannelActivity;
|
||||
type EnqueueSystemEvent = typeof import("../../infra/system-events.js").enqueueSystemEvent;
|
||||
type RequestHeartbeatNow = typeof import("../../infra/heartbeat-wake.js").requestHeartbeatNow;
|
||||
type RunCommandWithTimeout = typeof import("../../process/exec.js").runCommandWithTimeout;
|
||||
type FormatNativeDependencyHint = typeof import("./native-deps.js").formatNativeDependencyHint;
|
||||
type LoadWebMedia = typeof import("../../web/media.js").loadWebMedia;
|
||||
@@ -198,6 +199,7 @@ export type PluginRuntime = {
|
||||
};
|
||||
system: {
|
||||
enqueueSystemEvent: EnqueueSystemEvent;
|
||||
requestHeartbeatNow: RequestHeartbeatNow;
|
||||
runCommandWithTimeout: RunCommandWithTimeout;
|
||||
formatNativeDependencyHint: FormatNativeDependencyHint;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user