@openclaw/line 2026.9.8 → 2026.10.1-beta.1

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.
@@ -0,0 +1,3 @@
1
+ import { t as linePlugin } from "./channel-InKuXaRS.mjs";
2
+ import { t as lineSetupPlugin } from "./api-CMU7bG-C.mjs";
3
+ export { linePlugin, lineSetupPlugin };
@@ -1,5 +1,5 @@
1
- import { l as lineChannelPluginCommon } from "./channel-DN6Za8Vm.mjs";
2
- import { r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-CbfkmkIS.mjs";
1
+ import { c as lineChannelPluginCommon } from "./channel-InKuXaRS.mjs";
2
+ import { r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-1jkHGWg7.mjs";
3
3
  //#region extensions/line/src/channel.setup.ts
4
4
  const lineSetupPlugin = {
5
5
  id: "line",
@@ -1,5 +1,5 @@
1
- import { d as createActionCard, f as createImageCard, m as createListCard, p as createInfoCard, u as createReceiptCard } from "./send-retry-DV6I0muq.mjs";
2
- import { t as createFlexMessage } from "./send-DOY1WTxv.mjs";
1
+ import { d as createActionCard, f as createImageCard, m as createListCard, p as createInfoCard, u as createReceiptCard } from "./send-retry-B9Nor0-J.mjs";
2
+ import { t as createFlexMessage } from "./send-DAwROcyQ.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
@@ -1,7 +1,7 @@
1
1
  import { n as resolveDefaultLineAccountId, r as resolveLineAccount, t as listLineAccountIds } from "./accounts-DOiM8-y3.mjs";
2
- import { i as hasLineCredentials, r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-CbfkmkIS.mjs";
2
+ import { a as normalizeLineAllowEntry, i as hasLineCredentials, r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-1jkHGWg7.mjs";
3
3
  import { t as getLineRuntime } from "./runtime-V7yh9OeC.mjs";
4
- import { M as inferLineTargetChatType, N as normalizeLineMessagingTarget, O as reportLineQuoteCarrierMissing, S as fitsLineFlexBubble, T as canCarryLineQuoteToken, b as truncateLineActionLabel, c as createAgendaCard, d as createActionCard, g as messageAction, h as createCardBubble, j as buildLineMediaMessage, k as resolveLineQuoteToken, l as createEventCard, s as createLineSendReceipt, t as explainLineRefusal, y as postbackAction } from "./send-retry-DV6I0muq.mjs";
4
+ import { M as inferLineTargetChatType, N as normalizeLineMessagingTarget, O as reportLineQuoteCarrierMissing, S as fitsLineFlexBubble, T as canCarryLineQuoteToken, _ as messageAction, b as truncateLineActionLabel, c as createAgendaCard, d as createActionCard, g as createCardTitle, h as createCardBubble, j as buildLineMediaMessage, k as resolveLineQuoteToken, l as createEventCard, s as createLineSendReceipt, t as explainLineRefusal, y as postbackAction } from "./send-retry-B9Nor0-J.mjs";
5
5
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
6
6
  import { buildDmGroupAccountAllowlistAdapter, createFlatAllowlistOverrideResolver } from "openclaw/plugin-sdk/allowlist-config-edit";
7
7
  import { buildChannelOutboundSessionRoute, createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
@@ -58,9 +58,6 @@ const lineBindingsAdapter = {
58
58
  };
59
59
  //#endregion
60
60
  //#region extensions/line/src/config-adapter.ts
61
- function normalizeLineAllowFrom(entry) {
62
- return entry.replace(/^line:(?:user:)?/i, "");
63
- }
64
61
  const lineConfigAdapter = createScopedChannelConfigAdapter({
65
62
  sectionKey: "line",
66
63
  listAccountIds: listLineAccountIds,
@@ -77,7 +74,7 @@ const lineConfigAdapter = createScopedChannelConfigAdapter({
77
74
  "name"
78
75
  ],
79
76
  resolveAllowFrom: (account) => account.config.allowFrom,
80
- formatAllowFrom: (allowFrom) => normalizeStringEntries(allowFrom).map(normalizeLineAllowFrom)
77
+ formatAllowFrom: (allowFrom) => normalizeStringEntries(allowFrom).map(normalizeLineAllowEntry)
81
78
  });
82
79
  //#endregion
83
80
  //#region extensions/line/src/config-schema.ts
@@ -172,14 +169,6 @@ const lineChannelPluginCommon = {
172
169
  }
173
170
  };
174
171
  //#endregion
175
- //#region extensions/line/src/bot-access.ts
176
- function normalizeLineAllowEntry(value) {
177
- const trimmed = String(value).trim();
178
- if (!trimmed) return "";
179
- if (trimmed === "*") return "*";
180
- return trimmed.replace(/^line:(?:user:)?/i, "");
181
- }
182
- //#endregion
183
172
  //#region extensions/line/src/group-keys.ts
184
173
  function resolveLineGroupLookupIds(groupId) {
185
174
  const normalized = groupId?.trim();
@@ -319,7 +308,7 @@ const lineDoctor = {
319
308
  };
320
309
  //#endregion
321
310
  //#region extensions/line/src/status.ts
322
- const loadLineProbeRuntime$1 = createLazyRuntimeModule(() => import("./probe.runtime-Cj08-BZ1.mjs"));
311
+ const loadLineProbeRuntime$1 = createLazyRuntimeModule(() => import("./probe.runtime-C6LYzOHu.mjs"));
323
312
  const collectLineCredentialIssues = createDependentCredentialStatusIssueCollector({
324
313
  channel: "line",
325
314
  dependencySourceKey: "tokenSource",
@@ -392,8 +381,8 @@ const lineStatusAdapter = createComputedAccountStatusAdapter({
392
381
  });
393
382
  //#endregion
394
383
  //#region extensions/line/src/gateway.ts
395
- const loadLineProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-Cj08-BZ1.mjs"));
396
- const loadLineMonitorRuntime = createLazyRuntimeModule(() => import("./monitor.runtime-DwH2zK48.mjs"));
384
+ const loadLineProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-C6LYzOHu.mjs"));
385
+ const loadLineMonitorRuntime = createLazyRuntimeModule(() => import("./monitor.runtime-C6Kgs5BI.mjs"));
397
386
  const lineGatewayAdapter = {
398
387
  startAccount: async (ctx) => {
399
388
  const account = ctx.account;
@@ -417,7 +406,8 @@ const lineGatewayAdapter = {
417
406
  if (getLineRuntime().logging.shouldLogVerbose()) ctx.log?.debug?.(`[${account.accountId}] bot probe failed: ${String(err)}`);
418
407
  }
419
408
  ctx.log?.info(`[${account.accountId}] starting LINE provider${lineBotLabel}`);
420
- return await (getLineRuntime().channel.line?.monitorLineProvider ?? (await loadLineMonitorRuntime()).monitorLineProvider)({
409
+ const { monitorLineProvider } = await loadLineMonitorRuntime();
410
+ return await monitorLineProvider({
421
411
  channelAccessToken: token,
422
412
  channelSecret: secret,
423
413
  accountId: account.accountId,
@@ -490,14 +480,7 @@ function horizontalRow(contents, options = {}) {
490
480
  }
491
481
  function createMediaPlayerCard(params) {
492
482
  const { title, subtitle, source, imageUrl, isPlaying, progress, controls, extraActions } = params;
493
- const trackInfo = [{
494
- type: "text",
495
- text: title,
496
- weight: "bold",
497
- size: "xl",
498
- color: "#111111",
499
- wrap: true
500
- }];
483
+ const trackInfo = [createCardTitle(title)];
501
484
  if (subtitle) trackInfo.push({
502
485
  type: "text",
503
486
  text: subtitle,
@@ -615,14 +598,7 @@ function createMediaPlayerCard(params) {
615
598
  }
616
599
  function createAppleTvRemoteCard(params) {
617
600
  const { deviceName, status, actionData } = params;
618
- const headerContents = [{
619
- type: "text",
620
- text: deviceName,
621
- weight: "bold",
622
- size: "xl",
623
- color: "#111111",
624
- wrap: true
625
- }];
601
+ const headerContents = [createCardTitle(deviceName)];
626
602
  if (status) headerContents.push({
627
603
  type: "text",
628
604
  text: status,
@@ -687,12 +663,7 @@ function createDeviceControlCard(params) {
687
663
  backgroundColor: isOnline !== false ? "#06C755" : "#FF5555",
688
664
  cornerRadius: "5px"
689
665
  }, {
690
- type: "text",
691
- text: deviceName,
692
- weight: "bold",
693
- size: "xl",
694
- color: "#111111",
695
- wrap: true,
666
+ ...createCardTitle(deviceName),
696
667
  flex: 1,
697
668
  margin: "md"
698
669
  }], { alignItems: "center" })];
@@ -810,7 +781,7 @@ async function resolveLineQuestionPostback(params) {
810
781
  }
811
782
  }
812
783
  //#endregion
813
- //#region extensions/line/src/rich-messages.ts
784
+ //#region extensions/line/src/rich-message-schema.ts
814
785
  const nonempty = () => Type.String({ minLength: 1 });
815
786
  const closed = (properties) => Type.Object(properties, { additionalProperties: false });
816
787
  const lineCardSchema = Type.Union([
@@ -881,6 +852,8 @@ const lineChannelDataSchema = Type.Optional(closed({ line: closed({
881
852
  durationMs: Type.Optional(Type.Integer({ minimum: 1 })),
882
853
  trackingId: Type.Optional(nonempty())
883
854
  }) }));
855
+ //#endregion
856
+ //#region extensions/line/src/rich-messages.ts
884
857
  const lineMessageActions = {
885
858
  describeMessageTool: ({ cfg, accountId }) => {
886
859
  const account = resolveLineAccount({
@@ -1143,7 +1116,7 @@ function createLineQuickReply(items) {
1143
1116
  }
1144
1117
  //#endregion
1145
1118
  //#region extensions/line/src/outbound.ts
1146
- const loadLineOutboundRuntime = createLazyRuntimeModule(() => import("./outbound.runtime-D_Gs99Dm.mjs"));
1119
+ const loadLineOutboundRuntime = createLazyRuntimeModule(() => import("./outbound.runtime-BwO_m4n5.mjs"));
1147
1120
  function quotedOption(quoteToken) {
1148
1121
  return quoteToken ? { quoteToken } : {};
1149
1122
  }
@@ -1162,16 +1135,9 @@ const lineOutboundAdapter = {
1162
1135
  ...rawLineData,
1163
1136
  flexMessage: renderLineCard(rawLineData.card)
1164
1137
  } : rawLineData;
1165
- const lineRuntime = runtime.channel.line;
1166
1138
  const location = lineData.location;
1167
1139
  const locationMessage = location ? outboundRuntime.createLocationMessage(location) : null;
1168
- const sendText = lineRuntime?.pushMessageLine ?? outboundRuntime.pushMessageLine;
1169
- const sendBatch = lineRuntime?.pushMessagesLine ?? outboundRuntime.pushMessagesLine;
1170
- const sendFlex = lineRuntime?.pushFlexMessage ?? outboundRuntime.pushFlexMessage;
1171
- const sendTemplate = lineRuntime?.pushTemplateMessage ?? outboundRuntime.pushTemplateMessage;
1172
- const sendLocation = lineRuntime?.pushLocationMessage ?? outboundRuntime.pushLocationMessage;
1173
- const sendQuickReplies = lineRuntime?.pushTextMessageWithQuickReplies ?? outboundRuntime.pushTextMessageWithQuickReplies;
1174
- const buildTemplate = lineRuntime?.buildTemplateMessageFromPayload ?? outboundRuntime.buildTemplateMessageFromPayload;
1140
+ const { pushMessageLine: sendText, pushMessagesLine: sendBatch, pushFlexMessage: sendFlex, pushTemplateMessage: sendTemplate, pushLocationMessage: sendLocation, pushTextMessageWithQuickReplies: sendQuickReplies, buildTemplateMessageFromPayload: buildTemplate } = outboundRuntime;
1175
1141
  const sendOptions = {
1176
1142
  verbose: false,
1177
1143
  cfg,
@@ -1212,7 +1178,7 @@ const lineOutboundAdapter = {
1212
1178
  const quickReplies = lineData.quickReplies ?? [];
1213
1179
  const quickReplyItems = lineData.quickReplyItems ?? [];
1214
1180
  const hasQuickReplies = quickReplies.length > 0 || quickReplyItems.length > 0;
1215
- const quickReply = quickReplyItems.length ? createLineQuickReply(quickReplyItems) : quickReplies.length ? (lineRuntime?.createQuickReplyItems ?? outboundRuntime.createQuickReplyItems)(quickReplies) : void 0;
1181
+ const quickReply = quickReplyItems.length ? createLineQuickReply(quickReplyItems) : quickReplies.length ? outboundRuntime.createQuickReplyItems(quickReplies) : void 0;
1216
1182
  const quickReplyLabels = quickReplyItems.length ? quickReplyItems.map((item) => item.label) : quickReplies;
1217
1183
  const sendMessageBatch = async (messages) => {
1218
1184
  if (messages.length === 0) return;
@@ -1242,16 +1208,13 @@ const lineOutboundAdapter = {
1242
1208
  ...quotedOption(quoteToken)
1243
1209
  }));
1244
1210
  };
1245
- const processed = payload.text ? outboundRuntime.processLineMessage(payload.text) : {
1246
- text: "",
1247
- flexMessages: []
1248
- };
1211
+ const processed = payload.text ? outboundRuntime.processLineMessage(payload.text) : [];
1249
1212
  const chunkLimit = runtime.channel.text.resolveTextChunkLimit?.(cfg, "line", accountId ?? void 0, { fallbackLimit: 5e3 }) ?? 5e3;
1250
- const orderedMessages = processed.segments?.flatMap((segment) => segment.type === "flex" ? [segment.message] : runtime.channel.text.chunkMarkdownText(segment.text, chunkLimit).map((text) => ({
1213
+ const orderedMessages = processed.flatMap((segment) => segment.type === "flex" ? [segment.message] : runtime.channel.text.chunkMarkdownText(segment.text, chunkLimit).map((text) => ({
1251
1214
  type: "text",
1252
1215
  text
1253
1216
  })));
1254
- const chunks = orderedMessages ? orderedMessages.flatMap((message) => message.type === "text" ? [message.text] : []) : processed.text ? runtime.channel.text.chunkMarkdownText(processed.text, chunkLimit) : [];
1217
+ const hasText = orderedMessages.some((message) => message.type === "text");
1255
1218
  const mediaUrls = resolveOutboundMediaUrls(payload);
1256
1219
  const mediaOptions = {
1257
1220
  mediaKind: lineData.mediaKind,
@@ -1259,12 +1222,12 @@ const lineOutboundAdapter = {
1259
1222
  durationMs: lineData.durationMs,
1260
1223
  trackingId: lineData.trackingId
1261
1224
  };
1262
- const shouldSendQuickRepliesInline = chunks.length === 0 && hasQuickReplies;
1225
+ const shouldSendQuickRepliesInline = !hasText && hasQuickReplies;
1263
1226
  const sendMediaMessages = async () => {
1264
1227
  for (const url of mediaUrls) {
1265
1228
  const trimmed = url?.trim();
1266
1229
  if (!trimmed) continue;
1267
- await recordResult((lineRuntime?.sendMessageLine ?? outboundRuntime.sendMessageLine)(to, "", {
1230
+ await recordResult(outboundRuntime.sendMessageLine(to, "", {
1268
1231
  ...sendOptions,
1269
1232
  ...mediaOptions,
1270
1233
  mediaUrl: trimmed
@@ -1288,13 +1251,12 @@ const lineOutboundAdapter = {
1288
1251
  }
1289
1252
  }
1290
1253
  if (location) await recordResult(sendLocation(to, location, sendOptions));
1291
- if (!orderedMessages) for (const flexMsg of processed.flexMessages) await recordResult(sendFlex(to, flexMsg.altText, flexMsg.contents, sendOptions));
1292
1254
  }
1293
- const sendMediaAfterText = !(hasQuickReplies && chunks.length > 0);
1255
+ const sendMediaAfterText = !(hasQuickReplies && hasText);
1294
1256
  if (mediaUrls.length > 0 && !shouldSendQuickRepliesInline && !sendMediaAfterText) await sendMediaMessages();
1295
- if (orderedMessages && !shouldSendQuickRepliesInline) {
1257
+ if (!shouldSendQuickRepliesInline) {
1296
1258
  const quotedIndex = orderedMessages.findIndex(canCarryLineQuoteToken);
1297
- if (replyQuoteToken && quotedIndex < 0) reportLineQuoteCarrierMissing(to);
1259
+ if (replyQuoteToken && orderedMessages.length > 0 && quotedIndex < 0) reportLineQuoteCarrierMissing(to);
1298
1260
  for (const [index, message] of orderedMessages.entries()) {
1299
1261
  const isLast = index === orderedMessages.length - 1;
1300
1262
  const quoteToken = index === quotedIndex ? replyQuoteToken : void 0;
@@ -1310,16 +1272,7 @@ const lineOutboundAdapter = {
1310
1272
  ...quotedOption(quoteToken)
1311
1273
  }));
1312
1274
  }
1313
- } else if (chunks.length > 0) for (const [i, chunk] of chunks.entries()) {
1314
- const isLast = i === chunks.length - 1;
1315
- const quoteToken = i === 0 ? replyQuoteToken : void 0;
1316
- if (isLast && hasQuickReplies) await sendTextWithQuickReply(chunk, quoteToken);
1317
- else await recordResult(sendText(to, chunk, {
1318
- ...sendOptions,
1319
- ...quotedOption(quoteToken)
1320
- }));
1321
- }
1322
- else if (shouldSendQuickRepliesInline) {
1275
+ } else {
1323
1276
  const quickReplyMessages = [];
1324
1277
  if (lineData.flexMessage) quickReplyMessages.push(outboundRuntime.createFlexMessage(lineData.flexMessage.altText, lineData.flexMessage.contents));
1325
1278
  if (lineData.templateMessage) {
@@ -1330,7 +1283,7 @@ const lineOutboundAdapter = {
1330
1283
  } : template);
1331
1284
  }
1332
1285
  if (locationMessage) quickReplyMessages.push(locationMessage);
1333
- for (const flexMsg of processed.flexMessages) quickReplyMessages.push(outboundRuntime.createFlexMessage(flexMsg.altText, flexMsg.contents));
1286
+ quickReplyMessages.push(...orderedMessages);
1334
1287
  for (const url of mediaUrls) {
1335
1288
  const trimmed = url?.trim();
1336
1289
  if (!trimmed) continue;
@@ -1426,7 +1379,7 @@ const lineMessageAdapter = defineChannelMessageAdapter({
1426
1379
  });
1427
1380
  //#endregion
1428
1381
  //#region extensions/line/src/channel.ts
1429
- const loadLineChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-bd5vGeSo.mjs"));
1382
+ const loadLineChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-BEhASjr_.mjs"));
1430
1383
  const lineSecurityAdapter = createRestrictSendersChannelSecurity({
1431
1384
  channelKey: "line",
1432
1385
  resolveDmPolicy: (account) => account.config.dmPolicy,
@@ -1564,12 +1517,13 @@ const linePlugin = createChatChannelPlugin({
1564
1517
  message: "OpenClaw: your access has been approved.",
1565
1518
  normalizeAllowEntry: createPairingPrefixStripper(/^line:(?:user:)?/i),
1566
1519
  notify: async ({ cfg, id, message, accountId }) => {
1567
- const account = (getLineRuntime().channel.line?.resolveLineAccount ?? resolveLineAccount)({
1520
+ const account = resolveLineAccount({
1568
1521
  cfg,
1569
1522
  accountId
1570
1523
  });
1571
1524
  if (!account.channelAccessToken) throw new Error("LINE channel access token not configured");
1572
- await (getLineRuntime().channel.line?.pushMessageLine ?? (await loadLineChannelRuntime()).pushMessageLine)(id, message, {
1525
+ const { pushMessageLine } = await loadLineChannelRuntime();
1526
+ await pushMessageLine(id, message, {
1573
1527
  cfg,
1574
1528
  accountId: account.accountId,
1575
1529
  channelAccessToken: account.channelAccessToken
@@ -1588,4 +1542,4 @@ const linePlugin = createChatChannelPlugin({
1588
1542
  outbound: lineOutboundAdapter
1589
1543
  });
1590
1544
  //#endregion
1591
- export { resolveLineQuestionPostback as a, normalizeLineAllowEntry as c, parseLineQuestionPostbackData as i, lineChannelPluginCommon as l, createLineQuickReply as n, buildLineQuickReplyFallbackText as o, prepareLineReplyPayload as r, resolveLineGroupConfigEntry as s, linePlugin as t };
1545
+ export { resolveLineQuestionPostback as a, lineChannelPluginCommon as c, parseLineQuestionPostbackData as i, createLineQuickReply as n, buildLineQuickReplyFallbackText as o, prepareLineReplyPayload as r, resolveLineGroupConfigEntry as s, linePlugin as t };
@@ -1,4 +1,4 @@
1
- import { a as probeLineBot } from "./send-retry-DV6I0muq.mjs";
2
- import { h as showLoadingAnimation, l as pushMessageLine } from "./send-DOY1WTxv.mjs";
3
- import { t as monitorLineProvider } from "./monitor-C01hAm3f.mjs";
1
+ import { a as probeLineBot } from "./send-retry-B9Nor0-J.mjs";
2
+ import { h as showLoadingAnimation, l as pushMessageLine } from "./send-DAwROcyQ.mjs";
3
+ import { t as monitorLineProvider } from "./monitor-Bb3HieCd.mjs";
4
4
  export { monitorLineProvider, probeLineBot, pushMessageLine, showLoadingAnimation };