sync: 鍚屾灞€鍩熺綉鏈€鏂颁唬鐮?(source master @ b69568e4)
This commit is contained in:
1 parent
4f7f07504a
commit
8bc8b0e082
1651 files changed
+278599
-11416
No files matched your search
@@ -70,6 +70,9 @@ POSITION_INTENT_AGENT_ID = "position-roundtable-intent"
|
||||
# 功能/提示词同源(资源文件即字节级复制的验证版),但落成**独立目录**,供
|
||||
# 8BF 部署现场单独调优 SOUL,不影响通用多智能体会商的契约。
|
||||
EIGHTBF_INTENT_AGENT_ID = "eightbf-roundtable-intent"
|
||||
# 报告协同第一阶段专用意图智能体。它复用真实 LangGraph agent thread / SSE
|
||||
# 运行协议,但拥有独立 SOUL 和结构化交接契约,不能再退回一次性 ainvoke 包装。
|
||||
REPORT_COLLABORATION_INTENT_AGENT_ID = "report-collaboration-intent"
|
||||
RECOMMENDER_AGENT_ID = "roundtable-recommender"
|
||||
COORDINATOR_AGENT_ID = "roundtable-coordinator"
|
||||
# Step 3「结果绘制」用的方案可视化总结智能体:读各席位交付 + 共识,画自包含图表 HTML。
|
||||
@@ -106,6 +109,7 @@ _FUNCTIONAL_AGENT_IDS: tuple[str, ...] = (
|
||||
INTENT_AGENT_ID,
|
||||
POSITION_INTENT_AGENT_ID,
|
||||
EIGHTBF_INTENT_AGENT_ID,
|
||||
REPORT_COLLABORATION_INTENT_AGENT_ID,
|
||||
RECOMMENDER_AGENT_ID,
|
||||
COORDINATOR_AGENT_ID,
|
||||
REPORT_AGENT_ID,
|
||||
@@ -120,23 +124,35 @@ _SEED_FILES: tuple[str, ...] = ("config.yaml", "SOUL.md")
|
||||
_ACTION_PLAN_SKILL = "position-roundtable-action-create"
|
||||
|
||||
|
||||
def _ensure_action_plan_skill(agent_dir: Path) -> bool:
|
||||
"""Merge the owned batch-create Skill into an existing action planner.
|
||||
def _ensure_action_plan_contract(agent_dir: Path) -> bool:
|
||||
"""Refresh the action-type contract and retain the batch-create skill binding.
|
||||
|
||||
The planner SOUL remains editable in the agent configuration drawer and is
|
||||
therefore never overwritten here. The skill binding, however, is a runtime
|
||||
integration contract: without it an already-deployed planner cannot read
|
||||
the new SKILL.md or invoke the batch API script after a code upgrade.
|
||||
``actionType`` changed from a task-system enum to a model-derived name. An
|
||||
already seeded planner must receive this contract update; otherwise its
|
||||
persisted SOUL would continue to require frontend ``dictValue`` input after
|
||||
a deployment. Other optional skills on a deployed agent are preserved.
|
||||
"""
|
||||
changed = False
|
||||
source_soul = _ASSETS_DIR / ACTION_PLAN_AGENT_ID / "SOUL.md"
|
||||
target_soul = agent_dir / "SOUL.md"
|
||||
try:
|
||||
source_bytes = source_soul.read_bytes()
|
||||
if not target_soul.exists() or target_soul.read_bytes() != source_bytes:
|
||||
target_soul.write_bytes(source_bytes)
|
||||
changed = True
|
||||
except OSError:
|
||||
logger.warning("Unable to refresh action planner contract: %s", target_soul)
|
||||
return changed
|
||||
|
||||
config_path = agent_dir / "config.yaml"
|
||||
try:
|
||||
config = yaml.safe_load(config_path.read_text(encoding="utf-8")) if config_path.exists() else {}
|
||||
except (OSError, yaml.YAMLError):
|
||||
logger.warning("Unable to read action planner config for skill binding: %s", config_path)
|
||||
return False
|
||||
return changed
|
||||
if not isinstance(config, dict):
|
||||
logger.warning("Action planner config is not a mapping; skip skill binding: %s", config_path)
|
||||
return False
|
||||
return changed
|
||||
skills = config.get("skills")
|
||||
if skills is None:
|
||||
normalized: list[str] = []
|
||||
@@ -144,9 +160,9 @@ def _ensure_action_plan_skill(agent_dir: Path) -> bool:
|
||||
normalized = [str(name).strip() for name in skills if str(name).strip()]
|
||||
else:
|
||||
logger.warning("Action planner skills is not a list; skip skill binding: %s", config_path)
|
||||
return False
|
||||
return changed
|
||||
if _ACTION_PLAN_SKILL in normalized:
|
||||
return False
|
||||
return changed
|
||||
|
||||
config["skills"] = [*normalized, _ACTION_PLAN_SKILL]
|
||||
try:
|
||||
@@ -156,7 +172,7 @@ def _ensure_action_plan_skill(agent_dir: Path) -> bool:
|
||||
)
|
||||
except OSError:
|
||||
logger.warning("Unable to write action planner skill binding: %s", config_path)
|
||||
return False
|
||||
return changed
|
||||
return True
|
||||
|
||||
|
||||
@@ -164,10 +180,11 @@ def _ensure_one(agent_id: str) -> bool:
|
||||
"""Copy the verified SOUL.md + config.yaml for one functional agent into
|
||||
``.deer-flow/agents/<id>/`` if that directory is missing.
|
||||
|
||||
The position-roundtable intent agent is an implementation-owned compatibility
|
||||
contract: unlike user-managed agents, its schema must stay aligned with the
|
||||
position workspace. Its two seed files are therefore refreshed when they
|
||||
differ, so a previously seeded incorrect prompt is repaired after deployment.
|
||||
The position-roundtable intent agent and action planner are implementation-
|
||||
owned compatibility contracts: unlike user-managed agents, their required
|
||||
prompts must stay aligned with the position workspace. Their affected seed
|
||||
files are therefore refreshed when they differ, so a previously seeded
|
||||
incorrect prompt is repaired after deployment.
|
||||
|
||||
Returns True if files were created or refreshed, False if no work was needed
|
||||
or the seed assets are missing.
|
||||
@@ -186,8 +203,8 @@ def _ensure_one(agent_id: str) -> bool:
|
||||
agent_dir = get_paths().agent_dir(agent_id)
|
||||
if agent_dir.exists():
|
||||
if agent_id == ACTION_PLAN_AGENT_ID:
|
||||
return _ensure_action_plan_skill(agent_dir)
|
||||
if agent_id != POSITION_INTENT_AGENT_ID:
|
||||
return _ensure_action_plan_contract(agent_dir)
|
||||
if agent_id not in {POSITION_INTENT_AGENT_ID, REPORT_COLLABORATION_INTENT_AGENT_ID}:
|
||||
# Other built-in agents may have been tuned on a deployed machine;
|
||||
# preserve the long-standing no-overwrite behavior for them.
|
||||
return False
|
||||
|
||||
Reference in new issue
Block a user