@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.
- package/dist/account-helpers-BSUyZwLm.js +12 -0
- package/dist/api.js +2 -2
- package/dist/{card-command-CyDSm-OU.js → card-command-BywtX77U.js} +66 -29
- package/dist/{channel-DmoKZXmG.js → channel-DpMgRaxl.js} +52 -349
- package/dist/channel-plugin-api.js +1 -1
- package/dist/channel.runtime-Bty5U_1N.js +4 -0
- package/dist/doctor-contract-api.js +141 -0
- package/dist/index.js +1 -1
- package/dist/{markdown-to-line-rEaras_0.js → markdown-to-line-CG9Jy22s.js} +29 -25
- package/dist/{monitor-BYXS_B6r.js → monitor-Ch6TIatG.js} +261 -166
- package/dist/monitor.runtime-Czc3NxNV.js +2 -0
- package/dist/outbound.runtime-CyleVzFR.js +3 -0
- package/dist/probe.runtime-DTxBWvKz.js +2 -0
- package/dist/rich-messages-t_zRL24p.js +760 -0
- package/dist/runtime-api.js +10 -11
- package/dist/{send-BJCeiiOB.js → send-B-K2B6au.js} +138 -104
- package/dist/{send-receipt-DKZzgHMO.js → send-retry-CUvrarfE.js} +137 -413
- package/dist/setup-api.js +1 -1
- package/dist/{setup-surface-W0Dbgu58.js → setup-surface-DSJ92oJ5.js} +24 -17
- package/dist/webhook-spool-contract-CNe2h1I2.js +58 -0
- package/node_modules/typebox/build/format/date.d.mts +1 -1
- package/node_modules/typebox/build/format/date.mjs +1 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -3
- package/node_modules/typebox/build/format/email.d.mts +1 -1
- package/node_modules/typebox/build/format/email.mjs +2 -2
- package/node_modules/typebox/build/format/hostname.mjs +2 -10
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_email.mjs +3 -3
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
- package/node_modules/typebox/build/format/ipv4.mjs +2 -32
- package/node_modules/typebox/build/format/ipv6.mjs +2 -61
- package/node_modules/typebox/build/format/iri.d.mts +2 -2
- package/node_modules/typebox/build/format/iri.mjs +26 -8
- package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
- package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
- package/node_modules/typebox/build/format/regex.d.mts +1 -2
- package/node_modules/typebox/build/format/regex.mjs +2 -6
- package/node_modules/typebox/build/format/time.d.mts +2 -2
- package/node_modules/typebox/build/format/time.mjs +19 -14
- package/node_modules/typebox/build/format/uri.d.mts +1 -1
- package/node_modules/typebox/build/format/uri.mjs +3 -130
- package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
- package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
- package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
- package/node_modules/typebox/build/format/uri_template.mjs +4 -5
- package/node_modules/typebox/build/format/url.d.mts +3 -3
- package/node_modules/typebox/build/format/url.mjs +4 -5
- package/node_modules/typebox/build/guard/emit.d.mts +3 -1
- package/node_modules/typebox/build/guard/emit.mjs +12 -5
- package/node_modules/typebox/build/guard/guard.d.mts +8 -2
- package/node_modules/typebox/build/guard/guard.mjs +25 -4
- package/node_modules/typebox/build/guard/string.d.mts +2 -2
- package/node_modules/typebox/build/guard/string.mjs +7 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
- package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/types/index.mjs +0 -2
- package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
- package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
- package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
- package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
- package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
- package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
- package/node_modules/typebox/build/type/script/parser.mjs +27 -23
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/package.json +27 -27
- package/node_modules/typebox/readme.md +79 -82
- package/openclaw.plugin.json +26 -2
- package/package.json +6 -6
- package/dist/channel.runtime-qrUV6wPE.js +0 -4
- package/dist/config-schema-Be3azjB_.js +0 -47
- package/dist/monitor.runtime-B2z_5ugU.js +0 -2
- package/dist/outbound.runtime-DDTeqaBW.js +0 -3
- package/dist/probe.runtime-D13ZtXsd.js +0 -2
- package/dist/quick-reply-fallback-D86FwAfr.js +0 -56
- package/node_modules/typebox/build/format/_idna.d.mts +0 -2
- package/node_modules/typebox/build/format/_idna.mjs +0 -246
- package/node_modules/typebox/build/format/_puny.d.mts +0 -1
- package/node_modules/typebox/build/format/_puny.mjs +0 -77
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
- package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
- 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-
|
|
2
|
-
import { r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-
|
|
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 {
|
|
2
|
-
import {
|
|
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
|
|
39
|
-
const [label, data] = part
|
|
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
|
-
|
|
76
|
+
const action = actionData.startsWith("http://") || actionData.startsWith("https://") ? {
|
|
77
|
+
type: "uri",
|
|
43
78
|
label,
|
|
44
|
-
|
|
45
|
-
})
|
|
46
|
-
|
|
79
|
+
uri: actionData
|
|
80
|
+
} : actionData.includes("=") ? {
|
|
81
|
+
type: "postback",
|
|
47
82
|
label,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
83
|
+
data: actionData,
|
|
84
|
+
displayText: label
|
|
85
|
+
} : {
|
|
86
|
+
type: "message",
|
|
51
87
|
label,
|
|
52
|
-
|
|
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
|
|
62
|
-
const [title, subtitle] = part
|
|
101
|
+
return splitCardValue(itemsStr, ",").map((part) => {
|
|
102
|
+
const [title, subtitle] = splitCardPair(part);
|
|
63
103
|
return {
|
|
64
|
-
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
|
|
74
|
-
const
|
|
75
|
-
|
|
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:
|
|
81
|
-
value:
|
|
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}
|
|
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}
|
|
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
|
|
173
|
-
const [noLabel, noData] = noStr
|
|
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,
|