@openclaw/line 2026.8.1-beta.3 → 2026.8.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 (153) hide show
  1. package/dist/account-helpers-BSUyZwLm.js +12 -0
  2. package/dist/api.js +2 -2
  3. package/dist/{card-command-CyDSm-OU.js → card-command-BywtX77U.js} +66 -29
  4. package/dist/{channel-DmoKZXmG.js → channel-DpMgRaxl.js} +52 -349
  5. package/dist/channel-plugin-api.js +1 -1
  6. package/dist/channel.runtime-Bty5U_1N.js +4 -0
  7. package/dist/doctor-contract-api.js +141 -0
  8. package/dist/index.js +1 -1
  9. package/dist/{markdown-to-line-rEaras_0.js → markdown-to-line-CG9Jy22s.js} +29 -25
  10. package/dist/{monitor-BYXS_B6r.js → monitor-Ch6TIatG.js} +261 -166
  11. package/dist/monitor.runtime-Czc3NxNV.js +2 -0
  12. package/dist/outbound.runtime-CyleVzFR.js +3 -0
  13. package/dist/probe.runtime-DTxBWvKz.js +2 -0
  14. package/dist/rich-messages-t_zRL24p.js +760 -0
  15. package/dist/runtime-api.js +10 -11
  16. package/dist/{send-BJCeiiOB.js → send-B-K2B6au.js} +138 -104
  17. package/dist/{send-receipt-DKZzgHMO.js → send-retry-CUvrarfE.js} +137 -413
  18. package/dist/setup-api.js +1 -1
  19. package/dist/{setup-surface-W0Dbgu58.js → setup-surface-DSJ92oJ5.js} +24 -17
  20. package/dist/webhook-spool-contract-CNe2h1I2.js +58 -0
  21. package/node_modules/typebox/build/format/date.d.mts +1 -1
  22. package/node_modules/typebox/build/format/date.mjs +1 -1
  23. package/node_modules/typebox/build/format/date_time.d.mts +2 -2
  24. package/node_modules/typebox/build/format/date_time.mjs +3 -3
  25. package/node_modules/typebox/build/format/email.d.mts +1 -1
  26. package/node_modules/typebox/build/format/email.mjs +2 -2
  27. package/node_modules/typebox/build/format/hostname.mjs +2 -10
  28. package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
  29. package/node_modules/typebox/build/format/idn_email.mjs +3 -3
  30. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
  31. package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
  32. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
  33. package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
  34. package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
  35. package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
  36. package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
  37. package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
  38. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
  39. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
  40. package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
  41. package/node_modules/typebox/build/format/idna/index.mjs +2 -0
  42. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
  43. package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
  44. package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
  45. package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
  46. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
  47. package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
  48. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
  49. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
  50. package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
  51. package/node_modules/typebox/build/format/ipv4.mjs +2 -32
  52. package/node_modules/typebox/build/format/ipv6.mjs +2 -61
  53. package/node_modules/typebox/build/format/iri.d.mts +2 -2
  54. package/node_modules/typebox/build/format/iri.mjs +26 -8
  55. package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
  56. package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
  57. package/node_modules/typebox/build/format/regex.d.mts +1 -2
  58. package/node_modules/typebox/build/format/regex.mjs +2 -6
  59. package/node_modules/typebox/build/format/time.d.mts +2 -2
  60. package/node_modules/typebox/build/format/time.mjs +19 -14
  61. package/node_modules/typebox/build/format/uri.d.mts +1 -1
  62. package/node_modules/typebox/build/format/uri.mjs +3 -130
  63. package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
  64. package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
  65. package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
  66. package/node_modules/typebox/build/format/uri_template.mjs +4 -5
  67. package/node_modules/typebox/build/format/url.d.mts +3 -3
  68. package/node_modules/typebox/build/format/url.mjs +4 -5
  69. package/node_modules/typebox/build/guard/emit.d.mts +3 -1
  70. package/node_modules/typebox/build/guard/emit.mjs +12 -5
  71. package/node_modules/typebox/build/guard/guard.d.mts +8 -2
  72. package/node_modules/typebox/build/guard/guard.mjs +25 -4
  73. package/node_modules/typebox/build/guard/string.d.mts +2 -2
  74. package/node_modules/typebox/build/guard/string.mjs +7 -7
  75. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
  76. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
  77. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
  78. package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
  79. package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
  80. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
  81. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
  82. package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
  83. package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
  84. package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
  85. package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
  86. package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
  87. package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
  88. package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
  89. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
  90. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
  91. package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
  92. package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
  93. package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
  94. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
  95. package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
  96. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
  97. package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
  98. package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
  99. package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
  100. package/node_modules/typebox/build/schema/types/index.mjs +0 -2
  101. package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
  102. package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
  103. package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
  104. package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
  105. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
  106. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
  107. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
  108. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
  109. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
  110. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
  111. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
  112. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
  113. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
  114. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
  115. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
  116. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
  117. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
  118. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
  119. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
  120. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
  121. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
  122. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
  123. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
  124. package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
  125. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
  126. package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
  127. package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
  128. package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
  129. package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
  130. package/node_modules/typebox/build/type/script/parser.mjs +27 -23
  131. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  132. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  133. package/node_modules/typebox/package.json +27 -27
  134. package/node_modules/typebox/readme.md +79 -82
  135. package/openclaw.plugin.json +26 -2
  136. package/package.json +6 -6
  137. package/dist/channel.runtime-qrUV6wPE.js +0 -4
  138. package/dist/config-schema-Be3azjB_.js +0 -47
  139. package/dist/monitor.runtime-B2z_5ugU.js +0 -2
  140. package/dist/outbound.runtime-DDTeqaBW.js +0 -3
  141. package/dist/probe.runtime-D13ZtXsd.js +0 -2
  142. package/dist/quick-reply-fallback-D86FwAfr.js +0 -56
  143. package/node_modules/typebox/build/format/_idna.d.mts +0 -2
  144. package/node_modules/typebox/build/format/_idna.mjs +0 -246
  145. package/node_modules/typebox/build/format/_puny.d.mts +0 -1
  146. package/node_modules/typebox/build/format/_puny.mjs +0 -77
  147. package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
  148. package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
  149. package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
  150. package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
  151. package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
  152. package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
  153. package/dist/{probe-CM03wo6r.js → probe-4gc_YQ2L.js} +1 -1
