hypervisual 0.1.0__py3-none-any.whl

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 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,3 @@
1
+ from hypervisual.launcher import main
2
+
3
+ main()
@@ -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:]])
@@ -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,7 @@
1
+ hypervisual/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
2
+ hypervisual/__main__.py,sha256=ohukg9GAwTSuyvvamPfhu8xiPFjIDCBUtNhmb8WGXAU,46
3
+ hypervisual/launcher.py,sha256=SKAyE7Y4aYqBbHXkm9SoGIVkrw1VbpEG6ExgO1L0toE,2275
4
+ hypervisual-0.1.0.dist-info/METADATA,sha256=PbK7el1K0ZHj79BWmdH3IKzYh5cc8R44Oto5_l_yWH4,1305
5
+ hypervisual-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
6
+ hypervisual-0.1.0.dist-info/entry_points.txt,sha256=uDI0o9JYD4NZ6wp8C3CDsUxgsWS0KWYbXduY_3XSerI,91
7
+ hypervisual-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ codi = hypervisual.launcher:main
3
+ hypervisual = hypervisual.launcher:main