aamp-wechat-bridge 0.1.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/README.md +75 -0
- package/dist/index.js +3541 -0
- package/dist/index.js.map +7 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# aamp-wechat-bridge
|
|
2
|
+
|
|
3
|
+
Local bridge daemon that connects a QR-authenticated WeChat bot session to a target AAMP agent.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install
|
|
9
|
+
npm run build
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
Initialize local bridge config and mailbox identity:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
./dist/index.js init
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Login with WeChat QR scan:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
./dist/index.js login
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Run the daemon:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
./dist/index.js run
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Inspect current config and login state:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
./dist/index.js status
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
By default, bridge config and runtime state are stored under `~/.aamp/wechat-bridge/`.
|
|
39
|
+
|
|
40
|
+
## What it does
|
|
41
|
+
|
|
42
|
+
The bridge is designed for users who want to keep WeChat bot credentials on their own machine rather than in a hosted bridge service.
|
|
43
|
+
|
|
44
|
+
It can:
|
|
45
|
+
|
|
46
|
+
- authenticate through terminal QR scan
|
|
47
|
+
- poll the WeChat bot gateway directly without depending on WeClaw or OpenClaw
|
|
48
|
+
- provision or reuse an AAMP mailbox identity for the bridge
|
|
49
|
+
- dispatch each chat turn as a fresh `task.dispatch`
|
|
50
|
+
- preserve sticky conversation state through `X-AAMP-Session-Key`
|
|
51
|
+
- map `task.ack` to the WeChat typing indicator
|
|
52
|
+
- translate `task.result` and `task.help_needed` back into WeChat text replies
|
|
53
|
+
|
|
54
|
+
## Dispatch context
|
|
55
|
+
|
|
56
|
+
Each dispatch sent by the bridge includes WeChat-specific routing metadata in `X-AAMP-Dispatch-Context`, including:
|
|
57
|
+
|
|
58
|
+
- `source=wechat`
|
|
59
|
+
- `wechat_account_id`
|
|
60
|
+
- `wechat_sender_id`
|
|
61
|
+
- `wechat_context_token`
|
|
62
|
+
|
|
63
|
+
Each dispatch also carries a separate `X-AAMP-Session-Key` header for sticky conversation routing.
|
|
64
|
+
|
|
65
|
+
The key design rule is:
|
|
66
|
+
|
|
67
|
+
- each user message becomes a new `task.dispatch`
|
|
68
|
+
- session continuity is expressed through `X-AAMP-Session-Key`, not by reusing the same `taskId`
|
|
69
|
+
|
|
70
|
+
Runtimes such as `aamp-openclaw-plugin` and `aamp-acp-bridge` can use that session key to keep multiple turns inside the same underlying agent session.
|
|
71
|
+
|
|
72
|
+
## Current limitations
|
|
73
|
+
|
|
74
|
+
- direct messages only; no group chat support yet
|
|
75
|
+
- media attachments are currently summarized as text notes instead of being relayed natively
|