agent-messenger 2.3.0 → 2.4.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/.claude-plugin/README.md +16 -16
- package/.claude-plugin/marketplace.json +29 -29
- package/.claude-plugin/plugin.json +5 -5
- package/CONTRIBUTING.md +1 -1
- package/README.md +8 -5
- package/bun.lock +70 -110
- package/bunfig.toml +3 -0
- package/dist/package.json +11 -3
- package/dist/src/platforms/discordbot/client.js +2 -2
- package/dist/src/platforms/discordbot/client.js.map +1 -1
- package/dist/src/platforms/kakaotalk/cli.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/cli.js +2 -1
- package/dist/src/platforms/kakaotalk/cli.js.map +1 -1
- package/dist/src/platforms/kakaotalk/client.d.ts +2 -1
- package/dist/src/platforms/kakaotalk/client.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/client.js +52 -2
- package/dist/src/platforms/kakaotalk/client.js.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/index.d.ts +1 -0
- package/dist/src/platforms/kakaotalk/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/index.js +1 -0
- package/dist/src/platforms/kakaotalk/commands/index.js.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/profile.d.ts +3 -0
- package/dist/src/platforms/kakaotalk/commands/profile.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/commands/profile.js +19 -0
- package/dist/src/platforms/kakaotalk/commands/profile.js.map +1 -0
- package/dist/src/platforms/kakaotalk/index.d.ts +2 -2
- package/dist/src/platforms/kakaotalk/index.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/index.js +1 -1
- package/dist/src/platforms/kakaotalk/index.js.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/session.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/session.js +2 -1
- package/dist/src/platforms/kakaotalk/protocol/session.js.map +1 -1
- package/dist/src/platforms/kakaotalk/types.d.ts +16 -0
- package/dist/src/platforms/kakaotalk/types.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/types.js +8 -0
- package/dist/src/platforms/kakaotalk/types.js.map +1 -1
- package/dist/src/platforms/line/client.d.ts.map +1 -1
- package/dist/src/platforms/line/client.js +9 -36
- package/dist/src/platforms/line/client.js.map +1 -1
- package/dist/src/platforms/line/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/line/commands/auth.js +32 -20
- package/dist/src/platforms/line/commands/auth.js.map +1 -1
- package/dist/src/platforms/teams/commands/reaction.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/reaction.js +2 -0
- package/dist/src/platforms/teams/commands/reaction.js.map +1 -1
- package/dist/src/platforms/wechatbot/cli.d.ts +5 -0
- package/dist/src/platforms/wechatbot/cli.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/cli.js +18 -0
- package/dist/src/platforms/wechatbot/cli.js.map +1 -0
- package/dist/src/platforms/wechatbot/client.d.ts +36 -0
- package/dist/src/platforms/wechatbot/client.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/client.js +208 -0
- package/dist/src/platforms/wechatbot/client.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/auth.d.ts +28 -0
- package/dist/src/platforms/wechatbot/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/auth.js +164 -0
- package/dist/src/platforms/wechatbot/commands/auth.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/index.d.ts +5 -0
- package/dist/src/platforms/wechatbot/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/index.js +5 -0
- package/dist/src/platforms/wechatbot/commands/index.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/message.d.ts +18 -0
- package/dist/src/platforms/wechatbot/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/message.js +80 -0
- package/dist/src/platforms/wechatbot/commands/message.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/shared.d.ts +9 -0
- package/dist/src/platforms/wechatbot/commands/shared.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/shared.js +13 -0
- package/dist/src/platforms/wechatbot/commands/shared.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/template.d.ts +19 -0
- package/dist/src/platforms/wechatbot/commands/template.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/template.js +76 -0
- package/dist/src/platforms/wechatbot/commands/template.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/user.d.ts +20 -0
- package/dist/src/platforms/wechatbot/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/user.js +53 -0
- package/dist/src/platforms/wechatbot/commands/user.js.map +1 -0
- package/dist/src/platforms/wechatbot/credential-manager.d.ts +17 -0
- package/dist/src/platforms/wechatbot/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/credential-manager.js +121 -0
- package/dist/src/platforms/wechatbot/credential-manager.js.map +1 -0
- package/dist/src/platforms/wechatbot/index.d.ts +5 -0
- package/dist/src/platforms/wechatbot/index.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/index.js +4 -0
- package/dist/src/platforms/wechatbot/index.js.map +1 -0
- package/dist/src/platforms/wechatbot/types.d.ts +94 -0
- package/dist/src/platforms/wechatbot/types.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/types.js +54 -0
- package/dist/src/platforms/wechatbot/types.js.map +1 -0
- package/dist/src/platforms/whatsapp/client.d.ts +1 -0
- package/dist/src/platforms/whatsapp/client.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/client.js +27 -13
- package/dist/src/platforms/whatsapp/client.js.map +1 -1
- package/dist/src/platforms/whatsapp/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/commands/auth.js +21 -18
- package/dist/src/platforms/whatsapp/commands/auth.js.map +1 -1
- package/dist/src/platforms/whatsapp/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/credential-manager.js +14 -8
- package/dist/src/platforms/whatsapp/credential-manager.js.map +1 -1
- package/docs/content/docs/agent-skills.mdx +4 -4
- package/docs/content/docs/cli/channeltalk.mdx +1 -1
- package/docs/content/docs/cli/channeltalkbot.mdx +1 -1
- package/docs/content/docs/cli/discord.mdx +1 -1
- package/docs/content/docs/cli/discordbot.mdx +1 -1
- package/docs/content/docs/cli/instagram.mdx +1 -1
- package/docs/content/docs/cli/kakaotalk.mdx +1 -1
- package/docs/content/docs/cli/line.mdx +1 -1
- package/docs/content/docs/cli/meta.json +1 -0
- package/docs/content/docs/cli/slack.mdx +1 -1
- package/docs/content/docs/cli/slackbot.mdx +1 -1
- package/docs/content/docs/cli/teams.mdx +1 -1
- package/docs/content/docs/cli/webex.mdx +1 -1
- package/docs/content/docs/cli/wechatbot.mdx +179 -0
- package/docs/content/docs/cli/whatsapp.mdx +1 -1
- package/docs/content/docs/cli/whatsappbot.mdx +1 -1
- package/docs/content/docs/sdk/meta.json +1 -1
- package/docs/content/docs/sdk/wechatbot.mdx +282 -0
- package/docs/content/docs/tui.mdx +1 -1
- package/docs/src/app/page.tsx +5 -5
- package/package.json +11 -3
- package/skills/agent-channeltalk/SKILL.md +1 -1
- package/skills/agent-channeltalkbot/SKILL.md +1 -1
- package/skills/agent-discord/SKILL.md +1 -1
- package/skills/agent-discordbot/SKILL.md +1 -1
- package/skills/agent-instagram/SKILL.md +1 -1
- package/skills/agent-kakaotalk/SKILL.md +24 -1
- package/skills/agent-line/SKILL.md +7 -11
- package/skills/agent-line/references/authentication.md +13 -4
- package/skills/agent-slack/SKILL.md +1 -1
- package/skills/agent-slackbot/SKILL.md +1 -1
- package/skills/agent-teams/SKILL.md +1 -1
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +1 -1
- package/skills/agent-wechatbot/SKILL.md +385 -0
- package/skills/agent-whatsapp/SKILL.md +12 -1
- package/skills/agent-whatsappbot/SKILL.md +1 -1
- package/src/platforms/discord/credential-manager.test.ts +18 -1
- package/src/platforms/discordbot/client.ts +2 -2
- package/src/platforms/instagram/commands/auth.test.ts +216 -0
- package/src/platforms/instagram/commands/chat.test.ts +127 -0
- package/src/platforms/instagram/commands/message.test.ts +178 -0
- package/src/platforms/kakaotalk/cli.ts +2 -1
- package/src/platforms/kakaotalk/client.test.ts +157 -0
- package/src/platforms/kakaotalk/client.ts +57 -3
- package/src/platforms/kakaotalk/commands/auth.test.ts +299 -0
- package/src/platforms/kakaotalk/commands/chat.test.ts +97 -0
- package/src/platforms/kakaotalk/commands/index.ts +1 -0
- package/src/platforms/kakaotalk/commands/message.test.ts +113 -0
- package/src/platforms/kakaotalk/commands/profile.test.ts +84 -0
- package/src/platforms/kakaotalk/commands/profile.ts +21 -0
- package/src/platforms/kakaotalk/index.test.ts +5 -0
- package/src/platforms/kakaotalk/index.ts +2 -0
- package/src/platforms/kakaotalk/protocol/session.ts +2 -0
- package/src/platforms/kakaotalk/types.ts +18 -0
- package/src/platforms/line/client.ts +14 -39
- package/src/platforms/line/commands/auth.test.ts +141 -0
- package/src/platforms/line/commands/auth.ts +28 -19
- package/src/platforms/line/commands/chat.test.ts +110 -0
- package/src/platforms/line/commands/friend.test.ts +98 -0
- package/src/platforms/line/commands/message.test.ts +119 -0
- package/src/platforms/line/commands/profile.test.ts +85 -0
- package/src/platforms/slackbot/commands/channel.test.ts +139 -0
- package/src/platforms/slackbot/commands/message.test.ts +226 -0
- package/src/platforms/slackbot/commands/reaction.test.ts +90 -0
- package/src/platforms/slackbot/commands/user.test.ts +143 -0
- package/src/platforms/teams/commands/reaction.test.ts +45 -61
- package/src/platforms/teams/commands/reaction.ts +2 -0
- package/src/platforms/telegram/commands/chat.test.ts +125 -0
- package/src/platforms/telegram/commands/message.test.ts +92 -0
- package/src/platforms/webex/commands/member.test.ts +65 -58
- package/src/platforms/webex/commands/message.test.ts +78 -121
- package/src/platforms/webex/commands/snapshot.test.ts +59 -46
- package/src/platforms/webex/commands/space.test.ts +49 -48
- package/src/platforms/wechatbot/cli.ts +24 -0
- package/src/platforms/wechatbot/client.test.ts +497 -0
- package/src/platforms/wechatbot/client.ts +268 -0
- package/src/platforms/wechatbot/commands/auth.test.ts +211 -0
- package/src/platforms/wechatbot/commands/auth.ts +203 -0
- package/src/platforms/wechatbot/commands/index.ts +4 -0
- package/src/platforms/wechatbot/commands/message.test.ts +155 -0
- package/src/platforms/wechatbot/commands/message.ts +104 -0
- package/src/platforms/wechatbot/commands/shared.ts +22 -0
- package/src/platforms/wechatbot/commands/template.test.ts +199 -0
- package/src/platforms/wechatbot/commands/template.ts +102 -0
- package/src/platforms/wechatbot/commands/user.test.ts +165 -0
- package/src/platforms/wechatbot/commands/user.ts +75 -0
- package/src/platforms/wechatbot/credential-manager.test.ts +255 -0
- package/src/platforms/wechatbot/credential-manager.ts +148 -0
- package/src/platforms/wechatbot/index.test.ts +49 -0
- package/src/platforms/wechatbot/index.ts +19 -0
- package/src/platforms/wechatbot/types.test.ts +223 -0
- package/src/platforms/wechatbot/types.ts +107 -0
- package/src/platforms/whatsapp/client.ts +24 -13
- package/src/platforms/whatsapp/commands/auth.test.ts +311 -0
- package/src/platforms/whatsapp/commands/auth.ts +21 -17
- package/src/platforms/whatsapp/commands/chat.test.ts +198 -0
- package/src/platforms/whatsapp/commands/message.test.ts +231 -0
- package/src/platforms/whatsapp/credential-manager.test.ts +20 -0
- package/src/platforms/whatsapp/credential-manager.ts +17 -8
- package/src/platforms/whatsappbot/commands/auth.test.ts +217 -0
- package/src/platforms/whatsappbot/commands/message.test.ts +198 -0
- package/src/platforms/whatsappbot/commands/template.test.ts +112 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-manager.js","sourceRoot":"","sources":["../../../../src/platforms/whatsapp/credential-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO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ED,OAAO,iBAAiB,IAAI,UAAU,CAAA;IACxC,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,IAAI,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;YACrC,MAAM,EAAE,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;QACjD,CAAC;QAED,IAAI,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;YACpC,MAAM,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;QACjE,CAAC;IACH,CAAC;IAED,eAAe,CAAC,SAAiB;QAC/B,MAAM,aAAa,GAAG,eAAe,CAAC,SAAS,CAAC,CAAA;QAChD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,CAAA;QAE3D,OAAO;YACL,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;SACnC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,SAAiB;QACxC,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;QAC7C,MAAM,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QAChD,OAAO,KAAK,CAAA;IACd,CAAC;CACF"}
|
|
@@ -24,7 +24,7 @@ Agent Skills provide this knowledge in a structured format that AI agents can un
|
|
|
24
24
|
The fastest way to add Agent Messenger skills to your project:
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
npx skills add
|
|
27
|
+
npx skills add agent-messenger/agent-messenger
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
This adds the skill files to your project's `.skills/` directory. See [skills.sh](https://skills.sh/) for more details.
|
|
@@ -35,14 +35,14 @@ Add Agent Messenger skills to Claude Code:
|
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
# From terminal
|
|
38
|
-
claude plugin marketplace add
|
|
38
|
+
claude plugin marketplace add agent-messenger/agent-messenger
|
|
39
39
|
claude plugin install agent-messenger
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
Or from within Claude Code:
|
|
43
43
|
|
|
44
44
|
```
|
|
45
|
-
/plugin marketplace add
|
|
45
|
+
/plugin marketplace add agent-messenger/agent-messenger
|
|
46
46
|
/plugin install agent-messenger
|
|
47
47
|
```
|
|
48
48
|
|
|
@@ -95,4 +95,4 @@ Each platform skill includes:
|
|
|
95
95
|
|
|
96
96
|
- [Agent Skills Documentation](https://agentskills.io/)
|
|
97
97
|
- [Skills CLI](https://skills.sh/)
|
|
98
|
-
- [GitHub Repository](https://github.com/
|
|
98
|
+
- [GitHub Repository](https://github.com/agent-messenger/agent-messenger)
|
|
@@ -258,7 +258,7 @@ npx -y agent-messenger channeltalk snapshot --pretty
|
|
|
258
258
|
|
|
259
259
|
## AI Agent Integration
|
|
260
260
|
|
|
261
|
-
See [`skills/agent-channeltalk/`](https://github.com/
|
|
261
|
+
See [`skills/agent-channeltalk/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-channeltalk) for:
|
|
262
262
|
|
|
263
263
|
- Complete skill documentation
|
|
264
264
|
- Common patterns for AI agent workflows
|
|
@@ -255,7 +255,7 @@ Channel Talk enforces rate limits on API calls. The CLI automatically retries on
|
|
|
255
255
|
|
|
256
256
|
## AI Agent Integration
|
|
257
257
|
|
|
258
|
-
See [`skills/agent-channeltalkbot/`](https://github.com/
|
|
258
|
+
See [`skills/agent-channeltalkbot/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-channeltalkbot) for:
|
|
259
259
|
|
|
260
260
|
- Complete skill documentation
|
|
261
261
|
- Common patterns for AI agent workflows
|
|
@@ -268,7 +268,7 @@ All commands support these options:
|
|
|
268
268
|
|
|
269
269
|
## AI Agent Integration
|
|
270
270
|
|
|
271
|
-
See [`skills/agent-discord/`](https://github.com/
|
|
271
|
+
See [`skills/agent-discord/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-discord) for:
|
|
272
272
|
|
|
273
273
|
- Complete skill documentation
|
|
274
274
|
- Runnable templates
|
|
@@ -261,7 +261,7 @@ All commands support these options:
|
|
|
261
261
|
|
|
262
262
|
## AI Agent Integration
|
|
263
263
|
|
|
264
|
-
See [`skills/agent-discordbot/`](https://github.com/
|
|
264
|
+
See [`skills/agent-discordbot/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-discordbot) for:
|
|
265
265
|
|
|
266
266
|
- Complete skill documentation
|
|
267
267
|
- Runnable templates
|
|
@@ -227,7 +227,7 @@ agent-instagram auth login
|
|
|
227
227
|
|
|
228
228
|
## AI Agent Integration
|
|
229
229
|
|
|
230
|
-
See [`skills/agent-instagram/`](https://github.com/
|
|
230
|
+
See [`skills/agent-instagram/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-instagram) for:
|
|
231
231
|
|
|
232
232
|
- Complete skill documentation
|
|
233
233
|
- Common patterns for AI agent workflows
|
|
@@ -280,7 +280,7 @@ If this file doesn't exist:
|
|
|
280
280
|
|
|
281
281
|
## AI Agent Integration
|
|
282
282
|
|
|
283
|
-
See [`skills/agent-kakaotalk/`](https://github.com/
|
|
283
|
+
See [`skills/agent-kakaotalk/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-kakaotalk) for:
|
|
284
284
|
|
|
285
285
|
- Complete skill documentation
|
|
286
286
|
- Common patterns for AI agent workflows
|
|
@@ -300,7 +300,7 @@ try {
|
|
|
300
300
|
|
|
301
301
|
## AI Agent Integration
|
|
302
302
|
|
|
303
|
-
See [`skills/agent-line/`](https://github.com/
|
|
303
|
+
See [`skills/agent-line/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-line) for:
|
|
304
304
|
|
|
305
305
|
- Complete skill documentation
|
|
306
306
|
- Common patterns for AI agent workflows
|
|
@@ -389,7 +389,7 @@ agent-slack emoji list
|
|
|
389
389
|
|
|
390
390
|
## AI Agent Integration
|
|
391
391
|
|
|
392
|
-
See [`skills/agent-slack/`](https://github.com/
|
|
392
|
+
See [`skills/agent-slack/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-slack) for:
|
|
393
393
|
|
|
394
394
|
- Complete skill documentation
|
|
395
395
|
- Runnable templates
|
|
@@ -208,7 +208,7 @@ agent-slackbot reaction remove <channel> <ts> <emoji>
|
|
|
208
208
|
|
|
209
209
|
## AI Agent Integration
|
|
210
210
|
|
|
211
|
-
See [`skills/agent-slackbot/`](https://github.com/
|
|
211
|
+
See [`skills/agent-slackbot/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-slackbot) for:
|
|
212
212
|
|
|
213
213
|
- Complete skill documentation
|
|
214
214
|
- Runnable templates
|
|
@@ -294,7 +294,7 @@ Some operations require specific Microsoft 365 permissions. Check with your IT a
|
|
|
294
294
|
|
|
295
295
|
## AI Agent Integration
|
|
296
296
|
|
|
297
|
-
See [`skills/agent-teams/`](https://github.com/
|
|
297
|
+
See [`skills/agent-teams/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-teams) for:
|
|
298
298
|
|
|
299
299
|
- Complete skill documentation
|
|
300
300
|
- Runnable templates
|
|
@@ -268,7 +268,7 @@ npm install -g agent-messenger
|
|
|
268
268
|
|
|
269
269
|
## AI Agent Integration
|
|
270
270
|
|
|
271
|
-
See [`skills/agent-webex/`](https://github.com/
|
|
271
|
+
See [`skills/agent-webex/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-webex) for:
|
|
272
272
|
|
|
273
273
|
- Complete skill documentation
|
|
274
274
|
- Common patterns and runnable templates
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: WeChat Bot
|
|
3
|
+
description: Complete reference for the agent-wechatbot CLI.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> **Tip**: `agent-wechatbot` is a shortcut for `agent-messenger wechatbot`.
|
|
7
|
+
|
|
8
|
+
## Quick Start
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# 1. Set your API credentials
|
|
12
|
+
agent-wechatbot auth set your-app-id your-app-secret
|
|
13
|
+
|
|
14
|
+
# 2. Verify authentication
|
|
15
|
+
agent-wechatbot auth status
|
|
16
|
+
|
|
17
|
+
# 3. List available templates
|
|
18
|
+
agent-wechatbot template list --pretty
|
|
19
|
+
|
|
20
|
+
# 4. Send a text message (recipient must have interacted within 48h)
|
|
21
|
+
agent-wechatbot message send oXXXXXXXXXXXXXXX "Hello from the CLI!"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Key Concepts
|
|
25
|
+
|
|
26
|
+
WeChat Official Account API works differently from typical messaging APIs:
|
|
27
|
+
|
|
28
|
+
| Concept | Description |
|
|
29
|
+
| ------------------------ | -------------------------------------------------------------------------------- |
|
|
30
|
+
| **Send-only** | Cannot list or read received messages. Inbound messages require webhooks. |
|
|
31
|
+
| **Customer service messages** | Free-form text, image, and news messages within 48h of user's last interaction. |
|
|
32
|
+
| **Template messages** | Pre-approved templates can be sent at any time. Created in the WeChat admin panel. |
|
|
33
|
+
| **App ID + App Secret** | Credentials from WeChat Official Account admin panel under Development settings. |
|
|
34
|
+
| **OpenID** | Each follower has a unique OpenID scoped to your Official Account. |
|
|
35
|
+
| **IP Whitelist** | Your server IP must be added to the account's whitelist or API calls fail (40164). |
|
|
36
|
+
|
|
37
|
+
## Authentication
|
|
38
|
+
|
|
39
|
+
### API Credential Setup
|
|
40
|
+
|
|
41
|
+
agent-wechatbot uses App ID + App Secret pairs from the WeChat Official Account admin panel:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Set credentials (validates against WeChat API before saving)
|
|
45
|
+
agent-wechatbot auth set <app-id> <app-secret>
|
|
46
|
+
|
|
47
|
+
# Check auth status
|
|
48
|
+
agent-wechatbot auth status
|
|
49
|
+
agent-wechatbot auth status --account <account-id>
|
|
50
|
+
|
|
51
|
+
# Clear stored credentials
|
|
52
|
+
agent-wechatbot auth clear
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### How to Get API Credentials
|
|
56
|
+
|
|
57
|
+
1. Log in to the [WeChat Official Account admin panel](https://mp.weixin.qq.com/)
|
|
58
|
+
2. Navigate to **Development > Basic Configuration**
|
|
59
|
+
3. Copy your **App ID** and **App Secret** (you may need to reset the secret if you don't have it saved)
|
|
60
|
+
4. Add your server's IP to the **IP Whitelist**
|
|
61
|
+
5. Run `agent-wechatbot auth set <app-id> <app-secret>`
|
|
62
|
+
|
|
63
|
+
### Multi-Account Management
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# List stored accounts
|
|
67
|
+
agent-wechatbot auth list
|
|
68
|
+
|
|
69
|
+
# Switch active account
|
|
70
|
+
agent-wechatbot auth use <account-id>
|
|
71
|
+
|
|
72
|
+
# Remove a stored account
|
|
73
|
+
agent-wechatbot auth remove <account-id>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Commands
|
|
77
|
+
|
|
78
|
+
### Message Commands
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Send a text message (customer service, within 48h window)
|
|
82
|
+
agent-wechatbot message send <open-id> <text>
|
|
83
|
+
agent-wechatbot message send oABCD1234 "Your order has shipped!"
|
|
84
|
+
|
|
85
|
+
# Send an image message (customer service, within 48h window)
|
|
86
|
+
agent-wechatbot message send-image <open-id> <media-id>
|
|
87
|
+
agent-wechatbot message send-image oABCD1234 MEDIA_ID_HERE
|
|
88
|
+
|
|
89
|
+
# Send a news/article message (customer service, within 48h window)
|
|
90
|
+
agent-wechatbot message send-news <open-id> \
|
|
91
|
+
--title "Title" --description "Desc" --url "https://..." --picurl "https://..."
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Template Commands
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# List all private templates
|
|
98
|
+
agent-wechatbot template list
|
|
99
|
+
|
|
100
|
+
# Send a template message
|
|
101
|
+
agent-wechatbot template send <open-id> <template-id>
|
|
102
|
+
agent-wechatbot template send oABCD1234 TM00001 \
|
|
103
|
+
--data '{"order_id":{"value":"ORD-9876"},"customer_name":{"value":"Alice"}}' \
|
|
104
|
+
--url "https://example.com/order/9876"
|
|
105
|
+
|
|
106
|
+
# Delete a template
|
|
107
|
+
agent-wechatbot template delete <template-id>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### User Commands
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# List followers (paginated)
|
|
114
|
+
agent-wechatbot user list
|
|
115
|
+
agent-wechatbot user list --next-openid oLAST_OPENID
|
|
116
|
+
|
|
117
|
+
# Get user info by OpenID
|
|
118
|
+
agent-wechatbot user get <open-id>
|
|
119
|
+
agent-wechatbot user get oABCD1234 --lang en
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Global Options
|
|
123
|
+
|
|
124
|
+
| Option | Description |
|
|
125
|
+
| ---------------- | -------------------------------------- |
|
|
126
|
+
| `--pretty` | Human-readable output instead of JSON |
|
|
127
|
+
| `--account <id>` | Use a specific account for this command |
|
|
128
|
+
|
|
129
|
+
## Storage
|
|
130
|
+
|
|
131
|
+
Credentials stored in `~/.config/agent-messenger/wechatbot-credentials.json` (0600 permissions).
|
|
132
|
+
|
|
133
|
+
## Limitations
|
|
134
|
+
|
|
135
|
+
- **Cannot list or read received messages** -- WeChat Official Account API delivers inbound messages via webhooks only. This CLI is send-only.
|
|
136
|
+
- **Customer service messages require 48h window** -- Free-form text, image, and news messages only work within 48 hours of the user's last interaction.
|
|
137
|
+
- **Template messages require pre-approval** -- Templates must be created and approved in the WeChat admin panel before use.
|
|
138
|
+
- **IP whitelist required** -- Your server's IP must be added to the Official Account's whitelist (error 40164).
|
|
139
|
+
- **Media IDs required for images** -- Images must be uploaded to WeChat's media platform first. The CLI accepts media IDs, not URLs.
|
|
140
|
+
- **No group chat support** -- Official Account API communicates with individual followers only.
|
|
141
|
+
- **No real-time events / WebSocket connection** -- Inbound messages require a separate webhook server.
|
|
142
|
+
- **No message editing or deletion**
|
|
143
|
+
- **No voice or video calls**
|
|
144
|
+
- **Access tokens expire** -- Tokens are valid for 7200 seconds. The CLI handles automatic refresh.
|
|
145
|
+
|
|
146
|
+
## Troubleshooting
|
|
147
|
+
|
|
148
|
+
### `agent-wechatbot: command not found`
|
|
149
|
+
|
|
150
|
+
**`agent-wechatbot` is NOT the npm package name.** The npm package is `agent-messenger`.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# If installed globally
|
|
154
|
+
agent-wechatbot message send oABCD1234 "Hello"
|
|
155
|
+
|
|
156
|
+
# If not installed, use npx
|
|
157
|
+
npx -y agent-messenger wechatbot message send oABCD1234 "Hello"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### IP whitelist errors (40164)
|
|
161
|
+
|
|
162
|
+
If you get error `40164`, your server's IP is not in the Official Account's whitelist. Add it in the admin panel under **Development > Basic Configuration > IP Whitelist**.
|
|
163
|
+
|
|
164
|
+
### Token errors (40001, 42001)
|
|
165
|
+
|
|
166
|
+
These indicate an expired or invalid access token. The CLI handles automatic token refresh, but if you see persistent errors:
|
|
167
|
+
- Verify your App Secret hasn't been reset in the admin panel
|
|
168
|
+
- Re-run `agent-wechatbot auth set <app-id> <app-secret>` with the current credentials
|
|
169
|
+
|
|
170
|
+
### Rate limiting (45009)
|
|
171
|
+
|
|
172
|
+
WeChat enforces API call frequency limits. If you hit error `45009`, wait before retrying. For bulk operations, add delays between requests.
|
|
173
|
+
|
|
174
|
+
## AI Agent Integration
|
|
175
|
+
|
|
176
|
+
See [`skills/agent-wechatbot/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-wechatbot) for:
|
|
177
|
+
|
|
178
|
+
- Complete skill documentation
|
|
179
|
+
- Common patterns for AI agent workflows
|
|
@@ -157,7 +157,7 @@ agent-whatsapp auth login --phone +1234567890
|
|
|
157
157
|
|
|
158
158
|
## AI Agent Integration
|
|
159
159
|
|
|
160
|
-
See [`skills/agent-whatsapp/`](https://github.com/
|
|
160
|
+
See [`skills/agent-whatsapp/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-whatsapp) for:
|
|
161
161
|
|
|
162
162
|
- Complete skill documentation
|
|
163
163
|
- Common patterns for AI agent workflows
|
|
@@ -163,7 +163,7 @@ WhatsApp enforces rate limits based on your business tier. The CLI automatically
|
|
|
163
163
|
|
|
164
164
|
## AI Agent Integration
|
|
165
165
|
|
|
166
|
-
See [`skills/agent-whatsappbot/`](https://github.com/
|
|
166
|
+
See [`skills/agent-whatsappbot/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-whatsappbot) for:
|
|
167
167
|
|
|
168
168
|
- Complete skill documentation
|
|
169
169
|
- Common patterns for AI agent workflows
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"title": "TypeScript SDK",
|
|
3
|
-
"pages": ["slack", "discord", "teams", "webex", "whatsapp", "whatsappbot", "line", "instagram", "kakaotalk", "channeltalk", "channeltalkbot"]
|
|
3
|
+
"pages": ["slack", "discord", "teams", "webex", "whatsapp", "whatsappbot", "line", "wechatbot", "instagram", "kakaotalk", "channeltalk", "channeltalkbot"]
|
|
4
4
|
}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: WeChat Bot
|
|
3
|
+
description: TypeScript SDK reference for WeChat Bot — Official Account API client, credential management, and types.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install agent-messenger
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
import {
|
|
14
|
+
WeChatBotClient,
|
|
15
|
+
WeChatBotCredentialManager,
|
|
16
|
+
WeChatBotError,
|
|
17
|
+
} from 'agent-messenger/wechatbot'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## WeChatBotClient
|
|
21
|
+
|
|
22
|
+
The main client for interacting with the WeChat Official Account API programmatically. Handles access token lifecycle (caching, auto-refresh on expiry), errcode-aware response parsing, and automatic retries on transient errors. All API calls use query-parameter token injection per WeChat convention.
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { WeChatBotClient } from 'agent-messenger/wechatbot'
|
|
26
|
+
|
|
27
|
+
const client = await new WeChatBotClient().login({ appId, appSecret })
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or use automatic credential extraction, where credentials are read from stored config:
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { WeChatBotClient } from 'agent-messenger/wechatbot'
|
|
34
|
+
|
|
35
|
+
const client = await new WeChatBotClient().login()
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Verification
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
// Verify credentials by attempting to obtain an access token
|
|
42
|
+
const valid = await client.verifyCredentials()
|
|
43
|
+
// → boolean
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Customer Service Messages
|
|
47
|
+
|
|
48
|
+
Customer service messages can be sent to users who have interacted with your Official Account within the last 48 hours.
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
// Send a text message
|
|
52
|
+
await client.sendTextMessage('oABCD1234', 'Hello from the bot!')
|
|
53
|
+
|
|
54
|
+
// Send an image message (requires a media ID from WeChat's media upload API)
|
|
55
|
+
await client.sendImageMessage('oABCD1234', 'MEDIA_ID_HERE')
|
|
56
|
+
|
|
57
|
+
// Send a news/article message
|
|
58
|
+
await client.sendNewsMessage('oABCD1234', [
|
|
59
|
+
{
|
|
60
|
+
title: 'Your Order Update',
|
|
61
|
+
description: 'Your order #12345 has been shipped',
|
|
62
|
+
url: 'https://example.com/orders/12345',
|
|
63
|
+
picurl: 'https://example.com/images/shipping.jpg',
|
|
64
|
+
},
|
|
65
|
+
])
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Template Messages
|
|
69
|
+
|
|
70
|
+
Template messages can be sent at any time, regardless of the 48-hour interaction window.
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
// Send a template message
|
|
74
|
+
const result = await client.sendTemplateMessage(
|
|
75
|
+
'oABCD1234',
|
|
76
|
+
'TM00001',
|
|
77
|
+
{ order_id: { value: 'ORD-9876' }, customer_name: { value: 'Alice' } },
|
|
78
|
+
'https://example.com/order/9876', // optional click URL
|
|
79
|
+
)
|
|
80
|
+
console.log(`Message ID: ${result.msgid}`)
|
|
81
|
+
// → { msgid: number }
|
|
82
|
+
|
|
83
|
+
// List all private templates
|
|
84
|
+
const templates = await client.listTemplates()
|
|
85
|
+
// → WeChatBotTemplate[]
|
|
86
|
+
|
|
87
|
+
// Delete a template
|
|
88
|
+
await client.deleteTemplate('TM00001')
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Users
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
// List followers (paginated)
|
|
95
|
+
const followers = await client.getFollowers()
|
|
96
|
+
console.log(`Total: ${followers.total}, This page: ${followers.count}`)
|
|
97
|
+
// → { total: number, count: number, openids: string[], next_openid: string }
|
|
98
|
+
|
|
99
|
+
// Get next page
|
|
100
|
+
const nextPage = await client.getFollowers(followers.next_openid)
|
|
101
|
+
|
|
102
|
+
// Get user info
|
|
103
|
+
const user = await client.getUserInfo('oABCD1234', 'en')
|
|
104
|
+
// → WeChatBotUserInfo
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## WeChatBotCredentialManager
|
|
108
|
+
|
|
109
|
+
Manages WeChat Bot credentials stored at `~/.config/agent-messenger/wechatbot-credentials.json`. Files are written with `0o600` permissions. The environment variables `E2E_WECHATBOT_APP_ID` and `E2E_WECHATBOT_APP_SECRET` take precedence when calling `getCredentials()` without an `accountId`.
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { WeChatBotCredentialManager } from 'agent-messenger/wechatbot'
|
|
113
|
+
|
|
114
|
+
const manager = new WeChatBotCredentialManager()
|
|
115
|
+
// Custom path: new WeChatBotCredentialManager('/custom/config/dir')
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
// Load full config from disk (returns defaults if file doesn't exist)
|
|
120
|
+
const config = await manager.load()
|
|
121
|
+
// → WeChatBotConfig
|
|
122
|
+
|
|
123
|
+
// Save full config to disk
|
|
124
|
+
await manager.save(config)
|
|
125
|
+
|
|
126
|
+
// Get credentials for an account (env vars take precedence)
|
|
127
|
+
const creds = await manager.getCredentials()
|
|
128
|
+
const specific = await manager.getCredentials(accountId)
|
|
129
|
+
// → WeChatBotCredentials | null
|
|
130
|
+
|
|
131
|
+
// Store credentials for an account
|
|
132
|
+
await manager.setCredentials({
|
|
133
|
+
app_id: 'wx1234567890',
|
|
134
|
+
app_secret: '...',
|
|
135
|
+
account_name: 'wx1234567890',
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
// Remove an account's credentials
|
|
139
|
+
const removed = await manager.removeAccount('wx1234567890')
|
|
140
|
+
// → boolean
|
|
141
|
+
|
|
142
|
+
// Set the current default account
|
|
143
|
+
const ok = await manager.setCurrent('wx1234567890')
|
|
144
|
+
// → boolean
|
|
145
|
+
|
|
146
|
+
// List all saved accounts with current marker
|
|
147
|
+
const all = await manager.listAll()
|
|
148
|
+
// → Array<WeChatBotAccountEntry & { is_current: boolean }>
|
|
149
|
+
|
|
150
|
+
// Clear all stored credentials
|
|
151
|
+
await manager.clearCredentials()
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Types
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
import type {
|
|
158
|
+
WeChatBotAccountEntry,
|
|
159
|
+
WeChatBotConfig,
|
|
160
|
+
WeChatBotCredentials,
|
|
161
|
+
WeChatBotNewsArticle,
|
|
162
|
+
WeChatBotTemplate,
|
|
163
|
+
WeChatBotUserInfo,
|
|
164
|
+
} from 'agent-messenger/wechatbot'
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## WeChatBotError
|
|
168
|
+
|
|
169
|
+
Thrown on authentication failures, network errors, rate limits, and API errors. Includes a `code` string for programmatic handling.
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
import { WeChatBotError } from 'agent-messenger/wechatbot'
|
|
173
|
+
|
|
174
|
+
try {
|
|
175
|
+
await client.sendTextMessage('oABCD1234', 'Hello')
|
|
176
|
+
} catch (error) {
|
|
177
|
+
if (error instanceof WeChatBotError) {
|
|
178
|
+
console.error(`${error.code}: ${error.message}`)
|
|
179
|
+
// e.g. "40001: Invalid credential"
|
|
180
|
+
// e.g. "45009: Reach max API daily quota limit"
|
|
181
|
+
// e.g. "40164: Invalid ip, not in whitelist"
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Zod Schemas
|
|
187
|
+
|
|
188
|
+
Runtime-validated schemas are also exported for parsing API responses:
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
import {
|
|
192
|
+
WeChatBotAccountEntrySchema,
|
|
193
|
+
WeChatBotConfigSchema,
|
|
194
|
+
WeChatBotCredentialsSchema,
|
|
195
|
+
WeChatBotNewsArticleSchema,
|
|
196
|
+
WeChatBotTemplateSchema,
|
|
197
|
+
WeChatBotUserInfoSchema,
|
|
198
|
+
} from 'agent-messenger/wechatbot'
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Examples
|
|
202
|
+
|
|
203
|
+
### Send Template Notification
|
|
204
|
+
|
|
205
|
+
Send a template message with dynamic data to a follower.
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
import { WeChatBotClient } from 'agent-messenger/wechatbot'
|
|
209
|
+
|
|
210
|
+
const client = await new WeChatBotClient().login({ appId, appSecret })
|
|
211
|
+
|
|
212
|
+
const result = await client.sendTemplateMessage(
|
|
213
|
+
'oABCD1234',
|
|
214
|
+
'order_confirmation',
|
|
215
|
+
{
|
|
216
|
+
order_id: { value: 'ORD-5678' },
|
|
217
|
+
status: { value: 'Shipped' },
|
|
218
|
+
date: { value: 'March 30, 2026' },
|
|
219
|
+
},
|
|
220
|
+
'https://example.com/orders/5678',
|
|
221
|
+
)
|
|
222
|
+
console.log(`Sent template, msgid: ${result.msgid}`)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Broadcast to All Followers
|
|
226
|
+
|
|
227
|
+
Iterate through paginated follower list and send template messages.
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
import { WeChatBotClient } from 'agent-messenger/wechatbot'
|
|
231
|
+
|
|
232
|
+
const client = await new WeChatBotClient().login({ appId, appSecret })
|
|
233
|
+
|
|
234
|
+
let nextOpenId: string | undefined
|
|
235
|
+
do {
|
|
236
|
+
const page = await client.getFollowers(nextOpenId)
|
|
237
|
+
for (const openId of page.openids) {
|
|
238
|
+
await client.sendTemplateMessage(openId, 'weekly_update', {
|
|
239
|
+
content: { value: 'New features released this week!' },
|
|
240
|
+
})
|
|
241
|
+
}
|
|
242
|
+
nextOpenId = page.next_openid || undefined
|
|
243
|
+
} while (nextOpenId)
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Multi-Account Management
|
|
247
|
+
|
|
248
|
+
Set up and switch between multiple Official Account credentials.
|
|
249
|
+
|
|
250
|
+
```typescript
|
|
251
|
+
import { WeChatBotCredentialManager, WeChatBotClient } from 'agent-messenger/wechatbot'
|
|
252
|
+
|
|
253
|
+
const manager = new WeChatBotCredentialManager()
|
|
254
|
+
|
|
255
|
+
// Store credentials for two accounts
|
|
256
|
+
await manager.setCredentials({
|
|
257
|
+
app_id: 'wx1111111111',
|
|
258
|
+
app_secret: 'secret1...',
|
|
259
|
+
account_name: 'wx1111111111',
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
await manager.setCredentials({
|
|
263
|
+
app_id: 'wx2222222222',
|
|
264
|
+
app_secret: 'secret2...',
|
|
265
|
+
account_name: 'wx2222222222',
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
// List all accounts
|
|
269
|
+
const accounts = await manager.listAll()
|
|
270
|
+
for (const acct of accounts) {
|
|
271
|
+
const marker = acct.is_current ? '(current)' : ''
|
|
272
|
+
console.log(`${acct.account_name} [${acct.app_id}] ${marker}`)
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Switch to a specific account
|
|
276
|
+
await manager.setCurrent('wx1111111111')
|
|
277
|
+
|
|
278
|
+
// Login picks up the current account automatically
|
|
279
|
+
const client = await new WeChatBotClient().login()
|
|
280
|
+
const valid = await client.verifyCredentials()
|
|
281
|
+
console.log(`Credentials valid: ${valid}`)
|
|
282
|
+
```
|
|
@@ -113,7 +113,7 @@ This means adding a new platform to the TUI is just implementing one adapter —
|
|
|
113
113
|
|
|
114
114
|
## Source
|
|
115
115
|
|
|
116
|
-
The TUI source lives in [`src/tui/`](https://github.com/
|
|
116
|
+
The TUI source lives in [`src/tui/`](https://github.com/agent-messenger/agent-messenger/tree/main/src/tui):
|
|
117
117
|
|
|
118
118
|
```
|
|
119
119
|
src/tui/
|