@openclaw/line 2026.11.3 → 2026.11.5-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-4BpGVN1-.mjs +3 -0
- package/dist/.setup/{api-WIupE7U1.mjs → api-BRnngy5R.mjs} +1 -1
- package/dist/.setup/{card-command-Dnkl21vg.mjs → card-command-2y-RSLPg.mjs} +26 -43
- package/dist/.setup/{channel-DIEVJ4PQ.mjs → channel-DJcpjKpx.mjs} +237 -332
- package/dist/.setup/channel.runtime-CdfKsNz4.mjs +4 -0
- package/dist/.setup/{monitor-JlOPDECF.mjs → monitor-BkuPFFxZ.mjs} +240 -329
- package/dist/.setup/{outbound.runtime-pciQUWJd.mjs → outbound.runtime-BPo_111h.mjs} +2 -2
- package/dist/.setup/{send-kjjjemFi.mjs → send-C1JZOFMA.mjs} +32 -81
- package/dist/.setup/{send-retry-Dzbkz5wG.mjs → send-retry-Bf2Xr6ZN.mjs} +175 -80
- package/dist/.setup/{template-messages-COcdie6C.mjs → template-messages-C1Kkr0-e.mjs} +32 -44
- package/dist/.source-module-urls/2c97352967966b7ab9f67f528eb25c098b6fe10ea0e4616ffae3851ed839d81e.json +1 -0
- package/dist/api.js +2 -2
- package/dist/channel-plugin-api.js +1 -2
- package/dist/contract-api.js +1 -2
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +1 -2
- package/dist/setup-api.js +1 -2
- package/dist/setup-entry.js +1 -1
- package/node_modules/@line/bot-sdk/node_modules/@types/node/README.md +1 -1
- package/node_modules/@line/bot-sdk/node_modules/@types/node/package.json +2 -2
- package/node_modules/@line/bot-sdk/node_modules/@types/node/util.d.ts +7 -4
- package/node_modules/typebox/build/format/duration.d.mts +2 -2
- package/node_modules/typebox/build/format/duration.mjs +2 -2
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_email.mjs +1 -0
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
- package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
- package/node_modules/typebox/build/format/ipv4.mjs +2 -2
- package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
- package/node_modules/typebox/build/format/ipv6.mjs +1 -1
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/schema/build.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
- package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
- package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
- package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
- package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
- package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
- package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
- package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
- package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
- package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
- package/node_modules/typebox/build/system/memory/create.mjs +18 -13
- package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
- package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
- package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
- package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
- package/node_modules/typebox/build/system/memory/update.mjs +43 -16
- package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
- package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
- package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
- package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +1 -1
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
- package/node_modules/zod/src/v4/core/compile.ts +9 -0
- package/node_modules/zod/src/v4/core/schemas.ts +35 -1
- package/node_modules/zod/src/v4/core/util.ts +13 -0
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.d.cts +3 -1
- package/node_modules/zod/v4/core/schemas.d.ts +3 -1
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.d.cts +2 -0
- package/node_modules/zod/v4/core/util.d.ts +2 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/package.json +6 -6
- package/dist/.setup/api-BMSLc5Fi.mjs +0 -3
- package/dist/.setup/channel.runtime-CDy9DQUW.mjs +0 -4
- package/dist/.setup/monitor.runtime-DsIFiXEZ.mjs +0 -2
- package/dist/.setup/probe.runtime-D2MUF_B_.mjs +0 -2
- package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
- package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as resolveDefaultLineAccountId, r as resolveLineAccount } from "./accounts-DOiM8-y3.mjs";
|
|
2
2
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
|
-
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
import { asSafeIntegerInRange, hasNonEmptyString, isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { collectErrorGraphCandidates, extractErrorCode, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
5
|
import { getFileExtension, mimeTypeFromFilePath } from "openclaw/plugin-sdk/media-mime";
|
|
6
6
|
import { resolvePinnedHostnameWithPolicy } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
@@ -11,6 +11,18 @@ import { HTTPFetchError } from "@line/bot-sdk";
|
|
|
11
11
|
import { classifyTransientNetworkErrorCode, createChannelApiRetryRunner } from "openclaw/plugin-sdk/retry-runtime";
|
|
12
12
|
import { assertOkOrThrowHttpError, createProviderOperationDeadline, createProviderOperationTimeoutResolver, fetchWithTimeout, readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
|
|
13
13
|
import { fetchWithRuntimeDispatcherOrMockedGlobal } from "openclaw/plugin-sdk/runtime-fetch";
|
|
14
|
+
//#region \0rolldown/runtime.js
|
|
15
|
+
var __defProp = Object.defineProperty;
|
|
16
|
+
var __exportAll = (all, no_symbols) => {
|
|
17
|
+
let target = {};
|
|
18
|
+
for (var name in all) __defProp(target, name, {
|
|
19
|
+
get: all[name],
|
|
20
|
+
enumerable: true
|
|
21
|
+
});
|
|
22
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
23
|
+
return target;
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
14
26
|
//#region extensions/line/src/messaging-target.ts
|
|
15
27
|
function normalizeLineMessagingTarget(target) {
|
|
16
28
|
const trimmed = target.trim();
|
|
@@ -55,7 +67,7 @@ function resolveLineMediaKind(url, opts) {
|
|
|
55
67
|
mediaKind: opts.mediaKind,
|
|
56
68
|
kindSource: "declared"
|
|
57
69
|
};
|
|
58
|
-
if (
|
|
70
|
+
if (opts.durationMs !== void 0) return {
|
|
59
71
|
mediaKind: "audio",
|
|
60
72
|
kindSource: "metadata"
|
|
61
73
|
};
|
|
@@ -103,7 +115,7 @@ async function buildLineMediaMessage(mediaUrl, opts, target) {
|
|
|
103
115
|
case "audio": return {
|
|
104
116
|
type: "audio",
|
|
105
117
|
originalContentUrl: trimmedUrl,
|
|
106
|
-
duration:
|
|
118
|
+
duration: opts.durationMs ?? 6e4
|
|
107
119
|
};
|
|
108
120
|
default: return {
|
|
109
121
|
type: "image",
|
|
@@ -125,7 +137,6 @@ function quoteTokenKey(chatId, messageId) {
|
|
|
125
137
|
function readLineQuoteToken(message) {
|
|
126
138
|
return message.type === "text" || message.type === "image" || message.type === "video" || message.type === "sticker" ? message.quoteToken : void 0;
|
|
127
139
|
}
|
|
128
|
-
/** Remembers the token an inbound message can later be quoted with. */
|
|
129
140
|
function recordLineQuoteToken(params) {
|
|
130
141
|
const quoteToken = params.quoteToken;
|
|
131
142
|
if (!quoteToken) return;
|
|
@@ -137,7 +148,6 @@ function recordLineQuoteToken(params) {
|
|
|
137
148
|
tokens.set(key, quoteToken);
|
|
138
149
|
pruneMapToMaxSize(tokens, QUOTE_TOKEN_LIMIT);
|
|
139
150
|
}
|
|
140
|
-
/** Resolves the token that quotes one message in one chat, if it is still known. */
|
|
141
151
|
function resolveLineQuoteToken(params) {
|
|
142
152
|
const key = params.messageId ? quoteTokenKey(params.chatId, params.messageId) : void 0;
|
|
143
153
|
if (!key) return;
|
|
@@ -167,7 +177,7 @@ function reportLineQuoteCarrierMissing(chatId) {
|
|
|
167
177
|
/** Attaches a quote token to the first message in a request that can carry one. */
|
|
168
178
|
function applyLineQuoteToken(messages, quoteToken) {
|
|
169
179
|
const target = quoteToken ? messages.findIndex(canCarryLineQuoteToken) : -1;
|
|
170
|
-
return target < 0 ?
|
|
180
|
+
return target < 0 ? messages : messages.map((message, index) => index === target ? {
|
|
171
181
|
...message,
|
|
172
182
|
quoteToken
|
|
173
183
|
} : message);
|
|
@@ -203,6 +213,19 @@ function toFlexMessage(altText, contents) {
|
|
|
203
213
|
//#endregion
|
|
204
214
|
//#region extensions/line/src/actions.ts
|
|
205
215
|
const LINE_ACTION_LABEL_LIMIT = 20;
|
|
216
|
+
const LINE_QUICK_REPLY_ITEM_LIMIT = 13;
|
|
217
|
+
const lineActionUriProtocols = /* @__PURE__ */ new Set([
|
|
218
|
+
"http:",
|
|
219
|
+
"https:",
|
|
220
|
+
"line:",
|
|
221
|
+
"tel:"
|
|
222
|
+
]);
|
|
223
|
+
const linePostbackInputOptions = /* @__PURE__ */ new Set([
|
|
224
|
+
"closeRichMenu",
|
|
225
|
+
"openRichMenu",
|
|
226
|
+
"openKeyboard",
|
|
227
|
+
"openVoice"
|
|
228
|
+
]);
|
|
206
229
|
const LINE_ACTION_DATA_LIMIT = 300;
|
|
207
230
|
const LINE_ACTION_URI_LIMIT = 1e3;
|
|
208
231
|
const LINE_CLIPBOARD_TEXT_LIMIT = 1e3;
|
|
@@ -212,6 +235,28 @@ const LINE_IMAGEMAP_MESSAGE_TEXT_LIMIT = 400;
|
|
|
212
235
|
const LINE_IMAGEMAP_EXTERNAL_LINK_LABEL_LIMIT = 30;
|
|
213
236
|
const LINE_IMAGEMAP_ACTION_LIMIT = 50;
|
|
214
237
|
const graphemeSegmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
238
|
+
function isValidLineUri(value, icon = false) {
|
|
239
|
+
if (typeof value !== "string" || value.length > (icon ? 2e3 : LINE_ACTION_URI_LIMIT)) return false;
|
|
240
|
+
try {
|
|
241
|
+
const protocol = new URL(value).protocol;
|
|
242
|
+
return icon ? protocol === "https:" : lineActionUriProtocols.has(protocol);
|
|
243
|
+
} catch {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function invalidLineUriReason(value) {
|
|
248
|
+
return typeof value === "string" && value.length > LINE_ACTION_URI_LIMIT ? "URL exceeds LINE's limit." : "URL scheme is not supported by LINE.";
|
|
249
|
+
}
|
|
250
|
+
function isValidLinePickerValue(value, mode) {
|
|
251
|
+
if (mode === "time") return /^(?:[01]\d|2[0-3]):[0-5]\d$/.test(value);
|
|
252
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})(?:[Tt]((?:[01]\d|2[0-3]):[0-5]\d))?$/.exec(value);
|
|
253
|
+
if (!match || mode === "datetime" !== (match[4] !== void 0)) return false;
|
|
254
|
+
const year = Number(match[1]);
|
|
255
|
+
const month = Number(match[2]);
|
|
256
|
+
const day = Number(match[3]);
|
|
257
|
+
const date = new Date(Date.UTC(year, month - 1, day));
|
|
258
|
+
return year >= 1900 && year <= 2100 && date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day;
|
|
259
|
+
}
|
|
215
260
|
function truncateLineActionText(text, limit) {
|
|
216
261
|
let result = "";
|
|
217
262
|
let count = 0;
|
|
@@ -226,9 +271,6 @@ function truncateLineActionText(text, limit) {
|
|
|
226
271
|
function truncateLineActionLabel(label, limit = LINE_ACTION_LABEL_LIMIT) {
|
|
227
272
|
return truncateLineActionText(label, limit) || (label ? "…" : "");
|
|
228
273
|
}
|
|
229
|
-
function truncateLineActionData(data) {
|
|
230
|
-
return truncateUtf16Safe(data, LINE_ACTION_DATA_LIMIT);
|
|
231
|
-
}
|
|
232
274
|
const UNDELIVERABLE_IMAGE_WARNING = "Image unavailable: URL must use HTTPS.";
|
|
233
275
|
function flexWarning(text) {
|
|
234
276
|
return {
|
|
@@ -267,23 +309,51 @@ function isLineAction(value) {
|
|
|
267
309
|
function isUnavailableAction(action) {
|
|
268
310
|
return action[unavailableActionMarker] === true;
|
|
269
311
|
}
|
|
270
|
-
function
|
|
271
|
-
|
|
312
|
+
function hasRequiredActionFields(action) {
|
|
313
|
+
switch (action.type) {
|
|
314
|
+
case "message": return typeof action.text === "string";
|
|
315
|
+
case "uri": return hasNonEmptyString(action.uri);
|
|
316
|
+
case "postback": return typeof action.data === "string";
|
|
317
|
+
case "datetimepicker": return typeof action.data === "string" && (action.mode === "date" || action.mode === "time" || action.mode === "datetime");
|
|
318
|
+
case "clipboard": return typeof action.clipboardText === "string" && action.clipboardText.length > 0;
|
|
319
|
+
default: return true;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
function normalizeMessageSurfaceAction(value, labelLimit, surface, requireLabel) {
|
|
323
|
+
if (!isLineAction(value)) return unavailableAction("Action", "action type is not supported by LINE.");
|
|
324
|
+
if (requireLabel && !hasNonEmptyString(value.label)) return unavailableAction("Action", "action label is missing.");
|
|
325
|
+
if (value.type === "richmenuswitch") return unavailableAction("Action", "rich menu switching is only available in rich menus.");
|
|
326
|
+
if (surface !== "quick-reply" && (value.type === "camera" || value.type === "cameraRoll" || value.type === "location")) return unavailableAction("Action", "this action is only available in quick replies.");
|
|
327
|
+
if (surface === "quick-reply" && value.type === "postback" && value.text !== void 0) {
|
|
328
|
+
const { text, ...postback } = value;
|
|
329
|
+
return normalizeLineAction({
|
|
330
|
+
...postback,
|
|
331
|
+
displayText: postback.displayText ?? text
|
|
332
|
+
}, labelLimit);
|
|
333
|
+
}
|
|
334
|
+
return normalizeLineAction(value, labelLimit);
|
|
335
|
+
}
|
|
336
|
+
function normalizeNestedContent(value, labelLimit, warnings, surface = "flex") {
|
|
337
|
+
if (Array.isArray(value)) return value.map((item) => normalizeNestedContent(item, labelLimit, warnings, surface)).filter((item) => item !== void 0);
|
|
272
338
|
if (!isRecord(value)) return value;
|
|
273
339
|
if (warnings && (value.type === "image" || value.type === "icon") && !isHttpsUrl(value.url)) {
|
|
274
340
|
warnings.push(UNDELIVERABLE_IMAGE_WARNING);
|
|
275
341
|
return;
|
|
276
342
|
}
|
|
277
343
|
const normalized = { ...value };
|
|
278
|
-
for (const [key, nested] of Object.entries(value)) if ((key === "action" || key === "defaultAction") &&
|
|
279
|
-
const action =
|
|
344
|
+
for (const [key, nested] of Object.entries(value)) if ((key === "action" || key === "defaultAction") && nested !== void 0) {
|
|
345
|
+
const action = normalizeMessageSurfaceAction(nested, labelLimit, surface, surface === "template" || value.type === "button");
|
|
346
|
+
if (key === "defaultAction" && isUnavailableAction(action)) {
|
|
347
|
+
delete normalized[key];
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
280
350
|
if (warnings && key === "action" && (value.type === "video" && action.type !== "uri" || value.type !== "button" && isUnavailableAction(action))) {
|
|
281
351
|
delete normalized[key];
|
|
282
352
|
warnings.push(isUnavailableAction(action) ? action.text ?? "Action unavailable." : "Action unavailable in this video.");
|
|
283
353
|
} else normalized[key] = action;
|
|
284
|
-
} else if (key === "actions" && Array.isArray(nested)) normalized[key] = nested.map((action) =>
|
|
354
|
+
} else if (key === "actions" && Array.isArray(nested)) normalized[key] = nested.map((action) => normalizeMessageSurfaceAction(action, labelLimit, surface, surface === "template"));
|
|
285
355
|
else {
|
|
286
|
-
const content = normalizeNestedContent(nested, labelLimit, warnings);
|
|
356
|
+
const content = normalizeNestedContent(nested, labelLimit, warnings, surface);
|
|
287
357
|
if (content === void 0) delete normalized[key];
|
|
288
358
|
else normalized[key] = content;
|
|
289
359
|
}
|
|
@@ -349,22 +419,22 @@ function unavailableImagemapAction(kind, reason, area) {
|
|
|
349
419
|
function normalizeImagemapAction(action) {
|
|
350
420
|
const label = action.label === void 0 ? void 0 : truncateLineActionText(action.label, LINE_IMAGEMAP_ACTION_LABEL_LIMIT);
|
|
351
421
|
if (action.type === "uri") {
|
|
352
|
-
if (
|
|
422
|
+
if (!isValidLineUri(action.linkUri)) return unavailableImagemapAction("Link", invalidLineUriReason(action.linkUri), action.area);
|
|
353
423
|
return {
|
|
354
424
|
...action,
|
|
355
425
|
label
|
|
356
426
|
};
|
|
357
427
|
}
|
|
358
428
|
if (action.type === "message") {
|
|
359
|
-
|
|
360
|
-
if (text
|
|
429
|
+
if (typeof action.text !== "string") return unavailableImagemapAction("Action", "message text is missing.", action.area);
|
|
430
|
+
if (action.text.length > LINE_IMAGEMAP_MESSAGE_TEXT_LIMIT) return unavailableImagemapAction("Action", "message text exceeds LINE's limit.", action.area);
|
|
361
431
|
return {
|
|
362
432
|
...action,
|
|
363
|
-
label
|
|
364
|
-
text
|
|
433
|
+
label
|
|
365
434
|
};
|
|
366
435
|
}
|
|
367
|
-
if (
|
|
436
|
+
if (typeof action.clipboardText !== "string" || action.clipboardText.length === 0) return unavailableImagemapAction("Action", "clipboard text must not be empty.", action.area);
|
|
437
|
+
if (action.clipboardText.length > LINE_CLIPBOARD_TEXT_LIMIT) return unavailableImagemapAction("Action", "clipboard text exceeds LINE's limit.", action.area);
|
|
368
438
|
return {
|
|
369
439
|
...action,
|
|
370
440
|
label
|
|
@@ -372,16 +442,16 @@ function normalizeImagemapAction(action) {
|
|
|
372
442
|
}
|
|
373
443
|
function normalizeImagemapVideo(video) {
|
|
374
444
|
const externalLink = video.externalLink;
|
|
375
|
-
if (
|
|
376
|
-
|
|
377
|
-
if (externalLink.linkUri !== void 0 && truncateUtf16Safe(externalLink.linkUri, LINE_ACTION_URI_LIMIT) !== externalLink.linkUri) {
|
|
445
|
+
if (externalLink === void 0) return { video };
|
|
446
|
+
if (!isRecord(externalLink) || !isValidLineUri(externalLink.linkUri) || !hasNonEmptyString(externalLink.label)) {
|
|
378
447
|
const normalizedVideo = { ...video };
|
|
379
448
|
delete normalizedVideo.externalLink;
|
|
380
449
|
return {
|
|
381
450
|
video: normalizedVideo,
|
|
382
|
-
fallbackAction: video.area === void 0 ? void 0 : unavailableImagemapAction("Link", "URL
|
|
451
|
+
fallbackAction: video.area === void 0 ? void 0 : unavailableImagemapAction("Link", "video link URL or label is invalid.", video.area)
|
|
383
452
|
};
|
|
384
453
|
}
|
|
454
|
+
const label = truncateUtf16Safe(externalLink.label, LINE_IMAGEMAP_EXTERNAL_LINK_LABEL_LIMIT) || "…";
|
|
385
455
|
return { video: {
|
|
386
456
|
...video,
|
|
387
457
|
externalLink: {
|
|
@@ -398,7 +468,7 @@ function normalizeLineMessage(message) {
|
|
|
398
468
|
};
|
|
399
469
|
else if (message.type === "template") {
|
|
400
470
|
const labelLimit = message.template.type === "image_carousel" ? 12 : 20;
|
|
401
|
-
const template = normalizeNestedContent(message.template, labelLimit);
|
|
471
|
+
const template = normalizeNestedContent(message.template, labelLimit, void 0, message.template.type === "image_carousel" ? "image-carousel" : "template");
|
|
402
472
|
const columns = template.type === "carousel" ? template.columns : template.type === "buttons" ? [template] : [];
|
|
403
473
|
if (columns.some((column) => !isHttpsUrl(column.thumbnailImageUrl))) for (const column of columns) delete column.thumbnailImageUrl;
|
|
404
474
|
normalized = {
|
|
@@ -417,50 +487,77 @@ function normalizeLineMessage(message) {
|
|
|
417
487
|
video: videoResult?.video
|
|
418
488
|
};
|
|
419
489
|
} else normalized = { ...message };
|
|
420
|
-
if (message.quickReply)
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
490
|
+
if (message.quickReply) {
|
|
491
|
+
const items = [];
|
|
492
|
+
for (const item of Array.isArray(message.quickReply.items) ? message.quickReply.items : []) {
|
|
493
|
+
if (!isRecord(item) || !isLineAction(item.action) || !hasNonEmptyString(item.action.label) || !hasRequiredActionFields(item.action)) continue;
|
|
494
|
+
const { imageUrl, ...rest } = item;
|
|
495
|
+
items.push({
|
|
496
|
+
...rest,
|
|
497
|
+
...isValidLineUri(imageUrl, true) ? { imageUrl } : {},
|
|
498
|
+
type: "action",
|
|
499
|
+
action: normalizeMessageSurfaceAction(item.action, 20, "quick-reply", true)
|
|
500
|
+
});
|
|
501
|
+
if (items.length === LINE_QUICK_REPLY_ITEM_LIMIT) break;
|
|
502
|
+
}
|
|
503
|
+
if (items.length) normalized.quickReply = { items };
|
|
504
|
+
else delete normalized.quickReply;
|
|
505
|
+
}
|
|
424
506
|
return normalized;
|
|
425
507
|
}
|
|
426
508
|
function normalizeLineAction(action, labelLimit = LINE_ACTION_LABEL_LIMIT) {
|
|
427
509
|
if (isUnavailableAction(action)) return action;
|
|
428
510
|
const label = action.label === void 0 ? void 0 : truncateLineActionLabel(action.label, labelLimit);
|
|
429
511
|
if (action.type === "uri") {
|
|
430
|
-
|
|
431
|
-
const
|
|
432
|
-
const desktopUriTooLong = desktopUri !== void 0 && truncateUtf16Safe(desktopUri, LINE_ACTION_URI_LIMIT) !== desktopUri;
|
|
433
|
-
if (uriTooLong || desktopUriTooLong) return unavailableAction("Link", "URL exceeds LINE's limit.");
|
|
434
|
-
return {
|
|
512
|
+
if (!isValidLineUri(action.uri)) return unavailableAction("Link", invalidLineUriReason(action.uri));
|
|
513
|
+
const normalized = {
|
|
435
514
|
...action,
|
|
436
515
|
label
|
|
437
516
|
};
|
|
517
|
+
if (action.altUri !== void 0 && (!isRecord(action.altUri) || !isValidLineUri(action.altUri.desktop))) delete normalized.altUri;
|
|
518
|
+
return normalized;
|
|
438
519
|
}
|
|
439
|
-
if (action.type === "postback") {
|
|
440
|
-
|
|
441
|
-
if (data !== action.data) return unavailableAction("Action", "callback data exceeds LINE's limit.");
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
520
|
+
if (action.type === "postback" || action.type === "datetimepicker") {
|
|
521
|
+
if (!hasRequiredActionFields(action)) return unavailableAction("Action", "callback data or picker mode is missing.");
|
|
522
|
+
if (action.data !== void 0 && action.data.length > LINE_ACTION_DATA_LIMIT) return unavailableAction("Action", "callback data exceeds LINE's limit.");
|
|
523
|
+
if (action.type === "datetimepicker") {
|
|
524
|
+
const normalized = {
|
|
525
|
+
...action,
|
|
526
|
+
label
|
|
527
|
+
};
|
|
528
|
+
for (const field of [
|
|
529
|
+
"initial",
|
|
530
|
+
"min",
|
|
531
|
+
"max"
|
|
532
|
+
]) {
|
|
533
|
+
const value = normalized[field];
|
|
534
|
+
if (value !== void 0 && !isValidLinePickerValue(value, action.mode)) delete normalized[field];
|
|
535
|
+
}
|
|
536
|
+
if (normalized.min !== void 0 && normalized.max !== void 0 && normalized.min.toUpperCase() >= normalized.max.toUpperCase()) {
|
|
537
|
+
delete normalized.min;
|
|
538
|
+
delete normalized.max;
|
|
539
|
+
}
|
|
540
|
+
return normalized;
|
|
541
|
+
}
|
|
542
|
+
const { text: legacyText, ...postback } = action;
|
|
543
|
+
const chosenText = action.displayText === void 0 ? legacyText : void 0;
|
|
544
|
+
const text = chosenText === void 0 ? void 0 : truncateLineActionText(chosenText, LINE_ACTION_DATA_LIMIT);
|
|
545
|
+
const keyboardText = action.inputOption === "openKeyboard" ? action.fillInText : void 0;
|
|
546
|
+
const fillInText = keyboardText === void 0 ? void 0 : truncateLineActionText(keyboardText, LINE_ACTION_DATA_LIMIT);
|
|
547
|
+
if (text !== chosenText || fillInText !== keyboardText) return unavailableAction("Action", "message text exceeds LINE's limit.");
|
|
548
|
+
const normalized = {
|
|
549
|
+
...postback,
|
|
447
550
|
label,
|
|
448
|
-
data,
|
|
449
551
|
displayText: action.displayText === void 0 ? void 0 : truncateLineActionText(action.displayText, LINE_ACTION_DATA_LIMIT),
|
|
450
552
|
text,
|
|
451
553
|
fillInText
|
|
452
554
|
};
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
if (data !== action.data) return unavailableAction("Action", "callback data exceeds LINE's limit.");
|
|
457
|
-
return {
|
|
458
|
-
...action,
|
|
459
|
-
label,
|
|
460
|
-
data
|
|
461
|
-
};
|
|
555
|
+
if (normalized.inputOption !== void 0 && !linePostbackInputOptions.has(normalized.inputOption)) delete normalized.inputOption;
|
|
556
|
+
if (normalized.inputOption !== "openKeyboard") delete normalized.fillInText;
|
|
557
|
+
return normalized;
|
|
462
558
|
}
|
|
463
559
|
if (action.type === "message") {
|
|
560
|
+
if (!hasRequiredActionFields(action)) return unavailableAction("Action", "message text is missing.");
|
|
464
561
|
const text = action.text === void 0 ? void 0 : truncateLineActionText(action.text, LINE_ACTION_DATA_LIMIT);
|
|
465
562
|
if (text !== action.text) return unavailableAction("Action", "message text exceeds LINE's limit.");
|
|
466
563
|
return {
|
|
@@ -470,20 +567,20 @@ function normalizeLineAction(action, labelLimit = LINE_ACTION_LABEL_LIMIT) {
|
|
|
470
567
|
};
|
|
471
568
|
}
|
|
472
569
|
if (action.type === "clipboard") {
|
|
473
|
-
if (
|
|
570
|
+
if (!hasRequiredActionFields(action)) return unavailableAction("Action", "clipboard text must not be empty.");
|
|
571
|
+
if (action.clipboardText.length > LINE_CLIPBOARD_TEXT_LIMIT) return unavailableAction("Action", "clipboard text exceeds LINE's limit.");
|
|
474
572
|
return {
|
|
475
573
|
...action,
|
|
476
574
|
label
|
|
477
575
|
};
|
|
478
576
|
}
|
|
479
577
|
if (action.type === "richmenuswitch") {
|
|
480
|
-
const
|
|
481
|
-
const aliasTooLong = action.richMenuAliasId !== void 0 &&
|
|
482
|
-
if (
|
|
578
|
+
const dataTooLong = action.data !== void 0 && action.data.length > LINE_ACTION_DATA_LIMIT;
|
|
579
|
+
const aliasTooLong = action.richMenuAliasId !== void 0 && action.richMenuAliasId.length > LINE_RICH_MENU_ALIAS_LIMIT;
|
|
580
|
+
if (dataTooLong || aliasTooLong) return unavailableAction("Action", "rich menu data exceeds LINE's limit.");
|
|
483
581
|
return {
|
|
484
582
|
...action,
|
|
485
|
-
label
|
|
486
|
-
data
|
|
583
|
+
label
|
|
487
584
|
};
|
|
488
585
|
}
|
|
489
586
|
return action.label === label ? action : {
|
|
@@ -671,17 +768,6 @@ function createActionCard(title, body, actions, options) {
|
|
|
671
768
|
}
|
|
672
769
|
//#endregion
|
|
673
770
|
//#region extensions/line/src/flex-templates/schedule-cards.ts
|
|
674
|
-
function buildTitleSubtitleHeader(params) {
|
|
675
|
-
const { title, subtitle } = params;
|
|
676
|
-
const headerContents = [createCardTitle(title)];
|
|
677
|
-
if (subtitle) headerContents.push(cardText(subtitle, {
|
|
678
|
-
size: "sm",
|
|
679
|
-
color: "#888888",
|
|
680
|
-
margin: "sm",
|
|
681
|
-
wrap: true
|
|
682
|
-
}));
|
|
683
|
-
return headerContents;
|
|
684
|
-
}
|
|
685
771
|
function buildCardHeaderSections(headerContents) {
|
|
686
772
|
return [cardBox("vertical", headerContents, { paddingBottom: "lg" }), {
|
|
687
773
|
type: "separator",
|
|
@@ -809,10 +895,13 @@ function createEventCard(params) {
|
|
|
809
895
|
}
|
|
810
896
|
function createAgendaCard(params) {
|
|
811
897
|
const { title, subtitle, events, footer } = params;
|
|
812
|
-
const headerContents =
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
898
|
+
const headerContents = [createCardTitle(title)];
|
|
899
|
+
if (subtitle) headerContents.push(cardText(subtitle, {
|
|
900
|
+
size: "sm",
|
|
901
|
+
color: "#888888",
|
|
902
|
+
margin: "sm",
|
|
903
|
+
wrap: true
|
|
904
|
+
}));
|
|
816
905
|
const eventItems = events.slice(0, 6).map((event, index) => {
|
|
817
906
|
const isActive = event.isNow || index === 0;
|
|
818
907
|
const accentColor = isActive ? "#06C755" : "#E5E5E5";
|
|
@@ -855,6 +944,10 @@ function resolveLineChannelAccessToken(explicit, params) {
|
|
|
855
944
|
}
|
|
856
945
|
//#endregion
|
|
857
946
|
//#region extensions/line/src/probe.ts
|
|
947
|
+
var probe_exports = /* @__PURE__ */ __exportAll({
|
|
948
|
+
probeLineBot: () => probeLineBot,
|
|
949
|
+
readLineAccountMessageQuota: () => readLineAccountMessageQuota
|
|
950
|
+
});
|
|
858
951
|
const LINE_QUOTA_TIMEOUT_MS = 2e3;
|
|
859
952
|
const LINE_JSON_MAX_BYTES = 16384;
|
|
860
953
|
function createLineApiReader(channelAccessToken, timeoutMs) {
|
|
@@ -885,13 +978,15 @@ async function readLineMessageQuota(channelAccessToken, budgetMs) {
|
|
|
885
978
|
const read = createLineApiReader(channelAccessToken, budgetMs);
|
|
886
979
|
const quota = await read("message/quota");
|
|
887
980
|
if (quota.type === "none") return { kind: "unlimited" };
|
|
888
|
-
|
|
981
|
+
const limit = asSafeIntegerInRange(quota.value, { min: 0 });
|
|
982
|
+
if (quota.type !== "limited" || limit === void 0) return;
|
|
889
983
|
const { totalUsage } = await read("message/quota/consumption");
|
|
890
|
-
|
|
984
|
+
const used = asSafeIntegerInRange(totalUsage, { min: 0 });
|
|
985
|
+
return used === void 0 ? void 0 : {
|
|
891
986
|
kind: "limited",
|
|
892
|
-
limit
|
|
893
|
-
used
|
|
894
|
-
}
|
|
987
|
+
limit,
|
|
988
|
+
used
|
|
989
|
+
};
|
|
895
990
|
} catch {
|
|
896
991
|
return;
|
|
897
992
|
}
|
|
@@ -1005,4 +1100,4 @@ async function explainLineRefusal(params) {
|
|
|
1005
1100
|
};
|
|
1006
1101
|
}
|
|
1007
1102
|
//#endregion
|
|
1008
|
-
export {
|
|
1103
|
+
export { reportLineQuoteCarrierMissing as A, uriAction as C, canCarryLineQuoteToken as D, applyLineQuoteToken as E, normalizeLineMessagingTarget as F, withoutLineQuoteTokens as M, buildLineMediaMessage as N, readLineQuoteToken as O, inferLineTargetChatType as P, truncateLineActionLabel as S, toFlexMessage as T, createCardBubble as _, probeLineBot as a, normalizeLineMessage as b, createAgendaCard as c, createActionCard as d, createImageCard as f, cardText as g, cardBox as h, runLinePushWithRetries as i, resolveLineQuoteToken as j, recordLineQuoteToken as k, createEventCard as l, createListCard as m, findLineHttpError as n, probe_exports as o, createInfoCard as p, resolveLineNonDispatchRetryable as r, resolveLineChannelAccessToken as s, explainLineRefusal as t, createReceiptCard as u, createCardTitle as v, fitsLineFlexBubble as w, postbackAction as x, messageAction as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as uriAction, T as toFlexMessage, g as cardText, h as cardBox, u as createReceiptCard, w as fitsLineFlexBubble, x as postbackAction, y as messageAction } from "./send-retry-Bf2Xr6ZN.mjs";
|
|
2
2
|
import { markdownToIRWithMeta, stripMarkdown } from "openclaw/plugin-sdk/text-chunking";
|
|
3
3
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
4
4
|
//#region extensions/line/src/markdown-to-line.ts
|
|
@@ -19,12 +19,6 @@ function parseLineMarkdown(text, tableMode = "block") {
|
|
|
19
19
|
tableMode
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
function toCodeBlock(ir, span) {
|
|
23
|
-
return {
|
|
24
|
-
...span.language ? { language: span.language } : {},
|
|
25
|
-
code: ir.text.slice(span.start, span.end).trimEnd()
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
22
|
function rangesOverlap(left, right) {
|
|
29
23
|
return left.start < right.end && right.start < left.end;
|
|
30
24
|
}
|
|
@@ -103,18 +97,6 @@ function projectPlainText(ir, omitted = [], additionalInsertions = [], onSegment
|
|
|
103
97
|
}
|
|
104
98
|
return output.trim();
|
|
105
99
|
}
|
|
106
|
-
function formatOversizedTableAsBullets(table) {
|
|
107
|
-
const markdownCell = (cell) => projectPlainText(cell).replace(/[\\|`*_[\]~<>&]/gu, "\\$&").replace(/\r?\n/gu, " ");
|
|
108
|
-
const markdownRow = (cells) => `| ${cells.map(markdownCell).join(" | ")} |`;
|
|
109
|
-
return projectPlainText(parseLineMarkdown([
|
|
110
|
-
markdownRow(table.headerCells),
|
|
111
|
-
`| ${table.headerCells.map(() => "---").join(" | ")} |`,
|
|
112
|
-
...table.rowCells.map(markdownRow)
|
|
113
|
-
].join("\n"), "bullets").ir);
|
|
114
|
-
}
|
|
115
|
-
function sameSpanStyle(left, right) {
|
|
116
|
-
return left.weight === right.weight && left.style === right.style && left.decoration === right.decoration;
|
|
117
|
-
}
|
|
118
100
|
function renderTableCell(cell) {
|
|
119
101
|
if (!cell.text.trim()) return {
|
|
120
102
|
text: "-",
|
|
@@ -142,7 +124,7 @@ function renderTableCell(cell) {
|
|
|
142
124
|
let hasMarkup = false;
|
|
143
125
|
const appendSpan = (span) => {
|
|
144
126
|
const previous = spans.at(-1);
|
|
145
|
-
if (previous &&
|
|
127
|
+
if (previous && previous.weight === span.weight && previous.style === span.style && previous.decoration === span.decoration) previous.text = `${previous.text ?? ""}${span.text ?? ""}`;
|
|
146
128
|
else spans.push(span);
|
|
147
129
|
};
|
|
148
130
|
for (let index = 0; index < sortedBoundaries.length - 1; index += 1) {
|
|
@@ -244,26 +226,6 @@ function convertTableToFlexBubble(table) {
|
|
|
244
226
|
], { paddingAll: "lg" })
|
|
245
227
|
};
|
|
246
228
|
}
|
|
247
|
-
function convertCodeBlockToFlexBubble(block) {
|
|
248
|
-
const titleText = block.language ? `Code (${block.language})` : "Code";
|
|
249
|
-
return {
|
|
250
|
-
type: "bubble",
|
|
251
|
-
body: cardBox("vertical", [cardText(titleText, {
|
|
252
|
-
weight: "bold",
|
|
253
|
-
size: "sm",
|
|
254
|
-
color: "#666666"
|
|
255
|
-
}), cardBox("vertical", [cardText(block.code, {
|
|
256
|
-
size: "xs",
|
|
257
|
-
color: "#333333",
|
|
258
|
-
wrap: true
|
|
259
|
-
})], {
|
|
260
|
-
backgroundColor: "#F5F5F5",
|
|
261
|
-
paddingAll: "md",
|
|
262
|
-
cornerRadius: "md",
|
|
263
|
-
margin: "sm"
|
|
264
|
-
})], { paddingAll: "lg" })
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
229
|
/** Parse once, route existing block surfaces to Flex, and project the remainder as plain text. */
|
|
268
230
|
function processLineMessage(text) {
|
|
269
231
|
const { ir, tables } = parseLineMarkdown(text);
|
|
@@ -272,9 +234,16 @@ function processLineMessage(text) {
|
|
|
272
234
|
for (const table of tables) {
|
|
273
235
|
const bubble = convertTableToFlexBubble(table);
|
|
274
236
|
if (!bubble || !fitsLineFlexBubble(bubble)) {
|
|
237
|
+
const markdownCell = (cell) => projectPlainText(cell).replace(/[\\|`*_[\]~<>&]/gu, "\\$&").replace(/\r?\n/gu, " ");
|
|
238
|
+
const markdownRow = (cells) => `| ${cells.map(markdownCell).join(" | ")} |`;
|
|
239
|
+
const markdown = [
|
|
240
|
+
markdownRow(table.headerCells),
|
|
241
|
+
`| ${table.headerCells.map(() => "---").join(" | ")} |`,
|
|
242
|
+
...table.rowCells.map(markdownRow)
|
|
243
|
+
].join("\n");
|
|
275
244
|
plainTextInsertions.push({
|
|
276
245
|
position: table.placeholderOffset,
|
|
277
|
-
text: `\n\n${
|
|
246
|
+
text: `\n\n${projectPlainText(parseLineMarkdown(markdown, "bullets").ir)}\n\n`
|
|
278
247
|
});
|
|
279
248
|
continue;
|
|
280
249
|
}
|
|
@@ -285,7 +254,10 @@ function processLineMessage(text) {
|
|
|
285
254
|
});
|
|
286
255
|
}
|
|
287
256
|
for (const span of codeSpans) {
|
|
288
|
-
const block =
|
|
257
|
+
const block = {
|
|
258
|
+
...span.language ? { language: span.language } : {},
|
|
259
|
+
code: ir.text.slice(span.start, span.end).trimEnd()
|
|
260
|
+
};
|
|
289
261
|
if (!block.code.trim()) continue;
|
|
290
262
|
if (block.code.length > LINE_FLEX_CODE_CARD_MAX_CHARS) {
|
|
291
263
|
plainTextInsertions.push({
|
|
@@ -294,9 +266,26 @@ function processLineMessage(text) {
|
|
|
294
266
|
});
|
|
295
267
|
continue;
|
|
296
268
|
}
|
|
269
|
+
const titleText = block.language ? `Code (${block.language})` : "Code";
|
|
297
270
|
plainTextInsertions.push({
|
|
298
271
|
position: span.start,
|
|
299
|
-
message: toFlexMessage("Code",
|
|
272
|
+
message: toFlexMessage("Code", {
|
|
273
|
+
type: "bubble",
|
|
274
|
+
body: cardBox("vertical", [cardText(titleText, {
|
|
275
|
+
weight: "bold",
|
|
276
|
+
size: "sm",
|
|
277
|
+
color: "#666666"
|
|
278
|
+
}), cardBox("vertical", [cardText(block.code, {
|
|
279
|
+
size: "xs",
|
|
280
|
+
color: "#333333",
|
|
281
|
+
wrap: true
|
|
282
|
+
})], {
|
|
283
|
+
backgroundColor: "#F5F5F5",
|
|
284
|
+
paddingAll: "md",
|
|
285
|
+
cornerRadius: "md",
|
|
286
|
+
margin: "sm"
|
|
287
|
+
})], { paddingAll: "lg" })
|
|
288
|
+
})
|
|
300
289
|
});
|
|
301
290
|
}
|
|
302
291
|
const segments = [];
|
|
@@ -364,7 +353,6 @@ function truncateTemplateText(text, limit) {
|
|
|
364
353
|
function resolveTemplateAltText(value, fallback) {
|
|
365
354
|
return truncateTemplateText(value ?? fallback, TEMPLATE_ALT_TEXT_LIMIT);
|
|
366
355
|
}
|
|
367
|
-
/** Convert portable template payloads at the LINE provider boundary. */
|
|
368
356
|
function buildTemplateMessageFromPayload(payload) {
|
|
369
357
|
switch (payload.type) {
|
|
370
358
|
case "confirm": return {
|
|
@@ -0,0 +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-DOiM8-y3.mjs","sha256":"56d1cf766984063d8eec40ee937e12f10082bb39c5cd30ffb9d0829b85c85940","facadeSource":null,"sources":["extensions/line/src/accounts.ts"]},{"output":".setup/api-4BpGVN1-.mjs","sha256":"9c99544ce41b3dd018743eab7cc5b6d9596813890f7cf517bffcea775769c15f","facadeSource":"extensions/line/api.ts","sources":[]},{"output":".setup/api-BRnngy5R.mjs","sha256":"ab8599bad307acb2dea525ebdd65ed1f55c02a4ef1b0762f804371251daf8fdd","facadeSource":null,"sources":["extensions/line/src/channel.setup.ts"]},{"output":".setup/card-command-2y-RSLPg.mjs","sha256":"719c15c161a339b1378ee4159f307a56b68ca9a4c0c59468940a2950fecf4f87","facadeSource":"extensions/line/src/card-command.ts","sources":["extensions/line/src/card-command.ts"]},{"output":".setup/channel-DJcpjKpx.mjs","sha256":"d7a5980902942c2faaafb0fe35f4e8423fa3cf99f66d4e21ae2273672fedcb77","facadeSource":null,"sources":["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/outbound.ts","extensions/line/src/question-postback.ts","extensions/line/src/quick-reply-fallback.ts","extensions/line/src/rich-message-schema.ts","extensions/line/src/rich-messages.ts","extensions/line/src/status.ts"]},{"output":".setup/channel.runtime-CdfKsNz4.mjs","sha256":"56a33d635b2436d5abe67569edebe3185c39454adc34827273bcc94b6e015672","facadeSource":"extensions/line/src/channel.runtime.ts","sources":[]},{"output":".setup/monitor-BkuPFFxZ.mjs","sha256":"65a9b2e8486ca01ed61e6b644de98e4a947a628f3e17ce27e365a07bccd0c568","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-BPo_111h.mjs","sha256":"8f8c1733c74ec476640719a49e8325e28274c663ca1fb084d8a338128d744eff","facadeSource":"extensions/line/src/outbound.runtime.ts","sources":[]},{"output":".setup/runtime-V7yh9OeC.mjs","sha256":"1ac56aacd454f0a3cbe86865bbab4b6d67517074a582ba0c9cbf570a2c21c326","facadeSource":null,"sources":["extensions/line/src/runtime.ts"]},{"output":".setup/send-C1JZOFMA.mjs","sha256":"3ac4ecefe11628dfbe805cd23be47a8da93d24d2720b05edc8230f26cff04359","facadeSource":null,"sources":["extensions/line/src/outbound-message-log.ts","extensions/line/src/send.ts"]},{"output":".setup/send-retry-Bf2Xr6ZN.mjs","sha256":"d16a0c6817edb24691ff166b704025f4b082f5458ae27b51de24d87e5d6c1d4f","facadeSource":null,"sources":["extensions/line/src/actions.ts","extensions/line/src/channel-access-token.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","extensions/line/src/messaging-target.ts","extensions/line/src/outbound-media.ts","extensions/line/src/probe.ts","extensions/line/src/quote-tokens.ts","extensions/line/src/send-retry.ts"]},{"output":".setup/setup-surface-CYd8oqzt.mjs","sha256":"1b1badac06cd9a9100131be0787ea8d60e0536b18363d72a328c3345ece36fb0","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-C1Kkr0-e.mjs","sha256":"5a5961562bf31a43836baefed36509c311737c749ab12aaf3e036fd16fb16fcf","facadeSource":null,"sources":["extensions/line/src/markdown-to-line.ts","extensions/line/src/template-messages.ts","packages/normalization-core/src/grapheme.ts","packages/normalization-core/src/utf16-slice.ts"]},{"output":".setup/webhook-spool-contract-msjTl60Q.mjs","sha256":"adb5fcdc75ce67f080542810ef3e6f8992c6f605d1118491cb27c6fcfde0b394","facadeSource":null,"sources":["extensions/line/src/webhook-spool-contract.ts"]},{"output":"api.js","sha256":"db78e5e54b305b24a5511cf464f83c4892ea8350dab82bed25fb85406bef7740","facadeSource":"extensions/line/api.ts","sources":[]},{"output":"channel-plugin-api.js","sha256":"ee9f9f572d0679b890bc15c298c2b2a109f4fdd9c3d2174dbb54643539310f09","facadeSource":"extensions/line/channel-plugin-api.ts","sources":[]},{"output":"contract-api.js","sha256":"5ada259c1c8cc15d47a4b137b1c24b2d917358b605aa0b3b90c640dd8e9db631","facadeSource":"extensions/line/contract-api.ts","sources":[]},{"output":"doctor-contract-api.js","sha256":"74bab000c23513d711021179dac75bbcae70149816220010d060c21b8f0fc2a7","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":"7ed527cac8fde9450c824d6a832ad6cb403354ab543f1cc28edc6f11fab28589","facadeSource":"extensions/line/index.ts","sources":["extensions/line/index.ts"]},{"output":"runtime-api.js","sha256":"d4608e118257690b4678909bd09aeb76c6db6d74a2e8847a826316d2cebb120a","facadeSource":"extensions/line/runtime-api.ts","sources":[]},{"output":"secret-contract-api.js","sha256":"b910921591244f33f89f7da098a21be20b7c1d1a81871c2db2db5185dedfc8d6","facadeSource":"extensions/line/secret-contract-api.ts","sources":["extensions/line/secret-contract-api.ts"]},{"output":"setup-api.js","sha256":"8256db26d152acea47a918c482a77233e05d4cd556d3400a1c3cfe60848ae479","facadeSource":"extensions/line/setup-api.ts","sources":[]},{"output":"setup-entry.js","sha256":"8f520f079990c8ffff6cf85dc672f7ccf0c04638abdbe21140ebcfd3b8874ec4","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-DJcpjKpx.mjs";
|
|
2
|
+
import { t as lineSetupPlugin } from "./.setup/api-BRnngy5R.mjs";
|
|
3
3
|
export { linePlugin, lineSetupPlugin };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { linePlugin };
|
|
1
|
+
export { t as linePlugin } from "./.setup/channel-DJcpjKpx.mjs";
|
package/dist/contract-api.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { listLineAccountIds, resolveDefaultLineAccountId, resolveLineAccount };
|
|
1
|
+
export { t as listLineAccountIds, n as resolveDefaultLineAccountId, r as resolveLineAccount } from "./.setup/accounts-DOiM8-y3.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-2y-RSLPg.mjs");
|
|
25
25
|
return await handleLineCardCommand(ctx.args);
|
|
26
26
|
}
|
|
27
27
|
});
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { setLineRuntime };
|
|
1
|
+
export { n as setLineRuntime } from "./.setup/runtime-V7yh9OeC.mjs";
|
package/dist/setup-api.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { lineSetupAdapter, lineSetupWizard };
|
|
1
|
+
export { n as lineSetupAdapter, t as lineSetupWizard } from "./.setup/setup-surface-CYd8oqzt.mjs";
|