From 6ed95bfaaa1c51344fb000172beabd517977c845 Mon Sep 17 00:00:00 2001 From: jingrow Date: Mon, 3 Nov 2025 04:59:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96jlocal.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jcloud/api/jlocal.py | 6 +++++- .../jcloud/pagetype/local_agent/local_agent.json | 16 ++++++++++++++-- .../jcloud/pagetype/local_agent/local_agent.py | 1 + 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/jcloud/api/jlocal.py b/jcloud/api/jlocal.py index 27ee490..23737cf 100644 --- a/jcloud/api/jlocal.py +++ b/jcloud/api/jlocal.py @@ -663,6 +663,7 @@ def get_local_agent(name): "repository_url": agent.repository_url, "file_url": agent.file_url, "agent_image": agent.agent_image, + "agent_flow": agent.agent_flow, "creation": agent.creation, "modified": agent.modified } @@ -685,6 +686,8 @@ def create_local_agent(agent_data): return {"error": "Agent名称已存在,请使用其他名称"} # 创建Agent + agent_flow = agent_data.get("agent_flow") + agent = jingrow.get_pg({ "pagetype": "Local Agent", "agent_name": agent_data["agent_name"], @@ -694,7 +697,8 @@ def create_local_agent(agent_data): "team": team, "repository_url": agent_data.get("repository_url"), "file_url": agent_data.get("file_url"), - "agent_image": agent_data.get("agent_image") + "agent_image": agent_data.get("agent_image"), + "agent_flow": agent_flow }) agent.insert() diff --git a/jcloud/jcloud/pagetype/local_agent/local_agent.json b/jcloud/jcloud/pagetype/local_agent/local_agent.json index 54efe55..08f3264 100644 --- a/jcloud/jcloud/pagetype/local_agent/local_agent.json +++ b/jcloud/jcloud/pagetype/local_agent/local_agent.json @@ -17,7 +17,9 @@ "team", "agent_image", "section_break_otbv", - "description" + "description", + "agent_flow_tab", + "agent_flow" ], "fields": [ { @@ -93,10 +95,20 @@ "fieldname": "agent_image", "fieldtype": "Attach Image", "label": "Agent Image" + }, + { + "fieldname": "agent_flow_tab", + "fieldtype": "Tab Break", + "label": "Agent Flow" + }, + { + "fieldname": "agent_flow", + "fieldtype": "JSON", + "label": "Agent Flow" } ], "links": [], - "modified": "2025-11-02 04:51:31.964965", + "modified": "2025-11-03 04:01:44.111717", "modified_by": "Administrator", "module": "Jcloud", "name": "Local Agent", diff --git a/jcloud/jcloud/pagetype/local_agent/local_agent.py b/jcloud/jcloud/pagetype/local_agent/local_agent.py index 951fbf0..efe201f 100644 --- a/jcloud/jcloud/pagetype/local_agent/local_agent.py +++ b/jcloud/jcloud/pagetype/local_agent/local_agent.py @@ -14,6 +14,7 @@ class LocalAgent(Page): if TYPE_CHECKING: from jingrow.types import DF + agent_flow: DF.JSON | None agent_image: DF.AttachImage | None agent_name: DF.Data enabled: DF.Check