Files
openclaw/extensions/line/src/runtime.ts
2026-07-13 23:54:12 -07:00

31 lines
1.4 KiB
TypeScript

// Line plugin module implements runtime behavior.
import type { PluginRuntime } from "openclaw/plugin-sdk/core";
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
type LineChannelRuntime = {
buildTemplateMessageFromPayload?: typeof import("./template-messages.js").buildTemplateMessageFromPayload;
createQuickReplyItems?: typeof import("./send.js").createQuickReplyItems;
monitorLineProvider?: typeof import("./monitor.js").monitorLineProvider;
pushFlexMessage?: typeof import("./send.js").pushFlexMessage;
pushLocationMessage?: typeof import("./send.js").pushLocationMessage;
pushMessageLine?: typeof import("./send.js").pushMessageLine;
pushMessagesLine?: typeof import("./send.js").pushMessagesLine;
pushTemplateMessage?: typeof import("./send.js").pushTemplateMessage;
pushTextMessageWithQuickReplies?: typeof import("./send.js").pushTextMessageWithQuickReplies;
resolveLineAccount?: typeof import("./accounts.js").resolveLineAccount;
sendMessageLine?: typeof import("./send.js").sendMessageLine;
};
type LineRuntime = PluginRuntime & {
channel: PluginRuntime["channel"] & {
line?: LineChannelRuntime;
};
};
const { setRuntime: setLineRuntime, getRuntime: getLineRuntime } =
createPluginRuntimeStore<LineRuntime>({
pluginId: "line",
errorMessage: "LINE runtime not initialized - plugin not registered",
});
export { getLineRuntime, setLineRuntime };