wechat-claude-sessions 1.0.0
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/CONTRIBUTING.md +52 -0
- package/LICENSE +21 -0
- package/README.en.md +264 -0
- package/README.md +245 -0
- package/SECURITY.md +45 -0
- package/dist/bindings.d.ts +4 -0
- package/dist/bindings.js +50 -0
- package/dist/bindings.js.map +1 -0
- package/dist/claude-config.d.ts +4 -0
- package/dist/claude-config.js +49 -0
- package/dist/claude-config.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +345 -0
- package/dist/cli.js.map +1 -0
- package/dist/daemon.d.ts +2 -0
- package/dist/daemon.js +771 -0
- package/dist/daemon.js.map +1 -0
- package/dist/i18n.d.ts +67 -0
- package/dist/i18n.js +249 -0
- package/dist/i18n.js.map +1 -0
- package/dist/ilink.d.ts +49 -0
- package/dist/ilink.js +533 -0
- package/dist/ilink.js.map +1 -0
- package/dist/inbox.d.ts +4 -0
- package/dist/inbox.js +75 -0
- package/dist/inbox.js.map +1 -0
- package/dist/launchd.d.ts +7 -0
- package/dist/launchd.js +71 -0
- package/dist/launchd.js.map +1 -0
- package/dist/monitoring.d.ts +4 -0
- package/dist/monitoring.js +33 -0
- package/dist/monitoring.js.map +1 -0
- package/dist/paths.d.ts +11 -0
- package/dist/paths.js +35 -0
- package/dist/paths.js.map +1 -0
- package/dist/pkg-root.d.ts +2 -0
- package/dist/pkg-root.js +11 -0
- package/dist/pkg-root.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +364 -0
- package/dist/server.js.map +1 -0
- package/dist/session-numbers.d.ts +1 -0
- package/dist/session-numbers.js +44 -0
- package/dist/session-numbers.js.map +1 -0
- package/dist/sessions.d.ts +15 -0
- package/dist/sessions.js +135 -0
- package/dist/sessions.js.map +1 -0
- package/dist/tmux.d.ts +7 -0
- package/dist/tmux.js +47 -0
- package/dist/tmux.js.map +1 -0
- package/dist/types.d.ts +150 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +12 -0
- package/dist/utils.js +88 -0
- package/dist/utils.js.map +1 -0
- package/dist/watch-inbox.d.ts +2 -0
- package/dist/watch-inbox.js +102 -0
- package/dist/watch-inbox.js.map +1 -0
- package/package.json +50 -0
- package/templates/com.wechat-claude.daemon.plist.template +31 -0
- package/templates/wechat.md +20 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>Label</key>
|
|
6
|
+
<string>com.wechat-claude.daemon</string>
|
|
7
|
+
<key>ProgramArguments</key>
|
|
8
|
+
<array>
|
|
9
|
+
<string>__NODE__</string>
|
|
10
|
+
<string>__DAEMON_JS__</string>
|
|
11
|
+
</array>
|
|
12
|
+
<key>RunAtLoad</key>
|
|
13
|
+
<true/>
|
|
14
|
+
<key>KeepAlive</key>
|
|
15
|
+
<dict>
|
|
16
|
+
<key>SuccessfulExit</key>
|
|
17
|
+
<false/>
|
|
18
|
+
</dict>
|
|
19
|
+
<key>ThrottleInterval</key>
|
|
20
|
+
<integer>10</integer>
|
|
21
|
+
<key>StandardOutPath</key>
|
|
22
|
+
<string>__LOG__</string>
|
|
23
|
+
<key>StandardErrorPath</key>
|
|
24
|
+
<string>__LOG__</string>
|
|
25
|
+
<key>EnvironmentVariables</key>
|
|
26
|
+
<dict>
|
|
27
|
+
<key>PATH</key>
|
|
28
|
+
<string>__PATH__</string>
|
|
29
|
+
</dict>
|
|
30
|
+
</dict>
|
|
31
|
+
</plist>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Start WeChat message monitoring for this session.
|
|
2
|
+
|
|
3
|
+
1. Call `wechat_status`. It auto-starts the daemon when needed (if logged in), and its output includes this session's id and the exact watcher command to use in step 5.
|
|
4
|
+
2. If not logged in — or the status says the login has EXPIRED — call `wechat_login`, show the QR code URL to the user, then poll with `wechat_login_poll` until confirmed. Login success also auto-starts the daemon.
|
|
5
|
+
3. If the status says the daemon could not be started, tell the user to check `~/.claude/wechat/daemon.log`.
|
|
6
|
+
4. Call `wechat_get_messages` once to process any pending messages.
|
|
7
|
+
5. Start a persistent Monitor with the watcher command from the `wechat_status` output:
|
|
8
|
+
|
|
9
|
+
The command is printed verbatim by `wechat_status` — copy it from there
|
|
10
|
+
rather than composing it; the install path differs per machine. It looks
|
|
11
|
+
like `node /path/to/wechat-claude-sessions/dist/watch-inbox.js <session id>`.
|
|
12
|
+
|
|
13
|
+
Use `persistent: true`. The watcher is event-driven (`fs.watch` on the inbox), prints one line per new delivery, and maintains the heartbeat file that marks this session as `[monitoring]` — the daemon prefers monitored sessions when routing messages without a `/s` prefix.
|
|
14
|
+
6. When the Monitor emits an event:
|
|
15
|
+
- Call `wechat_get_messages` to read and clear the inbox
|
|
16
|
+
- Process the message content (answer questions, execute tasks, etc.)
|
|
17
|
+
- Reply via `wechat_send_text` with the result; use `wechat_send_image` for images
|
|
18
|
+
7. Confirm to the user that WeChat monitoring is active.
|
|
19
|
+
|
|
20
|
+
Fallback: if the Monitor tool is unavailable, use ScheduleWakeup with a 60-second interval and call `wechat_get_messages` on each wakeup (note: without the watcher heartbeat, this session will not show as `[monitoring]`, but messages explicitly routed here with `/s` still arrive).
|