@openclaw/line 2026.5.2-beta.2 → 2026.5.3-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.
Files changed (109) hide show
  1. package/dist/accounts-UXAvdBo_.js +105 -0
  2. package/dist/api.js +11 -0
  3. package/dist/basic-cards-7DTG6E-A.js +307 -0
  4. package/dist/card-command-UlPc6Vuc.js +240 -0
  5. package/dist/channel-Rls9s60K.js +601 -0
  6. package/dist/channel-plugin-api.js +2 -0
  7. package/dist/channel.runtime-bXoj8_Sl.js +4 -0
  8. package/dist/contract-api.js +2 -0
  9. package/dist/index.js +45 -0
  10. package/dist/markdown-to-line-CCWK6PJh.js +789 -0
  11. package/dist/monitor-B4_RxHc0.js +1523 -0
  12. package/dist/monitor.runtime-DyxYlrM9.js +2 -0
  13. package/dist/outbound-media-BfhBmWq5.js +55 -0
  14. package/dist/outbound.runtime-B-luYwEB.js +2 -0
  15. package/dist/probe-D9BPzb2n.js +30 -0
  16. package/dist/probe.runtime-N91OWW1J.js +2 -0
  17. package/dist/quick-reply-fallback-HskUUWsn.js +55 -0
  18. package/dist/reply-payload-transform-CFGTs9ln.js +713 -0
  19. package/dist/runtime-api.js +277 -0
  20. package/dist/schedule-cards-BwQChTdM.js +359 -0
  21. package/dist/secret-contract-api.js +5 -0
  22. package/dist/setup-api.js +2 -0
  23. package/dist/setup-entry.js +11 -0
  24. package/dist/setup-surface-DCH7CE-y.js +281 -0
  25. package/package.json +14 -6
  26. package/api.ts +0 -11
  27. package/channel-plugin-api.ts +0 -1
  28. package/contract-api.ts +0 -5
  29. package/index.ts +0 -54
  30. package/runtime-api.ts +0 -187
  31. package/secret-contract-api.ts +0 -4
  32. package/setup-api.ts +0 -2
  33. package/setup-entry.ts +0 -9
  34. package/src/account-helpers.ts +0 -16
  35. package/src/accounts.test.ts +0 -290
  36. package/src/accounts.ts +0 -187
  37. package/src/actions.ts +0 -61
  38. package/src/auto-reply-delivery.test.ts +0 -248
  39. package/src/auto-reply-delivery.ts +0 -200
  40. package/src/bindings.ts +0 -65
  41. package/src/bot-access.ts +0 -48
  42. package/src/bot-handlers.test.ts +0 -1089
  43. package/src/bot-handlers.ts +0 -642
  44. package/src/bot-message-context.test.ts +0 -405
  45. package/src/bot-message-context.ts +0 -581
  46. package/src/bot.ts +0 -70
  47. package/src/card-command.ts +0 -347
  48. package/src/channel-access-token.ts +0 -14
  49. package/src/channel-api.ts +0 -17
  50. package/src/channel-setup-status.contract.test.ts +0 -70
  51. package/src/channel-shared.ts +0 -48
  52. package/src/channel.logout.test.ts +0 -145
  53. package/src/channel.runtime.ts +0 -3
  54. package/src/channel.sendPayload.test.ts +0 -514
  55. package/src/channel.setup.ts +0 -11
  56. package/src/channel.status.test.ts +0 -63
  57. package/src/channel.ts +0 -154
  58. package/src/config-adapter.ts +0 -29
  59. package/src/config-schema.ts +0 -57
  60. package/src/download.test.ts +0 -133
  61. package/src/download.ts +0 -87
  62. package/src/flex-templates/basic-cards.ts +0 -395
  63. package/src/flex-templates/common.ts +0 -20
  64. package/src/flex-templates/media-control-cards.ts +0 -555
  65. package/src/flex-templates/message.ts +0 -13
  66. package/src/flex-templates/schedule-cards.ts +0 -467
  67. package/src/flex-templates/types.ts +0 -22
  68. package/src/flex-templates.ts +0 -32
  69. package/src/gateway.ts +0 -129
  70. package/src/group-keys.test.ts +0 -123
  71. package/src/group-keys.ts +0 -65
  72. package/src/group-policy.ts +0 -22
  73. package/src/markdown-to-line.test.ts +0 -348
  74. package/src/markdown-to-line.ts +0 -416
  75. package/src/message-cards.test.ts +0 -204
  76. package/src/monitor.lifecycle.test.ts +0 -421
  77. package/src/monitor.runtime.ts +0 -1
  78. package/src/monitor.ts +0 -506
  79. package/src/outbound-media.test.ts +0 -189
  80. package/src/outbound-media.ts +0 -120
  81. package/src/outbound.runtime.ts +0 -12
  82. package/src/outbound.ts +0 -356
  83. package/src/probe.contract.test.ts +0 -9
  84. package/src/probe.runtime.ts +0 -1
  85. package/src/probe.ts +0 -34
  86. package/src/quick-reply-fallback.ts +0 -10
  87. package/src/reply-chunks.test.ts +0 -179
  88. package/src/reply-chunks.ts +0 -110
  89. package/src/reply-payload-transform.test.ts +0 -387
  90. package/src/reply-payload-transform.ts +0 -317
  91. package/src/rich-menu.test.ts +0 -310
  92. package/src/rich-menu.ts +0 -326
  93. package/src/runtime.ts +0 -32
  94. package/src/send.test.ts +0 -346
  95. package/src/send.ts +0 -489
  96. package/src/setup-core.ts +0 -149
  97. package/src/setup-runtime-api.ts +0 -9
  98. package/src/setup-surface.test.ts +0 -474
  99. package/src/setup-surface.ts +0 -227
  100. package/src/signature.test.ts +0 -34
  101. package/src/signature.ts +0 -24
  102. package/src/status.ts +0 -37
  103. package/src/template-messages.ts +0 -333
  104. package/src/types.ts +0 -128
  105. package/src/webhook-node.test.ts +0 -513
  106. package/src/webhook-node.ts +0 -131
  107. package/src/webhook-utils.ts +0 -10
  108. package/src/webhook.ts +0 -111
  109. package/tsconfig.json +0 -16
