@openclaw/feishu 2026.9.1-beta.1 → 2026.9.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/api.js +211 -275
- package/dist/{app-registration-BpfUzS9m.js → app-registration-BI99e_JI.js} +12 -9
- package/dist/{channel-Dpgf8wLD.js → channel-DSYCNah8.js} +239 -580
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-BIEERwaT.js → channel.runtime-EfDl2Q8q.js} +14 -18
- package/dist/{chat-C1nuW5UY.js → chat-CxXaPTuO.js} +13 -13
- package/dist/{client-DalLmpMf.js → client-DMbIL3UH.js} +3 -6
- package/dist/contract-api.js +2 -2
- package/dist/doctor-contract-CQAuBotF.js +465 -0
- package/dist/doctor-contract-api.js +1 -1
- package/dist/index.js +11 -42
- package/dist/{json-response-CheljwGr.js → json-response-DXajw_FU.js} +1 -1
- package/dist/{monitor.startup-D-gL82OO.js → monitor-DoMmOfaD.js} +62 -2
- package/dist/{monitor.account-DhhotI_Q.js → monitor.account-WFdlCDhR.js} +261 -293
- package/dist/{probe-CfhhR_0a.js → probe-D_SatdZl.js} +3 -3
- package/dist/{presentation-card-C8Z7Tgru.js → reply-delivery-result-CEFTDA3f.js} +333 -239
- package/dist/{security-audit-D6Fz2h6p.js → security-audit-DKfR4Cv3.js} +1 -1
- package/dist/{security-audit-shared-BgpY7AiJ.js → security-audit-shared-CK5rVR-1.js} +2 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/dist/{subagent-hooks-KUi-7vUy.js → subagent-hooks-Buadpie_.js} +3 -6
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{targets-BUjQ1TcA.js → targets-BTQCYRZQ.js} +4 -4
- package/dist/{thread-bindings-CptM_YU6.js → thread-bindings-BiL1wGqK.js} +20 -9
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/ws/package.json +1 -1
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +43 -236
- package/package.json +6 -5
- package/dist/doctor-contract-bEQXIXyP.js +0 -158
- package/dist/monitor-BRg3sHH7.js +0 -62
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { asObjectRecord, defineChannelAliasMigration, defineKeyMoveMigration, hasLegacyAccountStreamingAliases, normalizeChannelConfigEntries } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
2
|
-
//#region extensions/feishu/src/webhook-path.ts
|
|
3
|
-
const DEFAULT_FEISHU_WEBHOOK_PATH = "/feishu/events";
|
|
4
|
-
/** Normalize trusted configuration only; incoming request targets must remain unmodified. */
|
|
5
|
-
function normalizeFeishuWebhookPath(value) {
|
|
6
|
-
const configured = value?.trim();
|
|
7
|
-
if (!configured) return DEFAULT_FEISHU_WEBHOOK_PATH;
|
|
8
|
-
try {
|
|
9
|
-
const parsed = new URL(configured, "http://localhost");
|
|
10
|
-
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return null;
|
|
11
|
-
const emptyQuery = !parsed.search && parsed.href.endsWith("?") && !configured.includes("#") ? "?" : "";
|
|
12
|
-
return `${parsed.pathname}${parsed.search}${emptyQuery}`;
|
|
13
|
-
} catch {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region extensions/feishu/src/doctor-contract.ts
|
|
19
|
-
const streamingAliasMigration = defineChannelAliasMigration({
|
|
20
|
-
channelId: "feishu",
|
|
21
|
-
streaming: { defaultMode: "partial" },
|
|
22
|
-
accountStreamingReplacesRoot: true
|
|
23
|
-
});
|
|
24
|
-
const LEGACY_COALESCE_FIELDS = [
|
|
25
|
-
"enabled",
|
|
26
|
-
"minDelayMs",
|
|
27
|
-
"maxDelayMs"
|
|
28
|
-
];
|
|
29
|
-
const LEGACY_HEARTBEAT_FIELDS = ["visibility", "intervalMs"];
|
|
30
|
-
const toolsBaseMigration = defineKeyMoveMigration({
|
|
31
|
-
from: ["tools", "base"],
|
|
32
|
-
to: ["tools", "bitable"],
|
|
33
|
-
match: (value) => typeof value === "boolean",
|
|
34
|
-
sourceOwn: false
|
|
35
|
-
});
|
|
36
|
-
function sanitizeLegacyHeartbeatFields(params) {
|
|
37
|
-
const heartbeat = asObjectRecord(params.entry.heartbeat);
|
|
38
|
-
if (!heartbeat || Object.keys(heartbeat).length > 0 && !LEGACY_HEARTBEAT_FIELDS.some((field) => Object.hasOwn(heartbeat, field))) return {
|
|
39
|
-
entry: params.entry,
|
|
40
|
-
changed: false
|
|
41
|
-
};
|
|
42
|
-
const next = { ...params.entry };
|
|
43
|
-
delete next.heartbeat;
|
|
44
|
-
params.changes.push(`Removed ${params.pathPrefix}.heartbeat (legacy Feishu fields were never read by runtime).`);
|
|
45
|
-
return {
|
|
46
|
-
entry: next,
|
|
47
|
-
changed: true
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function sanitizeLegacyCoalesceFields(params) {
|
|
51
|
-
const streaming = asObjectRecord(params.entry.streaming);
|
|
52
|
-
const block = asObjectRecord(streaming?.block);
|
|
53
|
-
const coalesce = asObjectRecord(block?.coalesce);
|
|
54
|
-
if (!streaming || !block || !coalesce) return {
|
|
55
|
-
entry: params.entry,
|
|
56
|
-
changed: false
|
|
57
|
-
};
|
|
58
|
-
const removed = LEGACY_COALESCE_FIELDS.filter((field) => coalesce[field] !== void 0);
|
|
59
|
-
if (removed.length === 0) return {
|
|
60
|
-
entry: params.entry,
|
|
61
|
-
changed: false
|
|
62
|
-
};
|
|
63
|
-
const nextCoalesce = { ...coalesce };
|
|
64
|
-
for (const field of removed) delete nextCoalesce[field];
|
|
65
|
-
params.changes.push(`Removed ${params.pathPrefix}.streaming.block.coalesce.{${removed.join(",")}} (legacy Feishu-only fields; block delivery reads minChars/maxChars/idleMs).`);
|
|
66
|
-
return {
|
|
67
|
-
entry: {
|
|
68
|
-
...params.entry,
|
|
69
|
-
streaming: {
|
|
70
|
-
...streaming,
|
|
71
|
-
block: {
|
|
72
|
-
...block,
|
|
73
|
-
coalesce: nextCoalesce
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
changed: true
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function hasLegacyWebhookPath(value) {
|
|
81
|
-
const path = asObjectRecord(value)?.webhookPath;
|
|
82
|
-
return typeof path === "string" && normalizeFeishuWebhookPath(path) !== path;
|
|
83
|
-
}
|
|
84
|
-
function normalizeLegacyWebhookPath(params) {
|
|
85
|
-
const path = params.entry.webhookPath;
|
|
86
|
-
if (typeof path !== "string") return {
|
|
87
|
-
entry: params.entry,
|
|
88
|
-
changed: false
|
|
89
|
-
};
|
|
90
|
-
const normalized = normalizeFeishuWebhookPath(path);
|
|
91
|
-
const canonical = normalized ?? "/feishu/events";
|
|
92
|
-
if (canonical === path) return {
|
|
93
|
-
entry: params.entry,
|
|
94
|
-
changed: false
|
|
95
|
-
};
|
|
96
|
-
params.changes.push(normalized === null ? `Reset invalid ${params.pathPrefix}.webhookPath to ${DEFAULT_FEISHU_WEBHOOK_PATH}.` : `Normalized ${params.pathPrefix}.webhookPath to its HTTP request path.`);
|
|
97
|
-
return {
|
|
98
|
-
entry: {
|
|
99
|
-
...params.entry,
|
|
100
|
-
webhookPath: canonical
|
|
101
|
-
},
|
|
102
|
-
changed: true
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
function normalizeFeishuLegacyConfigEntries(cfg, changes) {
|
|
106
|
-
return normalizeChannelConfigEntries({
|
|
107
|
-
cfg,
|
|
108
|
-
channelId: "feishu",
|
|
109
|
-
changes,
|
|
110
|
-
normalizeEntry: (params) => {
|
|
111
|
-
const tools = toolsBaseMigration.normalize(params);
|
|
112
|
-
const coalesce = sanitizeLegacyCoalesceFields({
|
|
113
|
-
...params,
|
|
114
|
-
entry: tools.entry
|
|
115
|
-
});
|
|
116
|
-
const heartbeat = sanitizeLegacyHeartbeatFields({
|
|
117
|
-
...params,
|
|
118
|
-
entry: coalesce.entry
|
|
119
|
-
});
|
|
120
|
-
const webhook = normalizeLegacyWebhookPath({
|
|
121
|
-
...params,
|
|
122
|
-
entry: heartbeat.entry
|
|
123
|
-
});
|
|
124
|
-
return {
|
|
125
|
-
entry: webhook.entry,
|
|
126
|
-
changed: tools.changed || coalesce.changed || heartbeat.changed || webhook.changed
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
}).config;
|
|
130
|
-
}
|
|
131
|
-
const legacyConfigRules = [
|
|
132
|
-
...streamingAliasMigration.legacyConfigRules,
|
|
133
|
-
{
|
|
134
|
-
path: ["channels", "feishu"],
|
|
135
|
-
message: "channels.feishu[.accounts.<id>].webhookPath must be a canonical HTTP request path; run \"openclaw doctor --fix\".",
|
|
136
|
-
match: (value) => {
|
|
137
|
-
const entry = asObjectRecord(value);
|
|
138
|
-
return hasLegacyWebhookPath(entry) || hasLegacyAccountStreamingAliases(entry?.accounts, hasLegacyWebhookPath);
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
path: ["channels", "feishu"],
|
|
143
|
-
message: "channels.feishu[.accounts.<id>].tools.base is legacy; use tools.bitable. Run \"openclaw doctor --fix\".",
|
|
144
|
-
match: (value) => {
|
|
145
|
-
const entry = asObjectRecord(value);
|
|
146
|
-
return toolsBaseMigration.hasLegacy(entry) || hasLegacyAccountStreamingAliases(entry?.accounts, toolsBaseMigration.hasLegacy);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
];
|
|
150
|
-
function normalizeCompatibilityConfig({ cfg }) {
|
|
151
|
-
const aliases = streamingAliasMigration.normalizeChannelConfig({ cfg });
|
|
152
|
-
return {
|
|
153
|
-
config: normalizeFeishuLegacyConfigEntries(aliases.config, aliases.changes),
|
|
154
|
-
changes: aliases.changes
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
//#endregion
|
|
158
|
-
export { normalizeFeishuWebhookPath as i, normalizeCompatibilityConfig as n, DEFAULT_FEISHU_WEBHOOK_PATH as r, legacyConfigRules as t };
|
package/dist/monitor-BRg3sHH7.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-RwSyseKr.js";
|
|
2
|
-
import { t as fetchBotIdentityForMonitor } from "./monitor.startup-D-gL82OO.js";
|
|
3
|
-
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
4
|
-
//#region extensions/feishu/src/monitor.ts
|
|
5
|
-
const loadMonitorAccountRuntime = createLazyRuntimeModule(() => import("./monitor.account-DhhotI_Q.js"));
|
|
6
|
-
async function monitorFeishuProvider(opts = {}) {
|
|
7
|
-
const cfg = opts.config;
|
|
8
|
-
if (!cfg) throw new Error("Config is required for Feishu monitor");
|
|
9
|
-
const log = opts.runtime?.log ?? console.log;
|
|
10
|
-
if (opts.accountId) {
|
|
11
|
-
const account = resolveFeishuRuntimeAccount({
|
|
12
|
-
cfg,
|
|
13
|
-
accountId: opts.accountId
|
|
14
|
-
}, { requireEventSecrets: true });
|
|
15
|
-
if (!account.enabled || !account.configured) throw new Error(`Feishu account "${opts.accountId}" not configured or disabled`);
|
|
16
|
-
const { monitorSingleAccount } = await loadMonitorAccountRuntime();
|
|
17
|
-
return monitorSingleAccount({
|
|
18
|
-
cfg,
|
|
19
|
-
account,
|
|
20
|
-
channelRuntime: opts.channelRuntime,
|
|
21
|
-
runtime: opts.runtime,
|
|
22
|
-
abortSignal: opts.abortSignal,
|
|
23
|
-
...opts.statusSink ? { statusSink: opts.statusSink } : {}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
const accounts = listEnabledFeishuAccounts(cfg);
|
|
27
|
-
if (accounts.length === 0) throw new Error("No enabled Feishu accounts configured");
|
|
28
|
-
log(`feishu: starting ${accounts.length} account(s): ${accounts.map((a) => a.accountId).join(", ")}`);
|
|
29
|
-
const { monitorSingleAccount } = await loadMonitorAccountRuntime();
|
|
30
|
-
const monitorPromises = [];
|
|
31
|
-
for (const account of accounts) {
|
|
32
|
-
if (opts.abortSignal?.aborted) {
|
|
33
|
-
log("feishu: abort signal received during startup preflight; stopping startup");
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
const { botOpenId, botName, source } = await fetchBotIdentityForMonitor(account, {
|
|
37
|
-
runtime: opts.runtime,
|
|
38
|
-
abortSignal: opts.abortSignal
|
|
39
|
-
});
|
|
40
|
-
if (opts.abortSignal?.aborted) {
|
|
41
|
-
log("feishu: abort signal received during startup preflight; stopping startup");
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
monitorPromises.push(monitorSingleAccount({
|
|
45
|
-
cfg,
|
|
46
|
-
account,
|
|
47
|
-
channelRuntime: opts.channelRuntime,
|
|
48
|
-
runtime: opts.runtime,
|
|
49
|
-
abortSignal: opts.abortSignal,
|
|
50
|
-
botOpenIdSource: {
|
|
51
|
-
kind: "prefetched",
|
|
52
|
-
botOpenId,
|
|
53
|
-
botName,
|
|
54
|
-
source
|
|
55
|
-
},
|
|
56
|
-
...opts.statusSink ? { statusSink: opts.statusSink } : {}
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
await Promise.all(monitorPromises);
|
|
60
|
-
}
|
|
61
|
-
//#endregion
|
|
62
|
-
export { monitorFeishuProvider };
|