@openclaw/line 2026.8.1-beta.3 → 2026.9.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.
- package/dist/api.js +1 -1
- package/dist/{card-command-CyDSm-OU.js → card-command-CmU47gD9.js} +16 -10
- package/dist/{channel-DmoKZXmG.js → channel-CsQLcrsA.js} +32 -15
- package/dist/channel-plugin-api.js +1 -1
- package/dist/channel.runtime-B83x7k_i.js +4 -0
- package/dist/index.js +1 -1
- package/dist/{markdown-to-line-rEaras_0.js → markdown-to-line-BmZ4hhfC.js} +17 -22
- package/dist/media-control-cards-CksNB8Wk.js +474 -0
- package/dist/{monitor-BYXS_B6r.js → monitor-Bd9XDV1i.js} +20 -11
- package/dist/monitor.runtime-BCCa6qTX.js +2 -0
- package/dist/{outbound.runtime-DDTeqaBW.js → outbound.runtime-D4w0-Gkc.js} +2 -2
- package/dist/runtime-api.js +6 -7
- package/dist/{send-BJCeiiOB.js → send-Dce0m539.js} +13 -9
- package/dist/{send-receipt-DKZzgHMO.js → send-receipt-CCPTalf9.js} +1 -371
- package/node_modules/typebox/build/format/date.d.mts +1 -1
- package/node_modules/typebox/build/format/date.mjs +1 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -3
- package/node_modules/typebox/build/format/email.d.mts +1 -1
- package/node_modules/typebox/build/format/email.mjs +2 -2
- package/node_modules/typebox/build/format/hostname.mjs +2 -10
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_email.mjs +3 -3
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
- package/node_modules/typebox/build/format/ipv4.mjs +2 -32
- package/node_modules/typebox/build/format/ipv6.mjs +2 -61
- package/node_modules/typebox/build/format/iri.d.mts +2 -2
- package/node_modules/typebox/build/format/iri.mjs +26 -8
- package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
- package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
- package/node_modules/typebox/build/format/regex.d.mts +1 -2
- package/node_modules/typebox/build/format/regex.mjs +2 -6
- package/node_modules/typebox/build/format/time.d.mts +2 -2
- package/node_modules/typebox/build/format/time.mjs +19 -14
- package/node_modules/typebox/build/format/uri.d.mts +1 -1
- package/node_modules/typebox/build/format/uri.mjs +3 -130
- package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
- package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
- package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
- package/node_modules/typebox/build/format/uri_template.mjs +4 -5
- package/node_modules/typebox/build/format/url.d.mts +3 -3
- package/node_modules/typebox/build/format/url.mjs +4 -5
- package/node_modules/typebox/build/guard/emit.d.mts +3 -1
- package/node_modules/typebox/build/guard/emit.mjs +12 -5
- package/node_modules/typebox/build/guard/guard.d.mts +8 -2
- package/node_modules/typebox/build/guard/guard.mjs +25 -4
- package/node_modules/typebox/build/guard/string.d.mts +2 -2
- package/node_modules/typebox/build/guard/string.mjs +7 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
- package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/types/index.mjs +0 -2
- package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
- package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
- package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
- package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
- package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
- package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
- package/node_modules/typebox/build/type/script/parser.mjs +27 -23
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/package.json +27 -27
- package/node_modules/typebox/readme.md +79 -82
- package/openclaw.plugin.json +10 -0
- package/package.json +6 -6
- package/dist/channel.runtime-qrUV6wPE.js +0 -4
- package/dist/config-schema-Be3azjB_.js +0 -47
- package/dist/monitor.runtime-B2z_5ugU.js +0 -2
- package/dist/quick-reply-fallback-D86FwAfr.js +0 -56
- package/node_modules/typebox/build/format/_idna.d.mts +0 -2
- package/node_modules/typebox/build/format/_idna.mjs +0 -246
- package/node_modules/typebox/build/format/_puny.d.mts +0 -1
- package/node_modules/typebox/build/format/_puny.mjs +0 -77
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
- package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
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-CsQLcrsA.js";
|
|
2
2
|
import { r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-W0Dbgu58.js";
|
|
3
3
|
//#region extensions/line/src/channel.setup.ts
|
|
4
4
|
const lineSetupPlugin = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as createFlexMessage } from "./send-
|
|
1
|
+
import { a as createActionCard, c as createListCard, i as createReceiptCard, o as createImageCard, s as createInfoCard } from "./send-receipt-CCPTalf9.js";
|
|
2
|
+
import { n as createFlexMessage } from "./send-Dce0m539.js";
|
|
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
|
|
@@ -39,17 +39,23 @@ function parseActions(actionsStr) {
|
|
|
39
39
|
const [label, data] = part.trim().split("|").map((s) => s.trim());
|
|
40
40
|
if (!label) continue;
|
|
41
41
|
const actionData = data || label;
|
|
42
|
-
|
|
42
|
+
const action = actionData.startsWith("http://") || actionData.startsWith("https://") ? {
|
|
43
|
+
type: "uri",
|
|
43
44
|
label,
|
|
44
|
-
|
|
45
|
-
})
|
|
46
|
-
|
|
45
|
+
uri: actionData
|
|
46
|
+
} : actionData.includes("=") ? {
|
|
47
|
+
type: "postback",
|
|
47
48
|
label,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
data: actionData,
|
|
50
|
+
displayText: label
|
|
51
|
+
} : {
|
|
52
|
+
type: "message",
|
|
53
|
+
label,
|
|
54
|
+
text: actionData
|
|
55
|
+
};
|
|
56
|
+
results.push({
|
|
51
57
|
label,
|
|
52
|
-
action
|
|
58
|
+
action
|
|
53
59
|
});
|
|
54
60
|
}
|
|
55
61
|
return results;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { i as resolveLineAccount, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-BqEVsDoB.js";
|
|
2
2
|
import { i as hasLineCredentials, r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-W0Dbgu58.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import { _ as uriAction, a as createAgendaCard, b as resolveLineOutboundMedia, c as createActionCard, g as postbackAction, i as createMediaPlayerCard, n as createAppleTvRemoteCard, o as createEventCard, p as messageAction, r as createDeviceControlCard, t as createLineSendReceipt, v as buildLineMediaMessage, y as hasLineSpecificMediaOptions } from "./send-receipt-DKZzgHMO.js";
|
|
3
|
+
import { a as resolveExactLineGroupConfigKey, d as LineChannelConfigSchema, i as buildLineQuickReplyFallbackText, l as getLineRuntime, n as createDeviceControlCard, r as createMediaPlayerCard, t as createAppleTvRemoteCard } from "./media-control-cards-CksNB8Wk.js";
|
|
4
|
+
import { _ as hasLineSpecificMediaOptions, a as createActionCard, g as buildLineMediaMessage, n as createAgendaCard, p as postbackAction, r as createEventCard, t as createLineSendReceipt, u as messageAction, v as resolveLineOutboundMedia } from "./send-receipt-CCPTalf9.js";
|
|
6
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
7
6
|
import { buildDmGroupAccountAllowlistAdapter, createFlatAllowlistOverrideResolver } from "openclaw/plugin-sdk/allowlist-config-edit";
|
|
8
7
|
import { buildChannelOutboundSessionRoute, createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
@@ -10,11 +9,11 @@ import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing
|
|
|
10
9
|
import { buildChannelGroupsScopeTree, createRestrictSendersChannelSecurity, resolveScopeRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
|
11
10
|
import { createEmptyChannelDirectoryAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
12
11
|
import { describeWebhookAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
13
|
-
import { DEFAULT_ACCOUNT_ID
|
|
12
|
+
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
14
13
|
import { createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
15
14
|
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
16
|
-
import { clearAccountEntryFields } from "openclaw/plugin-sdk/core";
|
|
17
15
|
import { createAccountStatusSink, defineChannelMessageAdapter, listMessageReceiptPlatformIds } from "openclaw/plugin-sdk/channel-outbound";
|
|
16
|
+
import { clearAccountEntryFields } from "openclaw/plugin-sdk/core";
|
|
18
17
|
import { createChannelPartialDeliveryError } from "openclaw/plugin-sdk/channel-inbound";
|
|
19
18
|
import { createAttachedChannelResultAdapter, createEmptyChannelResult } from "openclaw/plugin-sdk/channel-send-result";
|
|
20
19
|
import { resolveOutboundMediaUrls } from "openclaw/plugin-sdk/reply-payload";
|
|
@@ -122,7 +121,7 @@ const lineChannelPluginCommon = {
|
|
|
122
121
|
//#endregion
|
|
123
122
|
//#region extensions/line/src/gateway.ts
|
|
124
123
|
const loadLineProbeRuntime$1 = createLazyRuntimeModule(() => import("./probe.runtime-D13ZtXsd.js"));
|
|
125
|
-
const loadLineMonitorRuntime = createLazyRuntimeModule(() => import("./monitor.runtime-
|
|
124
|
+
const loadLineMonitorRuntime = createLazyRuntimeModule(() => import("./monitor.runtime-BCCa6qTX.js"));
|
|
126
125
|
const lineGatewayAdapter = {
|
|
127
126
|
startAccount: async (ctx) => {
|
|
128
127
|
const account = ctx.account;
|
|
@@ -162,7 +161,7 @@ const lineGatewayAdapter = {
|
|
|
162
161
|
const nextLine = { ...cfg.channels?.line ?? {} };
|
|
163
162
|
let cleared = false;
|
|
164
163
|
let changed = false;
|
|
165
|
-
if (accountId === DEFAULT_ACCOUNT_ID
|
|
164
|
+
if (accountId === DEFAULT_ACCOUNT_ID) {
|
|
166
165
|
if (nextLine.channelAccessToken || nextLine.channelSecret || nextLine.tokenFile || nextLine.secretFile) {
|
|
167
166
|
delete nextLine.channelAccessToken;
|
|
168
167
|
delete nextLine.channelSecret;
|
|
@@ -357,10 +356,28 @@ const LINE_PRESENTATION_CAPABILITIES = {
|
|
|
357
356
|
};
|
|
358
357
|
function toLineAction(button) {
|
|
359
358
|
const normalized = resolveMessagePresentationButtonAction(button);
|
|
360
|
-
|
|
361
|
-
if (normalized?.type === "
|
|
362
|
-
|
|
363
|
-
|
|
359
|
+
const { label } = button;
|
|
360
|
+
if (normalized?.type === "command") return {
|
|
361
|
+
type: "message",
|
|
362
|
+
label,
|
|
363
|
+
text: normalized.command
|
|
364
|
+
};
|
|
365
|
+
if (normalized?.type === "callback") return {
|
|
366
|
+
type: "postback",
|
|
367
|
+
label,
|
|
368
|
+
data: normalized.value,
|
|
369
|
+
displayText: label
|
|
370
|
+
};
|
|
371
|
+
if (normalized?.type === "url") return {
|
|
372
|
+
type: "uri",
|
|
373
|
+
label,
|
|
374
|
+
uri: normalized.url
|
|
375
|
+
};
|
|
376
|
+
if (normalized?.type === "web-app" && normalized.url) return {
|
|
377
|
+
type: "uri",
|
|
378
|
+
label,
|
|
379
|
+
uri: normalized.url
|
|
380
|
+
};
|
|
364
381
|
}
|
|
365
382
|
function renderLinePresentation(payload, presentation) {
|
|
366
383
|
const buttons = presentation.blocks.flatMap((block) => block.type === "buttons" ? block.buttons : []);
|
|
@@ -470,7 +487,7 @@ function createLineQuickReply(items) {
|
|
|
470
487
|
}
|
|
471
488
|
//#endregion
|
|
472
489
|
//#region extensions/line/src/outbound.ts
|
|
473
|
-
const loadLineOutboundRuntime = createLazyRuntimeModule(() => import("./outbound.runtime-
|
|
490
|
+
const loadLineOutboundRuntime = createLazyRuntimeModule(() => import("./outbound.runtime-D4w0-Gkc.js"));
|
|
474
491
|
const lineOutboundAdapter = {
|
|
475
492
|
deliveryMode: "direct",
|
|
476
493
|
chunker: (text, limit) => getLineRuntime().channel.text.chunkMarkdownText(text, limit),
|
|
@@ -617,7 +634,7 @@ const lineOutboundAdapter = {
|
|
|
617
634
|
}
|
|
618
635
|
const sendMediaAfterText = !(hasQuickReplies && chunks.length > 0);
|
|
619
636
|
if (mediaUrls.length > 0 && !shouldSendQuickRepliesInline && !sendMediaAfterText) await sendMediaMessages();
|
|
620
|
-
if (orderedMessages) for (const [index, message] of orderedMessages.entries()) {
|
|
637
|
+
if (orderedMessages && !shouldSendQuickRepliesInline) for (const [index, message] of orderedMessages.entries()) {
|
|
621
638
|
const isLast = index === orderedMessages.length - 1;
|
|
622
639
|
if (message.type === "flex") if (isLast && quickReply) await sendMessageBatch([{
|
|
623
640
|
...message,
|
|
@@ -748,7 +765,7 @@ const collectLineStatusIssues = createDependentCredentialStatusIssueCollector({
|
|
|
748
765
|
missingDependentMessage: "LINE channel secret not configured"
|
|
749
766
|
});
|
|
750
767
|
const lineStatusAdapter = createComputedAccountStatusAdapter({
|
|
751
|
-
defaultRuntime: createDefaultChannelRuntimeState(DEFAULT_ACCOUNT_ID
|
|
768
|
+
defaultRuntime: createDefaultChannelRuntimeState(DEFAULT_ACCOUNT_ID),
|
|
752
769
|
collectStatusIssues: collectLineStatusIssues,
|
|
753
770
|
buildChannelSummary: ({ snapshot }) => buildTokenChannelStatusSummary(snapshot),
|
|
754
771
|
probeAccount: async ({ account, timeoutMs }) => await (await loadLineProbeRuntime()).probeLineBot(account.channelAccessToken, timeoutMs),
|
|
@@ -768,7 +785,7 @@ const lineStatusAdapter = createComputedAccountStatusAdapter({
|
|
|
768
785
|
});
|
|
769
786
|
//#endregion
|
|
770
787
|
//#region extensions/line/src/channel.ts
|
|
771
|
-
const loadLineChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
788
|
+
const loadLineChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-B83x7k_i.js"));
|
|
772
789
|
const lineSecurityAdapter = createRestrictSendersChannelSecurity({
|
|
773
790
|
channelKey: "line",
|
|
774
791
|
resolveDmPolicy: (account) => account.config.dmPolicy,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as linePlugin } from "./channel-
|
|
1
|
+
import { t as linePlugin } from "./channel-CsQLcrsA.js";
|
|
2
2
|
export { linePlugin };
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
|
4
4
|
function createLineCardCommandLoader(api) {
|
|
5
5
|
return createLazyRuntimeModule(async () => {
|
|
6
6
|
let registered = null;
|
|
7
|
-
const { registerLineCardCommand } = await import("./card-command-
|
|
7
|
+
const { registerLineCardCommand } = await import("./card-command-CmU47gD9.js");
|
|
8
8
|
registerLineCardCommand({
|
|
9
9
|
...api,
|
|
10
10
|
registerCommand(command) {
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as normalizeLineAction, h as uriAction, i as createReceiptCard, p as postbackAction, u as messageAction } from "./send-receipt-CCPTalf9.js";
|
|
2
2
|
import { markdownToIRWithMeta, stripMarkdown, stripMarkdown as stripMarkdown$1 } from "openclaw/plugin-sdk/text-chunking";
|
|
3
3
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
4
|
-
//#region extensions/line/src/flex-templates/message.ts
|
|
5
|
-
/**
|
|
6
|
-
* Wrap a FlexContainer in a FlexMessage
|
|
7
|
-
*/
|
|
8
|
-
function toFlexMessage(altText, contents) {
|
|
9
|
-
return {
|
|
10
|
-
type: "flex",
|
|
11
|
-
altText,
|
|
12
|
-
contents
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
4
|
//#region extensions/line/src/template-messages.ts
|
|
17
5
|
const COMPACT_TEMPLATE_TEXT_LIMIT = 60;
|
|
18
6
|
const TEMPLATE_ALT_TEXT_LIMIT = 1500;
|
|
@@ -157,6 +145,18 @@ function buildTemplateMessageFromPayload(payload) {
|
|
|
157
145
|
}
|
|
158
146
|
}
|
|
159
147
|
//#endregion
|
|
148
|
+
//#region extensions/line/src/flex-templates/message.ts
|
|
149
|
+
/**
|
|
150
|
+
* Wrap a FlexContainer in a FlexMessage
|
|
151
|
+
*/
|
|
152
|
+
function toFlexMessage(altText, contents) {
|
|
153
|
+
return {
|
|
154
|
+
type: "flex",
|
|
155
|
+
altText,
|
|
156
|
+
contents
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
160
160
|
//#region extensions/line/src/markdown-to-line.ts
|
|
161
161
|
const LINE_MARKDOWN_OPTIONS = {
|
|
162
162
|
assistantTranscriptRoleHeaders: true,
|
|
@@ -455,13 +455,10 @@ function convertCodeBlockToFlexBubble(block) {
|
|
|
455
455
|
function processLineMessage(text) {
|
|
456
456
|
const { ir, tables } = parseLineMarkdown(text);
|
|
457
457
|
const codeSpans = codeBlockSpans(ir);
|
|
458
|
-
const flexMessages = [];
|
|
459
458
|
const plainTextInsertions = [];
|
|
460
|
-
let hasOversizedTable = false;
|
|
461
459
|
for (const table of tables) {
|
|
462
460
|
const bubble = table.rowCells.length > 10 && (table.headers.length !== 2 || table.rowCells.length > 12 || [table.headerCells, ...table.rowCells].some((cells) => cells.some((cell) => renderTableCell(cell, "-").hasMarkup))) ? void 0 : convertTableToFlexBubble(toMarkdownTable(table));
|
|
463
461
|
if (!bubble || Buffer.byteLength(JSON.stringify(bubble), "utf8") > LINE_FLEX_BUBBLE_MAX_BYTES) {
|
|
464
|
-
hasOversizedTable = true;
|
|
465
462
|
plainTextInsertions.push({
|
|
466
463
|
position: table.placeholderOffset,
|
|
467
464
|
text: `\n\n${formatOversizedTableAsBullets(table)}\n\n`
|
|
@@ -469,7 +466,6 @@ function processLineMessage(text) {
|
|
|
469
466
|
continue;
|
|
470
467
|
}
|
|
471
468
|
const message = toFlexMessage("Table", bubble);
|
|
472
|
-
flexMessages.push(message);
|
|
473
469
|
plainTextInsertions.push({
|
|
474
470
|
position: table.placeholderOffset,
|
|
475
471
|
message
|
|
@@ -477,7 +473,6 @@ function processLineMessage(text) {
|
|
|
477
473
|
}
|
|
478
474
|
for (const span of codeSpans) {
|
|
479
475
|
const message = toFlexMessage("Code", convertCodeBlockToFlexBubble(toCodeBlock(ir, span)));
|
|
480
|
-
flexMessages.push(message);
|
|
481
476
|
plainTextInsertions.push({
|
|
482
477
|
position: span.start,
|
|
483
478
|
message
|
|
@@ -485,9 +480,9 @@ function processLineMessage(text) {
|
|
|
485
480
|
}
|
|
486
481
|
const segments = [];
|
|
487
482
|
return {
|
|
488
|
-
text: projectPlainText(ir, codeSpans, plainTextInsertions,
|
|
489
|
-
flexMessages,
|
|
490
|
-
...
|
|
483
|
+
text: projectPlainText(ir, codeSpans, plainTextInsertions, (segment) => segments.push(segment)),
|
|
484
|
+
flexMessages: segments.flatMap((segment) => segment.type === "flex" ? [segment.message] : []),
|
|
485
|
+
...plainTextInsertions.length > 0 ? { segments } : {}
|
|
491
486
|
};
|
|
492
487
|
}
|
|
493
488
|
/** Check if text contains markdown that needs conversion. */
|
|
@@ -496,4 +491,4 @@ function hasMarkdownToConvert(text) {
|
|
|
496
491
|
return tables.length > 0 || ir.styles.length > 0 || ir.links.length > 0 || /<\/?u>/i.test(ir.text) || ir.text !== text.trimEnd();
|
|
497
492
|
}
|
|
498
493
|
//#endregion
|
|
499
|
-
export { stripMarkdown$1 as a,
|
|
494
|
+
export { stripMarkdown$1 as a, createButtonTemplate as c, createTemplateCarousel as d, processLineMessage as i, createCarouselColumn as l, convertTableToFlexBubble as n, toFlexMessage as o, hasMarkdownToConvert as r, buildTemplateMessageFromPayload as s, convertCodeBlockToFlexBubble as t, createConfirmTemplate as u };
|