deepseeker-code 1.0.69 → 1.0.70
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/cli.mjs +24 -18
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -3858,7 +3858,7 @@ var init_approval = __esm({
|
|
|
3858
3858
|
// ../core/src/batch/feishu/reconcile.ts
|
|
3859
3859
|
import fs16 from "fs/promises";
|
|
3860
3860
|
import path17 from "path";
|
|
3861
|
-
var cursorPath, FIRST_RUN_WINDOW_MS, loadCursor, saveCursor,
|
|
3861
|
+
var cursorPath, FIRST_RUN_WINDOW_MS, loadCursor, saveCursor, knownChatsPath, legacyP2pChatsPath, readChatsFile, loadKnownChats, recordKnownChat, RECONCILE_MSG, msg5, runReconcile;
|
|
3862
3862
|
var init_reconcile = __esm({
|
|
3863
3863
|
"../core/src/batch/feishu/reconcile.ts"() {
|
|
3864
3864
|
"use strict";
|
|
@@ -3881,23 +3881,29 @@ var init_reconcile = __esm({
|
|
|
3881
3881
|
await fs16.writeFile(tmp, JSON.stringify(value, null, 2), "utf-8");
|
|
3882
3882
|
await fs16.rename(tmp, cursorPath());
|
|
3883
3883
|
};
|
|
3884
|
-
|
|
3885
|
-
|
|
3884
|
+
knownChatsPath = () => path17.join(batchQueueRoot(), "feishu-known-chats.json");
|
|
3885
|
+
legacyP2pChatsPath = () => path17.join(batchQueueRoot(), "feishu-p2p-chats.json");
|
|
3886
|
+
readChatsFile = async (p) => {
|
|
3886
3887
|
try {
|
|
3887
|
-
const raw = JSON.parse(await fs16.readFile(
|
|
3888
|
+
const raw = JSON.parse(await fs16.readFile(p, "utf-8"));
|
|
3888
3889
|
return Array.isArray(raw?.chats) ? raw.chats.filter((x) => typeof x === "string") : [];
|
|
3889
3890
|
} catch {
|
|
3890
3891
|
return [];
|
|
3891
3892
|
}
|
|
3892
3893
|
};
|
|
3893
|
-
|
|
3894
|
-
const
|
|
3894
|
+
loadKnownChats = async () => {
|
|
3895
|
+
const known = await readChatsFile(knownChatsPath());
|
|
3896
|
+
if (known.length > 0) return known;
|
|
3897
|
+
return readChatsFile(legacyP2pChatsPath());
|
|
3898
|
+
};
|
|
3899
|
+
recordKnownChat = async (chatId) => {
|
|
3900
|
+
const chats = await loadKnownChats();
|
|
3895
3901
|
if (chats.includes(chatId)) return false;
|
|
3896
3902
|
const next = { chats: [...chats, chatId], updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
3897
|
-
await fs16.mkdir(path17.dirname(
|
|
3898
|
-
const tmp = `${
|
|
3903
|
+
await fs16.mkdir(path17.dirname(knownChatsPath()), { recursive: true });
|
|
3904
|
+
const tmp = `${knownChatsPath()}.tmp-${process.pid}-${Math.random().toString(36).slice(2, 8)}`;
|
|
3899
3905
|
await fs16.writeFile(tmp, JSON.stringify(next, null, 2), "utf-8");
|
|
3900
|
-
await fs16.rename(tmp,
|
|
3906
|
+
await fs16.rename(tmp, knownChatsPath());
|
|
3901
3907
|
return true;
|
|
3902
3908
|
};
|
|
3903
3909
|
RECONCILE_MSG = {
|
|
@@ -4554,7 +4560,7 @@ var init_listen = __esm({
|
|
|
4554
4560
|
botInfoFail: (e) => `\u26A0\uFE0F \u83B7\u53D6\u673A\u5668\u4EBA open_id \u5931\u8D25\uFF08${e}\uFF09\uFF1AmentionOnlyInGroup=true \u4E0B\u7FA4\u6D88\u606F\u5C06\u5168\u90E8\u62D2\u6536\uFF0C\u8BF7\u68C0\u67E5\u5E94\u7528\u6743\u9650\u6216\u628A mentionOnlyInGroup \u914D\u4E3A false\u3002`,
|
|
4555
4561
|
msgSkip: (why) => `\u23ED\uFE0F [feishu] \u8DF3\u8FC7\u6D88\u606F\uFF1A${why}`,
|
|
4556
4562
|
msgFail: (e) => `\u274C [feishu] \u6D88\u606F\u5904\u7406\u5F02\u5E38\uFF08\u4E0D\u4E2D\u65AD\u76D1\u542C\uFF09\uFF1A${e}`,
|
|
4557
|
-
|
|
4563
|
+
chatLearned: (chatId) => `\u{1F4AC} \u4F1A\u8BDD\u5DF2\u7EB3\u5165\u65AD\u7EBF\u5BF9\u8D26\uFF08${chatId.slice(0, 12)}\u2026\uFF09\uFF1A\u6B64\u540E\u65AD\u7EBF\u7A97\u53E3\u5185\u8BE5\u4F1A\u8BDD\u6F0F\u7968\u53EF\u56DE\u8865`,
|
|
4558
4564
|
cardDenied: (who) => `\u{1F6AB} \u70B9\u5361\u4EBA\u4E0D\u5728 users \u767D\u540D\u5355\uFF0C\u62D2\u7EDD\u5BA1\u6279\uFF1A${who}`,
|
|
4559
4565
|
cardOk: (id, d) => `\u{1F3B4} \u5BA1\u6279\u51B3\u5B9A\u5DF2\u843D\u76D8 [${id.slice(0, 8)}\u2026] ${d}`,
|
|
4560
4566
|
cardFail: (e) => `\u26A0\uFE0F \u5361\u7247\u51B3\u5B9A\u5199\u5165\u5931\u8D25\uFF1A${e}`,
|
|
@@ -4573,7 +4579,7 @@ var init_listen = __esm({
|
|
|
4573
4579
|
botInfoFail: (e) => `\u26A0\uFE0F Failed to fetch bot open_id (${e}): with mentionOnlyInGroup=true all group messages will be rejected \u2014 check app permissions or set mentionOnlyInGroup=false.`,
|
|
4574
4580
|
msgSkip: (why) => `\u23ED\uFE0F [feishu] message skipped: ${why}`,
|
|
4575
4581
|
msgFail: (e) => `\u274C [feishu] message handling error (listener keeps running): ${e}`,
|
|
4576
|
-
|
|
4582
|
+
chatLearned: (chatId) => `\u{1F4AC} chat registered for reconcile backfill (${chatId.slice(0, 12)}\u2026): missed tickets in this chat are now recoverable after reconnects`,
|
|
4577
4583
|
cardDenied: (who) => `\u{1F6AB} clicker not in the users whitelist, approval refused: ${who}`,
|
|
4578
4584
|
cardOk: (id, d) => `\u{1F3B4} approval decision recorded [${id.slice(0, 8)}\u2026] ${d}`,
|
|
4579
4585
|
cardFail: (e) => `\u26A0\uFE0F failed to write the approval decision: ${e}`,
|
|
@@ -4818,8 +4824,8 @@ var init_listen = __esm({
|
|
|
4818
4824
|
log(msg6(locale2, "alreadyRunning", lock.holderPid));
|
|
4819
4825
|
return { code: 1 };
|
|
4820
4826
|
}
|
|
4821
|
-
const
|
|
4822
|
-
for (const c of await
|
|
4827
|
+
const learnedChats = /* @__PURE__ */ new Set();
|
|
4828
|
+
for (const c of await loadKnownChats()) learnedChats.add(c);
|
|
4823
4829
|
const handleDeps = {
|
|
4824
4830
|
botOpenId,
|
|
4825
4831
|
download: deps?.download ?? makeSdkDownload(client),
|
|
@@ -4839,11 +4845,11 @@ var init_listen = __esm({
|
|
|
4839
4845
|
log(msg6(locale2, "msgSkip", `\u7C7B\u578B\u4E0D\u652F\u6301\u6216\u5F62\u6001\u5F02\u5E38\uFF08${type}\uFF09`));
|
|
4840
4846
|
return;
|
|
4841
4847
|
}
|
|
4842
|
-
if (candidate.
|
|
4843
|
-
const learned = await
|
|
4848
|
+
if (candidate.chatId && fcfg.users.includes(candidate.senderOpenId)) {
|
|
4849
|
+
const learned = await recordKnownChat(candidate.chatId).catch(() => false);
|
|
4844
4850
|
if (learned) {
|
|
4845
|
-
|
|
4846
|
-
log(msg6(locale2, "
|
|
4851
|
+
learnedChats.add(candidate.chatId);
|
|
4852
|
+
log(msg6(locale2, "chatLearned", candidate.chatId));
|
|
4847
4853
|
}
|
|
4848
4854
|
}
|
|
4849
4855
|
const r = await handleFeishuMessage(candidate, fcfg, handleDeps);
|
|
@@ -4887,7 +4893,7 @@ var init_listen = __esm({
|
|
|
4887
4893
|
process.once("SIGTERM", () => onSignal("SIGTERM"));
|
|
4888
4894
|
}
|
|
4889
4895
|
const reconcileLoop = async () => {
|
|
4890
|
-
const pull = makeSdkPull(client, fcfg, log, locale2, () => [...
|
|
4896
|
+
const pull = makeSdkPull(client, fcfg, log, locale2, () => [...learnedChats]);
|
|
4891
4897
|
let first = true;
|
|
4892
4898
|
for (; ; ) {
|
|
4893
4899
|
if (!first) await sleepInterruptible(reconcileMs);
|