Skip to content

Commit 0328ca8

Browse files
raylchenraychen911
authored andcommitted
style: 修改一些变量名称
- 统一 trpc_claw 名称 - 同步修改一些文档 - 同步一些bug修复
1 parent a66637b commit 0328ca8

52 files changed

Lines changed: 549 additions & 401 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ For full configuration and advanced features, see: [openclaw.md](./docs/mkdocs/e
165165
**1. Generate config**
166166

167167
```bash
168-
mkdir -p ~/.trpc_agent_claw
169-
trpc_agent_cmd openclaw conf_temp --full > ~/.trpc_agent_claw/config.yaml
168+
mkdir -p ~/.trpc_claw
169+
trpc_agent_cmd openclaw conf_temp > ~/.trpc_claw/config.yaml
170170
```
171171

172172
**2. Set environment variables**
@@ -181,10 +181,10 @@ export TRPC_AGENT_MODEL_NAME=your_model
181181

182182
```bash
183183
# Force local CLI mode
184-
trpc_agent_cmd openclaw chat -c ~/.trpc_agent_claw/config.yaml
184+
trpc_agent_cmd openclaw chat -c ~/.trpc_claw/config.yaml
185185

186186
# Local UI
187-
trpc_agent_cmd openclaw ui -c ~/.trpc_agent_claw/config.yaml
187+
trpc_agent_cmd openclaw ui -c ~/.trpc_claw/config.yaml
188188
```
189189

190190
**4. Connect WeCom / Telegram**
@@ -204,7 +204,7 @@ channels:
204204
```
205205

206206
```bash
207-
trpc_agent_cmd openclaw run -c ~/.trpc_agent_claw/config.yaml
207+
trpc_agent_cmd openclaw run -c ~/.trpc_claw/config.yaml
208208
```
209209

210210
If no channel is available, `run` automatically falls back to local CLI for easy debugging.

README.zh_CN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ tRPC-Agent 基于 [nanobot](https://github.com/HKUDS/nanobot) 提供了 trpc-cla
166166
**1. 生成配置文件**
167167

168168
```bash
169-
mkdir -p ~/.trpc_agent_claw
170-
trpc_agent_cmd openclaw conf_temp --full > ~/.trpc_agent_claw/config.yaml
169+
mkdir -p ~/.trpc_claw
170+
trpc_agent_cmd openclaw conf_temp > ~/.trpc_claw/config.yaml
171171
```
172172

173173
**2. 配置环境变量**
@@ -182,10 +182,10 @@ export TRPC_AGENT_MODEL_NAME=your_model
182182

183183
```bash
184184
# 强制本地 CLI
185-
trpc_agent_cmd openclaw chat -c ~/.trpc_agent_claw/config.yaml
185+
trpc_agent_cmd openclaw chat -c ~/.trpc_claw/config.yaml
186186

187187
# 本地 UI
188-
trpc_agent_cmd openclaw ui -c ~/.trpc_agent_claw/config.yaml
188+
trpc_agent_cmd openclaw ui -c ~/.trpc_claw/config.yaml
189189
```
190190

191191
**4. 接入企业微信 / Telegram**
@@ -205,7 +205,7 @@ channels:
205205
```
206206

207207
```bash
208-
trpc_agent_cmd openclaw run -c ~/.trpc_agent_claw/config.yaml
208+
trpc_agent_cmd openclaw run -c ~/.trpc_claw/config.yaml
209209
```
210210

211211
`run` 模式下若无可用通道会自动回退到本地 CLI,方便调试。

docs/mkdocs/en/multi_agents.md

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,9 @@ Content Processing Assistant (Main Agent)
440440

441441
### TransferAgent (Transfer Proxy)
442442

443-
TransferAgent is a transfer proxy Agent designed to enable custom Agents without transfer capability (such as KnotAgent, RemoteAgent, etc.) to gain transfer capability, thereby integrating them into the tRPC-Agent framework's multi-Agent system.
443+
TransferAgent is a transfer proxy Agent designed to enable custom Agents without transfer capability (such as `TrpcRemoteA2aAgent`) to gain transfer capability, thereby integrating them into the tRPC-Agent framework's multi-Agent system.
444+
445+
`TrpcRemoteA2aAgent` can be used to simulate a remote Agent scenario (first start an A2A Agent service with `examples/a2a/run_server.py` to mimic a remote Agent).
444446

445447
Through TransferAgent, custom Agents can:
446448
- **Act as sub_agent**: The parent Agent can transfer control to this Agent, and this Agent can transfer control to parent/sibling Agents
@@ -452,23 +454,24 @@ No need to provide `sub_agents` or `transfer_instruction` — TransferAgent dire
452454

453455
```python
454456
from trpc_agent_sdk.agents import TransferAgent, LlmAgent
455-
from trpc_agent_sdk.server.knot_agent import KnotAgent
456-
457-
# Create a custom Agent (without transfer capability); KnotAgent is a specific Agent supporting an internal platform
458-
knot_agent = KnotAgent(
459-
name="knot-assistant",
460-
knot_api_url="...",
461-
knot_api_key="...",
462-
knot_model="...",
457+
from trpc_agent_sdk.server.a2a import TrpcRemoteA2aAgent
458+
459+
# Create a custom Agent (without transfer capability); use TrpcRemoteA2aAgent to simulate a remote Agent
460+
remote_agent = TrpcRemoteA2aAgent(
461+
name="remote-weather-assistant",
462+
description="A remote weather agent served over A2A",
463+
agent_base_url="http://127.0.0.1:18081", # Remote A2A service URL
463464
)
465+
# Note: TrpcRemoteA2aAgent should be initialized during application startup
466+
# await remote_agent.initialize()
464467

465-
# Enable transfer capability for knot_agent via TransferAgent
468+
# Enable transfer capability for remote_agent via TransferAgent
466469
transfer_agent = TransferAgent(
467-
knot_agent,
470+
remote_agent,
468471
model=model,
469472
)
470473

471-
# Now knot_agent (via transfer_agent) can be invoked as a sub_agent
474+
# Now remote_agent (via transfer_agent) can be invoked as a sub_agent
472475
coordinator = LlmAgent(
473476
name="coordinator",
474477
model=model,
@@ -482,15 +485,16 @@ After providing `sub_agents`, TransferAgent analyzes the target Agent's returned
482485

483486
```python
484487
from trpc_agent_sdk.agents import TransferAgent, LlmAgent
485-
from trpc_agent_sdk.server.knot_agent import KnotAgent
486-
487-
# Create a custom Agent (without transfer capability); KnotAgent is a specific Agent supporting an internal platform
488-
knot_agent = KnotAgent(
489-
name="knot-assistant",
490-
knot_api_url="...",
491-
knot_api_key="...",
492-
knot_model="...",
488+
from trpc_agent_sdk.server.a2a import TrpcRemoteA2aAgent
489+
490+
# Create a custom Agent (without transfer capability); use TrpcRemoteA2aAgent
491+
remote_agent = TrpcRemoteA2aAgent(
492+
name="remote-weather-assistant",
493+
description="A remote weather agent served over A2A",
494+
agent_base_url="http://127.0.0.1:18081",
493495
)
496+
# Note: TrpcRemoteA2aAgent should be initialized during application startup
497+
# await remote_agent.initialize()
494498

495499
# Create child Agents
496500
data_analyst = LlmAgent(
@@ -502,19 +506,19 @@ data_analyst = LlmAgent(
502506

503507
# Method 1: Provide custom transfer rules
504508
transfer_agent = TransferAgent(
505-
knot_agent,
509+
remote_agent,
506510
model=model,
507511
sub_agents=[data_analyst],
508512
transfer_instruction=(
509-
"After knot-assistant returns results, analyze the response:\n"
513+
"After remote-weather-assistant returns results, analyze the response:\n"
510514
"1. If the result contains data or statistics, transfer to data_analyst.\n"
511515
"2. Otherwise, return directly to the user."
512516
),
513517
)
514518

515519
# Method 2: Use default transfer rules (do not provide transfer_instruction)
516520
transfer_agent = TransferAgent(
517-
knot_agent,
521+
remote_agent,
518522
model=model,
519523
sub_agents=[data_analyst],
520524
)
@@ -551,7 +555,7 @@ The default rules automatically analyze the target Agent's results:
551555
#### Agent Naming
552556

553557
TransferAgent's name is automatically generated in the format `transfer_{target_agent_name}`. For example:
554-
- If the target Agent's name is `knot-assistant`, the TransferAgent's name will be `transfer_knot-assistant`
558+
- If the target Agent's name is `remote-weather-assistant`, the TransferAgent's name will be `transfer_remote-weather-assistant`
555559
- If the target Agent's name is `custom-agent`, the TransferAgent's name will be `transfer_custom-agent`
556560

557561
#### Notes

docs/mkdocs/en/openclaw.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# OpenClaw (trpc-claw)
1+
# OpenClaw (trpc_claw)
22

3-
`openclaw` is an agent runtime built on top of `trpc_agent_sdk` and `nanobot`, supporting:
3+
`openclaw` (also called `trpc_claw`) is an agent runtime built on top of `trpc_agent_sdk` and `nanobot`, supporting:
44

55
- Third-party channel integrations (for example: Telegram / WeCom and other channels supported by nanobot). OpenClaw supports all of these channels. See [nanobot/channels](https://github.com/HKUDS/nanobot/tree/main/nanobot/channels).
66
- Local CLI fallback mode
77
- Tool invocation (file, shell, web, messaging, scheduled tasks, MCP, skills)
88
- Session/memory management and summarization
99
- Heartbeat/Cron scheduled execution
1010

11-
Default workspace: `~/.trpc_agent_claw/workspace`
11+
Default workspace: `~/.trpc_claw/workspace`
1212

1313
## Core Capabilities
1414

@@ -61,31 +61,29 @@ Current recommended command entry point (aligned with the repository state):
6161
trpc_agent_cmd openclaw --help
6262
```
6363

64-
> Note: older docs may mention `trpc-claw-py`; use `trpc_agent_cmd openclaw` as the authoritative command.
65-
6664
### 3) Generate Config Templates
6765

6866
```bash
69-
mkdir -p ~/.trpc_agent_claw
67+
mkdir -p ~/.trpc_claw
7068

7169
# Minimal template
72-
trpc_agent_cmd openclaw conf_temp > ~/.trpc_agent_claw/config.yaml
70+
trpc_agent_cmd openclaw conf_temp > ~/.trpc_claw/config.yaml
7371

7472
# Full template (recommended)
75-
trpc_agent_cmd openclaw conf_temp --full > ~/.trpc_agent_claw/config_full.yaml
73+
trpc_agent_cmd openclaw conf_temp --full > ~/.trpc_claw/config_full.yaml
7674
```
7775

7876
### 4) Startup Modes
7977

8078
```bash
8179
# Auto mode: use gateway if channels are available; otherwise fall back to CLI
82-
trpc_agent_cmd openclaw run -c ~/.trpc_agent_claw/config_full.yaml
80+
trpc_agent_cmd openclaw run -c ~/.trpc_claw/config_full.yaml
8381

8482
# Force local CLI interaction
85-
trpc_agent_cmd openclaw chat -c ~/.trpc_agent_claw/config_full.yaml
83+
trpc_agent_cmd openclaw chat -c ~/.trpc_claw/config_full.yaml
8684

8785
# Start UI
88-
trpc_agent_cmd openclaw ui -c ~/.trpc_agent_claw/config_full.yaml
86+
trpc_agent_cmd openclaw ui -c ~/.trpc_claw/config_full.yaml
8987
```
9088

9189
## Command Reference
@@ -106,23 +104,23 @@ trpc_agent_cmd openclaw ui -c ~/.trpc_agent_claw/config_full.yaml
106104
```bash
107105
# Inspect by profile (recommended)
108106
trpc_agent_cmd openclaw deps \
109-
-c ~/.trpc_agent_claw/config_full.yaml \
107+
-c ~/.trpc_claw/config_full.yaml \
110108
--profile common-file-tools
111109

112110
# Inspect by skill
113111
trpc_agent_cmd openclaw deps \
114-
-c ~/.trpc_agent_claw/config_full.yaml \
115-
--skills knot-skill-finder
112+
-c ~/.trpc_claw/config_full.yaml \
113+
--skills {skill-finder} # Placeholder skill name for downloading skills; replace with your real skill name
116114

117115
# Output JSON
118116
trpc_agent_cmd openclaw deps \
119-
-c ~/.trpc_agent_claw/config_full.yaml \
117+
-c ~/.trpc_claw/config_full.yaml \
120118
--profile common-file-tools \
121119
--json
122120

123121
# Execute the installation plan directly
124122
trpc_agent_cmd openclaw deps \
125-
-c ~/.trpc_agent_claw/config_full.yaml \
123+
-c ~/.trpc_claw/config_full.yaml \
126124
--profile common-file-tools \
127125
--apply
128126
```
@@ -141,17 +139,17 @@ Common options:
141139

142140
Configuration supports `YAML/JSON`, default lookup path:
143141

144-
- `~/.trpc_agent_claw/config.json`
142+
- `~/.trpc_claw/config.json`
145143

146144
You can override via:
147145

148146
- CLI argument: `-c/--config`
149-
- Environment variable: `TRPC_AGENT_CLAW_CONFIG`
147+
- Environment variable: `TRPC_CLAW_CONFIG`
150148

151149
Example:
152150

153151
```bash
154-
export TRPC_AGENT_CLAW_CONFIG=/path/to/config.yaml
152+
export TRPC_CLAW_CONFIG=/path/to/config.yaml
155153
trpc_agent_cmd openclaw chat
156154
```
157155

@@ -203,19 +201,21 @@ skills:
203201
skill_roots: []
204202
builtin_skill_roots: []
205203
config_keys:
206-
- knot.enabled
207-
- knot
204+
- skillhub.enabled
205+
- skillhub
208206
allow_bundled:
209-
- knot.skill.finder
210-
- knot-skill-finder
207+
- skillhub.skill.finder
208+
- skillhub-finder
211209
skill_configs:
212-
knot-skill-finder:
210+
skillhub-skill-finder:
213211
enabled: true
214212
env:
215-
KNOT_USERNAME: ${KNOT_USERNAME}
216-
KNOT_API_TOKEN: ${KNOT_API_TOKEN}
213+
SKILLHUB_USERNAME: ${SKILLHUB_USERNAME}
214+
SKILLHUB_TOKEN: ${SKILLHUB_TOKEN}
217215
```
218216
217+
Note: `skillhub-skill-finder` is only an example. Replace it with your actual skill name in real usage.
218+
219219
### tools
220220

221221
- `restrict_to_workspace`: restrict tools to operate inside workspace only
@@ -241,8 +241,8 @@ skills:
241241

242242
## Default Directories
243243

244-
- Config directory: `~/.trpc_agent_claw/`
245-
- Workspace: `~/.trpc_agent_claw/workspace`
244+
- Config directory: `~/.trpc_claw/`
245+
- Workspace: `~/.trpc_claw/workspace`
246246

247247
## Integrate with ClawBot
248248

@@ -268,7 +268,7 @@ export TRPC_AGENT_BASE_URL=xxx
268268
export TRPC_AGENT_MODEL_NAME=xxx
269269
export WECOM_BOT_ID=xxx
270270
export WECOM_BOT_SECRET=xxx
271-
trpc_agent_cmd openclaw run -c ~/.trpc_agent_claw/config_full.yaml
271+
trpc_agent_cmd openclaw run -c ~/.trpc_claw/config_full.yaml
272272
```
273273

274274
![wecom](./image/wecom.png)
@@ -288,7 +288,7 @@ Start:
288288

289289
```bash
290290
export TELEGRAM_BOT_TOKEN=xxx
291-
trpc_agent_cmd openclaw run -c ~/.trpc_agent_claw/config_full.yaml
291+
trpc_agent_cmd openclaw run -c ~/.trpc_claw/config_full.yaml
292292
```
293293

294294
![telegram](./image/telegram.png)
@@ -378,7 +378,7 @@ tools:
378378

379379
```yaml
380380
logger:
381-
name: trpc-claw
381+
name: trpc_claw
382382
log_file: trpc_claw.log
383383
log_level: INFO
384384
log_format: "[%(asctime)s][%(levelname)s][%(name)s][%(pathname)s:%(lineno)d][%(process)d] %(message)s"

0 commit comments

Comments
 (0)