more-compute 0.4.4__py3-none-any.whl → 0.5.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.
- frontend/app/globals.css +734 -27
- frontend/app/layout.tsx +13 -3
- frontend/components/Notebook.tsx +2 -14
- frontend/components/cell/MonacoCell.tsx +99 -5
- frontend/components/layout/Sidebar.tsx +39 -4
- frontend/components/panels/ClaudePanel.tsx +461 -0
- frontend/components/popups/ComputePopup.tsx +738 -447
- frontend/components/popups/FilterPopup.tsx +305 -189
- frontend/components/popups/MetricsPopup.tsx +20 -1
- frontend/components/popups/ProviderConfigModal.tsx +322 -0
- frontend/components/popups/ProviderDropdown.tsx +398 -0
- frontend/components/popups/SettingsPopup.tsx +1 -1
- frontend/contexts/ClaudeContext.tsx +392 -0
- frontend/contexts/PodWebSocketContext.tsx +16 -21
- frontend/hooks/useInlineDiff.ts +269 -0
- frontend/lib/api.ts +323 -12
- frontend/lib/settings.ts +5 -0
- frontend/lib/websocket-native.ts +4 -8
- frontend/lib/websocket.ts +1 -2
- frontend/package-lock.json +733 -36
- frontend/package.json +2 -0
- frontend/public/assets/icons/providers/lambda_labs.svg +22 -0
- frontend/public/assets/icons/providers/prime_intellect.svg +18 -0
- frontend/public/assets/icons/providers/runpod.svg +9 -0
- frontend/public/assets/icons/providers/vastai.svg +1 -0
- frontend/settings.md +54 -0
- frontend/tsconfig.tsbuildinfo +1 -0
- frontend/types/claude.ts +194 -0
- kernel_run.py +13 -0
- {more_compute-0.4.4.dist-info → more_compute-0.5.0.dist-info}/METADATA +53 -11
- {more_compute-0.4.4.dist-info → more_compute-0.5.0.dist-info}/RECORD +56 -37
- {more_compute-0.4.4.dist-info → more_compute-0.5.0.dist-info}/WHEEL +1 -1
- morecompute/__init__.py +1 -1
- morecompute/__version__.py +1 -1
- morecompute/execution/executor.py +24 -67
- morecompute/execution/worker.py +6 -72
- morecompute/models/api_models.py +62 -0
- morecompute/notebook.py +11 -0
- morecompute/server.py +641 -133
- morecompute/services/claude_service.py +392 -0
- morecompute/services/pod_manager.py +168 -67
- morecompute/services/pod_monitor.py +67 -39
- morecompute/services/prime_intellect.py +0 -4
- morecompute/services/providers/__init__.py +92 -0
- morecompute/services/providers/base_provider.py +336 -0
- morecompute/services/providers/lambda_labs_provider.py +394 -0
- morecompute/services/providers/provider_factory.py +194 -0
- morecompute/services/providers/runpod_provider.py +504 -0
- morecompute/services/providers/vastai_provider.py +407 -0
- morecompute/utils/cell_magics.py +0 -3
- morecompute/utils/config_util.py +93 -3
- morecompute/utils/special_commands.py +5 -32
- morecompute/utils/version_check.py +117 -0
- frontend/styling_README.md +0 -23
- {more_compute-0.4.4.dist-info/licenses → more_compute-0.5.0.dist-info}/LICENSE +0 -0
- {more_compute-0.4.4.dist-info → more_compute-0.5.0.dist-info}/entry_points.txt +0 -0
- {more_compute-0.4.4.dist-info → more_compute-0.5.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Version checking utility - notifies users when a newer version is available.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import time
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Optional, Tuple
|
|
9
|
+
|
|
10
|
+
# Check at most once per day
|
|
11
|
+
CHECK_INTERVAL_SECONDS = 86400 # 24 hours
|
|
12
|
+
CACHE_FILE = Path.home() / ".cache" / "morecompute" / "version_check.json"
|
|
13
|
+
PYPI_URL = "https://pypi.org/pypi/more-compute/json"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_cache() -> dict:
|
|
17
|
+
"""Read the version check cache."""
|
|
18
|
+
try:
|
|
19
|
+
if CACHE_FILE.exists():
|
|
20
|
+
return json.loads(CACHE_FILE.read_text())
|
|
21
|
+
except Exception:
|
|
22
|
+
pass
|
|
23
|
+
return {}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _save_cache(data: dict) -> None:
|
|
27
|
+
"""Save the version check cache."""
|
|
28
|
+
try:
|
|
29
|
+
CACHE_FILE.parent.mkdir(parents=True, exist_ok=True)
|
|
30
|
+
CACHE_FILE.write_text(json.dumps(data))
|
|
31
|
+
except Exception:
|
|
32
|
+
pass # Don't fail if we can't cache
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _parse_version(version: str) -> Tuple[int, ...]:
|
|
36
|
+
"""Parse version string into tuple for comparison."""
|
|
37
|
+
try:
|
|
38
|
+
# Handle versions like "0.4.4" or "0.4.4.post1"
|
|
39
|
+
parts = version.split(".")
|
|
40
|
+
return tuple(int(p.split("-")[0].split("a")[0].split("b")[0].split("post")[0])
|
|
41
|
+
for p in parts[:3])
|
|
42
|
+
except Exception:
|
|
43
|
+
return (0, 0, 0)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _fetch_latest_version() -> Optional[str]:
|
|
47
|
+
"""Fetch the latest version from PyPI."""
|
|
48
|
+
try:
|
|
49
|
+
import urllib.request
|
|
50
|
+
import json as json_module
|
|
51
|
+
|
|
52
|
+
request = urllib.request.Request(
|
|
53
|
+
PYPI_URL,
|
|
54
|
+
headers={"Accept": "application/json"}
|
|
55
|
+
)
|
|
56
|
+
with urllib.request.urlopen(request, timeout=3.0) as response:
|
|
57
|
+
data = json_module.loads(response.read().decode())
|
|
58
|
+
return data.get("info", {}).get("version")
|
|
59
|
+
except Exception:
|
|
60
|
+
pass # Network errors are fine, just skip the check
|
|
61
|
+
return None
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def check_for_updates(current_version: str, force: bool = False) -> Optional[str]:
|
|
65
|
+
"""
|
|
66
|
+
Check if a newer version is available on PyPI.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
current_version: The currently installed version
|
|
70
|
+
force: If True, bypass the cache and check immediately
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
A message string if an update is available, None otherwise
|
|
74
|
+
"""
|
|
75
|
+
cache = _get_cache()
|
|
76
|
+
now = time.time()
|
|
77
|
+
|
|
78
|
+
# Check if we should skip (already checked recently)
|
|
79
|
+
if not force:
|
|
80
|
+
last_check = cache.get("last_check", 0)
|
|
81
|
+
if now - last_check < CHECK_INTERVAL_SECONDS:
|
|
82
|
+
# Use cached result
|
|
83
|
+
latest = cache.get("latest_version")
|
|
84
|
+
if latest and _parse_version(latest) > _parse_version(current_version):
|
|
85
|
+
return _format_update_message(current_version, latest)
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
# Fetch from PyPI
|
|
89
|
+
latest = _fetch_latest_version()
|
|
90
|
+
|
|
91
|
+
# Update cache
|
|
92
|
+
cache["last_check"] = now
|
|
93
|
+
if latest:
|
|
94
|
+
cache["latest_version"] = latest
|
|
95
|
+
_save_cache(cache)
|
|
96
|
+
|
|
97
|
+
# Compare versions
|
|
98
|
+
if latest and _parse_version(latest) > _parse_version(current_version):
|
|
99
|
+
return _format_update_message(current_version, latest)
|
|
100
|
+
|
|
101
|
+
return None
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def _format_update_message(current: str, latest: str) -> str:
|
|
105
|
+
"""Format the update notification message."""
|
|
106
|
+
return f"""
|
|
107
|
+
╭─────────────────────────────────────────────────────────────╮
|
|
108
|
+
│ A new version of MoreCompute is available: {latest:>6} │
|
|
109
|
+
│ You are currently running: {current:>6} │
|
|
110
|
+
│ │
|
|
111
|
+
│ To update, run: │
|
|
112
|
+
│ pip install --upgrade more-compute │
|
|
113
|
+
│ │
|
|
114
|
+
│ Or with uv: │
|
|
115
|
+
│ uv tool upgrade more-compute │
|
|
116
|
+
╰─────────────────────────────────────────────────────────────╯
|
|
117
|
+
"""
|
frontend/styling_README.md
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# For settings.json
|
|
2
|
-
|
|
3
|
-
Available themes: `light`, `dark`, `tokyo-night`, `tokyo-night-storm`, `tokyo-night-light`, `night-owl`, `night-owl-light`, `synthwave-84`, `one-dark-pro`
|
|
4
|
-
|
|
5
|
-
- light
|
|
6
|
-
- dark
|
|
7
|
-
- tokyo-night
|
|
8
|
-
- tokyo-night-storm
|
|
9
|
-
- tokyo-night-light
|
|
10
|
-
- night-owl
|
|
11
|
-
- night-owl-light
|
|
12
|
-
- synthwave-84
|
|
13
|
-
- one-dark-pro
|
|
14
|
-
|
|
15
|
-
Available metricsCollectionMode: `on-demand` (only collect when popup open), `persistent` (collect continuously in background, uses more memory (obviously)
|
|
16
|
-
|
|
17
|
-
Example settings.json:
|
|
18
|
-
```json
|
|
19
|
-
{
|
|
20
|
-
"theme": "dark",
|
|
21
|
-
"metricsCollectionMode": "on-demand"
|
|
22
|
-
}
|
|
23
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|