@openclaw/line 2026.7.1-beta.1 → 2026.7.1-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/api.js +1 -1
- package/dist/{card-command-BaaE1SfK.js → card-command-DZVv78B6.js} +6 -5
- package/dist/{channel-DwbohZPO.js → channel-DIpdZiwc.js} +9 -8
- package/dist/channel-plugin-api.js +1 -1
- package/dist/channel.runtime-KvcDpasA.js +4 -0
- package/dist/index.js +7 -7
- package/dist/{markdown-to-line-BBM3V8-S.js → markdown-to-line-CFx7ME4o.js} +5 -4
- package/dist/{monitor-BEsUjORi.js → monitor-DzkYuWhv.js} +4 -3
- package/dist/monitor.runtime-njiPADBe.js +2 -0
- package/dist/{outbound.runtime-BKmUJlZB.js → outbound.runtime-BPz8U_hw.js} +1 -1
- package/dist/runtime-api.js +15 -4
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
- package/dist/channel.runtime-Cs_zbikE.js +0 -4
- package/dist/monitor.runtime-DX5NxULi.js +0 -2
package/dist/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as lineChannelPluginCommon, t as linePlugin } from "./channel-
|
|
1
|
+
import { n as lineChannelPluginCommon, t as linePlugin } from "./channel-DIpdZiwc.js";
|
|
2
2
|
import { n as lineSetupAdapter, t as lineSetupWizard } from "./setup-surface-Bc36YSS3.js";
|
|
3
3
|
//#region extensions/line/src/channel.setup.ts
|
|
4
4
|
const lineSetupPlugin = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { c as uriAction, d as createReceiptCard, f as createActionCard, g as createListCard, h as createInfoCard, m as createImageCard, o as messageAction, s as postbackAction } from "./flex-templates-DPBtqQ8R.js";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
3
4
|
//#region extensions/line/src/card-command.ts
|
|
4
5
|
const CARD_USAGE = `Usage: /card <type> "title" "body" [options]
|
|
5
6
|
|
|
@@ -114,7 +115,7 @@ function registerLineCardCommand(api) {
|
|
|
114
115
|
const [title = "Info", body = "", footer] = args;
|
|
115
116
|
const bubble = createInfoCard(title, body, footer);
|
|
116
117
|
return buildLineReply({ flexMessage: {
|
|
117
|
-
altText: `${title}: ${body}
|
|
118
|
+
altText: truncateUtf16Safe(`${title}: ${body}`, 400),
|
|
118
119
|
contents: bubble
|
|
119
120
|
} });
|
|
120
121
|
}
|
|
@@ -124,7 +125,7 @@ function registerLineCardCommand(api) {
|
|
|
124
125
|
if (!imageUrl) return { text: "Error: Image card requires --url <image-url>" };
|
|
125
126
|
const bubble = createImageCard(imageUrl, title, caption);
|
|
126
127
|
return buildLineReply({ flexMessage: {
|
|
127
|
-
altText: `${title}: ${caption}
|
|
128
|
+
altText: truncateUtf16Safe(`${title}: ${caption}`, 400),
|
|
128
129
|
contents: bubble
|
|
129
130
|
} });
|
|
130
131
|
}
|
|
@@ -134,7 +135,7 @@ function registerLineCardCommand(api) {
|
|
|
134
135
|
if (actions.length === 0) return { text: "Error: Action card requires --actions \"Label1|data1,Label2|data2\"" };
|
|
135
136
|
const bubble = createActionCard(title, body, actions, { imageUrl: flags.url || flags.image });
|
|
136
137
|
return buildLineReply({ flexMessage: {
|
|
137
|
-
altText: `${title}: ${body}
|
|
138
|
+
altText: truncateUtf16Safe(`${title}: ${body}`, 400),
|
|
138
139
|
contents: bubble
|
|
139
140
|
} });
|
|
140
141
|
}
|
|
@@ -144,7 +145,7 @@ function registerLineCardCommand(api) {
|
|
|
144
145
|
if (items.length === 0) return { text: "Error: List card requires items. Usage: /card list \"Title\" \"Item1|Desc1,Item2|Desc2\"" };
|
|
145
146
|
const bubble = createListCard(title, items);
|
|
146
147
|
return buildLineReply({ flexMessage: {
|
|
147
|
-
altText: `${title}: ${items.map((i) => i.title).join(", ")}
|
|
148
|
+
altText: truncateUtf16Safe(`${title}: ${items.map((i) => i.title).join(", ")}`, 400),
|
|
148
149
|
contents: bubble
|
|
149
150
|
} });
|
|
150
151
|
}
|
|
@@ -164,7 +165,7 @@ function registerLineCardCommand(api) {
|
|
|
164
165
|
footer
|
|
165
166
|
});
|
|
166
167
|
return buildLineReply({ flexMessage: {
|
|
167
|
-
altText: `${title}: ${items.map((i) => `${i.name} ${i.value}`).join(", ")}
|
|
168
|
+
altText: truncateUtf16Safe(`${title}: ${items.map((i) => `${i.name} ${i.value}`).join(", ")}`, 400),
|
|
168
169
|
contents: bubble
|
|
169
170
|
} });
|
|
170
171
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { i as resolveLineAccount, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-DJVOv1JI.js";
|
|
2
2
|
import { n as lineSetupAdapter, r as hasLineCredentials, t as lineSetupWizard } from "./setup-surface-Bc36YSS3.js";
|
|
3
3
|
import { a as resolveLineOutboundMedia, d as resolveExactLineGroupConfigKey, i as buildLineQuickReplyFallbackText, l as LineChannelConfigSchema, n as parseLineDirectives, r as createLineSendReceipt, s as getLineRuntime, t as hasLineDirectives } from "./reply-payload-transform-BwF-zq0G.js";
|
|
4
|
+
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
4
5
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
5
6
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
6
7
|
import { createRestrictSendersChannelSecurity, resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
|
7
8
|
import { createEmptyChannelDirectoryAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
8
|
-
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
9
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/account-id";
|
|
10
10
|
import { clearAccountEntryFields } from "openclaw/plugin-sdk/core";
|
|
11
11
|
import { describeWebhookAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
@@ -14,6 +14,7 @@ import { normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtim
|
|
|
14
14
|
import { defineChannelMessageAdapter } from "openclaw/plugin-sdk/channel-outbound";
|
|
15
15
|
import { createAttachedChannelResultAdapter, createEmptyChannelResult } from "openclaw/plugin-sdk/channel-send-result";
|
|
16
16
|
import { resolveOutboundMediaUrls } from "openclaw/plugin-sdk/reply-payload";
|
|
17
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
17
18
|
import { buildTokenChannelStatusSummary, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState, createDependentCredentialStatusIssueCollector } from "openclaw/plugin-sdk/status-helpers";
|
|
18
19
|
//#region extensions/line/src/bindings.ts
|
|
19
20
|
function normalizeLineConversationId(raw) {
|
|
@@ -107,7 +108,7 @@ const lineChannelPluginCommon = {
|
|
|
107
108
|
//#endregion
|
|
108
109
|
//#region extensions/line/src/gateway.ts
|
|
109
110
|
const loadLineProbeRuntime$1 = createLazyRuntimeModule(() => import("./probe.runtime-CRhVGqwl.js"));
|
|
110
|
-
const loadLineMonitorRuntime = createLazyRuntimeModule(() => import("./monitor.runtime-
|
|
111
|
+
const loadLineMonitorRuntime = createLazyRuntimeModule(() => import("./monitor.runtime-njiPADBe.js"));
|
|
111
112
|
const lineGatewayAdapter = {
|
|
112
113
|
startAccount: async (ctx) => {
|
|
113
114
|
const account = ctx.account;
|
|
@@ -211,7 +212,7 @@ function resolveLineGroupRequireMention(params) {
|
|
|
211
212
|
}
|
|
212
213
|
//#endregion
|
|
213
214
|
//#region extensions/line/src/outbound.ts
|
|
214
|
-
const loadLineOutboundRuntime = createLazyRuntimeModule(() => import("./outbound.runtime-
|
|
215
|
+
const loadLineOutboundRuntime = createLazyRuntimeModule(() => import("./outbound.runtime-BPz8U_hw.js"));
|
|
215
216
|
function isLineUserTarget(target) {
|
|
216
217
|
const normalized = target.trim().replace(/^line:(group|room|user):/i, "").replace(/^line:/i, "");
|
|
217
218
|
return /^U/i.test(normalized);
|
|
@@ -358,7 +359,7 @@ const lineOutboundAdapter = {
|
|
|
358
359
|
const quickReplyMessages = [];
|
|
359
360
|
if (lineData.flexMessage) quickReplyMessages.push({
|
|
360
361
|
type: "flex",
|
|
361
|
-
altText: lineData.flexMessage.altText
|
|
362
|
+
altText: truncateUtf16Safe(lineData.flexMessage.altText, 400),
|
|
362
363
|
contents: lineData.flexMessage.contents
|
|
363
364
|
});
|
|
364
365
|
if (lineData.templateMessage) {
|
|
@@ -367,14 +368,14 @@ const lineOutboundAdapter = {
|
|
|
367
368
|
}
|
|
368
369
|
if (lineData.location) quickReplyMessages.push({
|
|
369
370
|
type: "location",
|
|
370
|
-
title: lineData.location.title
|
|
371
|
-
address: lineData.location.address
|
|
371
|
+
title: truncateUtf16Safe(lineData.location.title, 100),
|
|
372
|
+
address: truncateUtf16Safe(lineData.location.address, 100),
|
|
372
373
|
latitude: lineData.location.latitude,
|
|
373
374
|
longitude: lineData.location.longitude
|
|
374
375
|
});
|
|
375
376
|
for (const flexMsg of processed.flexMessages) quickReplyMessages.push({
|
|
376
377
|
type: "flex",
|
|
377
|
-
altText: flexMsg.altText
|
|
378
|
+
altText: truncateUtf16Safe(flexMsg.altText, 400),
|
|
378
379
|
contents: flexMsg.contents
|
|
379
380
|
});
|
|
380
381
|
for (const url of mediaUrls) {
|
|
@@ -532,7 +533,7 @@ const lineStatusAdapter = createComputedAccountStatusAdapter({
|
|
|
532
533
|
});
|
|
533
534
|
//#endregion
|
|
534
535
|
//#region extensions/line/src/channel.ts
|
|
535
|
-
const loadLineChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
536
|
+
const loadLineChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-KvcDpasA.js"));
|
|
536
537
|
const lineSecurityAdapter = createRestrictSendersChannelSecurity({
|
|
537
538
|
channelKey: "line",
|
|
538
539
|
resolveDmPolicy: (account) => account.config.dmPolicy,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as linePlugin } from "./channel-
|
|
1
|
+
import { t as linePlugin } from "./channel-DIpdZiwc.js";
|
|
2
2
|
export { linePlugin };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
|
+
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
2
3
|
//#region extensions/line/index.ts
|
|
3
|
-
|
|
4
|
-
async
|
|
5
|
-
lineCardCommandPromise ??= (async () => {
|
|
4
|
+
function createLineCardCommandLoader(api) {
|
|
5
|
+
return createLazyRuntimeModule(async () => {
|
|
6
6
|
let registered = null;
|
|
7
|
-
const { registerLineCardCommand } = await import("./card-command-
|
|
7
|
+
const { registerLineCardCommand } = await import("./card-command-DZVv78B6.js");
|
|
8
8
|
registerLineCardCommand({
|
|
9
9
|
...api,
|
|
10
10
|
registerCommand(command) {
|
|
@@ -13,8 +13,7 @@ async function loadLineCardCommand(api) {
|
|
|
13
13
|
});
|
|
14
14
|
if (!registered) throw new Error("LINE card command registration unavailable");
|
|
15
15
|
return registered;
|
|
16
|
-
})
|
|
17
|
-
return await lineCardCommandPromise;
|
|
16
|
+
});
|
|
18
17
|
}
|
|
19
18
|
var line_default = defineBundledChannelEntry({
|
|
20
19
|
id: "line",
|
|
@@ -30,13 +29,14 @@ var line_default = defineBundledChannelEntry({
|
|
|
30
29
|
exportName: "setLineRuntime"
|
|
31
30
|
},
|
|
32
31
|
registerFull(api) {
|
|
32
|
+
const loadLineCardCommand = createLineCardCommandLoader(api);
|
|
33
33
|
api.registerCommand({
|
|
34
34
|
name: "card",
|
|
35
35
|
description: "Send a rich card message (LINE).",
|
|
36
36
|
acceptsArgs: true,
|
|
37
37
|
requireAuth: false,
|
|
38
38
|
async handler(ctx) {
|
|
39
|
-
return await (await loadLineCardCommand(
|
|
39
|
+
return await (await loadLineCardCommand()).handler(ctx);
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { i as resolveLineAccount } from "./accounts-DJVOv1JI.js";
|
|
2
2
|
import { o as validateLineMediaUrl, r as createLineSendReceipt } from "./reply-payload-transform-BwF-zq0G.js";
|
|
3
3
|
import { c as uriAction, d as createReceiptCard, o as messageAction, s as postbackAction, t as toFlexMessage } from "./flex-templates-DPBtqQ8R.js";
|
|
4
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
4
5
|
import { messagingApi } from "@line/bot-sdk";
|
|
5
6
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
6
7
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
@@ -279,8 +280,8 @@ function createAudioMessage(originalContentUrl, durationMs) {
|
|
|
279
280
|
function createLocationMessage(location) {
|
|
280
281
|
return {
|
|
281
282
|
type: "location",
|
|
282
|
-
title: location.title
|
|
283
|
-
address: location.address
|
|
283
|
+
title: truncateUtf16Safe(location.title, 100),
|
|
284
|
+
address: truncateUtf16Safe(location.address, 100),
|
|
284
285
|
latitude: location.latitude,
|
|
285
286
|
longitude: location.longitude
|
|
286
287
|
};
|
|
@@ -413,7 +414,7 @@ async function pushLocationMessage(to, location, opts) {
|
|
|
413
414
|
async function pushFlexMessage(to, altText, contents, opts) {
|
|
414
415
|
return pushLineMessages(to, [{
|
|
415
416
|
type: "flex",
|
|
416
|
-
altText: altText
|
|
417
|
+
altText: truncateUtf16Safe(altText, 400),
|
|
417
418
|
contents
|
|
418
419
|
}], opts, {
|
|
419
420
|
errorContext: "push flex message",
|
|
@@ -652,7 +653,7 @@ function extractCodeBlocks(text) {
|
|
|
652
653
|
*/
|
|
653
654
|
function convertCodeBlockToFlexBubble(block) {
|
|
654
655
|
const titleText = block.language ? `Code (${block.language})` : "Code";
|
|
655
|
-
const displayCode = block.code.length > 2e3 ? block.code
|
|
656
|
+
const displayCode = block.code.length > 2e3 ? truncateUtf16Safe(block.code, 2e3) + "\n..." : block.code;
|
|
656
657
|
return {
|
|
657
658
|
type: "bubble",
|
|
658
659
|
body: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { i as resolveLineAccount, r as resolveDefaultLineAccountId } from "./accounts-DJVOv1JI.js";
|
|
2
2
|
import { f as resolveLineGroupConfigEntry, i as buildLineQuickReplyFallbackText, s as getLineRuntime } from "./reply-payload-transform-BwF-zq0G.js";
|
|
3
|
-
import { A as buildTemplateMessageFromPayload, C as pushMessagesLine, E as replyMessageLine, O as showLoadingAnimation, S as pushMessageLine, T as pushTextMessageWithQuickReplies, _ as getUserDisplayName, c as processLineMessage, d as createFlexMessage, f as createImageMessage, h as createTextMessageWithQuickReplies, m as createQuickReplyItems, p as createLocationMessage } from "./markdown-to-line-
|
|
3
|
+
import { A as buildTemplateMessageFromPayload, C as pushMessagesLine, E as replyMessageLine, O as showLoadingAnimation, S as pushMessageLine, T as pushTextMessageWithQuickReplies, _ as getUserDisplayName, c as processLineMessage, d as createFlexMessage, f as createImageMessage, h as createTextMessageWithQuickReplies, m as createQuickReplyItems, p as createLocationMessage } from "./markdown-to-line-CFx7ME4o.js";
|
|
4
4
|
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
|
5
5
|
import { normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { createMessageReceiveContext } from "openclaw/plugin-sdk/channel-outbound";
|
|
7
7
|
import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
8
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
8
9
|
import { firstDefined } from "openclaw/plugin-sdk/allow-from";
|
|
9
10
|
import { messagingApi } from "@line/bot-sdk";
|
|
10
11
|
import { saveMediaStream } from "openclaw/plugin-sdk/media-store";
|
|
@@ -83,7 +84,7 @@ async function deliverLineAutoReply(params) {
|
|
|
83
84
|
};
|
|
84
85
|
const richMessages = [];
|
|
85
86
|
const hasQuickReplies = Boolean(lineData.quickReplies?.length);
|
|
86
|
-
if (lineData.flexMessage) richMessages.push(deps.createFlexMessage(lineData.flexMessage.altText
|
|
87
|
+
if (lineData.flexMessage) richMessages.push(deps.createFlexMessage(truncateUtf16Safe(lineData.flexMessage.altText, 400), lineData.flexMessage.contents));
|
|
87
88
|
if (lineData.templateMessage) {
|
|
88
89
|
const templateMsg = deps.buildTemplateMessageFromPayload(lineData.templateMessage);
|
|
89
90
|
if (templateMsg) richMessages.push(templateMsg);
|
|
@@ -93,7 +94,7 @@ async function deliverLineAutoReply(params) {
|
|
|
93
94
|
text: "",
|
|
94
95
|
flexMessages: []
|
|
95
96
|
};
|
|
96
|
-
for (const flexMsg of processed.flexMessages) richMessages.push(deps.createFlexMessage(flexMsg.altText
|
|
97
|
+
for (const flexMsg of processed.flexMessages) richMessages.push(deps.createFlexMessage(truncateUtf16Safe(flexMsg.altText, 400), flexMsg.contents));
|
|
97
98
|
const chunks = processed.text ? deps.chunkMarkdownText(processed.text, textLimit) : [];
|
|
98
99
|
const mediaMessages = resolveSendableOutboundReplyParts(payload).mediaUrls.map((url) => url?.trim()).filter((url) => Boolean(url)).map((url) => deps.createImageMessage(url));
|
|
99
100
|
if (chunks.length > 0) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as buildTemplateMessageFromPayload, C as pushMessagesLine, D as sendMessageLine, S as pushMessageLine, T as pushTextMessageWithQuickReplies, c as processLineMessage, m as createQuickReplyItems, w as pushTemplateMessage, x as pushLocationMessage, y as pushFlexMessage } from "./markdown-to-line-
|
|
1
|
+
import { A as buildTemplateMessageFromPayload, C as pushMessagesLine, D as sendMessageLine, S as pushMessageLine, T as pushTextMessageWithQuickReplies, c as processLineMessage, m as createQuickReplyItems, w as pushTemplateMessage, x as pushLocationMessage, y as pushFlexMessage } from "./markdown-to-line-CFx7ME4o.js";
|
|
2
2
|
export { buildTemplateMessageFromPayload, createQuickReplyItems, processLineMessage, pushFlexMessage, pushLocationMessage, pushMessageLine, pushMessagesLine, pushTemplateMessage, pushTextMessageWithQuickReplies, sendMessageLine };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { i as resolveLineAccount, n as normalizeAccountId, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-DJVOv1JI.js";
|
|
2
2
|
import { c as setLineRuntime, d as resolveExactLineGroupConfigKey, f as resolveLineGroupConfigEntry, l as LineChannelConfigSchema, m as resolveLineGroupsConfig, n as parseLineDirectives, p as resolveLineGroupLookupIds, t as hasLineDirectives, u as LineConfigSchema } from "./reply-payload-transform-BwF-zq0G.js";
|
|
3
3
|
import { _ as createNotificationBubble, a as datetimePickerAction, c as uriAction, d as createReceiptCard, f as createActionCard, g as createListCard, h as createInfoCard, i as createMediaPlayerCard, l as createAgendaCard, m as createImageCard, n as createAppleTvRemoteCard, o as messageAction, p as createCarousel, r as createDeviceControlCard, s as postbackAction, t as toFlexMessage, u as createEventCard } from "./flex-templates-DPBtqQ8R.js";
|
|
4
|
-
import { a as validateLineSignature, c as normalizeAllowFrom, i as parseLineWebhookBody, n as createLineNodeWebhookHandler, o as downloadLineMedia, r as readLineWebhookRequestBody, s as firstDefined, t as monitorLineProvider } from "./monitor-
|
|
4
|
+
import { a as validateLineSignature, c as normalizeAllowFrom, i as parseLineWebhookBody, n as createLineNodeWebhookHandler, o as downloadLineMedia, r as readLineWebhookRequestBody, s as firstDefined, t as monitorLineProvider } from "./monitor-DzkYuWhv.js";
|
|
5
5
|
import { t as probeLineBot } from "./probe-BslD77tJ.js";
|
|
6
|
-
import { A as buildTemplateMessageFromPayload, B as createYesNoConfirm, C as pushMessagesLine, D as sendMessageLine, E as replyMessageLine, F as createImageCarousel, I as createImageCarouselColumn, L as createLinkMenu, M as createButtonTemplate, N as createCarouselColumn, O as showLoadingAnimation, P as createConfirmTemplate, R as createProductCarousel, S as pushMessageLine, T as pushTextMessageWithQuickReplies, _ as getUserDisplayName, a as extractLinks, b as pushImageMessage, c as processLineMessage, d as createFlexMessage, f as createImageMessage, g as createVideoMessage, h as createTextMessageWithQuickReplies, i as extractCodeBlocks, j as createButtonMenu, k as resolveLineChannelAccessToken, l as stripMarkdown, m as createQuickReplyItems, n as convertLinksToFlexBubble, o as extractMarkdownTables, p as createLocationMessage, r as convertTableToFlexBubble, s as hasMarkdownToConvert, t as convertCodeBlockToFlexBubble, u as createAudioMessage, v as getUserProfile, w as pushTemplateMessage, x as pushLocationMessage, y as pushFlexMessage, z as createTemplateCarousel } from "./markdown-to-line-
|
|
6
|
+
import { A as buildTemplateMessageFromPayload, B as createYesNoConfirm, C as pushMessagesLine, D as sendMessageLine, E as replyMessageLine, F as createImageCarousel, I as createImageCarouselColumn, L as createLinkMenu, M as createButtonTemplate, N as createCarouselColumn, O as showLoadingAnimation, P as createConfirmTemplate, R as createProductCarousel, S as pushMessageLine, T as pushTextMessageWithQuickReplies, _ as getUserDisplayName, a as extractLinks, b as pushImageMessage, c as processLineMessage, d as createFlexMessage, f as createImageMessage, g as createVideoMessage, h as createTextMessageWithQuickReplies, i as extractCodeBlocks, j as createButtonMenu, k as resolveLineChannelAccessToken, l as stripMarkdown, m as createQuickReplyItems, n as convertLinksToFlexBubble, o as extractMarkdownTables, p as createLocationMessage, r as convertTableToFlexBubble, s as hasMarkdownToConvert, t as convertCodeBlockToFlexBubble, u as createAudioMessage, v as getUserProfile, w as pushTemplateMessage, x as pushLocationMessage, y as pushFlexMessage, z as createTemplateCarousel } from "./markdown-to-line-CFx7ME4o.js";
|
|
7
7
|
import { clearAccountEntryFields } from "openclaw/plugin-sdk/core";
|
|
8
8
|
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
|
|
9
9
|
import { createMessageReceiveContext } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -93,6 +93,7 @@ function startLineWebhook(options) {
|
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region extensions/line/src/rich-menu.ts
|
|
95
95
|
const USER_BATCH_SIZE = 500;
|
|
96
|
+
const graphemeSegmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
96
97
|
function getClient(opts) {
|
|
97
98
|
const account = resolveLineAccount({
|
|
98
99
|
cfg: opts.cfg,
|
|
@@ -114,13 +115,23 @@ function chunkUserIds(userIds) {
|
|
|
114
115
|
for (let i = 0; i < userIds.length; i += USER_BATCH_SIZE) batches.push(userIds.slice(i, i + USER_BATCH_SIZE));
|
|
115
116
|
return batches;
|
|
116
117
|
}
|
|
118
|
+
function truncateGraphemes(input, maxLength) {
|
|
119
|
+
let result = "";
|
|
120
|
+
let count = 0;
|
|
121
|
+
for (const { segment } of graphemeSegmenter.segment(input)) {
|
|
122
|
+
if (count >= maxLength) break;
|
|
123
|
+
result += segment;
|
|
124
|
+
count += 1;
|
|
125
|
+
}
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
117
128
|
async function createRichMenu(menu, opts) {
|
|
118
129
|
const client = getClient(opts);
|
|
119
130
|
const richMenuRequest = {
|
|
120
131
|
size: menu.size,
|
|
121
132
|
selected: menu.selected ?? false,
|
|
122
|
-
name: menu.name
|
|
123
|
-
chatBarText: menu.chatBarText
|
|
133
|
+
name: truncateGraphemes(menu.name, 300),
|
|
134
|
+
chatBarText: truncateGraphemes(menu.chatBarText, 14),
|
|
124
135
|
areas: menu.areas
|
|
125
136
|
};
|
|
126
137
|
const response = await client.createRichMenu(richMenuRequest);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/line",
|
|
3
|
-
"version": "2026.7.1-beta.
|
|
3
|
+
"version": "2026.7.1-beta.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/line",
|
|
9
|
-
"version": "2026.7.1-beta.
|
|
9
|
+
"version": "2026.7.1-beta.2",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@line/bot-sdk": "11.0.1",
|
|
12
12
|
"zod": "4.4.3"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"openclaw": ">=2026.7.1-beta.
|
|
15
|
+
"openclaw": ">=2026.7.1-beta.2"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"openclaw": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/line",
|
|
3
|
-
"version": "2026.7.1-beta.
|
|
3
|
+
"version": "2026.7.1-beta.2",
|
|
4
4
|
"description": "OpenClaw LINE channel plugin for LINE Bot API chats.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"zod": "4.4.3"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"openclaw": ">=2026.7.1-beta.
|
|
15
|
+
"openclaw": ">=2026.7.1-beta.2"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"openclaw": {
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"minHostVersion": ">=2026.4.10"
|
|
43
43
|
},
|
|
44
44
|
"compat": {
|
|
45
|
-
"pluginApi": ">=2026.7.1-beta.
|
|
45
|
+
"pluginApi": ">=2026.7.1-beta.2"
|
|
46
46
|
},
|
|
47
47
|
"build": {
|
|
48
|
-
"openclawVersion": "2026.7.1-beta.
|
|
48
|
+
"openclawVersion": "2026.7.1-beta.2"
|
|
49
49
|
},
|
|
50
50
|
"release": {
|
|
51
51
|
"publishToClawHub": true,
|