utharnessly 0.1.0__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.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Utharness Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: utharnessly
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Cross-platform launcher for the utharness local-first agent terminal
|
|
5
|
+
Project-URL: Homepage, https://github.com/uthumany/utharnessly
|
|
6
|
+
Project-URL: Repository, https://github.com/uthumany/utharnessly.git
|
|
7
|
+
Project-URL: Issues, https://github.com/uthumany/utharnessly/issues
|
|
8
|
+
Author: Utharness Contributors
|
|
9
|
+
License: MIT License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026 Utharness Contributors
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Keywords: agent,cli,rust,terminal,tui
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Environment :: Console
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Operating System :: MacOS
|
|
36
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
37
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
38
|
+
Classifier: Programming Language :: Python :: 3
|
|
39
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
40
|
+
Classifier: Topic :: System :: Shells
|
|
41
|
+
Requires-Python: >=3.9
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
# utharnessly
|
|
45
|
+
|
|
46
|
+
`utharnessly` is the Python launcher for the [Utharness](https://github.com/uthumany/utharnessly) local-first agent terminal. It downloads the matching GitHub Release archive on first use, verifies the published SHA-256 checksum, caches the native Rust runtime and bundled Ink UI, and forwards CLI arguments to `utharness`.
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
python -m pip install utharnessly
|
|
52
|
+
utharnessly --help
|
|
53
|
+
utharnessly --version
|
|
54
|
+
utharnessly
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The release launcher currently publishes Linux x64, macOS x64, and Windows x64 artifacts. Other architectures and operating systems should use the documented source-build or remote-host workflow in the repository installation guide.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
utharnessly update
|
|
61
|
+
utharnessly uninstall
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`uninstall` prints the package and cache removal commands; it does not silently mutate the Python environment.
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT. See the repository for the full license and development instructions.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# utharnessly
|
|
2
|
+
|
|
3
|
+
`utharnessly` is the Python launcher for the [Utharness](https://github.com/uthumany/utharnessly) local-first agent terminal. It downloads the matching GitHub Release archive on first use, verifies the published SHA-256 checksum, caches the native Rust runtime and bundled Ink UI, and forwards CLI arguments to `utharness`.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
python -m pip install utharnessly
|
|
9
|
+
utharnessly --help
|
|
10
|
+
utharnessly --version
|
|
11
|
+
utharnessly
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The release launcher currently publishes Linux x64, macOS x64, and Windows x64 artifacts. Other architectures and operating systems should use the documented source-build or remote-host workflow in the repository installation guide.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
utharnessly update
|
|
18
|
+
utharnessly uninstall
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`uninstall` prints the package and cache removal commands; it does not silently mutate the Python environment.
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
MIT. See the repository for the full license and development instructions.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.25"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "utharnessly"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Cross-platform launcher for the utharness local-first agent terminal"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = { file = "LICENSE" }
|
|
12
|
+
authors = [{ name = "Utharness Contributors" }]
|
|
13
|
+
keywords = ["cli", "terminal", "agent", "rust", "tui"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Operating System :: MacOS",
|
|
19
|
+
"Operating System :: Microsoft :: Windows",
|
|
20
|
+
"Operating System :: POSIX :: Linux",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
23
|
+
"Topic :: System :: Shells",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://github.com/uthumany/utharnessly"
|
|
28
|
+
Repository = "https://github.com/uthumany/utharnessly.git"
|
|
29
|
+
Issues = "https://github.com/uthumany/utharnessly/issues"
|
|
30
|
+
|
|
31
|
+
[project.scripts]
|
|
32
|
+
utharnessly = "utharnessly.cli:main"
|
|
33
|
+
utharness = "utharnessly.cli:main"
|
|
34
|
+
|
|
35
|
+
[tool.hatch.build.targets.wheel]
|
|
36
|
+
packages = ["src/utharnessly"]
|
|
37
|
+
|
|
38
|
+
[tool.hatch.build.targets.sdist]
|
|
39
|
+
include = [
|
|
40
|
+
"/src",
|
|
41
|
+
"/README.md",
|
|
42
|
+
"/LICENSE",
|
|
43
|
+
"/pyproject.toml",
|
|
44
|
+
]
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""Thin Python launcher for the utharnessly native release."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import hashlib
|
|
6
|
+
import os
|
|
7
|
+
import platform
|
|
8
|
+
import shutil
|
|
9
|
+
import subprocess
|
|
10
|
+
import sys
|
|
11
|
+
import tarfile
|
|
12
|
+
import tempfile
|
|
13
|
+
import urllib.request
|
|
14
|
+
import zipfile
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
VERSION = "0.1.0"
|
|
18
|
+
REPOSITORY = "uthumany/utharnessly"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def release_base_url() -> str:
|
|
22
|
+
return os.environ.get(
|
|
23
|
+
"UTHARNESSLY_RELEASE_BASE_URL",
|
|
24
|
+
f"https://github.com/{REPOSITORY}/releases/download/v{VERSION}",
|
|
25
|
+
).rstrip("/")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def platform_asset() -> tuple[str, str]:
|
|
29
|
+
system = sys.platform
|
|
30
|
+
machine = platform.machine().lower()
|
|
31
|
+
if system.startswith("linux") and machine in {"x86_64", "amd64"}:
|
|
32
|
+
return "utharnessly-linux-x64.tar.gz", "tar.gz"
|
|
33
|
+
if system == "darwin" and machine in {"x86_64", "amd64"}:
|
|
34
|
+
return "utharnessly-macos-x64.tar.gz", "tar.gz"
|
|
35
|
+
if system.startswith("win") and machine in {"x86_64", "amd64"}:
|
|
36
|
+
return "utharnessly-windows-x64.zip", "zip"
|
|
37
|
+
raise RuntimeError(
|
|
38
|
+
f"No published utharnessly binary for {system}/{machine}. "
|
|
39
|
+
"Supported release targets are Linux x64, macOS x64, and Windows x64; "
|
|
40
|
+
f"use the source instructions at https://github.com/{REPOSITORY} on other targets."
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def cache_root() -> Path:
|
|
45
|
+
if os.name == "nt":
|
|
46
|
+
base = Path(os.environ.get("LOCALAPPDATA", Path.home()))
|
|
47
|
+
else:
|
|
48
|
+
base = Path(os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache"))
|
|
49
|
+
return base / "utharnessly" / VERSION
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _download(url: str, destination: Path) -> None:
|
|
53
|
+
request = urllib.request.Request(url, headers={"User-Agent": "utharnessly-python-launcher"})
|
|
54
|
+
with urllib.request.urlopen(request, timeout=60) as response, destination.open("wb") as output:
|
|
55
|
+
shutil.copyfileobj(response, output)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _verify_checksum(archive: Path, checksums: Path) -> None:
|
|
59
|
+
asset = archive.name
|
|
60
|
+
line = next((row for row in checksums.read_text(encoding="utf-8").splitlines() if asset in row), None)
|
|
61
|
+
if not line:
|
|
62
|
+
raise RuntimeError(f"SHA256SUMS does not contain {asset}")
|
|
63
|
+
expected = line.split()[0].lower()
|
|
64
|
+
actual = hashlib.sha256(archive.read_bytes()).hexdigest()
|
|
65
|
+
if expected != actual:
|
|
66
|
+
raise RuntimeError(f"checksum verification failed for {asset}")
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def _extract(archive: Path, format_name: str, destination: Path) -> None:
|
|
70
|
+
if format_name == "tar.gz":
|
|
71
|
+
with tarfile.open(archive, "r:gz") as handle:
|
|
72
|
+
handle.extractall(destination, filter="data")
|
|
73
|
+
elif format_name == "zip":
|
|
74
|
+
with zipfile.ZipFile(archive) as handle:
|
|
75
|
+
handle.extractall(destination)
|
|
76
|
+
else:
|
|
77
|
+
raise RuntimeError(f"unsupported archive format: {format_name}")
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def ensure_binary(force: bool = False) -> tuple[Path, Path]:
|
|
81
|
+
asset, format_name = platform_asset()
|
|
82
|
+
root = cache_root()
|
|
83
|
+
binary = root / ("utharness.exe" if os.name == "nt" else "utharness")
|
|
84
|
+
ui = root / "ui"
|
|
85
|
+
if not force and binary.is_file():
|
|
86
|
+
return binary, ui
|
|
87
|
+
shutil.rmtree(root, ignore_errors=True)
|
|
88
|
+
root.mkdir(parents=True, exist_ok=True)
|
|
89
|
+
with tempfile.TemporaryDirectory(prefix="utharnessly-") as temporary:
|
|
90
|
+
temporary_path = Path(temporary)
|
|
91
|
+
archive = temporary_path / asset
|
|
92
|
+
checksums = temporary_path / "SHA256SUMS"
|
|
93
|
+
print(f"Downloading utharnessly v{VERSION} ({sys.platform}/{platform.machine()})…", file=sys.stderr)
|
|
94
|
+
_download(f"{release_base_url()}/{asset}", archive)
|
|
95
|
+
_download(f"{release_base_url()}/SHA256SUMS", checksums)
|
|
96
|
+
_verify_checksum(archive, checksums)
|
|
97
|
+
extracted = temporary_path / "extracted"
|
|
98
|
+
extracted.mkdir()
|
|
99
|
+
_extract(archive, format_name, extracted)
|
|
100
|
+
package_root = next((entry for entry in extracted.iterdir() if entry.is_dir() and entry.name.startswith("utharnessly-")), None)
|
|
101
|
+
if package_root is None:
|
|
102
|
+
raise RuntimeError("release archive did not contain an utharnessly directory")
|
|
103
|
+
shutil.copy2(package_root / binary.name, binary)
|
|
104
|
+
if os.name != "nt":
|
|
105
|
+
binary.chmod(0o755)
|
|
106
|
+
shutil.copytree(package_root / "ui", ui)
|
|
107
|
+
return binary, ui
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def main() -> int:
|
|
111
|
+
args = sys.argv[1:]
|
|
112
|
+
if args in (["--version"], ["-V"]):
|
|
113
|
+
print(f"utharnessly {VERSION}")
|
|
114
|
+
return 0
|
|
115
|
+
if args and args[0] == "update":
|
|
116
|
+
try:
|
|
117
|
+
ensure_binary(force=True)
|
|
118
|
+
print(f"utharnessly {VERSION} is ready.")
|
|
119
|
+
return 0
|
|
120
|
+
except Exception as error: # pragma: no cover - platform/network-specific
|
|
121
|
+
print(f"utharnessly update failed: {error}", file=sys.stderr)
|
|
122
|
+
return 1
|
|
123
|
+
if args and args[0] == "uninstall":
|
|
124
|
+
print("Remove the Python package with: python -m pip uninstall utharnessly")
|
|
125
|
+
cache_command = f'rmdir /s /q "{cache_root()}"' if os.name == "nt" else f'rm -rf "{cache_root()}"'
|
|
126
|
+
print(f"Remove the cached native runtime with: {cache_command}")
|
|
127
|
+
return 0
|
|
128
|
+
try:
|
|
129
|
+
binary, _ui = ensure_binary()
|
|
130
|
+
except Exception as error: # pragma: no cover - platform/network-specific
|
|
131
|
+
print(f"utharnessly: {error}", file=sys.stderr)
|
|
132
|
+
return 1
|
|
133
|
+
environment = os.environ.copy()
|
|
134
|
+
environment["UTHARNESS_RUNTIME_BIN"] = str(binary)
|
|
135
|
+
completed = subprocess.run([str(binary), *args], env=environment, check=False)
|
|
136
|
+
return completed.returncode
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
if __name__ == "__main__": # pragma: no cover
|
|
140
|
+
raise SystemExit(main())
|