@@ -0,0 +1,12 @@
1
+ //#region extensions/line/src/account-helpers.ts
2
+ function hasLineCredentials(account) {
3
+ if (account.tokenStatus && account.signingSecretStatus) return account.tokenStatus !== "missing" && account.signingSecretStatus !== "missing";
4
+ return Boolean(account.channelAccessToken?.trim() && account.channelSecret?.trim());
5
+ }
6
+ function parseLineAllowFromId(raw) {
7
+ const trimmed = raw.trim().replace(/^line:(?:user:)?/i, "");
8
+ if (!/^U[a-f0-9]{32}$/i.test(trimmed)) return null;
9
+ return trimmed;
10
+ }
11
+ //#endregion
12
+ export { parseLineAllowFromId as n, hasLineCredentials as t };
package/dist/api.js CHANGED
@@ -1,5 +1,5 @@
1
- import { n as lineChannelPluginCommon, t as linePlugin } from "./channel-DmoKZXmG.js";
2
- import { r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-W0Dbgu58.js";
1
+ import { n as lineChannelPluginCommon, t as linePlugin } from "./channel-DpMgRaxl.js";
2
+ import { r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-DSJ92oJ5.js";
3
3
  //#region extensions/line/src/channel.setup.ts
4
4
  const lineSetupPlugin = {
5
5
  id: "line",
@@ -1,5 +1,5 @@
1
- import { _ as uriAction, c as createActionCard, d as createListCard, g as postbackAction, l as createImageCard, p as messageAction, s as createReceiptCard, u as createInfoCard } from "./send-receipt-DKZzgHMO.js";
2
- import { n as createFlexMessage } from "./send-BJCeiiOB.js";
1
+ import { c as createActionCard, d as createListCard, l as createImageCard, s as createReceiptCard, u as createInfoCard } from "./send-retry-CUvrarfE.js";
2
+ import { t as createFlexMessage } from "./send-B-K2B6au.js";
3
3
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
5
5
  //#region extensions/line/src/card-command.ts
@@ -14,10 +14,13 @@ Types:
14
14
  confirm "Question?" --yes "Yes|data" --no "No|data"
15
15
  buttons "Title" "Text" --actions "Btn1|url1,Btn2|data2"
16
16
 
17
+ Escape a separator that belongs to the data with a backslash: \\, \\|, or \\:
18
+
17
19
  Examples:
18
20
  /card info "Welcome" "Thanks for joining!"
19
21
  /card image "Product" "Check it out" --url https://example.com/img.jpg
20
- /card action "Menu" "Choose an option" --actions "Order|/order,Help|/help"`;
22
+ /card action "Menu" "Choose an option" --actions "Order|/order,Help|/help"
23
+ /card action "Links" "Pick one" --actions "Open|https://example.com/a\\,b"`;
21
24
  function buildLineReply(lineData) {
22
25
  return { channelData: { line: lineData } };
23
26
  }
@@ -29,27 +32,64 @@ function buildLineFlexReply(altText, contents) {
29
32
  } });
30
33
  }
