@openclaw/line 2026.5.2-beta.2 → 2026.5.3-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.
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
@@ -1,395 +0,0 @@
1
- import { attachFooterText } from "./common.js";
2
- import type {
3
- Action,
4
- CardAction,
5
- FlexBox,
6
- FlexBubble,
7
- FlexButton,
8
- FlexCarousel,
9
- FlexComponent,
10
- FlexImage,
11
- FlexText,
12
- ListItem,
13
- } from "./types.js";
14
-
15
- /**
16
- * Create an info card with title, body, and optional footer
17
- *
18
- * Editorial design: Clean hierarchy with accent bar, generous spacing,
19
- * and subtle background zones for visual separation.
20
- */
21
- export function createInfoCard(title: string, body: string, footer?: string): FlexBubble {
22
- const bubble: FlexBubble = {
23
- type: "bubble",
24
- size: "mega",
25
- body: {
26
- type: "box",
27
- layout: "vertical",
28
- contents: [
29
- // Title with accent bar
30
- {
31
- type: "box",
32
- layout: "horizontal",
33
- contents: [
34
- {
35
- type: "box",
36
- layout: "vertical",
37
- contents: [],
38
- width: "4px",
39
- backgroundColor: "#06C755",
40
- cornerRadius: "2px",
41
- } as FlexBox,
42
- {
43
- type: "text",
44
- text: title,
45
- weight: "bold",
46
- size: "xl",
47
- color: "#111111",
48
- wrap: true,
49
- flex: 1,
50
- margin: "lg",
51
- } as FlexText,
52
- ],
53
- } as FlexBox,
54
- // Body text in subtle container
55
- {
56
- type: "box",
57
- layout: "vertical",
58
- contents: [
59
- {
60
- type: "text",
61
- text: body,
62
- size: "md",
63
- color: "#444444",
64
- wrap: true,
65
- lineSpacing: "6px",
66
- } as FlexText,
67
- ],
68
- margin: "xl",
69
- paddingAll: "lg",
70
- backgroundColor: "#F8F9FA",
71
- cornerRadius: "lg",
72
- } as FlexBox,
73
- ],
74
- paddingAll: "xl",
75
- backgroundColor: "#FFFFFF",
76
- },
77
- };
78
-
79
- if (footer) {
80
- attachFooterText(bubble, footer);
81
- }
82
-
83
- return bubble;
84
- }
85
-
86
- /**
87
- * Create a list card with title and multiple items
88
- *
89
- * Editorial design: Numbered/bulleted list with clear visual hierarchy,
90
- * accent dots for each item, and generous spacing.
91
- */
92
- export function createListCard(title: string, items: ListItem[]): FlexBubble {
93
- const itemContents: FlexComponent[] = items.slice(0, 8).map((item, index) => {
94
- const itemContents: FlexComponent[] = [
95
- {
96
- type: "text",
97
- text: item.title,
98
- size: "md",
99
- weight: "bold",
100
- color: "#1a1a1a",
101
- wrap: true,
102
- } as FlexText,
103
- ];
104
-
105
- if (item.subtitle) {
106
- itemContents.push({
107
- type: "text",
108
- text: item.subtitle,
109
- size: "sm",
110
- color: "#888888",
111
- wrap: true,
112
- margin: "xs",
113
- } as FlexText);
114
- }
115
-
116
- const itemBox: FlexBox = {
117
- type: "box",
118
- layout: "horizontal",
119
- contents: [
120
- // Accent dot
121
- {
122
- type: "box",
123
- layout: "vertical",
124
- contents: [
125
- {
126
- type: "box",
127
- layout: "vertical",
128
- contents: [],
129
- width: "8px",
130
- height: "8px",
131
- backgroundColor: index === 0 ? "#06C755" : "#DDDDDD",
132
- cornerRadius: "4px",
133
- } as FlexBox,
134
- ],
135
- width: "20px",
136
- alignItems: "center",
137
- paddingTop: "sm",
138
- } as FlexBox,
139
- // Item content
140
- {
141
- type: "box",
142
- layout: "vertical",
143
- contents: itemContents,
144
- flex: 1,
145
- } as FlexBox,
146
- ],
147
- margin: index > 0 ? "lg" : undefined,
148
- };
149
-
150
- if (item.action) {
151
- itemBox.action = item.action;
152
- }
153
-
154
- return itemBox;
155
- });
156
-
157
- return {
158
- type: "bubble",
159
- size: "mega",
160
- body: {
161
- type: "box",
162
- layout: "vertical",
163
- contents: [
164
- {
165
- type: "text",
166
- text: title,
167
- weight: "bold",
168
- size: "xl",
169
- color: "#111111",
170
- wrap: true,
171
- } as FlexText,
172
- {
173
- type: "separator",
174
- margin: "lg",
175
- color: "#EEEEEE",
176
- },
177
- {
178
- type: "box",
179
- layout: "vertical",
180
- contents: itemContents,
181
- margin: "lg",
182
- } as FlexBox,
183
- ],
184
- paddingAll: "xl",
185
- backgroundColor: "#FFFFFF",
186
- },
187
- };
188
- }
189
-
190
- /**
191
- * Create an image card with image, title, and optional body text
192
- */
193
- export function createImageCard(
194
- imageUrl: string,
195
- title: string,
196
- body?: string,
197
- options?: {
198
- aspectRatio?: "1:1" | "1.51:1" | "1.91:1" | "4:3" | "16:9" | "20:13" | "2:1" | "3:1";
199
- aspectMode?: "cover" | "fit";
200
- action?: Action;
201
- },
202
- ): FlexBubble {
203
- const bubble: FlexBubble = {
204
- type: "bubble",
205
- hero: {
206
- type: "image",
207
- url: imageUrl,
208
- size: "full",
209
- aspectRatio: options?.aspectRatio ?? "20:13",
210
- aspectMode: options?.aspectMode ?? "cover",
211
- action: options?.action,
212
- } as FlexImage,
213
- body: {
214
- type: "box",
215
- layout: "vertical",
216
- contents: [
217
- {
218
- type: "text",
219
- text: title,
220
- weight: "bold",
221
- size: "xl",
222
- wrap: true,
223
- } as FlexText,
224
- ],
225
- paddingAll: "lg",
226
- },
227
- };
228
-
229
- if (body && bubble.body) {
230
- bubble.body.contents.push({
231
- type: "text",
232
- text: body,
233
- size: "md",
234
- wrap: true,
235
- margin: "md",
236
- color: "#666666",
237
- } as FlexText);
238
- }
239
-
240
- return bubble;
241
- }
242
-
243
- /**
244
- * Create an action card with title, body, and action buttons
245
- */
246
- export function createActionCard(
247
- title: string,
248
- body: string,
249
- actions: CardAction[],
250
- options?: {
251
- imageUrl?: string;
252
- aspectRatio?: "1:1" | "1.51:1" | "1.91:1" | "4:3" | "16:9" | "20:13" | "2:1" | "3:1";
253
- },
254
- ): FlexBubble {
255
- const bubble: FlexBubble = {
256
- type: "bubble",
257
- body: {
258
- type: "box",
259
- layout: "vertical",
260
- contents: [
261
- {
262
- type: "text",
263
- text: title,
264
- weight: "bold",
265
- size: "xl",
266
- wrap: true,
267
- } as FlexText,
268
- {
269
- type: "text",
270
- text: body,
271
- size: "md",
272
- wrap: true,
273
- margin: "md",
274
- color: "#666666",
275
- } as FlexText,
276
- ],
277
- paddingAll: "lg",
278
- },
279
- footer: {
280
- type: "box",
281
- layout: "vertical",
282
- contents: actions.slice(0, 4).map(
283
- (action, index) =>
284
- ({
285
- type: "button",
286
- action: action.action,
287
- style: index === 0 ? "primary" : "secondary",
288
- margin: index > 0 ? "sm" : undefined,
289
- }) as FlexButton,
290
- ),
291
- paddingAll: "md",
292
- },
293
- };
294
-
295
- if (options?.imageUrl) {
296
- bubble.hero = {
297
- type: "image",
298
- url: options.imageUrl,
299
- size: "full",
300
- aspectRatio: options.aspectRatio ?? "20:13",
301
- aspectMode: "cover",
302
- } as FlexImage;
303
- }
304
-
305
- return bubble;
306
- }
307
-
308
- /**
309
- * Create a carousel container from multiple bubbles
310
- * LINE allows max 12 bubbles in a carousel
311
- */
312
- export function createCarousel(bubbles: FlexBubble[]): FlexCarousel {
313
- return {
314
- type: "carousel",
315
- contents: bubbles.slice(0, 12),
316
- };
317
- }
318
-
319
- /**
320
- * Create a notification bubble (for alerts, status updates)
321
- *
322
- * Editorial design: Bold status indicator with accent color,
323
- * clear typography, optional icon for context.
324
- */
325
- export function createNotificationBubble(
326
- text: string,
327
- options?: {
328
- icon?: string;
329
- type?: "info" | "success" | "warning" | "error";
330
- title?: string;
331
- },
332
- ): FlexBubble {
333
- // Color based on notification type
334
- const colors = {
335
- info: { accent: "#3B82F6", bg: "#EFF6FF" },
336
- success: { accent: "#06C755", bg: "#F0FDF4" },
337
- warning: { accent: "#F59E0B", bg: "#FFFBEB" },
338
- error: { accent: "#EF4444", bg: "#FEF2F2" },
339
- };
340
- const typeColors = colors[options?.type ?? "info"];
341
-
342
- const contents: FlexComponent[] = [];
343
-
344
- // Accent bar
345
- contents.push({
346
- type: "box",
347
- layout: "vertical",
348
- contents: [],
349
- width: "4px",
350
- backgroundColor: typeColors.accent,
351
- cornerRadius: "2px",
352
- } as FlexBox);
353
-
354
- // Content section
355
- const textContents: FlexComponent[] = [];
356
-
357
- if (options?.title) {
358
- textContents.push({
359
- type: "text",
360
- text: options.title,
361
- size: "md",
362
- weight: "bold",
363
- color: "#111111",
364
- wrap: true,
365
- } as FlexText);
366
- }
367
-
368
- textContents.push({
369
- type: "text",
370
- text,
371
- size: options?.title ? "sm" : "md",
372
- color: options?.title ? "#666666" : "#333333",
373
- wrap: true,
374
- margin: options?.title ? "sm" : undefined,
375
- } as FlexText);
376
-
377
- contents.push({
378
- type: "box",
379
- layout: "vertical",
380
- contents: textContents,
381
- flex: 1,
382
- paddingStart: "lg",
383
- } as FlexBox);
384
-
385
- return {
386
- type: "bubble",
387
- body: {
388
- type: "box",
389
- layout: "horizontal",
390
- contents,
391
- paddingAll: "xl",
392
- backgroundColor: typeColors.bg,
393
- },
394
- };
395
- }
@@ -1,20 +0,0 @@
1
- import type { FlexBox, FlexBubble, FlexText } from "./types.js";
2
-
3
- export function attachFooterText(bubble: FlexBubble, footer: string) {
4
- bubble.footer = {
5
- type: "box",
6
- layout: "vertical",
7
- contents: [
8
- {
9
- type: "text",
10
- text: footer,
11
- size: "xs",
12
- color: "#AAAAAA",
13
- wrap: true,
14
- align: "center",
15
- } as FlexText,
16
- ],
17
- paddingAll: "lg",
18
- backgroundColor: "#FAFAFA",
19
- } as FlexBox;
20
- }