@openclaw/line 2026.7.2-beta.5 → 2026.7.2-beta.7
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/{accounts-CSH5sk8U.js → accounts-BqEVsDoB.js} +24 -88
- package/dist/api.js +2 -2
- package/dist/{card-command-BEMIm8D8.js → card-command-ty11OJNt.js} +1 -1
- package/dist/{channel-CTaWrzfl.js → channel-D4i_K4fQ.js} +6 -6
- package/dist/channel-plugin-api.js +1 -1
- package/dist/channel.runtime-BdhK8Xw7.js +4 -0
- package/dist/contract-api.js +1 -1
- package/dist/{flex-templates-DVy_wog4.js → flex-templates-iKJsyCq-.js} +1 -3
- package/dist/index.js +1 -1
- package/dist/{markdown-to-line-Dn00k1bq.js → markdown-to-line-DMDQTMhx.js} +2 -2
- package/dist/{monitor-DzFU5UPV.js → monitor-DXEodYFJ.js} +23 -54
- package/dist/monitor.runtime-CZquR7jI.js +2 -0
- package/dist/{outbound.runtime-eHl7NNHu.js → outbound.runtime-BS0IhU_M.js} +1 -1
- package/dist/{reply-payload-transform-BRM2fRvK.js → reply-payload-transform-D5-dHB8b.js} +1 -1
- package/dist/runtime-api.js +7 -6
- package/dist/setup-api.js +1 -1
- package/dist/{setup-surface-BHQOSD8R.js → setup-surface-DRQ7n0En.js} +49 -67
- package/package.json +4 -4
- package/dist/channel.runtime-D4Paci2y.js +0 -4
- package/dist/monitor.runtime-B8xjVqev.js +0 -2
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/LICENSE +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/README.md +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/assert/strict.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/assert.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/async_hooks.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/buffer.buffer.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/buffer.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/child_process.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/cluster.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/compatibility/iterators.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/console.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/constants.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/crypto.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/dgram.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/diagnostics_channel.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/dns/promises.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/dns.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/domain.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/events.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/fs/promises.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/fs.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/globals.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/globals.typedarray.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/http.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/http2.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/https.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/index.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/inspector.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/inspector.generated.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/module.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/net.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/os.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/package.json +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/path.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/perf_hooks.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/process.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/punycode.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/querystring.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/readline/promises.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/readline.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/repl.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/sea.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/sqlite.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/stream/consumers.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/stream/promises.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/stream/web.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/stream.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/string_decoder.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/test.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/timers/promises.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/timers.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/tls.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/trace_events.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.6/buffer.buffer.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.6/compatibility/float16array.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.6/globals.typedarray.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.6/index.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.7/compatibility/float16array.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.7/index.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/tty.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/url.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/util.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/v8.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/vm.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/wasi.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/abortcontroller.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/crypto.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/domexception.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/events.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/fetch.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/navigator.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/storage.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/streams.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/worker_threads.d.ts +0 -0
- /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/zlib.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/LICENSE +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/README.md +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/agent.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/api.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/balanced-pool.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/cache-interceptor.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/cache.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/client-stats.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/client.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/connector.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/content-type.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/cookies.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/diagnostics-channel.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/dispatcher.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/env-http-proxy-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/errors.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/eventsource.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/fetch.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/formdata.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/global-dispatcher.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/global-origin.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/h2c-client.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/handlers.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/header.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/index.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/interceptors.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-call-history.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-client.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-errors.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-interceptor.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-pool.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/package.json +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/patch.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/pool-stats.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/pool.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/proxy-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/readable.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/retry-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/retry-handler.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/round-robin-pool.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/snapshot-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/util.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/utility.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/webidl.d.ts +0 -0
- /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/websocket.d.ts +0 -0
|
@@ -4,37 +4,19 @@ import { resolveAccountEntry, resolveListedDefaultAccountId } from "openclaw/plu
|
|
|
4
4
|
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/secret-file-runtime";
|
|
5
5
|
//#region extensions/line/src/accounts.ts
|
|
6
6
|
const { resolveAccountConfig: resolveMergedLineAccountConfig } = createAccountListHelpers("line", { omitKeys: ["defaultAccount"] });
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
source: "config",
|
|
15
|
-
status: "available"
|
|
16
|
-
};
|
|
17
|
-
if (accountConfig?.tokenFile?.trim()) {
|
|
18
|
-
const result = readCredentialFile(accountConfig.tokenFile, `channels.line.accounts.${accountId}.tokenFile`);
|
|
19
|
-
return result.status === "available" ? {
|
|
20
|
-
value: result.value,
|
|
21
|
-
source: "file",
|
|
22
|
-
status: "available"
|
|
23
|
-
} : {
|
|
24
|
-
value: "",
|
|
25
|
-
source: "file",
|
|
26
|
-
status: "configured_unavailable",
|
|
27
|
-
diagnostic: result.diagnostic
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
if (accountId === DEFAULT_ACCOUNT_ID) {
|
|
31
|
-
if (baseConfig?.channelAccessToken?.trim()) return {
|
|
32
|
-
value: baseConfig.channelAccessToken.trim(),
|
|
7
|
+
function resolveLineCredential(params) {
|
|
8
|
+
const { accountId, baseConfig, accountConfig, credentialKey, fileKey, envKey } = params;
|
|
9
|
+
const candidates = accountId === DEFAULT_ACCOUNT_ID ? [accountConfig, baseConfig] : [accountConfig];
|
|
10
|
+
for (const [index, config] of candidates.entries()) {
|
|
11
|
+
const credential = config?.[credentialKey]?.trim();
|
|
12
|
+
if (credential) return {
|
|
13
|
+
value: credential,
|
|
33
14
|
source: "config",
|
|
34
15
|
status: "available"
|
|
35
16
|
};
|
|
36
|
-
|
|
37
|
-
|
|
17
|
+
const file = config?.[fileKey];
|
|
18
|
+
if (file?.trim()) {
|
|
19
|
+
const result = tryReadSecretFileSync(file, "LINE credential file", { rejectSymlink: true }, { configPath: `channels.line.${index === 0 ? `accounts.${accountId}.` : ""}${fileKey}` });
|
|
38
20
|
return result.status === "available" ? {
|
|
39
21
|
value: result.value,
|
|
40
22
|
source: "file",
|
|
@@ -46,65 +28,13 @@ function resolveToken(params) {
|
|
|
46
28
|
diagnostic: result.diagnostic
|
|
47
29
|
};
|
|
48
30
|
}
|
|
49
|
-
const envToken = process.env.LINE_CHANNEL_ACCESS_TOKEN?.trim();
|
|
50
|
-
if (envToken) return {
|
|
51
|
-
value: envToken,
|
|
52
|
-
source: "env",
|
|
53
|
-
status: "available"
|
|
54
|
-
};
|
|
55
31
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
function resolveSecret(params) {
|
|
63
|
-
const { accountId, baseConfig, accountConfig } = params;
|
|
64
|
-
if (accountConfig?.channelSecret?.trim()) return {
|
|
65
|
-
value: accountConfig.channelSecret.trim(),
|
|
66
|
-
source: "config",
|
|
32
|
+
const envCredential = accountId === DEFAULT_ACCOUNT_ID ? process.env[envKey]?.trim() : void 0;
|
|
33
|
+
if (envCredential) return {
|
|
34
|
+
value: envCredential,
|
|
35
|
+
source: "env",
|
|
67
36
|
status: "available"
|
|
68
37
|
};
|
|
69
|
-
if (accountConfig?.secretFile?.trim()) {
|
|
70
|
-
const result = readCredentialFile(accountConfig.secretFile, `channels.line.accounts.${accountId}.secretFile`);
|
|
71
|
-
return result.status === "available" ? {
|
|
72
|
-
value: result.value,
|
|
73
|
-
source: "file",
|
|
74
|
-
status: "available"
|
|
75
|
-
} : {
|
|
76
|
-
value: "",
|
|
77
|
-
source: "file",
|
|
78
|
-
status: "configured_unavailable",
|
|
79
|
-
diagnostic: result.diagnostic
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
if (accountId === DEFAULT_ACCOUNT_ID) {
|
|
83
|
-
if (baseConfig?.channelSecret?.trim()) return {
|
|
84
|
-
value: baseConfig.channelSecret.trim(),
|
|
85
|
-
source: "config",
|
|
86
|
-
status: "available"
|
|
87
|
-
};
|
|
88
|
-
if (baseConfig?.secretFile?.trim()) {
|
|
89
|
-
const result = readCredentialFile(baseConfig.secretFile, "channels.line.secretFile");
|
|
90
|
-
return result.status === "available" ? {
|
|
91
|
-
value: result.value,
|
|
92
|
-
source: "file",
|
|
93
|
-
status: "available"
|
|
94
|
-
} : {
|
|
95
|
-
value: "",
|
|
96
|
-
source: "file",
|
|
97
|
-
status: "configured_unavailable",
|
|
98
|
-
diagnostic: result.diagnostic
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
const envSecret = process.env.LINE_CHANNEL_SECRET?.trim();
|
|
102
|
-
if (envSecret) return {
|
|
103
|
-
value: envSecret,
|
|
104
|
-
source: "env",
|
|
105
|
-
status: "available"
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
38
|
return {
|
|
109
39
|
value: "",
|
|
110
40
|
source: "none",
|
|
@@ -117,15 +47,21 @@ function resolveLineAccount(params) {
|
|
|
117
47
|
const lineConfig = cfg.channels?.line;
|
|
118
48
|
const accounts = lineConfig?.accounts;
|
|
119
49
|
const accountConfig = resolveAccountEntry(accounts, accountId);
|
|
120
|
-
const token =
|
|
50
|
+
const token = resolveLineCredential({
|
|
121
51
|
accountId,
|
|
122
52
|
baseConfig: lineConfig,
|
|
123
|
-
accountConfig
|
|
53
|
+
accountConfig,
|
|
54
|
+
credentialKey: "channelAccessToken",
|
|
55
|
+
fileKey: "tokenFile",
|
|
56
|
+
envKey: "LINE_CHANNEL_ACCESS_TOKEN"
|
|
124
57
|
});
|
|
125
|
-
const secret =
|
|
58
|
+
const secret = resolveLineCredential({
|
|
126
59
|
accountId,
|
|
127
60
|
baseConfig: lineConfig,
|
|
128
|
-
accountConfig
|
|
61
|
+
accountConfig,
|
|
62
|
+
credentialKey: "channelSecret",
|
|
63
|
+
fileKey: "secretFile",
|
|
64
|
+
envKey: "LINE_CHANNEL_SECRET"
|
|
129
65
|
});
|
|
130
66
|
const mergedConfig = resolveMergedLineAccountConfig(cfg, accountId);
|
|
131
67
|
const baseEnabled = lineConfig?.enabled !== false;
|
package/dist/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as lineChannelPluginCommon, t as linePlugin } from "./channel-
|
|
2
|
-
import { n as lineSetupAdapter, r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-
|
|
1
|
+
import { n as lineChannelPluginCommon, t as linePlugin } from "./channel-D4i_K4fQ.js";
|
|
2
|
+
import { n as lineSetupAdapter, r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-DRQ7n0En.js";
|
|
3
3
|
//#region extensions/line/src/channel.setup.ts
|
|
4
4
|
const lineSetupPlugin = {
|
|
5
5
|
id: "line",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as postbackAction, d as createListCard, l as createImageCard, m as messageAction, o as createReceiptCard, s as createActionCard, u as createInfoCard, v as uriAction } from "./flex-templates-
|
|
1
|
+
import { _ as postbackAction, d as createListCard, l as createImageCard, m as messageAction, o as createReceiptCard, s as createActionCard, u as createInfoCard, v as uriAction } from "./flex-templates-iKJsyCq-.js";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
4
4
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as resolveLineAccount, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-
|
|
2
|
-
import { i as hasLineCredentials, n as lineSetupAdapter, r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-
|
|
1
|
+
import { i as resolveLineAccount, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-BqEVsDoB.js";
|
|
2
|
+
import { i as hasLineCredentials, n as lineSetupAdapter, r as lineSetupContract, t as lineSetupWizard } from "./setup-surface-DRQ7n0En.js";
|
|
3
3
|
import { i as resolveExactLineGroupConfigKey, n as getLineRuntime, t as buildLineQuickReplyFallbackText } from "./quick-reply-fallback-D86FwAfr.js";
|
|
4
|
-
import { n as parseLineDirectives, r as LineChannelConfigSchema, t as hasLineDirectives } from "./reply-payload-transform-
|
|
4
|
+
import { n as parseLineDirectives, r as LineChannelConfigSchema, t as hasLineDirectives } from "./reply-payload-transform-D5-dHB8b.js";
|
|
5
5
|
import { i as resolveLineOutboundMedia, n as buildLineMediaMessage, r as hasLineSpecificMediaOptions, t as createLineSendReceipt } from "./send-receipt-CY2ey8XH.js";
|
|
6
6
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
7
7
|
import { buildDmGroupAccountAllowlistAdapter, createFlatAllowlistOverrideResolver } from "openclaw/plugin-sdk/allowlist-config-edit";
|
|
@@ -118,7 +118,7 @@ const lineChannelPluginCommon = {
|
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region extensions/line/src/gateway.ts
|
|
120
120
|
const loadLineProbeRuntime$1 = createLazyRuntimeModule(() => import("./probe.runtime-D13ZtXsd.js"));
|
|
121
|
-
const loadLineMonitorRuntime = createLazyRuntimeModule(() => import("./monitor.runtime-
|
|
121
|
+
const loadLineMonitorRuntime = createLazyRuntimeModule(() => import("./monitor.runtime-CZquR7jI.js"));
|
|
122
122
|
const lineGatewayAdapter = {
|
|
123
123
|
startAccount: async (ctx) => {
|
|
124
124
|
const account = ctx.account;
|
|
@@ -233,7 +233,7 @@ function inferLineTargetChatType(target) {
|
|
|
233
233
|
}
|
|
234
234
|
//#endregion
|
|
235
235
|
//#region extensions/line/src/outbound.ts
|
|
236
|
-
const loadLineOutboundRuntime = createLazyRuntimeModule(() => import("./outbound.runtime-
|
|
236
|
+
const loadLineOutboundRuntime = createLazyRuntimeModule(() => import("./outbound.runtime-BS0IhU_M.js"));
|
|
237
237
|
const LINE_FLEX_ALT_TEXT_LIMIT = 1500;
|
|
238
238
|
const lineOutboundAdapter = {
|
|
239
239
|
deliveryMode: "direct",
|
|
@@ -531,7 +531,7 @@ const lineStatusAdapter = createComputedAccountStatusAdapter({
|
|
|
531
531
|
});
|
|
532
532
|
//#endregion
|
|
533
533
|
//#region extensions/line/src/channel.ts
|
|
534
|
-
const loadLineChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
534
|
+
const loadLineChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-BdhK8Xw7.js"));
|
|
535
535
|
const lineSecurityAdapter = createRestrictSendersChannelSecurity({
|
|
536
536
|
channelKey: "line",
|
|
537
537
|
resolveDmPolicy: (account) => account.config.dmPolicy,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as linePlugin } from "./channel-
|
|
1
|
+
import { t as linePlugin } from "./channel-D4i_K4fQ.js";
|
|
2
2
|
export { linePlugin };
|
package/dist/contract-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as resolveLineAccount, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-
|
|
1
|
+
import { i as resolveLineAccount, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-BqEVsDoB.js";
|
|
2
2
|
export { listLineAccountIds, resolveDefaultLineAccountId, resolveLineAccount };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
2
|
+
import { isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
2
3
|
//#region extensions/line/src/actions.ts
|
|
3
4
|
const LINE_ACTION_LABEL_LIMIT = 20;
|
|
4
5
|
const LINE_ACTION_DATA_LIMIT = 300;
|
|
@@ -48,9 +49,6 @@ const actionTypes = /* @__PURE__ */ new Set([
|
|
|
48
49
|
"richmenuswitch",
|
|
49
50
|
"uri"
|
|
50
51
|
]);
|
|
51
|
-
function isRecord(value) {
|
|
52
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
53
|
-
}
|
|
54
52
|
function isLineAction(value) {
|
|
55
53
|
return isRecord(value) && typeof value.type === "string" && actionTypes.has(value.type);
|
|
56
54
|
}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
|
4
4
|
function createLineCardCommandLoader(api) {
|
|
5
5
|
return createLazyRuntimeModule(async () => {
|
|
6
6
|
let registered = null;
|
|
7
|
-
const { registerLineCardCommand } = await import("./card-command-
|
|
7
|
+
const { registerLineCardCommand } = await import("./card-command-ty11OJNt.js");
|
|
8
8
|
registerLineCardCommand({
|
|
9
9
|
...api,
|
|
10
10
|
registerCommand(command) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as resolveLineAccount } from "./accounts-
|
|
1
|
+
import { i as resolveLineAccount } from "./accounts-BqEVsDoB.js";
|
|
2
2
|
import { a as validateLineMediaUrl, t as createLineSendReceipt } from "./send-receipt-CY2ey8XH.js";
|
|
3
|
-
import { _ as postbackAction, g as normalizeLineMessageActions, h as normalizeLineAction, m as messageAction, o as createReceiptCard, v as uriAction } from "./flex-templates-
|
|
3
|
+
import { _ as postbackAction, g as normalizeLineMessageActions, h as normalizeLineAction, m as messageAction, o as createReceiptCard, v as uriAction } from "./flex-templates-iKJsyCq-.js";
|
|
4
4
|
import { markdownToIRWithMeta, stripMarkdown, stripMarkdown as stripMarkdown$1 } from "openclaw/plugin-sdk/text-chunking";
|
|
5
5
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
6
6
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as resolveLineAccount, r as resolveDefaultLineAccountId } from "./accounts-
|
|
1
|
+
import { i as resolveLineAccount, r as resolveDefaultLineAccountId } from "./accounts-BqEVsDoB.js";
|
|
2
2
|
import { a as resolveLineGroupConfigEntry, n as getLineRuntime, t as buildLineQuickReplyFallbackText } from "./quick-reply-fallback-D86FwAfr.js";
|
|
3
3
|
import { n as buildLineMediaMessage, r as hasLineSpecificMediaOptions } from "./send-receipt-CY2ey8XH.js";
|
|
4
|
-
import { E as buildTemplateMessageFromPayload, S as replyMessageLine, i as processLineMessage, l as createLocationMessage, p as getUserDisplayName, s as createFlexMessage, u as createQuickReplyItems, v as pushMessageLine, w as showLoadingAnimation, y as pushMessagesLine } from "./markdown-to-line-
|
|
4
|
+
import { E as buildTemplateMessageFromPayload, S as replyMessageLine, i as processLineMessage, l as createLocationMessage, p as getUserDisplayName, s as createFlexMessage, u as createQuickReplyItems, v as pushMessageLine, w as showLoadingAnimation, y as pushMessagesLine } from "./markdown-to-line-DMDQTMhx.js";
|
|
5
5
|
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
|
6
|
-
import { normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
|
-
import { DEFAULT_INGRESS_ADOPTION_STALL_MS, DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, bindIngressLifecycleToReplyOptions, createChannelIngressMonitor } from "openclaw/plugin-sdk/channel-outbound";
|
|
6
|
+
import { normalizeNullableString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
|
+
import { DEFAULT_INGRESS_ADOPTION_STALL_MS, DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor } from "openclaw/plugin-sdk/channel-outbound";
|
|
8
8
|
import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
9
9
|
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
10
10
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -16,8 +16,9 @@ import { saveMediaStream } from "openclaw/plugin-sdk/media-store";
|
|
|
16
16
|
import { createNonExitingRuntime, danger, logVerbose, shouldLogVerbose, waitForAbortSignal, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
17
17
|
import { fetchWithRuntimeDispatcherOrMockedGlobal } from "openclaw/plugin-sdk/runtime-fetch";
|
|
18
18
|
import { HTTPFetchError } from "@line/bot-sdk";
|
|
19
|
+
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
19
20
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
20
|
-
import { buildChannelInboundEventContext, buildMentionRegexes, formatInboundEnvelope, formatInboundMediaUnavailableText, formatLocationText, hasFinalInboundReplyDispatch, matchesMentionPatterns, resolveInboundSessionEnvelopeContext,
|
|
21
|
+
import { buildChannelInboundEventContext, buildMentionRegexes, formatInboundEnvelope, formatInboundMediaUnavailableText, formatLocationText, hasFinalInboundReplyDispatch, matchesMentionPatterns, resolveInboundSessionEnvelopeContext, toInboundMediaFactsWithMetadata, toLocationContext } from "openclaw/plugin-sdk/channel-inbound";
|
|
21
22
|
import { chunkMarkdownText } from "openclaw/plugin-sdk/reply-runtime";
|
|
22
23
|
import { isRequestBodyLimitError, normalizePluginHttpPath, normalizeWebhookPath, registerWebhookTargetWithPluginRoute, requestBodyErrorToText, resolveSingleWebhookTarget } from "openclaw/plugin-sdk/webhook-ingress";
|
|
23
24
|
import { beginWebhookRequestPipelineOrReject, createWebhookInFlightLimiter, isRequestBodyLimitError as isRequestBodyLimitError$1, readRequestBodyWithLimit, requestBodyErrorToText as requestBodyErrorToText$1, runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
@@ -451,7 +452,7 @@ async function finalizeLineInboundContext(params) {
|
|
|
451
452
|
sessionKey: params.route.sessionKey
|
|
452
453
|
});
|
|
453
454
|
const agentBody = params.agentBody ?? params.rawBody;
|
|
454
|
-
const media =
|
|
455
|
+
const media = await toInboundMediaFactsWithMetadata(params.media);
|
|
455
456
|
const body = formatInboundEnvelope({
|
|
456
457
|
channel: "LINE",
|
|
457
458
|
from: conversationLabel,
|
|
@@ -1065,14 +1066,7 @@ const LINE_WEBHOOK_DRAIN_INTERVAL_MS = 500;
|
|
|
1065
1066
|
const LINE_WEBHOOK_MAX_CONCURRENT_DELIVERIES = 8;
|
|
1066
1067
|
const LINE_WEBHOOK_DRAIN_SCAN_LIMIT = 100;
|
|
1067
1068
|
const LINE_WEBHOOK_ACTIVE_DELIVERY_STOP_GRACE_MS = 5e3;
|
|
1068
|
-
const
|
|
1069
|
-
const LINE_WEBHOOK_TOMBSTONE_MAX_ENTRIES = 4096;
|
|
1070
|
-
var LineWebhookPayloadError = class extends Error {
|
|
1071
|
-
constructor(message, options) {
|
|
1072
|
-
super(message, options);
|
|
1073
|
-
this.name = "LineWebhookPayloadError";
|
|
1074
|
-
}
|
|
1075
|
-
};
|
|
1069
|
+
const LineWebhookPayloadError = createChannelIngressError("LineWebhookPayloadError");
|
|
1076
1070
|
var LineWebhookTerminalDeliveryError = class extends Error {
|
|
1077
1071
|
constructor(message, options) {
|
|
1078
1072
|
super(message, options);
|
|
@@ -1080,18 +1074,15 @@ var LineWebhookTerminalDeliveryError = class extends Error {
|
|
|
1080
1074
|
this.name = "LineWebhookTerminalDeliveryError";
|
|
1081
1075
|
}
|
|
1082
1076
|
};
|
|
1083
|
-
function nonEmptyString(value) {
|
|
1084
|
-
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
1085
|
-
}
|
|
1086
1077
|
/** Message ids preserve the shipped replay-guard keyspace; other events use LINE's delivery id. */
|
|
1087
1078
|
function eventIdFor(event) {
|
|
1088
1079
|
if (!event || typeof event !== "object") throw new LineWebhookPayloadError("LINE webhook event must be an object.");
|
|
1089
1080
|
const candidate = event;
|
|
1090
1081
|
if (candidate.type === "message") {
|
|
1091
|
-
const messageId =
|
|
1082
|
+
const messageId = normalizeNullableString(candidate.message?.id);
|
|
1092
1083
|
if (messageId) return `message:${messageId}`;
|
|
1093
1084
|
}
|
|
1094
|
-
const webhookEventId =
|
|
1085
|
+
const webhookEventId = normalizeNullableString(candidate.webhookEventId);
|
|
1095
1086
|
if (webhookEventId) return `event:${webhookEventId}`;
|
|
1096
1087
|
throw new LineWebhookPayloadError("LINE webhook event is missing a stable delivery id.");
|
|
1097
1088
|
}
|
|
@@ -1099,15 +1090,15 @@ function laneKeyFor(event, eventId) {
|
|
|
1099
1090
|
if (!event || typeof event !== "object") return eventId;
|
|
1100
1091
|
const source = event.source;
|
|
1101
1092
|
if (source?.type === "group") {
|
|
1102
|
-
const groupId =
|
|
1093
|
+
const groupId = normalizeNullableString(source.groupId);
|
|
1103
1094
|
if (groupId) return `group:${groupId}`;
|
|
1104
1095
|
}
|
|
1105
1096
|
if (source?.type === "room") {
|
|
1106
|
-
const roomId =
|
|
1097
|
+
const roomId = normalizeNullableString(source.roomId);
|
|
1107
1098
|
if (roomId) return `room:${roomId}`;
|
|
1108
1099
|
}
|
|
1109
1100
|
if (source?.type === "user") {
|
|
1110
|
-
const userId =
|
|
1101
|
+
const userId = normalizeNullableString(source.userId);
|
|
1111
1102
|
if (userId) return `user:${userId}`;
|
|
1112
1103
|
}
|
|
1113
1104
|
return eventId;
|
|
@@ -1143,7 +1134,6 @@ async function waitForActiveDeliveriesBeforeDispose(activeDeliveries) {
|
|
|
1143
1134
|
function createLineWebhookSpool(options) {
|
|
1144
1135
|
const queue = options.queue ?? getLineRuntime().state.openChannelIngressQueue({ accountId: options.accountId });
|
|
1145
1136
|
const activeDeliveries = /* @__PURE__ */ new Set();
|
|
1146
|
-
const deferredClaims = /* @__PURE__ */ new Map();
|
|
1147
1137
|
let acceptsDeferredClaims = true;
|
|
1148
1138
|
const monitor = createChannelIngressMonitor({
|
|
1149
1139
|
queue,
|
|
@@ -1181,49 +1171,28 @@ function createLineWebhookSpool(options) {
|
|
|
1181
1171
|
},
|
|
1182
1172
|
createClaimError: (kind) => new LineWebhookPayloadError(kind === "invalid-version" ? "LINE webhook spool payload is invalid." : "LINE webhook event identity changed after durable admission.")
|
|
1183
1173
|
},
|
|
1184
|
-
deliver: async ({ event, destination }, lifecycle
|
|
1174
|
+
deliver: async ({ event, destination }, lifecycle) => {
|
|
1185
1175
|
const boundLifecycle = bindIngressLifecycleToReplyOptions(lifecycle).turnAdoptionLifecycle;
|
|
1186
1176
|
let handedOff = false;
|
|
1187
|
-
let resolveDeferredClaim;
|
|
1188
|
-
const deferredClaim = new Promise((resolve) => {
|
|
1189
|
-
resolveDeferredClaim = resolve;
|
|
1190
|
-
});
|
|
1191
|
-
let deferredClaimSettled = false;
|
|
1192
|
-
const settleDeferredClaim = () => {
|
|
1193
|
-
if (deferredClaimSettled) return;
|
|
1194
|
-
deferredClaimSettled = true;
|
|
1195
|
-
if (deferredClaims.get(claim.id) === deferredClaim) deferredClaims.delete(claim.id);
|
|
1196
|
-
resolveDeferredClaim();
|
|
1197
|
-
};
|
|
1198
1177
|
const delivery = options.deliver(event, destination, { turnAdoptionLifecycle: {
|
|
1199
1178
|
...boundLifecycle,
|
|
1200
1179
|
onAdopted: async () => {
|
|
1201
1180
|
handedOff = true;
|
|
1202
|
-
|
|
1203
|
-
await boundLifecycle.onAdopted();
|
|
1204
|
-
} finally {
|
|
1205
|
-
settleDeferredClaim();
|
|
1206
|
-
}
|
|
1181
|
+
await boundLifecycle.onAdopted();
|
|
1207
1182
|
},
|
|
1208
1183
|
onDeferred: () => {
|
|
1209
1184
|
handedOff = true;
|
|
1210
1185
|
if (!acceptsDeferredClaims) {
|
|
1211
|
-
settleDeferredClaim();
|
|
1212
1186
|
Promise.resolve().then(() => boundLifecycle.onAbandoned()).catch((error) => {
|
|
1213
1187
|
options.runtime.error?.(danger(`line: failed to abandon a late webhook delivery: ${errorText(error)}`));
|
|
1214
1188
|
});
|
|
1215
1189
|
return;
|
|
1216
1190
|
}
|
|
1217
|
-
if (!deferredClaimSettled) deferredClaims.set(claim.id, deferredClaim);
|
|
1218
1191
|
boundLifecycle.onDeferred();
|
|
1219
1192
|
},
|
|
1220
1193
|
onAbandoned: async () => {
|
|
1221
1194
|
handedOff = true;
|
|
1222
|
-
|
|
1223
|
-
await boundLifecycle.onAbandoned();
|
|
1224
|
-
} finally {
|
|
1225
|
-
settleDeferredClaim();
|
|
1226
|
-
}
|
|
1195
|
+
await boundLifecycle.onAbandoned();
|
|
1227
1196
|
}
|
|
1228
1197
|
} });
|
|
1229
1198
|
activeDeliveries.add(delivery);
|
|
@@ -1240,14 +1209,13 @@ function createLineWebhookSpool(options) {
|
|
|
1240
1209
|
pollIntervalMs: LINE_WEBHOOK_DRAIN_INTERVAL_MS,
|
|
1241
1210
|
retention: {
|
|
1242
1211
|
pruneIntervalMs: 0,
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
failedTtlMs: LINE_WEBHOOK_TOMBSTONE_TTL_MS,
|
|
1246
|
-
failedMaxEntries: LINE_WEBHOOK_TOMBSTONE_MAX_ENTRIES
|
|
1212
|
+
completedMaxEntries: 4096,
|
|
1213
|
+
failedMaxEntries: 4096
|
|
1247
1214
|
},
|
|
1248
1215
|
appendRetryDelaysMs: [0],
|
|
1249
1216
|
waitForDeliveryIdleBeforeRepump: false,
|
|
1250
1217
|
waitForDeliveryIdleOnStop: false,
|
|
1218
|
+
deferredClaims: "manual",
|
|
1251
1219
|
runPumpTask: runDetachedWebhookWork,
|
|
1252
1220
|
admissionMode: "durable-after-stop",
|
|
1253
1221
|
drain: {
|
|
@@ -1298,7 +1266,7 @@ function createLineWebhookSpool(options) {
|
|
|
1298
1266
|
try {
|
|
1299
1267
|
const deliveriesSettled = await waitForActiveDeliveriesBeforeDispose(activeDeliveries);
|
|
1300
1268
|
if (!deliveriesSettled) options.runtime.log(warn(`line: timed out after ${LINE_WEBHOOK_ACTIVE_DELIVERY_STOP_GRACE_MS}ms waiting for active webhook deliveries; releasing drain ownership`));
|
|
1301
|
-
|
|
1269
|
+
await monitor.waitForDeferredClaims();
|
|
1302
1270
|
acceptsDeferredClaims = false;
|
|
1303
1271
|
if (deliveriesSettled) await monitor.waitForIdle();
|
|
1304
1272
|
} finally {
|
|
@@ -1451,7 +1419,7 @@ function createLineNodeWebhookHandler(params) {
|
|
|
1451
1419
|
res.end(JSON.stringify({ error: requestBodyErrorToText$1("REQUEST_BODY_TIMEOUT") }));
|
|
1452
1420
|
return;
|
|
1453
1421
|
}
|
|
1454
|
-
params.runtime.error?.(danger(`line webhook error: ${
|
|
1422
|
+
params.runtime.error?.(danger(`line webhook error: ${formatErrorMessage(err)}`));
|
|
1455
1423
|
if (!res.headersSent) {
|
|
1456
1424
|
res.statusCode = 500;
|
|
1457
1425
|
res.setHeader("Content-Type", "application/json");
|
|
@@ -1681,6 +1649,7 @@ async function monitorLineProvider(opts) {
|
|
|
1681
1649
|
if (body.events && body.events.length > 0) {
|
|
1682
1650
|
logVerbose(`line: received ${body.events.length} webhook events`);
|
|
1683
1651
|
await match.target.bot.handleWebhook(body);
|
|
1652
|
+
res.setHeader("x-openclaw-delivery-accepted", "durable");
|
|
1684
1653
|
}
|
|
1685
1654
|
res.statusCode = 200;
|
|
1686
1655
|
res.setHeader("Content-Type", "application/json");
|
|
@@ -1698,7 +1667,7 @@ async function monitorLineProvider(opts) {
|
|
|
1698
1667
|
res.end(JSON.stringify({ error: requestBodyErrorToText("REQUEST_BODY_TIMEOUT") }));
|
|
1699
1668
|
return;
|
|
1700
1669
|
}
|
|
1701
|
-
runtime.error?.(danger(`line webhook error: ${
|
|
1670
|
+
runtime.error?.(danger(`line webhook error: ${formatErrorMessage(err)}`));
|
|
1702
1671
|
if (!res.headersSent) {
|
|
1703
1672
|
res.statusCode = 500;
|
|
1704
1673
|
res.setHeader("Content-Type", "application/json");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as sendMessageLine, E as buildTemplateMessageFromPayload, _ as pushLocationMessage, b as pushTemplateMessage, h as pushFlexMessage, i as processLineMessage, u as createQuickReplyItems, v as pushMessageLine, x as pushTextMessageWithQuickReplies, y as pushMessagesLine } from "./markdown-to-line-
|
|
1
|
+
import { C as sendMessageLine, E as buildTemplateMessageFromPayload, _ as pushLocationMessage, b as pushTemplateMessage, h as pushFlexMessage, i as processLineMessage, u as createQuickReplyItems, v as pushMessageLine, x as pushTextMessageWithQuickReplies, y as pushMessagesLine } from "./markdown-to-line-DMDQTMhx.js";
|
|
2
2
|
export { buildTemplateMessageFromPayload, createQuickReplyItems, processLineMessage, pushFlexMessage, pushLocationMessage, pushMessageLine, pushMessagesLine, pushTemplateMessage, pushTextMessageWithQuickReplies, sendMessageLine };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createEventCard, i as createAgendaCard, n as createDeviceControlCard, r as createMediaPlayerCard, t as createAppleTvRemoteCard } from "./flex-templates-
|
|
1
|
+
import { a as createEventCard, i as createAgendaCard, n as createDeviceControlCard, r as createMediaPlayerCard, t as createAppleTvRemoteCard } from "./flex-templates-iKJsyCq-.js";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { DmPolicySchema, GroupPolicySchema, buildChannelConfigSchema, buildGroupEntrySchema, buildMultiAccountChannelSchema, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
|
|
4
4
|
import { requireChannelOpenAllowFrom } from "openclaw/plugin-sdk/extension-shared";
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as resolveLineAccount, n as normalizeAccountId, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-
|
|
1
|
+
import { i as resolveLineAccount, n as normalizeAccountId, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-BqEVsDoB.js";
|
|
2
2
|
import { a as resolveLineGroupConfigEntry, i as resolveExactLineGroupConfigKey, o as resolveLineGroupLookupIds, r as setLineRuntime, s as resolveLineGroupsConfig } from "./quick-reply-fallback-D86FwAfr.js";
|
|
3
|
-
import { i as LineConfigSchema, n as parseLineDirectives, r as LineChannelConfigSchema, t as hasLineDirectives } from "./reply-payload-transform-
|
|
4
|
-
import { _ as postbackAction, a as createEventCard, c as createCarousel, d as createListCard, f as createNotificationBubble, i as createAgendaCard, l as createImageCard, m as messageAction, n as createDeviceControlCard, o as createReceiptCard, p as datetimePickerAction, r as createMediaPlayerCard, s as createActionCard, t as createAppleTvRemoteCard, u as createInfoCard, v as uriAction } from "./flex-templates-
|
|
5
|
-
import { A as createConfirmTemplate, C as sendMessageLine, D as createButtonMenu, E as buildTemplateMessageFromPayload, F as createTemplateCarousel, I as createYesNoConfirm, L as toFlexMessage, M as createImageCarouselColumn, N as createLinkMenu, O as createButtonTemplate, P as createProductCarousel, S as replyMessageLine, T as resolveLineChannelAccessToken, _ as pushLocationMessage, a as stripMarkdown, b as pushTemplateMessage, c as createImageMessage, d as createTextMessageWithQuickReplies, f as createVideoMessage, g as pushImageMessage, h as pushFlexMessage, i as processLineMessage, j as createImageCarousel, k as createCarouselColumn, l as createLocationMessage, m as getUserProfile, n as convertTableToFlexBubble, o as createAudioMessage, p as getUserDisplayName, r as hasMarkdownToConvert, s as createFlexMessage, t as convertCodeBlockToFlexBubble, u as createQuickReplyItems, v as pushMessageLine, w as showLoadingAnimation, x as pushTextMessageWithQuickReplies, y as pushMessagesLine } from "./markdown-to-line-
|
|
6
|
-
import { a as validateLineSignature, c as normalizeAllowFrom, i as parseLineWebhookBody, n as createLineNodeWebhookHandler, o as downloadLineMedia, r as readLineWebhookRequestBody, s as firstDefined, t as monitorLineProvider } from "./monitor-
|
|
3
|
+
import { i as LineConfigSchema, n as parseLineDirectives, r as LineChannelConfigSchema, t as hasLineDirectives } from "./reply-payload-transform-D5-dHB8b.js";
|
|
4
|
+
import { _ as postbackAction, a as createEventCard, c as createCarousel, d as createListCard, f as createNotificationBubble, i as createAgendaCard, l as createImageCard, m as messageAction, n as createDeviceControlCard, o as createReceiptCard, p as datetimePickerAction, r as createMediaPlayerCard, s as createActionCard, t as createAppleTvRemoteCard, u as createInfoCard, v as uriAction } from "./flex-templates-iKJsyCq-.js";
|
|
5
|
+
import { A as createConfirmTemplate, C as sendMessageLine, D as createButtonMenu, E as buildTemplateMessageFromPayload, F as createTemplateCarousel, I as createYesNoConfirm, L as toFlexMessage, M as createImageCarouselColumn, N as createLinkMenu, O as createButtonTemplate, P as createProductCarousel, S as replyMessageLine, T as resolveLineChannelAccessToken, _ as pushLocationMessage, a as stripMarkdown, b as pushTemplateMessage, c as createImageMessage, d as createTextMessageWithQuickReplies, f as createVideoMessage, g as pushImageMessage, h as pushFlexMessage, i as processLineMessage, j as createImageCarousel, k as createCarouselColumn, l as createLocationMessage, m as getUserProfile, n as convertTableToFlexBubble, o as createAudioMessage, p as getUserDisplayName, r as hasMarkdownToConvert, s as createFlexMessage, t as convertCodeBlockToFlexBubble, u as createQuickReplyItems, v as pushMessageLine, w as showLoadingAnimation, x as pushTextMessageWithQuickReplies, y as pushMessagesLine } from "./markdown-to-line-DMDQTMhx.js";
|
|
6
|
+
import { a as validateLineSignature, c as normalizeAllowFrom, i as parseLineWebhookBody, n as createLineNodeWebhookHandler, o as downloadLineMedia, r as readLineWebhookRequestBody, s as firstDefined, t as monitorLineProvider } from "./monitor-DXEodYFJ.js";
|
|
7
7
|
import { t as probeLineBot } from "./probe-CM03wo6r.js";
|
|
8
8
|
import { clearAccountEntryFields } from "openclaw/plugin-sdk/core";
|
|
9
9
|
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
|
|
@@ -11,6 +11,7 @@ import { DEFAULT_ACCOUNT_ID, formatDocsLink, setSetupChannelEnabled, splitSetupE
|
|
|
11
11
|
import { buildComputedAccountStatusSnapshot, buildTokenChannelStatusSummary } from "openclaw/plugin-sdk/status-helpers";
|
|
12
12
|
import { danger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
13
13
|
import { messagingApi } from "@line/bot-sdk";
|
|
14
|
+
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
14
15
|
import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-local-roots";
|
|
15
16
|
import { mimeTypeFromFilePath } from "openclaw/plugin-sdk/media-mime";
|
|
16
17
|
import { loadWebMediaRaw } from "openclaw/plugin-sdk/web-media";
|
|
@@ -59,7 +60,7 @@ function createLineWebhookMiddleware(options) {
|
|
|
59
60
|
}
|
|
60
61
|
res.status(200).json({ status: "ok" });
|
|
61
62
|
} catch (err) {
|
|
62
|
-
runtime?.error?.(danger(`line webhook error: ${
|
|
63
|
+
runtime?.error?.(danger(`line webhook error: ${formatErrorMessage(err)}`));
|
|
63
64
|
if (!res.headersSent) res.status(500).json({ error: "Internal server error" });
|
|
64
65
|
}
|
|
65
66
|
};
|
package/dist/setup-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as lineSetupAdapter, t as lineSetupWizard } from "./setup-surface-
|
|
1
|
+
import { n as lineSetupAdapter, t as lineSetupWizard } from "./setup-surface-DRQ7n0En.js";
|
|
2
2
|
export { lineSetupAdapter, lineSetupWizard };
|