aline-ai 0.1.2__py3-none-any.whl → 0.1.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aline-ai
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Shared AI memory; everyone knows everything in teams
5
5
  Author: Sharemind
6
6
  License: MIT
@@ -1,12 +1,12 @@
1
- aline_ai-0.1.2.dist-info/licenses/LICENSE,sha256=H8wTqV5IF1oHw_HbBtS1PSDU8G_q81yblEIL_JfV8Vo,1077
2
- realign/__init__.py,sha256=vbGKpkjVJG35eBo-5-ncGbNP095pDzKws749XISLcJg,68
1
+ aline_ai-0.1.3.dist-info/licenses/LICENSE,sha256=H8wTqV5IF1oHw_HbBtS1PSDU8G_q81yblEIL_JfV8Vo,1077
2
+ realign/__init__.py,sha256=l5m3jmTKnHo3QKvqEtK55mM-yaFZtwAuMDofmHF1qFc,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=NaT1c7dCNfOvmBPkBMpWI63wqmJQ3wQP2MiMqNUmFIQ,15346
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
@@ -16,8 +16,8 @@ realign/commands/config.py,sha256=oarvn6UuGT8svd2h5_8M_ueV5QWOCUOn8SYoa4XYjs8,65
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.2.dist-info/METADATA,sha256=MLVqx9fJTsUyeAxe9ZZogkfYBv9GGb-DXbcdwPwbxt0,1398
20
- aline_ai-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
- aline_ai-0.1.2.dist-info/entry_points.txt,sha256=h-NocHDzSueXfsepHTIdRPNQzhNZQPAztJfldd-mQTE,202
22
- aline_ai-0.1.2.dist-info/top_level.txt,sha256=yIL3s2xv9nf1GwD5n71Aq_JEIV4AfzCIDNKBzewuRm4,8
23
- aline_ai-0.1.2.dist-info/RECORD,,
19
+ aline_ai-0.1.3.dist-info/METADATA,sha256=uxqSPbYXK_-p2egCrKOYKpaOxefKKyMJAz2uw4D-k7w,1398
20
+ aline_ai-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
+ aline_ai-0.1.3.dist-info/entry_points.txt,sha256=h-NocHDzSueXfsepHTIdRPNQzhNZQPAztJfldd-mQTE,202
22
+ aline_ai-0.1.3.dist-info/top_level.txt,sha256=yIL3s2xv9nf1GwD5n71Aq_JEIV4AfzCIDNKBzewuRm4,8
23
+ aline_ai-0.1.3.dist-info/RECORD,,
realign/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """Aline - AI Agent Chat Session Tracker."""
2
2
 
3
- __version__ = "0.1.2"
3
+ __version__ = "0.1.3"
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
- # Start the dialogue watcher in the background
414
- await start_watcher(repo_path)
415
- else:
416
- # Not in a workspace - use current directory
417
- # The watcher will auto-initialize when needed
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
- print(f"[MCP Server] Watcher will auto-initialize when session changes detected", file=sys.stderr)
421
- await start_watcher(repo_path)
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