refactorai-cli 0.3.5__tar.gz → 0.3.8__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.3.5 → refactorai_cli-0.3.8}/PKG-INFO +2 -2
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/pyproject.toml +2 -2
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/__init__.py +1 -1
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/cloud_rr.py +47 -12
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/commands/runtime_proxy_cmds.py +11 -1
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/main.py +15 -8
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli.egg-info/PKG-INFO +2 -2
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli.egg-info/requires.txt +1 -1
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/README.md +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/auth.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/client.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/commands/__init__.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/commands/account_cmds.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/commands/auth_cmds.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/commands/cloud_cmds.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/commands/engine_cmds.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/commands/model_cmds.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/commands/rules_cmds.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/commands/run_cmds.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/commands/runtime_cmds.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/commands/setup_cmds.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/control_plane.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/credentials.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/local_constitution.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/local_engine_runtime.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/local_paths.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/model_policy.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/runtime_manager.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/settings.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli/setup_flow.py +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli.egg-info/SOURCES.txt +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli.egg-info/dependency_links.txt +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli.egg-info/entry_points.txt +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/refactorai_cli.egg-info/top_level.txt +0 -0
- {refactorai_cli-0.3.5 → refactorai_cli-0.3.8}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: refactorai-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.8
|
|
4
4
|
Summary: Local-first CLI for the refactor platform
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -8,7 +8,7 @@ Requires-Dist: typer>=0.12.0
|
|
|
8
8
|
Requires-Dist: httpx>=0.27.0
|
|
9
9
|
Requires-Dist: rich>=13.7.0
|
|
10
10
|
Requires-Dist: PyYAML>=6.0.1
|
|
11
|
-
Requires-Dist: refactorai-core>=3.0.
|
|
11
|
+
Requires-Dist: refactorai-core>=3.0.5
|
|
12
12
|
|
|
13
13
|
# refactorai-cli
|
|
14
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "refactorai-cli"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.8"
|
|
4
4
|
description = "Local-first CLI for the refactor platform"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -12,7 +12,7 @@ dependencies = [
|
|
|
12
12
|
"httpx>=0.27.0",
|
|
13
13
|
"rich>=13.7.0",
|
|
14
14
|
"PyYAML>=6.0.1",
|
|
15
|
-
"refactorai-core>=3.0.
|
|
15
|
+
"refactorai-core>=3.0.5",
|
|
16
16
|
]
|
|
17
17
|
|
|
18
18
|
[project.scripts]
|
|
@@ -51,7 +51,12 @@ from refactor_core.refactor_requests import (
|
|
|
51
51
|
save_request,
|
|
52
52
|
)
|
|
53
53
|
from refactor_core.store import create_run
|
|
54
|
-
from refactor_core.testcmd import
|
|
54
|
+
from refactor_core.testcmd import (
|
|
55
|
+
_SKIP_DIRS,
|
|
56
|
+
_configured_command,
|
|
57
|
+
discover_test_command,
|
|
58
|
+
resolve_test_command,
|
|
59
|
+
)
|
|
55
60
|
|
|
56
61
|
from refactorai_cli.auth import ensure_authenticated
|
|
57
62
|
from refactorai_cli.settings import platform_url
|
|
@@ -257,18 +262,47 @@ def _resolve_cloud_test_command(
|
|
|
257
262
|
"""Resolve a test command for a cloud run; return ``(command, note)``.
|
|
258
263
|
|
|
259
264
|
Layered resolution so the developer usually needs no config:
|
|
260
|
-
1. configured ``verification.tests.command``
|
|
261
|
-
2. deterministic monorepo discovery (subproject
|
|
262
|
-
|
|
265
|
+
1. configured ``verification.tests.command`` (explicit developer intent),
|
|
266
|
+
2. root-marker detection / deterministic monorepo discovery (subproject
|
|
267
|
+
test setups),
|
|
268
|
+
3. agentic discovery (server infers from manifests).
|
|
269
|
+
|
|
270
|
+
Cloud runs execute tests on the HOST (no sandbox), so every candidate is
|
|
271
|
+
preflight-validated against the host ``PATH`` before it is committed to. An
|
|
272
|
+
explicitly *configured* command is honored even when preflight fails (the
|
|
273
|
+
developer may know something we don't, e.g. a shell-resolved binary), but the
|
|
274
|
+
mismatch is surfaced as a note. Marker/monorepo-*detected* commands that fail
|
|
275
|
+
preflight are NOT returned: resolution falls through to server discovery so a
|
|
276
|
+
runnable alternative can be suggested instead of locking in an un-runnable
|
|
277
|
+
command (e.g. ``npm test`` when ``npm`` is not installed on the host).
|
|
263
278
|
"""
|
|
264
|
-
configured
|
|
279
|
+
# 1) Explicitly configured command: honor developer intent, but warn if the
|
|
280
|
+
# toolchain is not visible on the host PATH.
|
|
281
|
+
configured = _configured_command(config)
|
|
265
282
|
if configured:
|
|
266
|
-
|
|
283
|
+
if _client_preflight_command(project_root, configured):
|
|
284
|
+
return configured, ""
|
|
285
|
+
return configured, (
|
|
286
|
+
f"configured test command '{configured}' was not found on the host PATH; "
|
|
287
|
+
"cloud runs execute tests on the host, so it may fail. Install the "
|
|
288
|
+
"toolchain or update verification.tests.command."
|
|
289
|
+
)
|
|
267
290
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
291
|
+
# 2) Root-marker / monorepo detection: only usable if runnable on the host.
|
|
292
|
+
detected = resolve_test_command(project_root, config) or discover_test_command(project_root)
|
|
293
|
+
if detected:
|
|
294
|
+
if _client_preflight_command(project_root, detected):
|
|
295
|
+
return detected, f"auto-detected test command: {detected}"
|
|
296
|
+
# Detected but not runnable on the host -> fall through to server
|
|
297
|
+
# discovery rather than committing to an un-runnable command.
|
|
298
|
+
detected_note = (
|
|
299
|
+
f"auto-detected test command '{detected}' but its toolchain was not "
|
|
300
|
+
"found on the host PATH; trying server discovery."
|
|
301
|
+
)
|
|
302
|
+
else:
|
|
303
|
+
detected_note = ""
|
|
271
304
|
|
|
305
|
+
# 3) Server-assisted discovery, preflight-validated.
|
|
272
306
|
suggested = _discover_test_command_via_cloud(
|
|
273
307
|
project_root=project_root,
|
|
274
308
|
constitution=constitution,
|
|
@@ -280,11 +314,12 @@ def _resolve_cloud_test_command(
|
|
|
280
314
|
if suggested and _client_preflight_command(project_root, suggested):
|
|
281
315
|
return suggested, f"server-suggested test command: {suggested}"
|
|
282
316
|
if suggested:
|
|
283
|
-
|
|
317
|
+
note = (
|
|
284
318
|
f"server suggested test command '{suggested}' but its toolchain was not "
|
|
285
|
-
"found on PATH; skipped."
|
|
319
|
+
"found on the host PATH; skipped."
|
|
286
320
|
)
|
|
287
|
-
|
|
321
|
+
return None, f"{detected_note} {note}".strip() if detected_note else note
|
|
322
|
+
return None, detected_note
|
|
288
323
|
|
|
289
324
|
|
|
290
325
|
class _Session:
|
|
@@ -75,7 +75,17 @@ def _delegate_to_run_cmds(command_name: str, passthrough_args: list[str]) -> Non
|
|
|
75
75
|
real command signature (options, arguments, help) is honored without manual
|
|
76
76
|
argument parsing. Exit codes propagate to the caller.
|
|
77
77
|
"""
|
|
78
|
-
|
|
78
|
+
try:
|
|
79
|
+
from refactorai_cli.commands import run_cmds
|
|
80
|
+
except ModuleNotFoundError as exc:
|
|
81
|
+
if exc.name == "refactor_core.merge_gate":
|
|
82
|
+
console.print(
|
|
83
|
+
"[red]Installed refactor core is too old for this CLI.[/red]\n"
|
|
84
|
+
"Please upgrade both packages:\n"
|
|
85
|
+
" pip install --upgrade refactorai-core refactorai-cli"
|
|
86
|
+
)
|
|
87
|
+
raise typer.Exit(code=1) from exc
|
|
88
|
+
raise
|
|
79
89
|
|
|
80
90
|
func = getattr(run_cmds, command_name, None)
|
|
81
91
|
if func is None: # pragma: no cover - defensive; all cloud verbs exist
|
|
@@ -40,6 +40,12 @@ _TITLE_BY_COMMAND = {
|
|
|
40
40
|
"review": "Refactor Review Agent",
|
|
41
41
|
"code": "Refactor Code Agent",
|
|
42
42
|
}
|
|
43
|
+
_COLOR_BY_COMMAND = {
|
|
44
|
+
"setup": ("245", "250", "247"), # base, soft, art
|
|
45
|
+
"doctor": ("39", "117", "81"),
|
|
46
|
+
"review": ("214", "222", "220"),
|
|
47
|
+
"code": ("46", "120", "82"),
|
|
48
|
+
}
|
|
43
49
|
|
|
44
50
|
|
|
45
51
|
def _print_agent_intro(command_name: str) -> None:
|
|
@@ -48,19 +54,20 @@ def _print_agent_intro(command_name: str) -> None:
|
|
|
48
54
|
return
|
|
49
55
|
title = _TITLE_BY_COMMAND.get(command_name, "Refactor Agent")
|
|
50
56
|
tip = _TIP_BY_COMMAND.get(command_name, "Next: refactor review .")
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
base, soft, art = _COLOR_BY_COMMAND.get(command_name, ("46", "120", "82"))
|
|
58
|
+
color_bold = f"\033[1;38;5;{base}m"
|
|
59
|
+
color_soft = f"\033[38;5;{soft}m"
|
|
60
|
+
color_art = f"\033[38;5;{art}m"
|
|
54
61
|
reset = "\033[0m"
|
|
55
62
|
typer.echo("")
|
|
56
|
-
typer.echo(f"{
|
|
57
|
-
typer.echo(f"{
|
|
63
|
+
typer.echo(f"{color_bold}{title}{reset}")
|
|
64
|
+
typer.echo(f"{color_soft}Model: Sonnet 4.5{reset}")
|
|
58
65
|
typer.echo(f"Welcome back, {os.environ.get('USER', 'developer')}")
|
|
59
66
|
typer.echo("")
|
|
60
|
-
typer.echo(f"{
|
|
61
|
-
typer.echo(f"{
|
|
67
|
+
typer.echo(f"{color_art} * [■ ■] *{reset}")
|
|
68
|
+
typer.echo(f"{color_art} * \\_/ *{reset}")
|
|
62
69
|
typer.echo("")
|
|
63
|
-
typer.echo(f"{
|
|
70
|
+
typer.echo(f"{color_bold}Tip:{reset} {tip}")
|
|
64
71
|
typer.echo("")
|
|
65
72
|
|
|
66
73
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: refactorai-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.8
|
|
4
4
|
Summary: Local-first CLI for the refactor platform
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -8,7 +8,7 @@ Requires-Dist: typer>=0.12.0
|
|
|
8
8
|
Requires-Dist: httpx>=0.27.0
|
|
9
9
|
Requires-Dist: rich>=13.7.0
|
|
10
10
|
Requires-Dist: PyYAML>=6.0.1
|
|
11
|
-
Requires-Dist: refactorai-core>=3.0.
|
|
11
|
+
Requires-Dist: refactorai-core>=3.0.5
|
|
12
12
|
|
|
13
13
|
# refactorai-cli
|
|
14
14
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|