coze-bridge 0.1.4 → 0.1.5

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.
Files changed (3) hide show
  1. package/README.md +20 -5
  2. package/dist/index.js +41 -41
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -35,6 +35,16 @@ npx -y coze-bridge@latest --uninstall
35
35
 
36
36
  支持 `--name VALUE` 与 `--name=VALUE` 两种写法。
37
37
 
38
+ ### 自动 connect 某个 agent(可选)
39
+
40
+ | Flag | 说明 |
41
+ |---|---|
42
+ | `--agent-id <id>` | pair 成功后自动 connect 该 agent: 本地已有走 reconnect/revive, 没有 (需云端协议升级) 拉详情新建 |
43
+
44
+ ```bash
45
+ npx -y coze-bridge --pat-token=sat_xxx --pair-code=xxx --agent-id=<your-agent-id>
46
+ ```
47
+
38
48
  ### 环境路由(可选, 联调时用)
39
49
 
40
50
  | Flag | 说明 |
@@ -43,11 +53,16 @@ npx -y coze-bridge@latest --uninstall
43
53
  | `--handshake-url <url>` | 覆盖 HTTP base, 默认 `https://www.coze.cn` |
44
54
  | `--frontier-url <url>` | 覆盖 Frontier WS URL, 默认 `wss://frontier.coze.cn` |
45
55
 
46
- 例:
47
56
  ```bash
48
57
  npx -y coze-bridge --pat-token=sat_xxx --pair-code=xxx --env=ppe_xxx
49
58
  ```
50
59
 
60
+ ## 行为说明
61
+
62
+ - **daemon 启动自动复活 agents**: `~/.coze/agents/` 里所有未被云端主动 disconnect 的 agent, daemon 启动后会自动 spawn 子进程 + 加入路由, 不需要你一个个 reconnect
63
+ - **per-agent 30s 心跳**: pair 成功后每个 active agent 周期上行 `_agent/health` 给云端, 新 agent 上线毫秒级出首帧
64
+ - **deviceId 不持久化**: 每次 pair 由云端 handshake 接口分配, 切环境 / 重启 daemon 都用新值
65
+
51
66
  ## 工作目录
52
67
 
53
68
  ```
@@ -58,10 +73,10 @@ npx -y coze-bridge --pat-token=sat_xxx --pair-code=xxx --env=ppe_xxx
58
73
  │ ├── bridge.port # IPC HTTP 端口
59
74
  │ ├── bridge.token # IPC token (mode 0600)
60
75
  │ ├── bridge.log
61
- │ └── config.json
62
- └── agents/<agentId>/ # 每个 agent 一个目录
63
- ├── config.json # mode 0600 (含 modelToken)
64
- ├── workspace/ # 子进程 cwd
76
+ │ └── config.json # frameworks_cache + libVersion (不存 deviceId, 每次 pair 拿)
77
+ └── agents/<agentId>/ # 每个 agent 一个目录, daemon 重启自动复活
78
+ ├── config.json # mode 0600 (含 cozeIdentity / model / modelToken / sessions / ...)
79
+ ├── workspace/ # 子进程 cwd, CLAUDE.md / AGENTS.md / SOUL.md 在这
65
80
  └── logs/
66
81
  ```
67
82