feishu-user-plugin 1.3.1 → 1.3.3
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/.claude-plugin/plugin.json +2 -2
- package/CHANGELOG.md +16 -0
- package/README.md +5 -4
- package/package.json +2 -2
- package/proto/lark.proto +27 -0
- package/skills/feishu-user-plugin/SKILL.md +3 -3
- package/skills/feishu-user-plugin/references/CLAUDE.md +50 -15
- package/src/client.js +85 -14
- package/src/index.js +104 -42
- package/src/official.js +340 -166
- package/src/utils.js +13 -0
package/src/utils.js
CHANGED
|
@@ -31,9 +31,22 @@ function formatCookie(cookieObj) {
|
|
|
31
31
|
.join('; ');
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
// Wraps global fetch with an AbortController-based timeout. A stalled network
|
|
35
|
+
// connection to feishu.cn can otherwise block an MCP tool handler indefinitely,
|
|
36
|
+
// causing the client to time out and (in some clients) tear down the stdio
|
|
37
|
+
// transport — observed as "MCP 中途掉线" by v1.3.2 users.
|
|
38
|
+
// Default 30s; pass `timeoutMs` in init to override per-call.
|
|
39
|
+
function fetchWithTimeout(url, init = {}) {
|
|
40
|
+
const { timeoutMs = 30000, ...rest } = init;
|
|
41
|
+
const controller = new AbortController();
|
|
42
|
+
const timer = setTimeout(() => controller.abort(new Error(`fetch timeout after ${timeoutMs}ms: ${url}`)), timeoutMs);
|
|
43
|
+
return fetch(url, { ...rest, signal: rest.signal || controller.signal }).finally(() => clearTimeout(timer));
|
|
44
|
+
}
|
|
45
|
+
|
|
34
46
|
module.exports = {
|
|
35
47
|
generateRequestId,
|
|
36
48
|
generateCid,
|
|
37
49
|
parseCookie,
|
|
38
50
|
formatCookie,
|
|
51
|
+
fetchWithTimeout,
|
|
39
52
|
};
|