diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c857103..ff91bf9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,3 +9,33 @@ repos: rev: 22.3.0 hooks: - id: black +- repo: https://github.com/pycqa/flake8.git + rev: 4.0.0 + hooks: + - id: flake8 + exclude: | + (?x)^( + thirdparty/| + examples/| + tests/run.py + )$ +- repo: https://github.com/PyCQA/isort.git + rev: 4.3.21 + hooks: + - id: isort + exclude: | + (?x)^( + examples/| + tests/run.py| + swift/cli/sft.py + )$ +- repo: https://github.com/pre-commit/mirrors-yapf.git + rev: v0.30.0 + hooks: + - id: yapf + exclude: | + (?x)^( + thirdparty/| + examples/| + tests/run.py + )$ \ No newline at end of file diff --git a/.python-version b/.python-version deleted file mode 100644 index e4fba21..0000000 --- a/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.12 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f49a4e1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/README.md b/README_CN.md similarity index 95% rename from README.md rename to README_CN.md index 93151d3..842e64b 100644 --- a/README.md +++ b/README_CN.md @@ -14,8 +14,8 @@ C2S Agent 是一个AI Agent构建平台,提供在线可配置的Agent,MCP服 | | | | ---------------------------------- | ---------------------------------- | -| ![Demo](./.github/imgs/login.png) | ![Demo](./.github/imgs/main.png) | -| ![Demo](./.github/imgs/agent.png) | ![Demo](./.github/imgs/mcp.png) | +| ![Demo](./asset/imgs/login.png) | ![Demo](./asset/imgs/main.png) | +| ![Demo](./asset/imgs/agent.png) | ![Demo](./asset/imgs/mcp.png) | ## 💡 功能描述 diff --git a/.github/imgs/agent.png b/asset/imgs/agent.png similarity index 100% rename from .github/imgs/agent.png rename to asset/imgs/agent.png diff --git a/.github/imgs/login.png b/asset/imgs/login.png similarity index 100% rename from .github/imgs/login.png rename to asset/imgs/login.png diff --git a/.github/imgs/logo.png b/asset/imgs/logo.png similarity index 100% rename from .github/imgs/logo.png rename to asset/imgs/logo.png diff --git a/.github/imgs/main.png b/asset/imgs/main.png similarity index 100% rename from .github/imgs/main.png rename to asset/imgs/main.png diff --git a/.github/imgs/mcp.png b/asset/imgs/mcp.png similarity index 100% rename from .github/imgs/mcp.png rename to asset/imgs/mcp.png diff --git a/main.py b/examples/main.py similarity index 100% rename from main.py rename to examples/main.py diff --git a/main_a2a.py b/examples/main_a2a.py similarity index 100% rename from main_a2a.py rename to examples/main_a2a.py diff --git a/main_mcp.py b/examples/main_mcp.py similarity index 100% rename from main_mcp.py rename to examples/main_mcp.py diff --git a/requirements/framework.txt b/requirements/framework.txt new file mode 100644 index 0000000..31ee419 --- /dev/null +++ b/requirements/framework.txt @@ -0,0 +1 @@ +python= \ No newline at end of file diff --git a/pyproject.toml b/requirements/pyproject.toml similarity index 100% rename from pyproject.toml rename to requirements/pyproject.toml diff --git a/api/apps/agent/app_a2a.py b/server/main/app/api/apps/agent/app_a2a.py similarity index 100% rename from api/apps/agent/app_a2a.py rename to server/main/app/api/apps/agent/app_a2a.py diff --git a/api/apps/agent/app_history.py b/server/main/app/api/apps/agent/app_history.py similarity index 100% rename from api/apps/agent/app_history.py rename to server/main/app/api/apps/agent/app_history.py diff --git a/api/apps/agent/app_mcp.py b/server/main/app/api/apps/agent/app_mcp.py similarity index 100% rename from api/apps/agent/app_mcp.py rename to server/main/app/api/apps/agent/app_mcp.py diff --git a/api/apps/agent/config.py b/server/main/app/api/apps/agent/config.py similarity index 100% rename from api/apps/agent/config.py rename to server/main/app/api/apps/agent/config.py diff --git a/api/apps/agent/database.py b/server/main/app/api/apps/agent/database.py similarity index 100% rename from api/apps/agent/database.py rename to server/main/app/api/apps/agent/database.py diff --git a/api/apps/agent/manager_agent_card.py b/server/main/app/api/apps/agent/manager_agent_card.py similarity index 100% rename from api/apps/agent/manager_agent_card.py rename to server/main/app/api/apps/agent/manager_agent_card.py diff --git a/api/apps/agent/manager_kb.py b/server/main/app/api/apps/agent/manager_kb.py similarity index 100% rename from api/apps/agent/manager_kb.py rename to server/main/app/api/apps/agent/manager_kb.py diff --git a/api/apps/agent/manager_mcp_server.py b/server/main/app/api/apps/agent/manager_mcp_server.py similarity index 100% rename from api/apps/agent/manager_mcp_server.py rename to server/main/app/api/apps/agent/manager_mcp_server.py diff --git a/api/apps/auths/__init__.py b/server/main/app/api/apps/auths/__init__.py similarity index 100% rename from api/apps/auths/__init__.py rename to server/main/app/api/apps/auths/__init__.py diff --git a/api/apps/auths/auth.py b/server/main/app/api/apps/auths/auth.py similarity index 100% rename from api/apps/auths/auth.py rename to server/main/app/api/apps/auths/auth.py diff --git a/api/apps/auths/config.py b/server/main/app/api/apps/auths/config.py similarity index 100% rename from api/apps/auths/config.py rename to server/main/app/api/apps/auths/config.py diff --git a/api/apps/auths/database.py b/server/main/app/api/apps/auths/database.py similarity index 100% rename from api/apps/auths/database.py rename to server/main/app/api/apps/auths/database.py diff --git a/api/apps/auths/dependencies.py b/server/main/app/api/apps/auths/dependencies.py similarity index 100% rename from api/apps/auths/dependencies.py rename to server/main/app/api/apps/auths/dependencies.py diff --git a/api/apps/auths/endpoints.py b/server/main/app/api/apps/auths/endpoints.py similarity index 100% rename from api/apps/auths/endpoints.py rename to server/main/app/api/apps/auths/endpoints.py diff --git a/api/apps/auths/utils.py b/server/main/app/api/apps/auths/utils.py similarity index 100% rename from api/apps/auths/utils.py rename to server/main/app/api/apps/auths/utils.py diff --git a/api/apps/media/app_media.py b/server/main/app/api/apps/media/app_media.py similarity index 100% rename from api/apps/media/app_media.py rename to server/main/app/api/apps/media/app_media.py diff --git a/api/db/db_models.py b/server/main/app/api/db/db_models.py similarity index 100% rename from api/db/db_models.py rename to server/main/app/api/db/db_models.py diff --git a/api/media/bilibili.py b/server/main/app/api/media/bilibili.py similarity index 100% rename from api/media/bilibili.py rename to server/main/app/api/media/bilibili.py diff --git a/api/utils/api_utils.py b/server/main/app/api/utils/api_utils.py similarity index 100% rename from api/utils/api_utils.py rename to server/main/app/api/utils/api_utils.py diff --git a/api/utils/config.py b/server/main/app/api/utils/config.py similarity index 100% rename from api/utils/config.py rename to server/main/app/api/utils/config.py diff --git a/api/utils/database.py b/server/main/app/api/utils/database.py similarity index 100% rename from api/utils/database.py rename to server/main/app/api/utils/database.py diff --git a/api/utils/exception.py b/server/main/app/api/utils/exception.py similarity index 100% rename from api/utils/exception.py rename to server/main/app/api/utils/exception.py diff --git a/api/utils/function.py b/server/main/app/api/utils/function.py similarity index 100% rename from api/utils/function.py rename to server/main/app/api/utils/function.py diff --git a/api/utils/pydantic_v2.py b/server/main/app/api/utils/pydantic_v2.py similarity index 100% rename from api/utils/pydantic_v2.py rename to server/main/app/api/utils/pydantic_v2.py diff --git a/model/api_model/model_auth.py b/server/main/app/comment/api_model/model_auth.py similarity index 100% rename from model/api_model/model_auth.py rename to server/main/app/comment/api_model/model_auth.py diff --git a/model/api_model/model_create_agent.py b/server/main/app/comment/api_model/model_create_agent.py similarity index 100% rename from model/api_model/model_create_agent.py rename to server/main/app/comment/api_model/model_create_agent.py diff --git a/model/api_model/model_create_mcp.py b/server/main/app/comment/api_model/model_create_mcp.py similarity index 100% rename from model/api_model/model_create_mcp.py rename to server/main/app/comment/api_model/model_create_mcp.py diff --git a/model/api_model/model_tool.py b/server/main/app/comment/api_model/model_tool.py similarity index 100% rename from model/api_model/model_tool.py rename to server/main/app/comment/api_model/model_tool.py diff --git a/core/config.py b/server/main/app/core/config.py similarity index 100% rename from core/config.py rename to server/main/app/core/config.py diff --git a/core/db/base.py b/server/main/app/core/db/base.py similarity index 100% rename from core/db/base.py rename to server/main/app/core/db/base.py diff --git a/core/db/base_mindsdb.py b/server/main/app/core/db/base_mindsdb.py similarity index 100% rename from core/db/base_mindsdb.py rename to server/main/app/core/db/base_mindsdb.py diff --git a/core/db/base_mongo.py b/server/main/app/core/db/base_mongo.py similarity index 100% rename from core/db/base_mongo.py rename to server/main/app/core/db/base_mongo.py diff --git a/core/db/base_redis.py b/server/main/app/core/db/base_redis.py similarity index 100% rename from core/db/base_redis.py rename to server/main/app/core/db/base_redis.py diff --git a/core/db/base_sync.py b/server/main/app/core/db/base_sync.py similarity index 100% rename from core/db/base_sync.py rename to server/main/app/core/db/base_sync.py diff --git a/core/db/database.py b/server/main/app/core/db/database.py similarity index 100% rename from core/db/database.py rename to server/main/app/core/db/database.py diff --git a/core/llm/llm_client.py b/server/main/app/core/llm/llm_client.py similarity index 100% rename from core/llm/llm_client.py rename to server/main/app/core/llm/llm_client.py diff --git a/core/oss/base_oss.py b/server/main/app/core/oss/base_oss.py similarity index 100% rename from core/oss/base_oss.py rename to server/main/app/core/oss/base_oss.py diff --git a/core/prompt/system_prompt.jinja b/server/main/app/core/prompt/system_prompt.jinja similarity index 100% rename from core/prompt/system_prompt.jinja rename to server/main/app/core/prompt/system_prompt.jinja diff --git a/core/prompt/timeseries_param_extract.jinja b/server/main/app/core/prompt/timeseries_param_extract.jinja similarity index 100% rename from core/prompt/timeseries_param_extract.jinja rename to server/main/app/core/prompt/timeseries_param_extract.jinja diff --git a/core/timeseries/time_gpt.py b/server/main/app/core/timeseries/time_gpt.py similarity index 100% rename from core/timeseries/time_gpt.py rename to server/main/app/core/timeseries/time_gpt.py diff --git a/plugin/llm_tool_plugin.py b/server/main/app/models/__init__.py similarity index 100% rename from plugin/llm_tool_plugin.py rename to server/main/app/models/__init__.py diff --git a/model/model_agent.py b/server/main/app/models/agent.py similarity index 100% rename from model/model_agent.py rename to server/main/app/models/agent.py diff --git a/model/model_timeseries.py b/server/main/app/models/timeseries.py similarity index 100% rename from model/model_timeseries.py rename to server/main/app/models/timeseries.py diff --git a/sql/manager_rag.sql b/server/main/app/plugin/llm_tool_plugin.py similarity index 100% rename from sql/manager_rag.sql rename to server/main/app/plugin/llm_tool_plugin.py diff --git a/src_a2a/a2a_client/__init__.py b/server/main/app/src/a2a/a2a_client/__init__.py similarity index 100% rename from src_a2a/a2a_client/__init__.py rename to server/main/app/src/a2a/a2a_client/__init__.py diff --git a/src_a2a/a2a_client/__main__.py b/server/main/app/src/a2a/a2a_client/__main__.py similarity index 100% rename from src_a2a/a2a_client/__main__.py rename to server/main/app/src/a2a/a2a_client/__main__.py diff --git a/src_a2a/a2a_client/agent.py b/server/main/app/src/a2a/a2a_client/agent.py similarity index 100% rename from src_a2a/a2a_client/agent.py rename to server/main/app/src/a2a/a2a_client/agent.py diff --git a/src_a2a/a2a_client/agent_answer.jinja b/server/main/app/src/a2a/a2a_client/agent_answer.jinja similarity index 100% rename from src_a2a/a2a_client/agent_answer.jinja rename to server/main/app/src/a2a/a2a_client/agent_answer.jinja diff --git a/src_a2a/a2a_client/agents.jinja b/server/main/app/src/a2a/a2a_client/agents.jinja similarity index 100% rename from src_a2a/a2a_client/agents.jinja rename to server/main/app/src/a2a/a2a_client/agents.jinja diff --git a/src_a2a/a2a_client/called_agent_history.jinja b/server/main/app/src/a2a/a2a_client/called_agent_history.jinja similarity index 100% rename from src_a2a/a2a_client/called_agent_history.jinja rename to server/main/app/src/a2a/a2a_client/called_agent_history.jinja diff --git a/src_a2a/a2a_client/constant.py b/server/main/app/src/a2a/a2a_client/constant.py similarity index 100% rename from src_a2a/a2a_client/constant.py rename to server/main/app/src/a2a/a2a_client/constant.py diff --git a/src_a2a/a2a_client/decide.jinja b/server/main/app/src/a2a/a2a_client/decide.jinja similarity index 100% rename from src_a2a/a2a_client/decide.jinja rename to server/main/app/src/a2a/a2a_client/decide.jinja diff --git a/src_a2a/a2a_client/remote_agent_connection.py b/server/main/app/src/a2a/a2a_client/remote_agent_connection.py similarity index 100% rename from src_a2a/a2a_client/remote_agent_connection.py rename to server/main/app/src/a2a/a2a_client/remote_agent_connection.py diff --git a/src_a2a/a2a_server/__init__.py b/server/main/app/src/a2a/a2a_server/__init__.py similarity index 100% rename from src_a2a/a2a_server/__init__.py rename to server/main/app/src/a2a/a2a_server/__init__.py diff --git a/src_a2a/a2a_server/__main__.py b/server/main/app/src/a2a/a2a_server/__main__.py similarity index 100% rename from src_a2a/a2a_server/__main__.py rename to server/main/app/src/a2a/a2a_server/__main__.py diff --git a/src_a2a/a2a_server/agent.py b/server/main/app/src/a2a/a2a_server/agent.py similarity index 100% rename from src_a2a/a2a_server/agent.py rename to server/main/app/src/a2a/a2a_server/agent.py diff --git a/src_a2a/a2a_server/agent_executor.py b/server/main/app/src/a2a/a2a_server/agent_executor.py similarity index 100% rename from src_a2a/a2a_server/agent_executor.py rename to server/main/app/src/a2a/a2a_server/agent_executor.py diff --git a/src_a2a/a2a_server/called_tools_history.jinja b/server/main/app/src/a2a/a2a_server/called_tools_history.jinja similarity index 100% rename from src_a2a/a2a_server/called_tools_history.jinja rename to server/main/app/src/a2a/a2a_server/called_tools_history.jinja diff --git a/src_a2a/a2a_server/chat_history.jinja b/server/main/app/src/a2a/a2a_server/chat_history.jinja similarity index 100% rename from src_a2a/a2a_server/chat_history.jinja rename to server/main/app/src/a2a/a2a_server/chat_history.jinja diff --git a/src_a2a/a2a_server/constant.py b/server/main/app/src/a2a/a2a_server/constant.py similarity index 100% rename from src_a2a/a2a_server/constant.py rename to server/main/app/src/a2a/a2a_server/constant.py diff --git a/src_a2a/a2a_server/decide.jinja b/server/main/app/src/a2a/a2a_server/decide.jinja similarity index 100% rename from src_a2a/a2a_server/decide.jinja rename to server/main/app/src/a2a/a2a_server/decide.jinja diff --git a/src_a2a/a2a_server/mcp_manager.py b/server/main/app/src/a2a/a2a_server/mcp_manager.py similarity index 100% rename from src_a2a/a2a_server/mcp_manager.py rename to server/main/app/src/a2a/a2a_server/mcp_manager.py diff --git a/src_a2a/a2a_server/tool.jinja b/server/main/app/src/a2a/a2a_server/tool.jinja similarity index 100% rename from src_a2a/a2a_server/tool.jinja rename to server/main/app/src/a2a/a2a_server/tool.jinja diff --git a/src_mcp/mcp_client/__init__.py b/server/main/app/src/mcp/mcp_client/__init__.py similarity index 100% rename from src_mcp/mcp_client/__init__.py rename to server/main/app/src/mcp/mcp_client/__init__.py diff --git a/src_mcp/mcp_client/configs_server.json b/server/main/app/src/mcp/mcp_client/configs_server.json similarity index 100% rename from src_mcp/mcp_client/configs_server.json rename to server/main/app/src/mcp/mcp_client/configs_server.json diff --git a/src_mcp/mcp_client/dependencies.py b/server/main/app/src/mcp/mcp_client/dependencies.py similarity index 100% rename from src_mcp/mcp_client/dependencies.py rename to server/main/app/src/mcp/mcp_client/dependencies.py diff --git a/src_mcp/mcp_client/mcp_client.py b/server/main/app/src/mcp/mcp_client/mcp_client.py similarity index 100% rename from src_mcp/mcp_client/mcp_client.py rename to server/main/app/src/mcp/mcp_client/mcp_client.py diff --git a/src_mcp/mcp_server/configs_tool.json b/server/main/app/src/mcp/mcp_server/configs_tool.json similarity index 100% rename from src_mcp/mcp_server/configs_tool.json rename to server/main/app/src/mcp/mcp_server/configs_tool.json diff --git a/src_mcp/mcp_server/manager_server_tool.py b/server/main/app/src/mcp/mcp_server/manager_server_tool.py similarity index 100% rename from src_mcp/mcp_server/manager_server_tool.py rename to server/main/app/src/mcp/mcp_server/manager_server_tool.py diff --git a/src_mcp/mcp_server/manager_tool.py b/server/main/app/src/mcp/mcp_server/manager_tool.py similarity index 100% rename from src_mcp/mcp_server/manager_tool.py rename to server/main/app/src/mcp/mcp_server/manager_tool.py diff --git a/src_mcp/mcp_server/server/mcp_server.py b/server/main/app/src/mcp/mcp_server/server/mcp_server.py similarity index 100% rename from src_mcp/mcp_server/server/mcp_server.py rename to server/main/app/src/mcp/mcp_server/server/mcp_server.py diff --git a/src_mcp/mcp_server/tool/tool_sum.py b/server/main/app/src/mcp/mcp_server/tool/tool_sum.py similarity index 100% rename from src_mcp/mcp_server/tool/tool_sum.py rename to server/main/app/src/mcp/mcp_server/tool/tool_sum.py diff --git a/src_rag/settings.py b/server/main/app/src/rag/settings.py similarity index 100% rename from src_rag/settings.py rename to server/main/app/src/rag/settings.py diff --git a/conf/supervisord.conf b/server/main/conf/supervisord.conf similarity index 100% rename from conf/supervisord.conf rename to server/main/conf/supervisord.conf diff --git a/service/llm/volcano.py b/server/service/llm/volcano.py similarity index 100% rename from service/llm/volcano.py rename to server/service/llm/volcano.py diff --git a/service/media/bilibili.py b/server/service/media/bilibili.py similarity index 100% rename from service/media/bilibili.py rename to server/service/media/bilibili.py diff --git a/service/multimodel/video.py b/server/service/multimodel/video.py similarity index 100% rename from service/multimodel/video.py rename to server/service/multimodel/video.py diff --git a/vue-frontend/src/views/Agent/Detail.vue b/setup.py similarity index 100% rename from vue-frontend/src/views/Agent/Detail.vue rename to setup.py diff --git a/sql/manager_agent.sql b/sql/manager_agent.sql deleted file mode 100644 index 6f1c445..0000000 --- a/sql/manager_agent.sql +++ /dev/null @@ -1,130 +0,0 @@ --- 创建user_config表 -CREATE TABLE user_config ( - id SERIAL PRIMARY KEY, - name VARCHAR(255) NOT NULL, - password VARCHAR(255) NOT NULL, - core_llm_name VARCHAR(255), - core_llm_url VARCHAR(255), - core_llm_key VARCHAR(255), - UNIQUE name -); - --- 创建llm_config表 -CREATE TABLE llm_config ( - id SERIAL PRIMARY KEY, - name VARCHAR(255) NOT NULL, - url VARCHAR(255) NOT NULL, - key VARCHAR(255) NOT NULL, - user_id INTEGER NOT NULL, - FOREIGN KEY (user_id) REFERENCES user_config (id) ON DELETE CASCADE -); - --- 创建关联表user_config_and_llm_config -CREATE TABLE user_config_and_llm_config ( - id SERIAL PRIMARY KEY, - user_id INTEGER NOT NULL, - llm_id INTEGER NOT NULL, - FOREIGN KEY (user_id) REFERENCES user_config (id) ON DELETE CASCADE, - FOREIGN KEY (llm_id) REFERENCES llm_config (id) ON DELETE CASCADE, - UNIQUE (user_id, llm_id) -- 防止重复关联 -); - --- 创建agent_card表(表名统一小写) -CREATE TABLE agent_card ( - id SERIAL PRIMARY KEY, - name VARCHAR(255) NOT NULL, - description TEXT, - url VARCHAR(255), - version VARCHAR(50), - streaming BOOLEAN, - examples JSONB, - user_id INTEGER NOT NULL, - FOREIGN KEY (user_id) REFERENCES user_config (id) ON DELETE CASCADE -); - --- 创建skill表(修复原skills拼写不一致) -CREATE TABLE skill ( - id SERIAL PRIMARY KEY, - name VARCHAR(255) NOT NULL, - description TEXT, - tags JSONB, - examples JSONB -); - --- 创建input_mode表(表名改为下划线风格) -CREATE TABLE input_mode ( - id SERIAL PRIMARY KEY, - name VARCHAR(255) NOT NULL -); - --- 创建output_mode表(表名改为下划线风格) -CREATE TABLE output_mode ( - id SERIAL PRIMARY KEY, - name VARCHAR(255) NOT NULL -); - --- 创建agent_card_and_skill关联表(修复外键引用) -CREATE TABLE agent_card_and_skill ( - id SERIAL PRIMARY KEY, - agent_card_id INTEGER NOT NULL, - skill_id INTEGER NOT NULL, - FOREIGN KEY (agent_card_id) REFERENCES agent_card (id) ON DELETE CASCADE, - FOREIGN KEY (skill_id) REFERENCES skill (id) ON DELETE CASCADE, - UNIQUE (agent_card_id, skill_id) -); - --- 创建agent_card_and_input_mode关联表(修复列名不一致) -CREATE TABLE agent_card_and_input_mode ( - id SERIAL PRIMARY KEY, - agent_card_id INTEGER NOT NULL, - input_mode_id INTEGER NOT NULL, - FOREIGN KEY (agent_card_id) REFERENCES agent_card (id) ON DELETE CASCADE, - FOREIGN KEY (input_mode_id) REFERENCES input_mode (id) ON DELETE CASCADE, - UNIQUE (agent_card_id, input_mode_id) -); - --- 创建agent_card_and_output_mode关联表 -CREATE TABLE agent_card_and_output_mode ( - id SERIAL PRIMARY KEY, - agent_card_id INTEGER NOT NULL, - output_mode_id INTEGER NOT NULL, - FOREIGN KEY (agent_card_id) REFERENCES agent_card (id) ON DELETE CASCADE, - FOREIGN KEY (output_mode_id) REFERENCES output_mode (id) ON DELETE CASCADE, - UNIQUE (agent_card_id, output_mode_id) -); - --- 创建mcp_server表 -CREATE TABLE mcp_server ( - id SERIAL PRIMARY KEY, - name VARCHAR(255) NOT NULL, - url VARCHAR(255) NOT NULL, - user_id INTEGER NOT NULL, - FOREIGN KEY (user_id) REFERENCES user_config (id) ON DELETE CASCADE -); - --- 创建agent_card_and_mcp_server关联表(修复SERIAL拼写错误) -CREATE TABLE agent_card_and_mcp_server ( - id SERIAL PRIMARY KEY, - agent_card_id INTEGER NOT NULL, - mcp_server_id INTEGER NOT NULL, - FOREIGN KEY (agent_card_id) REFERENCES agent_card (id) ON DELETE CASCADE, - FOREIGN KEY (mcp_server_id) REFERENCES mcp_server (id) ON DELETE CASCADE, - UNIQUE (agent_card_id, mcp_server_id) -); - --- 创建tool表 -CREATE TABLE tool ( - id SERIAL PRIMARY KEY, - name VARCHAR(255) NOT NULL, - url VARCHAR(255) NOT NULL -); - --- 创建mcp_server_and_tool关联表 -CREATE TABLE mcp_server_and_tool ( - id SERIAL PRIMARY KEY, - mcp_server_id INTEGER NOT NULL, - tool_id INTEGER NOT NULL, - FOREIGN KEY (mcp_server_id) REFERENCES mcp_server (id) ON DELETE CASCADE, - FOREIGN KEY (tool_id) REFERENCES tool (id) ON DELETE CASCADE, - UNIQUE (mcp_server_id, tool_id) -); \ No newline at end of file diff --git a/sql/manager_user.sql b/sql/manager_user.sql deleted file mode 100644 index d6723a3..0000000 --- a/sql/manager_user.sql +++ /dev/null @@ -1,31 +0,0 @@ -class UserConfig(Base): - __tablename__ = 'user_config' - id = Column(Integer, primary_key=True, autoincrement=True) - name = Column(String(255)) - password = Column(String(255)) - - core_llm_name = Column(String(255)) - core_llm_url = Column(String(255)) - core_llm_key = Column(String(255)) - - llm_configs = relationship("UserAndLLM", back_populates="user_config") - agent_cards = relationship("AgentCard", back_populates="user_config") - -class UserConfigAndLLMConfig(Base): - __tablename__ = 'user_config_and_llm_config' - - id = Column(Integer, primary_key=True, autoincrement=True) - user_id = Column(Integer, ForeignKey('user_configs.id'), nullable=False) - llm_id = Column(Integer, ForeignKey('llm_configs.id'), nullable=False) - - user_config = relationship("UserConfig", back_populates="llm_config") - llm_config = relationship("LLMConfig", back_populates="user_config") - - -class LLMConfig(Base): - __tablename__ = 'llm_config' - - id = Column(Integer, primary_key=True, autoincrement=True) - name = Column(String(255)) - url = Column(String(255)) - key = Column(String(255)) diff --git a/start_services.sh b/start_services.sh old mode 100755 new mode 100644 diff --git a/vue-frontend/.editorconfig b/web/.editorconfig similarity index 100% rename from vue-frontend/.editorconfig rename to web/.editorconfig diff --git a/vue-frontend/.gitattributes b/web/.gitattributes similarity index 100% rename from vue-frontend/.gitattributes rename to web/.gitattributes diff --git a/vue-frontend/.gitignore b/web/.gitignore similarity index 100% rename from vue-frontend/.gitignore rename to web/.gitignore diff --git a/vue-frontend/.prettierrc.json b/web/.prettierrc.json similarity index 100% rename from vue-frontend/.prettierrc.json rename to web/.prettierrc.json diff --git a/vue-frontend/.vscode/extensions.json b/web/.vscode/extensions.json similarity index 100% rename from vue-frontend/.vscode/extensions.json rename to web/.vscode/extensions.json diff --git a/vue-frontend/Dockerfile b/web/Dockerfile similarity index 100% rename from vue-frontend/Dockerfile rename to web/Dockerfile diff --git a/vue-frontend/README.md b/web/README.md similarity index 100% rename from vue-frontend/README.md rename to web/README.md diff --git a/vue-frontend/api.c2sagent.com_nginx.tar b/web/api.c2sagent.com_nginx.tar similarity index 100% rename from vue-frontend/api.c2sagent.com_nginx.tar rename to web/api.c2sagent.com_nginx.tar diff --git a/vue-frontend/docker-compose.yml b/web/docker-compose.yml similarity index 100% rename from vue-frontend/docker-compose.yml rename to web/docker-compose.yml diff --git a/vue-frontend/eslint.config.ts b/web/eslint.config.ts similarity index 100% rename from vue-frontend/eslint.config.ts rename to web/eslint.config.ts diff --git a/vue-frontend/index.html b/web/index.html similarity index 100% rename from vue-frontend/index.html rename to web/index.html diff --git a/vue-frontend/nginx.conf b/web/nginx.conf similarity index 100% rename from vue-frontend/nginx.conf rename to web/nginx.conf diff --git a/vue-frontend/package-lock.json b/web/package-lock.json similarity index 100% rename from vue-frontend/package-lock.json rename to web/package-lock.json diff --git a/vue-frontend/package.json b/web/package.json similarity index 100% rename from vue-frontend/package.json rename to web/package.json diff --git a/vue-frontend/public/favicon.ico b/web/public/favicon.ico similarity index 100% rename from vue-frontend/public/favicon.ico rename to web/public/favicon.ico diff --git a/vue-frontend/public/favicon.png b/web/public/favicon.png similarity index 100% rename from vue-frontend/public/favicon.png rename to web/public/favicon.png diff --git a/vue-frontend/public/index.html b/web/public/index.html similarity index 100% rename from vue-frontend/public/index.html rename to web/public/index.html diff --git a/vue-frontend/src/App.vue b/web/src/App.vue similarity index 100% rename from vue-frontend/src/App.vue rename to web/src/App.vue diff --git a/vue-frontend/src/api/agent.ts b/web/src/api/agent.ts similarity index 100% rename from vue-frontend/src/api/agent.ts rename to web/src/api/agent.ts diff --git a/vue-frontend/src/api/auth.ts b/web/src/api/auth.ts similarity index 100% rename from vue-frontend/src/api/auth.ts rename to web/src/api/auth.ts diff --git a/vue-frontend/src/api/history.ts b/web/src/api/history.ts similarity index 100% rename from vue-frontend/src/api/history.ts rename to web/src/api/history.ts diff --git a/vue-frontend/src/api/index.ts b/web/src/api/index.ts similarity index 100% rename from vue-frontend/src/api/index.ts rename to web/src/api/index.ts diff --git a/vue-frontend/src/api/mcp.ts b/web/src/api/mcp.ts similarity index 100% rename from vue-frontend/src/api/mcp.ts rename to web/src/api/mcp.ts diff --git a/vue-frontend/src/api/media.ts b/web/src/api/media.ts similarity index 100% rename from vue-frontend/src/api/media.ts rename to web/src/api/media.ts diff --git a/vue-frontend/src/assets/base.css b/web/src/assets/base.css similarity index 100% rename from vue-frontend/src/assets/base.css rename to web/src/assets/base.css diff --git a/vue-frontend/src/assets/bg.jpeg b/web/src/assets/bg.jpeg similarity index 100% rename from vue-frontend/src/assets/bg.jpeg rename to web/src/assets/bg.jpeg diff --git a/vue-frontend/src/assets/logo.png b/web/src/assets/logo.png similarity index 100% rename from vue-frontend/src/assets/logo.png rename to web/src/assets/logo.png diff --git a/vue-frontend/src/assets/logo.svg b/web/src/assets/logo.svg similarity index 100% rename from vue-frontend/src/assets/logo.svg rename to web/src/assets/logo.svg diff --git a/vue-frontend/src/assets/main.css b/web/src/assets/main.css similarity index 100% rename from vue-frontend/src/assets/main.css rename to web/src/assets/main.css diff --git a/vue-frontend/src/components/ChatArea.vue b/web/src/components/ChatArea.vue similarity index 100% rename from vue-frontend/src/components/ChatArea.vue rename to web/src/components/ChatArea.vue diff --git a/vue-frontend/src/components/ChatItem.vue b/web/src/components/ChatItem.vue similarity index 100% rename from vue-frontend/src/components/ChatItem.vue rename to web/src/components/ChatItem.vue diff --git a/vue-frontend/src/components/Sidebar.vue b/web/src/components/Sidebar.vue similarity index 100% rename from vue-frontend/src/components/Sidebar.vue rename to web/src/components/Sidebar.vue diff --git a/vue-frontend/src/env.d.ts b/web/src/env.d.ts similarity index 100% rename from vue-frontend/src/env.d.ts rename to web/src/env.d.ts diff --git a/vue-frontend/src/main.ts b/web/src/main.ts similarity index 100% rename from vue-frontend/src/main.ts rename to web/src/main.ts diff --git a/vue-frontend/src/router/index.ts b/web/src/router/index.ts similarity index 100% rename from vue-frontend/src/router/index.ts rename to web/src/router/index.ts diff --git a/vue-frontend/src/stores/auth.ts b/web/src/stores/auth.ts similarity index 100% rename from vue-frontend/src/stores/auth.ts rename to web/src/stores/auth.ts diff --git a/vue-frontend/src/stores/counter.ts b/web/src/stores/counter.ts similarity index 100% rename from vue-frontend/src/stores/counter.ts rename to web/src/stores/counter.ts diff --git a/vue-frontend/src/types.ts b/web/src/types.ts similarity index 100% rename from vue-frontend/src/types.ts rename to web/src/types.ts diff --git a/vue-frontend/src/types/auth.d.ts b/web/src/types/auth.d.ts similarity index 100% rename from vue-frontend/src/types/auth.d.ts rename to web/src/types/auth.d.ts diff --git a/vue-frontend/src/types/chat.d.ts b/web/src/types/chat.d.ts similarity index 100% rename from vue-frontend/src/types/chat.d.ts rename to web/src/types/chat.d.ts diff --git a/vue-frontend/src/views/AboutView.vue b/web/src/views/AboutView.vue similarity index 100% rename from vue-frontend/src/views/AboutView.vue rename to web/src/views/AboutView.vue diff --git a/vue-frontend/src/views/Agent/Create.vue b/web/src/views/Agent/Create.vue similarity index 100% rename from vue-frontend/src/views/Agent/Create.vue rename to web/src/views/Agent/Create.vue diff --git a/vue-frontend/src/views/Media/Detail.vue b/web/src/views/Agent/Detail.vue similarity index 100% rename from vue-frontend/src/views/Media/Detail.vue rename to web/src/views/Agent/Detail.vue diff --git a/vue-frontend/src/views/Agent/List.vue b/web/src/views/Agent/List.vue similarity index 100% rename from vue-frontend/src/views/Agent/List.vue rename to web/src/views/Agent/List.vue diff --git a/vue-frontend/src/views/Auth/Login.vue b/web/src/views/Auth/Login.vue similarity index 100% rename from vue-frontend/src/views/Auth/Login.vue rename to web/src/views/Auth/Login.vue diff --git a/vue-frontend/src/views/Auth/Logout.vue b/web/src/views/Auth/Logout.vue similarity index 100% rename from vue-frontend/src/views/Auth/Logout.vue rename to web/src/views/Auth/Logout.vue diff --git a/vue-frontend/src/views/Auth/Register.vue b/web/src/views/Auth/Register.vue similarity index 100% rename from vue-frontend/src/views/Auth/Register.vue rename to web/src/views/Auth/Register.vue diff --git a/vue-frontend/src/views/Home.vue b/web/src/views/Home.vue similarity index 100% rename from vue-frontend/src/views/Home.vue rename to web/src/views/Home.vue diff --git a/vue-frontend/src/views/HomeView.vue b/web/src/views/HomeView.vue similarity index 100% rename from vue-frontend/src/views/HomeView.vue rename to web/src/views/HomeView.vue diff --git a/vue-frontend/src/views/Mcp/Create.vue b/web/src/views/Mcp/Create.vue similarity index 100% rename from vue-frontend/src/views/Mcp/Create.vue rename to web/src/views/Mcp/Create.vue diff --git a/vue-frontend/src/views/Mcp/List.vue b/web/src/views/Mcp/List.vue similarity index 100% rename from vue-frontend/src/views/Mcp/List.vue rename to web/src/views/Mcp/List.vue diff --git a/vue-frontend/src/views/Mcp/Tool.vue b/web/src/views/Mcp/Tool.vue similarity index 100% rename from vue-frontend/src/views/Mcp/Tool.vue rename to web/src/views/Mcp/Tool.vue diff --git a/web/src/views/Media/Detail.vue b/web/src/views/Media/Detail.vue new file mode 100644 index 0000000..e69de29 diff --git a/vue-frontend/src/views/Media/List.vue b/web/src/views/Media/List.vue similarity index 100% rename from vue-frontend/src/views/Media/List.vue rename to web/src/views/Media/List.vue diff --git a/vue-frontend/src/vue-shims.d.ts b/web/src/vue-shims.d.ts similarity index 100% rename from vue-frontend/src/vue-shims.d.ts rename to web/src/vue-shims.d.ts diff --git a/vue-frontend/tsconfig.app.json b/web/tsconfig.app.json similarity index 100% rename from vue-frontend/tsconfig.app.json rename to web/tsconfig.app.json diff --git a/vue-frontend/tsconfig.json b/web/tsconfig.json similarity index 100% rename from vue-frontend/tsconfig.json rename to web/tsconfig.json diff --git a/vue-frontend/tsconfig.node.json b/web/tsconfig.node.json similarity index 100% rename from vue-frontend/tsconfig.node.json rename to web/tsconfig.node.json diff --git a/vue-frontend/vite.config.js b/web/vite.config.js similarity index 100% rename from vue-frontend/vite.config.js rename to web/vite.config.js diff --git a/vue-frontend/vite.config.ts b/web/vite.config.ts similarity index 100% rename from vue-frontend/vite.config.ts rename to web/vite.config.ts