31
34
  /**
35
+ * Split a card option value on its unescaped separators.
36
+ *
37
+ * Each pass consumes escapes for its own separator and preserves every other
38
+ * backslash. This lets nested comma, pipe, and colon passes stay independent.
39
+ */
40
+ function splitCardValue(value, separator) {
41
+ const parts = [];
42
+ let current = "";
43
+ for (let index = 0; index < value.length; index += 1) {
44
+ const char = value[index];
45
+ if (char === "\\" && value[index + 1] === separator) {
46
+ current += separator;
47
+ index += 1;
48
+ continue;
49
+ }
50
+ if (char === separator) {
51
+ parts.push(current);
52
+ current = "";
53
+ continue;
54
+ }
55
+ current += char;
56
+ }
57
+ parts.push(current);
58
+ return parts;
59
+ }
60
+ /** Split a "Label|data" pair, keeping escaped separators inside either side. */
61
+ function splitCardPair(part) {
62
+ const [label = "", data] = splitCardValue(part, "|").map((piece) => piece.trim());
63
+ return [label, data];
64
+ }
65
+ /**
32
66
  * Parse action string format: "Label|data,Label2|data2"
33
67
  * Data can be a URL (uri action) or plain text (message action) or key=value (postback)
34
68
  */
35
69
  function parseActions(actionsStr) {
36
70
  if (!actionsStr) return [];
37
71
  const results = [];
38
- for (const part of actionsStr.split(",")) {
39
- const [label, data] = part.trim().split("|").map((s) => s.trim());
72
+ for (const part of splitCardValue(actionsStr, ",")) {
73
+ const [label, data] = splitCardPair(part);
40
74
  if (!label) continue;
41
75
  const actionData = data || label;
42
- if (actionData.startsWith("http://") || actionData.startsWith("https://")) results.push({
76
+ const action = actionData.startsWith("http://") || actionData.startsWith("https://") ? {
77
+ type: "uri",
43
78
  label,
44
- action: uriAction(label, actionData)
45
- });
46
- else if (actionData.includes("=")) results.push({
79
+ uri: actionData
80
+ } : actionData.includes("=") ? {
81
+ type: "postback",
47
82
  label,
48
- action: postbackAction(label, actionData, label)
49
- });
50
- else results.push({
83
+ data: actionData,
84
+ displayText: label
85
+ } : {
86
+ type: "message",
51
87
  label,
52
- action: messageAction(label, actionData)
88
+ text: actionData
89
+ };
90
+ results.push({
91
+ label,
92
+ action
53
93
  });
54
94
  }
55
95
  return results;
@@ -58,10 +98,10 @@ function parseActions(actionsStr) {
58
98
  * Parse list items format: "Item1|Subtitle1,Item2|Subtitle2"
59
99
  */
60
100
  function parseListItems(itemsStr) {
61
- return itemsStr.split(",").map((part) => {
62
- const [title, subtitle] = part.trim().split("|").map((s) => s.trim());
101
+ return splitCardValue(itemsStr, ",").map((part) => {
102
+ const [title, subtitle] = splitCardPair(part);
63
103
  return {
64
- title: title || "",
104
+ title,
65
105
  subtitle
66
106
  };
67
107
  }).filter((item) => item.title);
@@ -70,15 +110,12 @@ function parseListItems(itemsStr) {
70
110
  * Parse receipt items format: "Item1:$10,Item2:$20"
71
111
  */
72
112
  function parseReceiptItems(itemsStr) {
73
- return itemsStr.split(",").map((part) => {
74
- const colonIndex = part.lastIndexOf(":");
75
- if (colonIndex === -1) return {
76
- name: part.trim(),
77
- value: ""
78
- };
113
+ return splitCardValue(itemsStr, ",").map((part) => {
114
+ const segments = splitCardValue(part, ":");
115
+ const value = segments.length > 1 ? segments.pop() : void 0;
79
116
  return {
80
- name: part.slice(0, colonIndex).trim(),
81
- value: part.slice(colonIndex + 1).trim()
117
+ name: segments.join(":").trim(),
118
+ value: value?.trim() ?? ""
82
119
  };
83
120
  }).filter((item) => item.name);
84
121
  }
@@ -100,7 +137,7 @@ function parseCardArgs(argsStrInput) {
100
137
  }
101
138
  const quotedRegex = /"([^"]*?)"/g;
102
139
  let match;
103
- while ((match = quotedRegex.exec(argsStr)) !== null) result.args.push(expectDefined(match[1], "quoted card argument capture"));
140
+ while ((match = quotedRegex.exec(argsStr)) !== null) result.args.push(expectDefined(match[1], "quoted card argument capture") || void 0);
104
141
  const flagRegex = /--(\w+)\s+(?:"([^"]*?)"|(\S+))/g;
105
142
  while ((match = flagRegex.exec(argsStr)) !== null) {
106
143
  const key = expectDefined(match[1], "card flag name capture");
@@ -125,7 +162,7 @@ function registerLineCardCommand(api) {
125
162
  case "info": {
126
163
  const [title = "Info", body = "", footer] = args;
127
164
  const bubble = createInfoCard(title, body, footer);
128
- return buildLineFlexReply(`${title}: ${body}`, bubble);
165
+ return buildLineFlexReply(body ? `${title}: ${body}` : title, bubble);
129
166
  }
130
167
  case "image": {
131
168
  const [title = "Image", caption = ""] = args;
@@ -139,7 +176,7 @@ function registerLineCardCommand(api) {
139
176
  const actions = parseActions(flags.actions);
140
177
  if (actions.length === 0) return { text: "Error: Action card requires --actions \"Label1|data1,Label2|data2\"" };
141
178
  const bubble = createActionCard(title, body, actions, { imageUrl: flags.url || flags.image });
142
- return buildLineFlexReply(`${title}: ${body}`, bubble);
179
+ return buildLineFlexReply(body ? `${title}: ${body}` : title, bubble);
143
180
  }
144
181
  case "list": {
145
182
  const [title = "List", itemsStr = ""] = args;
@@ -169,8 +206,8 @@ function registerLineCardCommand(api) {
169
206
  const [question = "Confirm?"] = args;
170
207
  const yesStr = flags.yes || "Yes|yes";
171
208
  const noStr = flags.no || "No|no";
172
- const [yesLabel, yesData] = yesStr.split("|").map((s) => s.trim());
173
- const [noLabel, noData] = noStr.split("|").map((s) => s.trim());
209
+ const [yesLabel, yesData] = splitCardPair(yesStr);
210
+ const [noLabel, noData] = splitCardPair(noStr);
174
211
  return buildLineReply({ templateMessage: {
175
212
  type: "confirm",
176
213
  text: question,