@openclaw/line 2026.7.2-beta.5 → 2026.8.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{accounts-CSH5sk8U.js → accounts-BqEVsDoB.js} +24 -88
- package/dist/api.js +2 -3
- package/dist/{card-command-BEMIm8D8.js → card-command-DALdUSnc.js} +14 -22
- package/dist/{channel-CTaWrzfl.js → channel-CAdQJRw7.js} +75 -77
- package/dist/channel-plugin-api.js +1 -1
- package/dist/channel.runtime-CuKoy9xw.js +4 -0
- package/dist/contract-api.js +1 -1
- package/dist/{flex-templates-DVy_wog4.js → flex-templates-BBBlNqpV.js} +108 -83
- package/dist/index.js +1 -1
- package/dist/markdown-to-line-D4I-6lm6.js +499 -0
- package/dist/{monitor-DzFU5UPV.js → monitor-QEh_ZqyR.js} +114 -94
- package/dist/monitor.runtime-72isajCp.js +2 -0
- package/dist/outbound.runtime-CWQMIE7N.js +3 -0
- package/dist/{reply-payload-transform-BRM2fRvK.js → reply-payload-transform-BOPGHVPo.js} +4 -3
- package/dist/runtime-api.js +9 -7
- package/dist/send-CFFr0-rZ.js +366 -0
- package/dist/setup-api.js +1 -1
- package/dist/{setup-surface-BHQOSD8R.js → setup-surface-W0Dbgu58.js} +51 -68
- package/openclaw.plugin.json +7 -0
- package/package.json +9 -5
- package/dist/channel.runtime-D4Paci2y.js +0 -4
- package/dist/markdown-to-line-Dn00k1bq.js +0 -799
- package/dist/monitor.runtime-B8xjVqev.js +0 -2
- package/dist/outbound.runtime-eHl7NNHu.js +0 -2
- package/dist/send-receipt-CY2ey8XH.js +0 -107
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/LICENSE +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/README.md +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/assert/strict.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/assert.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/async_hooks.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/buffer.buffer.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/buffer.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/child_process.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/cluster.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/compatibility/iterators.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/console.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/constants.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/crypto.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/dgram.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/diagnostics_channel.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/dns/promises.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/dns.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/domain.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/events.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/fs/promises.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/fs.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/globals.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/globals.typedarray.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/http.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/http2.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/https.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/index.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/inspector.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/inspector.generated.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/module.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/net.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/os.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/package.json +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/path.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/perf_hooks.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/process.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/punycode.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/querystring.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/readline/promises.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/readline.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/repl.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/sea.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/sqlite.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/stream/consumers.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/stream/promises.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/stream/web.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/stream.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/string_decoder.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/test.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/timers/promises.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/timers.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/tls.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/trace_events.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.6/buffer.buffer.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.6/compatibility/float16array.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.6/globals.typedarray.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.6/index.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.7/compatibility/float16array.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.7/index.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/tty.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/url.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/util.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/v8.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/vm.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/wasi.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/abortcontroller.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/crypto.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/domexception.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/events.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/fetch.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/navigator.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/storage.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/streams.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/worker_threads.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/zlib.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/LICENSE +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/README.md +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/agent.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/api.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/balanced-pool.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/cache-interceptor.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/cache.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/client-stats.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/client.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/connector.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/content-type.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/cookies.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/diagnostics-channel.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/dispatcher.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/env-http-proxy-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/errors.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/eventsource.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/fetch.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/formdata.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/global-dispatcher.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/global-origin.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/h2c-client.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/handlers.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/header.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/index.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/interceptors.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-call-history.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-client.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-errors.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-interceptor.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-pool.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/package.json +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/patch.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/pool-stats.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/pool.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/proxy-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/readable.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/retry-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/retry-handler.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/round-robin-pool.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/snapshot-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/util.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/utility.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/webidl.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/websocket.d.ts +0 -0
|
@@ -1,4 +1,111 @@
|
|
|
1
|
+
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
+
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
3
|
+
import { resolvePinnedHostnameWithPolicy } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
4
|
+
import { isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
1
5
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
6
|
+
//#region extensions/line/src/outbound-media.ts
|
|
7
|
+
const LINE_OUTBOUND_MEDIA_SSRF_POLICY = { allowPrivateNetwork: false };
|
|
8
|
+
async function validateLineMediaUrl(url) {
|
|
9
|
+
let parsed;
|
|
10
|
+
try {
|
|
11
|
+
parsed = new URL(url);
|
|
12
|
+
} catch {
|
|
13
|
+
throw new Error("LINE outbound media URL must be a valid URL");
|
|
14
|
+
}
|
|
15
|
+
if (parsed.protocol !== "https:") throw new Error("LINE outbound media URL must use HTTPS");
|
|
16
|
+
if (url.length > 2e3) throw new Error(`LINE outbound media URL must be 2000 chars or less (got ${url.length})`);
|
|
17
|
+
await resolvePinnedHostnameWithPolicy(parsed.hostname, { policy: LINE_OUTBOUND_MEDIA_SSRF_POLICY });
|
|
18
|
+
}
|
|
19
|
+
function isHttpsUrl(url) {
|
|
20
|
+
try {
|
|
21
|
+
return new URL(url).protocol === "https:";
|
|
22
|
+
} catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function detectLineMediaKindFromUrl(url) {
|
|
27
|
+
try {
|
|
28
|
+
const pathname = normalizeLowercaseStringOrEmpty(new URL(url).pathname);
|
|
29
|
+
if (/\.(png|jpe?g|gif|webp|bmp|heic|heif|avif)$/i.test(pathname)) return "image";
|
|
30
|
+
if (/\.(mp4|mov|m4v|webm)$/i.test(pathname)) return "video";
|
|
31
|
+
if (/\.(mp3|m4a|aac|wav|ogg|oga)$/i.test(pathname)) return "audio";
|
|
32
|
+
} catch {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function resolveLineOutboundMedia(mediaUrl, opts = {}) {
|
|
37
|
+
const trimmedUrl = mediaUrl.trim();
|
|
38
|
+
if (isHttpsUrl(trimmedUrl)) {
|
|
39
|
+
await validateLineMediaUrl(trimmedUrl);
|
|
40
|
+
const previewImageUrl = opts.previewImageUrl?.trim();
|
|
41
|
+
if (previewImageUrl) await validateLineMediaUrl(previewImageUrl);
|
|
42
|
+
return {
|
|
43
|
+
mediaUrl: trimmedUrl,
|
|
44
|
+
mediaKind: opts.mediaKind ?? (typeof opts.durationMs === "number" ? "audio" : void 0) ?? (opts.trackingId?.trim() ? "video" : void 0) ?? detectLineMediaKindFromUrl(trimmedUrl) ?? "image",
|
|
45
|
+
...previewImageUrl ? { previewImageUrl } : {},
|
|
46
|
+
...typeof opts.durationMs === "number" ? { durationMs: opts.durationMs } : {},
|
|
47
|
+
...opts.trackingId ? { trackingId: opts.trackingId } : {}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
let parsed;
|
|
51
|
+
try {
|
|
52
|
+
parsed = new URL(trimmedUrl);
|
|
53
|
+
} catch {}
|
|
54
|
+
if (parsed) throw new Error("LINE outbound media URL must use HTTPS");
|
|
55
|
+
throw new Error("LINE outbound media currently requires a public HTTPS URL");
|
|
56
|
+
}
|
|
57
|
+
function isLineUserTarget(target) {
|
|
58
|
+
const normalized = target.trim().replace(/^line:(group|room|user):/i, "").replace(/^line:/i, "");
|
|
59
|
+
return /^U/i.test(normalized);
|
|
60
|
+
}
|
|
61
|
+
function hasLineSpecificMediaOptions(lineData) {
|
|
62
|
+
return lineData.mediaKind !== void 0 || Boolean(lineData.previewImageUrl?.trim()) || typeof lineData.durationMs === "number" || Boolean(lineData.trackingId?.trim());
|
|
63
|
+
}
|
|
64
|
+
function buildLineMediaMessageObject(resolved, opts) {
|
|
65
|
+
switch (resolved.mediaKind) {
|
|
66
|
+
case "video": {
|
|
67
|
+
const previewImageUrl = resolved.previewImageUrl?.trim();
|
|
68
|
+
if (!previewImageUrl) throw new Error("LINE video messages require previewImageUrl to reference an image URL");
|
|
69
|
+
return {
|
|
70
|
+
type: "video",
|
|
71
|
+
originalContentUrl: resolved.mediaUrl,
|
|
72
|
+
previewImageUrl,
|
|
73
|
+
...opts?.allowTrackingId && resolved.trackingId ? { trackingId: resolved.trackingId } : {}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
case "audio": return {
|
|
77
|
+
type: "audio",
|
|
78
|
+
originalContentUrl: resolved.mediaUrl,
|
|
79
|
+
duration: resolved.durationMs ?? 6e4
|
|
80
|
+
};
|
|
81
|
+
default: return {
|
|
82
|
+
type: "image",
|
|
83
|
+
originalContentUrl: resolved.mediaUrl,
|
|
84
|
+
previewImageUrl: resolved.previewImageUrl ?? resolved.mediaUrl
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async function buildLineMediaMessage(mediaUrl, opts, target) {
|
|
89
|
+
return buildLineMediaMessageObject(await resolveLineOutboundMedia(mediaUrl, opts), { allowTrackingId: isLineUserTarget(target) });
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region extensions/line/src/send-receipt.ts
|
|
93
|
+
function createLineSendReceipt(params) {
|
|
94
|
+
const messageIds = (params.messageIds ?? [params.messageId]).map((messageId) => messageId.trim()).filter(Boolean);
|
|
95
|
+
const chatId = params.chatId.trim();
|
|
96
|
+
return createMessageReceiptFromOutboundResults({
|
|
97
|
+
results: messageIds.map((messageId) => ({
|
|
98
|
+
channel: "line",
|
|
99
|
+
messageId,
|
|
100
|
+
chatId,
|
|
101
|
+
conversationId: chatId,
|
|
102
|
+
meta: { messageCount: params.messageCount ?? 1 }
|
|
103
|
+
})),
|
|
104
|
+
...chatId ? { threadId: chatId } : {},
|
|
105
|
+
kind: params.kind ?? "unknown"
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
2
109
|
//#region extensions/line/src/actions.ts
|
|
3
110
|
const LINE_ACTION_LABEL_LIMIT = 20;
|
|
4
111
|
const LINE_ACTION_DATA_LIMIT = 300;
|
|
@@ -48,9 +155,6 @@ const actionTypes = /* @__PURE__ */ new Set([
|
|
|
48
155
|
"richmenuswitch",
|
|
49
156
|
"uri"
|
|
50
157
|
]);
|
|
51
|
-
function isRecord(value) {
|
|
52
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
53
|
-
}
|
|
54
158
|
function isLineAction(value) {
|
|
55
159
|
return isRecord(value) && typeof value.type === "string" && actionTypes.has(value.type);
|
|
56
160
|
}
|
|
@@ -548,85 +652,6 @@ function createActionCard(title, body, actions, options) {
|
|
|
548
652
|
};
|
|
549
653
|
return bubble;
|
|
550
654
|
}
|
|
551
|
-
/**
|
|
552
|
-
* Create a carousel container from multiple bubbles
|
|
553
|
-
* LINE allows max 12 bubbles in a carousel
|
|
554
|
-
*/
|
|
555
|
-
function createCarousel(bubbles) {
|
|
556
|
-
return {
|
|
557
|
-
type: "carousel",
|
|
558
|
-
contents: bubbles.slice(0, 12)
|
|
559
|
-
};
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* Create a notification bubble (for alerts, status updates)
|
|
563
|
-
*
|
|
564
|
-
* Editorial design: Bold status indicator with accent color,
|
|
565
|
-
* clear typography, optional icon for context.
|
|
566
|
-
*/
|
|
567
|
-
function createNotificationBubble(text, options) {
|
|
568
|
-
const typeColors = {
|
|
569
|
-
info: {
|
|
570
|
-
accent: "#3B82F6",
|
|
571
|
-
bg: "#EFF6FF"
|
|
572
|
-
},
|
|
573
|
-
success: {
|
|
574
|
-
accent: "#06C755",
|
|
575
|
-
bg: "#F0FDF4"
|
|
576
|
-
},
|
|
577
|
-
warning: {
|
|
578
|
-
accent: "#F59E0B",
|
|
579
|
-
bg: "#FFFBEB"
|
|
580
|
-
},
|
|
581
|
-
error: {
|
|
582
|
-
accent: "#EF4444",
|
|
583
|
-
bg: "#FEF2F2"
|
|
584
|
-
}
|
|
585
|
-
}[options?.type ?? "info"];
|
|
586
|
-
const contents = [];
|
|
587
|
-
contents.push({
|
|
588
|
-
type: "box",
|
|
589
|
-
layout: "vertical",
|
|
590
|
-
contents: [],
|
|
591
|
-
width: "4px",
|
|
592
|
-
backgroundColor: typeColors.accent,
|
|
593
|
-
cornerRadius: "2px"
|
|
594
|
-
});
|
|
595
|
-
const textContents = [];
|
|
596
|
-
if (options?.title) textContents.push({
|
|
597
|
-
type: "text",
|
|
598
|
-
text: options.title,
|
|
599
|
-
size: "md",
|
|
600
|
-
weight: "bold",
|
|
601
|
-
color: "#111111",
|
|
602
|
-
wrap: true
|
|
603
|
-
});
|
|
604
|
-
textContents.push({
|
|
605
|
-
type: "text",
|
|
606
|
-
text,
|
|
607
|
-
size: options?.title ? "sm" : "md",
|
|
608
|
-
color: options?.title ? "#666666" : "#333333",
|
|
609
|
-
wrap: true,
|
|
610
|
-
margin: options?.title ? "sm" : void 0
|
|
611
|
-
});
|
|
612
|
-
contents.push({
|
|
613
|
-
type: "box",
|
|
614
|
-
layout: "vertical",
|
|
615
|
-
contents: textContents,
|
|
616
|
-
flex: 1,
|
|
617
|
-
paddingStart: "lg"
|
|
618
|
-
});
|
|
619
|
-
return {
|
|
620
|
-
type: "bubble",
|
|
621
|
-
body: {
|
|
622
|
-
type: "box",
|
|
623
|
-
layout: "horizontal",
|
|
624
|
-
contents,
|
|
625
|
-
paddingAll: "xl",
|
|
626
|
-
backgroundColor: typeColors.bg
|
|
627
|
-
}
|
|
628
|
-
};
|
|
629
|
-
}
|
|
630
655
|
//#endregion
|
|
631
656
|
//#region extensions/line/src/flex-templates/schedule-cards.ts
|
|
632
657
|
function buildTitleSubtitleHeader(params) {
|
|
@@ -1338,4 +1363,4 @@ function createDeviceControlCard(params) {
|
|
|
1338
1363
|
return bubble;
|
|
1339
1364
|
}
|
|
1340
1365
|
//#endregion
|
|
1341
|
-
export {
|
|
1366
|
+
export { createLineSendReceipt as _, createEventCard as a, resolveLineOutboundMedia as b, createImageCard as c, datetimePickerAction as d, messageAction as f, uriAction as g, postbackAction as h, createAgendaCard as i, createInfoCard as l, normalizeLineMessageActions as m, createDeviceControlCard as n, createReceiptCard as o, normalizeLineAction as p, createMediaPlayerCard as r, createActionCard as s, createAppleTvRemoteCard as t, createListCard as u, buildLineMediaMessage as v, validateLineMediaUrl as x, hasLineSpecificMediaOptions as y };
|
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-DALdUSnc.js");
|
|
8
8
|
registerLineCardCommand({
|
|
9
9
|
...api,
|
|
10
10
|
registerCommand(command) {
|