myagent-ai 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.py +2 -1
- package/core/version.py +1 -1
- package/package.json +1 -1
- package/web/api_server.py +27 -19
- package/web/ui/chat.html +11 -6
- package/agents/__pycache__/main_agent.cpython-312.pyc +0 -0
- package/departments/__pycache__/__init__.cpython-312.pyc +0 -0
- package/departments/__pycache__/manager.cpython-312.pyc +0 -0
- package/executor/__pycache__/engine.cpython-312.pyc +0 -0
- package/organization/__pycache__/manager.cpython-312.pyc +0 -0
- package/skills/aminer-open-academic/scripts/__pycache__/aminer_client.cpython-312.pyc +0 -0
- package/skills/blog-writer/__pycache__/manage_examples.cpython-312.pyc +0 -0
- package/skills/docx/ooxml/scripts/__pycache__/pack.cpython-312.pyc +0 -0
- package/skills/docx/ooxml/scripts/__pycache__/unpack.cpython-312.pyc +0 -0
- package/skills/docx/ooxml/scripts/__pycache__/validate.cpython-312.pyc +0 -0
- package/skills/docx/ooxml/scripts/validation/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/docx/ooxml/scripts/validation/__pycache__/base.cpython-312.pyc +0 -0
- package/skills/docx/ooxml/scripts/validation/__pycache__/docx.cpython-312.pyc +0 -0
- package/skills/docx/ooxml/scripts/validation/__pycache__/pptx.cpython-312.pyc +0 -0
- package/skills/docx/ooxml/scripts/validation/__pycache__/redlining.cpython-312.pyc +0 -0
- package/skills/docx/scripts/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/docx/scripts/__pycache__/add_toc_placeholders.cpython-312.pyc +0 -0
- package/skills/docx/scripts/__pycache__/document.cpython-312.pyc +0 -0
- package/skills/docx/scripts/__pycache__/utilities.cpython-312.pyc +0 -0
- package/skills/market-research-reports/scripts/__pycache__/generate_market_visuals.cpython-312.pyc +0 -0
- package/skills/pdf/scripts/__pycache__/add_zai_metadata.cpython-312.pyc +0 -0
- package/skills/pdf/scripts/__pycache__/check_bounding_boxes.cpython-312.pyc +0 -0
- package/skills/pdf/scripts/__pycache__/check_bounding_boxes_test.cpython-312.pyc +0 -0
- package/skills/pdf/scripts/__pycache__/check_fillable_fields.cpython-312.pyc +0 -0
- package/skills/pdf/scripts/__pycache__/convert_pdf_to_images.cpython-312.pyc +0 -0
- package/skills/pdf/scripts/__pycache__/create_validation_image.cpython-312.pyc +0 -0
- package/skills/pdf/scripts/__pycache__/extract_form_field_info.cpython-312.pyc +0 -0
- package/skills/pdf/scripts/__pycache__/fill_fillable_fields.cpython-312.pyc +0 -0
- package/skills/pdf/scripts/__pycache__/fill_pdf_form_with_annotations.cpython-312.pyc +0 -0
- package/skills/pdf/scripts/__pycache__/sanitize_code.cpython-312.pyc +0 -0
- package/skills/pptx/ooxml/scripts/__pycache__/pack.cpython-312.pyc +0 -0
- package/skills/pptx/ooxml/scripts/__pycache__/unpack.cpython-312.pyc +0 -0
- package/skills/pptx/ooxml/scripts/__pycache__/validate.cpython-312.pyc +0 -0
- package/skills/pptx/ooxml/scripts/validation/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/pptx/ooxml/scripts/validation/__pycache__/base.cpython-312.pyc +0 -0
- package/skills/pptx/ooxml/scripts/validation/__pycache__/docx.cpython-312.pyc +0 -0
- package/skills/pptx/ooxml/scripts/validation/__pycache__/pptx.cpython-312.pyc +0 -0
- package/skills/pptx/ooxml/scripts/validation/__pycache__/redlining.cpython-312.pyc +0 -0
- package/skills/pptx/scripts/__pycache__/inventory.cpython-312.pyc +0 -0
- package/skills/pptx/scripts/__pycache__/inventory.cpython-313.pyc +0 -0
- package/skills/pptx/scripts/__pycache__/rearrange.cpython-312.pyc +0 -0
- package/skills/pptx/scripts/__pycache__/replace.cpython-312.pyc +0 -0
- package/skills/pptx/scripts/__pycache__/thumbnail.cpython-312.pyc +0 -0
- package/skills/qingyan-research/__pycache__/generate_html.cpython-312.pyc +0 -0
- package/skills/skill-creator/eval-viewer/__pycache__/generate_review.cpython-312.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/aggregate_benchmark.cpython-312.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/generate_report.cpython-312.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/improve_description.cpython-312.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/package_skill.cpython-312.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/quick_validate.cpython-312.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/run_eval.cpython-312.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/run_loop.cpython-312.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/utils.cpython-312.pyc +0 -0
- package/skills/storyboard-manager/scripts/__pycache__/consistency_checker.cpython-312.pyc +0 -0
- package/skills/storyboard-manager/scripts/__pycache__/timeline_tracker.cpython-312.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-312.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-312.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/search.cpython-312.pyc +0 -0
- package/skills/xlsx/__pycache__/recalc.cpython-312.pyc +0 -0
- package/web/__pycache__/api_server.cpython-312.pyc +0 -0
package/config.py
CHANGED
|
@@ -270,8 +270,9 @@ class ConfigManager:
|
|
|
270
270
|
"""应用平台相关的默认值"""
|
|
271
271
|
if not self._config.memory.db_path:
|
|
272
272
|
self._config.memory.db_path = str(self.data_dir / "memory.db")
|
|
273
|
+
# data_dir 由 property 自动计算为 _data_dir / "data",无需在此设置
|
|
273
274
|
if not self._config.data_dir:
|
|
274
|
-
self._config.data_dir =
|
|
275
|
+
self._config.data_dir = ""
|
|
275
276
|
|
|
276
277
|
# 设置 Ollama base_url
|
|
277
278
|
if self._config.llm.provider == "ollama" and not self._config.llm.base_url:
|
package/core/version.py
CHANGED
package/package.json
CHANGED
package/web/api_server.py
CHANGED
|
@@ -92,23 +92,32 @@ class ApiServer:
|
|
|
92
92
|
|
|
93
93
|
def _setup_routes(self):
|
|
94
94
|
r = self.app.router
|
|
95
|
+
# ── 系统状态 ──
|
|
95
96
|
r.add_get("/api/status", self.handle_status)
|
|
96
97
|
r.add_post("/api/shutdown", self.handle_shutdown)
|
|
98
|
+
# ── Agent 列表/创建 ──
|
|
97
99
|
r.add_get("/api/agents", self.handle_list_agents)
|
|
98
100
|
r.add_get("/api/agents/tree", self.handle_agents_tree)
|
|
99
101
|
r.add_post("/api/agents", self.handle_create_agent)
|
|
100
|
-
|
|
101
|
-
r.
|
|
102
|
+
# ── Agent 子资源路由(必须在通用 {name} 路由之前注册) ──
|
|
103
|
+
r.add_get("/api/agents/{name:[^/]+}/soul", self.handle_get_soul)
|
|
104
|
+
r.add_put("/api/agents/{name:[^/]+}/soul", self.handle_set_soul)
|
|
105
|
+
r.add_get("/api/agents/{name:[^/]+}/identity", self.handle_get_identity)
|
|
106
|
+
r.add_put("/api/agents/{name:[^/]+}/identity", self.handle_set_identity)
|
|
107
|
+
r.add_get("/api/agents/{name:[^/]+}/user", self.handle_get_user)
|
|
108
|
+
r.add_put("/api/agents/{name:[^/]+}/user", self.handle_set_user)
|
|
109
|
+
r.add_get("/api/agents/{name:[^/]+}/sessions", self.handle_agent_sessions)
|
|
110
|
+
r.add_get("/api/agents/{name:[^/]+}/children", self.handle_list_children)
|
|
111
|
+
r.add_post("/api/agents/{name:[^/]+}/children", self.handle_create_child)
|
|
112
|
+
r.add_get("/api/agents/{name:[^/]+}/bindings", self.handle_agent_bindings)
|
|
113
|
+
r.add_get("/api/agents/{name:[^/]+}/knowledge", self.handle_list_agent_knowledge)
|
|
114
|
+
r.add_post("/api/agents/{name:[^/]+}/knowledge/upload", self.handle_upload_agent_knowledge)
|
|
115
|
+
r.add_delete("/api/agents/{name:[^/]+}/knowledge", self.handle_delete_agent_knowledge)
|
|
116
|
+
# ── Agent 通用 CRUD(放在子资源之后,name 不含斜杠避免吞掉子路由) ──
|
|
117
|
+
r.add_get("/api/agents/{name:[^/]+}", self.handle_get_agent)
|
|
118
|
+
r.add_put("/api/agents/{name:[^/]+}", self.handle_update_agent)
|
|
102
119
|
r.add_delete("/api/agents/{name:.+}", self.handle_delete_agent)
|
|
103
|
-
|
|
104
|
-
r.add_put("/api/agents/{name:[a-zA-Z0-9_/-]+}/soul", self.handle_set_soul)
|
|
105
|
-
r.add_get("/api/agents/{name:[a-zA-Z0-9_/-]+}/identity", self.handle_get_identity)
|
|
106
|
-
r.add_put("/api/agents/{name:[a-zA-Z0-9_/-]+}/identity", self.handle_set_identity)
|
|
107
|
-
r.add_get("/api/agents/{name:[a-zA-Z0-9_/-]+}/user", self.handle_get_user)
|
|
108
|
-
r.add_put("/api/agents/{name:[a-zA-Z0-9_/-]+}/user", self.handle_set_user)
|
|
109
|
-
r.add_get("/api/agents/{name:[a-zA-Z0-9_/-]+}/sessions", self.handle_agent_sessions)
|
|
110
|
-
r.add_get("/api/agents/{name:[a-zA-Z0-9_/-]+}/children", self.handle_list_children)
|
|
111
|
-
r.add_post("/api/agents/{name:[a-zA-Z0-9_/-]+}/children", self.handle_create_child)
|
|
120
|
+
# ── 平台管理 ──
|
|
112
121
|
r.add_get("/api/platforms", self.handle_list_platforms)
|
|
113
122
|
r.add_post("/api/platforms", self.handle_add_platform)
|
|
114
123
|
r.add_get("/api/platforms/{name}", self.handle_get_platform)
|
|
@@ -122,8 +131,7 @@ class ApiServer:
|
|
|
122
131
|
r.add_post("/api/models", self.handle_add_model)
|
|
123
132
|
r.add_put("/api/models/{model_id}", self.handle_update_model)
|
|
124
133
|
r.add_delete("/api/models/{model_id}", self.handle_delete_model)
|
|
125
|
-
# ──
|
|
126
|
-
r.add_get("/api/agents/{name:[a-zA-Z0-9_/-]+}/bindings", self.handle_agent_bindings)
|
|
134
|
+
# ── 会话管理 ──
|
|
127
135
|
r.add_get("/api/sessions", self.handle_list_sessions)
|
|
128
136
|
r.add_get("/api/sessions/{sid}/messages", self.handle_get_messages)
|
|
129
137
|
r.add_delete("/api/sessions/{sid}", self.handle_clear_session)
|
|
@@ -165,10 +173,6 @@ class ApiServer:
|
|
|
165
173
|
r.add_get("/api/organization/knowledge/file", self.handle_read_org_knowledge)
|
|
166
174
|
r.add_post("/api/organization/knowledge/upload", self.handle_upload_org_knowledge)
|
|
167
175
|
r.add_delete("/api/organization/knowledge", self.handle_delete_org_knowledge)
|
|
168
|
-
# ── Agent 知识库 ──
|
|
169
|
-
r.add_get("/api/agents/{name:[a-zA-Z0-9_/-]+}/knowledge", self.handle_list_agent_knowledge)
|
|
170
|
-
r.add_post("/api/agents/{name:[a-zA-Z0-9_/-]+}/knowledge/upload", self.handle_upload_agent_knowledge)
|
|
171
|
-
r.add_delete("/api/agents/{name:[a-zA-Z0-9_/-]+}/knowledge", self.handle_delete_agent_knowledge)
|
|
172
176
|
# ── 知识库 RAG 搜索 ──
|
|
173
177
|
r.add_post("/api/knowledge/search", self.handle_knowledge_search)
|
|
174
178
|
# ── 配置管理 (热重载/导入/导出) ──
|
|
@@ -239,14 +243,18 @@ class ApiServer:
|
|
|
239
243
|
r.add_post("/api/execution-lock", self.handle_execution_lock)
|
|
240
244
|
r.add_post("/api/chat/check-text-size", self.handle_check_text_size)
|
|
241
245
|
r.add_post("/api/chat/save-to-knowledge", self.handle_save_to_knowledge)
|
|
246
|
+
r.add_get("/ui/", self.handle_ui_index)
|
|
247
|
+
r.add_get("/", self.handle_index)
|
|
242
248
|
ui_dir = Path(__file__).parent / "ui"
|
|
243
249
|
if ui_dir.exists():
|
|
244
250
|
r.add_static("/ui", str(ui_dir))
|
|
245
|
-
r.add_get("/", self.handle_index)
|
|
246
251
|
|
|
247
252
|
async def handle_index(self, request):
|
|
248
253
|
raise web.HTTPFound("/ui/chat.html")
|
|
249
254
|
|
|
255
|
+
async def handle_ui_index(self, request):
|
|
256
|
+
raise web.HTTPFound("/ui/index.html")
|
|
257
|
+
|
|
250
258
|
def _get_group_manager(self):
|
|
251
259
|
"""获取群聊管理器实例(懒加载)"""
|
|
252
260
|
if not hasattr(self, '_group_manager'):
|
|
@@ -1044,7 +1052,7 @@ class ApiServer:
|
|
|
1044
1052
|
return web.json_response({"ok": True})
|
|
1045
1053
|
|
|
1046
1054
|
async def handle_get_soul(self, request):
|
|
1047
|
-
path = request.match_info
|
|
1055
|
+
path = request.match_info.get("name", "")
|
|
1048
1056
|
p = self._agent_dir(path) / "soul.md"
|
|
1049
1057
|
if not p.parent.exists() or not (p.parent / "config.json").exists():
|
|
1050
1058
|
return web.json_response({"error": "not found"}, status=404)
|
package/web/ui/chat.html
CHANGED
|
@@ -3067,14 +3067,19 @@ function newChat() {
|
|
|
3067
3067
|
document.getElementById('headerTitle').textContent = '新对话';
|
|
3068
3068
|
const agent = findAgentByPath(state.activeAgent);
|
|
3069
3069
|
if (agent) {
|
|
3070
|
-
document.getElementById('welcomeEmoji')
|
|
3071
|
-
|
|
3072
|
-
document.getElementById('
|
|
3070
|
+
const emojiEl = document.getElementById('welcomeEmoji');
|
|
3071
|
+
if (emojiEl) emojiEl.textContent = agent.avatar_emoji || '👋';
|
|
3072
|
+
const titleEl = document.getElementById('welcomeTitle');
|
|
3073
|
+
if (titleEl) titleEl.textContent = `你好,我是 ${agent.name}`;
|
|
3074
|
+
const subEl = document.getElementById('welcomeSubtitle');
|
|
3075
|
+
if (subEl) subEl.textContent = agent.description || '你的 AI 助手';
|
|
3073
3076
|
}
|
|
3074
|
-
document.getElementById('welcomeCard')
|
|
3077
|
+
const welcomeCard = document.getElementById('welcomeCard');
|
|
3078
|
+
if (welcomeCard) welcomeCard.style.display = '';
|
|
3075
3079
|
renderMessages();
|
|
3076
3080
|
renderSessions();
|
|
3077
|
-
document.getElementById('userInput')
|
|
3081
|
+
const userInput = document.getElementById('userInput');
|
|
3082
|
+
if (userInput) userInput.focus();
|
|
3078
3083
|
}
|
|
3079
3084
|
|
|
3080
3085
|
async function selectSession(id) {
|
|
@@ -3565,7 +3570,7 @@ function showConfigModal() {
|
|
|
3565
3570
|
+ '<div class="config-action-row">'
|
|
3566
3571
|
+ '<button class="config-action-btn primary" onclick="hotReloadConfig()" id="reloadBtn">'
|
|
3567
3572
|
+ '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>'
|
|
3568
|
-
+ '
|
|
3573
|
+
+ '热重载配置</button>'
|
|
3569
3574
|
+ '</div>'
|
|
3570
3575
|
+ '<div class="config-status" id="reloadStatus"></div>'
|
|
3571
3576
|
+ '</div>'
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/skills/market-research-reports/scripts/__pycache__/generate_market_visuals.cpython-312.pyc
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|