@openclaw/line 2026.6.11-beta.2 → 2026.7.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,359 +0,0 @@
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 };
@@ -1,6 +1,6 @@
1
+ import { withTimeout } from "openclaw/plugin-sdk/text-utility-runtime";
1
2
  import { messagingApi } from "@line/bot-sdk";
2
3
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
3
- import { withTimeout } from "openclaw/plugin-sdk/text-utility-runtime";
4
4
  //#region extensions/line/src/probe.ts
5
5
  async function probeLineBot(channelAccessToken, timeoutMs = 5e3) {
6
6
  if (!channelAccessToken?.trim()) return {