wechat-clawbot 1.2.0 → 1.3.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/README.md +26 -13
- package/README.zh.md +26 -13
- package/assets/icon.svg +7 -0
- package/cordis.patch.yml +4 -0
- package/lib/backlog.d.ts +14 -0
- package/lib/backlog.d.ts.map +1 -1
- package/lib/backlog.js +65 -4
- package/lib/backlog.js.map +1 -1
- package/lib/bridge.d.ts +6 -3
- package/lib/bridge.d.ts.map +1 -1
- package/lib/bridge.js +44 -11
- package/lib/bridge.js.map +1 -1
- package/lib/claude-peer.js +11 -11
- package/lib/claude-peer.js.map +1 -1
- package/lib/client.js +461 -85
- package/lib/codex-rpc.js +1 -1
- package/lib/config.d.ts +30 -7
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +17 -3
- package/lib/config.js.map +1 -1
- package/lib/idle-compact.d.ts +5 -0
- package/lib/idle-compact.d.ts.map +1 -1
- package/lib/idle-compact.js +10 -8
- package/lib/idle-compact.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +78 -28
- package/lib/index.js.map +1 -1
- package/lib/localtime.d.ts +4 -3
- package/lib/localtime.d.ts.map +1 -1
- package/lib/localtime.js +7 -6
- package/lib/localtime.js.map +1 -1
- package/lib/mac-alarms.d.ts +168 -0
- package/lib/mac-alarms.d.ts.map +1 -0
- package/lib/mac-alarms.js +612 -0
- package/lib/mac-alarms.js.map +1 -0
- package/lib/mac-calendar.d.ts +126 -11
- package/lib/mac-calendar.d.ts.map +1 -1
- package/lib/mac-calendar.js +418 -99
- package/lib/mac-calendar.js.map +1 -1
- package/lib/mcp-route.d.ts.map +1 -1
- package/lib/mcp-route.js +8 -2
- package/lib/mcp-route.js.map +1 -1
- package/lib/mcp-server.js +1 -1
- package/lib/memory-auto.js +4 -4
- package/lib/memory-auto.js.map +1 -1
- package/lib/models-route.d.ts +1 -1
- package/lib/pending.d.ts +9 -1
- package/lib/pending.d.ts.map +1 -1
- package/lib/pending.js +18 -1
- package/lib/pending.js.map +1 -1
- package/lib/permissions.d.ts +164 -0
- package/lib/permissions.d.ts.map +1 -0
- package/lib/permissions.js +549 -0
- package/lib/permissions.js.map +1 -0
- package/lib/prompt.d.ts.map +1 -1
- package/lib/prompt.js +12 -11
- package/lib/prompt.js.map +1 -1
- package/lib/secretary.d.ts +42 -9
- package/lib/secretary.d.ts.map +1 -1
- package/lib/secretary.js +142 -36
- package/lib/secretary.js.map +1 -1
- package/lib/time-context.d.ts +57 -0
- package/lib/time-context.d.ts.map +1 -0
- package/lib/time-context.js +90 -0
- package/lib/time-context.js.map +1 -0
- package/lib/tool.js +1 -1
- package/lib/typing.d.ts +0 -1
- package/lib/typing.d.ts.map +1 -1
- package/lib/typing.js +7 -1
- package/lib/typing.js.map +1 -1
- package/native/macos-calendar/main.swift +476 -13
- package/package.json +7 -6
- package/wechat-clawbot-INSTALL.md +64 -40
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ English | [中文](README.zh.md)
|
|
|
5
5
|
Chat with the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) agent on your computer from WeChat.
|
|
6
6
|
Clawbot is a DSH plugin and fully open source. It replies with the AI you use in DSH and does not upload your information.
|
|
7
7
|
Away from your desk, you can still ask it to look through files, edit documents or run commands, and the results come back to the WeChat chat.
|
|
8
|
-
It can also plan your days from the system calendar
|
|
8
|
+
It can also plan your days from the system calendar, create events for you, and set alarms that ring on your phone (macOS only).
|
|
9
9
|
|
|
10
10
|
It uses WeChat's official **微信ClawBot** channel: just scan a QR code to log in.
|
|
11
11
|
|
|
@@ -22,17 +22,25 @@ After nearly two months of development and real-world use, `wechat-clawbot` has
|
|
|
22
22
|
- **Asks before it acts**: anything that needs your approval (e.g. touching files outside its working directory) is asked in WeChat; reply `同意` / `拒绝` (or `yes` / `no`)
|
|
23
23
|
- **Understands quotes**: reply to an older message with WeChat's quote feature and it knows which one you mean
|
|
24
24
|
- **Long chats stay quick**: when the conversation gets long, it tidies older messages into a summary during a quiet spell after a reply, so your next message never waits for it
|
|
25
|
-
- **
|
|
25
|
+
- **All-day secretary (macOS only, off until you turn it on)**: plans your days and creates events from the Mac's calendar, and sets alarms that really ring. It plans by default rules you can rewrite, and you set up any daily routine in chat.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## All-day secretary: plan your days and set alarms from WeChat (new; macOS only, off until you turn it on)
|
|
28
28
|
|
|
29
29
|
- **Sees your whole schedule**: reads every account in the Mac Calendar app (iCloud, Google, Exchange, subscribed calendars), notes included. Ask "am I free tomorrow afternoon?" and it checks the calendar before answering.
|
|
30
30
|
- **Plans straight into your calendar**: tell it "the report is due Thursday and I still have two papers to read". It finds free time, puts the work into **a dedicated calendar you name yourself**, and replies in a few lines: what happens when, what got moved, where things clash. The calendar is created in iCloud when you have it, so the events show up on your phone too, and it still reminds you on WeChat when it's time.
|
|
31
|
-
- **
|
|
31
|
+
- **Free hand only in its own calendar**: it adds, changes and deletes events in the dedicated calendar by itself. For anything in your other calendars it asks you on WeChat first and waits for a yes, unless you switch off **改别的日历前先问我** in the settings (it still asks first about a change that would notify other attendees).
|
|
32
32
|
- **Reminders stay reminders**: a plain "remind me to…" becomes a WeChat reminder and stays out of the calendar. Only things that take up time go into the calendar.
|
|
33
|
-
- **
|
|
33
|
+
- **Alarms that really ring**: "wake me at 6:30 tomorrow", "set an alarm for my flight". The bot sets an urgent reminder in its own Reminders list, and when the time comes your iPhone rings like an alarm clock, even if it is silenced or a Focus is on. It doesn't go through WeChat, so it rings even when WeChat won't let the bot message you. See [Requirements](#requirements) for the Mac and phone it needs.
|
|
34
|
+
- **Routines you set up in chat**: for example "every evening at 9, look at tomorrow's calendar and wake me an hour and a half before my first event, none at weekends". The bot creates a daily task and carries it out by your rules, without bothering you when there is nothing to say. To change the rules, just tell it. The Mac has to be awake, with DSH running, at that time: a task it sleeps through runs when it wakes, and alarm times that have passed by then are skipped.
|
|
35
|
+
- **Your rules**: how it plans and sets alarms is written in the `## 全天候秘书` section of your long-term memory file, `memory.md`. Edit it however you like: the **打开 memory.md** button in the settings opens it.
|
|
36
|
+
|
|
37
|
+
This feature is **macOS only** and **off by default**. To turn it on:
|
|
38
|
+
|
|
39
|
+
1. In the DSH web UI, open Plugins → wechat-clawbot → 微信 Bot → **全天候秘书**: type a name for the dedicated calendar and switch it on.
|
|
40
|
+
2. On the Mac, click "Allow" for Calendars and for Reminders (if nothing pops up, press **一键授权**, one-click authorization; below macOS 26.2 there are no alarms, so only Calendars is asked).
|
|
41
|
+
3. Once, on the iPhone: in Reminders, mark any reminder as urgent by hand and allow the prompt that appears, and check that Find My uses this iPhone as your location. Without this, alarms don't ring.
|
|
42
|
+
4. Press **测试闹钟** (test alarm) and listen for your phone about two minutes later.
|
|
34
43
|
|
|
35
|
-
This feature is **macOS only** and **off by default**. To turn it on: in the DSH web UI, open Plugins → wechat-clawbot → 微信 Bot. Under **Mac 日历**, type a name for the dedicated calendar, switch it on, and click "Allow" once on the Mac when it asks for calendar access. Then switch on **日程秘书**.
|
|
36
44
|
The first time, the plugin compiles a small background app, `Clawbot-Calendar`, on your Mac. This needs the Xcode command line tools (`xcode-select --install` if you don't have them).
|
|
37
45
|
|
|
38
46
|
## Cost
|
|
@@ -41,10 +49,13 @@ The first time, the plugin compiles a small background app, `Clawbot-Calendar`,
|
|
|
41
49
|
|
|
42
50
|
## Requirements
|
|
43
51
|
|
|
44
|
-
- DSH **0.1.7 – 0.2.
|
|
52
|
+
- DSH **0.1.7 – 0.2.1** (tested on 0.1.7-rc.2, 0.2.0-rc.2 and 0.2.1-rc.2), Node.js 22+ and pnpm
|
|
45
53
|
- The official **微信ClawBot** plugin in the WeChat mobile app (WeChat → Settings → Plugins; the first scan may ask you to update WeChat)
|
|
46
54
|
- A computer that stays on: the bot is online while DSH is running
|
|
47
|
-
- For the
|
|
55
|
+
- For the all-day secretary (macOS only):
|
|
56
|
+
- **Calendar planning**: macOS 14 or later and the Xcode command line tools (`xcode-select --install` if you don't have them)
|
|
57
|
+
- **Alarms**: the Mac needs **macOS 26.2 or later**. Any Mac with Apple silicon will do; only four Intel Macs can run macOS 26 (see [Apple's list](https://support.apple.com/en-us/122867)).
|
|
58
|
+
- **Phone** (for alarms): an **iPhone 11 or later, or iPhone SE (2nd or 3rd generation)**, on **iOS 26.2 or later**. Reminders has to use iCloud on both the Mac and the iPhone, with the same Apple Account. The alarm rings only on the iPhone that Find My uses as your location; a Mac only shows a notification.
|
|
48
59
|
|
|
49
60
|
## Set up in three steps
|
|
50
61
|
|
|
@@ -76,7 +87,7 @@ Other commands: `clawbot status` shows who is linked, `clawbot logout` unlinks (
|
|
|
76
87
|
|
|
77
88
|
## Settings
|
|
78
89
|
|
|
79
|
-
Open **Plugins → wechat-clawbot → 微信 Bot** in the DSH web sidebar.
|
|
90
|
+
Open **Plugins → wechat-clawbot → 微信 Bot** in the DSH web sidebar. Most changes apply immediately and the WeChat connection stays up (the two switches marked below restart the WeChat listener for a few seconds):
|
|
80
91
|
|
|
81
92
|
- **Model**: pin a provider / model / reasoning effort for the bot. Leave it empty to follow DSH's global default.
|
|
82
93
|
- **Who may message the bot**: only you (the person who scanned) by default. Add WeChat user ids to let others in.
|
|
@@ -85,9 +96,9 @@ Open **Plugins → wechat-clawbot → 微信 Bot** in the DSH web sidebar. Chang
|
|
|
85
96
|
- **把工作目录的说明文件交给 bot** (workspace instruction files): on by default (DSH's own behaviour: once the bot works in a project, its AGENTS.md / CLAUDE.md is put into the chat, and the whole file again after every edit). Off keeps them out of the WeChat session, which helps when those files are long and change often; the bot can still read them when it needs to.
|
|
86
97
|
- **开放 MCP 桥(Claude / Codex)** (MCP bridge): see the integrations below.
|
|
87
98
|
- **Codex 会话联动**: select a Codex project and conversation, relay a message, or query progress. Off by default; when on, every request carries 5 more tools (about 1k tokens). Changing it restarts the WeChat listener.
|
|
88
|
-
-
|
|
99
|
+
- **全天候秘书** (all-day secretary; macOS only, off by default): type the dedicated calendar's name first, then switch it on. Flipping the switch restarts the WeChat listener (renaming the calendar does not). Switching it on writes the planning and alarm rules into `memory.md`; switching it off moves them out and keeps a copy, which comes back unchanged next time. **一键授权** (one-click authorization; press it at the Mac) asks for the calendar and reminders permissions that are still missing; **测试闹钟** (test alarm) sets an alarm about two minutes out; **打开 memory.md** opens `memory.md` on the Mac.
|
|
89
100
|
- **日历提醒** (calendar alerts): events the bot adds get an alert 10 minutes before by default. Switch it off or change the minutes.
|
|
90
|
-
-
|
|
101
|
+
- **改别的日历前先问我** (ask before changing other calendars): on by default. Before the bot adds, changes or deletes an event outside its dedicated calendar, it asks you on WeChat; switched off, it just does it (changes that would notify other attendees are still asked first).
|
|
91
102
|
|
|
92
103
|
A few options (the session id, the working directory, whether to start with DSH) live in the `- id: clawbot` entry of
|
|
93
104
|
`~/.dsh/profiles/web/cordis.patch.yml`. Changing them restarts the WeChat listener automatically.
|
|
@@ -100,7 +111,7 @@ A few options (the session id, the working directory, whether to start with DSH)
|
|
|
100
111
|
- **Auto-memory** (on by default): short messages that look like lasting facts ("I don't drink coffee") get a second
|
|
101
112
|
question to **the same model**: should this be remembered? To turn it off, add `autoMemory: false` to the `clawbot`
|
|
102
113
|
entry in `cordis.patch.yml`. It takes effect on the next message.
|
|
103
|
-
- **
|
|
114
|
+
- **All-day secretary** (off by default): when the bot looks at your calendar, the events it reads (notes included) go to the model, and so do the titles and times of what is in its alarm list. Only you can use the calendar and alarms; while anyone else is on the allow list, these tools refuse every request.
|
|
104
115
|
- The WeChat link and the long-term memory are stored on your computer, under `~/.dsh/clawbot/`.
|
|
105
116
|
|
|
106
117
|
## FAQ
|
|
@@ -110,6 +121,8 @@ components should say "running". If you just upgraded DSH, see the [install & tr
|
|
|
110
121
|
|
|
111
122
|
**A reminder was late**: reminders need the computer and DSH to be running. While the computer sleeps, they wait until it wakes.
|
|
112
123
|
|
|
124
|
+
**An alarm did not ring**: on the iPhone, check three things: it runs iOS 26.2 or later; Settings → your name → Find My → My Location is this iPhone; and in Settings → Apps → Reminders, **Alarms** under "Allow Reminders to Access" is on (if it isn't there yet, mark any reminder urgent by hand once and allow the prompt).
|
|
125
|
+
|
|
113
126
|
**I want the bot on a different model**: pin one in the 微信 Bot settings. Then switching models in the web UI no longer affects the bot.
|
|
114
127
|
|
|
115
128
|
More on installing, upgrading and troubleshooting: [wechat-clawbot-INSTALL.md](wechat-clawbot-INSTALL.md) (in Chinese).
|
|
@@ -120,7 +133,7 @@ It is written for an AI agent installing the plugin for you, and it works just a
|
|
|
120
133
|
- No group chats and no voice messages.
|
|
121
134
|
- One WeChat account per DSH installation.
|
|
122
135
|
- The bot is offline while the computer is off or DSH is not running.
|
|
123
|
-
- The
|
|
136
|
+
- The all-day secretary is macOS only, and alarms also need an iPhone (versions under [Requirements](#requirements)).
|
|
124
137
|
|
|
125
138
|
## Working with Claude Code (optional)
|
|
126
139
|
|
package/README.zh.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
在微信里和你电脑上的 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)助手聊天。
|
|
6
6
|
Clawbot 作为 DSH 插件,完全开源,使用 DSH 的 AI 进行回复,不会上传用户信息。
|
|
7
7
|
出门在外也能让它查文件、改文档、跑命令,结果直接回到微信对话里。
|
|
8
|
-
|
|
8
|
+
根据系统日历帮你规划、创建日程,还能帮你定闹钟,到点手机直接响铃(仅限 macOS)。
|
|
9
9
|
|
|
10
10
|
它走的是微信官方的 **微信ClawBot** 通道,扫码登录即可。
|
|
11
11
|
|
|
@@ -22,17 +22,25 @@ Clawbot 作为 DSH 插件,完全开源,使用 DSH 的 AI 进行回复,不
|
|
|
22
22
|
- **先问再做**:需要你授权的操作(比如动工作目录以外的文件),会先在微信里问你,回「同意」或「拒绝」即可
|
|
23
23
|
- **看得懂引用**:引用一条旧消息回复,它知道你在说哪条
|
|
24
24
|
- **聊得越久也不变慢**:回复结束、安静一阵之后,对话太长就趁空闲把旧内容整理成摘要,你下一条消息来时不用等
|
|
25
|
-
-
|
|
25
|
+
- **全天候秘书(仅 macOS,需手动开启)**:根据 Mac 系统日历帮你规划、创建日程,还能定到点直接响铃的闹钟;排日程用默认规则或你改过的规则,每天的例行安排在聊天里定。
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## 全天候秘书:在微信里排日程、定闹钟(新功能,仅 macOS,需手动开启)
|
|
28
28
|
|
|
29
29
|
- **看得到你所有的日程**:读取 Mac「日历」里所有账户的日程,iCloud、Google、Exchange、订阅日历都行,备注也看得到。问它「明天下午有空吗」,它查过日历再回答。
|
|
30
30
|
- **直接排进日历**:跟它说「周四前要交报告,还得看完两篇文献」,它先找空档,排进一个**你自己命名的专用日历**,再用几行告诉你:几点做什么、挪走了什么、哪里有冲突。专用日历优先建在 iCloud,手机上同步可见;到点还会在微信里提醒你。
|
|
31
|
-
-
|
|
31
|
+
- **只在自己的日历里自主安排**:专用日历里的日程它自己加、改、删;要动你其他日历里的日程,默认先在微信里问你,你回「好」才做(在设置里关掉「改别的日历前先问我」就直接改,会通知其他参与者的改动仍会先问)。
|
|
32
32
|
- **提醒和日程分得清**:只说「提醒我…」的事只发微信提醒,不占日历;要占一段时间的事才排进日历。
|
|
33
|
-
-
|
|
33
|
+
- **真会响的闹钟**:「明天 6:30 叫我起床」「给航班定个闹钟」——bot 在「提醒事项」里(它自己的清单)设一条紧急提醒,到点在 iPhone 上像闹钟一样响,静音和专注模式下也响。它不走微信,微信不让 bot 发消息的时候也照样响。对电脑和手机的要求见下面「需要什么」。
|
|
34
|
+
- **例行任务在聊天里定**:比如「每晚 9 点看看明天的日历,第一个日程前一个半小时叫我起床,周末不叫」。bot 会建一个每天的任务,到点照你的规则去做,没事不打扰你;要改规则,直接跟它说。到点时 Mac 要醒着、DSH 在运行:睡着错过的任务醒来才跑,已经过去的闹钟时间不会补。
|
|
35
|
+
- **排法你说了算**:排日程、定闹钟的规则写在长期记忆 `memory.md` 的「## 全天候秘书」一节里,想怎么排就怎么改:设置里点「打开 memory.md」就能直接编辑。
|
|
36
|
+
|
|
37
|
+
这个功能**只支持 macOS**,而且**默认关闭**,要自己打开:
|
|
38
|
+
|
|
39
|
+
1. DSH 网页「插件」→ wechat-clawbot → 微信 Bot →「全天候秘书」:填一个专用日历的名字,打开开关。
|
|
40
|
+
2. Mac 上会弹出「日历」和「提醒事项」的授权,都点「允许」(没弹出就点「一键授权」;低于 macOS 26.2 的系统没有闹钟,只问「日历」)。
|
|
41
|
+
3. iPhone 上做一次:在「提醒事项」里手动把随便一条提醒设成「紧急」,允许弹出的授权;再确认「查找」里的「我的位置」是这台 iPhone。不做这一步,闹钟到点不响。
|
|
42
|
+
4. 点「测试闹钟」,大约两分钟后听手机响不响。
|
|
34
43
|
|
|
35
|
-
这个功能**只支持 macOS**,而且**默认关闭**,要自己打开:在 DSH 网页「插件」→ wechat-clawbot → 微信 Bot 里,先在「Mac 日历」填一个专用日历的名字、打开开关,在 Mac 上点一次「允许」访问日历;再打开「日程秘书」。
|
|
36
44
|
第一次打开时,插件会在本机编译一个后台小程序 `Clawbot-Calendar`,需要 Xcode 命令行工具(没有的话运行 `xcode-select --install`)。
|
|
37
45
|
|
|
38
46
|
## 成本
|
|
@@ -41,10 +49,13 @@ Clawbot 作为 DSH 插件,完全开源,使用 DSH 的 AI 进行回复,不
|
|
|
41
49
|
|
|
42
50
|
## 需要什么
|
|
43
51
|
|
|
44
|
-
- DSH **0.1.7 到 0.2.
|
|
52
|
+
- DSH **0.1.7 到 0.2.1**(在 0.1.7-rc.2、0.2.0-rc.2 和 0.2.1-rc.2 上测过),以及 Node.js 22+、pnpm
|
|
45
53
|
- 手机微信里能用官方「**微信ClawBot**」插件(微信 → 设置 → 插件;第一次扫码时可能会提示升级微信)
|
|
46
54
|
- 一台一直开着的电脑:DSH 在运行,bot 才在线
|
|
47
|
-
-
|
|
55
|
+
- 想用全天候秘书的话(只支持 macOS):
|
|
56
|
+
- **排日程**:macOS 14 或更新,以及 Xcode 命令行工具(没有的话运行 `xcode-select --install`)
|
|
57
|
+
- **闹钟**:Mac 要 **macOS 26.2 或更新**。搭载 Apple 芯片的 Mac 都可以;Intel Mac 只有四款能升到 macOS 26,见苹果的[兼容机型列表](https://support.apple.com/zh-cn/122867)
|
|
58
|
+
- **手机**(闹钟用):**iPhone 11 或更新的机型、iPhone SE(第 2、3 代)**,系统 **iOS 26.2 或更新**;Mac 和 iPhone 的「提醒事项」都要用 iCloud,而且是同一个 Apple 账户。闹钟只在「查找」里设为「我的位置」的那台 iPhone 上响,Mac 只弹通知
|
|
48
59
|
|
|
49
60
|
## 三步装好
|
|
50
61
|
|
|
@@ -76,7 +87,7 @@ npx -y -p wechat-clawbot clawbot login
|
|
|
76
87
|
|
|
77
88
|
## 设置
|
|
78
89
|
|
|
79
|
-
在 DSH 网页侧边栏打开 **「插件」→ wechat-clawbot → 微信 Bot
|
|
90
|
+
在 DSH 网页侧边栏打开 **「插件」→ wechat-clawbot → 微信 Bot**,大多数改完立刻生效,微信连接不会断(注明会重启微信监听的两个开关除外,几秒就好):
|
|
80
91
|
|
|
81
92
|
- **模型**:给 bot 固定一个 provider / 模型 / 思考档位。留空就跟随 DSH 的全局默认模型。
|
|
82
93
|
- **允许给 bot 发消息的人**:默认只有扫码的你自己。要加人就填对方的微信用户 id。
|
|
@@ -85,9 +96,9 @@ npx -y -p wechat-clawbot clawbot login
|
|
|
85
96
|
- **把工作目录的说明文件交给 bot**:默认开(DSH 原样:bot 在哪个项目里干过活,那里的 AGENTS.md / CLAUDE.md 就会塞进对话,文件每改一次再塞一整份)。关掉则微信会话里不再自动塞,适合说明文件很长、又经常改的人;需要时让 bot 自己去读。
|
|
86
97
|
- **开放 MCP 桥(Claude / Codex)**:见下面的联动说明。
|
|
87
98
|
- **Codex 会话联动**:选择 Codex 项目和对话、转发消息、查询进度。默认关;打开后每次请求要多带 5 个工具(约 1k token),改动会重启微信监听。
|
|
88
|
-
-
|
|
99
|
+
- **全天候秘书**(仅 macOS,默认关):先填专用日历的名字再打开开关;拨这个开关会重启微信监听(改名字不会)。打开时把排日程、定闹钟的规则写进 `memory.md`;关掉时移出记忆并留一份副本,再打开原样放回。「一键授权」补上还缺的「日历」「提醒事项」授权(人要在 Mac 前);「测试闹钟」定一个两分钟后响的闹钟;「打开 memory.md」在 Mac 上打开这个文件。
|
|
89
100
|
- **日历提醒**:bot 往日历里加日程时,默认带一个提前 10 分钟的日历提醒,可以关掉或改分钟数。
|
|
90
|
-
-
|
|
101
|
+
- **改别的日历前先问我**:默认开。bot 往专用日历以外的日历里加、改、删日程前,先在微信里问你;关掉就直接改(会通知其他参与者的改动仍会先问)。
|
|
91
102
|
|
|
92
103
|
少数几项(会话 id、工作目录、是否随 DSH 自动启动等)在 `~/.dsh/profiles/web/cordis.patch.yml` 的 `- id: clawbot` 里改,改完会自动重启微信监听。
|
|
93
104
|
|
|
@@ -98,7 +109,7 @@ npx -y -p wechat-clawbot clawbot login
|
|
|
98
109
|
- **消息去哪**:发给你为这个 DSH 会话配置的模型。你要求转发给 Claude Code 或 Codex 时,对应消息也会交给所选的本机代码会话。
|
|
99
110
|
- **自动记忆**(默认开):像「我不喝咖啡」这种看起来是长期事实的短消息,会让**同一个模型**判断要不要记下来。
|
|
100
111
|
不想要的话,在 `cordis.patch.yml` 的 `clawbot` 里加一行 `autoMemory: false`,下一条消息就生效。
|
|
101
|
-
-
|
|
112
|
+
- **全天候秘书**(默认关):bot 查日历时,相关日程(含备注)会交给模型;查闹钟时,闹钟清单里各项的标题和时间也会交给模型。只有扫码的你自己能用日历和闹钟;白名单里还有别人时,这些工具整体不开放。
|
|
102
113
|
- 绑定凭据和长期记忆都存在本机的 `~/.dsh/clawbot/` 里。
|
|
103
114
|
|
|
104
115
|
## 常见问题
|
|
@@ -108,6 +119,8 @@ npx -y -p wechat-clawbot clawbot login
|
|
|
108
119
|
|
|
109
120
|
**提醒没按时响**:提醒要靠电脑和 DSH 开着;电脑睡眠时会推迟到醒来之后。
|
|
110
121
|
|
|
122
|
+
**闹钟没响**:在 iPhone 上查三处:系统是 iOS 26.2 或更新;「设置 → 你的名字 → 查找 → 我的位置」是这台 iPhone;「设置 → App → 提醒事项」里「允许“提醒事项”访问」下的「闹钟」开着(没有这一项,就手动把一条提醒设成「紧急」一次,在弹出的授权里点允许)。
|
|
123
|
+
|
|
111
124
|
**想换 bot 用的模型**:在上面的「微信 Bot」设置里固定一个模型,这样在网页里换模型就不会影响 bot。
|
|
112
125
|
|
|
113
126
|
更完整的安装、升级和排错说明见 [wechat-clawbot-INSTALL.md](wechat-clawbot-INSTALL.md)。
|
|
@@ -118,7 +131,7 @@ npx -y -p wechat-clawbot clawbot login
|
|
|
118
131
|
- 不支持群聊,也不支持语音消息。
|
|
119
132
|
- 一个 DSH 只绑定一个微信号。
|
|
120
133
|
- 电脑关机、DSH 没运行的时候,bot 不在线。
|
|
121
|
-
-
|
|
134
|
+
- 全天候秘书只支持 macOS,闹钟还要一台 iPhone(版本见「需要什么」)。
|
|
122
135
|
|
|
123
136
|
## 和 Claude Code 联动(可选)
|
|
124
137
|
|
package/assets/icon.svg
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" fill="none">
|
|
2
|
+
<line x1="18" y1="5" x2="18" y2="9.5" stroke="#1DB98A" stroke-width="2" stroke-linecap="round"/>
|
|
3
|
+
<circle cx="18" cy="4" r="2.2" fill="#4F7BF0"/>
|
|
4
|
+
<path d="M11 9h14a6 6 0 0 1 6 6v7a6 6 0 0 1-6 6H14l-6 4.5 1.6-4.9A6 6 0 0 1 5 22v-7a6 6 0 0 1 6-6z" fill="#1DB98A"/>
|
|
5
|
+
<rect x="11" y="15" width="4.2" height="6.5" rx="2.1" fill="#FFFFFF"/>
|
|
6
|
+
<rect x="20.8" y="15" width="4.2" height="6.5" rx="2.1" fill="#FFFFFF"/>
|
|
7
|
+
</svg>
|
package/cordis.patch.yml
CHANGED
|
@@ -26,5 +26,9 @@
|
|
|
26
26
|
# in the Plugins page. That bundle inserts its own `schedule` row after
|
|
27
27
|
# this one and the later row wins: harmless while it stays on, but turning
|
|
28
28
|
# off that bundle's "Task scheduling" row silences WeChat reminders too.
|
|
29
|
+
# DSH 0.2.1 moved the four schedule_* tools into @deepseek-ai/dsh-tool-schedule,
|
|
30
|
+
# which the standard/cordis/ptc presets mount in each agent's own scope (the
|
|
31
|
+
# WeChat agent gets the standard preset), and dsh-web-app ships this
|
|
32
|
+
# `schedule` row again. Both rows mount the same service; the later one wins.
|
|
29
33
|
- id: schedule
|
|
30
34
|
name: '@deepseek-ai/dsh-schedule'
|
package/lib/backlog.d.ts
CHANGED
|
@@ -63,6 +63,20 @@ export declare function isSendWindowClosed(err: unknown): boolean;
|
|
|
63
63
|
* computer was asleep) is still stamped with its own time.
|
|
64
64
|
*/
|
|
65
65
|
export declare function occurrenceAt(text: string): string | undefined;
|
|
66
|
+
/** What each reminder in a scheduled message says (one, or a recurring batch). */
|
|
67
|
+
export declare function reminderPrompts(text: string): string[];
|
|
68
|
+
/** A reminder that is a job for the bot (prompt rule G5.5): it starts with 「任务:」 or 「任务:」. */
|
|
69
|
+
export declare function isTaskPrompt(prompt: string): boolean;
|
|
70
|
+
/** A scheduled message made only of 「任务」: it may end without a word to the owner. */
|
|
71
|
+
export declare function quietTask(text: string): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* The line that goes with a scheduled message delivered on a later day than it
|
|
74
|
+
* was due (the Mac slept, DSH was down), or undefined. The message reads the
|
|
75
|
+
* same whenever it arrives and its only time is UTC, while the prompt's date
|
|
76
|
+
* line says today: a nightly 「任务」 about "the next day" would plan the wrong
|
|
77
|
+
* one. So the dates are worked out here, not left to the model.
|
|
78
|
+
*/
|
|
79
|
+
export declare function lateScheduleNote(text: string, now?: Date): string | undefined;
|
|
66
80
|
/** What a file is called in the digest: 图片 or 文件, and its name. */
|
|
67
81
|
export declare function fileLabel(p: string): string;
|
|
68
82
|
/** `10-13 周一 09:00` in the user's zone. */
|
package/lib/backlog.d.ts.map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vD,8EAA8E;IAC9E,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI;IAShD,OAAO,CAAC,IAAI;IAYZ,OAAO,CAAC,KAAK;CAMd"}
|
package/lib/backlog.js
CHANGED
|
@@ -17,7 +17,7 @@ import fs from "node:fs";
|
|
|
17
17
|
import path from "node:path";
|
|
18
18
|
import { randomUUID } from "node:crypto";
|
|
19
19
|
import { resolveStateDir } from "./ilink/storage/state-dir.js";
|
|
20
|
-
import { zonedDate, zonedStamp, zonedWeekday } from "./localtime.js";
|
|
20
|
+
import { zonedDate, zonedDatePlus, zonedStamp, zonedWeekday } from "./localtime.js";
|
|
21
21
|
import { logger } from "./ilink/util/logger.js";
|
|
22
22
|
/** Items kept per recipient; the oldest go first beyond this. */
|
|
23
23
|
export const BACKLOG_LIMIT = 100;
|
|
@@ -36,10 +36,71 @@ export function isSendWindowClosed(err) {
|
|
|
36
36
|
*/
|
|
37
37
|
export function occurrenceAt(text) {
|
|
38
38
|
const m = /^occurrence_at:\s*(\S+)\s*$/m.exec(text);
|
|
39
|
-
if (m
|
|
39
|
+
if (m !== null) {
|
|
40
|
+
const t = Date.parse(m[1]);
|
|
41
|
+
return Number.isNaN(t) ? undefined : new Date(t).toISOString();
|
|
42
|
+
}
|
|
43
|
+
// A recurring reminder comes as a batch: `reminders_json: [{ occurrence_at, … }]`. The latest one.
|
|
44
|
+
const batch = /^reminders_json:\s*(\[.*\])\s*$/m.exec(text);
|
|
45
|
+
if (batch === null)
|
|
46
|
+
return undefined;
|
|
47
|
+
try {
|
|
48
|
+
const times = JSON.parse(batch[1])
|
|
49
|
+
.map((r) => (typeof r?.occurrence_at === "string" ? Date.parse(r.occurrence_at) : Number.NaN))
|
|
50
|
+
.filter((t) => !Number.isNaN(t));
|
|
51
|
+
return times.length === 0 ? undefined : new Date(Math.max(...times)).toISOString();
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** What each reminder in a scheduled message says (one, or a recurring batch). */
|
|
58
|
+
export function reminderPrompts(text) {
|
|
59
|
+
const one = /^reminder_prompt_json:\s*(".*")\s*$/m.exec(text);
|
|
60
|
+
try {
|
|
61
|
+
if (one !== null) {
|
|
62
|
+
const prompt = JSON.parse(one[1]);
|
|
63
|
+
return typeof prompt === "string" ? [prompt] : [];
|
|
64
|
+
}
|
|
65
|
+
const batch = /^reminders_json:\s*(\[.*\])\s*$/m.exec(text);
|
|
66
|
+
if (batch === null)
|
|
67
|
+
return [];
|
|
68
|
+
return JSON.parse(batch[1])
|
|
69
|
+
.map((r) => r?.reminder_prompt)
|
|
70
|
+
.filter((p) => typeof p === "string");
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/** A reminder that is a job for the bot (prompt rule G5.5): it starts with 「任务:」 or 「任务:」. */
|
|
77
|
+
export function isTaskPrompt(prompt) {
|
|
78
|
+
return /^\s*任务\s*[::]/.test(prompt);
|
|
79
|
+
}
|
|
80
|
+
/** A scheduled message made only of 「任务」: it may end without a word to the owner. */
|
|
81
|
+
export function quietTask(text) {
|
|
82
|
+
const prompts = reminderPrompts(text);
|
|
83
|
+
return prompts.length > 0 && prompts.every(isTaskPrompt);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The line that goes with a scheduled message delivered on a later day than it
|
|
87
|
+
* was due (the Mac slept, DSH was down), or undefined. The message reads the
|
|
88
|
+
* same whenever it arrives and its only time is UTC, while the prompt's date
|
|
89
|
+
* line says today: a nightly 「任务」 about "the next day" would plan the wrong
|
|
90
|
+
* one. So the dates are worked out here, not left to the model.
|
|
91
|
+
*/
|
|
92
|
+
export function lateScheduleNote(text, now = new Date()) {
|
|
93
|
+
const due = occurrenceAt(text);
|
|
94
|
+
if (due === undefined)
|
|
95
|
+
return undefined;
|
|
96
|
+
const at = new Date(due);
|
|
97
|
+
const day = zonedDate(at);
|
|
98
|
+
if (day >= zonedDate(now))
|
|
40
99
|
return undefined;
|
|
41
|
-
const
|
|
42
|
-
|
|
100
|
+
const next = zonedDatePlus(1, at);
|
|
101
|
+
const label = (d) => `${d.slice(5)} ${zonedWeekday(d)}`;
|
|
102
|
+
return `[定时消息晚到] 上面这条定时消息原定 ${dueStamp(at)},${dueStamp(now)} 才送到(电脑睡着了,或 DSH 没在运行)。`
|
|
103
|
+
+ `照原定那天算:内容里的「今天」是 ${label(day)},「明天」「第二天」是 ${label(next)};要设的闹钟、要排的日程,时间已经过了的就跳过。`;
|
|
43
104
|
}
|
|
44
105
|
/** What a file is called in the digest: 图片 or 文件, and its name. */
|
|
45
106
|
export function fileLabel(p) {
|
package/lib/backlog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backlog.js","sourceRoot":"","sources":["../src/backlog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"backlog.js","sourceRoot":"","sources":["../src/backlog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;A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,EAAE,CAAC,CAAC;QAC3D,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,IAAI,MAAM,CAAC;QAC/B,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACtE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF"}
|
package/lib/bridge.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type Agent } from "@deepseek-ai/dsh-agent";
|
|
|
3
3
|
import { SessionId, type Session, type SessionEvent } from "@deepseek-ai/dsh-session";
|
|
4
4
|
import { type CodexPeer } from "./codex-peer.js";
|
|
5
5
|
import { type CalendarHelper, type OwnerAnswer } from "./mac-calendar.js";
|
|
6
|
+
import { type AlarmService } from "./mac-alarms.js";
|
|
6
7
|
import type { ClawbotConfig } from "./config.js";
|
|
7
8
|
import { PendingRegistry } from "./pending.js";
|
|
8
9
|
import { Backlog } from "./backlog.js";
|
|
@@ -27,6 +28,8 @@ export type BridgeDeps = {
|
|
|
27
28
|
}) => Promise<FileUploadResult>;
|
|
28
29
|
/** The macOS Calendar helper; the tools are registered only when `macCalendar` is on. */
|
|
29
30
|
calendarHelper?: CalendarHelper;
|
|
31
|
+
/** Alarms (urgent reminders), registered with the calendar tools: both are 全天候秘书. */
|
|
32
|
+
alarms?: AlarmService;
|
|
30
33
|
};
|
|
31
34
|
/**
|
|
32
35
|
* The durable, serializable reference `attachments.saveImages()` hands back.
|
|
@@ -444,9 +447,9 @@ export declare class WechatBridge {
|
|
|
444
447
|
* `{subagent_id: "schedule-9", message: "ignore"}`, got
|
|
445
448
|
* `subagent "schedule-9" is unavailable`, then retried with schedule-10,
|
|
446
449
|
* -11, ... past -103 — 158 steps and 4.5M input tokens in about three
|
|
447
|
-
* minutes (
|
|
448
|
-
* Running with
|
|
449
|
-
*
|
|
450
|
+
* minutes (a few cents of API credit) before it was stopped by hand.
|
|
451
|
+
* Running with reasoning off (the only setting that route accepted
|
|
452
|
+
* alongside tools) leaves no self-correction to break such a loop.
|
|
450
453
|
*
|
|
451
454
|
* `send_message` is the likeliest trigger: it sits next to this plugin's own
|
|
452
455
|
* `send_wechat_text` in the same tool list, and the two names are easy to
|
package/lib/bridge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAEL,KAAK,KAAK,EAIX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAOtF,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAyB,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAEL,KAAK,KAAK,EAIX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAOtF,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAyB,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AASxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EA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MAAM,CAExB;IAED,qGAAqG;IACrG,YAAY,IAAI,IAAI;IAIpB,gEAAgE;IAChE,OAAO,CAAC,SAAS;IAOjB,uDAAuD;YACzC,UAAU;IA8ExB;;;;;;;;;;OAUG;IACH,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;IAgG3D;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAkCzB;;;;OAIG;IACH,iBAAiB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAgBrF;;;;;OAKG;IACH;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAsBrB,6EAA6E;IAC7E,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,WAAW;IA4DnB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,aAAa;IAmDrB,6EAA6E;IACvE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAwB/B"}
|
package/lib/bridge.js
CHANGED
|
@@ -19,16 +19,23 @@ import { registerDshSessionTools } from "./dsh-sessions.js";
|
|
|
19
19
|
import { NOTIFY_TOOL } from "./owner-notify.js";
|
|
20
20
|
import { registerCodexPeerTools } from "./codex-peer.js";
|
|
21
21
|
import { registerCalendarTools } from "./mac-calendar.js";
|
|
22
|
+
import { registerAlarmTools } from "./mac-alarms.js";
|
|
23
|
+
import { registerClockReadingFilter, registerLateScheduleNotes } from "./time-context.js";
|
|
22
24
|
import { setApprovalPolicy } from "@deepseek-ai/dsh-user-approval";
|
|
23
25
|
import { markSessionCreated, wasSessionCreated } from "./state.js";
|
|
24
26
|
import { TypingIndicator } from "./typing.js";
|
|
25
27
|
import { HOLD_MESSAGE, INCOMING_WAIT_MS, MAX_HOLDS, MAX_RESTARTS, TOGETHER_HINT, mayRestartTurn, shouldHoldReply } from "./coalesce.js";
|
|
26
|
-
import { Backlog, FILE_ATTEMPTS, digestChunks, dueStamp, fileLabel, isSendWindowClosed, occurrenceAt } from "./backlog.js";
|
|
28
|
+
import { Backlog, FILE_ATTEMPTS, digestChunks, dueStamp, fileLabel, isSendWindowClosed, occurrenceAt, quietTask } from "./backlog.js";
|
|
27
29
|
/**
|
|
28
30
|
* Tool calls that are the bot talking to the user, not working: they must not
|
|
29
31
|
* bring 「正在输入」 back after a reply (see TypingIndicator.noteWorking).
|
|
30
32
|
*/
|
|
31
33
|
const REPLY_TOOLS = new Set(["send_wechat_text", "send_wechat_file", "ask_user_question"]);
|
|
34
|
+
/** The text of a session message (its text parts). */
|
|
35
|
+
function messageText(data) {
|
|
36
|
+
const content = data?.content ?? [];
|
|
37
|
+
return content.map((b) => (b.type === "text" ? b.text ?? "" : "")).join("\n");
|
|
38
|
+
}
|
|
32
39
|
/** A user message as the WeChat bridge appends it. */
|
|
33
40
|
function wechatUserMessage(parts) {
|
|
34
41
|
return createUserMessage({
|
|
@@ -129,7 +136,6 @@ export class WechatBridge {
|
|
|
129
136
|
this.backlog = deps.backlog ?? new Backlog();
|
|
130
137
|
this.typing = new TypingIndicator({
|
|
131
138
|
getAccount: () => deps.getAccount(),
|
|
132
|
-
getContextToken: (sender) => deps.getContextToken(sender),
|
|
133
139
|
isWaitingFor: (sender) => deps.pending.hasFor(sender),
|
|
134
140
|
});
|
|
135
141
|
this.idleCompact = new IdleCompactor({
|
|
@@ -141,6 +147,7 @@ export class WechatBridge {
|
|
|
141
147
|
|| this.ctx.agents.get(this.sessionId)?.status === "running",
|
|
142
148
|
lastRequestTokens: () => this.lastRequestTokens,
|
|
143
149
|
hostThreshold: () => this.hostCompactionThreshold(),
|
|
150
|
+
fixedTrigger: () => this.config.idleCompactionTokens,
|
|
144
151
|
compact: (signal) => this.runHostCompact(signal),
|
|
145
152
|
onCompacted: () => { this.lastRequestTokens = undefined; },
|
|
146
153
|
});
|
|
@@ -166,9 +173,11 @@ export class WechatBridge {
|
|
|
166
173
|
catch {
|
|
167
174
|
threshold = undefined;
|
|
168
175
|
}
|
|
176
|
+
const fixed = this.config.idleCompactionTokens;
|
|
177
|
+
const trigger = fixed ?? (threshold === undefined ? "?" : Math.floor(threshold * IDLE_COMPACT_RATIO));
|
|
169
178
|
logger.info(`idle-compact: /compact ${hasCompact ? "可用" : "不可用(只剩宿主回复前的压缩)"};`
|
|
170
|
-
+ ` 宿主阈值 ${threshold ?? "未知"},空闲时超过 ${
|
|
171
|
-
+
|
|
179
|
+
+ ` 宿主阈值 ${threshold ?? "未知"},空闲时超过 ${trigger} token 就整理`
|
|
180
|
+
+ `${fixed === undefined ? "" : "(插件设置的阈值)"}(上次请求 ${this.lastRequestTokens ?? "未知"})`);
|
|
172
181
|
}
|
|
173
182
|
/** The host's pre-step compaction threshold for the bot's current route. */
|
|
174
183
|
async hostCompactionThreshold() {
|
|
@@ -1405,9 +1414,7 @@ export class WechatBridge {
|
|
|
1405
1414
|
if (source?.kind === "schedule" || source?.plugin === "schedule") {
|
|
1406
1415
|
// What a refused reminder is stamped with: when it was due (even if it
|
|
1407
1416
|
// fired late), not when the bot got round to it.
|
|
1408
|
-
|
|
1409
|
-
.map((b) => (b.type === "text" ? b.text ?? "" : "")).join("\n");
|
|
1410
|
-
this.reminderDueAt = occurrenceAt(text) ?? new Date().toISOString();
|
|
1417
|
+
this.reminderDueAt = occurrenceAt(messageText(event.data)) ?? new Date().toISOString();
|
|
1411
1418
|
}
|
|
1412
1419
|
}
|
|
1413
1420
|
if (event.type === "tool/call" && this.currentSender) {
|
|
@@ -1444,7 +1451,10 @@ export class WechatBridge {
|
|
|
1444
1451
|
// that ran out every later reminder was dropped (the tool still said
|
|
1445
1452
|
// 已发送) until the owner happened to message the bot again.
|
|
1446
1453
|
this.turnMessageCount = 0;
|
|
1447
|
-
|
|
1454
|
+
// A 「任务」 runs quietly: it may well end without a word (「没事就不发」), and
|
|
1455
|
+
// 「正在输入」 late at night followed by nothing looks broken. What it sends arrives as usual.
|
|
1456
|
+
if (!quietTask(messageText(event.data)))
|
|
1457
|
+
this.typing.start(owner);
|
|
1448
1458
|
}
|
|
1449
1459
|
// dsh-schedule 自己就能把会话唤醒来投递提醒,这条路径**不经过**
|
|
1450
1460
|
// ensureAgent —— 所以那一轮里工具屏蔽、微信发送工具、配置的模型全都还
|
|
@@ -1608,8 +1618,27 @@ export class WechatBridge {
|
|
|
1608
1618
|
askOwner: (question, signal) => this.askOwner(question, 600_000, signal),
|
|
1609
1619
|
helper: this.deps.calendarHelper,
|
|
1610
1620
|
});
|
|
1621
|
+
if (this.deps.alarms !== undefined) {
|
|
1622
|
+
registerAlarmTools(agentCtx, {
|
|
1623
|
+
config: this.config,
|
|
1624
|
+
getAccount: this.deps.getAccount,
|
|
1625
|
+
activeSender: () => this.activeSender,
|
|
1626
|
+
alarms: this.deps.alarms,
|
|
1627
|
+
});
|
|
1628
|
+
}
|
|
1611
1629
|
}
|
|
1612
1630
|
this.restrictTools(agentCtx);
|
|
1631
|
+
// DSH 0.2.1's standard preset adds a clock reading whose browser time
|
|
1632
|
+
// zone is always "unavailable" for a WeChat message, telling the model to
|
|
1633
|
+
// ask the user (time-context.ts). Registered here, after the preset is
|
|
1634
|
+
// mounted, so this listener runs outside the clock's and can drop it.
|
|
1635
|
+
const offClock = registerClockReadingFilter(target, (id) => this.isWechatSession(id));
|
|
1636
|
+
if (typeof offClock === "function")
|
|
1637
|
+
this.toolDisposers.push(offClock);
|
|
1638
|
+
// A scheduled message delivered on a later day than it was due gets a line saying which day it meant.
|
|
1639
|
+
const offLate = registerLateScheduleNotes(target, (id) => this.isWechatSession(id), (text) => wechatUserMessage([{ type: "text", text }]));
|
|
1640
|
+
if (typeof offLate === "function")
|
|
1641
|
+
this.toolDisposers.push(offLate);
|
|
1613
1642
|
this.toolsRegistered = true;
|
|
1614
1643
|
logger.info(`ensureTools: WeChat tools registered (Codex tools ${codex ? "on" : "off"}, calendar tools ${calendar ? "on" : "off"})`);
|
|
1615
1644
|
}
|
|
@@ -1626,9 +1655,9 @@ export class WechatBridge {
|
|
|
1626
1655
|
* `{subagent_id: "schedule-9", message: "ignore"}`, got
|
|
1627
1656
|
* `subagent "schedule-9" is unavailable`, then retried with schedule-10,
|
|
1628
1657
|
* -11, ... past -103 — 158 steps and 4.5M input tokens in about three
|
|
1629
|
-
* minutes (
|
|
1630
|
-
* Running with
|
|
1631
|
-
*
|
|
1658
|
+
* minutes (a few cents of API credit) before it was stopped by hand.
|
|
1659
|
+
* Running with reasoning off (the only setting that route accepted
|
|
1660
|
+
* alongside tools) leaves no self-correction to break such a loop.
|
|
1632
1661
|
*
|
|
1633
1662
|
* `send_message` is the likeliest trigger: it sits next to this plugin's own
|
|
1634
1663
|
* `send_wechat_text` in the same tool list, and the two names are easy to
|
|
@@ -1654,6 +1683,10 @@ export class WechatBridge {
|
|
|
1654
1683
|
"list_agents",
|
|
1655
1684
|
"ralph",
|
|
1656
1685
|
"workflow",
|
|
1686
|
+
// A dsh-tool-subagent instance bound to an out-of-process Claude Code
|
|
1687
|
+
// (dsh-subagent-acp), if the profile mounts one under this name: it is
|
|
1688
|
+
// for the web UI; the WeChat session keeps its own Claude bridge.
|
|
1689
|
+
"claude_code",
|
|
1657
1690
|
];
|
|
1658
1691
|
try {
|
|
1659
1692
|
// Direct property access, matching how this plugin already registers its
|