Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions agents/taizi/SOUL.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 太子 · 皇上代理

你是太子,皇上在飞书上所有消息的第一接收人和分拣者
你是太子,皇上在所有通信渠道(飞书、Telegram、iMessage、QQ 等)消息的第一接收人和分拣者

## 核心职责
1. 接收皇上通过飞书发来的**所有消息**
1. 接收皇上通过任意渠道发来的**所有消息**
2. **判断消息类型**:闲聊/问答 vs 正式旨意/复杂任务
3. 简单消息 → **自己直接回复皇上**(不创建任务)
4. 旨意/复杂任务 → **自己用人话重新概括**后转交中书省(创建 JJC 任务)
5. 收到尚书省的最终回奏 → **在飞书原对话中回复皇上**
5. 收到尚书省的最终回奏 → **在原对话渠道中回复皇上**

---

Expand Down
2 changes: 1 addition & 1 deletion agents/zaochao/SOUL.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
python3 scripts/refresh_live_data.py # 在项目根目录下执行
```

4. 用飞书通知皇上(可选,如果配置了飞书的话
4. 用皇上通知皇上(可选,如果配置了皇上的话

注意:
- 标题和摘要均翻译为中文
Expand Down
4 changes: 2 additions & 2 deletions agents/zhongshu/SOUL.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ python3 scripts/kanban_update.py flow JJC-xxx "中书省" "尚书省" "✅ 门
```bash
python3 scripts/kanban_update.py done JJC-xxx "<产出>" "<摘要>"
```
回复飞书消息,简要汇报结果。
回复皇上消息,简要汇报结果。

---

Expand Down Expand Up @@ -94,7 +94,7 @@ python3 scripts/kanban_update.py todo JJC-xxx 2 "方案起草" completed --detai
```
```

> ⚠️ 标题**不要**夹带飞书消息的 JSON 元数据(Conversation info 等),只提取旨意正文!
> ⚠️ 标题**不要**夹带皇上消息的 JSON 元数据(Conversation info 等),只提取旨意正文!
> ⚠️ 标题必须是中文概括的一句话(10-30字),**严禁**包含文件路径、URL、代码片段!
> ⚠️ flow/state 的说明文本也不要粘贴原始消息,用自己的话概括!

Expand Down
47 changes: 47 additions & 0 deletions fix-existing-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
# 三省六部 · 修复已安装实例的数据同步问题

REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OC_HOME="$HOME/.openclaw"

echo "开始修复三省六部..."

# 修复所有 agent workspace
AGENTS="taizi zhongshu menxia shangshu hubu libu bingbu xingbu gongbu libu_hr zaochao"

for agent in $AGENTS; do
ws="$OC_HOME/workspace-$agent"
if [ -d "$ws" ]; then
# 软链接 scripts
rm -rf "$ws/scripts" 2>/dev/null
ln -sf "$REPO_DIR/scripts" "$ws/scripts"
# 软链接 data 文件
mkdir -p "$ws/data"
for f in tasks_source.json live_status.json agent_config.json officials_stats.json; do
if [ -f "$REPO_DIR/data/$f" ]; then
rm -f "$ws/data/$f"
ln -sf "$REPO_DIR/data/$f" "$ws/data/$f"
fi
done
echo "✅ 已修复: $agent"
fi
done

# 修复 main workspace(如果存在)
ws_main="$OC_HOME/workspace"
if [ -d "$ws_main" ]; then
rm -rf "$ws_main/scripts" 2>/dev/null
ln -sf "$REPO_DIR/scripts" "$ws_main/scripts"
mkdir -p "$ws_main/data"
for f in tasks_source.json live_status.json agent_config.json officials_stats.json; do
if [ -f "$REPO_DIR/data/$f" ]; then
rm -f "$ws_main/data/$f"
ln -sf "$REPO_DIR/data/$f" "$ws_main/data/$f"
fi
done
echo "✅ 已修复: main"
fi

echo ""
echo "修复完成!请刷新看板:"
echo " python3 $REPO_DIR/scripts/refresh_live_data.py"
91 changes: 90 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,23 @@ create_workspaces() {

AGENTS=(taizi zhongshu menxia shangshu hubu libu bingbu xingbu gongbu libu_hr zaochao)
for agent in "${AGENTS[@]}"; do
# 同时处理 main workspace
if [ "$agent" = "taizi" ]; then
ws_main="$OC_HOME/workspace"
if [ -d "$ws_main" ]; then
mkdir -p "$ws_main/data"
for f in tasks_source.json live_status.json agent_config.json officials_stats.json sync_status.json morning_brief.json pending_model_changes.json model_change_log.json; do
if [ -f "$REPO_DIR/data/$f" ]; then
if [ -f "$ws_main/data/$f" ] && [ ! -L "$ws_main/data/$f" ]; then
mv "$ws_main/data/$f" "$ws_main/data/$f.bak.$(date +%Y%m%d-%H%M%S)"
fi
rm -f "$ws_main/data/$f"
ln -sf "$REPO_DIR/data/$f" "$ws_main/data/$f"
fi
done
log "资源链接: main"
fi
fi
ws="$OC_HOME/workspace-$agent"
mkdir -p "$ws/skills"
if [ -f "$REPO_DIR/agents/$agent/SOUL.md" ]; then
Expand All @@ -109,6 +126,23 @@ create_workspaces() {

# 通用 AGENTS.md(工作协议)
for agent in "${AGENTS[@]}"; do
# 同时处理 main workspace
if [ "$agent" = "taizi" ]; then
ws_main="$OC_HOME/workspace"
if [ -d "$ws_main" ]; then
mkdir -p "$ws_main/data"
for f in tasks_source.json live_status.json agent_config.json officials_stats.json sync_status.json morning_brief.json pending_model_changes.json model_change_log.json; do
if [ -f "$REPO_DIR/data/$f" ]; then
if [ -f "$ws_main/data/$f" ] && [ ! -L "$ws_main/data/$f" ]; then
mv "$ws_main/data/$f" "$ws_main/data/$f.bak.$(date +%Y%m%d-%H%M%S)"
fi
rm -f "$ws_main/data/$f"
ln -sf "$REPO_DIR/data/$f" "$ws_main/data/$f"
fi
done
log "资源链接: main"
fi
fi
cat > "$OC_HOME/workspace-$agent/AGENTS.md" << 'AGENTS_EOF'
# AGENTS.md · 工作协议

Expand All @@ -120,7 +154,61 @@ AGENTS_EOF
done
}

# ── Step 2: 注册 Agents ─────────────────────────────────────

# ── Step 2.5: 链接共享资源 ───────────────────────────────────
link_resources() {
info "链接共享资源 (scripts + data)..."

AGENTS=(taizi zhongshu menxia shangshu hubu libu bingbu xingbu gongbu libu_hr zaochao)

for agent in "${AGENTS[@]}"; do
# 同时处理 main workspace
if [ "$agent" = "taizi" ]; then
ws_main="$OC_HOME/workspace"
if [ -d "$ws_main" ]; then
mkdir -p "$ws_main/data"
for f in tasks_source.json live_status.json agent_config.json officials_stats.json sync_status.json morning_brief.json pending_model_changes.json model_change_log.json; do
if [ -f "$REPO_DIR/data/$f" ]; then
if [ -f "$ws_main/data/$f" ] && [ ! -L "$ws_main/data/$f" ]; then
mv "$ws_main/data/$f" "$ws_main/data/$f.bak.$(date +%Y%m%d-%H%M%S)"
fi
rm -f "$ws_main/data/$f"
ln -sf "$REPO_DIR/data/$f" "$ws_main/data/$f"
fi
done
log "资源链接: main"
fi
fi
ws="$OC_HOME/workspace-$agent"

if [ -d "$ws" ]; then
# 软链接 scripts 目录
if [ -e "$ws/scripts" ]; then
rm -rf "$ws/scripts"
fi
ln -sf "$REPO_DIR/scripts" "$ws/scripts"

# 创建 data 目录并软链接主数据文件
mkdir -p "$ws/data"

for f in tasks_source.json live_status.json agent_config.json officials_stats.json sync_status.json morning_brief.json pending_model_changes.json model_change_log.json; do
if [ -f "$REPO_DIR/data/$f" ]; then
if [ -f "$ws/data/$f" ] && [ ! -L "$ws/data/$f" ]; then
mv "$ws/data/$f" "$ws/data/$f.bak.$(date +%Y%m%d-%H%M%S)"
fi
rm -f "$ws/data/$f"
ln -sf "$REPO_DIR/data/$f" "$ws/data/$f"
fi
done

log "资源链接: $agent"
fi
done

log "共享资源链接完成"
}


register_agents() {
info "注册三省六部 Agents..."

Expand Down Expand Up @@ -275,6 +363,7 @@ banner
check_deps
backup_existing
create_workspaces
link_resources
register_agents
init_data
build_frontend
Expand Down