clawcenter 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/LICENSE +201 -0
- package/README.md +180 -0
- package/bin/clawcenter.js +2 -0
- package/dist/center/commands/system-commands.d.ts +15 -0
- package/dist/center/commands/system-commands.d.ts.map +1 -0
- package/dist/center/commands/system-commands.js +363 -0
- package/dist/center/commands/system-commands.js.map +1 -0
- package/dist/center/dispatcher.d.ts +32 -0
- package/dist/center/dispatcher.d.ts.map +1 -0
- package/dist/center/dispatcher.js +264 -0
- package/dist/center/dispatcher.js.map +1 -0
- package/dist/center/hub.d.ts +16 -0
- package/dist/center/hub.d.ts.map +1 -0
- package/dist/center/hub.js +214 -0
- package/dist/center/hub.js.map +1 -0
- package/dist/center/router/engine.d.ts +35 -0
- package/dist/center/router/engine.d.ts.map +1 -0
- package/dist/center/router/engine.js +106 -0
- package/dist/center/router/engine.js.map +1 -0
- package/dist/center/router/hashtag.d.ts +15 -0
- package/dist/center/router/hashtag.d.ts.map +1 -0
- package/dist/center/router/hashtag.js +21 -0
- package/dist/center/router/hashtag.js.map +1 -0
- package/dist/center/wechat/api.d.ts +131 -0
- package/dist/center/wechat/api.d.ts.map +1 -0
- package/dist/center/wechat/api.js +205 -0
- package/dist/center/wechat/api.js.map +1 -0
- package/dist/center/wechat/cdn.d.ts +13 -0
- package/dist/center/wechat/cdn.d.ts.map +1 -0
- package/dist/center/wechat/cdn.js +100 -0
- package/dist/center/wechat/cdn.js.map +1 -0
- package/dist/center/wechat/connector.d.ts +51 -0
- package/dist/center/wechat/connector.d.ts.map +1 -0
- package/dist/center/wechat/connector.js +253 -0
- package/dist/center/wechat/connector.js.map +1 -0
- package/dist/center/wechat/login.d.ts +13 -0
- package/dist/center/wechat/login.d.ts.map +1 -0
- package/dist/center/wechat/login.js +81 -0
- package/dist/center/wechat/login.js.map +1 -0
- package/dist/core/agents/adapter.d.ts +43 -0
- package/dist/core/agents/adapter.d.ts.map +1 -0
- package/dist/core/agents/adapter.js +2 -0
- package/dist/core/agents/adapter.js.map +1 -0
- package/dist/core/agents/claude-code.d.ts +19 -0
- package/dist/core/agents/claude-code.d.ts.map +1 -0
- package/dist/core/agents/claude-code.js +138 -0
- package/dist/core/agents/claude-code.js.map +1 -0
- package/dist/core/agents/claude-sdk.d.ts +17 -0
- package/dist/core/agents/claude-sdk.d.ts.map +1 -0
- package/dist/core/agents/claude-sdk.js +85 -0
- package/dist/core/agents/claude-sdk.js.map +1 -0
- package/dist/core/agents/codebuddy.d.ts +19 -0
- package/dist/core/agents/codebuddy.d.ts.map +1 -0
- package/dist/core/agents/codebuddy.js +352 -0
- package/dist/core/agents/codebuddy.js.map +1 -0
- package/dist/core/agents/codex.d.ts +18 -0
- package/dist/core/agents/codex.d.ts.map +1 -0
- package/dist/core/agents/codex.js +300 -0
- package/dist/core/agents/codex.js.map +1 -0
- package/dist/core/agents/cursor-agent.d.ts +19 -0
- package/dist/core/agents/cursor-agent.d.ts.map +1 -0
- package/dist/core/agents/cursor-agent.js +253 -0
- package/dist/core/agents/cursor-agent.js.map +1 -0
- package/dist/core/agents/http-agent.d.ts +17 -0
- package/dist/core/agents/http-agent.d.ts.map +1 -0
- package/dist/core/agents/http-agent.js +91 -0
- package/dist/core/agents/http-agent.js.map +1 -0
- package/dist/core/agents/manager.d.ts +45 -0
- package/dist/core/agents/manager.d.ts.map +1 -0
- package/dist/core/agents/manager.js +245 -0
- package/dist/core/agents/manager.js.map +1 -0
- package/dist/core/agents/openclaw.d.ts +19 -0
- package/dist/core/agents/openclaw.d.ts.map +1 -0
- package/dist/core/agents/openclaw.js +173 -0
- package/dist/core/agents/openclaw.js.map +1 -0
- package/dist/core/agents/opencode.d.ts +19 -0
- package/dist/core/agents/opencode.d.ts.map +1 -0
- package/dist/core/agents/opencode.js +175 -0
- package/dist/core/agents/opencode.js.map +1 -0
- package/dist/core/agents/worker-agent.d.ts +24 -0
- package/dist/core/agents/worker-agent.d.ts.map +1 -0
- package/dist/core/agents/worker-agent.js +40 -0
- package/dist/core/agents/worker-agent.js.map +1 -0
- package/dist/core/api/routes.d.ts +6 -0
- package/dist/core/api/routes.d.ts.map +1 -0
- package/dist/core/api/routes.js +238 -0
- package/dist/core/api/routes.js.map +1 -0
- package/dist/core/db/schema.d.ts +3 -0
- package/dist/core/db/schema.d.ts.map +1 -0
- package/dist/core/db/schema.js +97 -0
- package/dist/core/db/schema.js.map +1 -0
- package/dist/core/db/store.d.ts +167 -0
- package/dist/core/db/store.d.ts.map +1 -0
- package/dist/core/db/store.js +469 -0
- package/dist/core/db/store.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +6 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +22 -0
- package/dist/logger.js.map +1 -0
- package/dist/server.d.ts +28 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +158 -0
- package/dist/server.js.map +1 -0
- package/dist/tui/App.d.ts +78 -0
- package/dist/tui/App.d.ts.map +1 -0
- package/dist/tui/App.js +106 -0
- package/dist/tui/App.js.map +1 -0
- package/dist/tui/index.d.ts +7 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +12 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/worker/client.d.ts +28 -0
- package/dist/worker/client.d.ts.map +1 -0
- package/dist/worker/client.js +142 -0
- package/dist/worker/client.js.map +1 -0
- package/package.json +74 -0
- package/web/dist/assets/index-Bvq27OV5.js +60 -0
- package/web/dist/index.html +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# 🐾 ClawCenter
|
|
2
|
+
|
|
3
|
+
> 欢迎提交 Issue 和 Pull Request!无论是 bug 反馈、功能建议还是代码贡献,我们都非常欢迎。
|
|
4
|
+
|
|
5
|
+
**在微信里使用多个 AI 编程助手。**
|
|
6
|
+
|
|
7
|
+
ClawCenter 是一个中央路由器,连接你的微信和多个 AI Agent(Claude Code、OpenCode 等)。你可以在微信聊天里直接跟 AI 对话、写代码、跑命令——用 `#话题标签` 切换不同的 Agent。
|
|
8
|
+
|
|
9
|
+
## 它能做什么
|
|
10
|
+
|
|
11
|
+
- **多 Agent 共存**:同一个微信聊天窗口里接入多个 AI Agent,用 `#claude`、`#助手` 等标签切换
|
|
12
|
+
- **引用回复接续**:直接引用 Agent 的消息继续对话,无需重复打标签
|
|
13
|
+
- **多微信账号**:同时连接多个微信号,各自独立配置
|
|
14
|
+
- **多机器协作**:Agent 可以分布在不同机器上,远程连接到中央服务器
|
|
15
|
+
- **零配置起步**:启动即用,所有设置在 Web 管理面板中完成
|
|
16
|
+
- **权限控制**:矩阵视图一目了然,配置每个微信账号可访问哪些 Agent
|
|
17
|
+
|
|
18
|
+
## 安装
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g clawcenter
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 快速开始
|
|
25
|
+
|
|
26
|
+
### 1. 启动服务
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
clawcenter start
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
服务启动后会显示 Web 管理面板地址(默认 `http://localhost:9800`)。
|
|
33
|
+
|
|
34
|
+
### 2. 添加微信账号
|
|
35
|
+
|
|
36
|
+
打开 Web 管理面板 → **WeChat** → **Add Account**:
|
|
37
|
+
- 输入一个名称(如"我的微信")
|
|
38
|
+
- 点击 **Login (QR)**,用微信扫码
|
|
39
|
+
- 扫码确认后即连接成功
|
|
40
|
+
|
|
41
|
+
### 3. 添加 Agent
|
|
42
|
+
|
|
43
|
+
**WeChat** → **Agents** → **Add Agent**:
|
|
44
|
+
- **ID**:`claude`(这就是微信里的 `#claude` 标签)
|
|
45
|
+
- **Display Name**:`🤖 Claude`
|
|
46
|
+
- **Type**:选择 Claude Code
|
|
47
|
+
- **Working Directory**:填你的项目路径,如 `/home/user/myproject`
|
|
48
|
+
- 点击 **Create & Start**
|
|
49
|
+
|
|
50
|
+
### 4. 开始使用
|
|
51
|
+
|
|
52
|
+
新建的 Agent 会自动对所有微信账号可用。如需调整权限,打开 **Access** 页面:
|
|
53
|
+
- 用矩阵视图查看所有微信账号和 Agent 的访问关系
|
|
54
|
+
- 勾选/取消勾选控制访问权限
|
|
55
|
+
- 点击 ★ 设置默认 Agent
|
|
56
|
+
|
|
57
|
+
### 5. 在微信里聊天
|
|
58
|
+
|
|
59
|
+
在微信里给 bot 发消息:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
#claude 帮我看看这段代码有什么问题
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Agent 会回复:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
[🤖 Claude] 我来看看。这段代码有几个问题...
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
直接引用这条回复继续追问,无需再打 `#claude`。
|
|
72
|
+
|
|
73
|
+
## 功能预览
|
|
74
|
+
|
|
75
|
+
**用 `#标签` 在不同 Agent 之间自由切换,引用回复自动接续对话:**
|
|
76
|
+
|
|
77
|
+
<img src="docs/img/im-quote.jpg" width="300" />
|
|
78
|
+
|
|
79
|
+
**查看可用 Agent、切换默认 Agent、查看/切换模型:**
|
|
80
|
+
|
|
81
|
+
<img src="docs/img/im-modelselect.jpg" width="300" />
|
|
82
|
+
|
|
83
|
+
**发送 `/help` 查看所有系统命令:**
|
|
84
|
+
|
|
85
|
+
<img src="docs/img/im-help.jpg" width="300" />
|
|
86
|
+
|
|
87
|
+
**在微信里给 Agent 发任务,直接完成工作:**
|
|
88
|
+
|
|
89
|
+
<img src="docs/img/im-task.jpg" width="300" />
|
|
90
|
+
|
|
91
|
+
**Web 管理面板统一管理所有 Agent:**
|
|
92
|
+
|
|
93
|
+
<img src="docs/img/web-agents.png" width="700" />
|
|
94
|
+
|
|
95
|
+
## 微信里的用法
|
|
96
|
+
|
|
97
|
+
### 话题标签
|
|
98
|
+
|
|
99
|
+
用 `#名称` 指定发给哪个 Agent:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
#claude 跑一下测试
|
|
103
|
+
#助手 写一首诗
|
|
104
|
+
#code 检查一下这个 bug
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 引用回复
|
|
108
|
+
|
|
109
|
+
引用 Agent 的某条消息直接回复,自动发给同一个 Agent,保持上下文连续。
|
|
110
|
+
|
|
111
|
+
### 无标签发送
|
|
112
|
+
|
|
113
|
+
直接发消息(不带 `#`,不引用),会发给你上次使用的 Agent。
|
|
114
|
+
|
|
115
|
+
### 系统命令
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
/help 查看所有命令
|
|
119
|
+
/agents 列出可用 Agent
|
|
120
|
+
/status 查看系统状态
|
|
121
|
+
/switch 助手 切换默认 Agent
|
|
122
|
+
/model 查看/切换当前 Agent 的模型
|
|
123
|
+
/session 管理当前 Agent 的会话
|
|
124
|
+
/sessions 查看所有会话概览
|
|
125
|
+
/clear 清空当前会话上下文
|
|
126
|
+
/clear all 清空所有会话
|
|
127
|
+
/echo <文本> 回显测试
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## 多个 Agent 示例
|
|
131
|
+
|
|
132
|
+
你可以同时配置多个 Agent,哪怕类型相同、只是工作目录不同:
|
|
133
|
+
|
|
134
|
+
| ID | 类型 | 工作目录 | 用途 |
|
|
135
|
+
|----|------|---------|------|
|
|
136
|
+
| frontend | Claude Code | /home/user/frontend | 前端项目 |
|
|
137
|
+
| backend | Claude Code | /home/user/backend | 后端项目 |
|
|
138
|
+
| 助手 | Claude SDK | — | 通用问答 |
|
|
139
|
+
|
|
140
|
+
在微信里:
|
|
141
|
+
```
|
|
142
|
+
#frontend 这个组件渲染太慢了
|
|
143
|
+
#backend 数据库查询怎么优化
|
|
144
|
+
#助手 今天天气怎么样
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## 多机器部署
|
|
148
|
+
|
|
149
|
+
如果你的 Agent 需要跑在不同机器上:
|
|
150
|
+
|
|
151
|
+
**中央服务器**(连微信的那台):
|
|
152
|
+
```bash
|
|
153
|
+
clawcenter start
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**远程机器**(跑 Agent 的):
|
|
157
|
+
```bash
|
|
158
|
+
clawcenter start --worker --center ws://中央服务器IP:9801
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Worker 启动后打开自己的管理面板(`http://localhost:9802`)添加本地 Agent,它们会自动出现在中央服务器的 Agent 列表中。
|
|
162
|
+
|
|
163
|
+
## 支持的 Agent 类型
|
|
164
|
+
|
|
165
|
+
| 类型 | 说明 |
|
|
166
|
+
|------|------|
|
|
167
|
+
| Claude Code | 本地 `claude` CLI |
|
|
168
|
+
| Claude Agent SDK | 直接调用 Anthropic API |
|
|
169
|
+
| OpenCode | 本地 `opencode` CLI |
|
|
170
|
+
| OpenClaw | 本地 `openclaw` CLI |
|
|
171
|
+
| Codex | 本地 `codex` CLI(OpenAI) |
|
|
172
|
+
| CodeBuddy | 本地 `codebuddy` CLI(腾讯) |
|
|
173
|
+
| Cursor Agent | 本地 `cursor` CLI |
|
|
174
|
+
| Custom HTTP | 任意 HTTP API 的 Agent |
|
|
175
|
+
| Remote Worker | 远程机器上的 Agent |
|
|
176
|
+
|
|
177
|
+
## 文档
|
|
178
|
+
|
|
179
|
+
- [English Documentation](docs/)
|
|
180
|
+
- [中文文档](docs/cn/)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Store } from "../../core/db/store.js";
|
|
2
|
+
import type { AgentManager } from "../../core/agents/manager.js";
|
|
3
|
+
export interface CommandContext {
|
|
4
|
+
wechatAccountId: string;
|
|
5
|
+
fromUserId: string;
|
|
6
|
+
text: string;
|
|
7
|
+
store: Store;
|
|
8
|
+
agentManager: AgentManager;
|
|
9
|
+
}
|
|
10
|
+
export interface CommandResult {
|
|
11
|
+
reply: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function isSystemCommand(text: string): boolean;
|
|
14
|
+
export declare function handleSystemCommand(ctx: CommandContext): Promise<CommandResult>;
|
|
15
|
+
//# sourceMappingURL=system-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-commands.d.ts","sourceRoot":"","sources":["../../../src/center/commands/system-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CA4BrF"}
|