mindstudio-agent 0.0.1__tar.gz
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.
- mindstudio_agent-0.0.1/.gitignore +54 -0
- mindstudio_agent-0.0.1/.gitmodules +3 -0
- mindstudio_agent-0.0.1/.python-version +1 -0
- mindstudio_agent-0.0.1/PKG-INFO +635 -0
- mindstudio_agent-0.0.1/README.md +590 -0
- mindstudio_agent-0.0.1/config.json +25 -0
- mindstudio_agent-0.0.1/pyproject.toml +105 -0
- mindstudio_agent-0.0.1/resources/__init__.py +0 -0
- mindstudio_agent-0.0.1/resources/configs/default/README.md +12 -0
- mindstudio_agent-0.0.1/resources/configs/default/agents/msagent.yml +28 -0
- mindstudio_agent-0.0.1/resources/configs/default/checkpointers/memory.yml +3 -0
- mindstudio_agent-0.0.1/resources/configs/default/checkpointers/sqlite.yml +3 -0
- mindstudio_agent-0.0.1/resources/configs/default/config.approval.json +30 -0
- mindstudio_agent-0.0.1/resources/configs/default/config.llms.yml +10 -0
- mindstudio_agent-0.0.1/resources/configs/default/config.mcp.json +14 -0
- mindstudio_agent-0.0.1/resources/configs/default/llms/anthropic.yml +50 -0
- mindstudio_agent-0.0.1/resources/configs/default/llms/bedrock.yml +66 -0
- mindstudio_agent-0.0.1/resources/configs/default/llms/deepseek.yml +9 -0
- mindstudio_agent-0.0.1/resources/configs/default/llms/google.yml +32 -0
- mindstudio_agent-0.0.1/resources/configs/default/llms/lmstudio.yml +26 -0
- mindstudio_agent-0.0.1/resources/configs/default/llms/ollama.yml +26 -0
- mindstudio_agent-0.0.1/resources/configs/default/llms/openai.yml +12 -0
- mindstudio_agent-0.0.1/resources/configs/default/llms/zhipuai.yml +21 -0
- mindstudio_agent-0.0.1/resources/configs/default/prompts/agents/msagent.md +96 -0
- mindstudio_agent-0.0.1/resources/configs/default/prompts/prefixes/notes.md +3 -0
- mindstudio_agent-0.0.1/resources/configs/default/prompts/shared/code_compression.md +158 -0
- mindstudio_agent-0.0.1/resources/configs/default/prompts/shared/general_compression.md +20 -0
- mindstudio_agent-0.0.1/resources/configs/default/prompts/subagents/explorer.md +43 -0
- mindstudio_agent-0.0.1/resources/configs/default/prompts/subagents/general-purpose.md +52 -0
- mindstudio_agent-0.0.1/resources/configs/default/prompts/suffixes/environments.md +7 -0
- mindstudio_agent-0.0.1/resources/configs/default/sandboxes/ro-offline-linux.yml +97 -0
- mindstudio_agent-0.0.1/resources/configs/default/sandboxes/ro-offline-macos.yml +91 -0
- mindstudio_agent-0.0.1/resources/configs/default/sandboxes/ro-online-linux.yml +98 -0
- mindstudio_agent-0.0.1/resources/configs/default/sandboxes/ro-online-macos.yml +95 -0
- mindstudio_agent-0.0.1/resources/configs/default/sandboxes/rw-offline-linux.yml +97 -0
- mindstudio_agent-0.0.1/resources/configs/default/sandboxes/rw-offline-macos.yml +91 -0
- mindstudio_agent-0.0.1/resources/configs/default/sandboxes/rw-online-linux.yml +98 -0
- mindstudio_agent-0.0.1/resources/configs/default/sandboxes/rw-online-macos.yml +95 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/.git +1 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/README.md +109 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/ascend-profiler-db-explorer/SKILL.md +183 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/ascend-profiler-db-explorer/references/profiler_db_data_format.md +983 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/ascend-profiler-db-explorer/scripts/get_schema.py +273 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/cluster-fast-slow-rank-detector/SKILL.md +59 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/cluster-fast-slow-rank-detector/scripts/compare_api_stats.py +198 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/cluster-fast-slow-rank-detector/scripts/compare_op_stats.py +203 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/cluster-fast-slow-rank-detector/scripts/rank_data_finder.py +152 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/github-raw-fetch/SKILL.md +233 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/mindstudio_profiler_data_check/SKILL.md +88 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/mindstudio_profiler_data_check/scripts/offline_parse_mindspore.py +52 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/mindstudio_profiler_data_check/scripts/offline_parse_pytorch.py +52 -0
- mindstudio_agent-0.0.1/resources/configs/default/skills/op-mfu-calculator/SKILL.md +209 -0
- mindstudio_agent-0.0.1/resources/configs/default/subagents/explorer.yml +16 -0
- mindstudio_agent-0.0.1/resources/configs/default/subagents/general-purpose.yml +14 -0
- mindstudio_agent-0.0.1/run.py +13 -0
- mindstudio_agent-0.0.1/scripts/build_whl.sh +193 -0
- mindstudio_agent-0.0.1/src/msagent/__init__.py +3 -0
- mindstudio_agent-0.0.1/src/msagent/agents/__init__.py +10 -0
- mindstudio_agent-0.0.1/src/msagent/agents/context.py +36 -0
- mindstudio_agent-0.0.1/src/msagent/agents/deep_agent.py +56 -0
- mindstudio_agent-0.0.1/src/msagent/agents/factory.py +524 -0
- mindstudio_agent-0.0.1/src/msagent/agents/react_agent.py +94 -0
- mindstudio_agent-0.0.1/src/msagent/agents/state.py +43 -0
- mindstudio_agent-0.0.1/src/msagent/checkpointer/__init__.py +7 -0
- mindstudio_agent-0.0.1/src/msagent/checkpointer/base.py +54 -0
- mindstudio_agent-0.0.1/src/msagent/checkpointer/factory.py +33 -0
- mindstudio_agent-0.0.1/src/msagent/checkpointer/impl/__init__.py +1 -0
- mindstudio_agent-0.0.1/src/msagent/checkpointer/impl/memory.py +175 -0
- mindstudio_agent-0.0.1/src/msagent/checkpointer/impl/sqlite.py +373 -0
- mindstudio_agent-0.0.1/src/msagent/cli/__init__.py +3 -0
- mindstudio_agent-0.0.1/src/msagent/cli/bootstrap/__init__.py +0 -0
- mindstudio_agent-0.0.1/src/msagent/cli/bootstrap/app.py +58 -0
- mindstudio_agent-0.0.1/src/msagent/cli/bootstrap/chat.py +57 -0
- mindstudio_agent-0.0.1/src/msagent/cli/bootstrap/initializer.py +320 -0
- mindstudio_agent-0.0.1/src/msagent/cli/bootstrap/legacy.py +297 -0
- mindstudio_agent-0.0.1/src/msagent/cli/bootstrap/server.py +383 -0
- mindstudio_agent-0.0.1/src/msagent/cli/bootstrap/timer.py +39 -0
- mindstudio_agent-0.0.1/src/msagent/cli/bootstrap/webapp.py +59 -0
- mindstudio_agent-0.0.1/src/msagent/cli/builders/__init__.py +5 -0
- mindstudio_agent-0.0.1/src/msagent/cli/builders/message.py +109 -0
- mindstudio_agent-0.0.1/src/msagent/cli/completers/__init__.py +7 -0
- mindstudio_agent-0.0.1/src/msagent/cli/completers/reference.py +101 -0
- mindstudio_agent-0.0.1/src/msagent/cli/completers/router.py +47 -0
- mindstudio_agent-0.0.1/src/msagent/cli/completers/slash.py +26 -0
- mindstudio_agent-0.0.1/src/msagent/cli/core/__init__.py +0 -0
- mindstudio_agent-0.0.1/src/msagent/cli/core/context.py +129 -0
- mindstudio_agent-0.0.1/src/msagent/cli/core/session.py +294 -0
- mindstudio_agent-0.0.1/src/msagent/cli/dispatchers/__init__.py +6 -0
- mindstudio_agent-0.0.1/src/msagent/cli/dispatchers/commands.py +181 -0
- mindstudio_agent-0.0.1/src/msagent/cli/dispatchers/messages.py +553 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/__init__.py +31 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/agents.py +196 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/approve.py +263 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/bash.py +50 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/compress.py +129 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/graph.py +122 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/interrupts.py +192 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/mcp.py +183 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/memory.py +49 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/models.py +446 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/replay.py +275 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/resume.py +287 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/skills.py +179 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/todo.py +57 -0
- mindstudio_agent-0.0.1/src/msagent/cli/handlers/tools.py +215 -0
- mindstudio_agent-0.0.1/src/msagent/cli/resolvers/__init__.py +7 -0
- mindstudio_agent-0.0.1/src/msagent/cli/resolvers/base.py +40 -0
- mindstudio_agent-0.0.1/src/msagent/cli/resolvers/file.py +134 -0
- mindstudio_agent-0.0.1/src/msagent/cli/resolvers/image.py +178 -0
- mindstudio_agent-0.0.1/src/msagent/cli/theme/__init__.py +21 -0
- mindstudio_agent-0.0.1/src/msagent/cli/theme/base.py +138 -0
- mindstudio_agent-0.0.1/src/msagent/cli/theme/console.py +44 -0
- mindstudio_agent-0.0.1/src/msagent/cli/theme/detect.py +198 -0
- mindstudio_agent-0.0.1/src/msagent/cli/theme/registry.py +52 -0
- mindstudio_agent-0.0.1/src/msagent/cli/theme/tokyo_day.py +177 -0
- mindstudio_agent-0.0.1/src/msagent/cli/theme/tokyo_night.py +177 -0
- mindstudio_agent-0.0.1/src/msagent/cli/ui/__init__.py +0 -0
- mindstudio_agent-0.0.1/src/msagent/cli/ui/markdown.py +123 -0
- mindstudio_agent-0.0.1/src/msagent/cli/ui/prompt.py +272 -0
- mindstudio_agent-0.0.1/src/msagent/cli/ui/renderer.py +608 -0
- mindstudio_agent-0.0.1/src/msagent/cli/ui/shared.py +190 -0
- mindstudio_agent-0.0.1/src/msagent/configs/__init__.py +74 -0
- mindstudio_agent-0.0.1/src/msagent/configs/agent.py +559 -0
- mindstudio_agent-0.0.1/src/msagent/configs/approval.py +105 -0
- mindstudio_agent-0.0.1/src/msagent/configs/base.py +17 -0
- mindstudio_agent-0.0.1/src/msagent/configs/checkpointer.py +75 -0
- mindstudio_agent-0.0.1/src/msagent/configs/llm.py +121 -0
- mindstudio_agent-0.0.1/src/msagent/configs/mcp.py +132 -0
- mindstudio_agent-0.0.1/src/msagent/configs/registry.py +387 -0
- mindstudio_agent-0.0.1/src/msagent/configs/sandbox.py +154 -0
- mindstudio_agent-0.0.1/src/msagent/configs/utils.py +183 -0
- mindstudio_agent-0.0.1/src/msagent/core/__init__.py +0 -0
- mindstudio_agent-0.0.1/src/msagent/core/constants.py +43 -0
- mindstudio_agent-0.0.1/src/msagent/core/logging.py +119 -0
- mindstudio_agent-0.0.1/src/msagent/core/settings.py +151 -0
- mindstudio_agent-0.0.1/src/msagent/llms/__init__.py +0 -0
- mindstudio_agent-0.0.1/src/msagent/llms/factory.py +318 -0
- mindstudio_agent-0.0.1/src/msagent/llms/wrappers/__init__.py +0 -0
- mindstudio_agent-0.0.1/src/msagent/llms/wrappers/zhipuai.py +261 -0
- mindstudio_agent-0.0.1/src/msagent/mcp/__init__.py +7 -0
- mindstudio_agent-0.0.1/src/msagent/mcp/cache.py +90 -0
- mindstudio_agent-0.0.1/src/msagent/mcp/client.py +217 -0
- mindstudio_agent-0.0.1/src/msagent/mcp/factory.py +244 -0
- mindstudio_agent-0.0.1/src/msagent/mcp/loader.py +75 -0
- mindstudio_agent-0.0.1/src/msagent/mcp/oauth/__init__.py +11 -0
- mindstudio_agent-0.0.1/src/msagent/mcp/oauth/callback.py +201 -0
- mindstudio_agent-0.0.1/src/msagent/mcp/oauth/provider.py +87 -0
- mindstudio_agent-0.0.1/src/msagent/mcp/oauth/storage.py +82 -0
- mindstudio_agent-0.0.1/src/msagent/mcp/registry.py +46 -0
- mindstudio_agent-0.0.1/src/msagent/mcp/session.py +112 -0
- mindstudio_agent-0.0.1/src/msagent/mcp/tool.py +117 -0
- mindstudio_agent-0.0.1/src/msagent/middlewares/__init__.py +22 -0
- mindstudio_agent-0.0.1/src/msagent/middlewares/approval.py +393 -0
- mindstudio_agent-0.0.1/src/msagent/middlewares/compress_tool_output.py +125 -0
- mindstudio_agent-0.0.1/src/msagent/middlewares/dynamic_prompt.py +24 -0
- mindstudio_agent-0.0.1/src/msagent/middlewares/pending_tool_result.py +111 -0
- mindstudio_agent-0.0.1/src/msagent/middlewares/return_direct.py +39 -0
- mindstudio_agent-0.0.1/src/msagent/middlewares/sandbox.py +142 -0
- mindstudio_agent-0.0.1/src/msagent/middlewares/token_cost.py +173 -0
- mindstudio_agent-0.0.1/src/msagent/py.typed +1 -0
- mindstudio_agent-0.0.1/src/msagent/sandboxes/__init__.py +12 -0
- mindstudio_agent-0.0.1/src/msagent/sandboxes/backends/__init__.py +7 -0
- mindstudio_agent-0.0.1/src/msagent/sandboxes/backends/base.py +274 -0
- mindstudio_agent-0.0.1/src/msagent/sandboxes/backends/bubblewrap.py +209 -0
- mindstudio_agent-0.0.1/src/msagent/sandboxes/backends/seatbelt.py +242 -0
- mindstudio_agent-0.0.1/src/msagent/sandboxes/cache.py +39 -0
- mindstudio_agent-0.0.1/src/msagent/sandboxes/constants.py +99 -0
- mindstudio_agent-0.0.1/src/msagent/sandboxes/factory.py +67 -0
- mindstudio_agent-0.0.1/src/msagent/sandboxes/serialization.py +63 -0
- mindstudio_agent-0.0.1/src/msagent/sandboxes/worker.py +102 -0
- mindstudio_agent-0.0.1/src/msagent/skills/__init__.py +0 -0
- mindstudio_agent-0.0.1/src/msagent/skills/factory.py +183 -0
- mindstudio_agent-0.0.1/src/msagent/tools/__init__.py +3 -0
- mindstudio_agent-0.0.1/src/msagent/tools/catalog/__init__.py +4 -0
- mindstudio_agent-0.0.1/src/msagent/tools/catalog/skills.py +172 -0
- mindstudio_agent-0.0.1/src/msagent/tools/catalog/tools.py +159 -0
- mindstudio_agent-0.0.1/src/msagent/tools/factory.py +63 -0
- mindstudio_agent-0.0.1/src/msagent/tools/impl/__init__.py +0 -0
- mindstudio_agent-0.0.1/src/msagent/tools/impl/file_system.py +602 -0
- mindstudio_agent-0.0.1/src/msagent/tools/impl/grep_search.py +315 -0
- mindstudio_agent-0.0.1/src/msagent/tools/impl/terminal.py +146 -0
- mindstudio_agent-0.0.1/src/msagent/tools/impl/web.py +76 -0
- mindstudio_agent-0.0.1/src/msagent/tools/internal/__init__.py +0 -0
- mindstudio_agent-0.0.1/src/msagent/tools/internal/memory.py +232 -0
- mindstudio_agent-0.0.1/src/msagent/tools/internal/todo.py +143 -0
- mindstudio_agent-0.0.1/src/msagent/tools/schema.py +30 -0
- mindstudio_agent-0.0.1/src/msagent/tools/subagents/__init__.py +0 -0
- mindstudio_agent-0.0.1/src/msagent/tools/subagents/task.py +175 -0
- mindstudio_agent-0.0.1/src/msagent/utils/__init__.py +0 -0
- mindstudio_agent-0.0.1/src/msagent/utils/bash.py +28 -0
- mindstudio_agent-0.0.1/src/msagent/utils/compression.py +174 -0
- mindstudio_agent-0.0.1/src/msagent/utils/cost.py +33 -0
- mindstudio_agent-0.0.1/src/msagent/utils/file.py +15 -0
- mindstudio_agent-0.0.1/src/msagent/utils/image.py +99 -0
- mindstudio_agent-0.0.1/src/msagent/utils/matching.py +132 -0
- mindstudio_agent-0.0.1/src/msagent/utils/path.py +152 -0
- mindstudio_agent-0.0.1/src/msagent/utils/patterns.py +84 -0
- mindstudio_agent-0.0.1/src/msagent/utils/rate_limiter.py +275 -0
- mindstudio_agent-0.0.1/src/msagent/utils/render.py +365 -0
- mindstudio_agent-0.0.1/src/msagent/utils/time.py +82 -0
- mindstudio_agent-0.0.1/src/msagent/utils/validators.py +135 -0
- mindstudio_agent-0.0.1/src/msagent/utils/version.py +96 -0
- mindstudio_agent-0.0.1/tests/test_bottom_toolbar.py +30 -0
- mindstudio_agent-0.0.1/tests/test_catalog_interfaces.py +205 -0
- mindstudio_agent-0.0.1/tests/test_checkpointer_factory.py +41 -0
- mindstudio_agent-0.0.1/tests/test_cli_bootstrap.py +35 -0
- mindstudio_agent-0.0.1/tests/test_cli_fastapi_integration.py +332 -0
- mindstudio_agent-0.0.1/tests/test_config_registry.py +148 -0
- mindstudio_agent-0.0.1/tests/test_context.py +42 -0
- mindstudio_agent-0.0.1/tests/test_legacy_defaults.py +90 -0
- mindstudio_agent-0.0.1/tests/test_package_imports.py +18 -0
- mindstudio_agent-0.0.1/tests/test_prompt_usage.py +59 -0
- mindstudio_agent-0.0.1/tests/test_renderer_welcome.py +73 -0
- mindstudio_agent-0.0.1/tests/test_server_interfaces.py +237 -0
- mindstudio_agent-0.0.1/tests/test_skill_script_guidance.py +46 -0
- mindstudio_agent-0.0.1/tests/test_skills_handler.py +33 -0
- mindstudio_agent-0.0.1/tests/test_token_cost_middleware.py +108 -0
- mindstudio_agent-0.0.1/tests/test_tool_compat.py +53 -0
- mindstudio_agent-0.0.1/tests/test_utf8_config_io.py +122 -0
- mindstudio_agent-0.0.1/uv.lock +4487 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
.env
|
|
25
|
+
.venv
|
|
26
|
+
env/
|
|
27
|
+
venv/
|
|
28
|
+
ENV/
|
|
29
|
+
|
|
30
|
+
# IDE
|
|
31
|
+
.idea/
|
|
32
|
+
.vscode/
|
|
33
|
+
*.swp
|
|
34
|
+
*.swo
|
|
35
|
+
*~
|
|
36
|
+
|
|
37
|
+
# Testing
|
|
38
|
+
.pytest_cache/
|
|
39
|
+
.coverage
|
|
40
|
+
htmlcov/
|
|
41
|
+
|
|
42
|
+
# MyPy
|
|
43
|
+
.mypy_cache/
|
|
44
|
+
.dmypy.json
|
|
45
|
+
dmypy.json
|
|
46
|
+
|
|
47
|
+
# Ruff
|
|
48
|
+
.ruff_cache/
|
|
49
|
+
|
|
50
|
+
# Project specific
|
|
51
|
+
*.log
|
|
52
|
+
config.local.json
|
|
53
|
+
|
|
54
|
+
test_data/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mindstudio-agent
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: msAgent CLI aligned to the langrepl architecture
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Requires-Dist: aiofiles~=25.1.0
|
|
7
|
+
Requires-Dist: aiosqlite~=0.22.1
|
|
8
|
+
Requires-Dist: fastapi>=0.128.0
|
|
9
|
+
Requires-Dist: greenlet~=3.3.0
|
|
10
|
+
Requires-Dist: httpx<1.0.0,>=0.28.0
|
|
11
|
+
Requires-Dist: json-repair<0.59.0,>=0.54.3
|
|
12
|
+
Requires-Dist: jsonschema<4.27.0,>=4.25.1
|
|
13
|
+
Requires-Dist: langchain-anthropic~=1.3.0
|
|
14
|
+
Requires-Dist: langchain-aws<1.4.0,>=1.1.1
|
|
15
|
+
Requires-Dist: langchain-community~=0.4.1
|
|
16
|
+
Requires-Dist: langchain-core~=1.2.4
|
|
17
|
+
Requires-Dist: langchain-deepseek~=1.0.1
|
|
18
|
+
Requires-Dist: langchain-google-genai<4.3.0,>=4.1.2
|
|
19
|
+
Requires-Dist: langchain-mcp-adapters~=0.2.1
|
|
20
|
+
Requires-Dist: langchain-ollama~=1.0.1
|
|
21
|
+
Requires-Dist: langchain-openai~=1.1.6
|
|
22
|
+
Requires-Dist: langchain~=1.2.0
|
|
23
|
+
Requires-Dist: langgraph-checkpoint-sqlite~=3.0.1
|
|
24
|
+
Requires-Dist: langgraph-cli[inmem]~=0.4.11
|
|
25
|
+
Requires-Dist: langgraph-prebuilt~=1.0.5
|
|
26
|
+
Requires-Dist: langgraph~=1.0.5
|
|
27
|
+
Requires-Dist: markdown-it-py~=4.0.0
|
|
28
|
+
Requires-Dist: mcp<2.0.0,>=1.13.0
|
|
29
|
+
Requires-Dist: mdformat~=1.0.0
|
|
30
|
+
Requires-Dist: msprof-mcp==0.1.4
|
|
31
|
+
Requires-Dist: packaging<26.0,>=24.0
|
|
32
|
+
Requires-Dist: pathspec<1.1.0,>=0.12.1
|
|
33
|
+
Requires-Dist: prompt-toolkit~=3.0.52
|
|
34
|
+
Requires-Dist: pydantic-settings<2.14,>=2.12
|
|
35
|
+
Requires-Dist: pydantic~=2.12.5
|
|
36
|
+
Requires-Dist: pygments-cache~=0.1.3
|
|
37
|
+
Requires-Dist: pyseccomp~=0.1.2; sys_platform == 'linux'
|
|
38
|
+
Requires-Dist: python-dotenv~=1.2.1
|
|
39
|
+
Requires-Dist: python-multipart~=0.0.21
|
|
40
|
+
Requires-Dist: pyyaml~=6.0.3
|
|
41
|
+
Requires-Dist: rich<14.4,>=14.2
|
|
42
|
+
Requires-Dist: tiktoken<1.0.0,>=0.9.0
|
|
43
|
+
Requires-Dist: trafilatura~=2.0.0
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
<h1 align="center">🚀 msAgent</h1>
|
|
47
|
+
|
|
48
|
+
<p align="center"><strong>面向 Ascend NPU 场景的性能问题定位助手</strong></p>
|
|
49
|
+
|
|
50
|
+
**msAgent** 聚焦“发现瓶颈 -> 定位根因 -> 给出建议”的分析闭环。
|
|
51
|
+
它结合 LLM 推理能力与可扩展工具链,帮助你把复杂 Profiling 信息快速转化为可执行的优化决策。
|
|
52
|
+
|
|
53
|
+
<p align="center">
|
|
54
|
+
<img src="https://github.com/luelueFLY/images/blob/main/img/agent-gif-05.gif" alt="msAgent">
|
|
55
|
+
</p>
|
|
56
|
+
|
|
57
|
+
📌 文档导航:[最新消息](#最新消息) | [版本说明](#版本说明) | [使用效果展示](#使用效果展示)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## 最新消息
|
|
61
|
+
|
|
62
|
+
- 2026-03-11:v0.1 PyPi whl包待发布
|
|
63
|
+
|
|
64
|
+
## 🔍 支持的分析场景与扩展能力
|
|
65
|
+
|
|
66
|
+
- ⚙️ 单卡性能问题:高耗时算子、计算热点、重叠度不足等
|
|
67
|
+
- 🔗 多卡性能问题:快慢卡差异、通信效率瓶颈、同步等待等
|
|
68
|
+
- ⏱️ 下发与调度问题:下发延迟、CPU 侧调度阻塞等
|
|
69
|
+
- 🧩 集群性能问题:慢节点识别与从全局到单机的逐层定位
|
|
70
|
+
- 🔌 MCP 扩展:基于 Model Context Protocol 接入工具(默认随 wheel 安装启用 `msprof-mcp==0.1.4`)
|
|
71
|
+
- 🧠 Skills 扩展:自动加载 `<working-dir>/skills` 与内置 Skills;源码仓库中的内置 Skills 由 `resources/configs/default/skills/` 下的 `mindstudio-skills` 子模块提供,复用领域分析流程和知识(仓库:[mindstudio-skills](https://github.com/kali20gakki/mindstudio-skills))
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## ⚡ 快速上手
|
|
75
|
+
|
|
76
|
+
### 1) 🧰 准备环境
|
|
77
|
+
|
|
78
|
+
- Python `3.11+`
|
|
79
|
+
- 推荐使用 `uv`
|
|
80
|
+
- 至少准备一个可用的 LLM API Key
|
|
81
|
+
|
|
82
|
+
说明:
|
|
83
|
+
- 下文中的 `msagent` 适用于已安装命令行入口的场景。
|
|
84
|
+
- 如果你是源码运行(`git clone` + `uv sync`),请把示例里的 `msagent` 替换成 `uv run msagent`。
|
|
85
|
+
- Windows 示例默认使用 CMD;若使用 PowerShell,请把 `set KEY=value` 改为 `$env:KEY = "value"`。
|
|
86
|
+
|
|
87
|
+
### 2) 📦 安装
|
|
88
|
+
|
|
89
|
+
源码运行方式:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git clone --recurse-submodules https://github.com/kali20gakki/msAgent.git
|
|
93
|
+
cd msAgent
|
|
94
|
+
git submodule sync --recursive
|
|
95
|
+
# 如果要同步 mindstudio-skills 上游最新版本,再执行下一行
|
|
96
|
+
git submodule update --init --recursive --remote resources/configs/default/skills
|
|
97
|
+
uv sync
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
说明:
|
|
101
|
+
|
|
102
|
+
- `git clone --recurse-submodules` 会拉取主仓库当前记录的 Skills 版本。
|
|
103
|
+
- 如果你只需要初始化到主仓库锁定的 Skills 版本,可执行:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
git submodule update --init --recursive resources/configs/default/skills
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
- 如果你想同步 `mindstudio-skills` 仓库的最新提交,请执行:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
git submodule sync --recursive
|
|
113
|
+
git submodule update --init --recursive --remote resources/configs/default/skills
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
如果你已经拿到 wheel 或已经发布到包源,也可以直接安装:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pip install -U mindstudio-agent
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
检查版本:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
msagent --version
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 3) 🔐 配置默认 LLM
|
|
129
|
+
|
|
130
|
+
当前 `config` 子命令直接支持的 Provider 是:`openai`、`anthropic`、`gemini`、`google`、`custom`。
|
|
131
|
+
|
|
132
|
+
OpenAI 示例:
|
|
133
|
+
|
|
134
|
+
Linux / macOS:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
export OPENAI_API_KEY="your-key"
|
|
138
|
+
msagent config --llm-provider openai --llm-model "gpt-5-mini-2025-08-07"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Windows(CMD):
|
|
142
|
+
|
|
143
|
+
```cmd
|
|
144
|
+
set OPENAI_API_KEY=your-key
|
|
145
|
+
msagent config --llm-provider openai --llm-model "gpt-5-mini-2025-08-07"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
查看当前项目配置:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
msagent config --show
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 4) 🖥️ 启动会话
|
|
155
|
+
|
|
156
|
+
进入交互式会话:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
msagent
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
### 5) 📊 与 msAgent 一起性能调优
|
|
164
|
+
|
|
165
|
+
把 Profiling 目录路径和问题一起发给 msAgent,例如:
|
|
166
|
+
|
|
167
|
+
Linux / macOS:
|
|
168
|
+
|
|
169
|
+
```text
|
|
170
|
+
请分析 /path/to/profiler_output 的性能瓶颈,重点关注通信效率、重叠度和高耗时算子。
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Windows:
|
|
174
|
+
|
|
175
|
+
```text
|
|
176
|
+
请分析 C:\path\to\profiler_output 的性能瓶颈,重点关注通信效率、重叠度和高耗时算子。
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 使用效果展示
|
|
182
|
+
|
|
183
|
+
| 场景 | 效果展示 |
|
|
184
|
+
|--------|---|
|
|
185
|
+
| MFU 计算 | <img src="https://github.com/luelueFLY/images/blob/main/img/op-mfu-calculate.png" alt="MFU 计算示例" width="800"> |
|
|
186
|
+
| 快慢卡诊断 | <img src="https://github.com/luelueFLY/images/blob/main/img/slow-rank-detect.png" alt="快慢卡诊断示例" width="800"> |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
## 📚 常用命令
|
|
193
|
+
|
|
194
|
+
| 命令 | 说明 |
|
|
195
|
+
|---|---|
|
|
196
|
+
| `msagent` | 启动交互式会话 |
|
|
197
|
+
| `msagent "..."` | 发送单条消息并输出结果 |
|
|
198
|
+
| `msagent -r` | 恢复当前工作目录最近一次线程 |
|
|
199
|
+
| `msagent -m gemini-2.5-pro` | 以指定模型别名启动当前会话 |
|
|
200
|
+
| `msagent -a code-reviewer` | 以指定 Agent 启动当前会话 |
|
|
201
|
+
| `msagent --no-stream "..."` | 关闭流式输出 |
|
|
202
|
+
| `msagent config --show` | 查看当前项目配置 |
|
|
203
|
+
| `msagent config --llm-provider openai --llm-model "gpt-5-mini-2025-08-07"` | 把默认模型写入当前项目配置 |
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## 🗂️ 完整命令参考
|
|
208
|
+
|
|
209
|
+
### 默认会话入口
|
|
210
|
+
|
|
211
|
+
当前 CLI 的“默认命令”就是聊天会话本身。也就是说,直接执行 `msagent` 会进入会话模式,根级 `--help` 只会显示显式暴露的 `config` 子命令。
|
|
212
|
+
|
|
213
|
+
会话入口实际支持的参数如下:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
msagent [message] [--stream | --no-stream] [-w DIR] [-a AGENT] [-m MODEL_ALIAS] [-r] [--timer] [-am {semi-active,active,aggressive}] [-v]
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
| 参数 | 说明 |
|
|
220
|
+
|---|---|
|
|
221
|
+
| `message` | 可选位置参数;省略时进入交互式会话,传入时执行单轮请求 |
|
|
222
|
+
| `-w`, `--working-dir` | 指定工作目录;`msAgent` 会从该目录下的 `.msagent/` 读取或初始化配置 |
|
|
223
|
+
| `-a`, `--agent` | 指定 Agent 名称,例如 `general`、`code-reviewer` |
|
|
224
|
+
| `-m`, `--model` | 指定模型别名,而不是 Provider 原始模型名;别名来自 `.msagent/config.llms.yml` 和 `.msagent/llms/*.yml` |
|
|
225
|
+
| `-r`, `--resume` | 恢复最近一个线程;若同时传入 `message`,会在恢复后的线程上继续执行 |
|
|
226
|
+
| `--stream` | 流式输出回答,默认开启 |
|
|
227
|
+
| `--no-stream` | 关闭流式输出,等待完整回答后再输出 |
|
|
228
|
+
| `--timer` | 打印启动阶段耗时,便于排查初始化慢的问题 |
|
|
229
|
+
| `-am`, `--approval-mode` | 工具审批模式,可选 `semi-active`、`active`、`aggressive` |
|
|
230
|
+
| `-v`, `--verbose` | 开启控制台和 `.msagent/logs/app.log` 调试日志输出 |
|
|
231
|
+
|
|
232
|
+
审批模式说明:
|
|
233
|
+
|
|
234
|
+
| 模式 | 说明 |
|
|
235
|
+
|---|---|
|
|
236
|
+
| `semi-active` | 正常遵循审批规则 |
|
|
237
|
+
| `active` | 默认模式;跳过绝大多数审批,仅保留 `always_deny` |
|
|
238
|
+
| `aggressive` | 跳过所有审批规则 |
|
|
239
|
+
|
|
240
|
+
示例:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
msagent -m gemini-2.5-pro
|
|
244
|
+
msagent -a code-reviewer
|
|
245
|
+
msagent -r "继续上一次分析,补充通信瓶颈优化建议"
|
|
246
|
+
msagent --no-stream "总结这个 Profiling 的主要瓶颈"
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### `config` 子命令
|
|
250
|
+
|
|
251
|
+
`config` 用于查看和更新当前项目的默认模型配置:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
msagent config [--show] [--llm-provider PROVIDER] [--llm-api-key KEY] [--llm-api-key-env ENV] [--llm-max-tokens N] [--llm-base-url URL] [--llm-model MODEL] [-w DIR] [-v]
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
| 参数 | 说明 |
|
|
258
|
+
|---|---|
|
|
259
|
+
| `--show`, `-s` | 显示当前项目配置;如果未传任何更新参数,也会自动执行展示 |
|
|
260
|
+
| `--llm-provider` | 只接受 `openai`、`anthropic`、`gemini`、`google`、`custom` |
|
|
261
|
+
| `--llm-model`, `-m` | 设置默认 Provider 对应的原始模型名,例如 `gpt-5-mini-2025-08-07` |
|
|
262
|
+
| `--llm-base-url` | 设置 OpenAI 兼容接口地址 |
|
|
263
|
+
| `--llm-max-tokens` | 设置最大输出 token;`0` 表示交给模型或服务端默认值 |
|
|
264
|
+
| `--llm-api-key-env` | 设置读取 API Key 的环境变量名 |
|
|
265
|
+
| `--llm-api-key` | 只给当前进程临时注入 API Key,不会明文写入配置文件 |
|
|
266
|
+
| `-w`, `--working-dir` | 指定要修改的项目目录 |
|
|
267
|
+
| `-v`, `--verbose` | 输出更详细日志 |
|
|
268
|
+
|
|
269
|
+
补充说明:
|
|
270
|
+
|
|
271
|
+
- `gemini` 会被映射到内部 Provider `google`,默认读取的环境变量是 `GOOGLE_API_KEY`。
|
|
272
|
+
- `config` 会把结果写入 `<working-dir>/.msagent/config.llms.yml`,并让默认 Agent 指向其中的 `default` 模型别名。
|
|
273
|
+
- 仓库里还内置了 `deepseek`、`zhipuai`、`ollama`、`lmstudio`、`bedrock` 等模型别名,但它们不是通过 `config --llm-provider` 暴露的;更适合用 `-m <alias>`、`/model` 或手动编辑 `.msagent/llms/*.yml`。
|
|
274
|
+
|
|
275
|
+
示例:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
msagent config --show
|
|
279
|
+
msagent config --llm-provider anthropic --llm-model "claude-sonnet-4-5"
|
|
280
|
+
msagent config --llm-provider openai --llm-base-url "https://api.deepseek.com" --llm-model "deepseek-chat" --llm-max-tokens 0
|
|
281
|
+
msagent config --llm-provider custom --llm-base-url "https://example.com/v1" --llm-model "my-model"
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## 💬 会话内命令与快捷键
|
|
287
|
+
|
|
288
|
+
### Slash 命令
|
|
289
|
+
|
|
290
|
+
以下命令在交互式会话中可用:
|
|
291
|
+
|
|
292
|
+
| 命令 | 说明 |
|
|
293
|
+
|---|---|
|
|
294
|
+
| `/help` | 显示会话命令帮助 |
|
|
295
|
+
| `/hotkeys` | 显示当前输入框快捷键 |
|
|
296
|
+
| `/agents` | 交互式切换 Agent,并把选中 Agent 写回默认配置 |
|
|
297
|
+
| `/model` | 交互式切换当前 Agent 或子 Agent 的模型别名 |
|
|
298
|
+
| `/tools` | 浏览当前 Agent 已加载的工具 |
|
|
299
|
+
| `/skills` | 浏览当前 Agent 已加载的 Skills |
|
|
300
|
+
| `/mcp` | 交互式启用或禁用当前已配置的 MCP 服务器 |
|
|
301
|
+
| `/memory` | 打开 `.msagent/memory.md` 进行编辑 |
|
|
302
|
+
| `/graph` | 在终端渲染当前 Agent Graph |
|
|
303
|
+
| `/graph --browser` | 生成图像并尝试在浏览器中打开 |
|
|
304
|
+
| `/clear` | 清屏并切换到一个新的线程 ID |
|
|
305
|
+
| `/resume` | 从历史线程列表中选择并恢复 |
|
|
306
|
+
| `/replay` | 从当前线程某条历史用户消息处重放 |
|
|
307
|
+
| `/compress` | 压缩当前上下文到新线程 |
|
|
308
|
+
| `/todo` | 查看当前线程的 todo 列表 |
|
|
309
|
+
| `/todo 20` | 最多显示 20 条 todo |
|
|
310
|
+
| `/approve` | 管理 `always_allow` / `always_ask` / `always_deny` 规则 |
|
|
311
|
+
| `/exit` | 退出当前会话 |
|
|
312
|
+
|
|
313
|
+
说明:
|
|
314
|
+
|
|
315
|
+
- 当前代码里没有 `/new`、`/backend`、`/shell` 这些旧命令。
|
|
316
|
+
- `/mcp` 只负责切换已存在 MCP 服务的启用状态;新增或删除服务需要直接编辑配置文件。
|
|
317
|
+
- `/memory` 和 `/approve` 都会使用 `CLI__EDITOR` 指定的编辑器,默认是 `vim`。
|
|
318
|
+
|
|
319
|
+
### 输入框快捷键
|
|
320
|
+
|
|
321
|
+
| 快捷键 | 说明 |
|
|
322
|
+
|---|---|
|
|
323
|
+
| `Ctrl+C` | 若输入框有内容则清空;若输入框为空,连续按两次退出 |
|
|
324
|
+
| `Ctrl+J` | 插入换行 |
|
|
325
|
+
| `Shift+Tab` | 切换审批模式 |
|
|
326
|
+
| `Ctrl+B` | 切换 Bash 模式 |
|
|
327
|
+
| `Ctrl+K` | 打开快捷键面板 |
|
|
328
|
+
| `Tab` | 立即应用第一个补全结果 |
|
|
329
|
+
| `Enter` | 提交消息;若当前选中补全项则先应用补全 |
|
|
330
|
+
|
|
331
|
+
补充说明:
|
|
332
|
+
|
|
333
|
+
- Slash 命令和 `@文件` / `@图片` 引用都支持补全。
|
|
334
|
+
- 在 Agent、Model、Thread、Tool、Skill 等选择面板里,通常使用 `Up` / `Down` / `Enter` 操作。
|
|
335
|
+
|
|
336
|
+
### Bash 模式说明
|
|
337
|
+
|
|
338
|
+
按 `Ctrl+B` 后,输入框会切换到 Bash 模式。此时你输入的内容会直接通过:
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
bash -c "<your-command>"
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
在当前 `working_dir` 下执行,并把 `stdout` / `stderr` 原样打印出来。
|
|
345
|
+
|
|
346
|
+
注意:
|
|
347
|
+
|
|
348
|
+
- 这里执行的是本机真实 Shell 命令,不是 LLM 工具调用结果。
|
|
349
|
+
- 当前实现没有额外沙箱隔离,风险和你直接在终端执行命令一致。
|
|
350
|
+
- 该模式依赖系统存在 `bash`,更适合 Linux、macOS、WSL 或 Git Bash 环境。
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## 🌱 环境变量参考
|
|
355
|
+
|
|
356
|
+
### LLM 鉴权与连接
|
|
357
|
+
|
|
358
|
+
| 环境变量 | 说明 |
|
|
359
|
+
|---|---|
|
|
360
|
+
| `OPENAI_API_KEY` | OpenAI Provider API Key |
|
|
361
|
+
| `ANTHROPIC_API_KEY` | Anthropic Provider API Key |
|
|
362
|
+
| `GOOGLE_API_KEY` | Google / Gemini Provider API Key |
|
|
363
|
+
| `CUSTOM_API_KEY` | 自定义 OpenAI 兼容 Provider API Key |
|
|
364
|
+
| `DEEPSEEK_API_KEY` | DeepSeek 内置别名所使用的 API Key |
|
|
365
|
+
| `ZHIPUAI_API_KEY` | 智谱内置别名所使用的 API Key |
|
|
366
|
+
| `AWS_ACCESS_KEY_ID` | Bedrock 鉴权 |
|
|
367
|
+
| `AWS_SECRET_ACCESS_KEY` | Bedrock 鉴权 |
|
|
368
|
+
| `AWS_SESSION_TOKEN` | Bedrock 临时凭证 |
|
|
369
|
+
| `CUSTOM_BASE_URL` | `custom` Provider 的默认 Base URL |
|
|
370
|
+
| `HTTP_PROXY` / `http_proxy` | HTTP 代理 |
|
|
371
|
+
| `HTTPS_PROXY` / `https_proxy` | HTTPS 代理 |
|
|
372
|
+
|
|
373
|
+
说明:
|
|
374
|
+
|
|
375
|
+
- `msagent config --llm-provider gemini` 实际读取的是 `GOOGLE_API_KEY`。
|
|
376
|
+
- `--llm-api-key` 只会注入当前进程,不会保存到配置文件。
|
|
377
|
+
- 配置文件不会明文保存 API Key。
|
|
378
|
+
|
|
379
|
+
### 设置项覆盖
|
|
380
|
+
|
|
381
|
+
`msAgent` 使用 `pydantic-settings` 读取环境变量,并支持 `.env` 文件。当前代码里没有强制 `MSAGENT_` 前缀,嵌套字段使用 `__` 分隔。
|
|
382
|
+
|
|
383
|
+
常用覆盖项:
|
|
384
|
+
|
|
385
|
+
| 环境变量 | 说明 |
|
|
386
|
+
|---|---|
|
|
387
|
+
| `CLI__EDITOR` | 设置 `/memory`、`/approve` 使用的编辑器 |
|
|
388
|
+
| `CLI__PROMPT_STYLE` | 修改输入提示符样式 |
|
|
389
|
+
| `CLI__ENABLE_WORD_WRAP` | 是否启用自动换行 |
|
|
390
|
+
| `CLI__MAX_AUTOCOMPLETE_SUGGESTIONS` | 设置补全候选上限 |
|
|
391
|
+
| `LLM__OLLAMA_BASE_URL` | 设置 Ollama 地址 |
|
|
392
|
+
| `LLM__LMSTUDIO_BASE_URL` | 设置 LM Studio OpenAI 兼容地址 |
|
|
393
|
+
| `LOG_LEVEL` | 设置日志级别 |
|
|
394
|
+
| `SUPPRESS_GRPC_WARNINGS` | 是否屏蔽 gRPC 警告,默认 `true` |
|
|
395
|
+
|
|
396
|
+
示例:
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
CLI__EDITOR=nvim
|
|
400
|
+
CLI__PROMPT_STYLE=">> "
|
|
401
|
+
CLI__MAX_AUTOCOMPLETE_SUGGESTIONS=20
|
|
402
|
+
LLM__OLLAMA_BASE_URL=http://localhost:11434
|
|
403
|
+
LOG_LEVEL=DEBUG
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## 🛠️ 参考:配置与扩展
|
|
409
|
+
|
|
410
|
+
### 📁 项目本地配置目录
|
|
411
|
+
|
|
412
|
+
当前实现使用“项目本地配置”,所有运行时文件都放在:
|
|
413
|
+
|
|
414
|
+
```text
|
|
415
|
+
<working-dir>/.msagent/
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
首次运行时,`msAgent` 会把 `resources/configs/default/` 里的默认模板复制到该目录。常见文件如下:
|
|
419
|
+
|
|
420
|
+
| 文件 | 作用 |
|
|
421
|
+
|---|---|
|
|
422
|
+
| `.msagent/config.llms.yml` | 当前项目默认模型配置;`msagent config` 直接写这里 |
|
|
423
|
+
| `.msagent/llms/*.yml` | 附带的模型别名集合 |
|
|
424
|
+
| `.msagent/agents/*.yml` | Agent 定义,例如 `general`、`code-reviewer` |
|
|
425
|
+
| `.msagent/subagents/*.yml` | SubAgent 定义 |
|
|
426
|
+
| `.msagent/checkpointers/*.yml` | Checkpointer 配置 |
|
|
427
|
+
| `.msagent/sandboxes/*.yml` | 沙箱配置模板 |
|
|
428
|
+
| `.msagent/config.mcp.json` | MCP 服务器配置 |
|
|
429
|
+
| `.msagent/config.approval.json` | 工具审批规则 |
|
|
430
|
+
| `.msagent/config.checkpoints.db` | 会话 checkpoint 数据库 |
|
|
431
|
+
| `.msagent/.history` | 输入历史 |
|
|
432
|
+
| `.msagent/memory.md` | 用户偏好和项目上下文记忆 |
|
|
433
|
+
|
|
434
|
+
### 🤖 模型别名与 Agent
|
|
435
|
+
|
|
436
|
+
除了 `config` 写入的 `default` 别名外,仓库还自带一批可直接使用的模型别名,来源于 `.msagent/llms/*.yml`。示例包括:
|
|
437
|
+
|
|
438
|
+
- OpenAI: `gpt-5-mini-thinking`
|
|
439
|
+
- Anthropic: `sonnet-4.5`、`haiku-4.5`、`haiku-4.5-thinking`
|
|
440
|
+
- Google: `gemini-3-pro`、`gemini-2.5-pro`、`gemini-2.5-pro-thinking`
|
|
441
|
+
- DeepSeek: `deepseek-chat`
|
|
442
|
+
- ZhipuAI: `glm-4.6`、`glm-4.6-thinking`
|
|
443
|
+
- Bedrock / Ollama / LM Studio: 也有默认别名模板
|
|
444
|
+
|
|
445
|
+
使用方式:
|
|
446
|
+
|
|
447
|
+
- 临时指定会话模型:`msagent -m gemini-2.5-pro`
|
|
448
|
+
- 在会话中持久切换 Agent / SubAgent 模型:`/model`
|
|
449
|
+
- 临时指定 Agent:`msagent -a code-reviewer`
|
|
450
|
+
- 在会话中切换默认 Agent:`/agents`
|
|
451
|
+
|
|
452
|
+
默认模板里内置了至少两个 Agent:
|
|
453
|
+
|
|
454
|
+
- `general`
|
|
455
|
+
- `code-reviewer`
|
|
456
|
+
|
|
457
|
+
### 🔌 MCP 配置
|
|
458
|
+
|
|
459
|
+
默认模板会启用 `msprof-mcp`,并直接调用随当前 Python 环境安装的 `msprof-mcp` 可执行程序启动。
|
|
460
|
+
|
|
461
|
+
当前代码中的 MCP 使用方式是:
|
|
462
|
+
|
|
463
|
+
- 用 `/mcp` 在会话里切换已有服务的启用状态
|
|
464
|
+
- 用编辑器直接修改 `.msagent/config.mcp.json` 来新增、删除或细调服务器定义
|
|
465
|
+
|
|
466
|
+
配置文件格式示例:
|
|
467
|
+
|
|
468
|
+
```json
|
|
469
|
+
{
|
|
470
|
+
"mcpServers": {
|
|
471
|
+
"filesystem": {
|
|
472
|
+
"command": "npx",
|
|
473
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/workspace"],
|
|
474
|
+
"transport": "stdio",
|
|
475
|
+
"env": {},
|
|
476
|
+
"include": [],
|
|
477
|
+
"exclude": [],
|
|
478
|
+
"enabled": true,
|
|
479
|
+
"stateful": false
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
常用字段:
|
|
486
|
+
|
|
487
|
+
- `command` / `url`
|
|
488
|
+
- `args`
|
|
489
|
+
- `transport`
|
|
490
|
+
- `env`
|
|
491
|
+
- `include` / `exclude`
|
|
492
|
+
- `enabled`
|
|
493
|
+
- `stateful`
|
|
494
|
+
- `repair_command` / `repair_timeout`
|
|
495
|
+
- `timeout` / `sse_read_timeout` / `invoke_timeout`
|
|
496
|
+
|
|
497
|
+
对于像 `msprof-mcp` 这类本地 `stdio` MCP,默认更推荐:
|
|
498
|
+
|
|
499
|
+
- `stateful: true`,避免每次工具调用都重新拉起服务进程
|
|
500
|
+
- 如果你是通过 `pip install mindstudio-agent` 或安装 wheel 使用,保持默认的 `"command": "msprof-mcp"` 即可
|
|
501
|
+
- 如需把 `msprof-mcp` 与当前环境解耦,仍可改成 `uvx --isolated --from msprof-mcp==0.1.4 msprof-mcp` 启动
|
|
502
|
+
- 只在需要强制刷新远端版本时才临时使用 `uvx --refresh`,不要把它作为常驻默认参数
|
|
503
|
+
|
|
504
|
+
### 🧠 Skills
|
|
505
|
+
|
|
506
|
+
Skills 会按以下候选目录自动加载:
|
|
507
|
+
|
|
508
|
+
- `<working-dir>/skills`
|
|
509
|
+
- 内置 Skills(源码仓库中对应 `resources/configs/default/skills/` 子模块)
|
|
510
|
+
- `<working-dir>/.msagent/skills`
|
|
511
|
+
|
|
512
|
+
源码仓库中的内置 Skills 来源于 `mindstudio-skills` 子模块:
|
|
513
|
+
|
|
514
|
+
- 子模块路径:`resources/configs/default/skills/`
|
|
515
|
+
- 上游仓库:`https://github.com/kali20gakki/mindstudio-skills`
|
|
516
|
+
|
|
517
|
+
如果你是 `git clone` 后从源码运行,建议至少执行一次以下命令初始化 Skills:
|
|
518
|
+
|
|
519
|
+
```bash
|
|
520
|
+
git submodule sync --recursive
|
|
521
|
+
git submodule update --init --recursive resources/configs/default/skills
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
如果你要同步 `mindstudio-skills` 的最新上游提交,请执行:
|
|
525
|
+
|
|
526
|
+
```bash
|
|
527
|
+
git submodule sync --recursive
|
|
528
|
+
git submodule update --init --recursive --remote resources/configs/default/skills
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
说明:
|
|
532
|
+
|
|
533
|
+
- 不带 `--remote`:同步到当前 `msAgent` 仓库记录的 Skills 版本,适合复现和保持版本一致。
|
|
534
|
+
- 带 `--remote`:同步到 `mindstudio-skills` 上游默认分支的最新提交。
|
|
535
|
+
- 执行 `--remote` 后,主仓库里的 submodule 指针会变更;如果你希望固定这个版本,记得一起提交该变更。
|
|
536
|
+
|
|
537
|
+
支持两种目录结构:
|
|
538
|
+
|
|
539
|
+
```text
|
|
540
|
+
skills/
|
|
541
|
+
my-skill/
|
|
542
|
+
SKILL.md
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
```text
|
|
546
|
+
skills/
|
|
547
|
+
profiling/
|
|
548
|
+
my-skill/
|
|
549
|
+
SKILL.md
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
其中 `SKILL.md` 需要包含 frontmatter,至少提供:
|
|
553
|
+
|
|
554
|
+
```yaml
|
|
555
|
+
---
|
|
556
|
+
name: my-skill
|
|
557
|
+
description: 这个技能做什么
|
|
558
|
+
---
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
当前仓库里已经包含示例技能 `op-mfu-calculator`,会在无项目自定义 Skill 时作为兜底能力之一被加载。
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
565
|
+
## 🏗️ 编译与打包
|
|
566
|
+
|
|
567
|
+
### 打包 wheel(可直接 pip install)
|
|
568
|
+
|
|
569
|
+
Linux / macOS:
|
|
570
|
+
|
|
571
|
+
```bash
|
|
572
|
+
bash scripts/build_whl.sh
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
Windows(CMD):
|
|
576
|
+
|
|
577
|
+
```cmd
|
|
578
|
+
git submodule sync --recursive
|
|
579
|
+
git submodule update --init --recursive --remote --force --depth 1 resources/configs/default/skills
|
|
580
|
+
uv build --wheel --out-dir dist .
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
如果你的 Windows 环境安装了 Git Bash / WSL,也可以直接执行 `bash scripts/build_whl.sh`。
|
|
584
|
+
|
|
585
|
+
构建脚本会默认执行 `git submodule update --init --recursive --remote --force --depth 1 resources/configs/default/skills`,同步 `mindstudio-skills` 上游最新提交后再打入 wheel 包。
|
|
586
|
+
如果你需要按主仓库里固定的 submodule 提交构建,可以临时设置 `SYNC_SKILLS_REMOTE=0`。
|
|
587
|
+
|
|
588
|
+
打包完成后会在 `dist/` 目录生成 `mindstudio_agent-*.whl`,可直接安装:
|
|
589
|
+
|
|
590
|
+
Linux / macOS:
|
|
591
|
+
|
|
592
|
+
```bash
|
|
593
|
+
pip install dist/mindstudio_agent-<version>-py3-none-any.whl
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
Windows(CMD):
|
|
597
|
+
|
|
598
|
+
```cmd
|
|
599
|
+
pip install .\dist\mindstudio_agent-<version>-py3-none-any.whl
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
请将上面的 `<version>` 替换为实际构建出的 wheel 文件名。
|
|
603
|
+
|
|
604
|
+
从 TestPyPI 安装时,建议同时添加 PyPI 作为依赖源(部分依赖仅发布在 PyPI):
|
|
605
|
+
|
|
606
|
+
```bash
|
|
607
|
+
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ mindstudio-agent==0.1.0
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
---
|
|
611
|
+
|
|
612
|
+
---
|
|
613
|
+
|
|
614
|
+
## 版本说明
|
|
615
|
+
|
|
616
|
+
| 项目 | 说明 |
|
|
617
|
+
|---|---|
|
|
618
|
+
| 当前版本 | `0.1.0` |
|
|
619
|
+
| 包名 | `mindstudio-agent` |
|
|
620
|
+
| 命令行入口 | `msagent` |
|
|
621
|
+
| Python 要求 | `>=3.11` |
|
|
622
|
+
| 版本策略 | 遵循语义化版本(SemVer),补丁版本以兼容性修复为主,次版本新增功能保持向后兼容,主版本包含不兼容变更。 |
|
|
623
|
+
|
|
624
|
+
可通过以下命令查看本地安装版本:
|
|
625
|
+
|
|
626
|
+
```bash
|
|
627
|
+
msagent --version
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
---
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
## 🙏 引用与致谢
|
|
634
|
+
|
|
635
|
+
本项目在架构设计与实现思路上参考了 [`langrepl`](https://github.com/midodimori/langrepl) 项目,在此向其作者与贡献者表示感谢。
|