feat: Add Line plugin (#1630)
* feat: add LINE plugin (#1630) (thanks @plum-dawg) * feat: complete LINE plugin (#1630) (thanks @plum-dawg) * chore: drop line plugin node_modules (#1630) (thanks @plum-dawg) * test: mock /context report in commands test (#1630) (thanks @plum-dawg) * test: limit macOS CI workers to avoid OOM (#1630) (thanks @plum-dawg) * test: reduce macOS CI vitest workers (#1630) (thanks @plum-dawg) --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -125,6 +125,25 @@ import { sendMessageWhatsApp, sendPollWhatsApp } from "../../web/outbound.js";
|
||||
import { registerMemoryCli } from "../../cli/memory-cli.js";
|
||||
import { formatNativeDependencyHint } from "./native-deps.js";
|
||||
import { textToSpeechTelephony } from "../../tts/tts.js";
|
||||
import {
|
||||
listLineAccountIds,
|
||||
normalizeAccountId as normalizeLineAccountId,
|
||||
resolveDefaultLineAccountId,
|
||||
resolveLineAccount,
|
||||
} from "../../line/accounts.js";
|
||||
import { probeLineBot } from "../../line/probe.js";
|
||||
import {
|
||||
createQuickReplyItems,
|
||||
pushMessageLine,
|
||||
pushMessagesLine,
|
||||
pushFlexMessage,
|
||||
pushTemplateMessage,
|
||||
pushLocationMessage,
|
||||
pushTextMessageWithQuickReplies,
|
||||
sendMessageLine,
|
||||
} from "../../line/send.js";
|
||||
import { monitorLineProvider } from "../../line/monitor.js";
|
||||
import { buildTemplateMessageFromPayload } from "../../line/template-messages.js";
|
||||
|
||||
import type { PluginRuntime } from "./types.js";
|
||||
|
||||
@@ -299,6 +318,23 @@ export function createPluginRuntime(): PluginRuntime {
|
||||
handleWhatsAppAction,
|
||||
createLoginTool: createWhatsAppLoginTool,
|
||||
},
|
||||
line: {
|
||||
listLineAccountIds,
|
||||
resolveDefaultLineAccountId,
|
||||
resolveLineAccount,
|
||||
normalizeAccountId: normalizeLineAccountId,
|
||||
probeLineBot,
|
||||
sendMessageLine,
|
||||
pushMessageLine,
|
||||
pushMessagesLine,
|
||||
pushFlexMessage,
|
||||
pushTemplateMessage,
|
||||
pushLocationMessage,
|
||||
pushTextMessageWithQuickReplies,
|
||||
createQuickReplyItems,
|
||||
buildTemplateMessageFromPayload,
|
||||
monitorLineProvider,
|
||||
},
|
||||
},
|
||||
logging: {
|
||||
shouldLogVerbose,
|
||||
|
||||
@@ -148,6 +148,26 @@ type HandleWhatsAppAction =
|
||||
type CreateWhatsAppLoginTool =
|
||||
typeof import("../../channels/plugins/agent-tools/whatsapp-login.js").createWhatsAppLoginTool;
|
||||
|
||||
// LINE channel types
|
||||
type ListLineAccountIds = typeof import("../../line/accounts.js").listLineAccountIds;
|
||||
type ResolveDefaultLineAccountId =
|
||||
typeof import("../../line/accounts.js").resolveDefaultLineAccountId;
|
||||
type ResolveLineAccount = typeof import("../../line/accounts.js").resolveLineAccount;
|
||||
type NormalizeLineAccountId = typeof import("../../line/accounts.js").normalizeAccountId;
|
||||
type ProbeLineBot = typeof import("../../line/probe.js").probeLineBot;
|
||||
type SendMessageLine = typeof import("../../line/send.js").sendMessageLine;
|
||||
type PushMessageLine = typeof import("../../line/send.js").pushMessageLine;
|
||||
type PushMessagesLine = typeof import("../../line/send.js").pushMessagesLine;
|
||||
type PushFlexMessage = typeof import("../../line/send.js").pushFlexMessage;
|
||||
type PushTemplateMessage = typeof import("../../line/send.js").pushTemplateMessage;
|
||||
type PushLocationMessage = typeof import("../../line/send.js").pushLocationMessage;
|
||||
type PushTextMessageWithQuickReplies =
|
||||
typeof import("../../line/send.js").pushTextMessageWithQuickReplies;
|
||||
type CreateQuickReplyItems = typeof import("../../line/send.js").createQuickReplyItems;
|
||||
type BuildTemplateMessageFromPayload =
|
||||
typeof import("../../line/template-messages.js").buildTemplateMessageFromPayload;
|
||||
type MonitorLineProvider = typeof import("../../line/monitor.js").monitorLineProvider;
|
||||
|
||||
export type RuntimeLogger = {
|
||||
debug?: (message: string) => void;
|
||||
info: (message: string) => void;
|
||||
@@ -310,6 +330,23 @@ export type PluginRuntime = {
|
||||
handleWhatsAppAction: HandleWhatsAppAction;
|
||||
createLoginTool: CreateWhatsAppLoginTool;
|
||||
};
|
||||
line: {
|
||||
listLineAccountIds: ListLineAccountIds;
|
||||
resolveDefaultLineAccountId: ResolveDefaultLineAccountId;
|
||||
resolveLineAccount: ResolveLineAccount;
|
||||
normalizeAccountId: NormalizeLineAccountId;
|
||||
probeLineBot: ProbeLineBot;
|
||||
sendMessageLine: SendMessageLine;
|
||||
pushMessageLine: PushMessageLine;
|
||||
pushMessagesLine: PushMessagesLine;
|
||||
pushFlexMessage: PushFlexMessage;
|
||||
pushTemplateMessage: PushTemplateMessage;
|
||||
pushLocationMessage: PushLocationMessage;
|
||||
pushTextMessageWithQuickReplies: PushTextMessageWithQuickReplies;
|
||||
createQuickReplyItems: CreateQuickReplyItems;
|
||||
buildTemplateMessageFromPayload: BuildTemplateMessageFromPayload;
|
||||
monitorLineProvider: MonitorLineProvider;
|
||||
};
|
||||
};
|
||||
logging: {
|
||||
shouldLogVerbose: ShouldLogVerbose;
|
||||
|
||||
Reference in New Issue
Block a user