zai-coding-gateway 0.1.0__tar.gz → 0.1.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.
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/PKG-INFO +30 -18
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/README.md +29 -17
- zai_coding_gateway-0.1.1/mcp.json.example +12 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/pyproject.toml +1 -1
- zai_coding_gateway-0.1.1/scripts/print_mcp_config.py +76 -0
- zai_coding_gateway-0.1.0/mcp.json.example +0 -12
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/.gitignore +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/pypi_credentials.env.example +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/scripts/e2e_smoke.sh +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/scripts/upload_to_pypi.sh +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/src/zai_coding_gateway/__init__.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/src/zai_coding_gateway/client.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/src/zai_coding_gateway/errors.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/src/zai_coding_gateway/logging_utils.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/src/zai_coding_gateway/main.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/src/zai_coding_gateway/server.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/src/zai_coding_gateway/tools/__init__.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/src/zai_coding_gateway/tools/file_io.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/src/zai_coding_gateway/tools/solve_in_workspace.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/conftest.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/e2e_fixtures/battle_project/README.md +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/e2e_fixtures/battle_project/src/__init__.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/e2e_fixtures/battle_project/src/calc.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/e2e_fixtures/battle_project/src/main.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/test_client.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/test_e2e.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/test_e2e_battle.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/test_file_io.py +0 -0
- {zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/test_solve_in_workspace.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: zai-coding-gateway
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: MCP-сервер для решения задач в рабочем пространстве через Z.AI Coding Plan (solve_in_workspace, apply_changes)
|
|
5
5
|
License: MIT
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -59,27 +59,39 @@ MCP запускается вашей IDE при открытии проекта
|
|
|
59
59
|
|
|
60
60
|
## Подключение в Cursor
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
### Вариант: пакет с PyPI (как shadcn — только конфиг)
|
|
63
|
+
|
|
64
|
+
Установка не нужна: Cursor при старте вызовет `pipx run zai-coding-gateway`, пакет подтянется с PyPI. Но Cursor не видит PATH из терминала, поэтому в `command` нужен **полный путь к pipx**.
|
|
65
|
+
|
|
66
|
+
1. Установите pipx, если ещё нет: [pypa.github.io/pipx](https://pypa.github.io/pipx/) (`brew install pipx` на macOS, `pip install pipx` и т.п.).
|
|
67
|
+
2. Запустите скрипт — он найдёт pipx на вашей платформе и выведет готовый фрагмент для `mcp.json`:
|
|
63
68
|
```bash
|
|
64
|
-
|
|
69
|
+
python scripts/print_mcp_config.py
|
|
65
70
|
```
|
|
66
|
-
|
|
67
|
-
3.
|
|
71
|
+
Или из репозитория пакета (после клонирования): `python scripts/print_mcp_config.py`.
|
|
72
|
+
3. Скопируйте вывод и вставьте в `~/.cursor/mcp.json` в объект `mcpServers` (если файла нет — создайте с обёрткой `{"mcpServers": { ... } }`).
|
|
73
|
+
4. Вставьте в `env` свой `ZAI_API_KEY` и при необходимости `ZAI_PROJECT_ROOT`.
|
|
74
|
+
5. Перезапустите MCP в Cursor (или перезапустите Cursor).
|
|
75
|
+
|
|
76
|
+
Скрипт `print_mcp_config.py` поддерживает macOS, Linux и Windows и подставляет типичные пути к pipx. Если репозитория нет (только пакет с PyPI), подставьте путь к pipx вручную — типичные расположения:
|
|
77
|
+
|
|
78
|
+
| Платформа | Типичный путь к pipx |
|
|
79
|
+
|-----------|----------------------|
|
|
80
|
+
| macOS (Homebrew) | `/opt/homebrew/bin/pipx` или `/usr/local/bin/pipx` |
|
|
81
|
+
| Linux | `$HOME/.local/bin/pipx` или `/usr/bin/pipx` |
|
|
82
|
+
| Windows | `%USERPROFILE%\.local\bin\pipx.exe` или через `where pipx` в cmd |
|
|
83
|
+
|
|
84
|
+
В терминале: `which pipx` (macOS/Linux) или `where pipx` (Windows) — выведет путь для вашей системы.
|
|
85
|
+
|
|
86
|
+
### Вариант: локальная разработка (pip install -e .)
|
|
87
|
+
|
|
88
|
+
1. В проекте: `pip install -e .`
|
|
89
|
+
2. В `mcp.json` укажите полный путь к тому же Python, в окружении которого установлен пакет, например:
|
|
68
90
|
```json
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"zai-coding-gateway": {
|
|
72
|
-
"command": "/путь/к/.venv/bin/python",
|
|
73
|
-
"args": ["-m", "zai_coding_gateway.main", "--stdio"],
|
|
74
|
-
"env": {
|
|
75
|
-
"ZAI_API_KEY": "ваш-ключ",
|
|
76
|
-
"ZAI_PROJECT_ROOT": "/путь/к/корню/проекта"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
91
|
+
"command": "/путь/к/.venv/bin/python",
|
|
92
|
+
"args": ["-m", "zai_coding_gateway.main", "--stdio"],
|
|
81
93
|
```
|
|
82
|
-
|
|
94
|
+
3. В `env` задайте `ZAI_API_KEY` и при необходимости `ZAI_PROJECT_ROOT`.
|
|
83
95
|
|
|
84
96
|
## Модели (work / fast)
|
|
85
97
|
|
|
@@ -39,27 +39,39 @@ MCP запускается вашей IDE при открытии проекта
|
|
|
39
39
|
|
|
40
40
|
## Подключение в Cursor
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
### Вариант: пакет с PyPI (как shadcn — только конфиг)
|
|
43
|
+
|
|
44
|
+
Установка не нужна: Cursor при старте вызовет `pipx run zai-coding-gateway`, пакет подтянется с PyPI. Но Cursor не видит PATH из терминала, поэтому в `command` нужен **полный путь к pipx**.
|
|
45
|
+
|
|
46
|
+
1. Установите pipx, если ещё нет: [pypa.github.io/pipx](https://pypa.github.io/pipx/) (`brew install pipx` на macOS, `pip install pipx` и т.п.).
|
|
47
|
+
2. Запустите скрипт — он найдёт pipx на вашей платформе и выведет готовый фрагмент для `mcp.json`:
|
|
43
48
|
```bash
|
|
44
|
-
|
|
49
|
+
python scripts/print_mcp_config.py
|
|
45
50
|
```
|
|
46
|
-
|
|
47
|
-
3.
|
|
51
|
+
Или из репозитория пакета (после клонирования): `python scripts/print_mcp_config.py`.
|
|
52
|
+
3. Скопируйте вывод и вставьте в `~/.cursor/mcp.json` в объект `mcpServers` (если файла нет — создайте с обёрткой `{"mcpServers": { ... } }`).
|
|
53
|
+
4. Вставьте в `env` свой `ZAI_API_KEY` и при необходимости `ZAI_PROJECT_ROOT`.
|
|
54
|
+
5. Перезапустите MCP в Cursor (или перезапустите Cursor).
|
|
55
|
+
|
|
56
|
+
Скрипт `print_mcp_config.py` поддерживает macOS, Linux и Windows и подставляет типичные пути к pipx. Если репозитория нет (только пакет с PyPI), подставьте путь к pipx вручную — типичные расположения:
|
|
57
|
+
|
|
58
|
+
| Платформа | Типичный путь к pipx |
|
|
59
|
+
|-----------|----------------------|
|
|
60
|
+
| macOS (Homebrew) | `/opt/homebrew/bin/pipx` или `/usr/local/bin/pipx` |
|
|
61
|
+
| Linux | `$HOME/.local/bin/pipx` или `/usr/bin/pipx` |
|
|
62
|
+
| Windows | `%USERPROFILE%\.local\bin\pipx.exe` или через `where pipx` в cmd |
|
|
63
|
+
|
|
64
|
+
В терминале: `which pipx` (macOS/Linux) или `where pipx` (Windows) — выведет путь для вашей системы.
|
|
65
|
+
|
|
66
|
+
### Вариант: локальная разработка (pip install -e .)
|
|
67
|
+
|
|
68
|
+
1. В проекте: `pip install -e .`
|
|
69
|
+
2. В `mcp.json` укажите полный путь к тому же Python, в окружении которого установлен пакет, например:
|
|
48
70
|
```json
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"zai-coding-gateway": {
|
|
52
|
-
"command": "/путь/к/.venv/bin/python",
|
|
53
|
-
"args": ["-m", "zai_coding_gateway.main", "--stdio"],
|
|
54
|
-
"env": {
|
|
55
|
-
"ZAI_API_KEY": "ваш-ключ",
|
|
56
|
-
"ZAI_PROJECT_ROOT": "/путь/к/корню/проекта"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
71
|
+
"command": "/путь/к/.venv/bin/python",
|
|
72
|
+
"args": ["-m", "zai_coding_gateway.main", "--stdio"],
|
|
61
73
|
```
|
|
62
|
-
|
|
74
|
+
3. В `env` задайте `ZAI_API_KEY` и при необходимости `ZAI_PROJECT_ROOT`.
|
|
63
75
|
|
|
64
76
|
## Модели (work / fast)
|
|
65
77
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"zai-coding-gateway": {
|
|
4
|
+
"command": "/opt/homebrew/bin/pipx",
|
|
5
|
+
"args": ["run", "zai-coding-gateway", "--stdio"],
|
|
6
|
+
"env": {
|
|
7
|
+
"ZAI_API_KEY": "<подставьте свой ключ Z.AI>",
|
|
8
|
+
"ZAI_PROJECT_ROOT": "<путь к корню проекта или ${workspaceFolder}>"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "zai-coding-gateway"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.1"
|
|
8
8
|
description = "MCP-сервер для решения задач в рабочем пространстве через Z.AI Coding Plan (solve_in_workspace, apply_changes)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Печатает фрагмент mcp.json с подставленным путём к pipx для текущей платформы.
|
|
4
|
+
Cursor при запуске не видит PATH из терминала, поэтому command должен быть полным путём.
|
|
5
|
+
Запуск: python scripts/print_mcp_config.py
|
|
6
|
+
Вставьте вывод в ~/.cursor/mcp.json в секцию mcpServers.
|
|
7
|
+
"""
|
|
8
|
+
import os
|
|
9
|
+
import platform
|
|
10
|
+
import shutil
|
|
11
|
+
import sys
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def find_pipx() -> str | None:
|
|
15
|
+
"""Ищет исполняемый pipx: сначала PATH, потом типичные пути для платформы."""
|
|
16
|
+
exe = shutil.which("pipx")
|
|
17
|
+
if exe:
|
|
18
|
+
return os.path.abspath(exe)
|
|
19
|
+
system = platform.system()
|
|
20
|
+
home = os.path.expanduser("~")
|
|
21
|
+
if system == "Darwin":
|
|
22
|
+
candidates = [
|
|
23
|
+
"/opt/homebrew/bin/pipx",
|
|
24
|
+
"/usr/local/bin/pipx",
|
|
25
|
+
f"{home}/.local/bin/pipx",
|
|
26
|
+
]
|
|
27
|
+
elif system == "Linux":
|
|
28
|
+
candidates = [
|
|
29
|
+
f"{home}/.local/bin/pipx",
|
|
30
|
+
"/usr/local/bin/pipx",
|
|
31
|
+
"/usr/bin/pipx",
|
|
32
|
+
]
|
|
33
|
+
elif system == "Windows":
|
|
34
|
+
local = os.environ.get("LOCALAPPDATA", f"{home}/AppData/Local")
|
|
35
|
+
candidates = [
|
|
36
|
+
f"{home}/.local/bin/pipx.exe",
|
|
37
|
+
f"{local}/Programs/pipx/pipx.exe",
|
|
38
|
+
"pipx.exe",
|
|
39
|
+
]
|
|
40
|
+
else:
|
|
41
|
+
candidates = [f"{home}/.local/bin/pipx", "pipx"]
|
|
42
|
+
for path in candidates:
|
|
43
|
+
if os.path.isfile(path) and os.access(path, os.X_OK):
|
|
44
|
+
return os.path.abspath(path)
|
|
45
|
+
if system == "Windows" and not path.endswith(".exe") and os.path.isfile(path + ".exe"):
|
|
46
|
+
return os.path.abspath(path + ".exe")
|
|
47
|
+
return None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def main() -> None:
|
|
51
|
+
pipx_path = find_pipx()
|
|
52
|
+
if not pipx_path:
|
|
53
|
+
print(
|
|
54
|
+
"pipx не найден. Установите: https://pypa.github.io/pipx/\n"
|
|
55
|
+
" macOS (Homebrew): brew install pipx && pipx ensurepath\n"
|
|
56
|
+
" Windows: py -m pip install pipx && pipx ensurepath\n"
|
|
57
|
+
" Linux: pip install --user pipx && pipx ensurepath",
|
|
58
|
+
file=sys.stderr,
|
|
59
|
+
)
|
|
60
|
+
sys.exit(1)
|
|
61
|
+
# Экранируем обратные слэши для JSON (Windows)
|
|
62
|
+
cmd = pipx_path.replace("\\", "\\\\")
|
|
63
|
+
block = f''' "zai-coding-gateway": {{
|
|
64
|
+
"command": "{cmd}",
|
|
65
|
+
"args": ["run", "zai-coding-gateway", "--stdio"],
|
|
66
|
+
"env": {{
|
|
67
|
+
"ZAI_API_KEY": "<ваш ключ Z.AI>",
|
|
68
|
+
"ZAI_PROJECT_ROOT": "<путь к корню проекта или ${{workspaceFolder}}>"
|
|
69
|
+
}}
|
|
70
|
+
}}'''
|
|
71
|
+
print("# Вставьте этот блок в ~/.cursor/mcp.json в объект mcpServers:")
|
|
72
|
+
print(block)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
if __name__ == "__main__":
|
|
76
|
+
main()
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mcpServers": {
|
|
3
|
-
"zai-coding-gateway": {
|
|
4
|
-
"command": "python",
|
|
5
|
-
"args": ["-m", "zai_coding_gateway.main", "--stdio"],
|
|
6
|
-
"env": {
|
|
7
|
-
"ZAI_API_KEY": "<подставьте свой ключ Z.AI>",
|
|
8
|
-
"ZAI_PROJECT_ROOT": "<рекомендуется: путь к корню открытого проекта; во многих IDE можно использовать переменную типа ${workspaceFolder}>"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/src/zai_coding_gateway/logging_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/src/zai_coding_gateway/tools/__init__.py
RENAMED
|
File without changes
|
{zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/src/zai_coding_gateway/tools/file_io.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/e2e_fixtures/battle_project/README.md
RENAMED
|
File without changes
|
|
File without changes
|
{zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/e2e_fixtures/battle_project/src/calc.py
RENAMED
|
File without changes
|
{zai_coding_gateway-0.1.0 → zai_coding_gateway-0.1.1}/tests/e2e_fixtures/battle_project/src/main.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|