aline-ai 0.1.2__py3-none-any.whl → 0.1.4__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.
- {aline_ai-0.1.2.dist-info → aline_ai-0.1.4.dist-info}/METADATA +1 -1
- {aline_ai-0.1.2.dist-info → aline_ai-0.1.4.dist-info}/RECORD +9 -9
- realign/__init__.py +1 -1
- realign/commands/commit.py +8 -2
- realign/mcp_server.py +34 -8
- {aline_ai-0.1.2.dist-info → aline_ai-0.1.4.dist-info}/WHEEL +0 -0
- {aline_ai-0.1.2.dist-info → aline_ai-0.1.4.dist-info}/entry_points.txt +0 -0
- {aline_ai-0.1.2.dist-info → aline_ai-0.1.4.dist-info}/licenses/LICENSE +0 -0
- {aline_ai-0.1.2.dist-info → aline_ai-0.1.4.dist-info}/top_level.txt +0 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
aline_ai-0.1.
|
|
2
|
-
realign/__init__.py,sha256=
|
|
1
|
+
aline_ai-0.1.4.dist-info/licenses/LICENSE,sha256=H8wTqV5IF1oHw_HbBtS1PSDU8G_q81yblEIL_JfV8Vo,1077
|
|
2
|
+
realign/__init__.py,sha256=PFVJVPatfhf1vGJIGnMKgKkPLWTkGXI6NKq_PQMW7Bc,68
|
|
3
3
|
realign/claude_detector.py,sha256=NLxI0zJWcqNxNha9jAy9AslTMwHKakCc9yPGdkrbiFE,3028
|
|
4
4
|
realign/cli.py,sha256=bkwS329jMDEkrUEihXRN2DDyeTKE6HbAysoDxxskZ8g,941
|
|
5
5
|
realign/codex_detector.py,sha256=RI3JbZgebrhoqpRfTBMfclYCAISN7hZAHVW3bgftJpU,4428
|
|
6
6
|
realign/config.py,sha256=jarinbr0mA6e5DmgY19b_VpMnxk6SOYTwyvB9luq0ww,7207
|
|
7
7
|
realign/hooks.py,sha256=qhAeuln_62OgTq0vboZcUAuP2apOrNn58vSZqKwNmWQ,36456
|
|
8
8
|
realign/logging_config.py,sha256=KvkKktF-bkUu031y9vgUoHpsbnOw7ud25jhpzliNZwA,4929
|
|
9
|
-
realign/mcp_server.py,sha256=
|
|
9
|
+
realign/mcp_server.py,sha256=oe2RQZ7_en_6vDMqXgVaSHCSqc_aQejc8wM2vkF0rj4,16702
|
|
10
10
|
realign/mcp_watcher.py,sha256=jxr4em27hw79N9d-lYCbu4dGclzG7OyPuPFtPeeadMM,13122
|
|
11
11
|
realign/redactor.py,sha256=uZvLKKGrRGJm-qM8S4XJyJK6i0CSSby_wbKiay7VGJw,8148
|
|
12
12
|
realign/commands/__init__.py,sha256=GG6IMw6fUBQAXGJDFJvOOQgv6pkiRSfMh8z3AYXTyRM,31
|
|
13
13
|
realign/commands/auto_commit.py,sha256=_DOw7nt9q3tD_Y3qDL9IFKAUG1hM4qH_xZ-9nyBc2Bc,7451
|
|
14
|
-
realign/commands/commit.py,sha256=
|
|
14
|
+
realign/commands/commit.py,sha256=yjhOrkRY_UvAa5EXufwwcYZaqE83L9Bzd0YPUc59fic,9196
|
|
15
15
|
realign/commands/config.py,sha256=oarvn6UuGT8svd2h5_8M_ueV5QWOCUOn8SYoa4XYjs8,6500
|
|
16
16
|
realign/commands/init.py,sha256=EpSzh2Dd2EmEQ_wo3vAsg6Uq7_YOlQWIpzIkZa_2y0A,11863
|
|
17
17
|
realign/commands/search.py,sha256=0CZaXll99wtd01MRiZk5NAblxgogc4RUAzMyJunvckE,18044
|
|
18
18
|
realign/commands/show.py,sha256=P1waa94-AKJr9XjagkE40OHMXzE6IwC74DpeDKqwsqw,16693
|
|
19
|
-
aline_ai-0.1.
|
|
20
|
-
aline_ai-0.1.
|
|
21
|
-
aline_ai-0.1.
|
|
22
|
-
aline_ai-0.1.
|
|
23
|
-
aline_ai-0.1.
|
|
19
|
+
aline_ai-0.1.4.dist-info/METADATA,sha256=fGfNH8tf8zKsOhpi7vfAkDkRDF0zFzpWHNaFtCtrnIM,1398
|
|
20
|
+
aline_ai-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
21
|
+
aline_ai-0.1.4.dist-info/entry_points.txt,sha256=h-NocHDzSueXfsepHTIdRPNQzhNZQPAztJfldd-mQTE,202
|
|
22
|
+
aline_ai-0.1.4.dist-info/top_level.txt,sha256=yIL3s2xv9nf1GwD5n71Aq_JEIV4AfzCIDNKBzewuRm4,8
|
|
23
|
+
aline_ai-0.1.4.dist-info/RECORD,,
|
realign/__init__.py
CHANGED
realign/commands/commit.py
CHANGED
|
@@ -13,10 +13,13 @@ from ..hooks import find_all_active_sessions
|
|
|
13
13
|
console = Console()
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
def has_file_changes() -> bool:
|
|
16
|
+
def has_file_changes(cwd: Optional[str] = None) -> bool:
|
|
17
17
|
"""
|
|
18
18
|
Check if there are any staged or unstaged file changes (excluding .realign/sessions/).
|
|
19
19
|
|
|
20
|
+
Args:
|
|
21
|
+
cwd: Working directory for git commands (default: current directory)
|
|
22
|
+
|
|
20
23
|
Returns:
|
|
21
24
|
True if there are file changes, False otherwise
|
|
22
25
|
"""
|
|
@@ -27,6 +30,7 @@ def has_file_changes() -> bool:
|
|
|
27
30
|
capture_output=True,
|
|
28
31
|
text=True,
|
|
29
32
|
check=True,
|
|
33
|
+
cwd=cwd,
|
|
30
34
|
)
|
|
31
35
|
unstaged = [
|
|
32
36
|
line.strip()
|
|
@@ -40,6 +44,7 @@ def has_file_changes() -> bool:
|
|
|
40
44
|
capture_output=True,
|
|
41
45
|
text=True,
|
|
42
46
|
check=True,
|
|
47
|
+
cwd=cwd,
|
|
43
48
|
)
|
|
44
49
|
staged = [
|
|
45
50
|
line.strip()
|
|
@@ -53,6 +58,7 @@ def has_file_changes() -> bool:
|
|
|
53
58
|
capture_output=True,
|
|
54
59
|
text=True,
|
|
55
60
|
check=True,
|
|
61
|
+
cwd=cwd,
|
|
56
62
|
)
|
|
57
63
|
untracked = [
|
|
58
64
|
line.strip()
|
|
@@ -137,7 +143,7 @@ def smart_commit(
|
|
|
137
143
|
subprocess.run(["git", "add", "-A"], cwd=repo_path, check=True)
|
|
138
144
|
|
|
139
145
|
# Check for file changes and session changes
|
|
140
|
-
has_files = has_file_changes()
|
|
146
|
+
has_files = has_file_changes(cwd=repo_path)
|
|
141
147
|
has_sessions, session_files = has_session_changes(repo_root)
|
|
142
148
|
|
|
143
149
|
# No changes detected
|
realign/mcp_server.py
CHANGED
|
@@ -400,7 +400,11 @@ async def async_main():
|
|
|
400
400
|
print("[MCP Server] Starting Aline MCP server...", file=sys.stderr)
|
|
401
401
|
|
|
402
402
|
# Detect workspace path and start the watcher
|
|
403
|
+
# Try multiple methods since MCP server may run in different context
|
|
404
|
+
repo_path = None
|
|
405
|
+
|
|
403
406
|
try:
|
|
407
|
+
# Method 1: Try git rev-parse from current directory
|
|
404
408
|
result = subprocess.run(
|
|
405
409
|
["git", "rev-parse", "--show-toplevel"],
|
|
406
410
|
capture_output=True,
|
|
@@ -409,16 +413,38 @@ async def async_main():
|
|
|
409
413
|
)
|
|
410
414
|
if result.returncode == 0:
|
|
411
415
|
repo_path = Path(result.stdout.strip())
|
|
412
|
-
print(f"[MCP Server] Detected workspace: {repo_path}", file=sys.stderr)
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
416
|
+
print(f"[MCP Server] Detected workspace from git: {repo_path}", file=sys.stderr)
|
|
417
|
+
|
|
418
|
+
# Method 2: If not in git repo, try to find from Claude session files
|
|
419
|
+
if not repo_path:
|
|
420
|
+
claude_projects = Path.home() / ".claude" / "projects"
|
|
421
|
+
if claude_projects.exists():
|
|
422
|
+
# Find most recently modified session file
|
|
423
|
+
session_files = list(claude_projects.glob("*/*.jsonl"))
|
|
424
|
+
if session_files:
|
|
425
|
+
# Sort by modification time, newest first
|
|
426
|
+
session_files.sort(key=lambda p: p.stat().st_mtime, reverse=True)
|
|
427
|
+
# Extract project path from directory name
|
|
428
|
+
# Format: -Users-jundewu-Downloads-code-noclue -> /Users/jundewu/Downloads/code/noclue
|
|
429
|
+
project_dir_name = session_files[0].parent.name
|
|
430
|
+
if project_dir_name.startswith('-'):
|
|
431
|
+
# Convert back to path: -Users-foo-bar -> /Users/foo/bar
|
|
432
|
+
# Note: underscores were also replaced with dashes, but we can't distinguish
|
|
433
|
+
# So we just replace dashes with slashes
|
|
434
|
+
path_str = '/' + project_dir_name[1:].replace('-', '/')
|
|
435
|
+
candidate_path = Path(path_str)
|
|
436
|
+
if candidate_path.exists():
|
|
437
|
+
repo_path = candidate_path
|
|
438
|
+
print(f"[MCP Server] Detected workspace from Claude session: {repo_path}", file=sys.stderr)
|
|
439
|
+
|
|
440
|
+
# Method 3: Fallback to current directory
|
|
441
|
+
if not repo_path:
|
|
418
442
|
repo_path = Path.cwd()
|
|
419
443
|
print(f"[MCP Server] Using current directory: {repo_path}", file=sys.stderr)
|
|
420
|
-
|
|
421
|
-
|
|
444
|
+
|
|
445
|
+
# Start the watcher
|
|
446
|
+
await start_watcher(repo_path)
|
|
447
|
+
|
|
422
448
|
except Exception as e:
|
|
423
449
|
print(f"[MCP Server] Warning: Could not start watcher: {e}", file=sys.stderr)
|
|
424
450
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|