@openclaw/line 2026.11.5-beta.1 → 2026.11.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{accounts-Dm_NoU7R.mjs → accounts-DOiM8-y3.mjs} +2 -1
- package/dist/.setup/api-4BpGVN1-.mjs +3 -0
- package/dist/.setup/{api-ByXjHPMe.mjs → api-BRnngy5R.mjs} +4 -3
- package/dist/.setup/{card-command-utjlRvb-.mjs → card-command-2y-RSLPg.mjs} +4 -3
- package/dist/.setup/{channel-D9i_xlsJ.mjs → channel-DJcpjKpx.mjs} +33 -21
- package/dist/.setup/{channel.runtime-C-E2qsIu.mjs → channel.runtime-CdfKsNz4.mjs} +3 -3
- package/dist/.setup/{monitor-BYGe2Y7S.mjs → monitor-BkuPFFxZ.mjs} +32 -20
- package/dist/.setup/{outbound.runtime-AQvUJvJV.mjs → outbound.runtime-BPo_111h.mjs} +2 -2
- package/dist/.setup/{runtime-C9ldw-V4.mjs → runtime-V7yh9OeC.mjs} +2 -1
- package/dist/.setup/{send-H86JOXWw.mjs → send-C1JZOFMA.mjs} +6 -4
- package/dist/.setup/{send-retry-D6J7bThI.mjs → send-retry-Bf2Xr6ZN.mjs} +27 -14
- package/dist/.setup/{setup-surface-DvbBjHFi.mjs → setup-surface-CYd8oqzt.mjs} +9 -5
- package/dist/.setup/{template-messages-KG1GwG0h.mjs → template-messages-C1Kkr0-e.mjs} +9 -5
- package/dist/.setup/{webhook-spool-contract-COhQK5XQ.mjs → webhook-spool-contract-msjTl60Q.mjs} +2 -1
- package/dist/.source-module-urls/2c97352967966b7ab9f67f528eb25c098b6fe10ea0e4616ffae3851ed839d81e.json +1 -1
- package/dist/api.js +2 -2
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/doctor-contract-api.js +5 -3
- package/dist/index.js +3 -2
- package/dist/runtime-api.js +1 -1
- package/dist/secret-contract-api.js +2 -1
- package/dist/setup-api.js +1 -1
- package/dist/setup-entry.js +3 -2
- package/package.json +4 -4
- package/dist/.setup/api-DCMpIrda.mjs +0 -3
|
@@ -2,7 +2,7 @@ import { createAccountListHelpers } from "openclaw/plugin-sdk/account-helpers";
|
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId, normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
3
|
import { resolveAccountEntry, resolveListedDefaultAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
4
4
|
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/secret-file-runtime";
|
|
5
|
-
|
|
5
|
+
//#region extensions/line/src/accounts.ts
|
|
6
6
|
const { resolveAccountConfig: resolveMergedLineAccountConfig } = createAccountListHelpers("line", { omitKeys: ["defaultAccount"] });
|
|
7
7
|
function resolveLineCredential(params) {
|
|
8
8
|
const { accountId, baseConfig, accountConfig, credentialKey, fileKey, envKey } = params;
|
|
@@ -97,4 +97,5 @@ function resolveDefaultLineAccountId(cfg) {
|
|
|
97
97
|
normalizeListedAccountId: normalizeAccountId
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
+
//#endregion
|
|
100
101
|
export { resolveDefaultLineAccountId as n, resolveLineAccount as r, listLineAccountIds as t };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-
|
|
2
|
-
import { l as lineChannelPluginCommon } from "./channel-
|
|
3
|
-
|
|
1
|
+
import { r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-CYd8oqzt.mjs";
|
|
2
|
+
import { l as lineChannelPluginCommon } from "./channel-DJcpjKpx.mjs";
|
|
3
|
+
//#region extensions/line/src/channel.setup.ts
|
|
4
4
|
const lineSetupPlugin = {
|
|
5
5
|
id: "line",
|
|
6
6
|
...lineChannelPluginCommon,
|
|
7
7
|
setupWizard: lineSetupWizard,
|
|
8
8
|
setupContract: lineSetupContract
|
|
9
9
|
};
|
|
10
|
+
//#endregion
|
|
10
11
|
export { lineSetupPlugin as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { d as createActionCard, f as createImageCard, m as createListCard, p as createInfoCard, u as createReceiptCard } from "./send-retry-
|
|
2
|
-
import { t as createFlexMessage } from "./send-
|
|
1
|
+
import { d as createActionCard, f as createImageCard, m as createListCard, p as createInfoCard, u as createReceiptCard } from "./send-retry-Bf2Xr6ZN.mjs";
|
|
2
|
+
import { t as createFlexMessage } from "./send-C1JZOFMA.mjs";
|
|
3
3
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
5
|
-
|
|
5
|
+
//#region extensions/line/src/card-command.ts
|
|
6
6
|
const CARD_USAGE = `Usage: /card <type> "title" "body" [options]
|
|
7
7
|
|
|
8
8
|
Types:
|
|
@@ -214,4 +214,5 @@ async function handleLineCardCommand(argsInput) {
|
|
|
214
214
|
return { text: `Error creating card: ${String(err)}` };
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
+
//#endregion
|
|
217
218
|
export { handleLineCardCommand };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as reportLineQuoteCarrierMissing, D as canCarryLineQuoteToken, F as normalizeLineMessagingTarget, N as buildLineMediaMessage, P as inferLineTargetChatType, S as truncateLineActionLabel, _ as createCardBubble, c as createAgendaCard, d as createActionCard, g as cardText, h as cardBox, j as resolveLineQuoteToken, l as createEventCard, t as explainLineRefusal, v as createCardTitle, w as fitsLineFlexBubble, x as postbackAction, y as messageAction } from "./send-retry-
|
|
2
|
-
import { n as resolveDefaultLineAccountId, r as resolveLineAccount, t as listLineAccountIds } from "./accounts-
|
|
3
|
-
import { a as normalizeLineAllowEntry, i as hasLineCredentials, r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-
|
|
4
|
-
import { t as getLineRuntime } from "./runtime-
|
|
1
|
+
import { A as reportLineQuoteCarrierMissing, D as canCarryLineQuoteToken, F as normalizeLineMessagingTarget, N as buildLineMediaMessage, P as inferLineTargetChatType, S as truncateLineActionLabel, _ as createCardBubble, c as createAgendaCard, d as createActionCard, g as cardText, h as cardBox, j as resolveLineQuoteToken, l as createEventCard, t as explainLineRefusal, v as createCardTitle, w as fitsLineFlexBubble, x as postbackAction, y as messageAction } from "./send-retry-Bf2Xr6ZN.mjs";
|
|
2
|
+
import { n as resolveDefaultLineAccountId, r as resolveLineAccount, t as listLineAccountIds } from "./accounts-DOiM8-y3.mjs";
|
|
3
|
+
import { a as normalizeLineAllowEntry, i as hasLineCredentials, r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-CYd8oqzt.mjs";
|
|
4
|
+
import { t as getLineRuntime } from "./runtime-V7yh9OeC.mjs";
|
|
5
5
|
import { buildDmGroupAccountAllowlistAdapter, createFlatAllowlistOverrideResolver } from "openclaw/plugin-sdk/allowlist-config-edit";
|
|
6
6
|
import { buildChannelOutboundSessionRoute, createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
7
7
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
@@ -26,7 +26,7 @@ import { resolveAskUserQuestionOptionIndex, resolveAskUserQuestionOptionIndices,
|
|
|
26
26
|
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
27
27
|
import { normalizeMessagePresentation, renderMessagePresentationFallbackText, renderPresentationForDelivery, resolveMessagePresentationButtonAction, resolveMessagePresentationOptionAction } from "openclaw/plugin-sdk/interactive-runtime";
|
|
28
28
|
import { Type } from "typebox";
|
|
29
|
-
|
|
29
|
+
//#region extensions/line/src/config-adapter.ts
|
|
30
30
|
const lineConfigAdapter = createScopedChannelConfigAdapter({
|
|
31
31
|
sectionKey: "line",
|
|
32
32
|
listAccountIds: listLineAccountIds,
|
|
@@ -45,7 +45,8 @@ const lineConfigAdapter = createScopedChannelConfigAdapter({
|
|
|
45
45
|
resolveAllowFrom: (account) => account.config.allowFrom,
|
|
46
46
|
formatAllowFrom: (allowFrom) => normalizeStringEntries(allowFrom).map(normalizeLineAllowEntry)
|
|
47
47
|
});
|
|
48
|
-
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region extensions/line/src/config-schema.ts
|
|
49
50
|
const ThreadBindingsSchema = z.object({
|
|
50
51
|
enabled: z.boolean().optional(),
|
|
51
52
|
idleHours: z.number().optional(),
|
|
@@ -136,7 +137,8 @@ const lineChannelPluginCommon = {
|
|
|
136
137
|
})
|
|
137
138
|
}
|
|
138
139
|
};
|
|
139
|
-
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region extensions/line/src/group-keys.ts
|
|
140
142
|
function resolveLineGroupLookupIds(groupId) {
|
|
141
143
|
const normalized = groupId?.trim();
|
|
142
144
|
if (!normalized) return [];
|
|
@@ -167,7 +169,8 @@ function resolveExactLineGroupConfigKey(params) {
|
|
|
167
169
|
if (!groups) return;
|
|
168
170
|
return resolveLineGroupLookupIds(params.groupId).find((candidate) => Object.hasOwn(groups, candidate));
|
|
169
171
|
}
|
|
170
|
-
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region extensions/line/src/doctor.ts
|
|
171
174
|
const GROUP_DEFAULTS_KEY = "*";
|
|
172
175
|
function classifyAllowFrom(values) {
|
|
173
176
|
const entries = Array.isArray(values) ? values.map(normalizeLineAllowEntry).filter(Boolean) : [];
|
|
@@ -259,7 +262,8 @@ const lineDoctor = {
|
|
|
259
262
|
return covered || referenceBacked.length > 0;
|
|
260
263
|
}
|
|
261
264
|
};
|
|
262
|
-
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region extensions/line/src/status.ts
|
|
263
267
|
const collectLineCredentialIssues = createDependentCredentialStatusIssueCollector({
|
|
264
268
|
channel: "line",
|
|
265
269
|
dependencySourceKey: "tokenSource",
|
|
@@ -311,7 +315,7 @@ const lineStatusAdapter = createComputedAccountStatusAdapter({
|
|
|
311
315
|
}
|
|
312
316
|
})],
|
|
313
317
|
buildChannelSummary: ({ snapshot }) => buildTokenChannelStatusSummary(snapshot),
|
|
314
|
-
probeAccount: async ({ account, timeoutMs }) => await (await import("./send-retry-
|
|
318
|
+
probeAccount: async ({ account, timeoutMs }) => await (await import("./send-retry-Bf2Xr6ZN.mjs").then((n) => n.o)).probeLineBot(account.channelAccessToken, timeoutMs),
|
|
315
319
|
resolveAccountSnapshot: ({ account, probe }) => ({
|
|
316
320
|
accountId: account.accountId,
|
|
317
321
|
name: account.name,
|
|
@@ -327,7 +331,8 @@ const lineStatusAdapter = createComputedAccountStatusAdapter({
|
|
|
327
331
|
}
|
|
328
332
|
})
|
|
329
333
|
});
|
|
330
|
-
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region extensions/line/src/gateway.ts
|
|
331
336
|
const lineGatewayAdapter = {
|
|
332
337
|
startAccount: async (ctx) => {
|
|
333
338
|
const account = ctx.account;
|
|
@@ -342,7 +347,7 @@ const lineGatewayAdapter = {
|
|
|
342
347
|
statusSink({ lifecycle: "starting" });
|
|
343
348
|
let lineBotLabel = "";
|
|
344
349
|
try {
|
|
345
|
-
const probe = await (await import("./send-retry-
|
|
350
|
+
const probe = await (await import("./send-retry-Bf2Xr6ZN.mjs").then((n) => n.o)).probeLineBot(token, 2500);
|
|
346
351
|
const displayName = probe.ok ? probe.bot?.displayName?.trim() : null;
|
|
347
352
|
if (displayName) lineBotLabel = ` (${displayName})`;
|
|
348
353
|
const delivery = describeLineWebhookDelivery({ webhook: probe.ok ? probe.webhook : void 0 });
|
|
@@ -351,7 +356,7 @@ const lineGatewayAdapter = {
|
|
|
351
356
|
if (getLineRuntime().logging.shouldLogVerbose()) ctx.log?.debug?.(`[${account.accountId}] bot check failed: ${String(err)}`);
|
|
352
357
|
}
|
|
353
358
|
ctx.log?.info(`[${account.accountId}] starting LINE provider${lineBotLabel}`);
|
|
354
|
-
const { monitorLineProvider } = await import("./monitor-
|
|
359
|
+
const { monitorLineProvider } = await import("./monitor-BkuPFFxZ.mjs");
|
|
355
360
|
return await monitorLineProvider({
|
|
356
361
|
channelAccessToken: token,
|
|
357
362
|
channelSecret: secret,
|
|
@@ -393,13 +398,15 @@ const lineGatewayAdapter = {
|
|
|
393
398
|
};
|
|
394
399
|
}
|
|
395
400
|
};
|
|
396
|
-
|
|
401
|
+
//#endregion
|
|
402
|
+
//#region extensions/line/src/quick-reply-fallback.ts
|
|
397
403
|
function buildLineQuickReplyFallbackText(labels) {
|
|
398
404
|
const normalized = normalizeStringEntries(labels).slice(0, 13);
|
|
399
405
|
if (normalized.length === 0) return "Choose an option.";
|
|
400
406
|
return `Options:\n${normalized.map((label) => `- ${label}`).join("\n")}`;
|
|
401
407
|
}
|
|
402
|
-
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region extensions/line/src/question-postback.ts
|
|
403
410
|
const QUESTION_ID_PARAM = "line.question";
|
|
404
411
|
const OPTION_INDEX_PARAM = "line.option";
|
|
405
412
|
const POSTBACK_DATA_MAX_BYTES = 300;
|
|
@@ -455,7 +462,8 @@ async function resolveLineQuestionPostback(params) {
|
|
|
455
462
|
return { status: "failed" };
|
|
456
463
|
}
|
|
457
464
|
}
|
|
458
|
-
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region extensions/line/src/rich-message-schema.ts
|
|
459
467
|
const nonempty = () => Type.String({ minLength: 1 });
|
|
460
468
|
const closed = (properties) => Type.Object(properties, { additionalProperties: false });
|
|
461
469
|
const lineCardSchema = Type.Union([
|
|
@@ -526,7 +534,8 @@ const lineChannelDataSchema = Type.Optional(closed({ line: closed({
|
|
|
526
534
|
durationMs: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
527
535
|
trackingId: Type.Optional(nonempty())
|
|
528
536
|
}) }));
|
|
529
|
-
|
|
537
|
+
//#endregion
|
|
538
|
+
//#region extensions/line/src/rich-messages.ts
|
|
530
539
|
const lineMessageActions = {
|
|
531
540
|
describeMessageTool: ({ cfg, accountId }) => {
|
|
532
541
|
const account = resolveLineAccount({
|
|
@@ -909,8 +918,9 @@ function createLineQuickReply(items) {
|
|
|
909
918
|
action: item.action.type === "command" ? messageAction(item.label, item.action.command) : postbackAction(item.label, item.action.value, item.label)
|
|
910
919
|
})) };
|
|
911
920
|
}
|
|
912
|
-
|
|
913
|
-
|
|
921
|
+
//#endregion
|
|
922
|
+
//#region extensions/line/src/outbound.ts
|
|
923
|
+
const loadLineOutboundRuntime = createLazyRuntimeModule(() => import("./outbound.runtime-BPo_111h.mjs"));
|
|
914
924
|
function quotedOption(quoteToken) {
|
|
915
925
|
return quoteToken ? { quoteToken } : {};
|
|
916
926
|
}
|
|
@@ -1153,8 +1163,9 @@ const lineMessageAdapter = createChannelMessageAdapterFromOutbound({
|
|
|
1153
1163
|
supportedAckPolicies: ["after_receive_record"]
|
|
1154
1164
|
}
|
|
1155
1165
|
});
|
|
1156
|
-
|
|
1157
|
-
|
|
1166
|
+
//#endregion
|
|
1167
|
+
//#region extensions/line/src/channel.ts
|
|
1168
|
+
const loadLineChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-CdfKsNz4.mjs"));
|
|
1158
1169
|
const lineSecurityAdapter = createRestrictSendersChannelSecurity({
|
|
1159
1170
|
channelKey: "line",
|
|
1160
1171
|
resolveDmPolicy: (account) => account.config.dmPolicy,
|
|
@@ -1351,4 +1362,5 @@ const linePlugin = createChatChannelPlugin({
|
|
|
1351
1362
|
} },
|
|
1352
1363
|
outbound: lineOutboundAdapter
|
|
1353
1364
|
});
|
|
1365
|
+
//#endregion
|
|
1354
1366
|
export { parseLineQuestionPostbackData as a, resolveLineGroupConfigEntry as c, isLineQuestionPostbackData as i, lineChannelPluginCommon as l, createLineQuickReply as n, resolveLineQuestionPostback as o, prepareLineReplyPayload as r, buildLineQuickReplyFallbackText as s, linePlugin as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as probeLineBot } from "./send-retry-
|
|
2
|
-
import { l as pushMessageLine, m as showLoadingAnimation } from "./send-
|
|
3
|
-
import { monitorLineProvider } from "./monitor-
|
|
1
|
+
import { a as probeLineBot } from "./send-retry-Bf2Xr6ZN.mjs";
|
|
2
|
+
import { l as pushMessageLine, m as showLoadingAnimation } from "./send-C1JZOFMA.mjs";
|
|
3
|
+
import { monitorLineProvider } from "./monitor-BkuPFFxZ.mjs";
|
|
4
4
|
export { monitorLineProvider, probeLineBot, pushMessageLine, showLoadingAnimation };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as reportLineQuoteCarrierMissing, D as canCarryLineQuoteToken, E as applyLineQuoteToken, N as buildLineMediaMessage, O as readLineQuoteToken, j as resolveLineQuoteToken, k as recordLineQuoteToken, n as findLineHttpError, r as resolveLineNonDispatchRetryable, t as explainLineRefusal } from "./send-retry-
|
|
2
|
-
import { n as resolveDefaultLineAccountId, r as resolveLineAccount } from "./accounts-
|
|
3
|
-
import { a as normalizeLineAllowEntry } from "./setup-surface-
|
|
4
|
-
import { a as parseLineQuestionPostbackData, c as resolveLineGroupConfigEntry, i as isLineQuestionPostbackData, n as createLineQuickReply, o as resolveLineQuestionPostback, r as prepareLineReplyPayload, s as buildLineQuickReplyFallbackText } from "./channel-
|
|
5
|
-
import { t as getLineRuntime } from "./runtime-
|
|
6
|
-
import { a as laneKeyFor, i as eventIdFor, n as LINE_WEBHOOK_SPOOL_INVALID_PAYLOAD_MESSAGE, r as LineWebhookPayloadError, t as LINE_WEBHOOK_SPOOL_INVALID_EVENT_REASON } from "./webhook-spool-contract-
|
|
7
|
-
import { a as getUserDisplayName, h as quotesLineBotMessage, i as getLineGroupName, l as pushMessageLine, m as showLoadingAnimation, n as createLocationMessage, o as getUserProfile, p as replyMessageLine, t as createFlexMessage, u as pushMessagesLine } from "./send-
|
|
8
|
-
import { n as processLineMessage, t as buildTemplateMessageFromPayload } from "./template-messages-
|
|
1
|
+
import { A as reportLineQuoteCarrierMissing, D as canCarryLineQuoteToken, E as applyLineQuoteToken, N as buildLineMediaMessage, O as readLineQuoteToken, j as resolveLineQuoteToken, k as recordLineQuoteToken, n as findLineHttpError, r as resolveLineNonDispatchRetryable, t as explainLineRefusal } from "./send-retry-Bf2Xr6ZN.mjs";
|
|
2
|
+
import { n as resolveDefaultLineAccountId, r as resolveLineAccount } from "./accounts-DOiM8-y3.mjs";
|
|
3
|
+
import { a as normalizeLineAllowEntry } from "./setup-surface-CYd8oqzt.mjs";
|
|
4
|
+
import { a as parseLineQuestionPostbackData, c as resolveLineGroupConfigEntry, i as isLineQuestionPostbackData, n as createLineQuickReply, o as resolveLineQuestionPostback, r as prepareLineReplyPayload, s as buildLineQuickReplyFallbackText } from "./channel-DJcpjKpx.mjs";
|
|
5
|
+
import { t as getLineRuntime } from "./runtime-V7yh9OeC.mjs";
|
|
6
|
+
import { a as laneKeyFor, i as eventIdFor, n as LINE_WEBHOOK_SPOOL_INVALID_PAYLOAD_MESSAGE, r as LineWebhookPayloadError, t as LINE_WEBHOOK_SPOOL_INVALID_EVENT_REASON } from "./webhook-spool-contract-msjTl60Q.mjs";
|
|
7
|
+
import { a as getUserDisplayName, h as quotesLineBotMessage, i as getLineGroupName, l as pushMessageLine, m as showLoadingAnimation, n as createLocationMessage, o as getUserProfile, p as replyMessageLine, t as createFlexMessage, u as pushMessagesLine } from "./send-C1JZOFMA.mjs";
|
|
8
|
+
import { n as processLineMessage, t as buildTemplateMessageFromPayload } from "./template-messages-C1Kkr0-e.mjs";
|
|
9
9
|
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
|
10
10
|
import { resolveChannelGroupsConfigPath } from "openclaw/plugin-sdk/channel-policy";
|
|
11
11
|
import { normalizeOptionalString, normalizeStringEntries, readNonEmptyStringPreservingWhitespace } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -45,7 +45,7 @@ import { raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
|
45
45
|
import { enqueueKeyedTask } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
46
46
|
import { sendJsonWithoutCharset } from "openclaw/plugin-sdk/http-response-runtime";
|
|
47
47
|
import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
48
|
-
|
|
48
|
+
//#region extensions/line/src/auto-reply-delivery.ts
|
|
49
49
|
function toLineDeliveryError(error) {
|
|
50
50
|
return error instanceof Error ? error : new Error("LINE message send failed", { cause: error });
|
|
51
51
|
}
|
|
@@ -229,7 +229,8 @@ async function deliverLineAutoReply(params) {
|
|
|
229
229
|
visibleReplySent
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region extensions/line/src/mentions.ts
|
|
233
234
|
function getLineMentionees(message) {
|
|
234
235
|
return message.type === "text" ? message.mention?.mentionees ?? [] : [];
|
|
235
236
|
}
|
|
@@ -266,7 +267,8 @@ function resolveLineMentionStrippedText(message) {
|
|
|
266
267
|
}
|
|
267
268
|
return `${stripped}${text.slice(cursor)}`.trim();
|
|
268
269
|
}
|
|
269
|
-
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region extensions/line/src/bot-message-context.ts
|
|
270
272
|
function getLineSourceInfo(source) {
|
|
271
273
|
if (!source) return {
|
|
272
274
|
userId: void 0,
|
|
@@ -626,7 +628,8 @@ async function buildLinePostbackContext(params) {
|
|
|
626
628
|
media: []
|
|
627
629
|
});
|
|
628
630
|
}
|
|
629
|
-
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region extensions/line/src/download.ts
|
|
630
633
|
const CONTENT_READY_MAX_ATTEMPTS = 6;
|
|
631
634
|
const CONTENT_READY_BASE_DELAY_MS = 500;
|
|
632
635
|
const CONTENT_READY_MAX_DELAY_MS = 4e3;
|
|
@@ -726,7 +729,8 @@ async function downloadLineMedia(messageId, channelAccessToken, maxBytes = 10485
|
|
|
726
729
|
clearTimeout(deadline);
|
|
727
730
|
}
|
|
728
731
|
}
|
|
729
|
-
|
|
732
|
+
//#endregion
|
|
733
|
+
//#region extensions/line/src/group-history.ts
|
|
730
734
|
const reservedEntries = /* @__PURE__ */ new WeakSet();
|
|
731
735
|
function reserveLineGroupHistory(historyMap, historyKey, limit) {
|
|
732
736
|
if (!historyMap || !historyKey || limit <= 0) return {
|
|
@@ -760,7 +764,8 @@ function reserveLineGroupHistory(historyMap, historyKey, limit) {
|
|
|
760
764
|
}
|
|
761
765
|
};
|
|
762
766
|
}
|
|
763
|
-
|
|
767
|
+
//#endregion
|
|
768
|
+
//#region extensions/line/src/bot-handlers.ts
|
|
764
769
|
const LINE_DOWNLOADABLE_MESSAGE_TYPES = /* @__PURE__ */ new Set([
|
|
765
770
|
"image",
|
|
766
771
|
"video",
|
|
@@ -1214,7 +1219,8 @@ async function handleLineWebhookEvents(events, context) {
|
|
|
1214
1219
|
throw toErrorObject(err, "Non-Error thrown");
|
|
1215
1220
|
}
|
|
1216
1221
|
}
|
|
1217
|
-
|
|
1222
|
+
//#endregion
|
|
1223
|
+
//#region extensions/line/src/inbound-image-set.ts
|
|
1218
1224
|
const IMAGE_SET_FLUSH_DELAY_MS = 4e3;
|
|
1219
1225
|
function orderedParts(pending) {
|
|
1220
1226
|
return [...pending.parts.values()].toSorted((left, right) => (left.index ?? Number.MAX_SAFE_INTEGER) - (right.index ?? Number.MAX_SAFE_INTEGER) || left.arrivedAt - right.arrivedAt);
|
|
@@ -1305,7 +1311,8 @@ function createLineImageSetIngressBuffer() {
|
|
|
1305
1311
|
isBusy: (laneKey) => laneChain.has(laneKey)
|
|
1306
1312
|
};
|
|
1307
1313
|
}
|
|
1308
|
-
|
|
1314
|
+
//#endregion
|
|
1315
|
+
//#region extensions/line/src/webhook-spool.ts
|
|
1309
1316
|
const LINE_WEBHOOK_DRAIN_INTERVAL_MS = 500;
|
|
1310
1317
|
const LINE_WEBHOOK_MAX_CONCURRENT_DELIVERIES = 8;
|
|
1311
1318
|
const LINE_WEBHOOK_DRAIN_SCAN_LIMIT = 100;
|
|
@@ -1528,7 +1535,8 @@ function createLineWebhookSpool(options) {
|
|
|
1528
1535
|
}
|
|
1529
1536
|
};
|
|
1530
1537
|
}
|
|
1531
|
-
|
|
1538
|
+
//#endregion
|
|
1539
|
+
//#region extensions/line/src/bot.ts
|
|
1532
1540
|
const DEFAULT_MEDIA_MAX_MB = 10;
|
|
1533
1541
|
function createLineBot(opts) {
|
|
1534
1542
|
const { runtime, config: startupConfig } = opts;
|
|
@@ -1573,12 +1581,14 @@ function createLineBot(opts) {
|
|
|
1573
1581
|
stop: spool.stop
|
|
1574
1582
|
};
|
|
1575
1583
|
}
|
|
1576
|
-
|
|
1584
|
+
//#endregion
|
|
1585
|
+
//#region extensions/line/src/signature.ts
|
|
1577
1586
|
function validateLineSignature(body, signature, channelSecret) {
|
|
1578
1587
|
const hash = crypto.createHmac("SHA256", channelSecret).update(body).digest("base64");
|
|
1579
1588
|
return safeEqualSecret(signature, hash);
|
|
1580
1589
|
}
|
|
1581
|
-
|
|
1590
|
+
//#endregion
|
|
1591
|
+
//#region extensions/line/src/webhook-node.ts
|
|
1582
1592
|
const LINE_WEBHOOK_PREAUTH_MAX_BODY_BYTES = 65536;
|
|
1583
1593
|
const LINE_WEBHOOK_PREAUTH_BODY_TIMEOUT_MS = 5e3;
|
|
1584
1594
|
function createLineNodeWebhookHandler(params) {
|
|
@@ -1648,7 +1658,8 @@ function createLineNodeWebhookHandler(params) {
|
|
|
1648
1658
|
}
|
|
1649
1659
|
};
|
|
1650
1660
|
}
|
|
1651
|
-
|
|
1661
|
+
//#endregion
|
|
1662
|
+
//#region extensions/line/src/monitor.ts
|
|
1652
1663
|
const lineWebhookInFlightLimiter = createWebhookInFlightLimiter();
|
|
1653
1664
|
const lineWebhookTargets = /* @__PURE__ */ new Map();
|
|
1654
1665
|
async function monitorLineProvider(opts) {
|
|
@@ -1848,4 +1859,5 @@ async function monitorLineProvider(opts) {
|
|
|
1848
1859
|
}
|
|
1849
1860
|
};
|
|
1850
1861
|
}
|
|
1862
|
+
//#endregion
|
|
1851
1863
|
export { monitorLineProvider };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { c as pushLocationMessage, d as pushTemplateMessage, f as pushTextMessageWithQuickReplies, l as pushMessageLine, n as createLocationMessage, r as createQuickReplyItems, s as pushFlexMessage, t as createFlexMessage, u as pushMessagesLine } from "./send-
|
|
2
|
-
import { n as processLineMessage, t as buildTemplateMessageFromPayload } from "./template-messages-
|
|
1
|
+
import { c as pushLocationMessage, d as pushTemplateMessage, f as pushTextMessageWithQuickReplies, l as pushMessageLine, n as createLocationMessage, r as createQuickReplyItems, s as pushFlexMessage, t as createFlexMessage, u as pushMessagesLine } from "./send-C1JZOFMA.mjs";
|
|
2
|
+
import { n as processLineMessage, t as buildTemplateMessageFromPayload } from "./template-messages-C1Kkr0-e.mjs";
|
|
3
3
|
export { buildTemplateMessageFromPayload, createFlexMessage, createLocationMessage, createQuickReplyItems, processLineMessage, pushFlexMessage, pushLocationMessage, pushMessageLine, pushMessagesLine, pushTemplateMessage, pushTextMessageWithQuickReplies };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
|
-
|
|
2
|
+
//#region extensions/line/src/runtime.ts
|
|
3
3
|
const { setRuntime: setLineRuntime, getRuntime: getLineRuntime } = createPluginRuntimeStore({
|
|
4
4
|
pluginId: "line",
|
|
5
5
|
errorMessage: "LINE runtime not initialized - plugin not registered"
|
|
6
6
|
});
|
|
7
|
+
//#endregion
|
|
7
8
|
export { setLineRuntime as n, getLineRuntime as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as applyLineQuoteToken, F as normalizeLineMessagingTarget, M as withoutLineQuoteTokens, N as buildLineMediaMessage, b as normalizeLineMessage, i as runLinePushWithRetries, n as findLineHttpError, s as resolveLineChannelAccessToken, y as messageAction } from "./send-retry-
|
|
2
|
-
import { r as resolveLineAccount } from "./accounts-
|
|
1
|
+
import { E as applyLineQuoteToken, F as normalizeLineMessagingTarget, M as withoutLineQuoteTokens, N as buildLineMediaMessage, b as normalizeLineMessage, i as runLinePushWithRetries, n as findLineHttpError, s as resolveLineChannelAccessToken, y as messageAction } from "./send-retry-Bf2Xr6ZN.mjs";
|
|
2
|
+
import { r as resolveLineAccount } from "./accounts-DOiM8-y3.mjs";
|
|
3
3
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
4
4
|
import { createChannelPartialDeliveryError } from "openclaw/plugin-sdk/channel-inbound";
|
|
5
5
|
import { createStaleWhileRevalidateCache } from "openclaw/plugin-sdk/collection-runtime";
|
|
@@ -15,7 +15,7 @@ import { captureEffectAuthority } from "openclaw/plugin-sdk/fetch-runtime";
|
|
|
15
15
|
import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
16
16
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
17
17
|
import { createDedupeCache } from "openclaw/plugin-sdk/dedupe-runtime";
|
|
18
|
-
|
|
18
|
+
//#region extensions/line/src/outbound-message-log.ts
|
|
19
19
|
const RECENT_SENT_LIMIT = 500;
|
|
20
20
|
const recentSentByAccount = /* @__PURE__ */ new Map();
|
|
21
21
|
function recentSentFor(accountId) {
|
|
@@ -36,7 +36,8 @@ function recordLineSentMessages(accountId, messageIds) {
|
|
|
36
36
|
function quotesLineBotMessage(accountId, quotedMessageId) {
|
|
37
37
|
return recentSentByAccount.get(accountId)?.peek(quotedMessageId) ?? false;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region extensions/line/src/send.ts
|
|
40
41
|
const PROFILE_CACHE_TTL_MS = 3e5;
|
|
41
42
|
const PROFILE_CACHE_MAX_ENTRIES = 1e3;
|
|
42
43
|
const profileCache = createStaleWhileRevalidateCache({
|
|
@@ -332,4 +333,5 @@ async function getLineGroupName(groupId, opts) {
|
|
|
332
333
|
return;
|
|
333
334
|
}
|
|
334
335
|
}
|
|
336
|
+
//#endregion
|
|
335
337
|
export { getUserDisplayName as a, pushLocationMessage as c, pushTemplateMessage as d, pushTextMessageWithQuickReplies as f, quotesLineBotMessage as h, getLineGroupName as i, pushMessageLine as l, showLoadingAnimation as m, createLocationMessage as n, getUserProfile as o, replyMessageLine as p, createQuickReplyItems as r, pushFlexMessage as s, createFlexMessage as t, pushMessagesLine as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as resolveDefaultLineAccountId, r as resolveLineAccount } from "./accounts-
|
|
1
|
+
import { n as resolveDefaultLineAccountId, r as resolveLineAccount } from "./accounts-DOiM8-y3.mjs";
|
|
2
2
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
3
|
import { asSafeIntegerInRange, hasNonEmptyString, isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { collectErrorGraphCandidates, extractErrorCode, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -11,7 +11,7 @@ import { HTTPFetchError } from "@line/bot-sdk";
|
|
|
11
11
|
import { classifyTransientNetworkErrorCode, createChannelApiRetryRunner } from "openclaw/plugin-sdk/retry-runtime";
|
|
12
12
|
import { assertOkOrThrowHttpError, createProviderOperationDeadline, createProviderOperationTimeoutResolver, fetchWithTimeout, readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
|
|
13
13
|
import { fetchWithRuntimeDispatcherOrMockedGlobal } from "openclaw/plugin-sdk/runtime-fetch";
|
|
14
|
-
|
|
14
|
+
//#region \0rolldown/runtime.js
|
|
15
15
|
var __defProp = Object.defineProperty;
|
|
16
16
|
var __exportAll = (all, no_symbols) => {
|
|
17
17
|
let target = {};
|
|
@@ -22,7 +22,8 @@ var __exportAll = (all, no_symbols) => {
|
|
|
22
22
|
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
23
23
|
return target;
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region extensions/line/src/messaging-target.ts
|
|
26
27
|
function normalizeLineMessagingTarget(target) {
|
|
27
28
|
const trimmed = target.trim();
|
|
28
29
|
if (!trimmed) return;
|
|
@@ -34,11 +35,13 @@ function inferLineTargetChatType(target) {
|
|
|
34
35
|
if (/^U[a-f0-9]{32}$/i.test(normalized)) return "direct";
|
|
35
36
|
return /^[CR][a-f0-9]{32}$/i.test(normalized) ? "group" : void 0;
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region extensions/line/src/media-url.ts
|
|
38
40
|
function isHttpsUrl(value) {
|
|
39
41
|
return typeof value === "string" && URL.parse(value)?.protocol === "https:";
|
|
40
42
|
}
|
|
41
|
-
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region extensions/line/src/outbound-media.ts
|
|
42
45
|
const LINE_OUTBOUND_MEDIA_SSRF_POLICY = { allowPrivateNetwork: false };
|
|
43
46
|
async function validateLineMediaUrl(url) {
|
|
44
47
|
const parsed = URL.parse(url);
|
|
@@ -121,7 +124,8 @@ async function buildLineMediaMessage(mediaUrl, opts, target) {
|
|
|
121
124
|
};
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
|
-
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region extensions/line/src/quote-tokens.ts
|
|
125
129
|
const QUOTE_TOKEN_LIMIT = 500;
|
|
126
130
|
const quoteTokensByAccount = /* @__PURE__ */ new Map();
|
|
127
131
|
function quoteTokenKey(chatId, messageId) {
|
|
@@ -192,7 +196,8 @@ function withoutLineQuoteTokens(messages) {
|
|
|
192
196
|
quoteToken: void 0
|
|
193
197
|
} : message);
|
|
194
198
|
}
|
|
195
|
-
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region extensions/line/src/flex-templates/message.ts
|
|
196
201
|
const LINE_FLEX_BUBBLE_MAX_BYTES = 3e4;
|
|
197
202
|
const LINE_FLEX_CAROUSEL_MAX_BYTES = 5e4;
|
|
198
203
|
function fitsLineFlexBubble(bubble) {
|
|
@@ -205,7 +210,8 @@ function toFlexMessage(altText, contents) {
|
|
|
205
210
|
contents
|
|
206
211
|
};
|
|
207
212
|
}
|
|
208
|
-
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region extensions/line/src/actions.ts
|
|
209
215
|
const LINE_ACTION_LABEL_LIMIT = 20;
|
|
210
216
|
const LINE_QUICK_REPLY_ITEM_LIMIT = 13;
|
|
211
217
|
const lineActionUriProtocols = /* @__PURE__ */ new Set([
|
|
@@ -604,7 +610,8 @@ function postbackAction(label, data, displayText) {
|
|
|
604
610
|
displayText
|
|
605
611
|
});
|
|
606
612
|
}
|
|
607
|
-
|
|
613
|
+
//#endregion
|
|
614
|
+
//#region extensions/line/src/flex-templates/common.ts
|
|
608
615
|
function cardText(text, style) {
|
|
609
616
|
return {
|
|
610
617
|
type: "text",
|
|
@@ -665,7 +672,8 @@ function createCardBubble(bodyContents, footer) {
|
|
|
665
672
|
});
|
|
666
673
|
return bubble;
|
|
667
674
|
}
|
|
668
|
-
|
|
675
|
+
//#endregion
|
|
676
|
+
//#region extensions/line/src/flex-templates/basic-cards.ts
|
|
669
677
|
function createInfoCard(title, body, footer) {
|
|
670
678
|
return createCardBubble([cardBox("horizontal", [cardBox("vertical", [], {
|
|
671
679
|
width: "4px",
|
|
@@ -758,7 +766,8 @@ function createActionCard(title, body, actions, options) {
|
|
|
758
766
|
};
|
|
759
767
|
return bubble;
|
|
760
768
|
}
|
|
761
|
-
|
|
769
|
+
//#endregion
|
|
770
|
+
//#region extensions/line/src/flex-templates/schedule-cards.ts
|
|
762
771
|
function buildCardHeaderSections(headerContents) {
|
|
763
772
|
return [cardBox("vertical", headerContents, { paddingBottom: "lg" }), {
|
|
764
773
|
type: "separator",
|
|
@@ -926,13 +935,15 @@ function createAgendaCard(params) {
|
|
|
926
935
|
});
|
|
927
936
|
return createCardBubble([...buildCardHeaderSections(headerContents), cardBox("vertical", eventItems, { paddingTop: "xl" })], footer);
|
|
928
937
|
}
|
|
929
|
-
|
|
938
|
+
//#endregion
|
|
939
|
+
//#region extensions/line/src/channel-access-token.ts
|
|
930
940
|
function resolveLineChannelAccessToken(explicit, params) {
|
|
931
941
|
if (explicit?.trim()) return explicit.trim();
|
|
932
942
|
if (!params.channelAccessToken) throw new Error(params.tokenStatus === "configured_unavailable" ? `LINE channel access token is configured but unavailable for account "${params.accountId}" (check the configured tokenFile).` : `LINE channel access token missing for account "${params.accountId}" (set channels.line.channelAccessToken or LINE_CHANNEL_ACCESS_TOKEN).`);
|
|
933
943
|
return params.channelAccessToken.trim();
|
|
934
944
|
}
|
|
935
|
-
|
|
945
|
+
//#endregion
|
|
946
|
+
//#region extensions/line/src/probe.ts
|
|
936
947
|
var probe_exports = /* @__PURE__ */ __exportAll({
|
|
937
948
|
probeLineBot: () => probeLineBot,
|
|
938
949
|
readLineAccountMessageQuota: () => readLineAccountMessageQuota
|
|
@@ -1026,7 +1037,8 @@ async function probeLineBot(channelAccessToken, timeoutMs = 5e3) {
|
|
|
1026
1037
|
error: formatErrorMessage(error)
|
|
1027
1038
|
}));
|
|
1028
1039
|
}
|
|
1029
|
-
|
|
1040
|
+
//#endregion
|
|
1041
|
+
//#region extensions/line/src/send-retry.ts
|
|
1030
1042
|
/** The LINE HTTP response carried by an error graph, when the request reached LINE. */
|
|
1031
1043
|
function findLineHttpError(error) {
|
|
1032
1044
|
return collectErrorGraphCandidates(error, (candidate) => [candidate.cause, candidate.error]).find((candidate) => candidate instanceof HTTPFetchError);
|
|
@@ -1087,4 +1099,5 @@ async function explainLineRefusal(params) {
|
|
|
1087
1099
|
reason: exhausted ? `LINE refused the push: ${quota.used}/${quota.limit} monthly messages used. Check the account allowance or plan before retrying.` : params.error instanceof Error ? params.error.message : "LINE rejected the message"
|
|
1088
1100
|
};
|
|
1089
1101
|
}
|
|
1102
|
+
//#endregion
|
|
1090
1103
|
export { reportLineQuoteCarrierMissing as A, uriAction as C, canCarryLineQuoteToken as D, applyLineQuoteToken as E, normalizeLineMessagingTarget as F, withoutLineQuoteTokens as M, buildLineMediaMessage as N, readLineQuoteToken as O, inferLineTargetChatType as P, truncateLineActionLabel as S, toFlexMessage as T, createCardBubble as _, probeLineBot as a, normalizeLineMessage as b, createAgendaCard as c, createActionCard as d, createImageCard as f, cardText as g, cardBox as h, runLinePushWithRetries as i, resolveLineQuoteToken as j, recordLineQuoteToken as k, createEventCard as l, createListCard as m, findLineHttpError as n, probe_exports as o, createInfoCard as p, resolveLineNonDispatchRetryable as r, resolveLineChannelAccessToken as s, explainLineRefusal as t, createReceiptCard as u, createCardTitle as v, fitsLineFlexBubble as w, postbackAction as x, messageAction as y };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { n as resolveDefaultLineAccountId, r as resolveLineAccount, t as listLineAccountIds } from "./accounts-
|
|
1
|
+
import { n as resolveDefaultLineAccountId, r as resolveLineAccount, t as listLineAccountIds } from "./accounts-DOiM8-y3.mjs";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
5
5
|
import { createAllowFromSection, createPromptParsedAllowFromForAccount, createSetupInputPresenceValidator, createSetupTranslator, createStandardChannelSetupStatus, defineTokenCredential, formatDocsLink, parseSetupEntriesWithParser, patchScopedAccountConfig, setSetupChannelEnabled, splitSetupEntries } from "openclaw/plugin-sdk/setup";
|
|
6
6
|
import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
7
|
-
|
|
7
|
+
//#region extensions/line/src/bot-access.ts
|
|
8
8
|
function normalizeLineAllowEntry(value) {
|
|
9
9
|
return String(value).trim().replace(/^line:(?:user:)?/i, "");
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region extensions/line/src/account-helpers.ts
|
|
12
13
|
function hasLineCredentials(account) {
|
|
13
14
|
if (account.tokenStatus && account.signingSecretStatus) return account.tokenStatus !== "missing" && account.signingSecretStatus !== "missing";
|
|
14
15
|
return Boolean(account.channelAccessToken?.trim() && account.channelSecret?.trim());
|
|
@@ -18,7 +19,8 @@ function parseLineAllowFromId(raw) {
|
|
|
18
19
|
if (!/^U[a-f0-9]{32}$/i.test(trimmed)) return null;
|
|
19
20
|
return trimmed;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region extensions/line/src/setup-core.ts
|
|
22
24
|
function patchLineAccountConfig(params) {
|
|
23
25
|
return patchScopedAccountConfig({
|
|
24
26
|
cfg: params.cfg,
|
|
@@ -161,7 +163,8 @@ const lineSetupContract = defineChannelSetupContract({
|
|
|
161
163
|
},
|
|
162
164
|
legacyAdapter: lineSetupAdapter
|
|
163
165
|
});
|
|
164
|
-
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region extensions/line/src/setup-surface.ts
|
|
165
168
|
const t = createSetupTranslator();
|
|
166
169
|
const channel = "line";
|
|
167
170
|
const LINE_SETUP_HELP_LINES = [
|
|
@@ -323,4 +326,5 @@ const lineSetupWizard = {
|
|
|
323
326
|
},
|
|
324
327
|
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false)
|
|
325
328
|
};
|
|
329
|
+
//#endregion
|
|
326
330
|
export { normalizeLineAllowEntry as a, hasLineCredentials as i, lineSetupAdapter as n, lineSetupContract as r, lineSetupWizard as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as uriAction, T as toFlexMessage, g as cardText, h as cardBox, u as createReceiptCard, w as fitsLineFlexBubble, x as postbackAction, y as messageAction } from "./send-retry-
|
|
1
|
+
import { C as uriAction, T as toFlexMessage, g as cardText, h as cardBox, u as createReceiptCard, w as fitsLineFlexBubble, x as postbackAction, y as messageAction } from "./send-retry-Bf2Xr6ZN.mjs";
|
|
2
2
|
import { markdownToIRWithMeta, stripMarkdown } from "openclaw/plugin-sdk/text-chunking";
|
|
3
3
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
4
|
-
|
|
4
|
+
//#region extensions/line/src/markdown-to-line.ts
|
|
5
5
|
const LINE_MARKDOWN_OPTIONS = {
|
|
6
6
|
assistantTranscriptRoleHeaders: true,
|
|
7
7
|
autolink: false,
|
|
@@ -292,7 +292,8 @@ function processLineMessage(text) {
|
|
|
292
292
|
projectPlainText(ir, codeSpans, plainTextInsertions, (segment) => segments.push(segment));
|
|
293
293
|
return segments;
|
|
294
294
|
}
|
|
295
|
-
|
|
295
|
+
//#endregion
|
|
296
|
+
//#region packages/normalization-core/src/utf16-slice.ts
|
|
296
297
|
function isHighSurrogate(codeUnit) {
|
|
297
298
|
return codeUnit >= 55296 && codeUnit <= 56319;
|
|
298
299
|
}
|
|
@@ -305,7 +306,8 @@ function avoidTrailingHighSurrogateBreak(text, start, end) {
|
|
|
305
306
|
const adjusted = end - 1;
|
|
306
307
|
return adjusted > start ? adjusted : end + 1;
|
|
307
308
|
}
|
|
308
|
-
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region packages/normalization-core/src/grapheme.ts
|
|
309
311
|
let graphemeSegmenter;
|
|
310
312
|
function getGraphemeSegmenter() {
|
|
311
313
|
graphemeSegmenter ??= new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
@@ -329,7 +331,8 @@ function findGraphemeChunkEnd(text, start, maxEnd, preferredEnd = maxEnd, allowP
|
|
|
329
331
|
if (end <= start && preferred < hardEnd) end = hardEnd === text.length ? hardEnd : segments.containing(hardEnd)?.index ?? hardEnd;
|
|
330
332
|
return end > start ? end : allowPartial ? avoidTrailingHighSurrogateBreak(text, start, hardEnd) : start;
|
|
331
333
|
}
|
|
332
|
-
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region extensions/line/src/template-messages.ts
|
|
333
336
|
const COMPACT_TEMPLATE_TEXT_LIMIT = 60;
|
|
334
337
|
const TEMPLATE_ALT_TEXT_LIMIT = 1500;
|
|
335
338
|
function buildTemplatePayloadAction(action) {
|
|
@@ -419,4 +422,5 @@ function buildTemplateMessageFromPayload(payload) {
|
|
|
419
422
|
default: return null;
|
|
420
423
|
}
|
|
421
424
|
}
|
|
425
|
+
//#endregion
|
|
422
426
|
export { processLineMessage as n, buildTemplateMessageFromPayload as t };
|
package/dist/.setup/{webhook-spool-contract-COhQK5XQ.mjs → webhook-spool-contract-msjTl60Q.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isRecord, normalizeNullableString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
|
|
2
|
+
//#region extensions/line/src/webhook-spool-contract.ts
|
|
3
3
|
/** Message the canonical decoder attaches when it rejects a spool payload. The
|
|
4
4
|
* upgrade migration matches this signature to recover rows the pre-fix decoder
|
|
5
5
|
* dead-lettered; the identity fence writes a different message on purpose. */
|
|
@@ -52,4 +52,5 @@ function laneKeyFor(event, eventId) {
|
|
|
52
52
|
}
|
|
53
53
|
return eventId;
|
|
54
54
|
}
|
|
55
|
+
//#endregion
|
|
55
56
|
export { laneKeyFor as a, eventIdFor as i, LINE_WEBHOOK_SPOOL_INVALID_PAYLOAD_MESSAGE as n, legacyEventIdFor as o, LineWebhookPayloadError as r, LINE_WEBHOOK_SPOOL_INVALID_EVENT_REASON as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"api.js","source":"extensions/line/api.ts"},{"output":"channel-plugin-api.js","source":"extensions/line/channel-plugin-api.ts"},{"output":"contract-api.js","source":"extensions/line/contract-api.ts"},{"output":"doctor-contract-api.js","source":"extensions/line/doctor-contract-api.ts"},{"output":"index.js","source":"extensions/line/index.ts"},{"output":"runtime-api.js","source":"extensions/line/runtime-api.ts"},{"output":"secret-contract-api.js","source":"extensions/line/secret-contract-api.ts"},{"output":"setup-api.js","source":"extensions/line/setup-api.ts"},{"output":"setup-entry.js","source":"extensions/line/setup-entry.ts"}],"chunks":[{"output":".setup/accounts-
|
|
1
|
+
{"version":3,"entries":[{"output":"api.js","source":"extensions/line/api.ts"},{"output":"channel-plugin-api.js","source":"extensions/line/channel-plugin-api.ts"},{"output":"contract-api.js","source":"extensions/line/contract-api.ts"},{"output":"doctor-contract-api.js","source":"extensions/line/doctor-contract-api.ts"},{"output":"index.js","source":"extensions/line/index.ts"},{"output":"runtime-api.js","source":"extensions/line/runtime-api.ts"},{"output":"secret-contract-api.js","source":"extensions/line/secret-contract-api.ts"},{"output":"setup-api.js","source":"extensions/line/setup-api.ts"},{"output":"setup-entry.js","source":"extensions/line/setup-entry.ts"}],"chunks":[{"output":".setup/accounts-DOiM8-y3.mjs","sha256":"56d1cf766984063d8eec40ee937e12f10082bb39c5cd30ffb9d0829b85c85940","facadeSource":null,"sources":["extensions/line/src/accounts.ts"]},{"output":".setup/api-4BpGVN1-.mjs","sha256":"9c99544ce41b3dd018743eab7cc5b6d9596813890f7cf517bffcea775769c15f","facadeSource":"extensions/line/api.ts","sources":[]},{"output":".setup/api-BRnngy5R.mjs","sha256":"ab8599bad307acb2dea525ebdd65ed1f55c02a4ef1b0762f804371251daf8fdd","facadeSource":null,"sources":["extensions/line/src/channel.setup.ts"]},{"output":".setup/card-command-2y-RSLPg.mjs","sha256":"719c15c161a339b1378ee4159f307a56b68ca9a4c0c59468940a2950fecf4f87","facadeSource":"extensions/line/src/card-command.ts","sources":["extensions/line/src/card-command.ts"]},{"output":".setup/channel-DJcpjKpx.mjs","sha256":"d7a5980902942c2faaafb0fe35f4e8423fa3cf99f66d4e21ae2273672fedcb77","facadeSource":null,"sources":["extensions/line/src/channel-shared.ts","extensions/line/src/channel.ts","extensions/line/src/config-adapter.ts","extensions/line/src/config-schema.ts","extensions/line/src/doctor.ts","extensions/line/src/gateway.ts","extensions/line/src/group-keys.ts","extensions/line/src/outbound.ts","extensions/line/src/question-postback.ts","extensions/line/src/quick-reply-fallback.ts","extensions/line/src/rich-message-schema.ts","extensions/line/src/rich-messages.ts","extensions/line/src/status.ts"]},{"output":".setup/channel.runtime-CdfKsNz4.mjs","sha256":"56a33d635b2436d5abe67569edebe3185c39454adc34827273bcc94b6e015672","facadeSource":"extensions/line/src/channel.runtime.ts","sources":[]},{"output":".setup/monitor-BkuPFFxZ.mjs","sha256":"65a9b2e8486ca01ed61e6b644de98e4a947a628f3e17ce27e365a07bccd0c568","facadeSource":"extensions/line/src/monitor.ts","sources":["extensions/line/src/auto-reply-delivery.ts","extensions/line/src/bot-handlers.ts","extensions/line/src/bot-message-context.ts","extensions/line/src/bot.ts","extensions/line/src/download.ts","extensions/line/src/group-history.ts","extensions/line/src/inbound-image-set.ts","extensions/line/src/mentions.ts","extensions/line/src/monitor.ts","extensions/line/src/signature.ts","extensions/line/src/webhook-node.ts","extensions/line/src/webhook-spool.ts"]},{"output":".setup/outbound.runtime-BPo_111h.mjs","sha256":"8f8c1733c74ec476640719a49e8325e28274c663ca1fb084d8a338128d744eff","facadeSource":"extensions/line/src/outbound.runtime.ts","sources":[]},{"output":".setup/runtime-V7yh9OeC.mjs","sha256":"1ac56aacd454f0a3cbe86865bbab4b6d67517074a582ba0c9cbf570a2c21c326","facadeSource":null,"sources":["extensions/line/src/runtime.ts"]},{"output":".setup/send-C1JZOFMA.mjs","sha256":"3ac4ecefe11628dfbe805cd23be47a8da93d24d2720b05edc8230f26cff04359","facadeSource":null,"sources":["extensions/line/src/outbound-message-log.ts","extensions/line/src/send.ts"]},{"output":".setup/send-retry-Bf2Xr6ZN.mjs","sha256":"d16a0c6817edb24691ff166b704025f4b082f5458ae27b51de24d87e5d6c1d4f","facadeSource":null,"sources":["extensions/line/src/actions.ts","extensions/line/src/channel-access-token.ts","extensions/line/src/flex-templates/basic-cards.ts","extensions/line/src/flex-templates/common.ts","extensions/line/src/flex-templates/message.ts","extensions/line/src/flex-templates/schedule-cards.ts","extensions/line/src/media-url.ts","extensions/line/src/messaging-target.ts","extensions/line/src/outbound-media.ts","extensions/line/src/probe.ts","extensions/line/src/quote-tokens.ts","extensions/line/src/send-retry.ts"]},{"output":".setup/setup-surface-CYd8oqzt.mjs","sha256":"1b1badac06cd9a9100131be0787ea8d60e0536b18363d72a328c3345ece36fb0","facadeSource":null,"sources":["extensions/line/src/account-helpers.ts","extensions/line/src/bot-access.ts","extensions/line/src/setup-core.ts","extensions/line/src/setup-surface.ts"]},{"output":".setup/template-messages-C1Kkr0-e.mjs","sha256":"5a5961562bf31a43836baefed36509c311737c749ab12aaf3e036fd16fb16fcf","facadeSource":null,"sources":["extensions/line/src/markdown-to-line.ts","extensions/line/src/template-messages.ts","packages/normalization-core/src/grapheme.ts","packages/normalization-core/src/utf16-slice.ts"]},{"output":".setup/webhook-spool-contract-msjTl60Q.mjs","sha256":"adb5fcdc75ce67f080542810ef3e6f8992c6f605d1118491cb27c6fcfde0b394","facadeSource":null,"sources":["extensions/line/src/webhook-spool-contract.ts"]},{"output":"api.js","sha256":"db78e5e54b305b24a5511cf464f83c4892ea8350dab82bed25fb85406bef7740","facadeSource":"extensions/line/api.ts","sources":[]},{"output":"channel-plugin-api.js","sha256":"ee9f9f572d0679b890bc15c298c2b2a109f4fdd9c3d2174dbb54643539310f09","facadeSource":"extensions/line/channel-plugin-api.ts","sources":[]},{"output":"contract-api.js","sha256":"5ada259c1c8cc15d47a4b137b1c24b2d917358b605aa0b3b90c640dd8e9db631","facadeSource":"extensions/line/contract-api.ts","sources":[]},{"output":"doctor-contract-api.js","sha256":"74bab000c23513d711021179dac75bbcae70149816220010d060c21b8f0fc2a7","facadeSource":"extensions/line/doctor-contract-api.ts","sources":["extensions/line/doctor-contract-api.ts","extensions/line/src/webhook-spool-migration.ts"]},{"output":"index.js","sha256":"7ed527cac8fde9450c824d6a832ad6cb403354ab543f1cc28edc6f11fab28589","facadeSource":"extensions/line/index.ts","sources":["extensions/line/index.ts"]},{"output":"runtime-api.js","sha256":"d4608e118257690b4678909bd09aeb76c6db6d74a2e8847a826316d2cebb120a","facadeSource":"extensions/line/runtime-api.ts","sources":[]},{"output":"secret-contract-api.js","sha256":"b910921591244f33f89f7da098a21be20b7c1d1a81871c2db2db5185dedfc8d6","facadeSource":"extensions/line/secret-contract-api.ts","sources":["extensions/line/secret-contract-api.ts"]},{"output":"setup-api.js","sha256":"8256db26d152acea47a918c482a77233e05d4cd556d3400a1c3cfe60848ae479","facadeSource":"extensions/line/setup-api.ts","sources":[]},{"output":"setup-entry.js","sha256":"8f520f079990c8ffff6cf85dc672f7ccf0c04638abdbe21140ebcfd3b8874ec4","facadeSource":"extensions/line/setup-entry.ts","sources":["extensions/line/setup-entry.ts"]}],"unrenderedSources":["extensions/line/api.ts","extensions/line/channel-plugin-api.ts","extensions/line/contract-api.ts","extensions/line/runtime-api.ts","extensions/line/setup-api.ts","extensions/line/src/channel.runtime.ts","extensions/line/src/outbound.runtime.ts","src/plugin-sdk/text-grapheme.ts"]}
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as linePlugin } from "./.setup/channel-
|
|
2
|
-
import { t as lineSetupPlugin } from "./.setup/api-
|
|
1
|
+
import { t as linePlugin } from "./.setup/channel-DJcpjKpx.mjs";
|
|
2
|
+
import { t as lineSetupPlugin } from "./.setup/api-BRnngy5R.mjs";
|
|
3
3
|
export { linePlugin, lineSetupPlugin };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as linePlugin } from "./.setup/channel-
|
|
1
|
+
export { t as linePlugin } from "./.setup/channel-DJcpjKpx.mjs";
|
package/dist/contract-api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as listLineAccountIds, n as resolveDefaultLineAccountId, r as resolveLineAccount } from "./.setup/accounts-
|
|
1
|
+
export { t as listLineAccountIds, n as resolveDefaultLineAccountId, r as resolveLineAccount } from "./.setup/accounts-DOiM8-y3.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as laneKeyFor, i as eventIdFor, o as legacyEventIdFor, r as LineWebhookPayloadError, t as LINE_WEBHOOK_SPOOL_INVALID_EVENT_REASON } from "./.setup/webhook-spool-contract-
|
|
1
|
+
import { a as laneKeyFor, i as eventIdFor, o as legacyEventIdFor, r as LineWebhookPayloadError, t as LINE_WEBHOOK_SPOOL_INVALID_EVENT_REASON } from "./.setup/webhook-spool-contract-msjTl60Q.mjs";
|
|
2
2
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
4
|
-
|
|
4
|
+
//#region extensions/line/src/webhook-spool-migration.ts
|
|
5
5
|
/** Pre-drain (#109655) rows stored the event object under `event` instead of the
|
|
6
6
|
* canonical serialized `rawEvent`; anything else is not a migratable row. */
|
|
7
7
|
function parseLegacySpoolPayload(payload) {
|
|
@@ -90,7 +90,8 @@ async function migrateLineLegacySpoolRows(queue) {
|
|
|
90
90
|
}
|
|
91
91
|
return result;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region extensions/line/doctor-contract-api.ts
|
|
94
95
|
const LINE_CHANNEL_ID = "line";
|
|
95
96
|
/** Pre-drain rows can outlive the account config that admitted them, so the sweep
|
|
96
97
|
* enumerates accounts from the host's queue lane instead of the config; a host
|
|
@@ -137,4 +138,5 @@ const stateMigrations = [{
|
|
|
137
138
|
};
|
|
138
139
|
}
|
|
139
140
|
}];
|
|
141
|
+
//#endregion
|
|
140
142
|
export { stateMigrations };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
|
-
|
|
2
|
+
//#region extensions/line/index.ts
|
|
3
3
|
var line_default = defineBundledChannelEntry({
|
|
4
4
|
id: "line",
|
|
5
5
|
name: "LINE",
|
|
@@ -21,10 +21,11 @@ var line_default = defineBundledChannelEntry({
|
|
|
21
21
|
acceptsArgs: true,
|
|
22
22
|
requireAuth: false,
|
|
23
23
|
async handler(ctx) {
|
|
24
|
-
const { handleLineCardCommand } = await import("./.setup/card-command-
|
|
24
|
+
const { handleLineCardCommand } = await import("./.setup/card-command-2y-RSLPg.mjs");
|
|
25
25
|
return await handleLineCardCommand(ctx.args);
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
//#endregion
|
|
30
31
|
export { line_default as default };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as setLineRuntime } from "./.setup/runtime-
|
|
1
|
+
export { n as setLineRuntime } from "./.setup/runtime-V7yh9OeC.mjs";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
//#region extensions/line/secret-contract-api.ts
|
|
2
2
|
const secretTargetRegistryEntries = [];
|
|
3
3
|
function collectRuntimeConfigAssignments() {}
|
|
4
|
+
//#endregion
|
|
4
5
|
export { collectRuntimeConfigAssignments, secretTargetRegistryEntries };
|
package/dist/setup-api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as lineSetupAdapter, t as lineSetupWizard } from "./.setup/setup-surface-
|
|
1
|
+
export { n as lineSetupAdapter, t as lineSetupWizard } from "./.setup/setup-surface-CYd8oqzt.mjs";
|
package/dist/setup-entry.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
|
|
3
|
+
//#region extensions/line/setup-entry.ts
|
|
4
4
|
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
5
5
|
importMetaUrl: import.meta.url,
|
|
6
6
|
plugin: {
|
|
7
|
-
specifier: fileURLToPath(new URL(".setup/api-
|
|
7
|
+
specifier: fileURLToPath(new URL(".setup/api-4BpGVN1-.mjs", import.meta.url).href),
|
|
8
8
|
exportName: "lineSetupPlugin"
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
//#endregion
|
|
11
12
|
export { setup_entry_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/line",
|
|
3
|
-
"version": "2026.11.5-beta.
|
|
3
|
+
"version": "2026.11.5-beta.2",
|
|
4
4
|
"description": "OpenClaw LINE channel plugin for LINE Bot API chats.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"zod": "4.6.7"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"openclaw": ">=2026.11.5-beta.
|
|
16
|
+
"openclaw": ">=2026.11.5-beta.2"
|
|
17
17
|
},
|
|
18
18
|
"peerDependenciesMeta": {
|
|
19
19
|
"openclaw": {
|
|
@@ -122,10 +122,10 @@
|
|
|
122
122
|
"minHostVersion": ">=2026.4.10"
|
|
123
123
|
},
|
|
124
124
|
"compat": {
|
|
125
|
-
"pluginApi": ">=2026.11.5-beta.
|
|
125
|
+
"pluginApi": ">=2026.11.5-beta.2"
|
|
126
126
|
},
|
|
127
127
|
"build": {
|
|
128
|
-
"openclawVersion": "2026.11.5-beta.
|
|
128
|
+
"openclawVersion": "2026.11.5-beta.2"
|
|
129
129
|
},
|
|
130
130
|
"release": {
|
|
131
131
|
"publishToClawHub": true,
|