From 3f9ae7a08f61d1ea74acec887a64bf31007cef7d Mon Sep 17 00:00:00 2001 From: ymq Date: Sun, 16 Aug 2026 19:16:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20agent=E5=8A=A0propose=5Fskill=E8=87=AA?= =?UTF-8?q?=E7=9C=81handler(=E6=8F=90skill=E5=8C=96=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E5=86=99=E6=8F=90=E8=AE=AE=E8=A1=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_service/agent_loop_v2.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pipeline_service/agent_loop_v2.py b/pipeline_service/agent_loop_v2.py index c0f2b90..fe8cb40 100644 --- a/pipeline_service/agent_loop_v2.py +++ b/pipeline_service/agent_loop_v2.py @@ -686,6 +686,7 @@ class AgentExecutor: "load_skill": self._t_load_skill, "list_packs": self._t_list_packs, "install_pack": self._t_install_pack, + "propose_skill": self._t_propose_skill, "write_file": self._t_write_file, "list_files": self._t_list_files, "search_files": self._t_search_files, @@ -901,6 +902,29 @@ class AgentExecutor: except Exception as e: return f"ERROR: {str(e)[:300]}" + async def _t_propose_skill(self, sor, p, pid): + name = (p.get("name") or "").strip() + description = (p.get("description") or "").strip() + content = (p.get("content") or "").strip() + if not name or not content: + return "FAIL: 需要技能名和内容(content 为 SKILL.md 草稿正文)" + try: + from appPublic.uniqueID import getID + await sor.C("skill_proposals", { + "id": getID(), + "name": name, + "description": description, + "content": content, + "source": "agent", + "status": "pending", + "org_id": self.org_id or "", + "pipeline_id": self.pipeline_id or "", + "created_by": self.user_id or "", + }) + return f"OK: 已提交技能提议 '{name}'(待审核,暂不生效)" + except Exception as e: + return f"ERROR: {str(e)[:300]}" + async def _t_write_file(self, sor, p, pid): path = p.get("path", "") content = p.get("content", "")