Compare commits
8 Commits
pku
...
23db6fc4a1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23db6fc4a1 | ||
|
|
ab8c9e294d | ||
|
|
1aa9e280b0 | ||
|
|
041986f5cd | ||
|
|
00ef22505e | ||
|
|
b73419b7a0 | ||
|
|
974af053ca | ||
|
|
0c571dec21 |
@@ -6,11 +6,12 @@ import os
|
||||
|
||||
# load config (apikey, apibase, model)
|
||||
yaml_file = os.path.join(os.getcwd(), "config", "config.yaml")
|
||||
yaml_data = {}
|
||||
try:
|
||||
with open(yaml_file, "r", encoding="utf-8") as file:
|
||||
yaml_data = yaml.safe_load(file)
|
||||
except Exception:
|
||||
yaml_file = {}
|
||||
yaml_data = {}
|
||||
OPENAI_API_BASE = os.getenv("OPENAI_API_BASE") or yaml_data.get(
|
||||
"OPENAI_API_BASE", "https://api.openai.com"
|
||||
)
|
||||
@@ -37,7 +38,28 @@ MISTRAL_API_KEY = os.getenv("MISTRAL_API_KEY") or yaml_data.get(
|
||||
def LLM_Completion(
|
||||
messages: list[dict], stream: bool = True, useGroq: bool = True
|
||||
) -> str:
|
||||
if not useGroq or not FAST_DESIGN_MODE:
|
||||
# 增强消息验证:确保所有消息的 role 和 content 非空且不是空白字符串
|
||||
if not messages or len(messages) == 0:
|
||||
raise ValueError("Messages list is empty")
|
||||
|
||||
# print(f"[DEBUG] LLM_Completion received {len(messages)} messages", flush=True)
|
||||
|
||||
for i, msg in enumerate(messages):
|
||||
if not isinstance(msg, dict):
|
||||
raise ValueError(f"Message at index {i} is not a dictionary")
|
||||
if not msg.get("role") or str(msg.get("role")).strip() == "":
|
||||
raise ValueError(f"Message at index {i} has empty 'role'")
|
||||
if not msg.get("content") or str(msg.get("content")).strip() == "":
|
||||
raise ValueError(f"Message at index {i} has empty 'content'")
|
||||
|
||||
# 额外验证:确保content不会因为格式化问题变成空
|
||||
content = str(msg.get("content")).strip()
|
||||
if len(content) < 10: # 设置最小长度阈值
|
||||
print(f"[WARNING] Message at index {i} has very short content: '{content}'", flush=True)
|
||||
# 修改1
|
||||
if not GROQ_API_KEY:
|
||||
useGroq = False
|
||||
elif not useGroq or not FAST_DESIGN_MODE:
|
||||
force_gpt4 = True
|
||||
useGroq = False
|
||||
else:
|
||||
@@ -137,16 +159,23 @@ async def _achat_completion_stream_mixtral(messages: list[dict]) -> str:
|
||||
async def _achat_completion_stream_gpt35(messages: list[dict]) -> str:
|
||||
openai.api_key = OPENAI_API_KEY
|
||||
openai.api_base = OPENAI_API_BASE
|
||||
response = await openai.ChatCompletion.acreate(
|
||||
messages=messages,
|
||||
max_tokens=4096,
|
||||
n=1,
|
||||
stop=None,
|
||||
temperature=0.3,
|
||||
timeout=3,
|
||||
model="gpt-3.5-turbo-16k",
|
||||
stream=True,
|
||||
)
|
||||
|
||||
kwargs = {
|
||||
"messages": messages,
|
||||
"max_tokens": 4096,
|
||||
"n": 1,
|
||||
"stop": None,
|
||||
"temperature": 0.3,
|
||||
"timeout": 3,
|
||||
"model": "gpt-3.5-turbo-16k",
|
||||
"stream": True,
|
||||
}
|
||||
# print("[DEBUG] about to call acreate with kwargs:", type(kwargs), kwargs)
|
||||
assert kwargs is not None, "kwargs is None right before acreate!"
|
||||
assert isinstance(kwargs, dict), "kwargs must be dict!"
|
||||
response = await openai.ChatCompletion.acreate(**kwargs)
|
||||
|
||||
|
||||
|
||||
# create variables to collect the stream of chunks
|
||||
collected_chunks = []
|
||||
@@ -205,6 +234,9 @@ async def _achat_completion_json(messages: list[dict]) -> str:
|
||||
|
||||
|
||||
async def _achat_completion_stream(messages: list[dict]) -> str:
|
||||
# print(">>>> _achat_completion_stream 被调用", flush=True)
|
||||
# print(">>>> messages 实参 =", messages, flush=True)
|
||||
# print(">>>> messages 类型 =", type(messages), flush=True)
|
||||
openai.api_key = OPENAI_API_KEY
|
||||
openai.api_base = OPENAI_API_BASE
|
||||
response = await openai.ChatCompletion.acreate(
|
||||
@@ -237,10 +269,8 @@ async def _achat_completion_stream(messages: list[dict]) -> str:
|
||||
|
||||
|
||||
def _chat_completion(messages: list[dict]) -> str:
|
||||
print(messages, flush=True)
|
||||
rsp = openai.ChatCompletion.create(**_cons_kwargs(messages))
|
||||
content = rsp["choices"][0]["message"]["content"]
|
||||
print(content, flush=True)
|
||||
return content
|
||||
|
||||
|
||||
@@ -248,11 +278,54 @@ def _cons_kwargs(messages: list[dict]) -> dict:
|
||||
kwargs = {
|
||||
"messages": messages,
|
||||
"max_tokens": 4096,
|
||||
"n": 1,
|
||||
"stop": None,
|
||||
"temperature": 0.5,
|
||||
"timeout": 3,
|
||||
}
|
||||
kwargs_mode = {"model": MODEL}
|
||||
kwargs.update(kwargs_mode)
|
||||
print("[DEBUG] kwargs =", kwargs)
|
||||
assert isinstance(kwargs, dict), f"_cons_kwargs returned {type(kwargs)}, must be dict"
|
||||
|
||||
# 添加调试信息
|
||||
print(f'[DEBUG] _cons_kwargs messages: {messages}', flush=True)
|
||||
|
||||
# 检查并修复消息中的null值
|
||||
for i, msg in enumerate(messages):
|
||||
# 确保msg是字典
|
||||
if not isinstance(msg, dict):
|
||||
print(f"[ERROR] Message {i} is not a dictionary: {msg}", flush=True)
|
||||
messages[i] = {"role": "user", "content": str(msg) if msg is not None else ""}
|
||||
continue
|
||||
|
||||
# 确保role和content存在且不为None
|
||||
if "role" not in msg or msg["role"] is None:
|
||||
print(f"[ERROR] Message {i} missing role, setting to 'user'", flush=True)
|
||||
msg["role"] = "user"
|
||||
else:
|
||||
msg["role"] = str(msg["role"]).strip()
|
||||
|
||||
if "content" not in msg or msg["content"] is None:
|
||||
print(f"[ERROR] Message {i} missing content, setting to empty string", flush=True)
|
||||
msg["content"] = ""
|
||||
else:
|
||||
msg["content"] = str(msg["content"]).strip()
|
||||
|
||||
# 根据不同的API提供商调整参数
|
||||
if "deepseek" in MODEL.lower():
|
||||
# DeepSeek API特殊处理
|
||||
print("[DEBUG] DeepSeek API detected, adjusting parameters", flush=True)
|
||||
kwargs.pop("n", None) # 移除n参数,DeepSeek可能不支持
|
||||
if "timeout" in kwargs:
|
||||
kwargs.pop("timeout", None)
|
||||
# DeepSeek可能不支持stop参数
|
||||
kwargs.pop("stop", None)
|
||||
else:
|
||||
# OpenAI兼容的API
|
||||
kwargs["n"] = 1
|
||||
kwargs["stop"] = None
|
||||
kwargs["timeout"] = 3
|
||||
|
||||
kwargs["model"] = MODEL
|
||||
|
||||
# 确保messages列表中的每个元素都有有效的role和content
|
||||
kwargs["messages"] = [msg for msg in messages if msg["role"] and msg["content"]]
|
||||
print(f"[DEBUG] Final kwargs for API call: {kwargs.keys()}", flush=True)
|
||||
|
||||
return kwargs
|
||||
@@ -83,7 +83,6 @@ class JSON_Agent(BaseModel):
|
||||
class JSON_AGENT_ABILITY_SCORING(RootModel):
|
||||
root: Dict[str, JSON_Agent]
|
||||
|
||||
|
||||
def agentAbilityScoring(Agent_Board, Ability_Requirement_List):
|
||||
scoreTable = {}
|
||||
for Ability_Requirement in Ability_Requirement_List:
|
||||
@@ -105,7 +104,7 @@ def agentAbilityScoring(Agent_Board, Ability_Requirement_List):
|
||||
return scoreTable
|
||||
|
||||
|
||||
def AgentSelectModify_init(stepTask, General_Goal, Agent_Board):
|
||||
async def AgentSelectModify_init(stepTask, General_Goal, Agent_Board):
|
||||
Current_Task = {
|
||||
"TaskName": stepTask["StepName"],
|
||||
"InputObject_List": stepTask["InputObject_List"],
|
||||
@@ -125,10 +124,10 @@ def AgentSelectModify_init(stepTask, General_Goal, Agent_Board):
|
||||
),
|
||||
},
|
||||
]
|
||||
Ability_Requirement_List = read_LLM_Completion(messages)[
|
||||
Ability_Requirement_List = await read_LLM_Completion(messages)[
|
||||
"AbilityRequirement"
|
||||
]
|
||||
scoreTable = agentAbilityScoring(Agent_Board, Ability_Requirement_List)
|
||||
scoreTable = await agentAbilityScoring(Agent_Board, Ability_Requirement_List)
|
||||
return scoreTable
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class JSON_ABILITY_REQUIREMENT_GENERATION(BaseModel):
|
||||
|
||||
PROMPT_AGENT_SELECTION_GENERATION = """
|
||||
## Instruction
|
||||
Based on "General Goal", "Current Task" and "Agent Board", output a formatted "Agent Selection Plan". Your selection should consider the ability needed for "Current Task" and the profile of each agent in "Agent Board". Agent Selection Plan ranks from high to low according to ability.
|
||||
Based on "General Goal", "Current Task" and "Agent Board", output a formatted "Agent Selection Plan". Your selection should consider the ability needed for "Current Task" and the profile of each agent in "Agent Board".
|
||||
|
||||
## General Goal (Specify the general goal for the collaboration plan)
|
||||
{General_Goal}
|
||||
@@ -78,7 +78,6 @@ def generate_AbilityRequirement(General_Goal, Current_Task):
|
||||
print(messages[1]["content"])
|
||||
return read_LLM_Completion(messages)["AbilityRequirement"]
|
||||
|
||||
|
||||
def generate_AgentSelection(General_Goal, Current_Task, Agent_Board):
|
||||
messages = [
|
||||
{
|
||||
|
||||
@@ -7,14 +7,22 @@ import AgentCoord.util as util
|
||||
|
||||
|
||||
def generate_basePlan(
|
||||
General_Goal, Agent_Board, AgentProfile_Dict, InitialObject_List, context
|
||||
General_Goal, Agent_Board, AgentProfile_Dict, InitialObject_List
|
||||
):
|
||||
Agent_Board = [
|
||||
{"Name": (a.get("Name") or "").strip(),"Profile": (a.get("Profile") or "").strip()}
|
||||
for a in Agent_Board
|
||||
if a and a.get("Name") is not None
|
||||
]
|
||||
if not Agent_Board: # 洗完后还是空 → 直接返回空计划
|
||||
return {"Plan_Outline": []}
|
||||
|
||||
basePlan = {
|
||||
"Initial Input Object": InitialObject_List,
|
||||
"Collaboration Process": [],
|
||||
}
|
||||
PlanOutline = generate_PlanOutline(
|
||||
InitialObject_List=[], General_Goal=General_Goal + context
|
||||
InitialObject_List=[], General_Goal=General_Goal
|
||||
)
|
||||
for stepItem in PlanOutline:
|
||||
Current_Task = {
|
||||
@@ -44,7 +52,7 @@ def generate_basePlan(
|
||||
),
|
||||
}
|
||||
TaskProcess = generate_TaskProcess(
|
||||
General_Goal=General_Goal + context,
|
||||
General_Goal=General_Goal,
|
||||
Current_Task_Description=Current_Task_Description,
|
||||
)
|
||||
# add the generated AgentSelection and TaskProcess to the stepItem
|
||||
|
||||
@@ -95,7 +95,7 @@ def branch_PlanOutline(
|
||||
},
|
||||
{"role": "system", "content": prompt},
|
||||
]
|
||||
Remaining_Steps = read_LLM_Completion(messages, useGroq=False)[
|
||||
Remaining_Steps = read_LLM_Completion(messages)[
|
||||
"Remaining Steps"
|
||||
]
|
||||
branch_List.append(Remaining_Steps)
|
||||
|
||||
@@ -145,7 +145,7 @@ def branch_TaskProcess(
|
||||
},
|
||||
{"role": "system", "content": prompt},
|
||||
]
|
||||
Remaining_Steps = read_LLM_Completion(messages, useGroq=False)[
|
||||
Remaining_Steps = read_LLM_Completion(messages)[
|
||||
"Remaining Steps"
|
||||
]
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ from AgentCoord.util.converter import read_LLM_Completion
|
||||
from typing import List
|
||||
from pydantic import BaseModel
|
||||
import json
|
||||
|
||||
import asyncio
|
||||
PROMPT_PLAN_OUTLINE_GENERATION = """
|
||||
## Instruction
|
||||
Based on "Output Format Example", "General Goal", and "Initial Key Object List", output a formatted "Plan_Outline". The number of steps in the Plan Outline cannot exceed 5.
|
||||
Based on "Output Format Example", "General Goal", and "Initial Key Object List", output a formatted "Plan_Outline".
|
||||
|
||||
## Initial Key Object List (Specify the list of initial key objects available, each initial key object should be the input object of at least one Step)
|
||||
{InitialObject_List}
|
||||
@@ -51,7 +51,6 @@ TaskContent: Describe the task of the current step.
|
||||
InputObject_List: The list of the input obejects that will be used in current step.
|
||||
OutputObject: The name of the final output object of current step.
|
||||
|
||||
请用中文回答
|
||||
"""
|
||||
|
||||
|
||||
@@ -70,6 +69,13 @@ class PlanOutline(BaseModel):
|
||||
|
||||
|
||||
def generate_PlanOutline(InitialObject_List, General_Goal):
|
||||
# 新增:校验 General_Goal 必须有有效内容
|
||||
if not isinstance(General_Goal, str) or len(General_Goal.strip()) == 0:
|
||||
raise ValueError("General_Goal 不能为空!必须提供具体的目标描述")
|
||||
|
||||
# 处理 InitialObject_List 为空的情况(可选,但更友好)
|
||||
if not InitialObject_List:
|
||||
InitialObject_List = ["无初始对象"] # 避免空列表导致的歧义
|
||||
messages = [
|
||||
{
|
||||
"role": "system",
|
||||
@@ -84,4 +90,11 @@ def generate_PlanOutline(InitialObject_List, General_Goal):
|
||||
),
|
||||
},
|
||||
]
|
||||
|
||||
# 二次校验 messages 内容(防止意外空值)
|
||||
for msg in messages:
|
||||
content = msg.get("content", "").strip()
|
||||
if not content:
|
||||
raise ValueError("生成的 LLM 请求消息内容为空,请检查参数")
|
||||
|
||||
return read_LLM_Completion(messages)["Plan_Outline"]
|
||||
|
||||
@@ -90,7 +90,6 @@ InputObject_List: List existing objects that should be utilized in current step.
|
||||
AgentName: Specify the agent who will perform the action, You CAN ONLY USE THE NAME APPEARS IN "AgentInvolved".
|
||||
ActionType: Specify the type of action, note that only the last action can be of type "Finalize", and the last action must be "Finalize".
|
||||
|
||||
请用中文回答
|
||||
"""
|
||||
|
||||
|
||||
@@ -107,6 +106,9 @@ class TaskProcessPlan(BaseModel):
|
||||
|
||||
|
||||
def generate_TaskProcess(General_Goal, Current_Task_Description):
|
||||
# 新增参数验证
|
||||
if not General_Goal or str(General_Goal).strip() == "":
|
||||
raise ValueError("General_Goal cannot be empty")
|
||||
messages = [
|
||||
{
|
||||
"role": "system",
|
||||
|
||||
@@ -83,7 +83,7 @@ class BaseAction():
|
||||
prompt = PROMPT_TEMPLATE_TAKE_ACTION_BASE.format(agentName = agentName, agentProfile = AgentProfile_Dict[agentName], General_Goal = General_Goal, Current_Task_Description = TaskDescription, Input_Objects = inputObject_Record, History_Action = action_Record, Action_Description = self.info["Description"], Action_Custom_Note = self.Action_Custom_Note)
|
||||
print_colored(text = prompt, text_color="red")
|
||||
messages = [{"role":"system", "content": prompt}]
|
||||
ActionResult = LLM_Completion(messages,True,False)
|
||||
ActionResult = LLM_Completion(messages,stream=False)
|
||||
ActionInfo_with_Result = copy.deepcopy(self.info)
|
||||
ActionInfo_with_Result["Action_Result"] = ActionResult
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Note: You can say something before you provide the improved version of the conte
|
||||
The improved version you provide must be a completed version (e.g. if you provide a improved story, you should give completed story content, rather than just reporting where you have improved).
|
||||
When you decide to give the improved version of the content, it should be start like this:
|
||||
|
||||
## xxx的改进版本
|
||||
## Improved version of xxx
|
||||
(the improved version of the content)
|
||||
```
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ from termcolor import colored
|
||||
|
||||
|
||||
# Accept inputs: num_StepToRun (the number of step to run, if None, run to the end), plan, RehearsalLog, AgentProfile_Dict
|
||||
def executePlan(plan, num_StepToRun, RehearsalLog, AgentProfile_Dict, context):
|
||||
def executePlan(plan, num_StepToRun, RehearsalLog, AgentProfile_Dict):
|
||||
# Prepare for execution
|
||||
KeyObjects = {}
|
||||
finishedStep_index = -1
|
||||
@@ -101,7 +101,7 @@ def executePlan(plan, num_StepToRun, RehearsalLog, AgentProfile_Dict, context):
|
||||
KeyObjects=KeyObjects,
|
||||
)
|
||||
ActionInfo_with_Result = currentAction.run(
|
||||
General_Goal=plan["General Goal"] + "\n\n### Useful Information (some information can help accomplish the task)\n如果使用该信息,请在回答中显示指出是来自数联网的数据。例如,基于数联网数据搜索结果。" + context,
|
||||
General_Goal=plan["General Goal"],
|
||||
TaskDescription=TaskDescription,
|
||||
agentName=agentName,
|
||||
AgentProfile_Dict=AgentProfile_Dict,
|
||||
@@ -113,8 +113,6 @@ def executePlan(plan, num_StepToRun, RehearsalLog, AgentProfile_Dict, context):
|
||||
ActionHistory.append(ActionInfo_with_Result)
|
||||
# post processing for the group chat (finish)
|
||||
objectLogNode["content"] = KeyObjects[OutputName]
|
||||
if StepRun_count == len(plan["Collaboration Process"][(finishedStep_index + 1): run_to]):
|
||||
objectLogNode["content"] += context
|
||||
RehearsalLog.append(stepLogNode)
|
||||
RehearsalLog.append(objectLogNode)
|
||||
stepLogNode["ActionHistory"] = ActionHistory
|
||||
|
||||
@@ -1,2 +1,23 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# 导出常用模块和函数,根据实际需求调整
|
||||
from .PlanEngine.planOutline_Generator import generate_PlanOutline
|
||||
from .PlanEngine.basePlan_Generator import generate_basePlan
|
||||
from .PlanEngine.AgentSelection_Generator import generate_AgentSelection
|
||||
from .LLMAPI.LLMAPI import LLM_Completion
|
||||
from .util.converter import read_LLM_Completion
|
||||
|
||||
# 定义包元数据
|
||||
__version__ = "0.1.0"
|
||||
__all__ = [
|
||||
"generate_PlanOutline",
|
||||
"generate_basePlan",
|
||||
"generate_AgentSelection",
|
||||
"LLM_Completion",
|
||||
"read_LLM_Completion"
|
||||
]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import re
|
||||
import json
|
||||
from AgentCoord.LLMAPI.LLMAPI import LLM_Completion
|
||||
from AgentCoord.LLMAPI.LLMAPI import LLM_Completion,GROQ_API_KEY
|
||||
|
||||
|
||||
def create_agent_dict(agent_list):
|
||||
@@ -73,24 +73,80 @@ def remove_render_spec(duty_spec):
|
||||
return duty_spec
|
||||
|
||||
|
||||
def read_LLM_Completion(messages, useGroq=True):
|
||||
for _ in range(3):
|
||||
def read_LLM_Completion(messages, useGroq=None):
|
||||
if useGroq is None:
|
||||
useGroq = bool(GROQ_API_KEY)
|
||||
|
||||
# 添加调试信息和输入验证
|
||||
print(f"[DEBUG] read_LLM_Completion called with {len(messages)} messages", flush=True)
|
||||
if not messages or len(messages) == 0:
|
||||
raise ValueError("No messages provided to read_LLM_Completion")
|
||||
|
||||
# 确保messages中的每个元素都是有效的
|
||||
for i, msg in enumerate(messages):
|
||||
if not isinstance(msg, dict):
|
||||
print(f"[ERROR] Message {i} is not a dictionary: {type(msg)}", flush=True)
|
||||
raise ValueError(f"Message {i} is not a dictionary")
|
||||
if 'content' not in msg or msg['content'] is None:
|
||||
print(f"[ERROR] Message {i} has no content or content is None", flush=True)
|
||||
msg['content'] = "" # 提供默认空字符串
|
||||
|
||||
for attempt in range(3):
|
||||
try:
|
||||
print(f"[DEBUG] Attempt {attempt + 1}/3 to get LLM response", flush=True)
|
||||
text = LLM_Completion(messages, useGroq=useGroq)
|
||||
|
||||
# 确保text是字符串类型
|
||||
if text is None:
|
||||
print(f"[ERROR] Null response from LLM on attempt {attempt + 1}", flush=True)
|
||||
continue
|
||||
|
||||
text = str(text).strip()
|
||||
if not text:
|
||||
print(f"[ERROR] Empty response from LLM on attempt {attempt + 1}", flush=True)
|
||||
continue
|
||||
|
||||
print(f"[DEBUG] LLM response length: {len(text)} characters", flush=True)
|
||||
|
||||
# 尝试从代码块中提取JSON
|
||||
pattern = r"(?:.*?```json)(.*?)(?:```.*?)"
|
||||
match = re.search(pattern, text, re.DOTALL)
|
||||
|
||||
if match:
|
||||
return json.loads(match.group(1).strip())
|
||||
json_content = match.group(1).strip()
|
||||
print(f"[DEBUG] Found JSON in code block, length: {len(json_content)}", flush=True)
|
||||
try:
|
||||
result = json.loads(json_content)
|
||||
print(f"[DEBUG] Successfully parsed JSON from code block", flush=True)
|
||||
return result
|
||||
except json.JSONDecodeError as e:
|
||||
print(f"[ERROR] JSON decode error in code block: {e}", flush=True)
|
||||
print(f"[ERROR] JSON content was: {json_content}", flush=True)
|
||||
|
||||
# 尝试直接提取JSON对象
|
||||
pattern = r"\{.*\}"
|
||||
match = re.search(pattern, text, re.DOTALL)
|
||||
if match:
|
||||
json_content = match.group(0).strip()
|
||||
print(f"[DEBUG] Found JSON in plain text, length: {len(json_content)}", flush=True)
|
||||
try:
|
||||
return json.loads(match.group(0).strip())
|
||||
except Exception:
|
||||
pass
|
||||
raise ("bad format!")
|
||||
result = json.loads(json_content)
|
||||
print(f"[DEBUG] Successfully parsed JSON from plain text", flush=True)
|
||||
return result
|
||||
except json.JSONDecodeError as e:
|
||||
print(f"[ERROR] JSON decode error in plain text: {e}", flush=True)
|
||||
print(f"[ERROR] JSON content was: {json_content}", flush=True)
|
||||
|
||||
print(f"[ERROR] No valid JSON found in response on attempt {attempt + 1}", flush=True)
|
||||
print(f"[ERROR] Full response was: {text[:200]}..." if len(text) > 200 else f"[ERROR] Full response was: {text}", flush=True)
|
||||
|
||||
except Exception as e:
|
||||
print(f"[ERROR] Exception on attempt {attempt + 1}: {e}", flush=True)
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
continue
|
||||
|
||||
raise ValueError(f"Failed to get valid JSON response after 3 attempts. Last error: bad format or empty response")
|
||||
|
||||
|
||||
def read_json_content(text):
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
[
|
||||
{
|
||||
"Icon": "Hailey_Johnson.png",
|
||||
"Name": "船舶设计师",
|
||||
"Profile": "提供船舶制造中的实际需求和约束。"
|
||||
},
|
||||
{
|
||||
"Icon": "Jennifer_Moore.png",
|
||||
"Name": "防护工程专家",
|
||||
"Profile": "专注于船舶腐蚀防护技术的设计与应用。在你的总结回答中,必须引用来自数联网的搜索数据,是搜索数据,不是数联网的研究成果。"
|
||||
},
|
||||
{
|
||||
"Icon": "Jane_Moreno.png",
|
||||
"Name": "病理生理学家",
|
||||
"Profile": "专注于失血性休克的疾病机制,为药物研发提供理论靶点。"
|
||||
},
|
||||
{
|
||||
"Icon": "Giorgio_Rossi.png",
|
||||
"Name": "药物化学家",
|
||||
"Profile": "负责将靶点概念转化为实际可合成的分子。"
|
||||
},
|
||||
{
|
||||
"Icon": "Tamara_Taylor.png",
|
||||
"Name": "制剂工程师",
|
||||
"Profile": "负责将活性药物成分(API)变成稳定、可用、符合战场要求的剂型。"
|
||||
},
|
||||
{
|
||||
"Icon": "Maria_Lopez.png",
|
||||
"Name": "监管事务专家",
|
||||
"Profile": "深谙药品审评法规,目标是找到最快的合法上市路径。"
|
||||
},
|
||||
{
|
||||
"Icon": "Sam_Moore.png",
|
||||
"Name": "物理学家",
|
||||
"Profile": "从热力学与统计力学的基本原理出发,研究液态金属的自由能、焓、熵、比热等参数的理论建模。"
|
||||
},
|
||||
{
|
||||
"Icon": "Yuriko_Yamamoto.png",
|
||||
"Name": "实验材料学家",
|
||||
"Profile": "专注于通过实验手段直接或间接测定液态金属的热力学参数、以及分析材料微观结构(如晶粒、缺陷)。"
|
||||
},
|
||||
{
|
||||
"Icon": "Carlos_Gomez.png",
|
||||
"Name": "计算模拟专家",
|
||||
"Profile": "侧重于利用数值计算和模拟技术获取液态金属的热力学参数。"
|
||||
},
|
||||
{
|
||||
"Icon": "John_Lin.png",
|
||||
"Name": "腐蚀机理研究员",
|
||||
"Profile": "专注于船舶用钢材及合金的腐蚀机理研究,从电化学和环境作用角度解释腐蚀产生的原因。在你的总结回答中,必须引用来自数联网的搜索数据,是搜索数据,不是数联网的研究成果。"
|
||||
},
|
||||
{
|
||||
"Icon": "Arthur_Burton.png",
|
||||
"Name": "先进材料研发员",
|
||||
"Profile": "专注于开发和评估新型耐腐蚀材料、复合材料及固态电池材料。"
|
||||
},
|
||||
{
|
||||
"Icon": "Eddy_Lin.png",
|
||||
"Name": "肾脏病学家",
|
||||
"Profile": "专注于慢性肾脏病的诊断、治疗和患者管理,能提供临床洞察。"
|
||||
},
|
||||
{
|
||||
"Icon": "Isabella_Rodriguez.png",
|
||||
"Name": "临床研究协调员",
|
||||
"Profile": "负责受试者招募和临床试验流程优化。"
|
||||
},
|
||||
{
|
||||
"Icon": "Latoya_Williams.png",
|
||||
"Name": "中医药专家",
|
||||
"Profile": "理解药物的中药成分和作用机制。"
|
||||
},
|
||||
{
|
||||
"Icon": "Carmen_Ortiz.png",
|
||||
"Name": "药物安全专家",
|
||||
"Profile": "专注于药物不良反应数据收集、分析和报告。"
|
||||
},
|
||||
{
|
||||
"Icon": "Rajiv_Patel.png",
|
||||
"Name": "二维材料科学家",
|
||||
"Profile": "专注于二维材料(如石墨烯)的合成、性质和应用。"
|
||||
},
|
||||
{
|
||||
"Icon": "Tom_Moreno.png",
|
||||
"Name": "光电物理学家",
|
||||
"Profile": "研究材料的光电转换机制和关键影响因素。"
|
||||
},
|
||||
{
|
||||
"Icon": "Ayesha_Khan.png",
|
||||
"Name": "机器学习专家",
|
||||
"Profile": "专注于开发和应用AI模型用于材料模拟。"
|
||||
},
|
||||
{
|
||||
"Icon": "Mei_Lin.png",
|
||||
"Name": "流体动力学专家",
|
||||
"Profile": "专注于流体行为理论和模拟。"
|
||||
}
|
||||
]
|
||||
@@ -1,12 +1,12 @@
|
||||
## config for default LLM
|
||||
OPENAI_API_BASE: ""
|
||||
OPENAI_API_KEY: ""
|
||||
OPENAI_API_MODEL: "gpt-4-turbo-preview"
|
||||
OPENAI_API_BASE: "https://ai.gitee.com/v1"
|
||||
OPENAI_API_KEY: "HYCNGM39GGFNSB1F8MBBMI9QYJR3P1CRSYS2PV1A"
|
||||
OPENAI_API_MODEL: "DeepSeek-V3"
|
||||
|
||||
## config for fast mode
|
||||
FAST_DESIGN_MODE: True
|
||||
GROQ_API_KEY: ""
|
||||
MISTRAL_API_KEY: ""
|
||||
|
||||
## options under experimentation, leave them as Fasle unless you know what it is for
|
||||
USE_CACHE: True
|
||||
## options under experimentation, leave them as False unless you know what it is for
|
||||
USE_CACHE: False
|
||||
@@ -3,5 +3,5 @@ openai==0.28.1
|
||||
PyYAML==6.0.1
|
||||
termcolor==2.4.0
|
||||
groq==0.4.2
|
||||
mistralai==0.1.6
|
||||
mistralai==1.5.2
|
||||
socksio==1.0.0
|
||||
|
||||
13
backend/restart.ps1
Normal file
@@ -0,0 +1,13 @@
|
||||
# restart.ps1
|
||||
$port=8000
|
||||
|
||||
$env:PYTHONUNBUFFERED="1"
|
||||
python server.py --port 8000
|
||||
|
||||
|
||||
Write-Host "Killing PID on port $port..." -ForegroundColor Red
|
||||
Get-NetTCPConnection -LocalPort $port -ErrorAction SilentlyContinue | ForEach-Object {
|
||||
Stop-Process -Id $_.OwningProcess -Force
|
||||
}
|
||||
Write-Host "Starting Flask..." -ForegroundColor Green
|
||||
python server.py --port $port
|
||||
@@ -1,6 +1,12 @@
|
||||
import nest_asyncio
|
||||
nest_asyncio.apply()
|
||||
import os, sys, functools
|
||||
print = functools.partial(print, flush=True) # 全局 flush
|
||||
sys.stdout.reconfigure(line_buffering=True) # 3.7+ 有效
|
||||
import asyncio
|
||||
|
||||
from flask import Flask, request, jsonify
|
||||
import json
|
||||
import time
|
||||
from DataProcess import Add_Collaboration_Brief_FrontEnd
|
||||
from AgentCoord.RehearsalEngine_V2.ExecutePlan import executePlan
|
||||
from AgentCoord.PlanEngine.basePlan_Generator import generate_basePlan
|
||||
@@ -20,11 +26,12 @@ import argparse
|
||||
|
||||
# initialize global variables
|
||||
yaml_file = os.path.join(os.getcwd(), "config", "config.yaml")
|
||||
yaml_data = {}
|
||||
try:
|
||||
with open(yaml_file, "r", encoding="utf-8") as file:
|
||||
yaml_data = yaml.safe_load(file)
|
||||
except Exception:
|
||||
yaml_file = {}
|
||||
yaml_data = {}
|
||||
USE_CACHE: bool = os.getenv("USE_CACHE")
|
||||
if USE_CACHE is None:
|
||||
USE_CACHE = yaml_data.get("USE_CACHE", False)
|
||||
@@ -32,110 +39,157 @@ else:
|
||||
USE_CACHE = USE_CACHE.lower() in ["true", "1", "yes"]
|
||||
AgentBoard = None
|
||||
AgentProfile_Dict = {}
|
||||
c1 = '''
|
||||
|
||||
=====数联网搜索结果=====
|
||||
|
||||
1. 论文
|
||||
|
||||
- 《Surface Defect Detection and Evaluation for Marine Vessels using Multi-Stage Deep Learning》提出一个面向船舶制造与检修的多阶段深度学习流水线,用于船体表面缺陷检测与评估,重点识别和量化与船舶制造材料腐蚀相关的现象,包括腐蚀(rust)、附着物(fouling)、涂层剥离(delamination)等。研究特别关注船舶材料腐蚀在不同涂层颜色、光照条件和相机角度下的鲁棒性,有助于提高船舶制造过程中对材料腐蚀的检测与管理能力。论文强调其方法在船舶材料表面腐蚀监测和维修决策中的应用价值。链接:https://arxiv.org/abs/2203.09580
|
||||
论文复现链接:http://8.130.138.52:21001/#/view/reproduction?doid=newID/5a4fef68-a138-4adb-ba88-43aa4474c08c
|
||||
|
||||
- 《Efficient Metal Corrosion Area Detection Model Combining Convolution and Transformer (MCD-Net)》提出了一种高效的金属腐蚀区域检测模型。该模型创新性地结合了卷积编码器与视觉Transformer序列编码器,利用注意力融合模块增强边界识别,并采用基于得分的多尺度增强机制来突出腐蚀区域。该方法在阴影、遮挡和复杂纹理条件下依然能保持高精度,在公开数据集上取得了优异的F1性能,特别适用于船舶制造与检修中对船体钢板和涂层腐蚀的自动化识别与量化分析。链接:https://www.mdpi.com/2076-3417/14/21/9900
|
||||
论文复现链接:http://8.130.138.52:21001/#/view/reproduction?doid=newID/b200a489-e2c8-4dbd-8767-682d15dd4c04
|
||||
|
||||
- 《Mechanical Failure and Metal Degradation of Ships and Marine Structures》系统探讨了船舶与海洋结构中金属材料(包括高强钢、不锈钢、铜合金、钛合金等)在海洋环境下的机械损伤与电化学腐蚀协同作用问题。重点分析了"机械载荷+腐蚀"耦合导致的疲劳、裂纹及腐蚀裂纹等失效机制,并对相应的检测、预警与保护措施进行了深入讨论。链接:https://doi.org/10.3390/met13020272
|
||||
|
||||
- 《Research Progress of Marine Anti-Fouling Coatings》(2024)全面综述了海洋防污涂层的研究进展,涵盖自我抛光涂料、生物可降解涂料、低表面能涂层、仿生涂层和纳米涂层等新型涂层技术。虽然重点在于防污,但文中指出许多防污机制与防腐蚀机制相互关联,通过阻碍生物附着可有效减少微生物引起的腐蚀和表面破坏。链接:https://doi.org/10.3390/coatings14091227
|
||||
|
||||
- 《Corrosion-Wear Behavior of Shipbuilding Steels (EH40, FH40, 921A) in Seawater》研究了三种常用船用钢(EH40、FH40、921A)在海水环境中磨损与腐蚀共同作用下的复合失效行为。通过机械-电化学方法系统测定了腐蚀磨损损失、表面形貌变化和耐腐蚀性能差异,发现在此类工况中921A钢表现最佳。《Journal of Chinese Society for Corrosion and Protection》, Vol 45(4): 894-904, 2025
|
||||
|
||||
- 《Sulfur-Selenium Alloy Coatings for Universal Corrosion Resistance》设计了一种硫-硒合金涂层,能够在包括模拟海水和硫酸盐还原菌生物环境在内的各种条件下为钢材提供高效的防腐蚀保护(约99.9%效率),腐蚀速率比裸钢低6-7个数量级。该涂层具有良好的机械性能、非多孔结构,能有效阻碍多种扩散性腐蚀因子的渗透。arXiv:2009.02451
|
||||
|
||||
2. 代码
|
||||
|
||||
- CoaST - Anti-corrosive coatings research (DTU, Denmark):丹麦技术大学的CoaST项目专注于抗腐蚀涂层的性能表征与失效机制分析。该项目采用电化学测试与表面/界面无损检测技术相结合的方法,系统评估涂层的保护效果与失效途径,为船舶腐蚀防护提供了重要的研究平台。链接:https://www.kt.dtu.dk/research/coast/research-areas/anti-corrosive-coatings
|
||||
|
||||
- Surface Defect Detection 仓库:该仓库集成了多种表面缺陷检测算法,为实现船舶腐蚀检测提供了可靠的代码基础和参考架构。链接:https://github.com/Charmve/Surface-Defect-Detection
|
||||
|
||||
- Hugging Face 预训练模型:平台提供了轻量级的腐蚀检测模型,可直接下载并微调,用于快速验证和部署。链接:https://huggingface.co/mahdavian/corrosion-model
|
||||
|
||||
3. 数据集
|
||||
|
||||
用于训练和验证MCD-Net模型的相关数据集包括:
|
||||
|
||||
- iamcloud/Corrosion_Dataset:一个包含约2000多张标注图像的数据集(ImageFolder格式,Apache-2.0协议),专门收录材料腐蚀图像,适用于船舶腐蚀监测模型的训练。链接:https://huggingface.co/datasets/iamcloud/Corrosion_Dataset
|
||||
|
||||
- Francesco/corrosion-bi3q3:此数据集提供了多种腐蚀实例,可用于支持船舶涂层损坏与基体腐蚀的自动化检测任务。链接:https://huggingface.co/datasets/Francesco/corrosion-bi3q3。
|
||||
|
||||
4. 研究团队
|
||||
|
||||
- 海洋腐蚀与防护全国重点实验室是我国在该领域最具权威性的国家级研究机构,依托于中国船舶集团旗下725所。实验室提供从材料、设计到运维的全生命周期腐蚀控制解决方案,其核心优势在于能够进行多技术(如“阴极保护+涂层”)的综合集成研发与验证。其研究成果广泛应用于船舶、海洋平台等国家重大工程,为保障我国海洋装备的安全与耐久性提供了关键支撑。
|
||||
|
||||
- 水性船舶防腐涂层新材料项目团队是一支源自东北石油大学的创新创业团队,专注于推动船舶涂料行业的环保化转型。团队致力于攻克水性涂料在船舶高湿环境下干燥慢、早期耐水性差的技术瓶颈,旨在开发出兼具优异防腐性能和施工便利性的水性体系,以替代传统溶剂型涂料,其目标是实现进口产品替代并大幅减少船舶制造与维修过程中的VOCs排放。
|
||||
|
||||
- 微纳一体化防腐耐磨技术研发团队是以广州航海学院青年技术骨干为核心的新锐力量。团队针对铝合金在极端海洋环境中的腐蚀-磨损难题,创新性地提出了“微米级氧化陶瓷层+纳米自润滑固化层+改性硅烷钝化层”的三层复合防护体系。该技术使防护层的结合强度、耐磨性(提升2000倍)和耐腐蚀性能(自腐蚀电流密度降低6个数量级)实现了质的飞跃。
|
||||
|
||||
- 北京大学南京创新研究院BXCFD团队专注于自主可控的高性能计算流体力学软件研发。团队在船舶与海洋工程水动力学领域取得关键突破,其自主研发的软件在船舶兴波阻力预报精度上达到国际先进水平,并成功实现了对复杂的船-桨-舵6自由度运动的耦合高精度模拟,为船舶水动力性能研究与优化提供了强大的国产化工具。
|
||||
|
||||
- 清华大学多相流与生物流动力学实验室由罗先武教授带领,长期专注于流体机械及工程领域。团队重点研究高速船舶喷水推进装置的基础理论与空化流动机理,其研究成果为攻克喷水推进系统中的空化、振动与噪声问题提供了坚实的理论依据和技术支持,对我国高性能船舶推进技术的发展具有重要意义。
|
||||
|
||||
'''
|
||||
context = {"材料腐蚀":c1}
|
||||
Request_Cache: dict[str, str] = {}
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
from jsonschema import validate, ValidationError
|
||||
|
||||
AGENT_SELECTION_SCHEMA = {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"AgentSelectionPlan": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"minLength": 1, # 不允许空字符串
|
||||
"pattern": r"^\S+$" # 不允许仅空白
|
||||
},
|
||||
"minItems": 1 # 至少选一个
|
||||
}
|
||||
},
|
||||
"required": ["AgentSelectionPlan"],
|
||||
"additionalProperties": False
|
||||
}
|
||||
|
||||
|
||||
BASE_PLAN_SCHEMA = {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Plan_Outline": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"StepName": {"type": "string"},
|
||||
"TaskContent": {"type": "string"},
|
||||
"InputObject_List":{"type": "array", "items": {"type": "string"}},
|
||||
"OutputObject": {"type": "string"},
|
||||
},
|
||||
"required": ["StepName", "TaskContent", "InputObject_List", "OutputObject"],
|
||||
"additionalProperties": False,
|
||||
},
|
||||
}
|
||||
},
|
||||
"required": ["Plan_Outline"],
|
||||
"additionalProperties": False,
|
||||
}
|
||||
|
||||
|
||||
def safe_join(iterable, sep=""):
|
||||
"""保证 join 前全是 str,None 变空串"""
|
||||
return sep.join("" if x is None else str(x) for x in iterable)
|
||||
|
||||
def clean_agent_board(board):
|
||||
"""把 AgentBoard 洗成只含 str 的字典列表"""
|
||||
if not board:
|
||||
return []
|
||||
return [
|
||||
{"Name": (a.get("Name") or "").strip(),
|
||||
"Profile": (a.get("Profile") or "").strip()}
|
||||
for a in board
|
||||
if a and a.get("Name")
|
||||
]
|
||||
|
||||
def clean_plan_outline(outline):
|
||||
"""清洗 Plan_Outline 里的 None"""
|
||||
if not isinstance(outline, list):
|
||||
return []
|
||||
for step in outline:
|
||||
if not isinstance(step, dict):
|
||||
continue
|
||||
step["InputObject_List"] = [
|
||||
str(i) for i in step.get("InputObject_List", []) if i is not None
|
||||
]
|
||||
step["OutputObject"] = str(step.get("OutputObject") or "")
|
||||
step["StepName"] = str(step.get("StepName") or "")
|
||||
step["TaskContent"] = str(step.get("TaskContent") or "")
|
||||
return outline
|
||||
|
||||
@app.route("/fill_stepTask_TaskProcess", methods=["post"])
|
||||
def Handle_fill_stepTask_TaskProcess():
|
||||
incoming_data = request.get_json()
|
||||
# print(f"[DEBUG] fill_stepTask_TaskProcess received data: {incoming_data}", flush=True)
|
||||
|
||||
# 验证必需参数
|
||||
General_Goal = incoming_data.get("General Goal", "").strip()
|
||||
stepTask_lackTaskProcess = incoming_data.get("stepTask_lackTaskProcess")
|
||||
|
||||
if not General_Goal:
|
||||
return jsonify({"error": "General Goal is required and cannot be empty"}), 400
|
||||
if not stepTask_lackTaskProcess:
|
||||
return jsonify({"error": "stepTask_lackTaskProcess is required"}), 400
|
||||
|
||||
requestIdentifier = str(
|
||||
(
|
||||
"/fill_stepTask_TaskProcess",
|
||||
incoming_data["General Goal"],
|
||||
incoming_data["stepTask_lackTaskProcess"],
|
||||
General_Goal,
|
||||
stepTask_lackTaskProcess,
|
||||
)
|
||||
)
|
||||
|
||||
if USE_CACHE:
|
||||
if requestIdentifier in Request_Cache:
|
||||
time.sleep(1)
|
||||
return jsonify(Request_Cache[requestIdentifier])
|
||||
|
||||
try:
|
||||
filled_stepTask = fill_stepTask_TaskProcess(
|
||||
General_Goal=incoming_data["General Goal"],
|
||||
stepTask=incoming_data["stepTask_lackTaskProcess"],
|
||||
General_Goal=General_Goal,
|
||||
stepTask=stepTask_lackTaskProcess,
|
||||
AgentProfile_Dict=AgentProfile_Dict,
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"[ERROR] fill_stepTask_TaskProcess failed: {e}", flush=True)
|
||||
return jsonify({"error": str(e)}), 500
|
||||
filled_stepTask = Add_Collaboration_Brief_FrontEnd(filled_stepTask)
|
||||
Request_Cache[requestIdentifier] = filled_stepTask
|
||||
response = jsonify(filled_stepTask)
|
||||
return response
|
||||
|
||||
|
||||
@app.route("/agentSelectModify_init", methods=["post"])
|
||||
@app.route("/agentSelectModify_init", methods=["POST"])
|
||||
def Handle_agentSelectModify_init():
|
||||
incoming_data = request.get_json()
|
||||
requestIdentifier = str(
|
||||
(
|
||||
"/agentSelectModify_init",
|
||||
incoming_data["General Goal"],
|
||||
incoming_data["stepTask"],
|
||||
)
|
||||
)
|
||||
incoming = request.get_json(silent=True) or {}
|
||||
general_goal = (incoming.get("General Goal") or "").strip()
|
||||
step_task = incoming.get("stepTask")
|
||||
if not general_goal or not step_task:
|
||||
return jsonify({"error": "Missing field"}), 400
|
||||
|
||||
if not AgentBoard: # 空 Board 直接返回
|
||||
return jsonify({"AgentSelectionPlan": []})
|
||||
|
||||
req_id = str(("/agentSelectModify_init", general_goal, step_task))
|
||||
if USE_CACHE and req_id in Request_Cache:
|
||||
return jsonify(Request_Cache[req_id])
|
||||
|
||||
try:
|
||||
clean_board = clean_agent_board(AgentBoard)
|
||||
raw = AgentSelectModify_init(stepTask=step_task,
|
||||
General_Goal=general_goal,
|
||||
Agent_Board=clean_board)
|
||||
if not isinstance(raw, dict):
|
||||
raise ValueError("model returned non-dict")
|
||||
plan = raw.get("AgentSelectionPlan") or []
|
||||
cleaned = [str(x).strip() for x in plan if x is not None and str(x).strip()]
|
||||
raw["AgentSelectionPlan"] = cleaned
|
||||
validate(instance=raw, schema=AGENT_SELECTION_SCHEMA)
|
||||
except Exception as exc:
|
||||
print(f"[ERROR] AgentSelectModify_init: {exc}")
|
||||
return jsonify({"error": str(exc)}), 500
|
||||
|
||||
if USE_CACHE:
|
||||
if requestIdentifier in Request_Cache:
|
||||
return jsonify(Request_Cache[requestIdentifier])
|
||||
|
||||
scoreTable = AgentSelectModify_init(
|
||||
stepTask=incoming_data["stepTask"],
|
||||
General_Goal=incoming_data["General Goal"],
|
||||
Agent_Board=AgentBoard,
|
||||
)
|
||||
Request_Cache[requestIdentifier] = scoreTable
|
||||
response = jsonify(scoreTable)
|
||||
return response
|
||||
Request_Cache[req_id] = raw
|
||||
return jsonify(raw)
|
||||
|
||||
|
||||
@app.route("/agentSelectModify_addAspect", methods=["post"])
|
||||
@@ -150,7 +204,7 @@ def Handle_agentSelectModify_addAspect():
|
||||
return jsonify(Request_Cache[requestIdentifier])
|
||||
|
||||
scoreTable = AgentSelectModify_addAspect(
|
||||
aspectList=incoming_data["aspectList"], Agent_Board=AgentBoard
|
||||
aspectList=incoming_data["aspectList"], Agent_Board=AgentBoard or []
|
||||
)
|
||||
Request_Cache[requestIdentifier] = scoreTable
|
||||
response = jsonify(scoreTable)
|
||||
@@ -160,25 +214,39 @@ def Handle_agentSelectModify_addAspect():
|
||||
@app.route("/fill_stepTask", methods=["post"])
|
||||
def Handle_fill_stepTask():
|
||||
incoming_data = request.get_json()
|
||||
# print(f"[DEBUG] fill_stepTask received data: {incoming_data}", flush=True)
|
||||
|
||||
# 验证必需参数
|
||||
General_Goal = incoming_data.get("General Goal", "").strip()
|
||||
stepTask = incoming_data.get("stepTask")
|
||||
|
||||
if not General_Goal:
|
||||
return jsonify({"error": "General Goal is required and cannot be empty"}), 400
|
||||
if not stepTask:
|
||||
return jsonify({"error": "stepTask is required"}), 400
|
||||
|
||||
requestIdentifier = str(
|
||||
(
|
||||
"/fill_stepTask",
|
||||
incoming_data["General Goal"],
|
||||
incoming_data["stepTask"],
|
||||
General_Goal,
|
||||
stepTask,
|
||||
)
|
||||
)
|
||||
|
||||
if USE_CACHE:
|
||||
if requestIdentifier in Request_Cache:
|
||||
time.sleep(1)
|
||||
return jsonify(Request_Cache[requestIdentifier])
|
||||
|
||||
try:
|
||||
filled_stepTask = fill_stepTask(
|
||||
General_Goal=incoming_data["General Goal"],
|
||||
stepTask=incoming_data["stepTask"],
|
||||
General_Goal=General_Goal,
|
||||
stepTask=stepTask,
|
||||
Agent_Board=AgentBoard,
|
||||
AgentProfile_Dict=AgentProfile_Dict,
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"[ERROR] fill_stepTask failed: {e}", flush=True)
|
||||
return jsonify({"error": str(e)}), 500
|
||||
filled_stepTask = Add_Collaboration_Brief_FrontEnd(filled_stepTask)
|
||||
Request_Cache[requestIdentifier] = filled_stepTask
|
||||
response = jsonify(filled_stepTask)
|
||||
@@ -251,42 +319,51 @@ def Handle_branch_TaskProcess():
|
||||
return response
|
||||
|
||||
|
||||
@app.route("/generate_basePlan", methods=["post"])
|
||||
@app.route("/generate_basePlan", methods=["POST"])
|
||||
def Handle_generate_basePlan():
|
||||
incoming_data = request.get_json()
|
||||
requestIdentifier = str(
|
||||
(
|
||||
"/generate_basePlan",
|
||||
incoming_data["General Goal"],
|
||||
incoming_data["Initial Input Object"],
|
||||
)
|
||||
)
|
||||
incoming = request.get_json(silent=True) or {}
|
||||
general_goal = (incoming.get("General Goal") or "").strip()
|
||||
initial_objs = incoming.get("Initial Input Object") or []
|
||||
|
||||
if USE_CACHE:
|
||||
if requestIdentifier in Request_Cache:
|
||||
time.sleep(2)
|
||||
return jsonify(Request_Cache[requestIdentifier])
|
||||
if not general_goal:
|
||||
return jsonify({"error": "General Goal is required"}), 400
|
||||
|
||||
basePlan = generate_basePlan(
|
||||
General_Goal=incoming_data["General Goal"],
|
||||
Agent_Board=AgentBoard,
|
||||
# 1. 空 Board 直接短路
|
||||
if not AgentBoard:
|
||||
print("[SKIP] AgentBoard empty")
|
||||
out = Add_Collaboration_Brief_FrontEnd({"Plan_Outline": []})
|
||||
return jsonify(out)
|
||||
|
||||
req_id = str(("/generate_basePlan", general_goal, initial_objs))
|
||||
if USE_CACHE and req_id in Request_Cache:
|
||||
return jsonify(Request_Cache[req_id])
|
||||
|
||||
try:
|
||||
# 2. 洗 Board → 调模型 → 洗返回
|
||||
clean_board = clean_agent_board(AgentBoard)
|
||||
raw_plan = asyncio.run(
|
||||
generate_basePlan(
|
||||
General_Goal=general_goal,
|
||||
Agent_Board=clean_board,
|
||||
AgentProfile_Dict=AgentProfile_Dict,
|
||||
InitialObject_List=incoming_data["Initial Input Object"],
|
||||
context="\n请注意,目标是给出解决方案,而不是工程实现,不需要实验验证,也不需要推广计划。"
|
||||
InitialObject_List=initial_objs,
|
||||
)
|
||||
basePlan_withRenderSpec = Add_Collaboration_Brief_FrontEnd(basePlan)
|
||||
Request_Cache[requestIdentifier] = basePlan_withRenderSpec
|
||||
response = jsonify(basePlan_withRenderSpec)
|
||||
return response
|
||||
)
|
||||
raw_plan["Plan_Outline"] = clean_plan_outline(raw_plan.get("Plan_Outline"))
|
||||
validate(instance=raw_plan, schema=BASE_PLAN_SCHEMA) # 可选,二次校验
|
||||
except Exception as exc:
|
||||
print(f"[ERROR] generate_basePlan failed: {exc}")
|
||||
return jsonify({"error": "model call failed", "detail": str(exc)}), 500
|
||||
|
||||
out = Add_Collaboration_Brief_FrontEnd(raw_plan)
|
||||
if USE_CACHE:
|
||||
Request_Cache[req_id] = out
|
||||
return jsonify(out)
|
||||
|
||||
|
||||
@app.route("/executePlan", methods=["post"])
|
||||
def Handle_executePlan():
|
||||
incoming_data = request.get_json()
|
||||
cur_context = ""
|
||||
if "材料腐蚀" in incoming_data["plan"]["General Goal"]:
|
||||
cur_context = context["材料腐蚀"]
|
||||
|
||||
requestIdentifier = str(
|
||||
(
|
||||
"/executePlan",
|
||||
@@ -298,7 +375,6 @@ def Handle_executePlan():
|
||||
|
||||
if USE_CACHE:
|
||||
if requestIdentifier in Request_Cache:
|
||||
time.sleep(3)
|
||||
return jsonify(Request_Cache[requestIdentifier])
|
||||
|
||||
RehearsalLog = executePlan(
|
||||
@@ -306,21 +382,20 @@ def Handle_executePlan():
|
||||
incoming_data["num_StepToRun"],
|
||||
incoming_data["RehearsalLog"],
|
||||
AgentProfile_Dict,
|
||||
context=cur_context
|
||||
)
|
||||
Request_Cache[requestIdentifier] = RehearsalLog
|
||||
response = jsonify(RehearsalLog)
|
||||
return response
|
||||
|
||||
|
||||
@app.route("/_saveRequestCashe", methods=["GET"])
|
||||
@app.route("/_saveRequestCashe", methods=["post"])
|
||||
def Handle_saveRequestCashe():
|
||||
with open(
|
||||
os.path.join(os.getcwd(), "RequestCache", "Request_Cache.json"), "w"
|
||||
) as json_file:
|
||||
json.dump(Request_Cache, json_file, indent=4)
|
||||
response = jsonify(
|
||||
{"code": 200, "content": "request cashe sucessfully saved: " + os.path.join(os.getcwd(), "RequestCache", "Request_Cache.json")}
|
||||
{"code": 200, "content": "request cashe sucessfully saved"}
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -328,13 +403,11 @@ def Handle_saveRequestCashe():
|
||||
@app.route("/setAgents", methods=["POST"])
|
||||
def set_agents():
|
||||
global AgentBoard, AgentProfile_Dict
|
||||
AgentBoard = request.json
|
||||
AgentProfile_Dict = {}
|
||||
for item in AgentBoard:
|
||||
name = item["Name"]
|
||||
profile = item["Profile"]
|
||||
AgentProfile_Dict[name] = profile
|
||||
return jsonify({"code": 200, "content": "set agentboard successfully"})
|
||||
board_in = request.json or []
|
||||
# 先清洗再赋值
|
||||
AgentBoard = clean_agent_board(board_in)
|
||||
AgentProfile_Dict = {a["Name"]: a["Profile"] for a in AgentBoard}
|
||||
return jsonify({"code": 200, "content": "AgentBoard set successfully"})
|
||||
|
||||
|
||||
def init():
|
||||
|
||||
@@ -21,12 +21,11 @@ services:
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- OPENAI_API_BASE=https://api.moleapi.com/v1
|
||||
- OPENAI_API_KEY=sk-sps7FBCbEvu85DfPoS8SdnPwYLEoW7u5Dd8vCDTXqPLpHuyb
|
||||
- OPENAI_API_MODEL=gpt-4.1-mini
|
||||
- FAST_DESIGN_MODE=False
|
||||
- OPENAI_API_BASE=htts://api.openai.com
|
||||
- OPENAI_API_KEY=
|
||||
- OPENAI_API_MODEL=gpt-4-turbo-preview
|
||||
- FAST_DESIGN_MODE=True
|
||||
- GROQ_API_KEY=
|
||||
- USE_CACHE=True
|
||||
networks:
|
||||
- agentcoord-network
|
||||
|
||||
|
||||
@@ -15,9 +15,8 @@ FROM base AS runner
|
||||
WORKDIR /app
|
||||
EXPOSE 8080/tcp
|
||||
COPY .npmrc ./
|
||||
COPY src ./src
|
||||
RUN npm install @modern-js/app-tools @modern-js/runtime --no-optional --no-shrinkwrap && mkdir src
|
||||
COPY modern.config.ts package.json ./
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
ENV API_BASE=
|
||||
CMD ["npm", "run", "serve"]
|
||||
|
||||
@@ -17,7 +17,7 @@ import _ from 'lodash';
|
||||
// fakeAgentSelections,
|
||||
// fakeCurrentAgentSelection,
|
||||
// } from './data/fakeAgentAssignment';
|
||||
import CheckIcon from '@/icons/checkIcon';
|
||||
import CheckIcon from '@/icons/CheckIcon';
|
||||
import AgentIcon from '@/components/AgentIcon';
|
||||
import { globalStorage } from '@/storage';
|
||||
import SendIcon from '@/icons/SendIcon';
|
||||
@@ -351,7 +351,7 @@ export default observer(({ style = {} }: IPlanModification) => {
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
>
|
||||
<Box sx={{ marginBottom: '6px', fontWeight: '600' }}>已选智能体</Box>
|
||||
<Box sx={{ marginBottom: '6px', fontWeight: '600' }}>Assignment</Box>
|
||||
<Box>
|
||||
{Object.keys(agentSelections).map(selectionId => (
|
||||
<Box
|
||||
@@ -405,7 +405,7 @@ export default observer(({ style = {} }: IPlanModification) => {
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
>
|
||||
<Box sx={{ marginBottom: '4px', fontWeight: '600' }}>候选智能体</Box>
|
||||
<Box sx={{ marginBottom: '4px', fontWeight: '600' }}>Comparison</Box>
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
|
||||
@@ -65,6 +65,7 @@ export default observer(({ agent, style = {} }: IAgentCardProps) => (
|
||||
userSelect: 'none',
|
||||
}}
|
||||
>
|
||||
{agent.profile}
|
||||
</Box>
|
||||
</Box>
|
||||
<Box
|
||||
@@ -104,7 +105,7 @@ export default observer(({ agent, style = {} }: IAgentCardProps) => (
|
||||
marginLeft: '2px',
|
||||
}}
|
||||
>
|
||||
当前职责:
|
||||
Current Duty:
|
||||
</Box>
|
||||
<Box>
|
||||
{agent.actions.map((action, index) => (
|
||||
|
||||
@@ -4,7 +4,6 @@ import Box from '@mui/material/Box';
|
||||
import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
|
||||
import UnfoldLessIcon from '@mui/icons-material/UnfoldLess';
|
||||
import { IAgentAction, globalStorage } from '@/storage';
|
||||
import { getActionTypeDisplayText } from '@/storage/plan/action'; // 导入映射函数
|
||||
|
||||
export interface IDutyItem {
|
||||
action: IAgentAction;
|
||||
@@ -39,7 +38,7 @@ export default React.memo<IDutyItem>(({ action, style = {} }) => {
|
||||
..._style,
|
||||
}}
|
||||
>
|
||||
{getActionTypeDisplayText(action.type)}
|
||||
{action.type}
|
||||
<Box
|
||||
onClick={() => setExpand(true)}
|
||||
sx={{
|
||||
@@ -84,7 +83,7 @@ export default React.memo<IDutyItem>(({ action, style = {} }) => {
|
||||
marginLeft: '2px',
|
||||
}}
|
||||
>
|
||||
{getActionTypeDisplayText(action.type)}
|
||||
{action.type}
|
||||
</Box>
|
||||
<Divider
|
||||
sx={{
|
||||
|
||||
@@ -88,7 +88,7 @@ export default observer(({ style = {} }: IAgentBoardProps) => {
|
||||
'& > input': { display: 'none' },
|
||||
}}
|
||||
>
|
||||
<Title title="智能体库" />
|
||||
<Title title="Agent Board" />
|
||||
<Box
|
||||
sx={{
|
||||
flexGrow: 1,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import AbigailChen from '@/static/AgentIcons/Abigail_Chen.png';
|
||||
import AbigailChenMilitary from '@/static/AgentIcons/Abigail_Chen_military.png';
|
||||
import AdamSmith from '@/static/AgentIcons/Adam_Smith.png';
|
||||
import ArthurBurton from '@/static/AgentIcons/Arthur_Burton.png';
|
||||
import AyeshaKhan from '@/static/AgentIcons/Ayesha_Khan.png';
|
||||
@@ -9,11 +8,9 @@ import EddyLin from '@/static/AgentIcons/Eddy_Lin.png';
|
||||
import FranciscoLopez from '@/static/AgentIcons/Francisco_Lopez.png';
|
||||
import GiorgioRossi from '@/static/AgentIcons/Giorgio_Rossi.png';
|
||||
import HaileyJohnson from '@/static/AgentIcons/Hailey_Johnson.png';
|
||||
import HaileyJohnsonMilitary from '@/static/AgentIcons/Hailey_Johnson_military.png';
|
||||
import IsabellaRodriguez from '@/static/AgentIcons/Isabella_Rodriguez.png';
|
||||
import JaneMoreno from '@/static/AgentIcons/Jane_Moreno.png';
|
||||
import JenniferMoore from '@/static/AgentIcons/Jennifer_Moore.png';
|
||||
import JenniferMooreMilitary from '@/static/AgentIcons/Jennifer_Moore_military.png';
|
||||
import JohnLin from '@/static/AgentIcons/John_Lin.png';
|
||||
import KlausMueller from '@/static/AgentIcons/Klaus_Mueller.png';
|
||||
import LatoyaWilliams from '@/static/AgentIcons/Latoya_Williams.png';
|
||||
@@ -30,7 +27,6 @@ import Unknown from '@/static/AgentIcons/Unknow.png';
|
||||
|
||||
export enum IconName {
|
||||
AbigailChen = 'Abigail_Chen',
|
||||
AbigailChenMilitary = 'Abigail_Chen_military',
|
||||
AdamSmith = 'Adam_Smith',
|
||||
ArthurBurton = 'Arthur_Burton',
|
||||
AyeshaKhan = 'Ayesha_Khan',
|
||||
@@ -49,11 +45,9 @@ export enum IconName {
|
||||
GabeSmith = 'Gabe_Smith',
|
||||
GiorgioRossi = 'Giorgio_Rossi',
|
||||
HaileyJohnson = 'Hailey_Johnson',
|
||||
HaileyJohnsonMilitary = 'Hailey_Johnson_military',
|
||||
IsabellaRodriguez = 'Isabella_Rodriguez',
|
||||
JaneMoreno = 'Jane_Moreno',
|
||||
JenniferMoore = 'Jennifer_Moore',
|
||||
JenniferMooreMilitary = 'Jennifer_Moore_military',
|
||||
JohnLin = 'John_Lin',
|
||||
KlausMueller = 'Klaus_Mueller',
|
||||
LatoyaWilliams = 'Latoya_Williams',
|
||||
@@ -89,7 +83,6 @@ export const IconMap = new Proxy<{ [key: string]: IconName }>(
|
||||
export const IconUrl: { [key in IconName]: string } = {
|
||||
[IconName.Unknown]: Unknown,
|
||||
[IconName.AbigailChen]: AbigailChen,
|
||||
[IconName.AbigailChenMilitary]: AbigailChenMilitary,
|
||||
[IconName.AdamSmith]: AdamSmith,
|
||||
[IconName.ArthurBurton]: ArthurBurton,
|
||||
[IconName.AyeshaKhan]: AyeshaKhan,
|
||||
@@ -108,11 +101,9 @@ export const IconUrl: { [key in IconName]: string } = {
|
||||
[IconName.GabeSmith]: AbigailChen,
|
||||
[IconName.GiorgioRossi]: GiorgioRossi,
|
||||
[IconName.HaileyJohnson]: HaileyJohnson,
|
||||
[IconName.HaileyJohnsonMilitary]: HaileyJohnsonMilitary,
|
||||
[IconName.IsabellaRodriguez]: IsabellaRodriguez,
|
||||
[IconName.JaneMoreno]: JaneMoreno,
|
||||
[IconName.JenniferMoore]: JenniferMoore,
|
||||
[IconName.JenniferMooreMilitary]: JenniferMooreMilitary,
|
||||
[IconName.JohnLin]: JohnLin,
|
||||
[IconName.KlausMueller]: KlausMueller,
|
||||
[IconName.LatoyaWilliams]: LatoyaWilliams,
|
||||
|
||||
@@ -151,7 +151,7 @@ export default observer(({ style = {} }: { style?: SxProps }) => {
|
||||
>
|
||||
<LogoIcon />
|
||||
<Box sx={{ marginLeft: '6px', fontWeight: 800, fontSize: '20px' }}>
|
||||
多智能体协同平台
|
||||
AGENTCOORD
|
||||
</Box>
|
||||
</Box>
|
||||
) : (
|
||||
|
||||
@@ -8,7 +8,6 @@ import RemoveIcon from '@mui/icons-material/Remove';
|
||||
import AdjustIcon from '@mui/icons-material/Adjust';
|
||||
import { ObjectProps, ProcessProps } from './interface';
|
||||
import AgentIcon from '@/components/AgentIcon';
|
||||
import DescriptionCard from '@/components/ProcessDiscription/DescriptionCard';
|
||||
import { globalStorage } from '@/storage';
|
||||
|
||||
export interface IEditObjectProps {
|
||||
@@ -330,13 +329,6 @@ export const ProcessCard: React.FC<IProcessCardProps> = React.memo(
|
||||
// handleEditStep(step.name, { ...step, task: text });
|
||||
}}
|
||||
/>
|
||||
{/* 这里直接渲染对应的 DescriptionCard */}
|
||||
{/* {(() => {
|
||||
const step = globalStorage.planManager.currentPlan.find(
|
||||
s => s.id === process.id
|
||||
);
|
||||
return step ? <DescriptionCard step={step} /> : null;
|
||||
})()} */}
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
@@ -118,10 +118,10 @@ const D3Graph: React.FC<D3GraphProps> = ({
|
||||
stepName: stepCardName,
|
||||
objectName: objectCardName,
|
||||
type,
|
||||
x1: stepRect.left + stepRect.width,
|
||||
y1: stepRect.top + 0.5 * stepRect.height,
|
||||
x2: objectRect.left,
|
||||
y2: objectRect.top + 0.5 * objectRect.height,
|
||||
x1: objectRect.left + objectRect.width,
|
||||
y1: objectRect.top + 0.5 * objectRect.height,
|
||||
x2: stepRect.left,
|
||||
y2: stepRect.top + 0.5 * stepRect.height,
|
||||
};
|
||||
});
|
||||
const objectMetrics = calculateLineMetrics(cardRect, 'object');
|
||||
@@ -152,17 +152,17 @@ const D3Graph: React.FC<D3GraphProps> = ({
|
||||
userSelect: 'none',
|
||||
}}
|
||||
>
|
||||
<marker
|
||||
<marker
|
||||
id="arrowhead"
|
||||
markerWidth="2"
|
||||
markerHeight="2"
|
||||
refX="1"
|
||||
refY="1"
|
||||
markerWidth="4"
|
||||
markerHeight="4"
|
||||
refX="2"
|
||||
refY="2"
|
||||
orient="auto"
|
||||
markerUnits="strokeWidth"
|
||||
>
|
||||
<path d="M0,0 L2,1 L0,2 z" fill="#E5E5E5" />
|
||||
</marker>
|
||||
>
|
||||
<path d="M0,0 L4,2 L0,4 z" fill="#E5E5E5" />
|
||||
</marker>
|
||||
<marker
|
||||
id="starter"
|
||||
markerWidth="4"
|
||||
@@ -184,7 +184,7 @@ const D3Graph: React.FC<D3GraphProps> = ({
|
||||
fill="#898989"
|
||||
fontWeight="800"
|
||||
>
|
||||
产出
|
||||
Key Object
|
||||
</text>
|
||||
<line
|
||||
x1={objectLine.x}
|
||||
@@ -204,7 +204,7 @@ const D3Graph: React.FC<D3GraphProps> = ({
|
||||
fill="#898989"
|
||||
fontWeight="800"
|
||||
>
|
||||
流程
|
||||
Process
|
||||
</text>
|
||||
<line
|
||||
x1={processLine.x}
|
||||
|
||||
@@ -53,7 +53,7 @@ export default observer(() => {
|
||||
const handleEditContent = (stepTaskId: string, newContent: string) => {
|
||||
globalStorage.setStepTaskContent(stepTaskId, newContent);
|
||||
};
|
||||
const WidthRatio = ['35%', '10%', '50%'];
|
||||
const WidthRatio = ['30%', '15%', '52.5%'];
|
||||
|
||||
const [cardRefMapReady, setCardRefMapReady] = React.useState(false);
|
||||
|
||||
@@ -175,34 +175,6 @@ export default observer(() => {
|
||||
sx={{ display: 'flex' }}
|
||||
ref={ref}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
// display: 'flex',
|
||||
alignItems: 'center',
|
||||
// width: WidthRatio[2],
|
||||
justifyContent: 'center',
|
||||
flex: `0 0 ${WidthRatio[2]}`,
|
||||
}}
|
||||
>
|
||||
{name && (
|
||||
<ProcessCard
|
||||
process={{
|
||||
id,
|
||||
name,
|
||||
icons: agentIcons,
|
||||
agents,
|
||||
content,
|
||||
cardRef: getCardRef(`process.${name}`),
|
||||
}}
|
||||
handleProcessClick={handleProcessClick}
|
||||
isFocusing={focusingStepTaskId === id}
|
||||
isAddActive={id === activeProcessIdAdd}
|
||||
handleAddActive={handleProcessAdd}
|
||||
handleEditContent={handleEditContent}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
<Box sx={{ flex: `0 0 ${WidthRatio[1]}` }} />
|
||||
<Box
|
||||
sx={{
|
||||
display: 'flex',
|
||||
@@ -237,6 +209,34 @@ export default observer(() => {
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
<Box sx={{ flex: `0 0 ${WidthRatio[1]}` }} />
|
||||
<Box
|
||||
sx={{
|
||||
// display: 'flex',
|
||||
alignItems: 'center',
|
||||
// width: WidthRatio[2],
|
||||
justifyContent: 'center',
|
||||
flex: `0 0 ${WidthRatio[2]}`,
|
||||
}}
|
||||
>
|
||||
{name && (
|
||||
<ProcessCard
|
||||
process={{
|
||||
id,
|
||||
name,
|
||||
icons: agentIcons,
|
||||
agents,
|
||||
content,
|
||||
cardRef: getCardRef(`process.${name}`),
|
||||
}}
|
||||
handleProcessClick={handleProcessClick}
|
||||
isFocusing={focusingStepTaskId === id}
|
||||
isAddActive={id === activeProcessIdAdd}
|
||||
handleAddActive={handleProcessAdd}
|
||||
handleEditContent={handleEditContent}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
),
|
||||
)}
|
||||
|
||||
@@ -25,7 +25,7 @@ export default observer(({ style = {} }: { style?: SxProps }) => {
|
||||
...style,
|
||||
}}
|
||||
>
|
||||
<Title title="任务大纲" />
|
||||
<Title title="Plan Outline" />
|
||||
<Box
|
||||
sx={{
|
||||
position: 'relative',
|
||||
|
||||
@@ -19,7 +19,7 @@ export default observer(({ style = {} }: { style?: SxProps }) => {
|
||||
...style,
|
||||
}}
|
||||
>
|
||||
<Title title="任务流程" />
|
||||
<Title title="Task Process" />
|
||||
<Stack
|
||||
spacing={1}
|
||||
sx={{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from 'react';
|
||||
import React from 'react';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { Divider, SxProps, Tooltip, Typography} from '@mui/material';
|
||||
import { Divider, SxProps } from '@mui/material';
|
||||
import Box from '@mui/material/Box';
|
||||
import UnfoldLessIcon from '@mui/icons-material/UnfoldLess';
|
||||
import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
|
||||
@@ -9,7 +9,6 @@ import { globalStorage } from '@/storage';
|
||||
import type { IExecuteStepHistoryItem } from '@/apis/execute-plan';
|
||||
import AgentIcon from '@/components/AgentIcon';
|
||||
import { getAgentActionStyle } from '@/storage/plan';
|
||||
import { getActionTypeDisplayText } from '@/storage/plan/action';
|
||||
|
||||
export interface IStepHistoryItemProps {
|
||||
item: IExecuteStepHistoryItem;
|
||||
@@ -47,170 +46,6 @@ export default observer(
|
||||
}, 10);
|
||||
}
|
||||
}, [expand]);
|
||||
|
||||
interface DataSpaceCard {
|
||||
name: string;
|
||||
data_space: string;
|
||||
doId: string;
|
||||
fromRepo: string;
|
||||
}
|
||||
|
||||
interface DataSpaceIndicatorProps {
|
||||
cards?: DataSpaceCard[];
|
||||
}
|
||||
|
||||
const DataSpaceIndicator = ({ cards = [] }: DataSpaceIndicatorProps) => {
|
||||
const [currentCard, setCurrentCard] = useState(0);
|
||||
|
||||
if (!cards || cards.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const tooltipContent = (
|
||||
<>
|
||||
{/* 添加标题 */}
|
||||
<Box
|
||||
sx={{
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center',
|
||||
padding: '8px 12px',
|
||||
backgroundColor: '#1565c0',
|
||||
color: 'white',
|
||||
borderRadius: '4px 4px 0 0',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '14px',
|
||||
}}
|
||||
>
|
||||
<span>数联网搜索结果</span>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
||||
<span style={{ fontSize: '12px', color: 'rgba(255,255,255,0.8)' }}>
|
||||
{currentCard + 1}/{cards.length}
|
||||
</span>
|
||||
<button
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setCurrentCard((prev) => (prev + 1) % cards.length);
|
||||
}}
|
||||
style={{
|
||||
fontSize: '12px',
|
||||
padding: '2px 8px',
|
||||
backgroundColor: 'white',
|
||||
color: '#1565c0',
|
||||
border: 'none',
|
||||
borderRadius: '3px',
|
||||
cursor: 'pointer',
|
||||
fontWeight: 'bold'
|
||||
}}
|
||||
>
|
||||
下一个
|
||||
</button>
|
||||
</Box>
|
||||
</Box>
|
||||
<Box
|
||||
sx={{
|
||||
padding: '12px',
|
||||
borderRadius: '4px',
|
||||
backgroundColor: '#e3f2fd',
|
||||
border: '1px solid #1565c0',
|
||||
minWidth: '450px', // 设置卡片最小宽度
|
||||
}}
|
||||
>
|
||||
<Box sx={{ display: 'flex', alignItems: 'flex-start', marginBottom: '4px' }}>
|
||||
<Typography variant="caption" sx={{ fontWeight: 'bold', color: '#666', minWidth: '60px' }}>
|
||||
名称:
|
||||
</Typography>
|
||||
<Typography variant="body2" sx={{ color: 'black' }}>
|
||||
{cards[currentCard]?.name}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
<Box sx={{ display: 'flex', alignItems: 'flex-start', marginBottom: '4px' }}>
|
||||
<Typography variant="caption" sx={{ fontWeight: 'bold', color: '#666', minWidth: '60px' }}>
|
||||
数据空间:
|
||||
</Typography>
|
||||
<Typography variant="body2" sx={{ color: 'black' }}>
|
||||
{cards[currentCard]?.data_space}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
<Box sx={{ display: 'flex', alignItems: 'flex-start', marginBottom: '4px' }}>
|
||||
<Typography variant="caption" sx={{ fontWeight: 'bold', color: '#666', minWidth: '60px' }}>
|
||||
DOID:
|
||||
</Typography>
|
||||
<Typography variant="body2" sx={{ color: 'black' }}>
|
||||
{cards[currentCard]?.doId}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
<Box sx={{ display: 'flex', alignItems: 'flex-start', marginBottom: '4px' }}>
|
||||
<Typography variant="caption" sx={{ fontWeight: 'bold', color: '#666', minWidth: '60px' }}>
|
||||
来源仓库:
|
||||
</Typography>
|
||||
<Typography variant="body2" sx={{ color: 'black' }}>
|
||||
{cards[currentCard]?.fromRepo}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
title={tooltipContent}
|
||||
arrow
|
||||
slotProps={{
|
||||
tooltip: {
|
||||
sx: {
|
||||
maxWidth: 500, // 只需要这一行来增加宽度
|
||||
},
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
width: '20px',
|
||||
height: '20px',
|
||||
borderRadius: '50%',
|
||||
backgroundColor: '#9e9e9e',
|
||||
color: 'white',
|
||||
fontSize: '12px',
|
||||
fontWeight: '600',
|
||||
cursor: 'pointer',
|
||||
'&:hover': {
|
||||
backgroundColor: '#1565c0',
|
||||
}
|
||||
}}
|
||||
>
|
||||
{cards.length}
|
||||
</Box>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
|
||||
const cardData = [
|
||||
{
|
||||
name: "3D Semantic-Geometric Corrosion Mapping Implementations",
|
||||
data_space: "江苏省产研院",
|
||||
doId: "bdware.scenario/d8f3ff8c-3fb3-4573-88a6-5dd823627c37",
|
||||
fromRepo: "https://arxiv.org/abs/2404.13691"
|
||||
},
|
||||
{
|
||||
name: "RustSEG -- Automated segmentation of corrosion using deep learning",
|
||||
data_space: "江苏省产研院",
|
||||
doId: "bdware.scenario/67445299-110a-4a4e-9fda-42e4b5a493c2",
|
||||
fromRepo: "https://arxiv.org/abs/2205.05426"
|
||||
},
|
||||
{
|
||||
name: "Pixel-level Corrosion Detection on Metal Constructions by Fusion of Deep Learning Semantic and Contour Segmentation",
|
||||
data_space: "江苏省产研院",
|
||||
doId: "bdware.scenario/115d5135-85d3-4123-8b81-9eb9f07b6153",
|
||||
fromRepo: "https://arxiv.org/abs/2008.05204"
|
||||
},
|
||||
];
|
||||
const s = { ...getAgentActionStyle(item.type), ...style } as SxProps;
|
||||
React.useEffect(() => {
|
||||
console.log(item);
|
||||
@@ -242,7 +77,7 @@ const cardData = [
|
||||
{item.agent}
|
||||
</Box>
|
||||
<Box component="span" sx={{ fontWeight: 400 }}>
|
||||
: {getActionTypeDisplayText(item.type)}
|
||||
: {item.type}
|
||||
</Box>
|
||||
</Box>
|
||||
{item.result ? (
|
||||
@@ -268,14 +103,10 @@ const cardData = [
|
||||
marginBottom: '4px',
|
||||
color: '#0009',
|
||||
fontWeight: 400,
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
gap: '8px',
|
||||
}}
|
||||
>
|
||||
{item.description}
|
||||
</Box>
|
||||
<DataSpaceIndicator cards={cardData} />
|
||||
<MarkdownBlock
|
||||
text={item.result}
|
||||
style={{
|
||||
|
||||
@@ -79,7 +79,7 @@ export default observer(({ style = {} }: { style?: SxProps }) => {
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
<Title title="执行结果" />
|
||||
<Title title="Execution Result" />
|
||||
<Box
|
||||
sx={{
|
||||
flexGrow: 1,
|
||||
|
||||
@@ -4,8 +4,6 @@ import { SxProps } from '@mui/material';
|
||||
import Box from '@mui/material/Box';
|
||||
import IconButton from '@mui/material/IconButton';
|
||||
import FormControl from '@mui/material/FormControl';
|
||||
import Autocomplete from '@mui/material/Autocomplete';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import FilledInput from '@mui/material/FilledInput';
|
||||
import TelegramIcon from '@mui/icons-material/Telegram';
|
||||
import CircularProgress from '@mui/material/CircularProgress';
|
||||
@@ -18,18 +16,6 @@ export interface UserGoalInputProps {
|
||||
export default observer(({ style = {} }: UserGoalInputProps) => {
|
||||
const inputRef = React.useRef<string>('');
|
||||
const inputElementRef = React.useRef<HTMLInputElement>(null);
|
||||
const goalOptions = [
|
||||
'如何快速筛选慢性肾脏病药物潜在受试者?',
|
||||
'如何补充“丹芍活血胶囊”不良反应数据?',
|
||||
'如何快速研发用于战场失血性休克的药物?',
|
||||
'二维材料的光电性质受哪些关键因素影响?',
|
||||
'如何通过AI模拟的方法分析材料的微观结构?',
|
||||
'如何分析获取液态金属热力学参数?',
|
||||
'如何解决固态电池的成本和寿命难题?',
|
||||
'如何解决船舶制造中的材料腐蚀难题?',
|
||||
'如何解决船舶制造中流体模拟和建模优化难题?',
|
||||
];
|
||||
|
||||
React.useEffect(() => {
|
||||
if (inputElementRef.current) {
|
||||
if (globalStorage.planManager) {
|
||||
@@ -46,53 +32,29 @@ export default observer(({ style = {} }: UserGoalInputProps) => {
|
||||
...style,
|
||||
}}
|
||||
>
|
||||
<Autocomplete
|
||||
freeSolo
|
||||
disableClearable
|
||||
<FilledInput
|
||||
disabled={
|
||||
globalStorage.api.busy ||
|
||||
!globalStorage.api.agentsReady ||
|
||||
globalStorage.api.planReady
|
||||
}
|
||||
options={goalOptions}
|
||||
value={inputRef.current || (globalStorage.planManager ? globalStorage.planManager.goal : globalStorage.briefGoal)}
|
||||
onChange={(event, newValue) => {
|
||||
if (newValue) {
|
||||
inputRef.current = newValue;
|
||||
}
|
||||
}}
|
||||
onInputChange={(event, newInputValue) => {
|
||||
inputRef.current = newInputValue;
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
{...params}
|
||||
variant="filled"
|
||||
placeholder="请输入你的任务"
|
||||
placeholder="Yout Goal"
|
||||
fullWidth
|
||||
size="small"
|
||||
inputRef={inputElementRef}
|
||||
onChange={event => (inputRef.current = event.target.value)}
|
||||
size="small"
|
||||
sx={{
|
||||
borderRadius: '10px',
|
||||
background: '#E1E1E1',
|
||||
borderBottom: 'none !important',
|
||||
'& .MuiFilledInput-root': {
|
||||
height: '45px',
|
||||
borderRadius: '10px',
|
||||
background: '#E1E1E1',
|
||||
paddingTop: '5px',
|
||||
borderBottom: 'none !important',
|
||||
'&::before': {
|
||||
borderBottom: 'none !important',
|
||||
},
|
||||
'&::after': {
|
||||
borderBottom: 'none !important',
|
||||
},
|
||||
'& > input': {
|
||||
padding: '10px',
|
||||
},
|
||||
}}
|
||||
InputProps={{
|
||||
...params.InputProps,
|
||||
startAdornment: (
|
||||
startAdornment={
|
||||
<Box
|
||||
sx={{
|
||||
color: '#4A9C9E',
|
||||
@@ -102,14 +64,10 @@ export default observer(({ style = {} }: UserGoalInputProps) => {
|
||||
userSelect: 'none',
|
||||
}}
|
||||
>
|
||||
任务
|
||||
\General Goal:
|
||||
</Box>
|
||||
),
|
||||
}}
|
||||
}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
{globalStorage.api.planGenerating ? (
|
||||
<CircularProgress
|
||||
sx={{
|
||||
|
||||
@@ -88,24 +88,24 @@ export default observer(() => {
|
||||
setConnectors(<></>);
|
||||
}
|
||||
const outlinePosition =
|
||||
ElementToLink[1]?.current?.getBoundingClientRect?.();
|
||||
ElementToLink[0]?.current?.getBoundingClientRect?.();
|
||||
if (!outlinePosition) {
|
||||
return;
|
||||
}
|
||||
const agentRects = ElementToLink[0]
|
||||
const agentRects = ElementToLink[1]
|
||||
.map(ele => ele.current?.getBoundingClientRect?.() as DOMRect)
|
||||
.filter(rect => rect);
|
||||
if (agentRects.length === 0) {
|
||||
return;
|
||||
}
|
||||
const agentsPosition = mergeRects(...agentRects);
|
||||
// const descriptionPosition =
|
||||
// ElementToLink[2]?.current?.getBoundingClientRect?.();
|
||||
// if (!descriptionPosition) {
|
||||
// return;
|
||||
// }
|
||||
const descriptionPosition =
|
||||
ElementToLink[2]?.current?.getBoundingClientRect?.();
|
||||
if (!descriptionPosition) {
|
||||
return;
|
||||
}
|
||||
|
||||
const LogRects = ElementToLink[2]
|
||||
const LogRects = ElementToLink[3]
|
||||
.map(ele => ele?.current?.getBoundingClientRect?.() as DOMRect)
|
||||
.filter(rect => rect);
|
||||
if (LogRects.length > 0) {
|
||||
@@ -115,14 +115,15 @@ export default observer(() => {
|
||||
|
||||
setConnectors(
|
||||
drawConnectors(
|
||||
agentsPosition,
|
||||
outlinePosition,
|
||||
agentsPosition,
|
||||
descriptionPosition,
|
||||
logPosition,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
setConnectors(
|
||||
drawConnectors(agentsPosition,outlinePosition),
|
||||
drawConnectors(outlinePosition, agentsPosition, descriptionPosition),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -44,7 +44,7 @@ export default observer(() => {
|
||||
)}
|
||||
{globalStorage.agentAssigmentWindow ? (
|
||||
<FloatWindow
|
||||
title="智能体选择"
|
||||
title="Assignment Exploration"
|
||||
onClose={() => (globalStorage.agentAssigmentWindow = false)}
|
||||
>
|
||||
<AgentAssignment
|
||||
|
||||
@@ -99,7 +99,16 @@ export default React.memo(() => {
|
||||
}}
|
||||
/>
|
||||
<Box sx={{ height: 0, flexGrow: 1, display: 'flex' }}>
|
||||
<ResizeableColumn columnWidth="19%">
|
||||
<ResizeableColumn columnWidth="25%">
|
||||
<Outline
|
||||
style={{
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
marginRight: '6px',
|
||||
}}
|
||||
/>
|
||||
</ResizeableColumn>
|
||||
<ResizeableColumn columnWidth="25%">
|
||||
<AgentBoard
|
||||
style={{
|
||||
height: '100%',
|
||||
@@ -109,16 +118,7 @@ export default React.memo(() => {
|
||||
onAddAgent={() => setShowAgentHiring(true)}
|
||||
/>
|
||||
</ResizeableColumn>
|
||||
<ResizeableColumn columnWidth="26%">
|
||||
<Outline
|
||||
style={{
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
marginRight: '6px',
|
||||
}}
|
||||
/>
|
||||
</ResizeableColumn>
|
||||
{/* <ResizeableColumn columnWidth="25%">
|
||||
<ResizeableColumn columnWidth="25%">
|
||||
<ProcessDiscrption
|
||||
style={{
|
||||
height: '100%',
|
||||
@@ -126,7 +126,7 @@ export default React.memo(() => {
|
||||
marginRight: '6px',
|
||||
}}
|
||||
/>
|
||||
</ResizeableColumn> */}
|
||||
</ResizeableColumn>
|
||||
<ProcessRehearsal
|
||||
style={{
|
||||
height: '100%',
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
@@ -285,15 +285,17 @@ export class GlobalStorage {
|
||||
}
|
||||
|
||||
public get ElementToLink(): [
|
||||
React.RefObject<HTMLElement> | undefined,
|
||||
React.RefObject<HTMLElement>[],
|
||||
React.RefObject<HTMLElement> | undefined,
|
||||
(React.RefObject<HTMLElement> | undefined)[],
|
||||
] {
|
||||
return [
|
||||
this.refMap.OutlineCard.get(this.focusingStepTaskId ?? ''),
|
||||
this.focusingStepTask?.agentSelection?.agents?.map(
|
||||
agent => this.refMap.AgentCard.get(agent) ?? [],
|
||||
) ?? ([] as any),
|
||||
this.refMap.OutlineCard.get(this.focusingStepTaskId ?? ''),
|
||||
this.refMap.DiscriptionCard.get(this.focusingStepTaskId ?? ''),
|
||||
this.logManager.outdate
|
||||
? []
|
||||
: [
|
||||
|
||||
@@ -11,17 +11,6 @@ export enum ActionType {
|
||||
Finalize = 'Finalize',
|
||||
}
|
||||
|
||||
export const getActionTypeDisplayText = (actionType: ActionType | string): string => {
|
||||
const displayMap: Record<string, string> = {
|
||||
[ActionType.Propose]: '提议',
|
||||
[ActionType.Critique]: '评审',
|
||||
[ActionType.Improve]: '改进',
|
||||
[ActionType.Finalize]: '总结',
|
||||
};
|
||||
|
||||
return displayMap[actionType] || actionType;
|
||||
};
|
||||
|
||||
const AgentActionStyles = new Map<ActionType | '', SxProps>([
|
||||
[ActionType.Propose, { backgroundColor: '#B9EBF9', borderColor: '#94c2dc' }],
|
||||
[ActionType.Critique, { backgroundColor: '#EFF9B9', borderColor: '#c0dc94' }],
|
||||
|
||||
@@ -20,7 +20,7 @@ const nameJoin = (names: string[]) => {
|
||||
const last = tmp.pop()!;
|
||||
let t = tmp.join(', ');
|
||||
if (t.length > 0) {
|
||||
t = `${t} 和 ${last}`;
|
||||
t = `${t} and ${last}`;
|
||||
} else {
|
||||
t = last;
|
||||
}
|
||||
@@ -102,14 +102,14 @@ export class StepTaskNode implements INodeBase {
|
||||
text: this.output,
|
||||
style: { background: '#FFCA8C' },
|
||||
};
|
||||
outputSentence = `得到 !<${indexOffset}>!`;
|
||||
outputSentence = `to obtain !<${indexOffset}>!`;
|
||||
}
|
||||
// Join them togeter
|
||||
let content = inputSentence;
|
||||
if (content) {
|
||||
content = `基于${content}, ${nameSentence} 执行任务 !<${actionIndex}>!`;
|
||||
content = `Based on ${content}, ${nameSentence} perform the task of !<${actionIndex}>!`;
|
||||
} else {
|
||||
content = `${nameSentence} 执行任务 !<${actionIndex}>!`;
|
||||
content = `${nameSentence} perform the task of !<${actionIndex}>!`;
|
||||
}
|
||||
if (outputSentence) {
|
||||
content = `${content}, ${outputSentence}.`;
|
||||
|
||||
9
frontend/.claude/settings.local.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(npm run type-check:*)"
|
||||
],
|
||||
"deny": [],
|
||||
"ask": []
|
||||
}
|
||||
}
|
||||
6
frontend/.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
||||
node_modules
|
||||
dist
|
||||
.idea
|
||||
.vscode
|
||||
.git
|
||||
.gitignore
|
||||
8
frontend/.editorconfig
Normal file
@@ -0,0 +1,8 @@
|
||||
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}]
|
||||
charset = utf-8
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
end_of_line = lf
|
||||
max_line_length = 100
|
||||
1
frontend/.env
Normal file
@@ -0,0 +1 @@
|
||||
API_BASE=http://127.0.0.1:8000
|
||||
79
frontend/.eslintrc-auto-import.json
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"globals": {
|
||||
"Component": true,
|
||||
"ComponentPublicInstance": true,
|
||||
"ComputedRef": true,
|
||||
"DirectiveBinding": true,
|
||||
"EffectScope": true,
|
||||
"ExtractDefaultPropTypes": true,
|
||||
"ExtractPropTypes": true,
|
||||
"ExtractPublicPropTypes": true,
|
||||
"InjectionKey": true,
|
||||
"MaybeRef": true,
|
||||
"MaybeRefOrGetter": true,
|
||||
"PropType": true,
|
||||
"Ref": true,
|
||||
"ShallowRef": true,
|
||||
"Slot": true,
|
||||
"Slots": true,
|
||||
"VNode": true,
|
||||
"WritableComputedRef": true,
|
||||
"computed": true,
|
||||
"createApp": true,
|
||||
"customRef": true,
|
||||
"defineAsyncComponent": true,
|
||||
"defineComponent": true,
|
||||
"effectScope": true,
|
||||
"getCurrentInstance": true,
|
||||
"getCurrentScope": true,
|
||||
"getCurrentWatcher": true,
|
||||
"h": true,
|
||||
"inject": true,
|
||||
"isProxy": true,
|
||||
"isReactive": true,
|
||||
"isReadonly": true,
|
||||
"isRef": true,
|
||||
"isShallow": true,
|
||||
"markRaw": true,
|
||||
"nextTick": true,
|
||||
"onActivated": true,
|
||||
"onBeforeMount": true,
|
||||
"onBeforeUnmount": true,
|
||||
"onBeforeUpdate": true,
|
||||
"onDeactivated": true,
|
||||
"onErrorCaptured": true,
|
||||
"onMounted": true,
|
||||
"onRenderTracked": true,
|
||||
"onRenderTriggered": true,
|
||||
"onScopeDispose": true,
|
||||
"onServerPrefetch": true,
|
||||
"onUnmounted": true,
|
||||
"onUpdated": true,
|
||||
"onWatcherCleanup": true,
|
||||
"provide": true,
|
||||
"reactive": true,
|
||||
"readonly": true,
|
||||
"ref": true,
|
||||
"resolveComponent": true,
|
||||
"shallowReactive": true,
|
||||
"shallowReadonly": true,
|
||||
"shallowRef": true,
|
||||
"toRaw": true,
|
||||
"toRef": true,
|
||||
"toRefs": true,
|
||||
"toValue": true,
|
||||
"triggerRef": true,
|
||||
"unref": true,
|
||||
"useAttrs": true,
|
||||
"useCssModule": true,
|
||||
"useCssVars": true,
|
||||
"useId": true,
|
||||
"useModel": true,
|
||||
"useSlots": true,
|
||||
"useTemplateRef": true,
|
||||
"watch": true,
|
||||
"watchEffect": true,
|
||||
"watchPostEffect": true,
|
||||
"watchSyncEffect": true
|
||||
}
|
||||
}
|
||||
1
frontend/.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* text=auto eol=lf
|
||||
36
frontend/.gitignore
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Cypress
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Vitest
|
||||
__screenshots__/
|
||||
6
frontend/.prettierrc.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/prettierrc",
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"printWidth": 100
|
||||
}
|
||||
9
frontend/.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"Vue.volar",
|
||||
"vitest.explorer",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"EditorConfig.EditorConfig",
|
||||
"esbenp.prettier-vscode"
|
||||
]
|
||||
}
|
||||
95
frontend/CLAUDE.md
Normal file
@@ -0,0 +1,95 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Development Commands
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
pnpm install
|
||||
|
||||
# Development server with hot reload
|
||||
pnpm dev
|
||||
|
||||
# Build for production
|
||||
pnpm build
|
||||
|
||||
# Type checking
|
||||
pnpm type-check
|
||||
|
||||
# Lint and fix code
|
||||
pnpm lint
|
||||
|
||||
# Format code
|
||||
pnpm format
|
||||
|
||||
# Run unit tests
|
||||
pnpm test:unit
|
||||
```
|
||||
|
||||
## Project Architecture
|
||||
|
||||
This is a **Multi-Agent Coordination Platform** (多智能体协同平台) built with Vue 3, TypeScript, and Vite. The application enables users to create and manage AI agents with specialized roles and coordinate them to complete complex tasks through visual workflows.
|
||||
|
||||
### Tech Stack
|
||||
- **Vue 3** with Composition API and TypeScript
|
||||
- **Vite** for build tooling and development
|
||||
- **Element Plus** for UI components
|
||||
- **Pinia** for state management
|
||||
- **Tailwind CSS** for styling
|
||||
- **Vue Router** for routing (minimal usage)
|
||||
- **JSPlumb** for visual workflow connections
|
||||
- **Axios** for API requests with custom interceptors
|
||||
|
||||
### Key Architecture Components
|
||||
|
||||
#### State Management (`src/stores/modules/agents.ts`)
|
||||
Central store managing:
|
||||
- Agent definitions with profiles and icons
|
||||
- Task workflow data structures (`IRawStepTask`, `TaskProcess`)
|
||||
- Search functionality and current task state
|
||||
- Raw plan responses with UUID generation for tasks
|
||||
|
||||
#### Request Layer (`src/utils/request.ts`)
|
||||
Custom Axios wrapper with:
|
||||
- Proxy configuration for `/api` -> `http://localhost:8000`
|
||||
- Response interceptors for error handling
|
||||
- `useRequest` hook for reactive data fetching
|
||||
- Integrated Element Plus notifications
|
||||
|
||||
#### Component Structure
|
||||
- **Layout System** (`src/layout/`): Main application layout with Header and Main sections
|
||||
- **Task Templates** (`src/layout/components/Main/TaskTemplate/`): Different task types including AgentRepo, TaskSyllabus, and TaskResult
|
||||
- **Visual Workflow**: JSPlumb integration for drag-and-drop agent coordination flows
|
||||
|
||||
#### Icon System
|
||||
- SVG icons stored in `src/assets/icons/`
|
||||
- Custom `SvgIcon` component with vite-plugin-svg-icons
|
||||
- Icon categories include specialist roles (doctor, engineer, researcher, etc.)
|
||||
|
||||
### Build Configuration
|
||||
|
||||
#### Vite (`vite.config.ts`)
|
||||
- Element Plus auto-import and component resolution
|
||||
- SVG icon caching with custom symbol IDs
|
||||
- Proxy setup for API requests to backend
|
||||
- Path aliases: `@/` maps to `src/`
|
||||
|
||||
#### Docker Deployment
|
||||
- Multi-stage build: Node.js build + Caddy web server
|
||||
- API proxy configured via Caddyfile
|
||||
- Environment variable support for different deployment modes
|
||||
|
||||
### Data Models
|
||||
Key interfaces for the agent coordination system:
|
||||
- `Agent`: Name, Profile, Icon
|
||||
- `IRawStepTask`: Individual task steps with agent selection and inputs
|
||||
- `TaskProcess`: Action descriptions with important inputs
|
||||
- `IRichText`: Template-based content formatting with style support
|
||||
|
||||
### Development Notes
|
||||
- Uses pnpm as package manager (required by package.json)
|
||||
- Node version constraint: ^20.19.0 or >=22.12.0
|
||||
- Dark theme enabled by default in App.vue
|
||||
- Auto-imports configured for Vue APIs
|
||||
- No traditional Vue routes - uses component-based navigation
|
||||
27
frontend/Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
ARG CADDY_VERSION=2.6
|
||||
ARG BUILD_ENV=prod
|
||||
|
||||
FROM node:20.19.0 as base
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN npm install -g pnpm
|
||||
RUN pnpm install
|
||||
RUN pnpm build
|
||||
|
||||
|
||||
# The base for mode ENVIRONMENT=prod
|
||||
FROM caddy:${CADDY_VERSION}-alpine as prod
|
||||
|
||||
# Workaround for https://github.com/alpinelinux/docker-alpine/issues/98#issuecomment-679278499
|
||||
RUN sed -i 's/https/http/' /etc/apk/repositories \
|
||||
&& apk add --no-cache bash
|
||||
|
||||
COPY docker/Caddyfile /etc/caddy/
|
||||
COPY --from=base /app/dist /frontend
|
||||
|
||||
# Run stage
|
||||
FROM ${BUILD_ENV}
|
||||
|
||||
EXPOSE 80 443
|
||||
VOLUME ["/data", "/etc/caddy"]
|
||||
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
|
||||
106
frontend/README.md
Normal file
@@ -0,0 +1,106 @@
|
||||
# 多智能体协同平台 (Agent Coordination Platform)
|
||||
|
||||
一个强大的可视化平台,用于创建和管理具有专门角色的AI智能体,通过直观的工作流程协调它们来完成复杂任务。
|
||||
|
||||
## ✨ 功能特性
|
||||
|
||||
- **多智能体系统**:创建具有专门角色和专业知识的AI智能体
|
||||
- **可视化工作流编辑器**:使用JSPlumb设计智能体协调流程的拖放界面
|
||||
- **任务管理**:定义、执行和跟踪复杂的多步骤任务
|
||||
- **实时通信**:无缝的智能体交互和协调
|
||||
- **丰富的模板系统**:支持样式的灵活内容格式化
|
||||
- **TypeScript支持**:整个应用程序的完整类型安全
|
||||
|
||||
## 🚀 快速开始
|
||||
|
||||
### 开发命令
|
||||
|
||||
```bash
|
||||
# 安装依赖
|
||||
pnpm install
|
||||
|
||||
# 开发服务器(热重载)
|
||||
pnpm dev
|
||||
|
||||
# 生产构建
|
||||
pnpm build
|
||||
|
||||
# 类型检查
|
||||
pnpm type-check
|
||||
|
||||
# 代码检查和修复
|
||||
pnpm lint
|
||||
|
||||
# 代码格式化
|
||||
pnpm format
|
||||
|
||||
# 运行单元测试
|
||||
pnpm test:unit
|
||||
```
|
||||
|
||||
### 系统要求
|
||||
|
||||
- Node.js ^20.19.0 或 >=22.12.0
|
||||
- pnpm(必需的包管理器)
|
||||
|
||||
## 🏗️ 架构设计
|
||||
|
||||
### 技术栈
|
||||
|
||||
- **Vue 3**:Composition API 和 TypeScript
|
||||
- **Vite**:构建工具和开发环境
|
||||
- **Element Plus**:UI组件库
|
||||
- **Pinia**:状态管理
|
||||
- **Tailwind CSS**:样式框架
|
||||
- **JSPlumb**:可视化工作流连接
|
||||
- **Axios**:API请求与自定义拦截器
|
||||
|
||||
### 核心组件
|
||||
|
||||
#### 状态管理
|
||||
中央存储管理智能体定义、任务工作流和协调状态
|
||||
|
||||
#### 请求层
|
||||
自定义Axios包装器,具有代理配置和集成通知
|
||||
|
||||
#### 可视化工作流
|
||||
JSPlumb集成,用于拖放智能体协调流程
|
||||
|
||||
#### 图标系统
|
||||
基于SVG的图标,用于不同的智能体专业化和角色
|
||||
|
||||
## 📁 项目结构
|
||||
|
||||
```
|
||||
src/
|
||||
├── assets/ # 静态资源,包括智能体图标
|
||||
├── components/ # 可复用的Vue组件
|
||||
├── layout/ # 应用布局和主要组件
|
||||
├── stores/ # Pinia状态管理
|
||||
├── utils/ # 工具函数和请求层
|
||||
├── views/ # 页面组件
|
||||
└── App.vue # 根组件
|
||||
```
|
||||
|
||||
## 🎯 开发指南
|
||||
|
||||
### IDE设置
|
||||
|
||||
[VS Code](https://code.visualstudio.com/) + [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar)(禁用Vetur)。
|
||||
|
||||
### 浏览器开发工具
|
||||
|
||||
- 基于Chromium的浏览器:
|
||||
- [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd)
|
||||
- 在DevTools中启用自定义对象格式化程序
|
||||
- Firefox:
|
||||
- [Vue.js devtools](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/)
|
||||
- 在DevTools中启用自定义对象格式化程序
|
||||
|
||||
## 🚀 部署
|
||||
|
||||
应用程序支持Docker部署,使用多阶段构建过程:Node.js用于构建,Caddy作为Web服务器。
|
||||
|
||||
## 📄 许可证
|
||||
|
||||
MIT许可证 - 详见LICENSE文件
|
||||
75
frontend/auto-imports.d.ts
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// @ts-nocheck
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
// Generated by unplugin-auto-import
|
||||
// biome-ignore lint: disable
|
||||
export {}
|
||||
declare global {
|
||||
const EffectScope: typeof import('vue').EffectScope
|
||||
const ElMessage: typeof import('element-plus/es').ElMessage
|
||||
const ElNotification: typeof import('element-plus/es').ElNotification
|
||||
const computed: typeof import('vue').computed
|
||||
const createApp: typeof import('vue').createApp
|
||||
const customRef: typeof import('vue').customRef
|
||||
const defineAsyncComponent: typeof import('vue').defineAsyncComponent
|
||||
const defineComponent: typeof import('vue').defineComponent
|
||||
const effectScope: typeof import('vue').effectScope
|
||||
const getCurrentInstance: typeof import('vue').getCurrentInstance
|
||||
const getCurrentScope: typeof import('vue').getCurrentScope
|
||||
const getCurrentWatcher: typeof import('vue').getCurrentWatcher
|
||||
const h: typeof import('vue').h
|
||||
const inject: typeof import('vue').inject
|
||||
const isProxy: typeof import('vue').isProxy
|
||||
const isReactive: typeof import('vue').isReactive
|
||||
const isReadonly: typeof import('vue').isReadonly
|
||||
const isRef: typeof import('vue').isRef
|
||||
const isShallow: typeof import('vue').isShallow
|
||||
const markRaw: typeof import('vue').markRaw
|
||||
const nextTick: typeof import('vue').nextTick
|
||||
const onActivated: typeof import('vue').onActivated
|
||||
const onBeforeMount: typeof import('vue').onBeforeMount
|
||||
const onBeforeUnmount: typeof import('vue').onBeforeUnmount
|
||||
const onBeforeUpdate: typeof import('vue').onBeforeUpdate
|
||||
const onDeactivated: typeof import('vue').onDeactivated
|
||||
const onErrorCaptured: typeof import('vue').onErrorCaptured
|
||||
const onMounted: typeof import('vue').onMounted
|
||||
const onRenderTracked: typeof import('vue').onRenderTracked
|
||||
const onRenderTriggered: typeof import('vue').onRenderTriggered
|
||||
const onScopeDispose: typeof import('vue').onScopeDispose
|
||||
const onServerPrefetch: typeof import('vue').onServerPrefetch
|
||||
const onUnmounted: typeof import('vue').onUnmounted
|
||||
const onUpdated: typeof import('vue').onUpdated
|
||||
const onWatcherCleanup: typeof import('vue').onWatcherCleanup
|
||||
const provide: typeof import('vue').provide
|
||||
const reactive: typeof import('vue').reactive
|
||||
const readonly: typeof import('vue').readonly
|
||||
const ref: typeof import('vue').ref
|
||||
const resolveComponent: typeof import('vue').resolveComponent
|
||||
const shallowReactive: typeof import('vue').shallowReactive
|
||||
const shallowReadonly: typeof import('vue').shallowReadonly
|
||||
const shallowRef: typeof import('vue').shallowRef
|
||||
const toRaw: typeof import('vue').toRaw
|
||||
const toRef: typeof import('vue').toRef
|
||||
const toRefs: typeof import('vue').toRefs
|
||||
const toValue: typeof import('vue').toValue
|
||||
const triggerRef: typeof import('vue').triggerRef
|
||||
const unref: typeof import('vue').unref
|
||||
const useAttrs: typeof import('vue').useAttrs
|
||||
const useCssModule: typeof import('vue').useCssModule
|
||||
const useCssVars: typeof import('vue').useCssVars
|
||||
const useId: typeof import('vue').useId
|
||||
const useModel: typeof import('vue').useModel
|
||||
const useSlots: typeof import('vue').useSlots
|
||||
const useTemplateRef: typeof import('vue').useTemplateRef
|
||||
const watch: typeof import('vue').watch
|
||||
const watchEffect: typeof import('vue').watchEffect
|
||||
const watchPostEffect: typeof import('vue').watchPostEffect
|
||||
const watchSyncEffect: typeof import('vue').watchSyncEffect
|
||||
}
|
||||
// for type re-export
|
||||
declare global {
|
||||
// @ts-ignore
|
||||
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
|
||||
import('vue')
|
||||
}
|
||||
205
frontend/claude_code_env.sh
Normal file
@@ -0,0 +1,205 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# ========================
|
||||
# 常量定义
|
||||
# ========================
|
||||
SCRIPT_NAME=$(basename "$0")
|
||||
NODE_MIN_VERSION=18
|
||||
NODE_INSTALL_VERSION=22
|
||||
NVM_VERSION="v0.40.3"
|
||||
CLAUDE_PACKAGE="@anthropic-ai/claude-code"
|
||||
CONFIG_DIR="$HOME/.claude"
|
||||
CONFIG_FILE="$CONFIG_DIR/settings.json"
|
||||
API_BASE_URL="https://open.bigmodel.cn/api/anthropic"
|
||||
API_KEY_URL="https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys"
|
||||
API_TIMEOUT_MS=3000000
|
||||
|
||||
# ========================
|
||||
# 工具函数
|
||||
# ========================
|
||||
|
||||
log_info() {
|
||||
echo "🔹 $*"
|
||||
}
|
||||
|
||||
log_success() {
|
||||
echo "✅ $*"
|
||||
}
|
||||
|
||||
log_error() {
|
||||
echo "❌ $*" >&2
|
||||
}
|
||||
|
||||
ensure_dir_exists() {
|
||||
local dir="$1"
|
||||
if [ ! -d "$dir" ]; then
|
||||
mkdir -p "$dir" || {
|
||||
log_error "Failed to create directory: $dir"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
}
|
||||
|
||||
# ========================
|
||||
# Node.js 安装函数
|
||||
# ========================
|
||||
|
||||
install_nodejs() {
|
||||
local platform=$(uname -s)
|
||||
|
||||
case "$platform" in
|
||||
Linux|Darwin)
|
||||
log_info "Installing Node.js on $platform..."
|
||||
|
||||
# 安装 nvm
|
||||
log_info "Installing nvm ($NVM_VERSION)..."
|
||||
curl -s https://raw.githubusercontent.com/nvm-sh/nvm/"$NVM_VERSION"/install.sh | bash
|
||||
|
||||
# 加载 nvm
|
||||
log_info "Loading nvm environment..."
|
||||
\. "$HOME/.nvm/nvm.sh"
|
||||
|
||||
# 安装 Node.js
|
||||
log_info "Installing Node.js $NODE_INSTALL_VERSION..."
|
||||
nvm install "$NODE_INSTALL_VERSION"
|
||||
|
||||
# 验证安装
|
||||
node -v &>/dev/null || {
|
||||
log_error "Node.js installation failed"
|
||||
exit 1
|
||||
}
|
||||
log_success "Node.js installed: $(node -v)"
|
||||
log_success "npm version: $(npm -v)"
|
||||
;;
|
||||
*)
|
||||
log_error "Unsupported platform: $platform"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# ========================
|
||||
# Node.js 检查函数
|
||||
# ========================
|
||||
|
||||
check_nodejs() {
|
||||
if command -v node &>/dev/null; then
|
||||
current_version=$(node -v | sed 's/v//')
|
||||
major_version=$(echo "$current_version" | cut -d. -f1)
|
||||
|
||||
if [ "$major_version" -ge "$NODE_MIN_VERSION" ]; then
|
||||
log_success "Node.js is already installed: v$current_version"
|
||||
return 0
|
||||
else
|
||||
log_info "Node.js v$current_version is installed but version < $NODE_MIN_VERSION. Upgrading..."
|
||||
install_nodejs
|
||||
fi
|
||||
else
|
||||
log_info "Node.js not found. Installing..."
|
||||
install_nodejs
|
||||
fi
|
||||
}
|
||||
|
||||
# ========================
|
||||
# Claude Code 安装
|
||||
# ========================
|
||||
|
||||
install_claude_code() {
|
||||
if command -v claude &>/dev/null; then
|
||||
log_success "Claude Code is already installed: $(claude --version)"
|
||||
else
|
||||
log_info "Installing Claude Code..."
|
||||
npm install -g "$CLAUDE_PACKAGE" || {
|
||||
log_error "Failed to install claude-code"
|
||||
exit 1
|
||||
}
|
||||
log_success "Claude Code installed successfully"
|
||||
fi
|
||||
}
|
||||
|
||||
configure_claude_json(){
|
||||
node --eval '
|
||||
const os = require("os");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const homeDir = os.homedir();
|
||||
const filePath = path.join(homeDir, ".claude.json");
|
||||
if (fs.existsSync(filePath)) {
|
||||
const content = JSON.parse(fs.readFileSync(filePath, "utf-8"));
|
||||
fs.writeFileSync(filePath, JSON.stringify({ ...content, hasCompletedOnboarding: true }, null, 2), "utf-8");
|
||||
} else {
|
||||
fs.writeFileSync(filePath, JSON.stringify({ hasCompletedOnboarding: true }, null, 2), "utf-8");
|
||||
}'
|
||||
}
|
||||
|
||||
# ========================
|
||||
# API Key 配置
|
||||
# ========================
|
||||
|
||||
configure_claude() {
|
||||
log_info "Configuring Claude Code..."
|
||||
echo " You can get your API key from: $API_KEY_URL"
|
||||
read -s -p "🔑 Please enter your ZHIPU API key: " api_key
|
||||
echo
|
||||
|
||||
if [ -z "$api_key" ]; then
|
||||
log_error "API key cannot be empty. Please run the script again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ensure_dir_exists "$CONFIG_DIR"
|
||||
|
||||
# 写入配置文件
|
||||
node --eval '
|
||||
const os = require("os");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const homeDir = os.homedir();
|
||||
const filePath = path.join(homeDir, ".claude", "settings.json");
|
||||
const apiKey = "'"$api_key"'";
|
||||
|
||||
const content = fs.existsSync(filePath)
|
||||
? JSON.parse(fs.readFileSync(filePath, "utf-8"))
|
||||
: {};
|
||||
|
||||
fs.writeFileSync(filePath, JSON.stringify({
|
||||
...content,
|
||||
env: {
|
||||
ANTHROPIC_AUTH_TOKEN: apiKey,
|
||||
ANTHROPIC_BASE_URL: "'"$API_BASE_URL"'",
|
||||
API_TIMEOUT_MS: "'"$API_TIMEOUT_MS"'",
|
||||
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 1
|
||||
}
|
||||
}, null, 2), "utf-8");
|
||||
' || {
|
||||
log_error "Failed to write settings.json"
|
||||
exit 1
|
||||
}
|
||||
|
||||
log_success "Claude Code configured successfully"
|
||||
}
|
||||
|
||||
# ========================
|
||||
# 主流程
|
||||
# ========================
|
||||
|
||||
main() {
|
||||
echo "🚀 Starting $SCRIPT_NAME"
|
||||
|
||||
check_nodejs
|
||||
install_claude_code
|
||||
configure_claude_json
|
||||
configure_claude
|
||||
|
||||
echo ""
|
||||
log_success "🎉 Installation completed successfully!"
|
||||
echo ""
|
||||
echo "🚀 You can now start using Claude Code with:"
|
||||
echo " claude"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
35
frontend/components.d.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
// biome-ignore lint: disable
|
||||
// oxlint-disable
|
||||
// ------
|
||||
// Generated by unplugin-vue-components
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
|
||||
export {}
|
||||
|
||||
/* prettier-ignore */
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElCard: typeof import('element-plus/es')['ElCard']
|
||||
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
||||
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
||||
ElEmpty: typeof import('element-plus/es')['ElEmpty']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElPopover: typeof import('element-plus/es')['ElPopover']
|
||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||
MultiLineTooltip: typeof import('./src/components/MultiLineTooltip/index.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
SvgIcon: typeof import('./src/components/SvgIcon/index.vue')['default']
|
||||
}
|
||||
export interface GlobalDirectives {
|
||||
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
|
||||
}
|
||||
}
|
||||
BIN
frontend/dist.zip
Normal file
14
frontend/docker/Caddyfile
Normal file
@@ -0,0 +1,14 @@
|
||||
:80
|
||||
|
||||
# Proxy `/api` to backends
|
||||
handle_path /api/* {
|
||||
reverse_proxy {$API_HOST}
|
||||
}
|
||||
|
||||
# Frontend
|
||||
handle {
|
||||
root * /frontend
|
||||
encode gzip
|
||||
try_files {path} /index.html
|
||||
file_server
|
||||
}
|
||||
15
frontend/docker/docker-compose.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
agent-coord-font:
|
||||
image: agent-coord:0.0.1
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile
|
||||
environment:
|
||||
- API_HOST="http://host.docker.internal:8000"
|
||||
- BUILD_ENV=prod
|
||||
4
frontend/env.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/// <reference types="vite/client" />
|
||||
declare global {
|
||||
const testGlobal: any; // 声明 testGlobal 为全局变量
|
||||
}
|
||||
48
frontend/eslint.config.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { globalIgnores } from 'eslint/config'
|
||||
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
|
||||
import pluginVue from 'eslint-plugin-vue'
|
||||
import pluginVitest from '@vitest/eslint-plugin'
|
||||
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
|
||||
import autoImportConfig from './.eslintrc-auto-import.json' with { type: 'json' }
|
||||
|
||||
|
||||
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
|
||||
// import { configureVueProject } from '@vue/eslint-config-typescript'
|
||||
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
|
||||
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
|
||||
|
||||
export default defineConfigWithVueTs(
|
||||
{
|
||||
name: 'app/files-to-lint',
|
||||
files: ['**/*.{ts,mts,tsx,vue}'],
|
||||
},
|
||||
globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
|
||||
pluginVue.configs['flat/essential'],
|
||||
vueTsConfigs.recommended,
|
||||
{
|
||||
...pluginVitest.configs.recommended,
|
||||
files: ['src/**/__tests__/*'],
|
||||
},
|
||||
skipFormatting,
|
||||
{
|
||||
name: 'app/custom-rules',
|
||||
files: ['**/*.{ts,mts,tsx,vue}'],
|
||||
rules: {
|
||||
'vue/multi-word-component-names': 'off',
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'auto-import-globals',
|
||||
files: ['**/*.{ts,mts,tsx,vue}'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...(autoImportConfig.globals || {}),
|
||||
testGlobal: 'readonly' // 手动添加一个测试变量
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'no-undef': 'off', // 确保关闭 no-undef 规则
|
||||
'@typescript-eslint/no-undef': 'off'
|
||||
}
|
||||
}
|
||||
)
|
||||
13
frontend/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/logo.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>多智能体协同平台</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
11986
frontend/package-lock.json
generated
Normal file
66
frontend/package.json
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"name": "agent-coord",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"test:unit": "vitest",
|
||||
"build-only": "vite build",
|
||||
"type-check": "vue-tsc --build",
|
||||
"lint": "eslint . --fix --cache",
|
||||
"format": "prettier --write src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jsplumb/browser-ui": "^6.2.10",
|
||||
"@types/markdown-it": "^14.1.2",
|
||||
"@vueuse/core": "^14.0.0",
|
||||
"axios": "^1.12.2",
|
||||
"dompurify": "^3.3.0",
|
||||
"element-plus": "^2.11.5",
|
||||
"lodash": "^4.17.21",
|
||||
"markdown-it": "^14.1.0",
|
||||
"pinia": "^3.0.3",
|
||||
"qs": "^6.14.0",
|
||||
"uuid": "^13.0.0",
|
||||
"vue": "^3.5.22",
|
||||
"vue-router": "^4.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/vite": "^4.1.15",
|
||||
"@tsconfig/node22": "^22.0.2",
|
||||
"@types/jsdom": "^27.0.0",
|
||||
"@types/lodash": "^4.17.20",
|
||||
"@types/node": "^22.18.11",
|
||||
"@types/qs": "^6.14.0",
|
||||
"@vitejs/plugin-vue": "^6.0.1",
|
||||
"@vitest/eslint-plugin": "^1.3.23",
|
||||
"@vue/eslint-config-prettier": "^10.2.0",
|
||||
"@vue/eslint-config-typescript": "^14.6.0",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"@vue/tsconfig": "^0.8.1",
|
||||
"eslint": "^9.37.0",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-vue": "~10.5.0",
|
||||
"jiti": "^2.6.1",
|
||||
"jsdom": "^27.0.1",
|
||||
"npm-run-all2": "^8.0.4",
|
||||
"prettier": "3.6.2",
|
||||
"sass": "^1.93.2",
|
||||
"sass-loader": "^16.0.5",
|
||||
"tailwindcss": "^4.1.15",
|
||||
"typescript": "~5.9.0",
|
||||
"unplugin-auto-import": "^20.2.0",
|
||||
"unplugin-vue-components": "^30.0.0",
|
||||
"vite": "^7.1.11",
|
||||
"vite-plugin-svg-icons": "^2.0.1",
|
||||
"vite-plugin-vue-devtools": "^8.0.3",
|
||||
"vitest": "^3.2.4",
|
||||
"vue-tsc": "^3.1.1"
|
||||
}
|
||||
}
|
||||
6750
frontend/pnpm-lock.yaml
generated
Normal file
116
frontend/public/agent.json
Normal file
@@ -0,0 +1,116 @@
|
||||
[
|
||||
{
|
||||
"Icon": "Hailey_Johnson.png",
|
||||
"Name": "船舶设计师",
|
||||
"Profile": "提供船舶制造中的实际需求和约束。",
|
||||
"Classification": "船舶制造数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Jennifer_Moore.png",
|
||||
"Name": "防护工程专家",
|
||||
"Profile": "专注于船舶腐蚀防护技术的设计与应用。在你的总结回答中,必须引用来自数联网的搜索数据,是搜索数据,不是数联网的研究成果。",
|
||||
"Classification": "船舶制造数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Jane_Moreno.png",
|
||||
"Name": "病理生理学家",
|
||||
"Profile": "专注于失血性休克的疾病机制,为药物研发提供理论靶点。",
|
||||
"Classification": "医药数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Giorgio_Rossi.png",
|
||||
"Name": "药物化学家",
|
||||
"Profile": "负责将靶点概念转化为实际可合成的分子。",
|
||||
"Classification": "医药数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Tamara_Taylor.png",
|
||||
"Name": "制剂工程师",
|
||||
"Profile": "负责将活性药物成分(API)变成稳定、可用、符合战场要求的剂型。",
|
||||
"Classification": "医药数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Maria_Lopez.png",
|
||||
"Name": "监管事务专家",
|
||||
"Profile": "深谙药品审评法规,目标是找到最快的合法上市路径。",
|
||||
"Classification": "医药数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Sam_Moore.png",
|
||||
"Name": "物理学家",
|
||||
"Profile": "从热力学与统计力学的基本原理出发,研究液态金属的自由能、焓、熵、比热等参数的理论建模。",
|
||||
"Classification": "科学数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Yuriko_Yamamoto.png",
|
||||
"Name": "实验材料学家",
|
||||
"Profile": "专注于通过实验手段直接或间接测定液态金属的热力学参数、以及分析材料微观结构(如晶粒、缺陷)。",
|
||||
"Classification": "科学数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Carlos_Gomez.png",
|
||||
"Name": "计算模拟专家",
|
||||
"Profile": "侧重于利用数值计算和模拟技术获取液态金属的热力学参数。",
|
||||
"Classification": "科学数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "John_Lin.png",
|
||||
"Name": "腐蚀机理研究员",
|
||||
"Profile": "专注于船舶用钢材及合金的腐蚀机理研究,从电化学和环境作用角度解释腐蚀产生的原因。在你的总结回答中,必须引用来自数联网的搜索数据,是搜索数据,不是数联网的研究成果。",
|
||||
"Classification": "船舶制造数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Arthur_Burton.png",
|
||||
"Name": "先进材料研发员",
|
||||
"Profile": "专注于开发和评估新型耐腐蚀材料、复合材料及固态电池材料。",
|
||||
"Classification": "科学数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Eddy_Lin.png",
|
||||
"Name": "肾脏病学家",
|
||||
"Profile": "专注于慢性肾脏病的诊断、治疗和患者管理,能提供临床洞察。",
|
||||
"Classification": "医药数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Isabella_Rodriguez.png",
|
||||
"Name": "临床研究协调员",
|
||||
"Profile": "负责受试者招募和临床试验流程优化。",
|
||||
"Classification": "医药数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Latoya_Williams.png",
|
||||
"Name": "中医药专家",
|
||||
"Profile": "理解药物的中药成分和作用机制。",
|
||||
"Classification": "医药数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Carmen_Ortiz.png",
|
||||
"Name": "药物安全专家",
|
||||
"Profile": "专注于药物不良反应数据收集、分析和报告。",
|
||||
"Classification": "医药数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Rajiv_Patel.png",
|
||||
"Name": "二维材料科学家",
|
||||
"Profile": "专注于二维材料(如石墨烯)的合成、性质和应用。",
|
||||
"Classification": "科学数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Tom_Moreno.png",
|
||||
"Name": "光电物理学家",
|
||||
"Profile": "研究材料的光电转换机制和关键影响因素。",
|
||||
"Classification": "科学数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Ayesha_Khan.png",
|
||||
"Name": "机器学习专家",
|
||||
"Profile": "专注于开发和应用AI模型用于材料模拟。",
|
||||
"Classification": "科学数据空间"
|
||||
},
|
||||
{
|
||||
"Icon": "Mei_Lin.png",
|
||||
"Name": "流体动力学专家",
|
||||
"Profile": "专注于流体行为理论和模拟。",
|
||||
"Classification": "科学数据空间"
|
||||
}
|
||||
]
|
||||
19
frontend/public/config.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"title": "数联网",
|
||||
"subTitle": "众创智能体",
|
||||
"centerTitle": "多智能体协同平台",
|
||||
"taskPromptWords": [
|
||||
"如何快速筛选慢性肾脏病药物潜在受试者?",
|
||||
"如何补充“丹芍活血胶囊”不良反应数据?",
|
||||
"如何快速研发用于战场失血性休克的药物?",
|
||||
"二维材料的光电性质受哪些关键因素影响?",
|
||||
"如何通过AI模拟的方法分析材料的微观结构?",
|
||||
"如何分析获取液态金属热力学参数?",
|
||||
"如何解决固态电池的成本和寿命难题?",
|
||||
"如何解决船舶制造中的材料腐蚀难题?",
|
||||
"如何解决船舶制造中流体模拟和建模优化难题?"
|
||||
],
|
||||
"agentRepository": {
|
||||
"storageVersionIdentifier": "1"
|
||||
}
|
||||
}
|
||||
BIN
frontend/public/favicon.ico
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
22
frontend/public/iodConfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"name": "3D Semantic-Geometric Corrosion Mapping Implementations",
|
||||
"data_space": "江苏省产研院",
|
||||
"doId": "bdware.scenario/d8f3ff8c-3fb3-4573-88a6-5dd823627c37",
|
||||
"fromRepo": "https://arxiv.org/abs/2404.13691"
|
||||
},
|
||||
{
|
||||
"name": "RustSEG -- Automated segmentation of corrosion using deep learning",
|
||||
"data_space": "江苏省产研院",
|
||||
"doId": "bdware.scenario/67445299-110a-4a4e-9fda-42e4b5a493c2",
|
||||
"fromRepo": "https://arxiv.org/abs/2205.05426"
|
||||
},
|
||||
{
|
||||
"name": "Pixel-level Corrosion Detection on Metal Constructions by Fusion of Deep Learning Semantic and Contour Segmentation",
|
||||
"data_space": "江苏省产研院",
|
||||
"doId": "bdware.scenario/115d5135-85d3-4123-8b81-9eb9f07b6153",
|
||||
"fromRepo": "https://arxiv.org/abs/2008.05204"
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
frontend/public/logo.jpg
Normal file
|
After Width: | Height: | Size: 79 KiB |
BIN
frontend/public/logo.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
97
frontend/src/App.vue
Normal file
@@ -0,0 +1,97 @@
|
||||
<script setup lang="ts">
|
||||
import Layout from './layout/index.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<layout />
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
#app {
|
||||
background-color: var(--color-bg);
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.jtk-endpoint {
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.card-item + .card-item {
|
||||
margin-top: 35px;
|
||||
}
|
||||
|
||||
.el-card {
|
||||
border-radius: 8px;
|
||||
background: var(--color-bg-tertiary);
|
||||
border: 2px solid var(--color-card-border);
|
||||
box-shadow: var(--color-card-border-hover);
|
||||
|
||||
&:hover {
|
||||
background: var(--color-bg-content-hover);
|
||||
box-shadow: none;
|
||||
transition: background-color 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.el-card__body {
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
:root {
|
||||
--gradient: linear-gradient(to right, #0093eb, #00d2d1);
|
||||
}
|
||||
|
||||
#task-template {
|
||||
.active-card {
|
||||
border: 2px solid transparent;
|
||||
$bg: var(--el-input-bg-color, var(--el-fill-color-blank));
|
||||
background: linear-gradient(
|
||||
var(--color-agent-list-selected-bg),
|
||||
var(--color-agent-list-selected-bg)
|
||||
)
|
||||
padding-box,
|
||||
linear-gradient(to right, #00c8d2, #315ab4) border-box;
|
||||
color: var(--color-text);
|
||||
}
|
||||
}
|
||||
|
||||
/* 1. 定义流动动画:让虚线沿路径移动 */
|
||||
@keyframes flowAnimation {
|
||||
to {
|
||||
stroke-dashoffset: 8; /* 与stroke-dasharray总和一致 */
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes flowAnimationReverse {
|
||||
to {
|
||||
stroke-dashoffset: -8; /* 与stroke-dasharray总和一致 */
|
||||
}
|
||||
}
|
||||
|
||||
/* 2. 为jsPlumb连线绑定动画:作用于SVG的path元素 */
|
||||
/* jtk-connector是jsPlumb连线的默认SVG类,path是实际的线条元素 */
|
||||
.jtk-connector-output path {
|
||||
/* 定义虚线规则:线段长度5px + 间隙3px(总长度8px,与动画偏移量匹配) */
|
||||
stroke-dasharray: 5 3;
|
||||
/* 应用动画:名称+时长+线性速度+无限循环 */
|
||||
animation: flowAnimationReverse 0.5s linear infinite;
|
||||
/* 可选:设置线条基础样式(颜色、宽度) */
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
/* 2. 为jsPlumb连线绑定动画:作用于SVG的path元素 */
|
||||
/* jtk-connector是jsPlumb连线的默认SVG类,path是实际的线条元素 */
|
||||
.jtk-connector-input path {
|
||||
/* 定义虚线规则:线段长度5px + 间隙3px(总长度8px,与动画偏移量匹配) */
|
||||
stroke-dasharray: 5 3;
|
||||
/* 应用动画:名称+时长+线性速度+无限循环 */
|
||||
animation: flowAnimationReverse 0.5s linear infinite;
|
||||
/* 可选:设置线条基础样式(颜色、宽度) */
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
/* 可选: hover时增强动画效果(如加速、变色) */
|
||||
.jtk-connector path:hover {
|
||||
animation-duration: 0.5s; /* hover时流动加速 */
|
||||
}
|
||||
</style>
|
||||
11
frontend/src/__tests__/App.spec.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
|
||||
import { mount } from '@vue/test-utils'
|
||||
import App from '../App.vue'
|
||||
|
||||
describe('App', () => {
|
||||
it('mounts renders properly', () => {
|
||||
const wrapper = mount(App)
|
||||
expect(wrapper.text()).toContain('You did it!')
|
||||
})
|
||||
})
|
||||
74
frontend/src/api/index.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
import request from '@/utils/request'
|
||||
import type { Agent, IRawPlanResponse } from '@/stores'
|
||||
|
||||
export interface ActionHistory {
|
||||
ID: string
|
||||
ActionType: string
|
||||
AgentName: string
|
||||
Description: string
|
||||
ImportantInput: string[]
|
||||
Action_Result: string
|
||||
}
|
||||
|
||||
export type IExecuteRawResponse = {
|
||||
LogNodeType: string
|
||||
NodeId: string
|
||||
InputName_List?: string[] | null
|
||||
OutputName?: string
|
||||
content?: string
|
||||
ActionHistory: ActionHistory[]
|
||||
}
|
||||
|
||||
class Api {
|
||||
// 智能体信息
|
||||
setAgents = (data: Pick<Agent, 'Name' | 'Profile'>[]) => {
|
||||
return request({
|
||||
url: '/setAgents',
|
||||
data,
|
||||
method: 'POST',
|
||||
})
|
||||
}
|
||||
|
||||
generateBasePlan = (data: { goal: string; inputs: string[] }) => {
|
||||
return request<unknown, IRawPlanResponse>({
|
||||
url: '/generate_basePlan',
|
||||
method: 'POST',
|
||||
data: {
|
||||
'General Goal': data.goal,
|
||||
'Initial Input Object': data.inputs,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
executePlan = (plan: IRawPlanResponse) => {
|
||||
return request<unknown, IExecuteRawResponse[]>({
|
||||
url: '/executePlan',
|
||||
method: 'POST',
|
||||
data: {
|
||||
RehearsalLog: [],
|
||||
num_StepToRun: null,
|
||||
plan: {
|
||||
'Initial Input Object': plan['Initial Input Object'],
|
||||
'General Goal': plan['General Goal'],
|
||||
'Collaboration Process': plan['Collaboration Process']?.map(step => ({
|
||||
StepName: step.StepName,
|
||||
TaskContent: step.TaskContent,
|
||||
InputObject_List: step.InputObject_List,
|
||||
OutputObject: step.OutputObject,
|
||||
AgentSelection: step.AgentSelection,
|
||||
Collaboration_Brief_frontEnd: step.Collaboration_Brief_FrontEnd,
|
||||
TaskProcess: step.TaskProcess.map(action => ({
|
||||
ActionType: action.ActionType,
|
||||
AgentName: action.AgentName,
|
||||
Description: action.Description,
|
||||
ID: action.ID,
|
||||
ImportantInput: action.ImportantInput,
|
||||
})),
|
||||
})),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default new Api()
|
||||
1
frontend/src/assets/icons/action.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761736278335" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5885" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M226.592 896C167.616 896 128 850.48 128 782.736V241.264C128 173.52 167.616 128 226.592 128c20.176 0 41.136 5.536 62.288 16.464l542.864 280.432C887.648 453.792 896 491.872 896 512s-8.352 58.208-64.272 87.088L288.864 879.536C267.712 890.464 246.768 896 226.592 896z m0-704.304c-31.008 0-34.368 34.656-34.368 49.568v541.472c0 14.896 3.344 49.568 34.368 49.568 9.6 0 20.88-3.2 32.608-9.248l542.864-280.432c21.904-11.328 29.712-23.232 29.712-30.608s-7.808-19.28-29.712-30.592L259.2 200.96c-11.728-6.048-23.008-9.264-32.608-9.264z" p-id="5886"></path></svg>
|
||||
|
After Width: | Height: | Size: 886 B |
1
frontend/src/assets/icons/agent-change.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1764640542560" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1335" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M838.611638 631.662714l67.309037-44.87798 87.97131 131.929203a40.41239 40.41239 0 0 1-33.646587 62.843448H555.939064v-80.82478h328.851364l-46.17879-69.069891zM718.135918 979.106157l-67.237652 44.862116-88.050627-131.921271a40.41239 40.41239 0 0 1 33.583133-62.779994h404.37772v80.761326h-328.772047l46.107404 69.149209v-0.071386zM701.510919 407.10625a294.54644 294.54644 0 0 0-84.695487-59.139309c44.34655-35.891279 72.670917-90.69984 72.670917-152.218682 0-108.300447-90.461886-197.31875-199.008219-195.621351A196.089325 196.089325 0 0 0 318.390354 107.673837a7.828661 7.828661 0 0 0 6.202648 11.278983c18.655533 2.014671 36.882751 6.194716 54.126428 12.214932a7.804866 7.804866 0 0 0 9.07395-3.140982 125.203058 125.203058 0 0 1 104.11247-57.632273 124.608175 124.608175 0 0 1 91.262995 37.898018 124.679561 124.679561 0 0 1 35.462963 83.759537 124.846128 124.846128 0 0 1-73.979659 117.953417 7.884184 7.884184 0 0 0-4.386271 8.582179 250.96134 250.96134 0 0 1 2.879234 71.409765l0.13484 0.063454a7.828661 7.828661 0 0 0 5.821923 8.526657 220.661962 220.661962 0 0 1 102.478524 58.369928 221.201323 221.201323 0 0 1 65.278503 150.338851 7.773139 7.773139 0 0 0 7.828661 7.51139h55.189286a7.844525 7.844525 0 0 0 7.574845-8.074546 291.05646 291.05646 0 0 0-85.940775-199.626897z" fill="#17A29E" p-id="1336"></path><path d="M458.386171 627.942712h89.145212a291.072323 291.072323 0 0 0-41.649747-52.38937 293.443924 293.443924 0 0 0-84.568578-59.13931A195.875168 195.875168 0 0 0 493.761885 367.550491c1.808445-108.173539-84.425806-197.310819-192.591413-199.111331l-0.824905-0.007932c-108.768422-0.650405-197.469454 86.987769-198.119859 195.764123a195.296148 195.296148 0 0 0 72.655053 152.21075c-31.441554 14.602397-59.401058 35.288464-84.560647 59.139309C4.371408 657.03646 6.187784 763.131873 4.371408 838.277504a7.836593 7.836593 0 0 0 7.828661 8.011092h54.816492a7.804866 7.804866 0 0 0 7.828662-7.511391c1.840172-56.601142 25.207179-173.483769 65.334025-213.420252 42.157381-42.157381 98.227094-65.334025 157.850241-65.334025a221.827933 221.827933 0 0 1 157.858173 65.334025c0.864563 0.832836 1.657741 1.729127 2.498509 2.585759zM298.037421 489.549113l-0.063454-0.071386a124.663697 124.663697 0 0 1-88.637578-36.636866c-23.668415-23.747732-36.70032-55.141695-36.70032-88.64551 0-33.829018 13.27779-65.643364 37.580747-89.454551a126.05969 126.05969 0 0 1 89.081757-35.764371 125.512397 125.512397 0 0 1 86.686362 36.414776c49.169069 48.820071 49.454613 128.264723 0.642474 177.449656a124.354358 124.354358 0 0 1-88.589988 36.708252z" fill="#17A29E" p-id="1337"></path></svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
1
frontend/src/assets/icons/close.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1764755052115" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6234" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M886.784 746.496q29.696 30.72 43.52 56.32t-4.608 58.368q-4.096 6.144-11.264 14.848t-14.848 16.896-15.36 14.848-12.8 9.728q-25.6 15.36-60.416 8.192t-62.464-34.816l-43.008-43.008-57.344-57.344-67.584-67.584-73.728-73.728-131.072 131.072q-60.416 60.416-98.304 99.328-38.912 38.912-77.312 48.128t-68.096-17.408l-7.168-7.168-11.264-11.264-11.264-11.264q-6.144-6.144-7.168-8.192-11.264-14.336-13.312-29.184t2.56-29.184 13.824-27.648 20.48-24.576q9.216-8.192 32.768-30.72l55.296-57.344q33.792-32.768 75.264-73.728t86.528-86.016q-49.152-49.152-93.696-93.184t-79.872-78.848-57.856-56.832-27.648-27.136q-26.624-26.624-27.136-52.736t17.92-52.736q8.192-10.24 23.552-24.064t21.504-17.92q30.72-20.48 55.296-17.92t49.152 28.16l31.744 31.744q23.552 23.552 58.368 57.344t78.336 76.288 90.624 88.576q38.912-38.912 76.288-75.776t69.632-69.12 58.368-57.856 43.52-43.008q24.576-23.552 53.248-31.232t55.296 12.8q1.024 1.024 6.656 5.12t11.264 9.216 10.752 9.728 7.168 5.632q27.648 26.624 27.136 57.856t-27.136 57.856q-18.432 18.432-45.568 46.08t-60.416 60.416-70.144 69.632l-77.824 77.824q37.888 36.864 74.24 72.192t67.584 66.048 56.32 56.32 41.472 41.984z" p-id="6235"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
1
frontend/src/assets/icons/doctor.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761212882014" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3052" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M988.8 939.2c0-134.4-78.4-252.8-193.6-308.8 4.8 12.8 8 25.6 8 40v11.2c54.4 11.2 96 60.8 96 118.4v65.6c8 6.4 14.4 17.6 14.4 30.4 0 22.4-17.6 38.4-38.4 38.4-22.4 0-38.4-17.6-38.4-38.4 0-12.8 6.4-24 16-32v-67.2c0-40-32-72-72-72s-72 32-72 72v68.8c9.6 6.4 14.4 17.6 14.4 30.4 0 22.4-17.6 38.4-38.4 38.4-22.4 0-38.4-17.6-38.4-38.4 0-11.2 4.8-22.4 14.4-30.4V800c0-59.2 43.2-108.8 100.8-120-1.6-28.8-14.4-56-32-76.8-19.2-4.8-38.4-8-57.6-8-9.6 216-75.2 384-156.8 384-80 0-147.2-168-156.8-384h-1.6c-19.2 22.4-32 52.8-32 84.8v99.2c27.2 9.6 48 36.8 48 68.8 0 40-32 73.6-73.6 73.6s-73.6-32-73.6-73.6c0-33.6 22.4-60.8 52.8-70.4v-118.4c0-19.2 6.4-38.4 16-54.4C145.6 644.8 35.2 779.2 35.2 939.2V953.6C35.2 992 249.6 1024 512 1024s476.8-32 476.8-72v-3.2-9.6z m-470.4-720C400 219.2 304 256 304 300.8v4.8l44.8 212.8c0 3.2 1.6 8 1.6 11.2 19.2 75.2 86.4 129.6 166.4 129.6 84.8 0 156.8-64 169.6-145.6l44.8-208v-4.8c0-44.8-96-81.6-212.8-81.6z m-1.6-16c105.6 0 193.6 35.2 225.6 83.2h9.6V83.2v-1.6C752 36.8 646.4 0 518.4 0S284.8 36.8 284.8 81.6V288h6.4c30.4-49.6 120-84.8 225.6-84.8z m-65.6-105.6c0-8 6.4-16 16-16h33.6V46.4c0-8 6.4-16 16-16 8 0 16 6.4 16 16V80h33.6c8 0 16 6.4 16 16s-6.4 16-16 16h-33.6v33.6c0 8-6.4 16-16 16-8 0-16-6.4-16-16v-32h-33.6c-8 0-16-8-16-16z" p-id="3053"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
1
frontend/src/assets/icons/engineer.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761212791945" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2409" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M338.36032 362.9056c9.59488 59.4944 34.53952 115.1488 74.84416 161.20832l15.34976 13.43488c1.23904 2.47808 3.2768 4.15744 5.60128 6.07232 1.26976 1.04448 2.63168 2.16064 3.9936 3.52256 42.21952 38.37952 107.4688 38.37952 147.7632-1.92512 53.73952-47.9744 80.60928-113.22368 95.95904-182.31296H338.37056z m366.5408-63.32416h26.86976c7.68 0 13.43488 5.75488 9.59488 11.50976v15.36H275.02592v-15.36c0-7.68 5.75488-13.43488 13.43488-13.43488h28.78464c1.09568-7.63904 2.02752-14.97088 2.93888-22.12864 2.304-17.99168 4.4544-34.8672 8.58112-52.71552 5.75488-34.53952 21.10464-69.08928 42.21952-95.9488 21.10464-24.95488 49.88928-44.1344 82.51392-49.89952 40.30464-9.59488 82.5344-9.59488 120.90368 1.91488 47.98464 11.52 86.36416 46.05952 103.6288 92.11904 13.44512 36.46464 23.04 72.92928 24.95488 111.3088v7.68c1.91488 3.84 1.91488 5.75488 1.91488 9.59488z m-241.80736-86.36416c7.68-1.91488 13.43488-9.59488 13.43488-17.26464V132.608c0-7.68-7.68-15.36-15.34976-15.36-7.68 0-15.36 7.68-15.36 15.36v65.24928c0 7.68 7.68 15.36 15.36 15.36h1.91488z m99.79904 0c7.68-1.91488 13.43488-9.59488 13.43488-17.26464V132.608c0-7.68-7.68-15.36-15.36-15.36s-15.34976 7.68-15.34976 15.36v65.24928c0 7.68 7.68 15.36 15.36 15.36h1.91488z m351.16032 596.8384c5.8368 20.5824 11.66336 41.08288 17.3056 61.42976 4.1984 19.56864 9.41056 37.09952 14.8992 55.57248 2.048 6.88128 4.12672 13.89568 6.21568 21.1968 1.91488 3.82976 0 5.75488-3.84 5.75488H73.5232c-1.91488 0-3.84-3.84-1.91488-5.76512 3.82976-13.43488 7.68-25.9072 11.50976-38.37952 3.84-12.47232 7.68-24.94464 11.52-38.37952 12.1856-48.7424 26.27584-98.44736 40.26368-147.75296 5.8368-20.5824 11.65312-41.08288 17.3056-61.44 1.91488-7.66976 3.84-9.58464 11.50976-11.50976 18.2272-3.82976 35.98336-8.15104 53.73952-12.47232 17.75616-4.31104 35.50208-8.63232 53.73952-12.47232 3.82976-1.91488 5.75488 0 5.75488 3.84v163.1232c0 1.91488 1.91488 3.84 3.84 3.84h47.9744a4.12672 4.12672 0 0 0 3.84-3.84V612.4032c2.2528 0 3.1744-0.65536 3.95264-1.19808 0.54272-0.38912 1.00352-0.7168 1.80224-0.7168 23.02976-3.84 46.05952-17.27488 59.4944-38.37952 1.91488-3.84 5.75488-7.68 9.59488-11.52 1.91488-1.91488 5.75488-1.91488 7.68 0 15.34976 15.36 28.7744 30.69952 42.20928 46.05952 13.43488 17.27488 34.54976 26.86976 55.6544 24.94464 21.11488 1.92512 42.22976-7.68 55.6544-24.94464 13.43488-15.36 26.86976-30.70976 42.22976-46.05952 1.91488-1.91488 5.75488-1.91488 7.68 0 1.91488 3.84 5.74464 7.68 9.58464 11.52 13.43488 21.10464 34.54976 34.53952 59.4944 38.37952 1.92512 0 3.84 0 5.75488 1.91488v180.39808c0 1.91488 1.92512 3.84 3.84 3.84h47.9744a4.12672 4.12672 0 0 0 3.84-3.84v-163.1232c0-1.92512 3.84-3.84 5.76512-3.84 36.4544 9.59488 71.00416 17.27488 107.4688 24.94464a17.3056 17.3056 0 0 1 11.50976 11.52c12.1856 48.7424 26.28608 98.44736 40.26368 147.75296z" p-id="2410"></path></svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
14
frontend/src/assets/icons/icons.svg
Normal file
@@ -0,0 +1,14 @@
|
||||
<svg
|
||||
className="icon"
|
||||
viewBox="0 0 8960 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="9634"
|
||||
width="100%"
|
||||
height="60"
|
||||
>
|
||||
<path
|
||||
d="M8960 0c-451.52 181.184-171.2 1024-992 1024H992C171.232 1024 451.392 181.184 0 0h8960z"
|
||||
p-id="9635"
|
||||
></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 336 B |
1
frontend/src/assets/icons/left.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1764757574909" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9019" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M248.88888875 558.88888844l401.7777778 401.77777782c28.44444469 28.44444469 74.66666625 28.44444469 99.55555594 0 28.44444469-28.44444469 28.44444469-74.66666625 1e-8-99.555555l-352.00000031-352.00000032 352.00000031-351.99999937c28.44444469-28.44444469 28.44444469-71.11111125 0-99.55555594s-74.66666625-28.44444469-99.55555594 0L248.88888875 459.33333344c-14.22222188 14.22222188-21.33333375 31.99999969-21.33333281 49.7777775 0 17.7777778 7.11111094 35.55555562 21.33333281 49.7777775" fill="#ffffff" p-id="9020"></path></svg>
|
||||
|
After Width: | Height: | Size: 860 B |
1
frontend/src/assets/icons/loading.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761626283461" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2759" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M511.882596 287.998081h-0.361244a31.998984 31.998984 0 0 1-31.659415-31.977309v-0.361244c0-0.104761 0.115598-11.722364 0.115598-63.658399V96.000564a31.998984 31.998984 0 1 1 64.001581 0V192.001129c0 52.586273-0.111986 63.88237-0.119211 64.337537a32.002596 32.002596 0 0 1-31.977309 31.659415zM511.998194 959.99842a31.998984 31.998984 0 0 1-31.998984-31.998984v-96.379871c0-51.610915-0.111986-63.174332-0.115598-63.286318s0-0.242033 0-0.361243a31.998984 31.998984 0 0 1 63.997968-0.314283c0 0.455167 0.11921 11.711527 0.11921 64.034093v96.307622a31.998984 31.998984 0 0 1-32.002596 31.998984zM330.899406 363.021212a31.897836 31.897836 0 0 1-22.866739-9.612699c-0.075861-0.075861-8.207461-8.370021-44.931515-45.094076L195.198137 240.429485a31.998984 31.998984 0 0 1 45.256635-45.253022L308.336112 263.057803c37.182834 37.182834 45.090463 45.253022 45.41197 45.578141A31.998984 31.998984 0 0 1 330.899406 363.021212zM806.137421 838.11473a31.901448 31.901448 0 0 1-22.628318-9.374279L715.624151 760.859111c-36.724054-36.724054-45.018214-44.859267-45.097687-44.93874a31.998984 31.998984 0 0 1 44.77618-45.729864c0.32512 0.317895 8.395308 8.229136 45.578142 45.411969l67.88134 67.88134a31.998984 31.998984 0 0 1-22.624705 54.630914zM224.000113 838.11473a31.901448 31.901448 0 0 0 22.628317-9.374279l67.88134-67.88134c36.724054-36.724054 45.021826-44.859267 45.097688-44.93874a31.998984 31.998984 0 0 0-44.776181-45.729864c-0.32512 0.317895-8.395308 8.229136-45.578142 45.411969l-67.88134 67.884953a31.998984 31.998984 0 0 0 22.628318 54.627301zM255.948523 544.058589h-0.361244c-0.104761 0-11.722364-0.115598-63.658399-0.115598H95.942765a31.998984 31.998984 0 1 1 0-64.00158h95.996952c52.586273 0 63.88237 0.111986 64.337538 0.11921a31.998984 31.998984 0 0 1 31.659414 31.97731v0.361244a32.002596 32.002596 0 0 1-31.988146 31.659414zM767.939492 544.058589a32.002596 32.002596 0 0 1-31.995372-31.666639v-0.361244a31.998984 31.998984 0 0 1 31.659415-31.970085c0.455167 0 11.754876-0.11921 64.34115-0.11921h96.000564a31.998984 31.998984 0 0 1 0 64.00158H831.944685c-51.936034 0-63.553638 0.111986-63.665624 0.115598h-0.335957zM692.999446 363.0176a31.998984 31.998984 0 0 1-22.863126-54.381656c0.317895-0.32512 8.229136-8.395308 45.41197-45.578141l67.88134-67.884953A31.998984 31.998984 0 1 1 828.693489 240.429485l-67.892177 67.88134c-31.020013 31.023625-41.644196 41.759794-44.241539 44.393262l-0.697201 0.722488a31.908673 31.908673 0 0 1-22.863126 9.591025z" fill="" p-id="2760"></path></svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
1
frontend/src/assets/icons/medical.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761212815712" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2569" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M845.285053 1008.842105H520.421053v-52.224c45.999158-24.468211 96.538947-287.420632 134.03621-286.302316 145.960421 30.100211 249.317053 113.057684 249.317053 270.928843-1.684211 41.472-21.005474 67.597474-58.489263 67.597473z m0 0" p-id="2570"></path><path d="M719.764211 480.619789c-32.363789 107.344842-116.439579 183.457684-214.662737 183.457685-98.829474 0-182.905263-76.665263-214.703158-184.010106-14.767158-6.831158-32.943158-22.150737-39.760842-61.291789-8.528842-51.186526 22.703158-63.690105 22.703158-63.690105 2.290526 0 4.554105 1.751579 6.817684 5.133473a95.137684 95.137684 0 0 1 24.427789-36.917894c40.313263-39.774316 114.714947-60.779789 204.463158-61.359158 81.232842-0.565895 138.024421 5.133474 195.961263 60.240842 10.213053 9.633684 19.887158 24.939789 24.980211 40.326737 2.842947-4.554105 5.685895-7.424 8.528842-6.817685 0 0 31.797895 12.476632 23.282526 63.609264-7.949474 39.733895-26.691368 54.501053-42.037894 61.318736z m0 0" p-id="2571"></path><path d="M496.559158 15.454316c-126.059789 0-231.141053 64.794947-231.141053 64.794947v215.794526s69.308632-78.942316 237.406316-78.942315c166.979368 0 237.406316 79.508211 237.406316 79.50821V80.801684c-0.579368-0.552421-122.677895-65.347368-243.671579-65.347368z m71.545263 117.005473h-52.237474v52.237474h-27.823158V132.459789h-51.685052V104.084211h51.685052V51.846737h27.823158v52.237474h52.237474v28.375578zM497.125053 956.618105v52.224c-141.433263 0-240.249263-0.538947-324.877474 0-36.352 0-56.212211-26.125474-58.489263-67.058526 0-157.884632 103.356632-241.367579 249.330526-270.901895 38.642526-1.684211 88.616421 261.268211 134.036211 285.736421z" p-id="2572"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
1
frontend/src/assets/icons/moon.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1764820450888" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23116" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M854.442667 725.376c-117.845333 204.117333-378.837333 274.048-582.954667 156.202667A425.173333 425.173333 0 0 1 133.546667 754.346667a32 32 0 0 1 15.573333-48.298667c160.725333-57.514667 246.826667-124.16 296.789333-219.562667 52.565333-100.394667 66.176-210.346667 29.397334-361.088a32 32 0 0 1 32.810666-39.552 425.002667 425.002667 0 0 1 190.165334 56.618667c204.117333 117.845333 274.048 378.837333 156.16 582.912z" fill="#ffffff" p-id="23117"></path></svg>
|
||||
|
After Width: | Height: | Size: 793 B |
1
frontend/src/assets/icons/paper-plane.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761204835005" class="icon" viewBox="0 0 1171 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5692" xmlns:xlink="http://www.w3.org/1999/xlink" width="228.7109375" height="200"><path d="M502.237757 1024 644.426501 829.679301 502.237757 788.716444 502.237757 1024 502.237757 1024ZM0 566.713817 403.967637 689.088066 901.485385 266.66003 515.916344 721.68034 947.825442 855.099648 1170.285714 0 0 566.713817 0 566.713817Z" p-id="5693"></path></svg>
|
||||
|
After Width: | Height: | Size: 603 B |
1
frontend/src/assets/icons/plus.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761211358508" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6686" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M469.333333 469.333333V170.666667h85.333334v298.666666h298.666666v85.333334h-298.666666v298.666666h-85.333334v-298.666666H170.666667v-85.333334h298.666666z" p-id="6687"></path></svg>
|
||||
|
After Width: | Height: | Size: 516 B |
1
frontend/src/assets/icons/process.svg
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
1
frontend/src/assets/icons/refresh.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761368152518" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7696" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M835.516 709.837l154.351-225.894h-109.158c-14.541-221.047-198.11-396.151-422.844-396.151-234.291 0-423.731 189.918-423.731 424.277 0 234.155 189.918 424.141 424.209 424.141 105.062 0 200.977-38.434 275.115-101.786l-56.73-73.045c-58.368 51.063-134.69 82.398-218.385 82.398-183.296 0-331.844-148.617-331.844-331.708 0-183.364 148.617-331.913 331.844-331.913 173.739 0 315.665 133.734 329.933 303.787h-107.11l154.351 225.894z" p-id="7697"></path></svg>
|
||||
|
After Width: | Height: | Size: 783 B |
1
frontend/src/assets/icons/renyuan.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761545116983" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1453" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M856.98894 727.680806c-64.797424-20.50007-128.161277-40.856783-169.448131-61.356852-28.814784-14.335713-46.877782-28.671427-46.877782-43.00714v-34.405712c10.034999-8.171357 19.209856-17.202856 27.381212-27.237855 2.293714-2.867143 4.587428-5.734285 6.881142-8.888143 10.034999-13.905642 20.213356-32.972141 29.101498-51.895282 9.891642-21.073499 18.349713-41.716926 23.223856-54.47571 4.730785-5.590928 8.888142-11.181856 12.758785-16.629428 22.363713-32.111998 30.104998-62.647067 23.223855-91.175136-3.870643-16.48607-12.902142-31.395212-25.804284-42.433712 5.0175-40.570069 4.730785-86.444351-10.034999-126.727705-7.597928-21.216856-18.349713-41.143497-31.968641-59.063139-20.643427-26.807784-47.451211-47.307854-80.279994-61.070138-42.00364-17.632927-81.856923-19.639927-97.196136-19.639927h-10.608428c-15.195856 0-55.049139 1.863643-97.196136 19.639927-35.122498 14.765785-63.363853 37.129497-84.580708 66.947781-11.611928 16.48607-20.930141 34.405712-27.667927 53.328853-14.765785 40.283354-15.052499 86.300994-10.034999 126.727706-12.758785 11.038499-21.790284 25.947641-25.804284 42.433711-6.737785 27.954641 0.716786 57.916282 22.076998 89.454851 4.157357 6.164357 8.888142 12.185356 14.048999 18.49307 5.0175 12.902142 13.332213 33.545569 23.223856 54.762425 8.888142 18.923142 18.923142 37.846283 28.958141 51.608568 2.150357 3.0105 4.444071 5.877642 6.737785 8.744785 7.741285 9.461571 16.48607 18.206356 25.947641 25.947641v35.695926c0 14.47907-18.49307 29.101498-48.02464 43.580568-41.286854 20.213356-104.220636 40.570069-168.301273 60.783425C56.626067 762.51659 56.626067 946.157077 56.626067 946.157077s134.038919 48.884782 457.165897 48.884782S966.943861 946.157077 966.943861 946.157077s0.286714-183.783844-109.954921-218.476271zM351.224976 414.875542c-46.877782-51.321854-28.958141-72.251995-18.349714-76.265994 17.48957-6.594428 29.388212 19.49657 33.54557 31.108498-4.874143-15.052499-18.062999-59.636567-20.213356-106.51435 15.769285-22.076998 47.164497-58.919782 84.580708-64.797424 0 0 80.710066 96.47935 246.574269 94.47235-3.727285 26.090998-9.604928 51.895282-17.632928 76.982781 4.300714-11.611928 16.055999-37.702926 33.545569-31.108498 10.608428 4.014 28.528069 25.087498-18.349713 76.265995 0 0-17.346213 47.164497-35.552568 80.99678-3.870643 7.454571-8.171357 14.47907-12.902142 21.360212-12.041999 16.48607-27.667927 29.818284-45.874283 38.993141-20.50007 10.465071-43.293854 15.912642-66.230995 16.055998-0.430071 0-0.860143 0-1.146857-0.143357-0.430071 0-0.860143 0.143357-1.146857 0.143357-23.653927-0.143357-47.02114-6.021-68.094639-17.059498a129.42282 129.42282 0 0 1-44.010639-38.132998c-4.730785-6.737785-9.031499-13.762285-12.902142-21.073498-18.349713-33.832283-35.839283-81.283494-35.839283-81.283495z m170.881702 519.52625c-5.734285 3.727285-9.174857 5.447571-9.174857 5.447571s-3.440571-1.863643-9.174856-5.447571c-31.968641-20.069999-137.336133-94.615708-151.815204-208.584628 34.405712-15.48257 91.891922-46.447711 91.891922-102.50035v-2.293714c21.933641 7.454571 44.870783 11.468571 67.951281 11.755284h2.293714c22.50707-0.143357 44.870783-4.014 66.230996-11.181856v1.720286c0 57.056139 59.49321 88.164637 93.612208 103.360492-14.909142 113.252135-119.98992 187.654487-151.815204 207.724486z" p-id="1454"></path><path d="M574.432031 693.418452l-28.097998-30.53507h-66.804424L451.574969 693.418452s16.055999 34.118998 42.003639 47.451211l-42.003639 106.084278s30.821784 43.723926 61.356852 55.049139c30.678426-11.325213 61.50021-55.049139 61.50021-55.049139l-42.00364-106.084278c25.804284-13.332213 42.00364-47.451211 42.00364-47.451211z" p-id="1455"></path></svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
1
frontend/src/assets/icons/researcher.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761212863001" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2892" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M725.308 314.532c2.743 1.543 5.486 3.215 8.164 5.057l8.164 5.55 0.15 9.77c0.45 28.328-2.957 52.326-10.37 70.796-6.836 16.885-16.971 29.527-30.556 37.134-9.235 32.976-20.077 63.532-35.42 89.18-17.677 29.548-41.011 52.261-74.01 64.496-14.763 5.4-52.432 7.907-88.708 7.393-35.012-0.536-70.131-4.007-84.06-10.414-29.997-13.842-51.082-37.048-67.045-65.975-13.692-24.705-23.463-53.46-31.97-83.823-14.034-7.328-24.577-19.906-31.669-36.92-7.778-18.577-11.314-42.982-10.82-71.866l0.106-9.814 8.143-5.485c2.1-1.414 4.178-2.722 6.256-3.921-9.17-113.544-5.72-155.52 36.448-203.495 82.217-67.346 270.712-64.968 354-3.943 56.718 53.547 60.66 113.586 43.197 206.28m-172.66 328.33l1.2 26.013-15.407 25.434 21.47 141.12 88.045-189.224 134.07-4.585c69.189 65.503 113.63 219.758 102.701 320.38H137.623c1.843-88.366 18.106-239.278 106.108-316.03l121.107 1.135 113.414 187.124 21.32-139.92-15.427-25.434 1.178-26.013c29.355-1.607 37.99-1.607 67.325 0m100.3-368.656c-53.246 10.414-132.57 19.52-195.245-15.706-24.105-13.563-59.417 14.228-88.301 11.378a217.808 217.808 0 0 0-19.542 57.682l-3.214 17.035-17.142-1.671a24.02 24.02 0 0 0-9.942 1.264 38.098 38.098 0 0 0-4.65 1.843c0.45 18.877 3.107 34.54 7.971 46.261 4.285 10.307 10.307 17.035 18.106 19.477l10.007 3.107 2.742 10.071c8.4 31.134 17.806 60.468 31.027 84.36 12.256 22.22 27.984 39.833 49.711 49.84 9.107 4.156 38.226 6.556 68.653 7.006 32.334 0.471 64.603-1.243 75.253-5.164 23.934-8.871 41.204-25.97 54.618-48.34 14.399-24.127 24.62-54.661 33.62-88.173l2.549-9.578 9.535-3.321c7.542-2.7 13.392-9.536 17.549-19.97 4.714-11.614 7.264-27.02 7.692-45.534a35.355 35.355 0 0 0-4.178-1.67 25.413 25.413 0 0 0-9.706-1.48l-16.67 1.072-3.108-16.435a213.844 213.844 0 0 0-17.334-53.354m0 0" p-id="2893"></path></svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
1
frontend/src/assets/icons/right.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1764757483582" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7204" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M775.11111125 465.11111156l-401.7777778-401.77777782c-28.44444469-28.44444469-74.66666625-28.44444469-99.55555594 0-28.44444469 28.44444469-28.44444469 74.66666625-1e-8 99.555555l352.00000031 352.00000032-352.00000031 351.99999937c-28.44444469 28.44444469-28.44444469 71.11111125 0 99.55555594s74.66666625 28.44444469 99.55555594 0L775.11111125 564.66666656c14.22222188-14.22222188 21.33333375-31.99999969 21.33333281-49.7777775 0-17.7777778-7.11111094-35.55555562-21.33333281-49.7777775" fill="#d8d8d8" p-id="7205"></path></svg>
|
||||
|
After Width: | Height: | Size: 860 B |
1
frontend/src/assets/icons/shejishi.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761545158610" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1618" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 625.777778l85.333333 85.333333-56.888889 85.333333 56.888889 142.222223 79.644445-290.133334c142.222222 34.133333 290.133333 102.4 290.133333 204.8v113.777778H56.888889v-113.777778c0-108.088889 147.911111-176.355556 290.133333-204.8l79.644445 290.133334 56.888889-142.222223-56.888889-85.333333L512 625.777778z m196.266667-261.688889c0 110.933333-85.333333 204.8-196.266667 204.8-107.235556 0-190.577778-87.722667-195.982222-193.763556L315.733333 364.088889h392.533334zM521.159111 56.888889c12.970667 0.170667 28.444444 0.967111 41.415111 4.949333l9.159111 3.584v136.533334h34.133334v-119.466667c65.024 32.483556 114.574222 103.708444 119.125333 184.149333l0.341333 12.117334h42.666667v42.666666h-512V278.755556h42.666667c0-81.066667 38.513778-154.453333 100.864-190.805334L409.6 82.488889v119.466667h42.666667v-136.533334c14.222222-7.111111 34.360889-8.305778 50.574222-8.533333h18.318222z" p-id="1619"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
1
frontend/src/assets/icons/soldier.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761212898988" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3212" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M105.9 959.3c5.5-79.7 16.6-187.3 41.1-286.1 5.1-25.5 23.2-46.9 23.8-47.7 2.3-15.1 187.9-15.2 187.9-15.2l30.7-2.9c-4.4 27.2-7.7 68.5 4 104 15.2 46.6 39.4 92.8 72.3 120.3l7-123.7H536l10.9 116c23-32.9 49.8-84.7 52.6-150.7 2.2-51.6 15.1-75.2 26.2-86.1 76.9 3.1 173.3 17.2 212 38.4 36.9 20.2 48.5 146.4 81.9 333.8H105.9v-0.1z" p-id="3213"></path><path d="M528.1 690.2h-39.7l-31.8-26.6 47.7-62 47.6 53.2-23.8 35.4z m210.7-526.8c-19-38-129.4-95-249.8-98.9-120.4-4-247.9 65.9-246.9 117 1 51 64.2 73 64.2 73-3.3 9.9-1.6 48.3-1.6 48.3s2.9 5.3 8.4 12.7C294.5 560.8 509 565 509 565c185.9-19.3 171.1-221.2 169.3-250.4-0.7-10.7-2-19.2-3.6-26.8 2.3-16.5-4.1-33.5-4.1-33.5 27.1-10.9 87.3-52.9 68.2-90.9z m-280.2-19.1c-0.2-1.6-0.5-3.2-0.5-4.9 0-20.7 18.2-37.5 40.7-37.5 22.5 0 40.7 16.8 40.7 37.5 0 2.6-0.3 5.2-0.9 7.7 12.1-1.1 25.2-2.1 37.1-2.3 0 0-33.9 15.8-53.2 25.1-2.9 1.9-6 3.4-9.4 4.6-0.2 0.1-0.5 0.3-0.8 0.4 0 0-1.1 0.3-2.9 0.6-3.4 0.9-7 1.5-10.7 1.5-0.7 0-1.4-0.2-2.1-0.2-9 0-20.4-1.8-29.6-9.5 0 0-13.9-9.5-45.3-22.6 0.1 0 16.8-2.1 36.9-0.4z m181.3 107.8H332v-36.4h307.9v36.4z" p-id="3214"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
1
frontend/src/assets/icons/specialist.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761212837698" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2731" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M855.7 781.7c-11.8-25.2-29.1-47.3-48.4-67.2-26.3-27-56.5-50-87.9-70.7-32.1-20.9-65.6-39.7-100.4-55.6 28.1-18.7 49.6-45.9 64.9-75.7 20.9-40.7 31.9-85.6 38.1-130.7 6.3-47.9 7.5-96.5 3.7-144.7 32.3-12.9 64.5-25.8 96.8-38.7 12-5 24.3-9.4 36.2-14.7-114.9-39.9-229.9-79.6-344.8-119.4-2-1-4 0.5-5.9 1-108.1 39.5-216.3 78.9-324.5 118.4 39.4 18.4 79 36.5 118.5 54.9-8.8 55.8-7.2 113.4 7.1 168.2 9 34.8 23 68.2 41.4 99.1 18.3 30.4 40.2 58.9 67 82.3-48 15.6-94.7 36.5-136.1 65.7-28.4 20-54.1 43.9-74.7 71.9-23 31.1-39.5 67.3-46.7 105.4-3.7 19.5-5.3 39.5-3.2 59.2 112.7 48 235.5 71.4 357.9 69.7-37.9-32.3-75.9-64.6-113.9-96.9 30.3-73.3 60.5-146.6 90.8-219.9 0.4-1.4 1.8-2.9 0.8-4.2-8.6-14.2-17.4-28.2-25.8-42.5 14.6 7.7 30.8 12.6 47.4 12.7 14.9 0.3 29.7-4.3 42-12.7-9.1 13.7-18.3 27.4-27.5 41.1 17.8 40.6 35.7 81.2 53.5 121.9 14.7 33.9 29.9 67.6 44.4 101.5-37.3 32.9-74.3 66.1-111.4 99.2 90.1-1.2 180-15.1 266.2-41.2 26.5-8.2 52.7-17.2 78-28.6 6.5-15.2 10.3-31.6 10.5-48.1 0.2-21-5.2-41.8-14-60.7z" p-id="2732"></path><path d="M216.4 380.8h11V392h21.5v-11.2h11v-26.3h-11V223.3h-21.5c-0.1 43.7 0 87.5 0 131.2h-11v26.3z" p-id="2733"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
1
frontend/src/assets/icons/sunny.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1764820260653" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13095" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M152.00256 792.00256l76.00128-77.99808 60.00128 60.00128-76.00128 77.99808z m317.99808 165.99552V832h83.99872v125.99808H470.00064zM512 233.99936c141.99808 0 256 114.00192 256 256s-114.00192 256-256 256-256-114.00192-256-256 114.00192-256 256-256zM854.00064 448h128v86.00064h-128V448z m-118.00064 326.00064l60.00128-57.99936 76.00128 76.00128-60.00128 60.00128z m136.00256-584.00256l-76.00128 76.00128-60.00128-60.00128 76.00128-76.00128z m-318.0032-165.99552v125.99808H470.00064V24.00256h83.99872z m-384 423.99744v86.00064h-128V448h128zM288 205.99808L227.99872 265.99936 151.99744 189.99808 211.99872 129.9968z" p-id="13096" fill="#ffa300"></path></svg>
|
||||
|
After Width: | Height: | Size: 985 B |
1
frontend/src/assets/icons/technicist.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1761212761688" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2247" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M636.478451 965.736274l10.285126-0.276102c-2.068945-0.25056-5.512321-0.662889-10.064973-1.188336a398.001259 398.001259 0 0 1-0.220153 1.464438zM319.897045 966.147387l15.81934-0.411113-0.214071-1.463222c-7.760064 0.893989-12.318797 1.463222-12.318797 1.463222l-3.286472 0.411113zM701.706773 232.246056c0-130.470023-177.671401-195.699562-177.671401-195.699562-25.16304-11.331153-50.139985-8.750141-75.875908 0 0 0-177.679915 57.274865-177.679915 195.699562 0 20.694314-37.558465 16.252347-49.98673 81.7142h531.217713c-22.614869-65.914321-50.003758-61.019886-50.003759-81.7142zM261.149228 691.016641C179.668559 732.292152 110.143011 786.116343 110.143011 839.449144v27.720942c0 57.176344 150.840799 106.349362 150.840799 106.349362l58.913235-7.372061-5.835859 0.152039s-48.965029-277.278751-52.911958-275.282785z" p-id="2248"></path><path d="M649.282557 868.865624c-18.205742 19.018238-43.489197 24.747062-67.840958 15.467826-25.402654-9.681835-41.173341-37.079238-36.441892-62.991526 2.217335-12.137567 7.629918-22.585677 16.273024-31.609489 36.338505-37.95255 72.662414-75.917262 108.994838-113.872244-20.740534-9.049353-41.343624-19.515709-62.035506-26.357458-5.480697-1.774598-39.908378-17.257019-18.379674-82.532777h-0.291915c50.639889-51.988778 86.252256-102.79895 86.252256-215.156888h-378.248369c0 113.53411 34.725677 163.877219 85.702483 215.795451 22.010362 57.542453-17.334863 78.908171-25.565639 81.90881-22.185511 8.003326-37.025721 17.671781-59.579774 27.987314-4.070993 1.864605 34.183202 264.833458 37.380883 286.769626 28.691558-3.307149 101.308969-11.070862 150.593888-11.070862 49.355464 0 121.929088 7.763713 150.601185 11.070862 1.212662-8.076305 7.314894-48.820288 14.275842-97.177161l-1.690672 1.768516zM780.85699 731.325185a466047.419516 466047.419516 0 0 1-98.887294 103.3694c-11.765376 66.245158-22.605138 130.427453-22.605138 130.427452l-12.599765 0.336918c1.455924 0.177581 2.246526 0.276103 2.246526 0.276103l62.66069 7.96562s150.381033-49.146259 150.381033-106.531808v-27.719726c-0.002433-37.857677-33.167582-75.24221-81.196052-108.123959z" p-id="2249"></path><path d="M843.295095 519.324624l-52.478951 54.703584 62.663122 57.647056 52.688157-55.292278c0.620319 1.188336 0.975481 1.74419 1.211445 2.343831 20.077644 51.086275-8.213748 109.894908-61.513708 127.951044-20.261307 6.862426-40.735469 7.679787-61.405457 2.17598-2.048268-0.54734-2.96415 0.256642-4.130592 1.474169A361833.588559 361833.588559 0 0 1 643.464941 853.40023c-13.557002 14.162724-32.385495 18.42711-50.519474 11.518465-18.916067-7.210291-30.659549-27.611474-27.138329-46.907031 1.652967-9.039623 5.682605-16.819147 12.118106-23.538049 45.458404-47.47748 90.870589-94.993883 136.371564-142.431225 1.828115-1.904743 2.042186-3.3631 1.162793-5.751934-19.576524-53.126028 12.26163-112.586604 68.353025-127.899958 18.585231-5.074449 37.137621-5.129183 55.717987-0.199475 1.046027 0.278535 2.072594 0.622751 3.764482 1.133601zM604.103904 841.024267c5.432045-0.211638 9.560204-4.471159 9.419112-9.706161-0.147174-5.362715-4.626847-9.473846-10.113626-9.281669-5.391906 0.189745-9.684268 4.732666-9.44587 10.004157 0.233532 5.146212 4.800779 9.190445 10.140384 8.983673z" p-id="2250"></path></svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
93
frontend/src/components/MultiLineTooltip/index.vue
Normal file
@@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<el-tooltip :disabled="!isOverflow" effect="light" placement="top" :content="text">
|
||||
<div
|
||||
ref="containerRef"
|
||||
class="multi-line-ellipsis"
|
||||
:style="containerStyle"
|
||||
@mouseenter="handleMouseEnter"
|
||||
@mouseleave="handleMouseLeave"
|
||||
>
|
||||
<slot>
|
||||
{{ text }}
|
||||
</slot>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, type HTMLAttributes, nextTick, onMounted, ref } from 'vue'
|
||||
import { ElTooltip } from 'element-plus'
|
||||
|
||||
// 定义组件 props 类型
|
||||
interface Props {
|
||||
text?: string
|
||||
lines?: number
|
||||
maxWidth?: string | number
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
text: '',
|
||||
lines: 3,
|
||||
maxWidth: '100%',
|
||||
})
|
||||
|
||||
const isOverflow = ref(false)
|
||||
const containerRef = ref<HTMLElement | null>(null)
|
||||
|
||||
// 计算容器样式
|
||||
const containerStyle = computed(
|
||||
() =>
|
||||
({
|
||||
maxWidth: props.maxWidth,
|
||||
display: '-webkit-box',
|
||||
WebkitBoxOrient: 'vertical',
|
||||
WebkitLineClamp: props.lines,
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
lineHeight: '1.5',
|
||||
wordBreak: 'break-all',
|
||||
}) as HTMLAttributes['style'],
|
||||
)
|
||||
|
||||
// 检查文字是否溢出
|
||||
const checkOverflow = (element: HTMLElement): boolean => {
|
||||
// 单行情况下使用宽度判断
|
||||
if (props.lines === 1) {
|
||||
return element.scrollWidth > element.clientWidth
|
||||
}
|
||||
// 多行情况下使用高度判断
|
||||
else {
|
||||
return element.scrollHeight > element.clientHeight
|
||||
}
|
||||
}
|
||||
|
||||
// 鼠标进入处理
|
||||
const handleMouseEnter = (event: MouseEvent) => {
|
||||
const element = event.target as HTMLElement
|
||||
console.log(checkOverflow(element))
|
||||
isOverflow.value = checkOverflow(element)
|
||||
}
|
||||
|
||||
// 鼠标离开处理
|
||||
const handleMouseLeave = () => {
|
||||
isOverflow.value = false
|
||||
}
|
||||
|
||||
// 初始化时检查溢出状态
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
if (containerRef.value) {
|
||||
isOverflow.value = checkOverflow(containerRef.value)
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.multi-line-ellipsis {
|
||||
cursor: default;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
}
|
||||
</style>
|
||||