feat: Provider model_settings 全链路 + 监管节点工具集 + 重型插件注入 + 前端打磨
- Provider model_settings (Provider+Model 级别参数配置): DB JSONB → API → GSM → AgentFactory.resolve → 三节点 agent.run 注入 - 新增 data/toolset/regulatory_toolset/: 监管节点专属工具(query_workflow_status / query_task_list / send_file) - send_file 从 interactive_toolset 迁移至 regulatory_toolset,interactive 仅保留 approval - mcp_helper 合入 GlobalPluginManager dispatch tools - 前端 Provider 弹窗参数设置区加 JSON 编辑器(model_settings) - 前端 Plugin 页面新增"重型插件"Tab(HeavyPluginList 占位) - .gitignore 精简:去除系统默认项,修复 data/ 子目录追踪 - data/toolset/ 与 data/plugin/ 首次纳入版本控制 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ from pathlib import Path
|
||||
_toolset_dir = Path(__file__).parent.parent.parent / "data" / "toolset"
|
||||
_base_toolset_dir = _toolset_dir / "base_toolset"
|
||||
_interactive_toolset_dir = _toolset_dir / "interactive_toolset"
|
||||
_regulatory_toolset_dir = _toolset_dir / "regulatory_toolset"
|
||||
|
||||
|
||||
def _read_manifest(toolset_dir=_base_toolset_dir):
|
||||
@@ -26,6 +27,7 @@ def _get_tool_def(manifest, name):
|
||||
def test_manifest_json_exists():
|
||||
assert (_base_toolset_dir / "manifest.json").exists()
|
||||
assert (_interactive_toolset_dir / "manifest.json").exists()
|
||||
assert (_regulatory_toolset_dir / "manifest.json").exists()
|
||||
|
||||
|
||||
def test_manifest_has_all_tools():
|
||||
@@ -33,11 +35,13 @@ def test_manifest_has_all_tools():
|
||||
interactive_names = {
|
||||
t["name"] for t in _read_manifest(_interactive_toolset_dir)["tools"]
|
||||
}
|
||||
regulatory_names = {t["name"] for t in _read_manifest(_regulatory_toolset_dir)["tools"]}
|
||||
assert base_names == {
|
||||
"shell_executor", "file_reader", "edit_file", "write_file",
|
||||
"search_file", "python_executor", "tavily_search",
|
||||
}
|
||||
assert interactive_names == {"approval", "send_file"}
|
||||
assert interactive_names == {"approval"}
|
||||
assert regulatory_names == {"query_workflow_status", "query_task_list", "send_file"}
|
||||
|
||||
|
||||
def test_approval_metadata():
|
||||
@@ -48,6 +52,15 @@ def test_approval_metadata():
|
||||
assert tool["action_scope"] == []
|
||||
|
||||
|
||||
def test_regulatory_toolset_scope():
|
||||
manifest = _read_manifest(_regulatory_toolset_dir)
|
||||
for name in ("query_workflow_status", "query_task_list", "send_file"):
|
||||
tool = _get_tool_def(manifest, name)
|
||||
assert tool is not None
|
||||
assert tool["is_system"] is True
|
||||
assert tool["action_scope"] == ["regulatory_node"]
|
||||
|
||||
|
||||
def test_tavily_search_metadata():
|
||||
manifest = _read_manifest()
|
||||
tool = _get_tool_def(manifest, "tavily_search")
|
||||
@@ -59,7 +72,7 @@ def test_tavily_search_metadata():
|
||||
|
||||
|
||||
def test_all_tool_files_exist():
|
||||
for toolset_dir in (_base_toolset_dir, _interactive_toolset_dir):
|
||||
for toolset_dir in (_base_toolset_dir, _interactive_toolset_dir, _regulatory_toolset_dir):
|
||||
manifest = _read_manifest(toolset_dir)
|
||||
for tool in manifest["tools"]:
|
||||
file_path = toolset_dir / tool["file"]
|
||||
@@ -70,10 +83,14 @@ def test_tool_manager_loads_all_tools():
|
||||
from kilostar.core.global_state_machine.tool_manager import GlobalToolManager
|
||||
|
||||
tm = GlobalToolManager()
|
||||
assert len(tm.tool_metadata) == 9
|
||||
# base_toolset(7) + interactive_toolset(1) + regulatory_toolset(3) = 11
|
||||
assert len(tm.tool_metadata) == 11
|
||||
assert "shell_executor" in tm.tool_metadata
|
||||
assert "tavily_search" in tm.tool_metadata
|
||||
assert "approval" in tm.tool_metadata
|
||||
assert "query_workflow_status" in tm.tool_metadata
|
||||
assert "query_task_list" in tm.tool_metadata
|
||||
assert "send_file" in tm.tool_metadata
|
||||
|
||||
|
||||
def test_tool_manager_system_vs_third_party():
|
||||
|
||||
Reference in New Issue
Block a user