hypervisual 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.
- hypervisual-0.1.0/.gitignore +4 -0
- hypervisual-0.1.0/PKG-INFO +29 -0
- hypervisual-0.1.0/README.md +14 -0
- hypervisual-0.1.0/pyproject.toml +26 -0
- hypervisual-0.1.0/src/hypervisual/__init__.py +1 -0
- hypervisual-0.1.0/src/hypervisual/__main__.py +3 -0
- hypervisual-0.1.0/src/hypervisual/launcher.py +71 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: hypervisual
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: HyperVisual CLI launcher: downloads and runs the `codi` binary for architecture diagrams as code.
|
|
5
|
+
Project-URL: Homepage, https://hypervisual.io
|
|
6
|
+
Project-URL: Repository, https://github.com/hypervisual-io/hypervisual
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Keywords: architecture,c4,cli,diagrams,diagrams-as-code,mcp
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Operating System :: MacOS
|
|
11
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
12
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
13
|
+
Requires-Python: >=3.9
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# hypervisual
|
|
17
|
+
|
|
18
|
+
Launcher for the HyperVisual CLI (`codi`): architecture diagrams as code that validate themselves.
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
pipx run hypervisual validate architecture.codi
|
|
22
|
+
uvx hypervisual render architecture.codi -o architecture.svg
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
On first run it downloads the matching `codi` binary from [GitHub Releases](https://github.com/hypervisual-io/hypervisual/releases), verifies its SHA-256 and caches it under `~/.cache/hypervisual`. Set `HYPERVISUAL_VERSION` to pin another release tag.
|
|
26
|
+
|
|
27
|
+
Supported: macOS arm64, Linux x86_64 and arm64. Validation needs Python 3.9+ as `python3`.
|
|
28
|
+
|
|
29
|
+
See [hypervisual-io/hypervisual](https://github.com/hypervisual-io/hypervisual) for agent skills and MCP setup.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# hypervisual
|
|
2
|
+
|
|
3
|
+
Launcher for the HyperVisual CLI (`codi`): architecture diagrams as code that validate themselves.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pipx run hypervisual validate architecture.codi
|
|
7
|
+
uvx hypervisual render architecture.codi -o architecture.svg
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
On first run it downloads the matching `codi` binary from [GitHub Releases](https://github.com/hypervisual-io/hypervisual/releases), verifies its SHA-256 and caches it under `~/.cache/hypervisual`. Set `HYPERVISUAL_VERSION` to pin another release tag.
|
|
11
|
+
|
|
12
|
+
Supported: macOS arm64, Linux x86_64 and arm64. Validation needs Python 3.9+ as `python3`.
|
|
13
|
+
|
|
14
|
+
See [hypervisual-io/hypervisual](https://github.com/hypervisual-io/hypervisual) for agent skills and MCP setup.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "hypervisual"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "HyperVisual CLI launcher: downloads and runs the `codi` binary for architecture diagrams as code."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "Apache-2.0"
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
keywords = ["architecture", "diagrams", "diagrams-as-code", "c4", "mcp", "cli"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Environment :: Console",
|
|
15
|
+
"Operating System :: MacOS",
|
|
16
|
+
"Operating System :: POSIX :: Linux",
|
|
17
|
+
"Topic :: Software Development :: Documentation",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.urls]
|
|
21
|
+
Homepage = "https://hypervisual.io"
|
|
22
|
+
Repository = "https://github.com/hypervisual-io/hypervisual"
|
|
23
|
+
|
|
24
|
+
[project.scripts]
|
|
25
|
+
hypervisual = "hypervisual.launcher:main"
|
|
26
|
+
codi = "hypervisual.launcher:main"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import hashlib
|
|
2
|
+
import os
|
|
3
|
+
import platform
|
|
4
|
+
import sys
|
|
5
|
+
import tarfile
|
|
6
|
+
import tempfile
|
|
7
|
+
import urllib.request
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
from hypervisual import __version__
|
|
11
|
+
|
|
12
|
+
REPO = "hypervisual-io/hypervisual"
|
|
13
|
+
TARGETS = {
|
|
14
|
+
("Darwin", "arm64"): "aarch64-apple-darwin",
|
|
15
|
+
("Linux", "x86_64"): "x86_64-unknown-linux-gnu",
|
|
16
|
+
("Linux", "amd64"): "x86_64-unknown-linux-gnu",
|
|
17
|
+
("Linux", "aarch64"): "aarch64-unknown-linux-gnu",
|
|
18
|
+
("Linux", "arm64"): "aarch64-unknown-linux-gnu",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def die(message):
|
|
23
|
+
sys.stderr.write(f"hypervisual: error: {message}\n")
|
|
24
|
+
sys.exit(1)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def download(url):
|
|
28
|
+
try:
|
|
29
|
+
with urllib.request.urlopen(url) as response:
|
|
30
|
+
return response.read()
|
|
31
|
+
except OSError as error:
|
|
32
|
+
die(f"download failed: {url} ({error})")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def ensure_binary():
|
|
36
|
+
tag = os.environ.get("HYPERVISUAL_VERSION") or f"v{__version__}"
|
|
37
|
+
system, machine = platform.system(), platform.machine()
|
|
38
|
+
target = TARGETS.get((system, machine))
|
|
39
|
+
if target is None:
|
|
40
|
+
die(f"no prebuilt binary for {system}/{machine} (available: macOS arm64, Linux x86_64, Linux arm64)")
|
|
41
|
+
|
|
42
|
+
cache_root = Path(os.environ.get("XDG_CACHE_HOME") or Path.home() / ".cache")
|
|
43
|
+
directory = cache_root / "hypervisual" / tag / target
|
|
44
|
+
binary = directory / "codi"
|
|
45
|
+
if binary.exists():
|
|
46
|
+
return binary
|
|
47
|
+
|
|
48
|
+
asset = f"codi-{target}.tar.gz"
|
|
49
|
+
base = f"https://github.com/{REPO}/releases/download/{tag}"
|
|
50
|
+
sys.stderr.write(f"hypervisual: downloading {asset} ({tag})\n")
|
|
51
|
+
archive = download(f"{base}/{asset}")
|
|
52
|
+
expected = download(f"{base}/{asset}.sha256").decode().split()[0]
|
|
53
|
+
if hashlib.sha256(archive).hexdigest() != expected:
|
|
54
|
+
die(f"checksum mismatch for {asset}")
|
|
55
|
+
|
|
56
|
+
directory.mkdir(parents=True, exist_ok=True)
|
|
57
|
+
with tempfile.TemporaryDirectory(dir=directory, prefix=".download-") as staging:
|
|
58
|
+
archive_path = Path(staging) / asset
|
|
59
|
+
archive_path.write_bytes(archive)
|
|
60
|
+
with tarfile.open(archive_path) as tar:
|
|
61
|
+
member = tar.getmember("codi")
|
|
62
|
+
tar.extract(member, staging)
|
|
63
|
+
extracted = Path(staging) / "codi"
|
|
64
|
+
extracted.chmod(0o755)
|
|
65
|
+
extracted.replace(binary)
|
|
66
|
+
return binary
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def main():
|
|
70
|
+
binary = ensure_binary()
|
|
71
|
+
os.execv(binary, [str(binary), *sys.argv[1:]])
|