refactorai-cli 0.1.0__tar.gz → 0.2.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.
- {refactorai_cli-0.1.0 → refactorai_cli-0.2.0}/PKG-INFO +2 -2
- {refactorai_cli-0.1.0 → refactorai_cli-0.2.0}/README.md +1 -1
- {refactorai_cli-0.1.0 → refactorai_cli-0.2.0}/pyproject.toml +3 -3
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/__init__.py +1 -1
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/auth.py +2 -2
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/client.py +1 -1
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/auth_cmds.py +4 -4
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/engine_cmds.py +1 -1
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/model_cmds.py +1 -1
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/run_cmds.py +2 -2
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/runtime_cmds.py +4 -4
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/setup_cmds.py +1 -1
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/control_plane.py +2 -2
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/credentials.py +1 -1
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/main.py +2 -2
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/model_policy.py +1 -1
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/runtime_manager.py +20 -16
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/setup_flow.py +4 -4
- {refactorai_cli-0.1.0 → refactorai_cli-0.2.0}/refactorai_cli.egg-info/PKG-INFO +2 -2
- refactorai_cli-0.2.0/refactorai_cli.egg-info/SOURCES.txt +26 -0
- refactorai_cli-0.2.0/refactorai_cli.egg-info/entry_points.txt +2 -0
- refactorai_cli-0.2.0/refactorai_cli.egg-info/top_level.txt +1 -0
- refactorai_cli-0.1.0/refactorai_cli.egg-info/SOURCES.txt +0 -26
- refactorai_cli-0.1.0/refactorai_cli.egg-info/entry_points.txt +0 -2
- refactorai_cli-0.1.0/refactorai_cli.egg-info/top_level.txt +0 -1
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/__init__.py +0 -0
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/rules_cmds.py +0 -0
- {refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/settings.py +0 -0
- {refactorai_cli-0.1.0 → refactorai_cli-0.2.0}/refactorai_cli.egg-info/dependency_links.txt +0 -0
- {refactorai_cli-0.1.0 → refactorai_cli-0.2.0}/refactorai_cli.egg-info/requires.txt +0 -0
- {refactorai_cli-0.1.0 → refactorai_cli-0.2.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: refactorai-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Local-first CLI for the refactor platform
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -16,7 +16,7 @@ Public CLI package for Refactor.
|
|
|
16
16
|
|
|
17
17
|
- PyPI package name: `refactorai-cli`
|
|
18
18
|
- Installed command: `refactor`
|
|
19
|
-
- Python module package: `
|
|
19
|
+
- Python module package: `refactorai_cli`
|
|
20
20
|
|
|
21
21
|
## Local development install
|
|
22
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "refactorai-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0"
|
|
4
4
|
description = "Local-first CLI for the refactor platform"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -13,11 +13,11 @@ dependencies = [
|
|
|
13
13
|
]
|
|
14
14
|
|
|
15
15
|
[project.scripts]
|
|
16
|
-
refactor = "
|
|
16
|
+
refactor = "refactorai_cli.main:app"
|
|
17
17
|
|
|
18
18
|
[build-system]
|
|
19
19
|
requires = ["setuptools>=68", "wheel"]
|
|
20
20
|
build-backend = "setuptools.build_meta"
|
|
21
21
|
|
|
22
22
|
[tool.setuptools]
|
|
23
|
-
packages = ["
|
|
23
|
+
packages = ["refactorai_cli", "refactorai_cli.commands"]
|
|
@@ -13,8 +13,8 @@ from pathlib import Path
|
|
|
13
13
|
|
|
14
14
|
from refactor_core.paths import ensure_dir, validation_cache_dir
|
|
15
15
|
|
|
16
|
-
from
|
|
17
|
-
from
|
|
16
|
+
from refactorai_cli.client import PlatformClient, PlatformError
|
|
17
|
+
from refactorai_cli.credentials import ResolvedKey, resolve_developer_key
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
class AuthError(RuntimeError):
|
{refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/auth_cmds.py
RENAMED
|
@@ -5,10 +5,10 @@ from __future__ import annotations
|
|
|
5
5
|
import typer
|
|
6
6
|
from rich.console import Console
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
8
|
+
from refactorai_cli.auth import AuthError, ensure_authenticated
|
|
9
|
+
from refactorai_cli.client import PlatformClient, PlatformError
|
|
10
|
+
from refactorai_cli.credentials import load_credentials, save_credentials
|
|
11
|
+
from refactorai_cli.settings import mask_key, platform_url
|
|
12
12
|
|
|
13
13
|
console = Console()
|
|
14
14
|
|
{refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/engine_cmds.py
RENAMED
|
@@ -20,7 +20,7 @@ from refactor_core.engine_runtime import (
|
|
|
20
20
|
run_engine_logs,
|
|
21
21
|
stop_engine,
|
|
22
22
|
)
|
|
23
|
-
from
|
|
23
|
+
from refactorai_cli.model_policy import detect_machine_profile, evaluate_model, get_policy_bundle
|
|
24
24
|
|
|
25
25
|
console = Console()
|
|
26
26
|
app = typer.Typer(help="Manage the persistent local refactor engine.")
|
{refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/model_cmds.py
RENAMED
|
@@ -8,7 +8,7 @@ from rich.table import Table
|
|
|
8
8
|
|
|
9
9
|
from refactor_core.engine_runtime import DEFAULT_ENGINE_CONTAINER, probe_model, read_engine_state, resolve_runtime
|
|
10
10
|
|
|
11
|
-
from
|
|
11
|
+
from refactorai_cli.model_policy import (
|
|
12
12
|
detect_machine_profile,
|
|
13
13
|
evaluate_model,
|
|
14
14
|
get_policy_bundle,
|
{refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/run_cmds.py
RENAMED
|
@@ -88,8 +88,8 @@ from refactor_core.store import (
|
|
|
88
88
|
)
|
|
89
89
|
from refactor_core.testcmd import resolve_test_command
|
|
90
90
|
|
|
91
|
-
from
|
|
92
|
-
from
|
|
91
|
+
from refactorai_cli.auth import AuthError, ensure_authenticated
|
|
92
|
+
from refactorai_cli.settings import platform_url
|
|
93
93
|
|
|
94
94
|
console = Console()
|
|
95
95
|
|
{refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/runtime_cmds.py
RENAMED
|
@@ -5,9 +5,9 @@ from __future__ import annotations
|
|
|
5
5
|
import typer
|
|
6
6
|
from rich.console import Console
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
8
|
+
from refactorai_cli.auth import AuthError, ensure_authenticated
|
|
9
|
+
from refactorai_cli.control_plane import ensure_lease, heartbeat, read_cached_lease, resolve_policy
|
|
10
|
+
from refactorai_cli.runtime_manager import (
|
|
11
11
|
activate_runtime,
|
|
12
12
|
download_artifact,
|
|
13
13
|
resolve_runtime_manifest,
|
|
@@ -68,7 +68,7 @@ def update(
|
|
|
68
68
|
# Verification happens in activate_runtime; dry-run still checks
|
|
69
69
|
# integrity by attempting activation in-memory style via duplicate call.
|
|
70
70
|
# We use a no-op by verifying digest directly in manager on activation.
|
|
71
|
-
from
|
|
71
|
+
from refactorai_cli.runtime_manager import verify_sha256 # local import to keep module surface small
|
|
72
72
|
|
|
73
73
|
ok = verify_sha256(artifact, manifest.sha256)
|
|
74
74
|
if not ok:
|
{refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/setup_cmds.py
RENAMED
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
import typer
|
|
6
6
|
from rich.console import Console
|
|
7
7
|
|
|
8
|
-
from
|
|
8
|
+
from refactorai_cli.setup_flow import STAGE_IDS, SetupError, get_setup_diagnostics, run_setup
|
|
9
9
|
|
|
10
10
|
console = Console()
|
|
11
11
|
|
|
@@ -14,8 +14,8 @@ import httpx
|
|
|
14
14
|
|
|
15
15
|
from refactor_core.paths import ensure_dir, refactor_home
|
|
16
16
|
|
|
17
|
-
from
|
|
18
|
-
from
|
|
17
|
+
from refactorai_cli.credentials import resolve_developer_key
|
|
18
|
+
from refactorai_cli.settings import platform_url, policy_signing_key
|
|
19
19
|
|
|
20
20
|
LEASE_DIR = "leases"
|
|
21
21
|
LEASE_FILE = "current.json"
|
|
@@ -16,7 +16,7 @@ from pathlib import Path
|
|
|
16
16
|
from refactor_core.constitution import find_config, load_config
|
|
17
17
|
from refactor_core.paths import credentials_path, ensure_dir, refactor_home
|
|
18
18
|
|
|
19
|
-
from
|
|
19
|
+
from refactorai_cli.settings import env_api_key
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
@dataclass
|
|
@@ -4,8 +4,8 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import typer
|
|
6
6
|
|
|
7
|
-
from
|
|
8
|
-
from
|
|
7
|
+
from refactorai_cli import __version__
|
|
8
|
+
from refactorai_cli.commands import auth_cmds, engine_cmds, model_cmds, rules_cmds, run_cmds, runtime_cmds, setup_cmds
|
|
9
9
|
|
|
10
10
|
app = typer.Typer(
|
|
11
11
|
name="refactor",
|
{refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/runtime_manager.py
RENAMED
|
@@ -19,9 +19,9 @@ import httpx
|
|
|
19
19
|
|
|
20
20
|
from refactor_core.paths import ensure_dir, refactor_home
|
|
21
21
|
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
22
|
+
from refactorai_cli.control_plane import ensure_lease
|
|
23
|
+
from refactorai_cli.credentials import resolve_developer_key
|
|
24
|
+
from refactorai_cli.settings import platform_url
|
|
25
25
|
|
|
26
26
|
RUNTIME_DIR = "runtime"
|
|
27
27
|
VERSIONS_DIR = "versions"
|
|
@@ -125,18 +125,7 @@ def parse_manifest(payload: dict) -> RuntimeManifest:
|
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
def resolve_runtime_manifest(*, channel: str = "stable", timeout: float = 20.0) -> RuntimeManifest:
|
|
128
|
-
auth_header =
|
|
129
|
-
try:
|
|
130
|
-
lease = ensure_lease()
|
|
131
|
-
auth_header = f"Bearer {lease.token}"
|
|
132
|
-
except RuntimeError:
|
|
133
|
-
resolved = resolve_developer_key()
|
|
134
|
-
if not resolved:
|
|
135
|
-
raise RuntimeError(
|
|
136
|
-
"No developer key configured. Run `refactor login`, set REFACTOR_API_KEY, "
|
|
137
|
-
"or add developer_key to refactor.config."
|
|
138
|
-
)
|
|
139
|
-
auth_header = f"Bearer {resolved.key}"
|
|
128
|
+
auth_header = _runtime_auth_header()
|
|
140
129
|
os_name = str(platform.system() or "linux").lower()
|
|
141
130
|
arch = str(platform.machine() or "x86_64").lower()
|
|
142
131
|
payload = {
|
|
@@ -163,8 +152,9 @@ def resolve_runtime_manifest(*, channel: str = "stable", timeout: float = 20.0)
|
|
|
163
152
|
|
|
164
153
|
|
|
165
154
|
def download_artifact(url: str, *, timeout: float = 60.0) -> bytes:
|
|
155
|
+
auth_header = _runtime_auth_header()
|
|
166
156
|
try:
|
|
167
|
-
response = httpx.get(url, timeout=timeout)
|
|
157
|
+
response = httpx.get(url, headers={"Authorization": auth_header}, timeout=timeout)
|
|
168
158
|
except httpx.HTTPError as exc:
|
|
169
159
|
raise RuntimeError(f"Could not download runtime artifact: {exc}") from exc
|
|
170
160
|
if response.status_code >= 400:
|
|
@@ -172,6 +162,20 @@ def download_artifact(url: str, *, timeout: float = 60.0) -> bytes:
|
|
|
172
162
|
return response.content
|
|
173
163
|
|
|
174
164
|
|
|
165
|
+
def _runtime_auth_header() -> str:
|
|
166
|
+
try:
|
|
167
|
+
lease = ensure_lease()
|
|
168
|
+
return f"Bearer {lease.token}"
|
|
169
|
+
except RuntimeError:
|
|
170
|
+
resolved = resolve_developer_key()
|
|
171
|
+
if not resolved:
|
|
172
|
+
raise RuntimeError(
|
|
173
|
+
"No developer key configured. Run `refactor login`, set REFACTOR_API_KEY, "
|
|
174
|
+
"or add developer_key to refactor.config."
|
|
175
|
+
)
|
|
176
|
+
return f"Bearer {resolved.key}"
|
|
177
|
+
|
|
178
|
+
|
|
175
179
|
def activate_runtime(manifest: RuntimeManifest, artifact: bytes, *, channel: str = "stable") -> Path:
|
|
176
180
|
if not verify_sha256(artifact, manifest.sha256):
|
|
177
181
|
raise RuntimeError("Runtime artifact checksum verification failed")
|
|
@@ -18,10 +18,10 @@ from refactor_core.engine_runtime import (
|
|
|
18
18
|
)
|
|
19
19
|
from refactor_core.paths import ensure_dir, refactor_home
|
|
20
20
|
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
21
|
+
from refactorai_cli.auth import ensure_authenticated
|
|
22
|
+
from refactorai_cli.control_plane import ensure_lease, heartbeat, resolve_policy
|
|
23
|
+
from refactorai_cli.model_policy import detect_machine_profile, evaluate_model, recommended_model_id
|
|
24
|
+
from refactorai_cli.runtime_manager import activate_runtime, download_artifact, resolve_runtime_manifest, runtime_status
|
|
25
25
|
|
|
26
26
|
SETUP_DIR = "setup"
|
|
27
27
|
STATE_FILE = "state.json"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: refactorai-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Local-first CLI for the refactor platform
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -16,7 +16,7 @@ Public CLI package for Refactor.
|
|
|
16
16
|
|
|
17
17
|
- PyPI package name: `refactorai-cli`
|
|
18
18
|
- Installed command: `refactor`
|
|
19
|
-
- Python module package: `
|
|
19
|
+
- Python module package: `refactorai_cli`
|
|
20
20
|
|
|
21
21
|
## Local development install
|
|
22
22
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
refactorai_cli/__init__.py
|
|
4
|
+
refactorai_cli/auth.py
|
|
5
|
+
refactorai_cli/client.py
|
|
6
|
+
refactorai_cli/control_plane.py
|
|
7
|
+
refactorai_cli/credentials.py
|
|
8
|
+
refactorai_cli/main.py
|
|
9
|
+
refactorai_cli/model_policy.py
|
|
10
|
+
refactorai_cli/runtime_manager.py
|
|
11
|
+
refactorai_cli/settings.py
|
|
12
|
+
refactorai_cli/setup_flow.py
|
|
13
|
+
refactorai_cli.egg-info/PKG-INFO
|
|
14
|
+
refactorai_cli.egg-info/SOURCES.txt
|
|
15
|
+
refactorai_cli.egg-info/dependency_links.txt
|
|
16
|
+
refactorai_cli.egg-info/entry_points.txt
|
|
17
|
+
refactorai_cli.egg-info/requires.txt
|
|
18
|
+
refactorai_cli.egg-info/top_level.txt
|
|
19
|
+
refactorai_cli/commands/__init__.py
|
|
20
|
+
refactorai_cli/commands/auth_cmds.py
|
|
21
|
+
refactorai_cli/commands/engine_cmds.py
|
|
22
|
+
refactorai_cli/commands/model_cmds.py
|
|
23
|
+
refactorai_cli/commands/rules_cmds.py
|
|
24
|
+
refactorai_cli/commands/run_cmds.py
|
|
25
|
+
refactorai_cli/commands/runtime_cmds.py
|
|
26
|
+
refactorai_cli/commands/setup_cmds.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
refactorai_cli
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
README.md
|
|
2
|
-
pyproject.toml
|
|
3
|
-
refactor_cli/__init__.py
|
|
4
|
-
refactor_cli/auth.py
|
|
5
|
-
refactor_cli/client.py
|
|
6
|
-
refactor_cli/control_plane.py
|
|
7
|
-
refactor_cli/credentials.py
|
|
8
|
-
refactor_cli/main.py
|
|
9
|
-
refactor_cli/model_policy.py
|
|
10
|
-
refactor_cli/runtime_manager.py
|
|
11
|
-
refactor_cli/settings.py
|
|
12
|
-
refactor_cli/setup_flow.py
|
|
13
|
-
refactor_cli/commands/__init__.py
|
|
14
|
-
refactor_cli/commands/auth_cmds.py
|
|
15
|
-
refactor_cli/commands/engine_cmds.py
|
|
16
|
-
refactor_cli/commands/model_cmds.py
|
|
17
|
-
refactor_cli/commands/rules_cmds.py
|
|
18
|
-
refactor_cli/commands/run_cmds.py
|
|
19
|
-
refactor_cli/commands/runtime_cmds.py
|
|
20
|
-
refactor_cli/commands/setup_cmds.py
|
|
21
|
-
refactorai_cli.egg-info/PKG-INFO
|
|
22
|
-
refactorai_cli.egg-info/SOURCES.txt
|
|
23
|
-
refactorai_cli.egg-info/dependency_links.txt
|
|
24
|
-
refactorai_cli.egg-info/entry_points.txt
|
|
25
|
-
refactorai_cli.egg-info/requires.txt
|
|
26
|
-
refactorai_cli.egg-info/top_level.txt
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
refactor_cli
|
{refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/__init__.py
RENAMED
|
File without changes
|
{refactorai_cli-0.1.0/refactor_cli → refactorai_cli-0.2.0/refactorai_cli}/commands/rules_cmds.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|