aline-ai 0.1.10__py3-none-any.whl → 0.2.1__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.10.dist-info → aline_ai-0.2.1.dist-info}/METADATA +1 -1
- aline_ai-0.2.1.dist-info/RECORD +25 -0
- realign/__init__.py +1 -1
- realign/commands/auto_commit.py +1 -1
- realign/commands/commit.py +100 -0
- realign/commands/config.py +13 -12
- realign/commands/init.py +48 -16
- realign/commands/search.py +57 -31
- realign/commands/session_utils.py +28 -0
- realign/commands/show.py +25 -38
- realign/file_lock.py +120 -0
- realign/hooks.py +362 -49
- realign/mcp_server.py +4 -54
- realign/mcp_watcher.py +356 -253
- aline_ai-0.1.10.dist-info/RECORD +0 -23
- {aline_ai-0.1.10.dist-info → aline_ai-0.2.1.dist-info}/WHEEL +0 -0
- {aline_ai-0.1.10.dist-info → aline_ai-0.2.1.dist-info}/entry_points.txt +0 -0
- {aline_ai-0.1.10.dist-info → aline_ai-0.2.1.dist-info}/licenses/LICENSE +0 -0
- {aline_ai-0.1.10.dist-info → aline_ai-0.2.1.dist-info}/top_level.txt +0 -0
realign/mcp_server.py
CHANGED
|
@@ -432,62 +432,12 @@ async def async_main():
|
|
|
432
432
|
_server_log(f"Current working directory: {Path.cwd()}")
|
|
433
433
|
_server_log(f"Home directory: {Path.home()}")
|
|
434
434
|
|
|
435
|
-
#
|
|
436
|
-
# Try multiple methods since MCP server may run in different context
|
|
437
|
-
repo_path = None
|
|
438
|
-
|
|
435
|
+
# Start the watcher (no repo_path needed - it will extract dynamically from sessions)
|
|
439
436
|
try:
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
["git", "rev-parse", "--show-toplevel"],
|
|
443
|
-
capture_output=True,
|
|
444
|
-
text=True,
|
|
445
|
-
check=False,
|
|
446
|
-
)
|
|
447
|
-
if result.returncode == 0:
|
|
448
|
-
repo_path = Path(result.stdout.strip())
|
|
449
|
-
_server_log(f"Detected workspace from git: {repo_path}")
|
|
450
|
-
else:
|
|
451
|
-
_server_log(f"Not in git repo (cwd: {Path.cwd()})")
|
|
452
|
-
|
|
453
|
-
# Method 2: If not in git repo, try to find from Claude session files
|
|
454
|
-
if not repo_path:
|
|
455
|
-
claude_projects = Path.home() / ".claude" / "projects"
|
|
456
|
-
_server_log(f"Checking Claude projects at: {claude_projects}")
|
|
457
|
-
if claude_projects.exists():
|
|
458
|
-
# Find most recently modified session file
|
|
459
|
-
session_files = list(claude_projects.glob("*/*.jsonl"))
|
|
460
|
-
_server_log(f"Found {len(session_files)} Claude session files")
|
|
461
|
-
if session_files:
|
|
462
|
-
# Sort by modification time, newest first
|
|
463
|
-
session_files.sort(key=lambda p: p.stat().st_mtime, reverse=True)
|
|
464
|
-
_server_log(f"Most recent session: {session_files[0]}")
|
|
465
|
-
# Extract project path from directory name
|
|
466
|
-
# Format: -Users-jundewu-Downloads-code-noclue -> /Users/jundewu/Downloads/code/noclue
|
|
467
|
-
project_dir_name = session_files[0].parent.name
|
|
468
|
-
_server_log(f"Project dir name: {project_dir_name}")
|
|
469
|
-
if project_dir_name.startswith('-'):
|
|
470
|
-
# Convert back to path: -Users-foo-bar -> /Users/foo/bar
|
|
471
|
-
# Note: underscores were also replaced with dashes, but we can't distinguish
|
|
472
|
-
# So we just replace dashes with slashes
|
|
473
|
-
path_str = '/' + project_dir_name[1:].replace('-', '/')
|
|
474
|
-
candidate_path = Path(path_str)
|
|
475
|
-
_server_log(f"Candidate path: {candidate_path}, exists: {candidate_path.exists()}")
|
|
476
|
-
if candidate_path.exists():
|
|
477
|
-
repo_path = candidate_path
|
|
478
|
-
_server_log(f"Detected workspace from Claude session: {repo_path}")
|
|
479
|
-
|
|
480
|
-
# Method 3: Fallback to current directory
|
|
481
|
-
if not repo_path:
|
|
482
|
-
repo_path = Path.cwd()
|
|
483
|
-
_server_log(f"Using current directory: {repo_path}")
|
|
484
|
-
|
|
485
|
-
# Start the watcher
|
|
486
|
-
_server_log(f"Starting watcher for: {repo_path}")
|
|
487
|
-
await start_watcher(repo_path)
|
|
488
|
-
|
|
437
|
+
await start_watcher()
|
|
438
|
+
print("[MCP Server] Watcher started (will auto-detect project paths from sessions)", file=sys.stderr)
|
|
489
439
|
except Exception as e:
|
|
490
|
-
|
|
440
|
+
print(f"[MCP Server] Warning: Could not start watcher: {e}", file=sys.stderr)
|
|
491
441
|
import traceback
|
|
492
442
|
traceback.print_exc(file=sys.stderr)
|
|
493
443
|
|