aline-ai 0.1.1__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.1
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,13 +1,13 @@
1
- aline_ai-0.1.1.dist-info/licenses/LICENSE,sha256=H8wTqV5IF1oHw_HbBtS1PSDU8G_q81yblEIL_JfV8Vo,1077
2
- realign/__init__.py,sha256=rbqKcU4VX7pqy2whuU-fAUj9L1rEIEdaemJUOKCYBCc,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
10
- realign/mcp_watcher.py,sha256=4F0xmREG0rF6Pun3D2zpoCqilmtvoERyKQNl3LIhLoI,12594
9
+ realign/mcp_server.py,sha256=oe2RQZ7_en_6vDMqXgVaSHCSqc_aQejc8wM2vkF0rj4,16702
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
@@ -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.1.dist-info/METADATA,sha256=wLufq517bkK305Ifuv1xw0uqVItKoolNuMNqrjJqRnU,1398
20
- aline_ai-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
- aline_ai-0.1.1.dist-info/entry_points.txt,sha256=h-NocHDzSueXfsepHTIdRPNQzhNZQPAztJfldd-mQTE,202
22
- aline_ai-0.1.1.dist-info/top_level.txt,sha256=yIL3s2xv9nf1GwD5n71Aq_JEIV4AfzCIDNKBzewuRm4,8
23
- aline_ai-0.1.1.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.1"
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
 
realign/mcp_watcher.py CHANGED
@@ -119,12 +119,18 @@ class DialogueWatcher:
119
119
  try:
120
120
  current_sizes = self._get_session_sizes()
121
121
 
122
+ # Debug: log if no sessions found (only once)
123
+ if not current_sizes and not hasattr(self, '_no_session_warned'):
124
+ print(f"[MCP Watcher] Warning: No active sessions found for repo: {self.repo_path}", file=sys.stderr)
125
+ self._no_session_warned = True
126
+
122
127
  # Detect changed files
123
128
  changed_files = []
124
129
  for path, size in current_sizes.items():
125
130
  old_size = self.last_session_sizes.get(path, 0)
126
131
  if size > old_size:
127
132
  changed_files.append(Path(path))
133
+ print(f"[MCP Watcher] Session file changed: {Path(path).name} ({old_size} -> {size} bytes)", file=sys.stderr)
128
134
 
129
135
  if changed_files:
130
136
  # File changed - cancel any pending commit and schedule a new one
@@ -211,6 +217,8 @@ class DialogueWatcher:
211
217
  timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
212
218
  message = f"chore: Auto-commit MCP session ({timestamp})"
213
219
 
220
+ print(f"[MCP Watcher] Attempting commit with message: {message}", file=sys.stderr)
221
+
214
222
  # Use realign commit command
215
223
  result = await asyncio.get_event_loop().run_in_executor(
216
224
  None,