@openclaw/line 2026.12.1-beta.1 → 2026.12.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/.setup/api-BFKOcDBj.mjs +3 -0
- package/dist/.setup/{api-BEzEEC5x.mjs → api-BHi0Jdse.mjs} +1 -1
- package/dist/.setup/{card-command-CxXAu1W-.mjs → card-command-3YJcF1Sg.mjs} +1 -1
- package/dist/.setup/{channel-CP5-K_ID.mjs → channel-D8h0qJMW.mjs} +27 -11
- package/dist/.setup/{channel.runtime-D6OWIDkw.mjs → channel.runtime-BBSUSMgH.mjs} +3 -3
- package/dist/.setup/{monitor-ClTD6chi.mjs → monitor-B4Vqphj5.mjs} +4 -4
- package/dist/.setup/outbound.runtime-C41lKCRl.mjs +3 -0
- package/dist/.setup/{send-BESSixO4.mjs → send-Btj5Sv6v.mjs} +82 -21
- package/dist/.setup/{template-messages-CHhFDk8x.mjs → template-messages-5ZlXYNrb.mjs} +51 -11
- 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/index.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/package.json +4 -4
- package/dist/.setup/api-B2wI3umU.mjs +0 -3
- package/dist/.setup/outbound.runtime-WmCUvxNB.mjs +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { w as lineChannelPluginCommon } from "./channel-
|
|
1
|
+
import { w as lineChannelPluginCommon } from "./channel-D8h0qJMW.mjs";
|
|
2
2
|
import { r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-DvbBjHFi.mjs";
|
|
3
3
|
// extensions/line/src/channel.setup.ts
|
|
4
4
|
const lineSetupPlugin = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as createImageCard, i as createActionCard, o as createInfoCard, r as createReceiptCard, s as createListCard } from "./schedule-cards-D2zI0jRv.mjs";
|
|
2
|
-
import { n as createFlexMessage } from "./template-messages-
|
|
2
|
+
import { n as createFlexMessage } from "./template-messages-5ZlXYNrb.mjs";
|
|
3
3
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
5
5
|
// extensions/line/src/card-command.ts
|
|
@@ -371,7 +371,7 @@ const lineGatewayAdapter = {
|
|
|
371
371
|
if (getLineRuntime().logging.shouldLogVerbose()) ctx.log?.debug?.(`[${account.accountId}] bot check failed: ${String(err)}`);
|
|
372
372
|
}
|
|
373
373
|
ctx.log?.info(`[${account.accountId}] starting LINE provider${lineBotLabel}`);
|
|
374
|
-
const { monitorLineProvider } = await import("./monitor-
|
|
374
|
+
const { monitorLineProvider } = await import("./monitor-B4Vqphj5.mjs");
|
|
375
375
|
return await monitorLineProvider({
|
|
376
376
|
channelAccessToken: token,
|
|
377
377
|
channelSecret: secret,
|
|
@@ -1257,7 +1257,7 @@ async function explainLineRefusal(params) {
|
|
|
1257
1257
|
};
|
|
1258
1258
|
}
|
|
1259
1259
|
// extensions/line/src/outbound.ts
|
|
1260
|
-
const loadLineOutboundRuntime = createLazyRuntimeModule(() => import("./outbound.runtime-
|
|
1260
|
+
const loadLineOutboundRuntime = createLazyRuntimeModule(() => import("./outbound.runtime-C41lKCRl.mjs"));
|
|
1261
1261
|
function quotedOption(quoteToken) {
|
|
1262
1262
|
return quoteToken ? { quoteToken } : {};
|
|
1263
1263
|
}
|
|
@@ -1356,10 +1356,18 @@ const lineOutboundAdapter = {
|
|
|
1356
1356
|
};
|
|
1357
1357
|
const processed = payload.text ? outboundRuntime.processLineMessage(payload.text) : [];
|
|
1358
1358
|
const chunkLimit = runtime.channel.text.resolveTextChunkLimit(cfg, "line", accountId ?? void 0, { fallbackLimit: 5e3 });
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1359
|
+
const tablePushText = /* @__PURE__ */ new Map();
|
|
1360
|
+
const orderedMessages = processed.flatMap((segment) => {
|
|
1361
|
+
if (segment.type === "flex") return [segment.message];
|
|
1362
|
+
return outboundRuntime.chunkLineText(segment, chunkLimit, runtime.channel.text.chunkMarkdownText).map(({ text, pushText }) => {
|
|
1363
|
+
const message = {
|
|
1364
|
+
type: "text",
|
|
1365
|
+
text
|
|
1366
|
+
};
|
|
1367
|
+
if (pushText !== void 0) tablePushText.set(message, pushText);
|
|
1368
|
+
return message;
|
|
1369
|
+
});
|
|
1370
|
+
});
|
|
1363
1371
|
const hasText = orderedMessages.some((message) => message.type === "text");
|
|
1364
1372
|
const mediaUrls = resolveOutboundMediaUrls(payload);
|
|
1365
1373
|
const mediaOptions = {
|
|
@@ -1413,10 +1421,18 @@ const lineOutboundAdapter = {
|
|
|
1413
1421
|
}]);
|
|
1414
1422
|
else await recordResult(sendFlex(to, message.altText, message.contents, sendOptions));
|
|
1415
1423
|
} else if (isLast && hasQuickReplies) await sendTextWithQuickReply(message.text, quoteToken);
|
|
1416
|
-
else
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1424
|
+
else {
|
|
1425
|
+
const pushText = tablePushText.get(message);
|
|
1426
|
+
if (pushText !== void 0) await sendMessageBatch([{
|
|
1427
|
+
...message,
|
|
1428
|
+
text: pushText,
|
|
1429
|
+
...quotedOption(quoteToken)
|
|
1430
|
+
}]);
|
|
1431
|
+
else await recordResult(sendText(to, message.text, {
|
|
1432
|
+
...sendOptions,
|
|
1433
|
+
...quotedOption(quoteToken)
|
|
1434
|
+
}));
|
|
1435
|
+
}
|
|
1420
1436
|
}
|
|
1421
1437
|
} else {
|
|
1422
1438
|
const quickReplyMessages = [];
|
|
@@ -1501,7 +1517,7 @@ const lineMessageAdapter = createChannelMessageAdapterFromOutbound({
|
|
|
1501
1517
|
}
|
|
1502
1518
|
});
|
|
1503
1519
|
// extensions/line/src/channel.ts
|
|
1504
|
-
const loadLineChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
1520
|
+
const loadLineChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-BBSUSMgH.mjs"));
|
|
1505
1521
|
const lineSecurityAdapter = createRestrictSendersChannelSecurity({
|
|
1506
1522
|
channelKey: "line",
|
|
1507
1523
|
resolveDmPolicy: (account) => account.config.dmPolicy,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as probeLineBot } from "./channel-
|
|
2
|
-
import { d as showLoadingAnimation, o as pushMessageLine } from "./send-
|
|
3
|
-
import { monitorLineProvider } from "./monitor-
|
|
1
|
+
import { o as probeLineBot } from "./channel-D8h0qJMW.mjs";
|
|
2
|
+
import { d as showLoadingAnimation, o as pushMessageLine } from "./send-Btj5Sv6v.mjs";
|
|
3
|
+
import { monitorLineProvider } from "./monitor-B4Vqphj5.mjs";
|
|
4
4
|
export { monitorLineProvider, probeLineBot, pushMessageLine, showLoadingAnimation };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { C as resolveLineGroupConfigEntry, _ as reportLineQuoteCarrierMissing, b as buildLineQuickReplyFallbackText, c as createLineQuickReply, d as parseLineQuestionPostbackData, f as resolveLineQuestionPostback, g as recordLineQuoteToken, h as readLineQuoteToken, i as resolveLineNonDispatchRetryable, l as prepareLineReplyPayload, m as canCarryLineQuoteToken, n as explainLineRefusal, p as applyLineQuoteToken, r as findLineHttpError, u as isLineQuestionPostbackData, v as resolveLineQuoteToken, x as buildLineMediaMessage } from "./channel-
|
|
1
|
+
import { C as resolveLineGroupConfigEntry, _ as reportLineQuoteCarrierMissing, b as buildLineQuickReplyFallbackText, c as createLineQuickReply, d as parseLineQuestionPostbackData, f as resolveLineQuestionPostback, g as recordLineQuoteToken, h as readLineQuoteToken, i as resolveLineNonDispatchRetryable, l as prepareLineReplyPayload, m as canCarryLineQuoteToken, n as explainLineRefusal, p as applyLineQuoteToken, r as findLineHttpError, u as isLineQuestionPostbackData, v as resolveLineQuoteToken, x as buildLineMediaMessage } from "./channel-D8h0qJMW.mjs";
|
|
2
2
|
import { n as resolveDefaultLineAccountId, r as resolveLineAccount } from "./accounts-Dm_NoU7R.mjs";
|
|
3
3
|
import { a as normalizeLineAllowEntry } from "./setup-surface-DvbBjHFi.mjs";
|
|
4
4
|
import { t as getLineRuntime } from "./runtime-C9ldw-V4.mjs";
|
|
5
5
|
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-COhQK5XQ.mjs";
|
|
6
|
-
import { n as createFlexMessage, r as createLocationMessage, t as buildTemplateMessageFromPayload } from "./template-messages-
|
|
7
|
-
import { d as showLoadingAnimation, f as quotesLineBotMessage, n as getUserDisplayName, o as pushMessageLine, p as
|
|
6
|
+
import { n as createFlexMessage, r as createLocationMessage, t as buildTemplateMessageFromPayload } from "./template-messages-5ZlXYNrb.mjs";
|
|
7
|
+
import { d as showLoadingAnimation, f as quotesLineBotMessage, m as processLineMessage, n as getUserDisplayName, o as pushMessageLine, p as chunkLineText, r as getUserProfile, s as pushMessagesLine, t as getLineGroupName, u as replyMessageLine } from "./send-Btj5Sv6v.mjs";
|
|
8
8
|
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
|
9
9
|
import { resolveChannelGroupsConfigPath } from "openclaw/plugin-sdk/channel-policy";
|
|
10
10
|
import { normalizeOptionalString, normalizeStringEntries, readNonEmptyStringPreservingWhitespace } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -138,7 +138,7 @@ async function deliverLineAutoReply(params) {
|
|
|
138
138
|
}
|
|
139
139
|
if (lineData.location) richMessages.push(createLocationMessage(lineData.location));
|
|
140
140
|
const visibleText = payload.text ? sanitizeAssistantVisibleText(payload.text) : "";
|
|
141
|
-
const markdownMessages = (visibleText ? processLineMessage(visibleText) : []).flatMap((segment) => segment.type === "flex" ? [createFlexMessage(segment.message.altText, segment.message.contents)] :
|
|
141
|
+
const markdownMessages = (visibleText ? processLineMessage(visibleText) : []).flatMap((segment) => segment.type === "flex" ? [createFlexMessage(segment.message.altText, segment.message.contents)] : chunkLineText(segment, textLimit, chunkMarkdownText).map(({ text }) => ({
|
|
142
142
|
type: "text",
|
|
143
143
|
text
|
|
144
144
|
})));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { i as createQuickReplyItems, n as createFlexMessage, r as createLocationMessage, t as buildTemplateMessageFromPayload } from "./template-messages-5ZlXYNrb.mjs";
|
|
2
|
+
import { a as pushLocationMessage, c as pushTemplateMessage, i as pushFlexMessage, l as pushTextMessageWithQuickReplies, m as processLineMessage, o as pushMessageLine, p as chunkLineText, s as pushMessagesLine } from "./send-Btj5Sv6v.mjs";
|
|
3
|
+
export { buildTemplateMessageFromPayload, chunkLineText, createFlexMessage, createLocationMessage, createQuickReplyItems, processLineMessage, pushFlexMessage, pushLocationMessage, pushMessageLine, pushMessagesLine, pushTemplateMessage, pushTextMessageWithQuickReplies };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { S as normalizeLineMessagingTarget, a as runLinePushWithRetries, p as applyLineQuoteToken, r as findLineHttpError, s as resolveLineChannelAccessToken, x as buildLineMediaMessage, y as withoutLineQuoteTokens } from "./channel-
|
|
1
|
+
import { S as normalizeLineMessagingTarget, a as runLinePushWithRetries, p as applyLineQuoteToken, r as findLineHttpError, s as resolveLineChannelAccessToken, x as buildLineMediaMessage, y as withoutLineQuoteTokens } from "./channel-D8h0qJMW.mjs";
|
|
2
2
|
import { r as resolveLineAccount } from "./accounts-Dm_NoU7R.mjs";
|
|
3
3
|
import { _ as fitsLineFlexBubble, c as cardBox, l as cardText, p as normalizeLineMessage, r as createReceiptCard, v as toFlexMessage } from "./schedule-cards-D2zI0jRv.mjs";
|
|
4
|
-
import { i as createQuickReplyItems, n as createFlexMessage, r as createLocationMessage } from "./template-messages-
|
|
4
|
+
import { i as createQuickReplyItems, n as createFlexMessage, r as createLocationMessage } from "./template-messages-5ZlXYNrb.mjs";
|
|
5
5
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
6
6
|
import { createChannelPartialDeliveryError } from "openclaw/plugin-sdk/channel-inbound";
|
|
7
|
-
import { markdownToIRWithMeta, stripMarkdown } from "openclaw/plugin-sdk/text-chunking";
|
|
7
|
+
import { chunkTextRanges, markdownToIRWithMeta, stripMarkdown } from "openclaw/plugin-sdk/text-chunking";
|
|
8
8
|
import { createStaleWhileRevalidateCache } from "openclaw/plugin-sdk/collection-runtime";
|
|
9
9
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
10
10
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -19,6 +19,42 @@ import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
|
19
19
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
20
20
|
import { createDedupeCache } from "openclaw/plugin-sdk/dedupe-runtime";
|
|
21
21
|
// extensions/line/src/markdown-to-line.ts
|
|
22
|
+
/** Prose uses LINE's Markdown chunker. A projected table needs contiguous, lossless slices. */
|
|
23
|
+
function chunkLineText(segment, limit, chunkMarkdown) {
|
|
24
|
+
if (!segment.parts) return chunkMarkdown(segment.text, limit).map((text) => ({ text }));
|
|
25
|
+
const chunks = [];
|
|
26
|
+
let text = "";
|
|
27
|
+
let firstTable = Infinity;
|
|
28
|
+
let lastTable = 0;
|
|
29
|
+
const flush = () => {
|
|
30
|
+
const start = Math.min(text.length - text.trimStart().length, firstTable);
|
|
31
|
+
const end = Math.max(text.trimEnd().length, lastTable);
|
|
32
|
+
const pushText = text.slice(start, end);
|
|
33
|
+
if (pushText) chunks.push(pushText === text.trim() ? { text } : {
|
|
34
|
+
text,
|
|
35
|
+
pushText
|
|
36
|
+
});
|
|
37
|
+
text = "";
|
|
38
|
+
firstTable = Infinity;
|
|
39
|
+
lastTable = 0;
|
|
40
|
+
};
|
|
41
|
+
for (const part of segment.parts) {
|
|
42
|
+
const pieces = part.table ? chunkTextRanges(part.text, {
|
|
43
|
+
limit,
|
|
44
|
+
mode: "preferred"
|
|
45
|
+
}).map(({ start, end }) => part.text.slice(start, end)) : chunkMarkdown(part.text, limit);
|
|
46
|
+
for (const [index, piece] of pieces.entries()) {
|
|
47
|
+
if (!part.table && index > 0 || limit > 0 && text.length + piece.length > limit) flush();
|
|
48
|
+
if (part.table) {
|
|
49
|
+
firstTable = Math.min(firstTable, text.length);
|
|
50
|
+
lastTable = text.length + piece.length;
|
|
51
|
+
}
|
|
52
|
+
text += piece;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
flush();
|
|
56
|
+
return chunks;
|
|
57
|
+
}
|
|
22
58
|
const LINE_MARKDOWN_OPTIONS = {
|
|
23
59
|
assistantTranscriptRoleHeaders: true,
|
|
24
60
|
autolink: false,
|
|
@@ -44,6 +80,16 @@ function linkAddsHref(rawLabel, href) {
|
|
|
44
80
|
const label = rawLabel.trim();
|
|
45
81
|
return Boolean(href && label && label !== href && `mailto:${label}` !== href);
|
|
46
82
|
}
|
|
83
|
+
function trimOutsideInlineCode(text, ir, codeSpans) {
|
|
84
|
+
const first = codeSpans[0];
|
|
85
|
+
const last = codeSpans.at(-1);
|
|
86
|
+
if (!first || !last) return text.trim();
|
|
87
|
+
const before = ir.text.slice(0, first.start).replace(/<\/?u>/gi, "");
|
|
88
|
+
const after = ir.text.slice(last.end).replace(/<\/?u>/gi, "");
|
|
89
|
+
const start = Math.min(before.length, text.length - text.trimStart().length);
|
|
90
|
+
const end = text.length - Math.min(after.length, text.length - text.trimEnd().length);
|
|
91
|
+
return text.slice(start, end);
|
|
92
|
+
}
|
|
47
93
|
function projectPlainText(ir, omitted = [], additionalInsertions = [], onSegment) {
|
|
48
94
|
const insertions = [...additionalInsertions];
|
|
49
95
|
for (const link of ir.links) {
|
|
@@ -73,7 +119,19 @@ function projectPlainText(ir, omitted = [], additionalInsertions = [], onSegment
|
|
|
73
119
|
})).filter((tag) => !inlineCodeSpans.some((span) => rangesOverlap(tag, span)) && !omitted.some((span) => rangesOverlap(tag, span)));
|
|
74
120
|
const removed = [...omitted, ...underlineTags].toSorted((left, right) => left.start - right.start);
|
|
75
121
|
let output = "";
|
|
76
|
-
let
|
|
122
|
+
let parts = [];
|
|
123
|
+
const flushText = () => {
|
|
124
|
+
const tail = parts.length ? output.trimEnd() : output.trim();
|
|
125
|
+
if (parts.length && tail) parts.push({ text: tail });
|
|
126
|
+
const text = parts.length ? parts.map((part) => part.text).join("") : tail;
|
|
127
|
+
if (text) onSegment?.({
|
|
128
|
+
type: "text",
|
|
129
|
+
text,
|
|
130
|
+
...parts.some((part) => part.table) ? { parts } : {}
|
|
131
|
+
});
|
|
132
|
+
output = "";
|
|
133
|
+
parts = [];
|
|
134
|
+
};
|
|
77
135
|
let cursor = 0;
|
|
78
136
|
let insertionIndex = 0;
|
|
79
137
|
const appendRange = (end) => {
|
|
@@ -83,17 +141,21 @@ function projectPlainText(ir, omitted = [], additionalInsertions = [], onSegment
|
|
|
83
141
|
if (insertion.position >= cursor) {
|
|
84
142
|
output += ir.text.slice(cursor, insertion.position);
|
|
85
143
|
if ("text" in insertion) output += insertion.text;
|
|
86
|
-
else if (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
144
|
+
else if ("tableText" in insertion) {
|
|
145
|
+
output += "\n\n";
|
|
146
|
+
const preceding = parts.length ? output : output.trimStart();
|
|
147
|
+
if (preceding) parts.push({ text: preceding });
|
|
148
|
+
if (insertion.tableText) parts.push({
|
|
149
|
+
text: insertion.tableText,
|
|
150
|
+
table: insertion.preserveTableSpaces
|
|
91
151
|
});
|
|
152
|
+
output = "\n\n";
|
|
153
|
+
} else if (onSegment) {
|
|
154
|
+
flushText();
|
|
92
155
|
onSegment({
|
|
93
156
|
type: "flex",
|
|
94
157
|
message: insertion.message
|
|
95
158
|
});
|
|
96
|
-
segmentStart = output.length;
|
|
97
159
|
}
|
|
98
160
|
cursor = insertion.position;
|
|
99
161
|
}
|
|
@@ -109,16 +171,13 @@ function projectPlainText(ir, omitted = [], additionalInsertions = [], onSegment
|
|
|
109
171
|
}
|
|
110
172
|
appendRange(ir.text.length);
|
|
111
173
|
if (onSegment) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
type: "text",
|
|
115
|
-
text: trailingText
|
|
116
|
-
});
|
|
174
|
+
flushText();
|
|
175
|
+
return "";
|
|
117
176
|
}
|
|
118
|
-
return output
|
|
177
|
+
return trimOutsideInlineCode(output, ir, inlineCodeSpans);
|
|
119
178
|
}
|
|
120
179
|
function renderTableCell(cell) {
|
|
121
|
-
if (!cell.text
|
|
180
|
+
if (!cell.text) return {
|
|
122
181
|
text: "-",
|
|
123
182
|
hasMarkup: false
|
|
124
183
|
};
|
|
@@ -184,7 +243,7 @@ function renderTableCell(cell) {
|
|
|
184
243
|
}
|
|
185
244
|
}
|
|
186
245
|
return {
|
|
187
|
-
text: spans.map((span) => span.text ?? "").join("")
|
|
246
|
+
text: trimOutsideInlineCode(spans.map((span) => span.text ?? "").join(""), cell, codeSpans) || "-",
|
|
188
247
|
...hasMarkup ? { contents: spans } : {},
|
|
189
248
|
hasMarkup
|
|
190
249
|
};
|
|
@@ -253,7 +312,8 @@ function processLineMessage(text) {
|
|
|
253
312
|
for (const table of tables) {
|
|
254
313
|
const bubble = convertTableToFlexBubble(table);
|
|
255
314
|
if (!bubble || !fitsLineFlexBubble(bubble)) {
|
|
256
|
-
const
|
|
315
|
+
const hasPaddedCode = (cell) => cell.styles.some(({ style, start, end }) => style === "code" && /^\s|\s$/u.test(cell.text.slice(start, end)));
|
|
316
|
+
const markdownCell = (cell) => projectPlainText(cell).replace(/[\\|`*_[\]~<>&]/gu, "\\$&").replace(/\r?\n/gu, " ").replace(/^\s+|(?<=\S)\s+$/gu, (edge) => "`" + (/[^ ]/u.test(edge) ? ` ${edge} ` : edge) + "`");
|
|
257
317
|
const markdownRow = (cells) => `| ${cells.map(markdownCell).join(" | ")} |`;
|
|
258
318
|
const markdown = [
|
|
259
319
|
markdownRow(table.headerCells),
|
|
@@ -262,7 +322,8 @@ function processLineMessage(text) {
|
|
|
262
322
|
].join("\n");
|
|
263
323
|
plainTextInsertions.push({
|
|
264
324
|
position: table.placeholderOffset,
|
|
265
|
-
|
|
325
|
+
tableText: projectPlainText(parseLineMarkdown(markdown, "bullets").ir),
|
|
326
|
+
preserveTableSpaces: table.headerCells.some(hasPaddedCode) || table.rowCells.some((row) => row.some(hasPaddedCode))
|
|
266
327
|
});
|
|
267
328
|
continue;
|
|
268
329
|
}
|
|
@@ -600,4 +661,4 @@ async function getLineGroupName(groupId, opts) {
|
|
|
600
661
|
return;
|
|
601
662
|
}
|
|
602
663
|
}
|
|
603
|
-
export { pushLocationMessage as a, pushTemplateMessage as c, showLoadingAnimation as d, quotesLineBotMessage as f, pushFlexMessage as i, pushTextMessageWithQuickReplies as l, getUserDisplayName as n, pushMessageLine as o,
|
|
664
|
+
export { pushLocationMessage as a, pushTemplateMessage as c, showLoadingAnimation as d, quotesLineBotMessage as f, pushFlexMessage as i, pushTextMessageWithQuickReplies as l, processLineMessage as m, getUserDisplayName as n, pushMessageLine as o, chunkLineText as p, getUserProfile as r, pushMessagesLine as s, getLineGroupName as t, replyMessageLine as u };
|
|
@@ -25,17 +25,57 @@ function getGraphemeSegmenter() {
|
|
|
25
25
|
* a leading surrogate pair can exceed maxEnd by one code unit.
|
|
26
26
|
*/
|
|
27
27
|
function findGraphemeChunkEnd(text, start, maxEnd, preferredEnd = maxEnd, allowPartial = true) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
return graphemeChunkEndFinder(text, false)(start, maxEnd, preferredEnd, allowPartial);
|
|
29
|
+
}
|
|
30
|
+
function indexGraphemeBoundaries(text) {
|
|
31
|
+
const starts = new Uint32Array(Math.ceil(text.length / 32));
|
|
32
|
+
for (const { index } of getGraphemeSegmenter().segment(text)) {
|
|
33
|
+
const word = Math.floor(index / 32);
|
|
34
|
+
starts[word] = (starts[word] ?? 0) | 1 << index % 32;
|
|
35
|
+
}
|
|
36
|
+
const preceding = new Uint32Array(starts.length);
|
|
37
|
+
let last = 0;
|
|
38
|
+
for (const [word, bits] of starts.entries()) {
|
|
39
|
+
preceding[word] = last;
|
|
40
|
+
if (bits !== 0) last = word * 32 + 31 - Math.clz32(bits);
|
|
41
|
+
}
|
|
42
|
+
return (offset) => {
|
|
43
|
+
const word = Math.floor(offset / 32);
|
|
44
|
+
const throughOffset = 4294967295 >>> 31 - (offset & 31);
|
|
45
|
+
const bits = (starts[word] ?? 0) & throughOffset;
|
|
46
|
+
return bits === 0 ? preceding[word] ?? 0 : word * 32 + 31 - Math.clz32(bits);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function graphemeChunkEndFinder(text, reuse) {
|
|
50
|
+
let lastBoundary = 0;
|
|
51
|
+
let indexed;
|
|
52
|
+
return (start, maxEnd, preferredEnd = maxEnd, allowPartial = true) => {
|
|
53
|
+
const hardEnd = Math.min(maxEnd, text.length);
|
|
54
|
+
if (hardEnd <= start) return start;
|
|
55
|
+
const preferred = Number.isInteger(preferredEnd) && preferredEnd > start && preferredEnd <= hardEnd ? preferredEnd : hardEnd;
|
|
56
|
+
if (preferred === text.length) return preferred;
|
|
57
|
+
const before = text.charCodeAt(preferred - 1);
|
|
58
|
+
const after = text.charCodeAt(preferred);
|
|
59
|
+
if (Number.isInteger(preferred) && before <= 127 && after <= 127 && !(before === 13 && after === 10)) {
|
|
60
|
+
lastBoundary = preferred;
|
|
61
|
+
return preferred;
|
|
62
|
+
}
|
|
63
|
+
const from = start === 0 ? 0 : lastBoundary ?? 0;
|
|
64
|
+
if (reuse && start !== 0 && (lastBoundary === void 0 || from > start || start - from > hardEnd - start)) indexed ??= indexGraphemeBoundaries(text);
|
|
65
|
+
const segments = indexed ? void 0 : getGraphemeSegmenter().segment(text.slice(from, hardEnd + 2));
|
|
66
|
+
const boundaryAt = indexed ?? ((position) => from + (segments?.containing(position - from)?.index ?? position - from));
|
|
67
|
+
let end = boundaryAt(preferred);
|
|
68
|
+
if (end <= start && preferred < hardEnd) end = hardEnd === text.length ? hardEnd : boundaryAt(hardEnd);
|
|
69
|
+
if (end > start) {
|
|
70
|
+
lastBoundary = end;
|
|
71
|
+
return end;
|
|
72
|
+
}
|
|
73
|
+
if (allowPartial) {
|
|
74
|
+
lastBoundary = void 0;
|
|
75
|
+
return avoidTrailingHighSurrogateBreak(text, start, hardEnd);
|
|
76
|
+
}
|
|
77
|
+
return start;
|
|
78
|
+
};
|
|
39
79
|
}
|
|
40
80
|
// extensions/line/src/template-messages.ts
|
|
41
81
|
const COMPACT_TEMPLATE_TEXT_LIMIT = 60;
|
|
@@ -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-Dm_NoU7R.mjs","sha256":"fbb3c981ee38eddff00d1f154e26a072649d43bb8648fad0e9318725f3c28b97","facadeSource":null,"sources":["extensions/line/src/accounts.ts"]},{"output":".setup/api-
|
|
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-Dm_NoU7R.mjs","sha256":"fbb3c981ee38eddff00d1f154e26a072649d43bb8648fad0e9318725f3c28b97","facadeSource":null,"sources":["extensions/line/src/accounts.ts"]},{"output":".setup/api-BFKOcDBj.mjs","sha256":"ef7650988c2f177e9f598f44403379ddaa465c4c9e39c5b6f0a1e8acab512ef9","facadeSource":"extensions/line/api.ts","sources":[]},{"output":".setup/api-BHi0Jdse.mjs","sha256":"5967c7c106b4271b513271db9ab02a8d69516dcc5368bb098a8423532185017f","facadeSource":null,"sources":["extensions/line/src/channel.setup.ts"]},{"output":".setup/card-command-3YJcF1Sg.mjs","sha256":"dd26a515c2f6f2b85fc639a229e3ecf90cf2ca398d188b58ce9fd8d1a8068cf4","facadeSource":"extensions/line/src/card-command.ts","sources":["extensions/line/src/card-command.ts"]},{"output":".setup/channel-D8h0qJMW.mjs","sha256":"f9e97b2ae4333aed8b025c38697a3d88d7a9b3bd6161654dbadf56f77c7e489e","facadeSource":null,"sources":["extensions/line/src/channel-access-token.ts","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/messaging-target.ts","extensions/line/src/outbound-media.ts","extensions/line/src/outbound.ts","extensions/line/src/probe.ts","extensions/line/src/question-postback.ts","extensions/line/src/quick-reply-fallback.ts","extensions/line/src/quote-tokens.ts","extensions/line/src/rich-message-schema.ts","extensions/line/src/rich-messages.ts","extensions/line/src/send-retry.ts","extensions/line/src/status.ts"]},{"output":".setup/channel.runtime-BBSUSMgH.mjs","sha256":"f0f2cb49fe54919310d99fa8ddac9a55ddecd25abb1890270af1b4ba3f70c346","facadeSource":"extensions/line/src/channel.runtime.ts","sources":[]},{"output":".setup/monitor-B4Vqphj5.mjs","sha256":"5eb4f583aad361f684f3b0358524670351c9f409701385f63a862ffd4a2f5a06","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-C41lKCRl.mjs","sha256":"abb408cf2eccd8081907a013f5160749b0e28ee463c33487404629449ce911d4","facadeSource":"extensions/line/src/outbound.runtime.ts","sources":[]},{"output":".setup/runtime-C9ldw-V4.mjs","sha256":"ac1144683eff8dc37f71e7b26f00dd5f692e4c35b6ac4a14d11ba81603dc0414","facadeSource":null,"sources":["extensions/line/src/runtime.ts"]},{"output":".setup/schedule-cards-D2zI0jRv.mjs","sha256":"0d015e0923b7eb479ede357ac1497a415c646f480a89bca9a4ff4012f53a2436","facadeSource":null,"sources":["extensions/line/src/actions.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"]},{"output":".setup/send-Btj5Sv6v.mjs","sha256":"09757980b856feadfbef4617597c6112f4249d44b3547609189d1359e5106e04","facadeSource":null,"sources":["extensions/line/src/markdown-to-line.ts","extensions/line/src/outbound-message-log.ts","extensions/line/src/send.ts"]},{"output":".setup/setup-surface-DvbBjHFi.mjs","sha256":"9d8e2bdd72c9e37a53b10784ca83e0257e8ce7da2f40f8fb279132babf872430","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-5ZlXYNrb.mjs","sha256":"c45ea3e83fda48337869f85901d62a088d1f9a435f6f3c2b51d82fdc9db12b1c","facadeSource":null,"sources":["extensions/line/src/template-messages.ts","packages/normalization-core/src/grapheme.ts","packages/normalization-core/src/utf16-slice.ts"]},{"output":".setup/webhook-spool-contract-COhQK5XQ.mjs","sha256":"c5980d6b5431bd7ffab5f3c3351ac3aa3c7d477f1aec4244e1f3d8b01d704743","facadeSource":null,"sources":["extensions/line/src/webhook-spool-contract.ts"]},{"output":"api.js","sha256":"5e9f58c90690d4285e993be486cdfdb389c60a2461ffb43b27cec20421b49e44","facadeSource":"extensions/line/api.ts","sources":[]},{"output":"channel-plugin-api.js","sha256":"24d7f13d277266f1abd237a3e977b7730b37348fe26417b8a42d6ef12ff7ec79","facadeSource":"extensions/line/channel-plugin-api.ts","sources":[]},{"output":"contract-api.js","sha256":"88215026ff1655afd96c12893f7d2efdbcfacd9b21c5029e1653de305c208773","facadeSource":"extensions/line/contract-api.ts","sources":[]},{"output":"doctor-contract-api.js","sha256":"a516c654e8d5273dd36fd75728a10b044021efb68815296dd0400b1958a49dbe","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":"f1704905a543e6b32361a8b5231ceddfd4bf9ea2bf324730d296d9f462fbeebd","facadeSource":"extensions/line/index.ts","sources":["extensions/line/index.ts"]},{"output":"runtime-api.js","sha256":"e37fbce0148c490628ce5edc25492212c1a2d3a7c3f084353a5ee49972159886","facadeSource":"extensions/line/runtime-api.ts","sources":[]},{"output":"secret-contract-api.js","sha256":"4824eb0315431709e20d35bb056c00eae3498212e57bda4dd9cdbb24f3db07c4","facadeSource":"extensions/line/secret-contract-api.ts","sources":["extensions/line/secret-contract-api.ts"]},{"output":"setup-api.js","sha256":"730732424bb98bbceaca6d6e982a03e799f30200b1413fc0bd82aef62865b256","facadeSource":"extensions/line/setup-api.ts","sources":[]},{"output":"setup-entry.js","sha256":"ab5c1144dfdd792f279b3be7f1916fbfe48bdf7196e05a6b2f21483d78d8adf7","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-D8h0qJMW.mjs";
|
|
2
|
+
import { t as lineSetupPlugin } from "./.setup/api-BHi0Jdse.mjs";
|
|
3
3
|
export { linePlugin, lineSetupPlugin };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as linePlugin } from "./.setup/channel-
|
|
1
|
+
export { t as linePlugin } from "./.setup/channel-D8h0qJMW.mjs";
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ 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-3YJcF1Sg.mjs");
|
|
25
25
|
return await handleLineCardCommand(ctx.args);
|
|
26
26
|
}
|
|
27
27
|
});
|
package/dist/setup-entry.js
CHANGED
|
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
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-BFKOcDBj.mjs", import.meta.url).href),
|
|
8
8
|
exportName: "lineSetupPlugin"
|
|
9
9
|
}
|
|
10
10
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/line",
|
|
3
|
-
"version": "2026.12.1-beta.
|
|
3
|
+
"version": "2026.12.1-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.12.1-beta.
|
|
16
|
+
"openclaw": ">=2026.12.1-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.12.1-beta.
|
|
125
|
+
"pluginApi": ">=2026.12.1-beta.2"
|
|
126
126
|
},
|
|
127
127
|
"build": {
|
|
128
|
-
"openclawVersion": "2026.12.1-beta.
|
|
128
|
+
"openclawVersion": "2026.12.1-beta.2"
|
|
129
129
|
},
|
|
130
130
|
"release": {
|
|
131
131
|
"publishToClawHub": true,
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { i as createQuickReplyItems, n as createFlexMessage, r as createLocationMessage, t as buildTemplateMessageFromPayload } from "./template-messages-CHhFDk8x.mjs";
|
|
2
|
-
import { a as pushLocationMessage, c as pushTemplateMessage, i as pushFlexMessage, l as pushTextMessageWithQuickReplies, o as pushMessageLine, p as processLineMessage, s as pushMessagesLine } from "./send-BESSixO4.mjs";
|
|
3
|
-
export { buildTemplateMessageFromPayload, createFlexMessage, createLocationMessage, createQuickReplyItems, processLineMessage, pushFlexMessage, pushLocationMessage, pushMessageLine, pushMessagesLine, pushTemplateMessage, pushTextMessageWithQuickReplies };
|