@openclaw/line 2026.9.1-beta.1 → 2026.9.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 (46) hide show
  1. package/dist/account-helpers-BSUyZwLm.js +12 -0
  2. package/dist/{accounts-BqEVsDoB.js → accounts-BBEFMYbY.js} +2 -1
  3. package/dist/api.js +2 -2
  4. package/dist/card-command-pwvE48Wb.js +252 -0
  5. package/dist/{channel-CsQLcrsA.js → channel-BJvELOIg.js} +111 -380
  6. package/dist/channel-plugin-api.js +1 -1
  7. package/dist/channel.runtime-CZOszXXj.js +4 -0
  8. package/dist/contract-api.js +1 -1
  9. package/dist/doctor-contract-api.js +141 -0
  10. package/dist/index.js +5 -17
  11. package/dist/{markdown-to-line-BmZ4hhfC.js → markdown-to-line-B-sj-7II.js} +22 -23
  12. package/dist/{monitor-Bd9XDV1i.js → monitor-m9h5osFz.js} +339 -237
  13. package/dist/monitor.runtime-C90LL-P3.js +2 -0
  14. package/dist/outbound.runtime-CGqyJ-Ug.js +3 -0
  15. package/dist/probe.runtime-CbtMgU4s.js +2 -0
  16. package/dist/rich-messages-DY1AGKAJ.js +742 -0
  17. package/dist/runtime-api.js +14 -15
  18. package/dist/{send-Dce0m539.js → send-CQQxpxPp.js} +142 -112
  19. package/dist/{send-receipt-CCPTalf9.js → send-retry-ChpfJ-LM.js} +326 -86
  20. package/dist/setup-api.js +1 -1
  21. package/dist/{setup-surface-W0Dbgu58.js → setup-surface-CDlgkTKi.js} +47 -39
  22. package/dist/webhook-spool-contract-1rY8OJw8.js +59 -0
  23. package/node_modules/typebox/build/format/email.mjs +1 -1
  24. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
  25. package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
  26. package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
  27. package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
  28. package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
  29. package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
  30. package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
  31. package/node_modules/typebox/build/system/memory/assign.mjs +2 -1
  32. package/node_modules/typebox/build/system/memory/create.mjs +3 -4
  33. package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
  34. package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
  35. package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
  36. package/node_modules/typebox/build/system/memory/update.mjs +3 -2
  37. package/node_modules/typebox/package.json +1 -1
  38. package/openclaw.plugin.json +16 -3
  39. package/package.json +5 -5
  40. package/dist/card-command-CmU47gD9.js +0 -230
  41. package/dist/channel.runtime-B83x7k_i.js +0 -4
  42. package/dist/media-control-cards-CksNB8Wk.js +0 -474
  43. package/dist/monitor.runtime-BCCa6qTX.js +0 -2
  44. package/dist/outbound.runtime-D4w0-Gkc.js +0 -3
  45. package/dist/probe-CM03wo6r.js +0 -28
  46. package/dist/probe.runtime-D13ZtXsd.js +0 -2
