@openclaw/line 2026.6.11 → 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.
@@ -56,7 +56,7 @@ function resolveLineAccount(params) {
56
56
  const accountId = normalizeAccountId(params.accountId ?? resolveDefaultLineAccountId(cfg));
57
57
  const lineConfig = cfg.channels?.line;
58
58
  const accounts = lineConfig?.accounts;
59
- const accountConfig = accountId !== DEFAULT_ACCOUNT_ID ? resolveAccountEntry(accounts, accountId) : void 0;
59
+ const accountConfig = resolveAccountEntry(accounts, accountId);
60
60
  const { token, tokenSource } = resolveToken({
61
61
  accountId,
62
62
  baseConfig: lineConfig,
@@ -72,7 +72,9 @@ function resolveLineAccount(params) {
72
72
  ...lineBase,
73
73
  ...accountConfig
74
74
  };
75
- const enabled = accountConfig?.enabled ?? (accountId === DEFAULT_ACCOUNT_ID ? lineConfig?.enabled ?? true : false);
75
+ const baseEnabled = lineConfig?.enabled !== false;
76
+ const accountEnabled = accountConfig?.enabled !== false;
77
+ const enabled = baseEnabled && accountEnabled;
76
78
  return {
77
79
  accountId,
78
80
  name: accountConfig?.name ?? (accountId === DEFAULT_ACCOUNT_ID ? lineConfig?.name : void 0),
package/dist/api.js CHANGED
@@ -1,5 +1,5 @@
1
- import { n as lineChannelPluginCommon, t as linePlugin } from "./channel-DnBQa9Fv.js";
2
- import { n as lineSetupAdapter, t as lineSetupWizard } from "./setup-surface-CvTRDCEq.js";
1
+ import { n as lineChannelPluginCommon, t as linePlugin } from "./channel-DIpdZiwc.js";
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 = {
5
5
  id: "line",
@@ -1,6 +1,6 @@
1
- import { r as createReceiptCard } from "./schedule-cards-Bq74H30B.js";
2
- import { a as createListCard, i as createInfoCard, r as createImageCard, t as createActionCard } from "./basic-cards-B1eTkw-f.js";
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";
3
2
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
3
+ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
4
4
  //#region extensions/line/src/card-command.ts
5
5
  const CARD_USAGE = `Usage: /card <type> "title" "body" [options]
6
6
 
@@ -33,28 +33,15 @@ function parseActions(actionsStr) {
33
33
  const actionData = data || label;
34
34
  if (actionData.startsWith("http://") || actionData.startsWith("https://")) results.push({
35
35
  label,
36
- action: {
37
- type: "uri",
38
- label: label.slice(0, 20),
39
- uri: actionData
40
- }
36
+ action: uriAction(label, actionData)
41
37
  });
42
38
  else if (actionData.includes("=")) results.push({
43
39
  label,
44
- action: {
45
- type: "postback",
46
- label: label.slice(0, 20),
47
- data: actionData.slice(0, 300),
48
- displayText: label
49
- }
40
+ action: postbackAction(label, actionData, label)
50
41
  });
51
42
  else results.push({
52
43
  label,
53
- action: {
54
- type: "message",
55
- label: label.slice(0, 20),
56
- text: actionData
57
- }
44
+ action: messageAction(label, actionData)
58
45
  });
59
46
  }
60
47
  return results;
@@ -128,7 +115,7 @@ function registerLineCardCommand(api) {
128
115
  const [title = "Info", body = "", footer] = args;
129
116
  const bubble = createInfoCard(title, body, footer);
130
117
  return buildLineReply({ flexMessage: {
131
- altText: `${title}: ${body}`.slice(0, 400),
118
+ altText: truncateUtf16Safe(`${title}: ${body}`, 400),
132
119
  contents: bubble
133
120
  } });
134
121
  }
@@ -138,7 +125,7 @@ function registerLineCardCommand(api) {
138
125
  if (!imageUrl) return { text: "Error: Image card requires --url <image-url>" };
139
126
  const bubble = createImageCard(imageUrl, title, caption);
140
127
  return buildLineReply({ flexMessage: {
141
- altText: `${title}: ${caption}`.slice(0, 400),
128
+ altText: truncateUtf16Safe(`${title}: ${caption}`, 400),
142
129
  contents: bubble
143
130
  } });
144
131
  }
@@ -148,7 +135,7 @@ function registerLineCardCommand(api) {
148
135
  if (actions.length === 0) return { text: "Error: Action card requires --actions \"Label1|data1,Label2|data2\"" };
149
136
  const bubble = createActionCard(title, body, actions, { imageUrl: flags.url || flags.image });
150
137
  return buildLineReply({ flexMessage: {
151
- altText: `${title}: ${body}`.slice(0, 400),
138
+ altText: truncateUtf16Safe(`${title}: ${body}`, 400),
152
139
  contents: bubble
153
140
  } });
154
141
  }
@@ -158,7 +145,7 @@ function registerLineCardCommand(api) {
158
145
  if (items.length === 0) return { text: "Error: List card requires items. Usage: /card list \"Title\" \"Item1|Desc1,Item2|Desc2\"" };
159
146
  const bubble = createListCard(title, items);
160
147
  return buildLineReply({ flexMessage: {
161
- altText: `${title}: ${items.map((i) => i.title).join(", ")}`.slice(0, 400),
148
+ altText: truncateUtf16Safe(`${title}: ${items.map((i) => i.title).join(", ")}`, 400),
162
149
  contents: bubble
163
150
  } });
164
151
  }
@@ -178,7 +165,7 @@ function registerLineCardCommand(api) {
178
165
  footer
179
166
  });
180
167
  return buildLineReply({ flexMessage: {
181
- altText: `${title}: ${items.map((i) => `${i.name} ${i.value}`).join(", ")}`.slice(0, 400),
168
+ altText: truncateUtf16Safe(`${title}: ${items.map((i) => `${i.name} ${i.value}`).join(", ")}`, 400),
182
169
  contents: bubble
183
170
  } });
184
171
  }
@@ -1,11 +1,11 @@
1
- import { i as resolveLineAccount, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-B-K3yrdP.js";
2
- import { n as lineSetupAdapter, r as hasLineCredentials, t as lineSetupWizard } from "./setup-surface-CvTRDCEq.js";
3
- import { c as resolveLineOutboundMedia, f as LineChannelConfigSchema, m as resolveExactLineGroupConfigKey, n as parseLineDirectives, o as createLineSendReceipt, s as buildLineQuickReplyFallbackText, t as hasLineDirectives, u as getLineRuntime } from "./reply-payload-transform-DZ8-37Ot.js";
1
+ import { i as resolveLineAccount, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-DJVOv1JI.js";
2
+ import { n as lineSetupAdapter, r as hasLineCredentials, t as lineSetupWizard } from "./setup-surface-Bc36YSS3.js";
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) {
@@ -106,8 +107,8 @@ const lineChannelPluginCommon = {
106
107
  };
107
108
  //#endregion
108
109
  //#region extensions/line/src/gateway.ts
109
- const loadLineProbeRuntime$1 = createLazyRuntimeModule(() => import("./probe.runtime-DH_jgr7u.js"));
110
- const loadLineMonitorRuntime = createLazyRuntimeModule(() => import("./monitor.runtime-CGCy-kYV.js"));
110
+ const loadLineProbeRuntime$1 = createLazyRuntimeModule(() => import("./probe.runtime-CRhVGqwl.js"));
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-Cx3rgMAH.js"));
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.slice(0, 400),
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.slice(0, 100),
371
- address: lineData.location.address.slice(0, 100),
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.slice(0, 400),
378
+ altText: truncateUtf16Safe(flexMsg.altText, 400),
378
379
  contents: flexMsg.contents
379
380
  });
380
381
  for (const url of mediaUrls) {
@@ -507,7 +508,7 @@ const lineMessageAdapter = defineChannelMessageAdapter({
507
508
  });
508
509
  //#endregion
509
510
  //#region extensions/line/src/status.ts
510
- const loadLineProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-DH_jgr7u.js"));
511
+ const loadLineProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-CRhVGqwl.js"));
511
512
  const collectLineStatusIssues = createDependentCredentialStatusIssueCollector({
512
513
  channel: "line",
513
514
  dependencySourceKey: "tokenSource",
@@ -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-C-kKPoMb.js"));
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-DnBQa9Fv.js";
1
+ import { t as linePlugin } from "./channel-DIpdZiwc.js";
2
2
  export { linePlugin };
@@ -0,0 +1,4 @@
1
+ import { t as monitorLineProvider } from "./monitor-DzkYuWhv.js";
2
+ import { t as probeLineBot } from "./probe-BslD77tJ.js";
3
+ import { S as pushMessageLine } from "./markdown-to-line-CFx7ME4o.js";
4
+ export { monitorLineProvider, probeLineBot, pushMessageLine };
@@ -1,2 +1,2 @@
1
- import { i as resolveLineAccount, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-B-K3yrdP.js";
1
+ import { i as resolveLineAccount, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-DJVOv1JI.js";
2
2
  export { listLineAccountIds, resolveDefaultLineAccountId, resolveLineAccount };