@@ -0,0 +1,277 @@
1
+ import { i as resolveLineAccount, n as normalizeAccountId, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-UXAvdBo_.js";
2
+ import { a as resolveLineGroupConfigEntry, i as resolveExactLineGroupConfigKey, o as resolveLineGroupLookupIds, r as setLineRuntime, s as resolveLineGroupsConfig } from "./quick-reply-fallback-HskUUWsn.js";
3
+ import { a as createMediaPlayerCard, i as createDeviceControlCard, n as parseLineDirectives, o as LineChannelConfigSchema, r as createAppleTvRemoteCard, s as LineConfigSchema, t as hasLineDirectives } from "./reply-payload-transform-CFGTs9ln.js";
4
+ import { n as createEventCard, r as createReceiptCard, t as createAgendaCard } from "./schedule-cards-BwQChTdM.js";
5
+ import { a as createListCard, i as createInfoCard, n as createCarousel, o as createNotificationBubble, r as createImageCard, t as createActionCard } from "./basic-cards-7DTG6E-A.js";
6
+ import { A as buildTemplateMessageFromPayload, B as createYesNoConfirm, C as pushMessagesLine, D as sendMessageLine, E as replyMessageLine, F as createImageCarousel, G as toFlexMessage, H as messageAction, I as createImageCarouselColumn, L as createLinkMenu, M as createButtonTemplate, N as createCarouselColumn, O as showLoadingAnimation, P as createConfirmTemplate, R as createProductCarousel, S as pushMessageLine, T as pushTextMessageWithQuickReplies, U as postbackAction, V as datetimePickerAction, W as uriAction, _ as getUserDisplayName, a as extractLinks, b as pushImageMessage, c as processLineMessage, d as createFlexMessage, f as createImageMessage, g as createVideoMessage, h as createTextMessageWithQuickReplies, i as extractCodeBlocks, j as createButtonMenu, k as resolveLineChannelAccessToken, l as stripMarkdown, m as createQuickReplyItems, n as convertLinksToFlexBubble, o as extractMarkdownTables, p as createLocationMessage, r as convertTableToFlexBubble, s as hasMarkdownToConvert, t as convertCodeBlockToFlexBubble, u as createAudioMessage, v as getUserProfile, w as pushTemplateMessage, x as pushLocationMessage, y as pushFlexMessage, z as createTemplateCarousel } from "./markdown-to-line-CCWK6PJh.js";
7
+ import { a as validateLineSignature, c as isSenderAllowed, i as parseLineWebhookBody, l as normalizeAllowFrom, n as createLineNodeWebhookHandler, o as downloadLineMedia, r as readLineWebhookRequestBody, s as firstDefined, t as monitorLineProvider, u as normalizeDmAllowFromWithStore } from "./monitor-B4_RxHc0.js";
8
+ import { t as probeLineBot } from "./probe-D9BPzb2n.js";
9
+ import { clearAccountEntryFields } from "openclaw/plugin-sdk/core";
10
+ import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
11
+ import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
12
+ import { DEFAULT_ACCOUNT_ID, formatDocsLink, setSetupChannelEnabled, splitSetupEntries } from "openclaw/plugin-sdk/setup";
13
+ import { buildComputedAccountStatusSnapshot, buildTokenChannelStatusSummary } from "openclaw/plugin-sdk/status-helpers";
14
+ import { messagingApi } from "@line/bot-sdk";
15
+ import { danger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
16
+ import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/agent-media-payload";
17
+ import { loadWebMediaRaw } from "openclaw/plugin-sdk/web-media";
18
+ //#region extensions/line/src/webhook.ts
19
+ const LINE_WEBHOOK_MAX_RAW_BODY_BYTES = 64 * 1024;
20
+ function readRawBody(req) {
21
+ const rawBody = req.rawBody ?? (typeof req.body === "string" || Buffer.isBuffer(req.body) ? req.body : null);
22
+ if (!rawBody) return null;
23
+ return Buffer.isBuffer(rawBody) ? rawBody.toString("utf-8") : rawBody;
24
+ }
25
+ function parseWebhookBody(rawBody) {
26
+ if (!rawBody) return null;
27
+ return parseLineWebhookBody(rawBody);
28
+ }
29
+ function createLineWebhookMiddleware(options) {
30
+ const { channelSecret, onEvents, runtime } = options;
31
+ return async (req, res, _next) => {
32
+ try {
33
+ const signature = req.headers["x-line-signature"];
34
+ if (!signature || typeof signature !== "string") {
35
+ res.status(400).json({ error: "Missing X-Line-Signature header" });
36
+ return;
37
+ }
38
+ const rawBody = readRawBody(req);
39
+ if (!rawBody) {
40
+ res.status(400).json({ error: "Missing raw request body for signature verification" });
41
+ return;
42
+ }
43
+ if (Buffer.byteLength(rawBody, "utf-8") > LINE_WEBHOOK_MAX_RAW_BODY_BYTES) {
44
+ res.status(413).json({ error: "Payload too large" });
45
+ return;
46
+ }
47
+ if (!validateLineSignature(rawBody, signature, channelSecret)) {
48
+ logVerbose("line: webhook signature validation failed");
49
+ res.status(401).json({ error: "Invalid signature" });
50
+ return;
51
+ }
52
+ const body = parseWebhookBody(rawBody);
53
+ if (!body) {
54
+ res.status(400).json({ error: "Invalid webhook payload" });
55
+ return;
56
+ }
57
+ if (body.events && body.events.length > 0) {
58
+ logVerbose(`line: received ${body.events.length} webhook events`);
59
+ await onEvents(body);
60
+ }
61
+ res.status(200).json({ status: "ok" });
62
+ } catch (err) {
63
+ runtime?.error?.(danger(`line webhook error: ${String(err)}`));
64
+ if (!res.headersSent) res.status(500).json({ error: "Internal server error" });
65
+ }
66
+ };
67
+ }
68
+ function startLineWebhook(options) {
69
+ const channelSecret = typeof options.channelSecret === "string" ? options.channelSecret.trim() : "";
70
+ if (!channelSecret) throw new Error("LINE webhook mode requires a non-empty channel secret. Set channels.line.channelSecret in your config.");
71
+ return {
72
+ path: options.path ?? "/line/webhook",
73
+ handler: createLineWebhookMiddleware({
74
+ channelSecret,
75
+ onEvents: options.onEvents,
76
+ runtime: options.runtime
77
+ })
78
+ };
79
+ }
80
+ //#endregion
81
+ //#region extensions/line/src/rich-menu.ts
82
+ const USER_BATCH_SIZE = 500;
83
+ function getClient(opts) {
84
+ const account = resolveLineAccount({
85
+ cfg: opts.cfg,
86
+ accountId: opts.accountId
87
+ });
88
+ const token = resolveLineChannelAccessToken(opts.channelAccessToken, account);
89
+ return new messagingApi.MessagingApiClient({ channelAccessToken: token });
90
+ }
91
+ function getBlobClient(opts) {
92
+ const account = resolveLineAccount({
93
+ cfg: opts.cfg,
94
+ accountId: opts.accountId
95
+ });
96
+ const token = resolveLineChannelAccessToken(opts.channelAccessToken, account);
97
+ return new messagingApi.MessagingApiBlobClient({ channelAccessToken: token });
98
+ }
99
+ function chunkUserIds(userIds) {
100
+ const batches = [];
101
+ for (let i = 0; i < userIds.length; i += USER_BATCH_SIZE) batches.push(userIds.slice(i, i + USER_BATCH_SIZE));
102
+ return batches;
103
+ }
104
+ async function createRichMenu(menu, opts) {
105
+ const client = getClient(opts);
106
+ const richMenuRequest = {
107
+ size: menu.size,
108
+ selected: menu.selected ?? false,
109
+ name: menu.name.slice(0, 300),
110
+ chatBarText: menu.chatBarText.slice(0, 14),
111
+ areas: menu.areas
112
+ };
113
+ const response = await client.createRichMenu(richMenuRequest);
114
+ if (opts.verbose) logVerbose(`line: created rich menu ${response.richMenuId}`);
115
+ return response.richMenuId;
116
+ }
117
+ async function uploadRichMenuImage(richMenuId, imagePath, opts) {
118
+ const blobClient = getBlobClient(opts);
119
+ const media = await loadWebMediaRaw(imagePath, { localRoots: opts.mediaLocalRoots ?? getAgentScopedMediaLocalRoots(opts.cfg) });
120
+ const contentType = media.contentType === "image/png" || media.contentType === "image/jpeg" ? media.contentType : normalizeLowercaseStringOrEmpty(imagePath).endsWith(".png") ? "image/png" : "image/jpeg";
121
+ const imageBytes = new ArrayBuffer(media.buffer.byteLength);
122
+ new Uint8Array(imageBytes).set(media.buffer);
123
+ await blobClient.setRichMenuImage(richMenuId, new Blob([imageBytes], { type: contentType }));
124
+ if (opts.verbose) logVerbose(`line: uploaded image to rich menu ${richMenuId}`);
125
+ }
126
+ async function setDefaultRichMenu(richMenuId, opts) {
127
+ await getClient(opts).setDefaultRichMenu(richMenuId);
128
+ if (opts.verbose) logVerbose(`line: set default rich menu to ${richMenuId}`);
129
+ }
130
+ async function cancelDefaultRichMenu(opts) {
131
+ await getClient(opts).cancelDefaultRichMenu();
132
+ if (opts.verbose) logVerbose("line: cancelled default rich menu");
133
+ }
134
+ async function getDefaultRichMenuId(opts) {
135
+ const client = getClient(opts);
136
+ try {
137
+ return (await client.getDefaultRichMenuId()).richMenuId ?? null;
138
+ } catch {
139
+ return null;
140
+ }
141
+ }
142
+ async function linkRichMenuToUser(userId, richMenuId, opts) {
143
+ await getClient(opts).linkRichMenuIdToUser(userId, richMenuId);
144
+ if (opts.verbose) logVerbose(`line: linked rich menu ${richMenuId} to user ${userId}`);
145
+ }
146
+ async function linkRichMenuToUsers(userIds, richMenuId, opts) {
147
+ const client = getClient(opts);
148
+ for (const batch of chunkUserIds(userIds)) await client.linkRichMenuIdToUsers({
149
+ richMenuId,
150
+ userIds: batch
151
+ });
152
+ if (opts.verbose) logVerbose(`line: linked rich menu ${richMenuId} to ${userIds.length} users`);
153
+ }
154
+ async function unlinkRichMenuFromUser(userId, opts) {
155
+ await getClient(opts).unlinkRichMenuIdFromUser(userId);
156
+ if (opts.verbose) logVerbose(`line: unlinked rich menu from user ${userId}`);
157
+ }
158
+ async function unlinkRichMenuFromUsers(userIds, opts) {
159
+ const client = getClient(opts);
160
+ for (const batch of chunkUserIds(userIds)) await client.unlinkRichMenuIdFromUsers({ userIds: batch });
161
+ if (opts.verbose) logVerbose(`line: unlinked rich menu from ${userIds.length} users`);
162
+ }
163
+ async function getRichMenuIdOfUser(userId, opts) {
164
+ const client = getClient(opts);
165
+ try {
166
+ return (await client.getRichMenuIdOfUser(userId)).richMenuId ?? null;
167
+ } catch {
168
+ return null;
169
+ }
170
+ }
171
+ async function getRichMenuList(opts) {
172
+ return (await getClient(opts).getRichMenuList()).richmenus ?? [];
173
+ }
174
+ async function getRichMenu(richMenuId, opts) {
175
+ const client = getClient(opts);
176
+ try {
177
+ return await client.getRichMenu(richMenuId);
178
+ } catch {
179
+ return null;
180
+ }
181
+ }
182
+ async function deleteRichMenu(richMenuId, opts) {
183
+ await getClient(opts).deleteRichMenu(richMenuId);
184
+ if (opts.verbose) logVerbose(`line: deleted rich menu ${richMenuId}`);
185
+ }
186
+ async function createRichMenuAlias(richMenuId, aliasId, opts) {
187
+ await getClient(opts).createRichMenuAlias({
188
+ richMenuId,
189
+ richMenuAliasId: aliasId
190
+ });
191
+ if (opts.verbose) logVerbose(`line: created alias ${aliasId} for rich menu ${richMenuId}`);
192
+ }
193
+ async function deleteRichMenuAlias(aliasId, opts) {
194
+ await getClient(opts).deleteRichMenuAlias(aliasId);
195
+ if (opts.verbose) logVerbose(`line: deleted alias ${aliasId}`);
196
+ }
197
+ function createGridLayout(height, actions) {
198
+ const colWidth = Math.floor(2500 / 3);
199
+ const rowHeight = Math.floor(height / 2);
200
+ return [
201
+ {
202
+ bounds: {
203
+ x: 0,
204
+ y: 0,
205
+ width: colWidth,
206
+ height: rowHeight
207
+ },
208
+ action: actions[0]
209
+ },
210
+ {
211
+ bounds: {
212
+ x: colWidth,
213
+ y: 0,
214
+ width: colWidth,
215
+ height: rowHeight
216
+ },
217
+ action: actions[1]
218
+ },
219
+ {
220
+ bounds: {
221
+ x: colWidth * 2,
222
+ y: 0,
223
+ width: colWidth,
224
+ height: rowHeight
225
+ },
226
+ action: actions[2]
227
+ },
228
+ {
229
+ bounds: {
230
+ x: 0,
231
+ y: rowHeight,
232
+ width: colWidth,
233
+ height: rowHeight
234
+ },
235
+ action: actions[3]
236
+ },
237
+ {
238
+ bounds: {
239
+ x: colWidth,
240
+ y: rowHeight,
241
+ width: colWidth,
242
+ height: rowHeight
243
+ },
244
+ action: actions[4]
245
+ },
246
+ {
247
+ bounds: {
248
+ x: colWidth * 2,
249
+ y: rowHeight,
250
+ width: colWidth,
251
+ height: rowHeight
252
+ },
253
+ action: actions[5]
254
+ }
255
+ ];
256
+ }
257
+ function createDefaultMenuConfig() {
258
+ return {
259
+ size: {
260
+ width: 2500,
261
+ height: 843
262
+ },
263
+ selected: false,
264
+ name: "Default Menu",
265
+ chatBarText: "Menu",
266
+ areas: createGridLayout(843, [
267
+ messageAction("Help", "/help"),
268
+ messageAction("Status", "/status"),
269
+ messageAction("Settings", "/settings"),
270
+ messageAction("About", "/about"),
271
+ messageAction("Feedback", "/feedback"),
272
+ messageAction("Contact", "/contact")
273
+ ])
274
+ };
275
+ }
276
+ //#endregion
277
+ export { DEFAULT_ACCOUNT_ID, LineChannelConfigSchema, LineConfigSchema, buildChannelConfigSchema, buildComputedAccountStatusSnapshot, buildTemplateMessageFromPayload, buildTokenChannelStatusSummary, cancelDefaultRichMenu, clearAccountEntryFields, convertCodeBlockToFlexBubble, convertLinksToFlexBubble, convertTableToFlexBubble, createActionCard, createAgendaCard, createAppleTvRemoteCard, createAudioMessage, createButtonMenu, createButtonTemplate, createCarousel, createCarouselColumn, createConfirmTemplate, createDefaultMenuConfig, createDeviceControlCard, createEventCard, createFlexMessage, createGridLayout, createImageCard, createImageCarousel, createImageCarouselColumn, createImageMessage, createInfoCard, createLineNodeWebhookHandler, createLineWebhookMiddleware, createLinkMenu, createListCard, createLocationMessage, createMediaPlayerCard, createNotificationBubble, createProductCarousel, createQuickReplyItems, createReceiptCard, createRichMenu, createRichMenuAlias, createTemplateCarousel, createTextMessageWithQuickReplies, createVideoMessage, createYesNoConfirm, datetimePickerAction, deleteRichMenu, deleteRichMenuAlias, downloadLineMedia, extractCodeBlocks, extractLinks, extractMarkdownTables, firstDefined, formatDocsLink, getDefaultRichMenuId, getRichMenu, getRichMenuIdOfUser, getRichMenuList, getUserDisplayName, getUserProfile, hasLineDirectives, hasMarkdownToConvert, isSenderAllowed, linkRichMenuToUser, linkRichMenuToUsers, listLineAccountIds, messageAction, monitorLineProvider, normalizeAccountId, normalizeAllowFrom, normalizeDmAllowFromWithStore, parseLineDirectives, parseLineWebhookBody, postbackAction, probeLineBot, processLineMessage, pushFlexMessage, pushImageMessage, pushLocationMessage, pushMessageLine, pushMessagesLine, pushTemplateMessage, pushTextMessageWithQuickReplies, readLineWebhookRequestBody, replyMessageLine, resolveDefaultLineAccountId, resolveExactLineGroupConfigKey, resolveLineAccount, resolveLineChannelAccessToken, resolveLineGroupConfigEntry, resolveLineGroupLookupIds, resolveLineGroupsConfig, sendMessageLine, setDefaultRichMenu, setLineRuntime, setSetupChannelEnabled, showLoadingAnimation, splitSetupEntries, startLineWebhook, stripMarkdown, toFlexMessage, unlinkRichMenuFromUser, unlinkRichMenuFromUsers, uploadRichMenuImage, uriAction, validateLineSignature };
@@ -0,0 +1,359 @@
1
+ //#region extensions/line/src/flex-templates/common.ts
2
+ function attachFooterText(bubble, footer) {
3
+ bubble.footer = {
4
+ type: "box",
5
+ layout: "vertical",
6
+ contents: [{
7
+ type: "text",
8
+ text: footer,
9
+ size: "xs",
10
+ color: "#AAAAAA",
11
+ wrap: true,
12
+ align: "center"
13
+ }],
14
+ paddingAll: "lg",
15
+ backgroundColor: "#FAFAFA"
16
+ };
17
+ }
18
+ //#endregion
19
+ //#region extensions/line/src/flex-templates/schedule-cards.ts
20
+ function buildTitleSubtitleHeader(params) {
21
+ const { title, subtitle } = params;
22
+ const headerContents = [{
23
+ type: "text",
24
+ text: title,
25
+ weight: "bold",
26
+ size: "xl",
27
+ color: "#111111",
28
+ wrap: true
29
+ }];
30
+ if (subtitle) headerContents.push({
31
+ type: "text",
32
+ text: subtitle,
33
+ size: "sm",
34
+ color: "#888888",
35
+ margin: "sm",
36
+ wrap: true
37
+ });
38
+ return headerContents;
39
+ }
40
+ function buildCardHeaderSections(headerContents) {
41
+ return [{
42
+ type: "box",
43
+ layout: "vertical",
44
+ contents: headerContents,
45
+ paddingBottom: "lg"
46
+ }, {
47
+ type: "separator",
48
+ color: "#EEEEEE"
49
+ }];
50
+ }
51
+ function createMegaBubbleWithFooter(params) {
52
+ const bubble = {
53
+ type: "bubble",
54
+ size: "mega",
55
+ body: {
56
+ type: "box",
57
+ layout: "vertical",
58
+ contents: params.bodyContents,
59
+ paddingAll: "xl",
60
+ backgroundColor: "#FFFFFF"
61
+ }
62
+ };
63
+ if (params.footer) attachFooterText(bubble, params.footer);
64
+ return bubble;
65
+ }
66
+ /**
67
+ * Create a receipt/summary card (for orders, transactions, data tables)
68
+ *
69
+ * Editorial design: Clean table layout with alternating row backgrounds,
70
+ * prominent total section, and clear visual hierarchy.
71
+ */
72
+ function createReceiptCard(params) {
73
+ const { title, subtitle, items, total, footer } = params;
74
+ const itemRows = items.slice(0, 12).map((item, index) => ({
75
+ type: "box",
76
+ layout: "horizontal",
77
+ contents: [{
78
+ type: "text",
79
+ text: item.name,
80
+ size: "sm",
81
+ color: item.highlight ? "#111111" : "#666666",
82
+ weight: item.highlight ? "bold" : "regular",
83
+ flex: 3,
84
+ wrap: true
85
+ }, {
86
+ type: "text",
87
+ text: item.value,
88
+ size: "sm",
89
+ color: item.highlight ? "#06C755" : "#333333",
90
+ weight: item.highlight ? "bold" : "regular",
91
+ flex: 2,
92
+ align: "end",
93
+ wrap: true
94
+ }],
95
+ paddingAll: "md",
96
+ backgroundColor: index % 2 === 0 ? "#FFFFFF" : "#FAFAFA"
97
+ }));
98
+ const bodyContents = [...buildCardHeaderSections(buildTitleSubtitleHeader({
99
+ title,
100
+ subtitle
101
+ })), {
102
+ type: "box",
103
+ layout: "vertical",
104
+ contents: itemRows,
105
+ margin: "md",
106
+ cornerRadius: "md",
107
+ borderWidth: "light",
108
+ borderColor: "#EEEEEE"
109
+ }];
110
+ if (total) bodyContents.push({
111
+ type: "box",
112
+ layout: "horizontal",
113
+ contents: [{
114
+ type: "text",
115
+ text: total.label,
116
+ size: "lg",
117
+ weight: "bold",
118
+ color: "#111111",
119
+ flex: 2
120
+ }, {
121
+ type: "text",
122
+ text: total.value,
123
+ size: "xl",
124
+ weight: "bold",
125
+ color: "#06C755",
126
+ flex: 2,
127
+ align: "end"
128
+ }],
129
+ margin: "xl",
130
+ paddingAll: "lg",
131
+ backgroundColor: "#F0FDF4",
132
+ cornerRadius: "lg"
133
+ });
134
+ return createMegaBubbleWithFooter({
135
+ bodyContents,
136
+ footer
137
+ });
138
+ }
139
+ /**
140
+ * Create a calendar event card (for meetings, appointments, reminders)
141
+ *
142
+ * Editorial design: Date as hero, strong typographic hierarchy,
143
+ * color-blocked zones, full text wrapping for readability.
144
+ */
145
+ function createEventCard(params) {
146
+ const { title, date, time, location, description, calendar, isAllDay, action } = params;
147
+ const dateBlock = {
148
+ type: "box",
149
+ layout: "vertical",
150
+ contents: [{
151
+ type: "text",
152
+ text: date.toUpperCase(),
153
+ size: "sm",
154
+ weight: "bold",
155
+ color: "#06C755",
156
+ wrap: true
157
+ }, {
158
+ type: "text",
159
+ text: isAllDay ? "ALL DAY" : time ?? "",
160
+ size: "xxl",
161
+ weight: "bold",
162
+ color: "#111111",
163
+ wrap: true,
164
+ margin: "xs"
165
+ }],
166
+ paddingBottom: "lg",
167
+ borderWidth: "none"
168
+ };
169
+ if (!time && !isAllDay) dateBlock.contents = [{
170
+ type: "text",
171
+ text: date,
172
+ size: "xl",
173
+ weight: "bold",
174
+ color: "#111111",
175
+ wrap: true
176
+ }];
177
+ const bodyContents = [dateBlock, {
178
+ type: "box",
179
+ layout: "horizontal",
180
+ contents: [{
181
+ type: "box",
182
+ layout: "vertical",
183
+ contents: [],
184
+ width: "4px",
185
+ backgroundColor: "#06C755",
186
+ cornerRadius: "2px"
187
+ }, {
188
+ type: "box",
189
+ layout: "vertical",
190
+ contents: [{
191
+ type: "text",
192
+ text: title,
193
+ size: "lg",
194
+ weight: "bold",
195
+ color: "#1a1a1a",
196
+ wrap: true
197
+ }, ...calendar ? [{
198
+ type: "text",
199
+ text: calendar,
200
+ size: "xs",
201
+ color: "#888888",
202
+ margin: "sm",
203
+ wrap: true
204
+ }] : []],
205
+ flex: 1,
206
+ paddingStart: "lg"
207
+ }],
208
+ paddingTop: "lg",
209
+ paddingBottom: "lg",
210
+ borderWidth: "light",
211
+ borderColor: "#EEEEEE"
212
+ }];
213
+ if (location || description) {
214
+ const detailItems = [];
215
+ if (location) detailItems.push({
216
+ type: "box",
217
+ layout: "horizontal",
218
+ contents: [{
219
+ type: "text",
220
+ text: "📍",
221
+ size: "sm",
222
+ flex: 0
223
+ }, {
224
+ type: "text",
225
+ text: location,
226
+ size: "sm",
227
+ color: "#444444",
228
+ margin: "md",
229
+ flex: 1,
230
+ wrap: true
231
+ }],
232
+ alignItems: "flex-start"
233
+ });
234
+ if (description) detailItems.push({
235
+ type: "text",
236
+ text: description,
237
+ size: "sm",
238
+ color: "#666666",
239
+ wrap: true,
240
+ margin: location ? "lg" : "none"
241
+ });
242
+ bodyContents.push({
243
+ type: "box",
244
+ layout: "vertical",
245
+ contents: detailItems,
246
+ margin: "lg",
247
+ paddingAll: "lg",
248
+ backgroundColor: "#F8F9FA",
249
+ cornerRadius: "lg"
250
+ });
251
+ }
252
+ return {
253
+ type: "bubble",
254
+ size: "mega",
255
+ body: {
256
+ type: "box",
257
+ layout: "vertical",
258
+ contents: bodyContents,
259
+ paddingAll: "xl",
260
+ backgroundColor: "#FFFFFF",
261
+ action
262
+ }
263
+ };
264
+ }
265
+ /**
266
+ * Create a calendar agenda card showing multiple events
267
+ *
268
+ * Editorial timeline design: Time-focused left column with event details
269
+ * on the right. Visual accent bars indicate event priority/recency.
270
+ */
271
+ function createAgendaCard(params) {
272
+ const { title, subtitle, events, footer } = params;
273
+ const headerContents = buildTitleSubtitleHeader({
274
+ title,
275
+ subtitle
276
+ });
277
+ const eventItems = events.slice(0, 6).map((event, index) => {
278
+ const isActive = event.isNow || index === 0;
279
+ const accentColor = isActive ? "#06C755" : "#E5E5E5";
280
+ const timeColumn = {
281
+ type: "box",
282
+ layout: "vertical",
283
+ contents: [{
284
+ type: "text",
285
+ text: event.time ?? "—",
286
+ size: "sm",
287
+ weight: isActive ? "bold" : "regular",
288
+ color: isActive ? "#06C755" : "#666666",
289
+ align: "end",
290
+ wrap: true
291
+ }],
292
+ width: "65px",
293
+ justifyContent: "flex-start"
294
+ };
295
+ const dotColumn = {
296
+ type: "box",
297
+ layout: "vertical",
298
+ contents: [{
299
+ type: "box",
300
+ layout: "vertical",
301
+ contents: [],
302
+ width: "10px",
303
+ height: "10px",
304
+ backgroundColor: accentColor,
305
+ cornerRadius: "5px"
306
+ }],
307
+ width: "24px",
308
+ alignItems: "center",
309
+ justifyContent: "flex-start",
310
+ paddingTop: "xs"
311
+ };
312
+ const detailContents = [{
313
+ type: "text",
314
+ text: event.title,
315
+ size: "md",
316
+ weight: "bold",
317
+ color: "#1a1a1a",
318
+ wrap: true
319
+ }];
320
+ const secondaryParts = [];
321
+ if (event.location) secondaryParts.push(event.location);
322
+ if (event.calendar) secondaryParts.push(event.calendar);
323
+ if (secondaryParts.length > 0) detailContents.push({
324
+ type: "text",
325
+ text: secondaryParts.join(" · "),
326
+ size: "xs",
327
+ color: "#888888",
328
+ wrap: true,
329
+ margin: "xs"
330
+ });
331
+ return {
332
+ type: "box",
333
+ layout: "horizontal",
334
+ contents: [
335
+ timeColumn,
336
+ dotColumn,
337
+ {
338
+ type: "box",
339
+ layout: "vertical",
340
+ contents: detailContents,
341
+ flex: 1
342
+ }
343
+ ],
344
+ margin: index > 0 ? "xl" : void 0,
345
+ alignItems: "flex-start"
346
+ };
347
+ });
348
+ return createMegaBubbleWithFooter({
349
+ bodyContents: [...buildCardHeaderSections(headerContents), {
350
+ type: "box",
351
+ layout: "vertical",
352
+ contents: eventItems,
353
+ paddingTop: "xl"
354
+ }],
355
+ footer
356
+ });
357
+ }
358
+ //#endregion
359
+ export { attachFooterText as i, createEventCard as n, createReceiptCard as r, createAgendaCard as t };
@@ -0,0 +1,5 @@
1
+ //#region extensions/line/secret-contract-api.ts
2
+ const secretTargetRegistryEntries = [];
3
+ function collectRuntimeConfigAssignments() {}
4
+ //#endregion
5
+ export { collectRuntimeConfigAssignments, secretTargetRegistryEntries };
@@ -0,0 +1,2 @@
1
+ import { n as lineSetupAdapter, t as lineSetupWizard } from "./setup-surface-DCH7CE-y.js";
2
+ export { lineSetupAdapter, lineSetupWizard };
@@ -0,0 +1,11 @@
1
+ import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
2
+ //#region extensions/line/setup-entry.ts
3
+ var setup_entry_default = defineBundledChannelSetupEntry({
4
+ importMetaUrl: import.meta.url,
5
+ plugin: {
6
+ specifier: "./api.js",
7
+ exportName: "lineSetupPlugin"
8
+ }
9
+ });
10
+ //#endregion
11
+ export { setup_entry_default as default };