@@ -1,474 +0,0 @@
1
- import { m as truncateLineActionLabel, p as postbackAction } from "./send-receipt-CCPTalf9.js";
2
- import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
3
- import { resolveAccountEntry } from "openclaw/plugin-sdk/account-resolution";
4
- import { normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
5
- import { DmPolicySchema, GroupPolicySchema, buildChannelConfigSchema, buildGroupEntrySchema, buildMultiAccountChannelSchema, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
6
- import { requireChannelOpenAllowFrom } from "openclaw/plugin-sdk/extension-shared";
7
- import { z } from "zod";
8
- import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
9
- //#region extensions/line/src/config-schema.ts
10
- const ThreadBindingsSchema = z.object({
11
- enabled: z.boolean().optional(),
12
- idleHours: z.number().optional(),
13
- maxAgeHours: z.number().optional(),
14
- spawnSessions: z.boolean().optional(),
15
- defaultSpawnContext: z.enum(["isolated", "fork"]).optional()
16
- }).strict();
17
- const LineCommonConfigSchemaBase = z.object({
18
- enabled: z.boolean().optional(),
19
- configWrites: z.boolean().optional(),
20
- historyLimit: z.number().int().min(0).optional(),
21
- channelAccessToken: z.string().optional(),
22
- channelSecret: z.string().optional(),
23
- tokenFile: z.string().optional(),
24
- secretFile: z.string().optional(),
25
- name: z.string().optional(),
26
- allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
27
- groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
28
- dmPolicy: DmPolicySchema.optional().default("pairing"),
29
- groupPolicy: GroupPolicySchema.optional().default("allowlist"),
30
- responsePrefix: z.string().optional(),
31
- mediaMaxMb: z.number().optional(),
32
- webhookPath: z.string().optional(),
33
- threadBindings: ThreadBindingsSchema.optional()
34
- });
35
- const LineGroupConfigSchema = buildGroupEntrySchema().omit({
36
- tools: true,
37
- toolsBySender: true
38
- });
39
- const LineConfigSchema = buildMultiAccountChannelSchema(LineCommonConfigSchemaBase.extend({ groups: z.record(z.string(), LineGroupConfigSchema.optional()).optional() }).strict(), {
40
- optionalAccount: true,
41
- refine: (value, ctx) => {
42
- requireChannelOpenAllowFrom({
43
- channel: "line",
44
- policy: value.dmPolicy,
45
- allowFrom: value.allowFrom,
46
- ctx,
47
- requireOpenAllowFrom
48
- });
49
- }
50
- });
51
- const LineChannelConfigSchema = buildChannelConfigSchema(LineConfigSchema);
52
- //#endregion
53
- //#region extensions/line/src/runtime.ts
54
- const { setRuntime: setLineRuntime, getRuntime: getLineRuntime } = createPluginRuntimeStore({
55
- pluginId: "line",
56
- errorMessage: "LINE runtime not initialized - plugin not registered"
57
- });
58
- //#endregion
59
- //#region extensions/line/src/group-keys.ts
60
- function resolveLineGroupLookupIds(groupId) {
61
- const normalized = groupId?.trim();
62
- if (!normalized) return [];
63
- if (normalized.startsWith("group:") || normalized.startsWith("room:")) {
64
- const rawId = normalized.split(":").slice(1).join(":");
65
- return rawId ? [rawId, normalized] : [normalized];
66
- }
67
- return [
68
- normalized,
69
- `group:${normalized}`,
70
- `room:${normalized}`
71
- ];
72
- }
73
- function resolveLineGroupConfigEntry(groups, params) {
74
- if (!groups) return;
75
- for (const candidate of resolveLineGroupLookupIds(params.groupId)) {
76
- const hit = groups[candidate];
77
- if (hit) return hit;
78
- }
79
- for (const candidate of resolveLineGroupLookupIds(params.roomId)) {
80
- const hit = groups[candidate];
81
- if (hit) return hit;
82
- }
83
- return groups["*"];
84
- }
85
- function resolveLineGroupsConfig(cfg, accountId) {
86
- const lineConfig = cfg.channels?.line;
87
- if (!lineConfig) return;
88
- const normalizedAccountId = normalizeAccountId(accountId);
89
- return resolveAccountEntry(lineConfig.accounts, normalizedAccountId)?.groups ?? lineConfig.groups;
90
- }
91
- function resolveExactLineGroupConfigKey(params) {
92
- const { groups } = params;
93
- if (!groups) return;
94
- return resolveLineGroupLookupIds(params.groupId).find((candidate) => Object.hasOwn(groups, candidate));
95
- }
96
- //#endregion
97
- //#region extensions/line/src/quick-reply-fallback.ts
98
- function buildLineQuickReplyFallbackText(labels) {
99
- const normalized = normalizeStringEntries(labels ?? []).slice(0, 13);
100
- if (normalized.length === 0) return "Choose an option.";
101
- return `Options:\n${normalized.map((label) => `- ${label}`).join("\n")}`;
102
- }
103
- //#endregion
104
- //#region extensions/line/src/flex-templates/media-control-cards.ts
105
- /**
106
- * Create a media player card for Sonos, Spotify, Apple Music, etc.
107
- *
108
- * Editorial design: Album art hero with gradient overlay for text,
109
- * prominent now-playing indicator, refined playback controls.
110
- */
111
- function createMediaPlayerCard(params) {
112
- const { title, subtitle, source, imageUrl, isPlaying, progress, controls, extraActions } = params;
113
- const trackInfo = [{
114
- type: "text",
115
- text: title,
116
- weight: "bold",
117
- size: "xl",
118
- color: "#111111",
119
- wrap: true
120
- }];
121
- if (subtitle) trackInfo.push({
122
- type: "text",
123
- text: subtitle,
124
- size: "md",
125
- color: "#666666",
126
- wrap: true,
127
- margin: "sm"
128
- });
129
- const statusItems = [];
130
- if (isPlaying !== void 0) statusItems.push({
131
- type: "box",
132
- layout: "horizontal",
133
- contents: [{
134
- type: "box",
135
- layout: "vertical",
136
- contents: [],
137
- width: "8px",
138
- height: "8px",
139
- backgroundColor: isPlaying ? "#06C755" : "#CCCCCC",
140
- cornerRadius: "4px"
141
- }, {
142
- type: "text",
143
- text: isPlaying ? "Now Playing" : "Paused",
144
- size: "xs",
145
- color: isPlaying ? "#06C755" : "#888888",
146
- weight: "bold",
147
- margin: "sm"
148
- }],
149
- alignItems: "center"
150
- });
151
- if (source) statusItems.push({
152
- type: "text",
153
- text: source,
154
- size: "xs",
155
- color: "#AAAAAA",
156
- margin: statusItems.length > 0 ? "lg" : void 0
157
- });
158
- if (progress) statusItems.push({
159
- type: "text",
160
- text: progress,
161
- size: "xs",
162
- color: "#888888",
163
- align: "end",
164
- flex: 1
165
- });
166
- const bodyContents = [{
167
- type: "box",
168
- layout: "vertical",
169
- contents: trackInfo
170
- }];
171
- if (statusItems.length > 0) bodyContents.push({
172
- type: "box",
173
- layout: "horizontal",
174
- contents: statusItems,
175
- margin: "lg",
176
- alignItems: "center"
177
- });
178
- const bubble = {
179
- type: "bubble",
180
- size: "mega",
181
- body: {
182
- type: "box",
183
- layout: "vertical",
184
- contents: bodyContents,
185
- paddingAll: "xl",
186
- backgroundColor: "#FFFFFF"
187
- }
188
- };
189
- if (imageUrl) bubble.hero = {
190
- type: "image",
191
- url: imageUrl,
192
- size: "full",
193
- aspectRatio: "1:1",
194
- aspectMode: "cover"
195
- };
196
- if (controls || extraActions?.length) {
197
- const footerContents = [];
198
- if (controls) {
199
- const controlButtons = [];
200
- if (controls.previous) controlButtons.push({
201
- type: "button",
202
- action: postbackAction("⏮", controls.previous.data),
203
- style: "secondary",
204
- flex: 1,
205
- height: "sm"
206
- });
207
- if (controls.play) controlButtons.push({
208
- type: "button",
209
- action: postbackAction("▶", controls.play.data),
210
- style: isPlaying ? "secondary" : "primary",
211
- flex: 1,
212
- height: "sm",
213
- margin: controls.previous ? "md" : void 0
214
- });
215
- if (controls.pause) controlButtons.push({
216
- type: "button",
217
- action: postbackAction("⏸", controls.pause.data),
218
- style: isPlaying ? "primary" : "secondary",
219
- flex: 1,
220
- height: "sm",
221
- margin: controlButtons.length > 0 ? "md" : void 0
222
- });
223
- if (controls.next) controlButtons.push({
224
- type: "button",
225
- action: postbackAction("⏭", controls.next.data),
226
- style: "secondary",
227
- flex: 1,
228
- height: "sm",
229
- margin: controlButtons.length > 0 ? "md" : void 0
230
- });
231
- if (controlButtons.length > 0) footerContents.push({
232
- type: "box",
233
- layout: "horizontal",
234
- contents: controlButtons
235
- });
236
- }
237
- if (extraActions?.length) footerContents.push({
238
- type: "box",
239
- layout: "horizontal",
240
- contents: extraActions.slice(0, 2).map((action, index) => ({
241
- type: "button",
242
- action: postbackAction(truncateLineActionLabel(action.label, 15), action.data),
243
- style: "secondary",
244
- flex: 1,
245
- height: "sm",
246
- margin: index > 0 ? "md" : void 0
247
- })),
248
- margin: "md"
249
- });
250
- if (footerContents.length > 0) bubble.footer = {
251
- type: "box",
252
- layout: "vertical",
253
- contents: footerContents,
254
- paddingAll: "lg",
255
- backgroundColor: "#FAFAFA"
256
- };
257
- }
258
- return bubble;
259
- }
260
- /**
261
- * Create an Apple TV remote card with a D-pad and control rows.
262
- */
263
- function createAppleTvRemoteCard(params) {
264
- const { deviceName, status, actionData } = params;
265
- const headerContents = [{
266
- type: "text",
267
- text: deviceName,
268
- weight: "bold",
269
- size: "xl",
270
- color: "#111111",
271
- wrap: true
272
- }];
273
- if (status) headerContents.push({
274
- type: "text",
275
- text: status,
276
- size: "sm",
277
- color: "#666666",
278
- wrap: true,
279
- margin: "sm"
280
- });
281
- const makeButton = (label, data, style = "secondary") => ({
282
- type: "button",
283
- action: postbackAction(label, data),
284
- style,
285
- height: "sm",
286
- flex: 1
287
- });
288
- const dpadRows = [
289
- {
290
- type: "box",
291
- layout: "horizontal",
292
- contents: [
293
- { type: "filler" },
294
- makeButton("↑", actionData.up),
295
- { type: "filler" }
296
- ]
297
- },
298
- {
299
- type: "box",
300
- layout: "horizontal",
301
- contents: [
302
- makeButton("←", actionData.left),
303
- makeButton("OK", actionData.select, "primary"),
304
- makeButton("→", actionData.right)
305
- ],
306
- margin: "md"
307
- },
308
- {
309
- type: "box",
310
- layout: "horizontal",
311
- contents: [
312
- { type: "filler" },
313
- makeButton("↓", actionData.down),
314
- { type: "filler" }
315
- ],
316
- margin: "md"
317
- }
318
- ];
319
- const menuRow = {
320
- type: "box",
321
- layout: "horizontal",
322
- contents: [makeButton("Menu", actionData.menu), makeButton("Home", actionData.home)],
323
- margin: "lg"
324
- };
325
- const playbackRow = {
326
- type: "box",
327
- layout: "horizontal",
328
- contents: [makeButton("Play", actionData.play), makeButton("Pause", actionData.pause)],
329
- margin: "md"
330
- };
331
- const volumeRow = {
332
- type: "box",
333
- layout: "horizontal",
334
- contents: [
335
- makeButton("Vol +", actionData.volumeUp),
336
- makeButton("Mute", actionData.mute),
337
- makeButton("Vol -", actionData.volumeDown)
338
- ],
339
- margin: "md"
340
- };
341
- return {
342
- type: "bubble",
343
- size: "mega",
344
- body: {
345
- type: "box",
346
- layout: "vertical",
347
- contents: [
348
- {
349
- type: "box",
350
- layout: "vertical",
351
- contents: headerContents
352
- },
353
- {
354
- type: "separator",
355
- margin: "lg",
356
- color: "#EEEEEE"
357
- },
358
- ...dpadRows,
359
- menuRow,
360
- playbackRow,
361
- volumeRow
362
- ],
363
- paddingAll: "xl",
364
- backgroundColor: "#FFFFFF"
365
- }
366
- };
367
- }
368
- /**
369
- * Create a device control card for Apple TV, smart home devices, etc.
370
- *
371
- * Editorial design: Device-focused header with status indicator,
372
- * clean control grid with clear visual hierarchy.
373
- */
374
- function createDeviceControlCard(params) {
375
- const { deviceName, deviceType, status, isOnline, imageUrl, controls } = params;
376
- const headerContents = [{
377
- type: "box",
378
- layout: "horizontal",
379
- contents: [{
380
- type: "box",
381
- layout: "vertical",
382
- contents: [],
383
- width: "10px",
384
- height: "10px",
385
- backgroundColor: isOnline !== false ? "#06C755" : "#FF5555",
386
- cornerRadius: "5px"
387
- }, {
388
- type: "text",
389
- text: deviceName,
390
- weight: "bold",
391
- size: "xl",
392
- color: "#111111",
393
- wrap: true,
394
- flex: 1,
395
- margin: "md"
396
- }],
397
- alignItems: "center"
398
- }];
399
- if (deviceType) headerContents.push({
400
- type: "text",
401
- text: deviceType,
402
- size: "sm",
403
- color: "#888888",
404
- margin: "sm"
405
- });
406
- if (status) headerContents.push({
407
- type: "box",
408
- layout: "vertical",
409
- contents: [{
410
- type: "text",
411
- text: status,
412
- size: "sm",
413
- color: "#444444",
414
- wrap: true
415
- }],
416
- margin: "lg",
417
- paddingAll: "md",
418
- backgroundColor: "#F8F9FA",
419
- cornerRadius: "md"
420
- });
421
- const bubble = {
422
- type: "bubble",
423
- size: "mega",
424
- body: {
425
- type: "box",
426
- layout: "vertical",
427
- contents: headerContents,
428
- paddingAll: "xl",
429
- backgroundColor: "#FFFFFF"
430
- }
431
- };
432
- if (imageUrl) bubble.hero = {
433
- type: "image",
434
- url: imageUrl,
435
- size: "full",
436
- aspectRatio: "16:9",
437
- aspectMode: "cover"
438
- };
439
- if (controls.length > 0) {
440
- const rows = [];
441
- const limitedControls = controls.slice(0, 6);
442
- for (let i = 0; i < limitedControls.length; i += 2) {
443
- const rowButtons = [];
444
- for (const [offset, ctrl] of limitedControls.slice(i, i + 2).entries()) {
445
- const buttonLabel = ctrl.icon ? `${ctrl.icon} ${ctrl.label}` : ctrl.label;
446
- rowButtons.push({
447
- type: "button",
448
- action: postbackAction(truncateLineActionLabel(buttonLabel, 18), ctrl.data),
449
- style: ctrl.style ?? "secondary",
450
- flex: 1,
451
- height: "sm",
452
- margin: offset > 0 ? "md" : void 0
453
- });
454
- }
455
- if (rowButtons.length === 1) rowButtons.push({ type: "filler" });
456
- rows.push({
457
- type: "box",
458
- layout: "horizontal",
459
- contents: rowButtons,
460
- margin: i > 0 ? "md" : void 0
461
- });
462
- }
463
- bubble.footer = {
464
- type: "box",
465
- layout: "vertical",
466
- contents: rows,
467
- paddingAll: "lg",
468
- backgroundColor: "#FAFAFA"
469
- };
470
- }
471
- return bubble;
472
- }
473
- //#endregion
474
- export { resolveExactLineGroupConfigKey as a, resolveLineGroupsConfig as c, LineChannelConfigSchema as d, LineConfigSchema as f, buildLineQuickReplyFallbackText as i, getLineRuntime as l, createDeviceControlCard as n, resolveLineGroupConfigEntry as o, createMediaPlayerCard as r, resolveLineGroupLookupIds as s, createAppleTvRemoteCard as t, setLineRuntime as u };
@@ -1,2 +0,0 @@
1
- import { t as monitorLineProvider } from "./monitor-Bd9XDV1i.js";
2
- export { monitorLineProvider };
@@ -1,3 +0,0 @@
1
- import { i as processLineMessage, s as buildTemplateMessageFromPayload } from "./markdown-to-line-BmZ4hhfC.js";
2
- import { a as createQuickReplyItems, f as pushLocationMessage, g as pushTextMessageWithQuickReplies, h as pushTemplateMessage, i as createLocationMessage, m as pushMessagesLine, n as createFlexMessage, p as pushMessageLine, u as pushFlexMessage, v as sendMessageLine } from "./send-Dce0m539.js";
3
- export { buildTemplateMessageFromPayload, createFlexMessage, createLocationMessage, createQuickReplyItems, processLineMessage, pushFlexMessage, pushLocationMessage, pushMessageLine, pushMessagesLine, pushTemplateMessage, pushTextMessageWithQuickReplies, sendMessageLine };
@@ -1,28 +0,0 @@
1
- import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
2
- import { messagingApi } from "@line/bot-sdk";
3
- import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
4
- //#region extensions/line/src/probe.ts
5
- async function probeLineBot(channelAccessToken, timeoutMs = 5e3) {
6
- if (!channelAccessToken?.trim()) return {
7
- ok: false,
8
- error: "Channel access token not configured"
9
- };
10
- const client = new messagingApi.MessagingApiClient({ channelAccessToken: channelAccessToken.trim() });
11
- return await runChannelProbe(timeoutMs, async () => {
12
- const profile = await client.getBotInfo();
13
- return {
14
- ok: true,
15
- bot: {
16
- displayName: profile.displayName,
17
- userId: profile.userId,
18
- basicId: profile.basicId,
19
- pictureUrl: profile.pictureUrl
20
- }
21
- };
22
- }, (error) => ({
23
- ok: false,
24
- error: formatErrorMessage(error)
25
- }));
26
- }
27
- //#endregion
28
- export { probeLineBot as t };
@@ -1,2 +0,0 @@
1
- import { t as probeLineBot } from "./probe-CM03wo6r.js";
2
- export { probeLineBot };