vefier-cli 1.0.0__tar.gz → 1.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.
- {vefier_cli-1.0.0 → vefier_cli-1.0.1}/PKG-INFO +1 -1
- {vefier_cli-1.0.0 → vefier_cli-1.0.1}/setup.py +1 -1
- {vefier_cli-1.0.0 → vefier_cli-1.0.1}/vefier/wrapper.py +71 -71
- {vefier_cli-1.0.0 → vefier_cli-1.0.1}/vefier_cli.egg-info/PKG-INFO +1 -1
- {vefier_cli-1.0.0 → vefier_cli-1.0.1}/setup.cfg +0 -0
- {vefier_cli-1.0.0 → vefier_cli-1.0.1}/vefier/__init__.py +0 -0
- {vefier_cli-1.0.0 → vefier_cli-1.0.1}/vefier_cli.egg-info/SOURCES.txt +0 -0
- {vefier_cli-1.0.0 → vefier_cli-1.0.1}/vefier_cli.egg-info/dependency_links.txt +0 -0
- {vefier_cli-1.0.0 → vefier_cli-1.0.1}/vefier_cli.egg-info/entry_points.txt +0 -0
- {vefier_cli-1.0.0 → vefier_cli-1.0.1}/vefier_cli.egg-info/top_level.txt +0 -0
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="vefier-cli",
|
|
5
|
-
version="1.0.
|
|
5
|
+
version="1.0.1",
|
|
6
6
|
description="Универсальный AI-агент для терминала (TUI)",
|
|
7
7
|
long_description="Обертка для загрузки скомпилированного Go-бинарника VeFier CLI.",
|
|
8
8
|
author="VeFier Studio",
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import sys
|
|
3
|
-
import platform
|
|
4
|
-
import subprocess
|
|
5
|
-
import urllib.request
|
|
6
|
-
import zipfile
|
|
7
|
-
import tarfile
|
|
8
|
-
import shutil
|
|
9
|
-
|
|
10
|
-
VERSION = "1.0.
|
|
11
|
-
REPO = "
|
|
12
|
-
|
|
13
|
-
def get_release_url():
|
|
14
|
-
sys_name = platform.system().lower()
|
|
15
|
-
arch = platform.machine().lower()
|
|
16
|
-
|
|
17
|
-
if sys_name == "darwin": os_name = "darwin"
|
|
18
|
-
elif sys_name == "windows": os_name = "windows"
|
|
19
|
-
else: os_name = "linux"
|
|
20
|
-
|
|
21
|
-
if arch in ["x86_64", "amd64"]: arch_name = "x86_64"
|
|
22
|
-
elif arch in ["arm64", "aarch64"]: arch_name = "arm64"
|
|
23
|
-
else: arch_name = arch
|
|
24
|
-
|
|
25
|
-
ext = "zip" if os_name == "windows" else "tar.gz"
|
|
26
|
-
# Для теста URL будет ложным, пока нет реального репозитория
|
|
27
|
-
return f"https://github.com/{REPO}/releases/download/v{VERSION}/vefier_{os_name}_{arch_name}.{ext}", ext
|
|
28
|
-
|
|
29
|
-
def download_and_extract(url, ext, bin_dir, exe_name):
|
|
30
|
-
print(f"
|
|
31
|
-
archive_path = os.path.join(bin_dir, f"download.{ext}")
|
|
32
|
-
|
|
33
|
-
try:
|
|
34
|
-
urllib.request.urlretrieve(url, archive_path)
|
|
35
|
-
except Exception as e:
|
|
36
|
-
print(f"
|
|
37
|
-
print("Убедитесь, что релиз
|
|
38
|
-
sys.exit(1)
|
|
39
|
-
|
|
40
|
-
print("
|
|
41
|
-
if ext == "zip":
|
|
42
|
-
with zipfile.ZipFile(archive_path, 'r') as zf:
|
|
43
|
-
zf.extractall(bin_dir)
|
|
44
|
-
else:
|
|
45
|
-
with tarfile.open(archive_path, 'r:gz') as tf:
|
|
46
|
-
tf.extractall(bin_dir)
|
|
47
|
-
|
|
48
|
-
os.remove(archive_path)
|
|
49
|
-
if platform.system() != "Windows":
|
|
50
|
-
os.chmod(os.path.join(bin_dir, exe_name), 0o755)
|
|
51
|
-
|
|
52
|
-
def main():
|
|
53
|
-
# Сохраняем бинарник в домашнюю папку (кэш)
|
|
54
|
-
bin_dir = os.path.expanduser("~/.vefier/bin")
|
|
55
|
-
os.makedirs(bin_dir, exist_ok=True)
|
|
56
|
-
|
|
57
|
-
exe_name = "vefier.exe" if platform.system() == "Windows" else "vefier"
|
|
58
|
-
bin_path = os.path.join(bin_dir, exe_name)
|
|
59
|
-
|
|
60
|
-
# Если бинарника нет, скачиваем его
|
|
61
|
-
if not os.path.exists(bin_path):
|
|
62
|
-
url, ext = get_release_url()
|
|
63
|
-
download_and_extract(url, ext, bin_dir, exe_name)
|
|
64
|
-
|
|
65
|
-
# Передаем управление Go-приложению
|
|
66
|
-
try:
|
|
67
|
-
sys.exit(subprocess.call([bin_path] + sys.argv[1:]))
|
|
68
|
-
except KeyboardInterrupt:
|
|
69
|
-
sys.exit(0)
|
|
70
|
-
|
|
71
|
-
if __name__ == "__main__":
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import platform
|
|
4
|
+
import subprocess
|
|
5
|
+
import urllib.request
|
|
6
|
+
import zipfile
|
|
7
|
+
import tarfile
|
|
8
|
+
import shutil
|
|
9
|
+
|
|
10
|
+
VERSION = "1.0.1"
|
|
11
|
+
REPO = "wodorfells/vefier-cli"
|
|
12
|
+
|
|
13
|
+
def get_release_url():
|
|
14
|
+
sys_name = platform.system().lower()
|
|
15
|
+
arch = platform.machine().lower()
|
|
16
|
+
|
|
17
|
+
if sys_name == "darwin": os_name = "darwin"
|
|
18
|
+
elif sys_name == "windows": os_name = "windows"
|
|
19
|
+
else: os_name = "linux"
|
|
20
|
+
|
|
21
|
+
if arch in ["x86_64", "amd64"]: arch_name = "x86_64"
|
|
22
|
+
elif arch in ["arm64", "aarch64"]: arch_name = "arm64"
|
|
23
|
+
else: arch_name = arch
|
|
24
|
+
|
|
25
|
+
ext = "zip" if os_name == "windows" else "tar.gz"
|
|
26
|
+
# Для теста URL будет ложным, пока нет реального репозитория
|
|
27
|
+
return f"https://github.com/{REPO}/releases/download/v{VERSION}/vefier_{os_name}_{arch_name}.{ext}", ext
|
|
28
|
+
|
|
29
|
+
def download_and_extract(url, ext, bin_dir, exe_name):
|
|
30
|
+
print(f"[INFO] Загрузка VeFier v{VERSION} из GitHub Releases...")
|
|
31
|
+
archive_path = os.path.join(bin_dir, f"download.{ext}")
|
|
32
|
+
|
|
33
|
+
try:
|
|
34
|
+
urllib.request.urlretrieve(url, archive_path)
|
|
35
|
+
except Exception as e:
|
|
36
|
+
print(f"[ERROR] Ошибка загрузки ({url}): {e}")
|
|
37
|
+
print("Убедитесь, что релиз существует на GitHub.")
|
|
38
|
+
sys.exit(1)
|
|
39
|
+
|
|
40
|
+
print("[INFO] Распаковка...")
|
|
41
|
+
if ext == "zip":
|
|
42
|
+
with zipfile.ZipFile(archive_path, 'r') as zf:
|
|
43
|
+
zf.extractall(bin_dir)
|
|
44
|
+
else:
|
|
45
|
+
with tarfile.open(archive_path, 'r:gz') as tf:
|
|
46
|
+
tf.extractall(bin_dir)
|
|
47
|
+
|
|
48
|
+
os.remove(archive_path)
|
|
49
|
+
if platform.system() != "Windows":
|
|
50
|
+
os.chmod(os.path.join(bin_dir, exe_name), 0o755)
|
|
51
|
+
|
|
52
|
+
def main():
|
|
53
|
+
# Сохраняем бинарник в домашнюю папку (кэш)
|
|
54
|
+
bin_dir = os.path.expanduser("~/.vefier/bin")
|
|
55
|
+
os.makedirs(bin_dir, exist_ok=True)
|
|
56
|
+
|
|
57
|
+
exe_name = "vefier.exe" if platform.system() == "Windows" else "vefier"
|
|
58
|
+
bin_path = os.path.join(bin_dir, exe_name)
|
|
59
|
+
|
|
60
|
+
# Если бинарника нет, скачиваем его
|
|
61
|
+
if not os.path.exists(bin_path):
|
|
62
|
+
url, ext = get_release_url()
|
|
63
|
+
download_and_extract(url, ext, bin_dir, exe_name)
|
|
64
|
+
|
|
65
|
+
# Передаем управление Go-приложению
|
|
66
|
+
try:
|
|
67
|
+
sys.exit(subprocess.call([bin_path] + sys.argv[1:]))
|
|
68
|
+
except KeyboardInterrupt:
|
|
69
|
+
sys.exit(0)
|
|
70
|
+
|
|
71
|
+
if __name__ == "__main__":
|
|
72
72
|
main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|