mimikyu 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,23 @@
1
+ # Rust
2
+ /target/
3
+ **/*.rs.bk
4
+
5
+ # Python & Packaging
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+ *.egg-info/
10
+ dist/
11
+ build/
12
+ .pytest_cache/
13
+ .mypy_cache/
14
+ .ruff_cache/
15
+ .venv/
16
+ venv/
17
+
18
+ # OS & Editors
19
+ .DS_Store
20
+ Thumbs.db
21
+ *.swp
22
+ *.swo
23
+ *~
mimikyu-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.5
2
+ Name: mimikyu
3
+ Version: 0.1.0
4
+ Summary: Fast dual-engine (Chromium CDP & Firefox WebDriver BiDi) browser automation, session isolation, and 31-tool MCP server for AI agents.
5
+ Project-URL: Homepage, https://github.com/YXZYSME/mimikyu
6
+ Project-URL: Repository, https://github.com/YXZYSME/mimikyu
7
+ Project-URL: Issues, https://github.com/YXZYSME/mimikyu/issues
8
+ Project-URL: Changelog, https://github.com/YXZYSME/mimikyu/blob/main/CHANGELOG.md
9
+ Author: Saengil (YXZYS)
10
+ License-Expression: MIT OR Apache-2.0
11
+ Keywords: ai-agents,browser-automation,cdp,chromium,firefox,mcp,mimikyu,model-context-protocol,webdriver-bidi
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Rust
19
+ Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
20
+ Classifier: Topic :: Software Development :: Testing
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+
24
+ # `mimikyu` (Python / `uvx` CLI & MCP Launcher)
25
+
26
+ Zero-dependency Python / `uvx` binary launcher for [`mimikyu`](https://github.com/YXZYSME/mimikyu) — fast Rust browser automation, two-tier session/profile isolation, warm background daemon, and 31-tool Model Context Protocol (`MCP`) server over **Chromium (CDP)** and **Firefox (WebDriver BiDi)**.
27
+
28
+ ## Quick Start (`pip` & `uvx`)
29
+
30
+ ```sh
31
+ # Install `mimikyu` and `mimikyu-mcp` onto your PATH
32
+ pip install mimikyu
33
+ mimikyu doctor
34
+
35
+ # Or run ephemerally with uvx
36
+ uvx mimikyu doctor
37
+ uvx --from mimikyu mimikyu-mcp
38
+ ```
39
+
40
+ ## MCP Client Configuration (`uvx`)
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "mimikyu": {
46
+ "command": "uvx",
47
+ "args": ["--from", "mimikyu", "mimikyu-mcp"]
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ On first invocation, this package downloads the matching native Rust release archive for your OS/CPU (`aarch64-apple-darwin`, `x86_64-apple-darwin`, `aarch64-unknown-linux-gnu`, `x86_64-unknown-linux-gnu`), verifies its `SHA-256` digest against `SHA256SUMS`, caches the binary locally, and `exec`s `mimikyu` directly.
54
+
55
+ ## License
56
+
57
+ Dual-licensed under **MIT OR Apache-2.0**. See https://github.com/YXZYSME/mimikyu.
@@ -0,0 +1,34 @@
1
+ # `mimikyu` (Python / `uvx` CLI & MCP Launcher)
2
+
3
+ Zero-dependency Python / `uvx` binary launcher for [`mimikyu`](https://github.com/YXZYSME/mimikyu) — fast Rust browser automation, two-tier session/profile isolation, warm background daemon, and 31-tool Model Context Protocol (`MCP`) server over **Chromium (CDP)** and **Firefox (WebDriver BiDi)**.
4
+
5
+ ## Quick Start (`pip` & `uvx`)
6
+
7
+ ```sh
8
+ # Install `mimikyu` and `mimikyu-mcp` onto your PATH
9
+ pip install mimikyu
10
+ mimikyu doctor
11
+
12
+ # Or run ephemerally with uvx
13
+ uvx mimikyu doctor
14
+ uvx --from mimikyu mimikyu-mcp
15
+ ```
16
+
17
+ ## MCP Client Configuration (`uvx`)
18
+
19
+ ```json
20
+ {
21
+ "mcpServers": {
22
+ "mimikyu": {
23
+ "command": "uvx",
24
+ "args": ["--from", "mimikyu", "mimikyu-mcp"]
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ On first invocation, this package downloads the matching native Rust release archive for your OS/CPU (`aarch64-apple-darwin`, `x86_64-apple-darwin`, `aarch64-unknown-linux-gnu`, `x86_64-unknown-linux-gnu`), verifies its `SHA-256` digest against `SHA256SUMS`, caches the binary locally, and `exec`s `mimikyu` directly.
31
+
32
+ ## License
33
+
34
+ Dual-licensed under **MIT OR Apache-2.0**. See https://github.com/YXZYSME/mimikyu.
@@ -0,0 +1,50 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.21.0"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "mimikyu"
7
+ version = "0.1.0"
8
+ description = "Fast dual-engine (Chromium CDP & Firefox WebDriver BiDi) browser automation, session isolation, and 31-tool MCP server for AI agents."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT OR Apache-2.0"
12
+ authors = [
13
+ { name = "Saengil (YXZYS)" }
14
+ ]
15
+ keywords = [
16
+ "browser-automation",
17
+ "mcp",
18
+ "model-context-protocol",
19
+ "cdp",
20
+ "webdriver-bidi",
21
+ "chromium",
22
+ "firefox",
23
+ "ai-agents",
24
+ "mimikyu",
25
+ ]
26
+ classifiers = [
27
+ "Development Status :: 4 - Beta",
28
+ "Environment :: Console",
29
+ "Intended Audience :: Developers",
30
+ "Operating System :: MacOS",
31
+ "Operating System :: POSIX :: Linux",
32
+ "Programming Language :: Python :: 3",
33
+ "Programming Language :: Rust",
34
+ "Topic :: Internet :: WWW/HTTP :: Browsers",
35
+ "Topic :: Software Development :: Testing",
36
+ ]
37
+ dependencies = []
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/YXZYSME/mimikyu"
41
+ Repository = "https://github.com/YXZYSME/mimikyu"
42
+ Issues = "https://github.com/YXZYSME/mimikyu/issues"
43
+ Changelog = "https://github.com/YXZYSME/mimikyu/blob/main/CHANGELOG.md"
44
+
45
+ [project.scripts]
46
+ mimikyu = "mimikyu_pypi.cli:main"
47
+ mimikyu-mcp = "mimikyu_pypi.cli:main_mcp"
48
+
49
+ [tool.hatch.build.targets.wheel]
50
+ packages = ["src/mimikyu_pypi"]
@@ -0,0 +1,3 @@
1
+ """Zero-dependency Python binary launcher for the mimikyu Rust runtime."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,140 @@
1
+ """Downloads, SHA-256-verifies, caches, and executes the native mimikyu binary."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import hashlib
6
+ import io
7
+ import os
8
+ import platform
9
+ import shutil
10
+ import stat
11
+ import sys
12
+ import tarfile
13
+ import tempfile
14
+ import urllib.request
15
+ from pathlib import Path
16
+
17
+ from . import __version__
18
+
19
+ REPO = os.environ.get("MIMIKYU_REPO", "YXZYSME/mimikyu")
20
+
21
+
22
+ def _resolve_target() -> str:
23
+ sys_name = platform.system().lower()
24
+ machine = platform.machine().lower()
25
+
26
+ if machine in ("x86_64", "amd64"):
27
+ arch = "x86_64"
28
+ elif machine in ("arm64", "aarch64"):
29
+ arch = "aarch64"
30
+ else:
31
+ raise RuntimeError(f"Unsupported CPU architecture: {machine!r}")
32
+
33
+ if sys_name == "darwin":
34
+ return f"{arch}-apple-darwin"
35
+ if sys_name == "linux":
36
+ return f"{arch}-unknown-linux-gnu"
37
+ raise RuntimeError(
38
+ f"Unsupported operating system: {sys_name!r} (supported: macOS and Linux)"
39
+ )
40
+
41
+
42
+ def _resolve_cache_root() -> Path:
43
+ override = os.environ.get("MIMIKYU_CACHE_DIR")
44
+ if override:
45
+ return Path(override)
46
+ if platform.system().lower() == "darwin":
47
+ return Path.home() / "Library" / "Caches" / "mimikyu" / "pypi"
48
+ xdg = os.environ.get("XDG_CACHE_HOME")
49
+ base = Path(xdg) if xdg else (Path.home() / ".cache")
50
+ return base / "mimikyu" / "pypi"
51
+
52
+
53
+ def _fetch_bytes(url: str) -> bytes:
54
+ req = urllib.request.Request(
55
+ url,
56
+ headers={"User-Agent": f"mimikyu-pypi/{__version__}"},
57
+ )
58
+ with urllib.request.urlopen(req, timeout=60) as resp:
59
+ return resp.read()
60
+
61
+
62
+ def _parse_expected_sha256(sums_text: str, archive_name: str) -> str:
63
+ for raw_line in sums_text.splitlines():
64
+ parts = raw_line.strip().split()
65
+ if len(parts) >= 2:
66
+ digest = parts[0].lower()
67
+ fname = parts[1].lstrip("*")
68
+ if fname == archive_name and len(digest) == 64:
69
+ return digest
70
+ raise RuntimeError(f"Checksum entry for {archive_name!r} not found in SHA256SUMS")
71
+
72
+
73
+ def ensure_binary() -> Path:
74
+ override_bin = os.environ.get("MIMIKYU_BIN")
75
+ if override_bin and Path(override_bin).is_file():
76
+ return Path(override_bin)
77
+
78
+ target = _resolve_target()
79
+ install_dir = _resolve_cache_root() / f"v{__version__}-{target}"
80
+ bin_path = install_dir / "mimikyu"
81
+ if bin_path.is_file():
82
+ return bin_path
83
+
84
+ archive_name = f"mimikyu-{target}.tar.gz"
85
+ base_url = f"https://github.com/{REPO}/releases/download/v{__version__}"
86
+ sys.stderr.write(
87
+ f"[mimikyu] Downloading and verifying mimikyu v{__version__} ({target})...\n"
88
+ )
89
+ sys.stderr.flush()
90
+
91
+ sums_bytes = _fetch_bytes(f"{base_url}/SHA256SUMS")
92
+ tar_bytes = _fetch_bytes(f"{base_url}/{archive_name}")
93
+
94
+ expected_sha = _parse_expected_sha256(sums_bytes.decode("utf-8"), archive_name)
95
+ actual_sha = hashlib.sha256(tar_bytes).hexdigest()
96
+ if actual_sha != expected_sha:
97
+ raise RuntimeError(
98
+ f"SHA-256 mismatch for {archive_name}: expected {expected_sha}, got {actual_sha}"
99
+ )
100
+
101
+ install_dir.mkdir(parents=True, exist_ok=True)
102
+ tmp_dir = Path(tempfile.mkdtemp(prefix=".stage-", dir=str(install_dir)))
103
+ try:
104
+ with tarfile.open(fileobj=io.BytesIO(tar_bytes), mode="r:gz") as tf:
105
+ member = tf.getmember("mimikyu")
106
+ extracted = tf.extractfile(member)
107
+ if extracted is None:
108
+ raise RuntimeError(f"Archive {archive_name} missing 'mimikyu' file payload")
109
+ staged_bin = tmp_dir / "mimikyu"
110
+ with open(staged_bin, "wb") as out_f:
111
+ shutil.copyfileobj(extracted, out_f)
112
+ os.chmod(staged_bin, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
113
+ os.replace(staged_bin, bin_path)
114
+ finally:
115
+ shutil.rmtree(tmp_dir, ignore_errors=True)
116
+
117
+ return bin_path
118
+
119
+
120
+ def main() -> None:
121
+ try:
122
+ bin_path = ensure_binary()
123
+ except Exception as exc: # noqa: BLE001
124
+ sys.stderr.write(f"[mimikyu] Error: {exc}\n")
125
+ sys.exit(1)
126
+ os.execv(str(bin_path), [str(bin_path), *sys.argv[1:]])
127
+
128
+
129
+ def main_mcp() -> None:
130
+ try:
131
+ bin_path = ensure_binary()
132
+ except Exception as exc: # noqa: BLE001
133
+ sys.stderr.write(f"[mimikyu-mcp] Error: {exc}\n")
134
+ sys.exit(1)
135
+ args = sys.argv[1:] if len(sys.argv) > 1 else ["mcp"]
136
+ os.execv(str(bin_path), [str(bin_path), *args])
137
+
138
+
139
+ if __name__ == "__main__":
140
+ main()