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:
plum-dawg
2026-01-25 07:22:36 -05:00
committed by GitHub
parent 101d0f451f
commit c96ffa7186
85 changed files with 11365 additions and 60 deletions

View File

@@ -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,

View File

@@ -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;