@openclaw/feishu 2026.5.12 → 2026.5.14-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +5 -5
- package/dist/{channel-COlXCApz.js → channel-1pldyM9r.js} +369 -18
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-Bt1Lk06Y.js → channel.runtime-BlJ_XJTS.js} +5 -6
- package/dist/contract-api.js +3 -3
- package/dist/{drive-BocW3yO6.js → drive-Av1h_Lwd.js} +1 -1
- package/dist/{monitor-BZgAq8ET.js → monitor-Dfy3D2pM.js} +2 -2
- package/dist/{monitor.account-CI4_rDnC.js → monitor.account-CT3Skl8y.js} +62 -36
- package/dist/{monitor.state-D1WkvOGG.js → monitor.state-D6ByOM5W.js} +1 -1
- package/dist/{probe-BNzzU_uR.js → probe-DpPNslkb.js} +1 -1
- package/dist/runtime-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/{security-audit-DqJdocrN.js → security-audit-BzTLFO6g.js} +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/{send-DiFpqzBJ.js → send-DsCQVFOE.js} +37 -37
- package/dist/session-key-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/package.json +5 -5
- package/dist/directory.static-DqfUoZrD.js +0 -44
- package/dist/policy-iDTxfTYv.js +0 -181
- package/dist/send-result-zZZOR3qT.js +0 -140
- /package/dist/{app-registration-BNC02wLI.js → app-registration-BVQ8zzYj.js} +0 -0
- /package/dist/{audio-preflight.runtime-BPlzkO3l.js → audio-preflight.runtime-qKoiXN6J.js} +0 -0
- /package/dist/{client-DBVoQL5w.js → client-B18oTGHf.js} +0 -0
- /package/dist/{runtime-CG0DuRCy.js → runtime-Cc16UY23.js} +0 -0
- /package/dist/{secret-contract-Dm4Z_zQN.js → secret-contract-DIpADEx7.js} +0 -0
- /package/dist/{security-audit-shared-ByuMx9cJ.js → security-audit-shared-B6kEakHj.js} +0 -0
- /package/dist/{session-conversation-BulT2OKc.js → session-conversation-DIuxgPQi.js} +0 -0
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { f as isRecord } from "./accounts-CP4tDW-z.js";
|
|
2
|
-
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-message";
|
|
3
|
-
//#region extensions/feishu/src/card-interaction.ts
|
|
4
|
-
const FEISHU_CARD_INTERACTION_VERSION = "ocf1";
|
|
5
|
-
function isInteractionKind(value) {
|
|
6
|
-
return value === "button" || value === "quick" || value === "meta";
|
|
7
|
-
}
|
|
8
|
-
function isMetadataValue(value) {
|
|
9
|
-
return value === null || value === void 0 || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
10
|
-
}
|
|
11
|
-
function createFeishuCardInteractionEnvelope(envelope) {
|
|
12
|
-
return {
|
|
13
|
-
oc: FEISHU_CARD_INTERACTION_VERSION,
|
|
14
|
-
...envelope
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
function buildFeishuCardActionTextFallback(event) {
|
|
18
|
-
const actionValue = event.action.value;
|
|
19
|
-
if (isRecord(actionValue)) {
|
|
20
|
-
if (typeof actionValue.text === "string") return actionValue.text;
|
|
21
|
-
if (typeof actionValue.command === "string") return actionValue.command;
|
|
22
|
-
return JSON.stringify(actionValue);
|
|
23
|
-
}
|
|
24
|
-
return String(actionValue);
|
|
25
|
-
}
|
|
26
|
-
function decodeFeishuCardAction(params) {
|
|
27
|
-
const { event, now = Date.now() } = params;
|
|
28
|
-
const actionValue = event.action.value;
|
|
29
|
-
if (!isRecord(actionValue) || actionValue.oc !== "ocf1") return {
|
|
30
|
-
kind: "legacy",
|
|
31
|
-
text: buildFeishuCardActionTextFallback(event)
|
|
32
|
-
};
|
|
33
|
-
if (!isInteractionKind(actionValue.k) || typeof actionValue.a !== "string" || !actionValue.a) return {
|
|
34
|
-
kind: "invalid",
|
|
35
|
-
reason: "malformed"
|
|
36
|
-
};
|
|
37
|
-
if (actionValue.q !== void 0 && typeof actionValue.q !== "string") return {
|
|
38
|
-
kind: "invalid",
|
|
39
|
-
reason: "malformed"
|
|
40
|
-
};
|
|
41
|
-
if (actionValue.m !== void 0) {
|
|
42
|
-
if (!isRecord(actionValue.m)) return {
|
|
43
|
-
kind: "invalid",
|
|
44
|
-
reason: "malformed"
|
|
45
|
-
};
|
|
46
|
-
for (const value of Object.values(actionValue.m)) if (!isMetadataValue(value)) return {
|
|
47
|
-
kind: "invalid",
|
|
48
|
-
reason: "malformed"
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
if (actionValue.c !== void 0) {
|
|
52
|
-
if (!isRecord(actionValue.c)) return {
|
|
53
|
-
kind: "invalid",
|
|
54
|
-
reason: "malformed"
|
|
55
|
-
};
|
|
56
|
-
if (actionValue.c.u !== void 0 && typeof actionValue.c.u !== "string") return {
|
|
57
|
-
kind: "invalid",
|
|
58
|
-
reason: "malformed"
|
|
59
|
-
};
|
|
60
|
-
if (actionValue.c.h !== void 0 && typeof actionValue.c.h !== "string") return {
|
|
61
|
-
kind: "invalid",
|
|
62
|
-
reason: "malformed"
|
|
63
|
-
};
|
|
64
|
-
if (actionValue.c.s !== void 0 && typeof actionValue.c.s !== "string") return {
|
|
65
|
-
kind: "invalid",
|
|
66
|
-
reason: "malformed"
|
|
67
|
-
};
|
|
68
|
-
if (actionValue.c.e !== void 0 && !Number.isFinite(actionValue.c.e)) return {
|
|
69
|
-
kind: "invalid",
|
|
70
|
-
reason: "malformed"
|
|
71
|
-
};
|
|
72
|
-
if (actionValue.c.t !== void 0 && actionValue.c.t !== "p2p" && actionValue.c.t !== "group") return {
|
|
73
|
-
kind: "invalid",
|
|
74
|
-
reason: "malformed"
|
|
75
|
-
};
|
|
76
|
-
if (typeof actionValue.c.e === "number" && actionValue.c.e < now) return {
|
|
77
|
-
kind: "invalid",
|
|
78
|
-
reason: "stale"
|
|
79
|
-
};
|
|
80
|
-
const expectedUser = actionValue.c.u?.trim();
|
|
81
|
-
if (expectedUser && expectedUser !== (event.operator.open_id ?? "").trim()) return {
|
|
82
|
-
kind: "invalid",
|
|
83
|
-
reason: "wrong_user"
|
|
84
|
-
};
|
|
85
|
-
const expectedChat = actionValue.c.h?.trim();
|
|
86
|
-
if (expectedChat && expectedChat !== (event.context.chat_id ?? "").trim()) return {
|
|
87
|
-
kind: "invalid",
|
|
88
|
-
reason: "wrong_conversation"
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
return {
|
|
92
|
-
kind: "structured",
|
|
93
|
-
envelope: actionValue
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region extensions/feishu/src/send-result.ts
|
|
98
|
-
function resolveFeishuReceiptKind(msgType) {
|
|
99
|
-
switch (msgType) {
|
|
100
|
-
case "audio": return "voice";
|
|
101
|
-
case "image":
|
|
102
|
-
case "media":
|
|
103
|
-
case "file": return "media";
|
|
104
|
-
case "interactive": return "card";
|
|
105
|
-
case "post":
|
|
106
|
-
case "text": return "text";
|
|
107
|
-
default: return "unknown";
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function createFeishuSendReceipt(params) {
|
|
111
|
-
const messageId = params.messageId?.trim();
|
|
112
|
-
const chatId = params.chatId.trim();
|
|
113
|
-
return createMessageReceiptFromOutboundResults({
|
|
114
|
-
results: messageId ? [{
|
|
115
|
-
channel: "feishu",
|
|
116
|
-
messageId,
|
|
117
|
-
chatId,
|
|
118
|
-
conversationId: chatId
|
|
119
|
-
}] : [],
|
|
120
|
-
...chatId ? { threadId: chatId } : {},
|
|
121
|
-
kind: params.kind ?? "unknown"
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
function assertFeishuMessageApiSuccess(response, errorPrefix) {
|
|
125
|
-
if (response.code !== 0) throw new Error(`${errorPrefix}: ${response.msg || `code ${response.code}`}`);
|
|
126
|
-
}
|
|
127
|
-
function toFeishuSendResult(response, chatId, kind) {
|
|
128
|
-
const messageId = response.data?.message_id ?? "unknown";
|
|
129
|
-
return {
|
|
130
|
-
messageId,
|
|
131
|
-
chatId,
|
|
132
|
-
receipt: createFeishuSendReceipt({
|
|
133
|
-
messageId,
|
|
134
|
-
chatId,
|
|
135
|
-
kind
|
|
136
|
-
})
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
//#endregion
|
|
140
|
-
export { FEISHU_CARD_INTERACTION_VERSION as a, decodeFeishuCardAction as c, toFeishuSendResult as i, createFeishuSendReceipt as n, buildFeishuCardActionTextFallback as o, resolveFeishuReceiptKind as r, createFeishuCardInteractionEnvelope as s, assertFeishuMessageApiSuccess as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|