metame-cli 1.5.14 → 1.5.15

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 CHANGED
@@ -567,6 +567,40 @@ Use from mobile: `/dispatch to windows:hunter research competitors` or just ment
567
567
  | `/teamtask <task_id>` | View task detail |
568
568
  | `/teamtask resume <task_id>` | Resume a task |
569
569
 
570
+ ## Weixin Direct Bridge
571
+
572
+ MetaMe also supports a direct Weixin bridge. It is separate from WeCom and currently optimized for text-only request/response flows.
573
+
574
+ ### Enable and bind
575
+
576
+ 1. Edit `~/.metame/daemon.yaml` and enable the bridge:
577
+
578
+ ```yaml
579
+ weixin:
580
+ enabled: true
581
+ base_url: "https://ilinkai.weixin.qq.com"
582
+ bot_type: "3"
583
+ account_id: ""
584
+ route_tag: null
585
+ allowed_chat_ids: []
586
+ chat_agent_map: {}
587
+ poll_timeout_ms: 35000
588
+ ```
589
+
590
+ 2. Redeploy or restart MetaMe so the runtime picks up the new config.
591
+ 3. In your admin chat, run `/weixin login start` to generate the login QR/link.
592
+ 4. Scan and confirm with Weixin, then run `/weixin login wait --session <key>`.
593
+ 5. Run `/weixin` or `/weixin status` to verify the account is linked.
594
+
595
+ Natural-language setup is available through the intent hook. If you want the model to expose the setup flow on demand, enable this in `~/.metame/daemon.yaml`:
596
+
597
+ ```yaml
598
+ hooks:
599
+ weixin_bridge: true
600
+ ```
601
+
602
+ Then prompts like “帮我配置微信桥接” or “开始微信扫码登录” will inject the enable-and-bind workflow for the model.
603
+
570
604
  ## Mentor Mode (Why + How)
571
605
 
572
606
  Mentor Mode is designed for users who want MetaMe to actively improve decision quality, not just execute commands.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metame-cli",
3
- "version": "1.5.14",
3
+ "version": "1.5.15",
4
4
  "description": "The Cognitive Profile Layer for Claude Code. Knows how you think, not just what you said.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -29,7 +29,7 @@ Stop (每轮结束)
29
29
  | `ops_assist` | `intent-ops-assist.js` | 回退/日志/重启/gc/状态 相关语境 | `/undo` `/restart` `/logs` `/gc` `/status` 命令提示 |
30
30
  | `task_create` | `intent-task-create.js` | 定时/提醒/每天X点 等调度语境 | `/task-add` 命令用法提示 |
31
31
  | `file_transfer` | `intent-file-transfer.js` | "发给我/发过来/导出" 等文件传输语境 | `[[FILE:...]]` 协议 + 收发规则 |
32
- | `weixin_bridge` | `intent-weixin-bridge.js` | "微信接入/扫码登录/怎么测试/为什么微信没回" 等微信桥接语境 | `/weixin` 登录与测试命令提示 |
32
+ | `weixin_bridge` | `intent-weixin-bridge.js` | "帮我绑定微信/配置微信桥接/开启微信接入/开始微信扫码登录" 等明确桥接语境 | 开启 `weixin.enabled` + `/weixin` 绑定流程提示 |
33
33
  | `memory_recall` | `intent-memory-recall.js` | "上次/之前/还记得" 等跨会话回忆语境 | `memory-search.js` 命令用法 |
34
34
  | `doc_router` | `intent-doc-router.js` | "创建/绑定 Agent"、"代码结构/脚本入口"、"hook/intent 配置" 等文档导向语境 | 统一 doc-router 文档指引 |
35
35
  ---
@@ -43,7 +43,7 @@ hooks:
43
43
  team_dispatch: true # 改为 false 可禁用
44
44
  ops_assist: true
45
45
  task_create: false # 禁用任务调度提示
46
- weixin_bridge: false # 默认关闭,避免误触发
46
+ weixin_bridge: false # 默认关闭;命中明确微信配置语境时再按需开启
47
47
  ```
48
48
 
49
49
  改完立即生效(intent-engine 每次运行时读取)。
@@ -3,18 +3,18 @@
3
3
  /**
4
4
  * Weixin Bridge Intent Module
5
5
  *
6
- * 按需暴露 MetaMe 的微信桥接能力,只在用户明确谈到微信接入、
7
- * 扫码登录、测试链路或微信侧为何没反应时注入。
6
+ * 按需暴露 MetaMe 的微信桥接配置能力,只在用户明确谈到微信接入、
7
+ * 开启桥接、扫码登录、绑定配置或微信 direct bridge 时注入。
8
8
  *
9
9
  * @param {string} prompt
10
10
  * @returns {string|null}
11
11
  */
12
12
 
13
13
  const POSITIVE_PATTERNS = [
14
- /(?:微信|wechat).{0,12}(?:接入|接上|接通|联通|联调|测试|试试|能不能用|能否使用|可不可用|怎么用|如何用)/i,
15
- /(?:微信|wechat).{0,12}(?:扫码|二维码|登录|绑定|授权|bot|bridge|桥接|通道)/i,
14
+ /(?:帮我|请|想|要|需要|如何|怎么).{0,10}(?:配置|绑定|接入|接上|开通|启用).{0,10}(?:微信|wechat)(?:.{0,10}(?:bridge|桥接|bot|通道))?/i,
15
+ /(?:微信|wechat).{0,12}(?:配置|绑定|接入|接上|开通|启用|扫码|二维码|登录|授权|bridge|桥接|bot|通道)/i,
16
+ /(?:开始|发起).{0,8}(?:微信|wechat).{0,10}(?:扫码|二维码|登录|绑定|授权)/i,
16
17
  /(?:用|通过).{0,6}(?:微信|wechat).{0,10}(?:聊|对话|发消息|收消息|回复)/i,
17
- /(?:微信|wechat).{0,12}(?:没反应|不回|收不到|发不出|发不出去|回复不了|登不上)/i,
18
18
  ];
19
19
  const NEGATIVE_PATTERNS = [
20
20
  /企业微信|wecom/i,
@@ -30,7 +30,9 @@ module.exports = function detectWeixinBridge(prompt) {
30
30
  return [
31
31
  '[微信桥接提示]',
32
32
  '- 当前已接入 MetaMe 的是 **微信 direct bridge**,不是企业微信。',
33
- '- 登录链路:先用 `/weixin login start [--bot-type 3] [--session <key>]` 生成二维码/登录链接,再用 `/weixin login wait --session <key>` 等待绑定完成。',
33
+ '- 如果用户是在让你代为配置,先确保 `~/.metame/daemon.yaml` 里的 `weixin.enabled=true`,`weixin.bot_type=\"3\"`,其余可先保持默认。',
34
+ '- 开启配置后,执行 `/weixin login start [--bot-type 3] [--session <key>]` 生成二维码/登录链接。',
35
+ '- 用户扫码确认后,再执行 `/weixin login wait --session <key>` 等待绑定完成。',
34
36
  '- 查看状态:`/weixin` 或 `/weixin status`。',
35
37
  '- 当前最稳的是 **text-only**:收到微信消息后回复文本;媒体、文件、富交互还不是第一优先级。',
36
38
  '- 微信出站依赖最近一条入站消息携带的 `context_token`,所以更适合“用户来一句,系统回一句”的对话模式。',