aline-ai 0.1.8__py3-none-any.whl → 0.1.10__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.8
3
+ Version: 0.1.10
4
4
  Summary: Shared AI memory; everyone knows everything in teams
5
5
  Author: Sharemind
6
6
  License: MIT
@@ -1,5 +1,5 @@
1
- aline_ai-0.1.8.dist-info/licenses/LICENSE,sha256=H8wTqV5IF1oHw_HbBtS1PSDU8G_q81yblEIL_JfV8Vo,1077
2
- realign/__init__.py,sha256=SinCCjUdQJgIbiL3QFxgLcSeMMNgu-2OIZmOD-_yaHM,68
1
+ aline_ai-0.1.10.dist-info/licenses/LICENSE,sha256=H8wTqV5IF1oHw_HbBtS1PSDU8G_q81yblEIL_JfV8Vo,1077
2
+ realign/__init__.py,sha256=XAZn0QmHa9QpFynxcqvNBgMblMHb6ppHrHzvnAj8p1s,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
@@ -7,17 +7,17 @@ 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
9
  realign/mcp_server.py,sha256=HGg0nW9_cJnW-22bSBwBONpid3Lq8UICyWyzOAny4OM,18963
10
- realign/mcp_watcher.py,sha256=xL35Nz35YF6Mc9yu-nCbDzKzTFHQaYmtPNfyBzKKOhc,16038
10
+ realign/mcp_watcher.py,sha256=0bMD1Ah7hmmpozJzopnjFTDJrpq76jyTZaXat-Ropy0,19708
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
14
  realign/commands/commit.py,sha256=yjhOrkRY_UvAa5EXufwwcYZaqE83L9Bzd0YPUc59fic,9196
15
15
  realign/commands/config.py,sha256=oarvn6UuGT8svd2h5_8M_ueV5QWOCUOn8SYoa4XYjs8,6500
16
- realign/commands/init.py,sha256=EpSzh2Dd2EmEQ_wo3vAsg6Uq7_YOlQWIpzIkZa_2y0A,11863
16
+ realign/commands/init.py,sha256=QURhANbtLog6oFZB34sKtLeSGSdMG5qSVL8-5i1qzwk,11809
17
17
  realign/commands/search.py,sha256=0CZaXll99wtd01MRiZk5NAblxgogc4RUAzMyJunvckE,18044
18
18
  realign/commands/show.py,sha256=P1waa94-AKJr9XjagkE40OHMXzE6IwC74DpeDKqwsqw,16693
19
- aline_ai-0.1.8.dist-info/METADATA,sha256=_zzB8FOdgwI6cj1Ja6alPVifXEHVm4A8vN0G6P5_Joc,1398
20
- aline_ai-0.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
- aline_ai-0.1.8.dist-info/entry_points.txt,sha256=h-NocHDzSueXfsepHTIdRPNQzhNZQPAztJfldd-mQTE,202
22
- aline_ai-0.1.8.dist-info/top_level.txt,sha256=yIL3s2xv9nf1GwD5n71Aq_JEIV4AfzCIDNKBzewuRm4,8
23
- aline_ai-0.1.8.dist-info/RECORD,,
19
+ aline_ai-0.1.10.dist-info/METADATA,sha256=qJL5p2Vn5LAW9_A5mtlfdItwYLq9-FxdYPLcbWZaYbc,1399
20
+ aline_ai-0.1.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
+ aline_ai-0.1.10.dist-info/entry_points.txt,sha256=h-NocHDzSueXfsepHTIdRPNQzhNZQPAztJfldd-mQTE,202
22
+ aline_ai-0.1.10.dist-info/top_level.txt,sha256=yIL3s2xv9nf1GwD5n71Aq_JEIV4AfzCIDNKBzewuRm4,8
23
+ aline_ai-0.1.10.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.8"
3
+ __version__ = "0.1.9"
realign/commands/init.py CHANGED
@@ -246,23 +246,23 @@ def get_pre_commit_hook() -> str:
246
246
  # ReAlign pre-commit hook
247
247
  # Finds and stages agent session files before commit
248
248
 
249
- # 1. Try to find realign-hook-pre-commit in PATH first (pipx/pip installations)
250
- if command -v realign-hook-pre-commit >/dev/null 2>&1; then
251
- VERSION=$(realign version 2>/dev/null | grep -oE '[0-9]+\\.[0-9]+\\.[0-9]+' || echo "unknown")
252
- echo "ReAlign pre-commit hook (dev-$VERSION)" >&2
253
- exec realign-hook-pre-commit "$@"
249
+ # 1. Try to find aline-hook-pre-commit in PATH first (pipx/pip installations)
250
+ if command -v aline-hook-pre-commit >/dev/null 2>&1; then
251
+ VERSION=$(aline version 2>/dev/null | grep -oE '[0-9]+\\.[0-9]+\\.[0-9]+' || echo "unknown")
252
+ echo "Aline pre-commit hook (dev-$VERSION)" >&2
253
+ exec aline-hook-pre-commit "$@"
254
254
  fi
255
255
 
256
256
  # 2. Try using uvx (for MCP installations where command is in uvx cache)
257
257
  if command -v uvx >/dev/null 2>&1; then
258
- VERSION=$(uvx --from realign-git realign version 2>/dev/null | grep -oE '[0-9]+\\.[0-9]+\\.[0-9]+' || echo "unknown")
259
- echo "ReAlign pre-commit hook (release-$VERSION)" >&2
260
- exec uvx --from realign-git realign-hook-pre-commit "$@"
258
+ VERSION=$(uvx --from aline-ai aline version 2>/dev/null | grep -oE '[0-9]+\\.[0-9]+\\.[0-9]+' || echo "unknown")
259
+ echo "Aline pre-commit hook (release-$VERSION)" >&2
260
+ exec uvx --from aline-ai aline-hook-pre-commit "$@"
261
261
  fi
262
262
 
263
263
  # If all else fails, print an error
264
- echo "Error: Cannot find realign. Please ensure it's installed:" >&2
265
- echo " - For CLI: pipx install realign-git" >&2
264
+ echo "Error: Cannot find aline. Please ensure it's installed:" >&2
265
+ echo " - For CLI: pipx install aline-ai" >&2
266
266
  echo " - For MCP: Ensure uvx is available" >&2
267
267
  exit 1
268
268
  '''
@@ -282,23 +282,23 @@ if [ "$COMMIT_SOURCE" = "merge" ] || [ "$COMMIT_SOURCE" = "squash" ] || [ "$COMM
282
282
  exit 0
283
283
  fi
284
284
 
285
- # 1. Try to find realign-hook-prepare-commit-msg in PATH first (pipx/pip installations)
286
- if command -v realign-hook-prepare-commit-msg >/dev/null 2>&1; then
287
- VERSION=$(realign version 2>/dev/null | grep -oE '[0-9]+\\.[0-9]+\\.[0-9]+' || echo "unknown")
288
- echo "ReAlign prepare-commit-msg hook (dev-$VERSION)" >&2
289
- exec realign-hook-prepare-commit-msg "$@"
285
+ # 1. Try to find aline-hook-prepare-commit-msg in PATH first (pipx/pip installations)
286
+ if command -v aline-hook-prepare-commit-msg >/dev/null 2>&1; then
287
+ VERSION=$(aline version 2>/dev/null | grep -oE '[0-9]+\\.[0-9]+\\.[0-9]+' || echo "unknown")
288
+ echo "Aline prepare-commit-msg hook (dev-$VERSION)" >&2
289
+ exec aline-hook-prepare-commit-msg "$@"
290
290
  fi
291
291
 
292
292
  # 2. Try using uvx (for MCP installations where command is in uvx cache)
293
293
  if command -v uvx >/dev/null 2>&1; then
294
- VERSION=$(uvx --from realign-git realign version 2>/dev/null | grep -oE '[0-9]+\\.[0-9]+\\.[0-9]+' || echo "unknown")
295
- echo "ReAlign prepare-commit-msg hook (release-$VERSION)" >&2
296
- exec uvx --from realign-git realign-hook-prepare-commit-msg "$@"
294
+ VERSION=$(uvx --from aline-ai aline version 2>/dev/null | grep -oE '[0-9]+\\.[0-9]+\\.[0-9]+' || echo "unknown")
295
+ echo "Aline prepare-commit-msg hook (release-$VERSION)" >&2
296
+ exec uvx --from aline-ai aline-hook-prepare-commit-msg "$@"
297
297
  fi
298
298
 
299
299
  # If all else fails, print an error
300
- echo "Error: Cannot find realign. Please ensure it's installed:" >&2
301
- echo " - For CLI: pipx install realign-git" >&2
300
+ echo "Error: Cannot find aline. Please ensure it's installed:" >&2
301
+ echo " - For CLI: pipx install aline-ai" >&2
302
302
  echo " - For MCP: Ensure uvx is available" >&2
303
303
  exit 1
304
304
  '''
realign/mcp_watcher.py CHANGED
@@ -261,29 +261,111 @@ class DialogueWatcher:
261
261
  Extract the actual project path from a Claude session file's location.
262
262
 
263
263
  Claude Code stores sessions in: ~/.claude/projects/-Users-username-path/session.jsonl
264
- The directory name encodes the project path with dashes replacing slashes.
264
+ The directory name encodes the project path with dashes replacing both slashes and underscores.
265
+ This means we need to intelligently reconstruct the path by testing which separators work.
265
266
  """
266
267
  try:
267
268
  project_dir_name = session_file.parent.name
268
269
  _log(f"Extracting project path from: {project_dir_name}")
269
270
 
270
271
  if project_dir_name.startswith('-'):
271
- # Convert back to path: -Users-foo-bar -> /Users/foo/bar
272
- path_str = '/' + project_dir_name[1:].replace('-', '/')
273
- candidate_path = Path(path_str)
274
- _log(f"Candidate project path: {candidate_path}")
272
+ # Split into segments
273
+ segments = project_dir_name[1:].split('-')
274
+ _log(f"Path segments: {segments}")
275
275
 
276
- if candidate_path.exists():
276
+ # Try to reconstruct the path by checking which combinations exist
277
+ candidate_path = self._reconstruct_path_from_segments(segments)
278
+
279
+ if candidate_path and candidate_path.exists():
277
280
  _log(f"Project path exists: {candidate_path}")
278
281
  return candidate_path
279
282
  else:
280
- _log(f"WARNING: Project path does not exist: {candidate_path}")
283
+ # Fallback: try simple replacement (for backward compatibility)
284
+ simple_path = Path('/' + project_dir_name[1:].replace('-', '/'))
285
+ if simple_path.exists():
286
+ _log(f"Project path exists (simple method): {simple_path}")
287
+ return simple_path
288
+ _log(f"WARNING: Could not find valid project path for: {project_dir_name}")
281
289
  else:
282
290
  _log(f"WARNING: Directory name doesn't start with '-': {project_dir_name}")
283
291
  except Exception as e:
284
292
  _log(f"Error extracting project path: {e}")
285
293
  return None
286
294
 
295
+ def _reconstruct_path_from_segments(self, segments: list) -> Optional[Path]:
296
+ """
297
+ Reconstruct a file path from encoded segments.
298
+
299
+ Claude Code encodes paths by replacing both '/' and '_' with '-'.
300
+ This method tries to find the correct path by testing which separators
301
+ produce valid paths.
302
+
303
+ Strategy:
304
+ 1. Start from root '/'
305
+ 2. Build path incrementally, checking if each partial path exists
306
+ 3. When a segment doesn't match, try combining with next segment using '_' or '-'
307
+ """
308
+ if not segments:
309
+ return None
310
+
311
+ current_path = Path('/')
312
+ i = 0
313
+
314
+ while i < len(segments):
315
+ segment = segments[i]
316
+
317
+ # Try direct match first (segment is a directory/file name)
318
+ test_path = current_path / segment
319
+ if test_path.exists():
320
+ current_path = test_path
321
+ i += 1
322
+ continue
323
+
324
+ # If direct match fails, try combining with next segments using '_' or '-'
325
+ found_match = False
326
+ for lookahead in range(1, min(10, len(segments) - i)): # Try up to 10 segments ahead
327
+ # Try combining segments with underscores
328
+ combined_underscore = '_'.join(segments[i:i+lookahead+1])
329
+ test_path_underscore = current_path / combined_underscore
330
+
331
+ # Try combining segments with hyphens
332
+ combined_hyphen = '-'.join(segments[i:i+lookahead+1])
333
+ test_path_hyphen = current_path / combined_hyphen
334
+
335
+ # Try mixed combinations for longer paths
336
+ if test_path_underscore.exists():
337
+ current_path = test_path_underscore
338
+ i += lookahead + 1
339
+ found_match = True
340
+ _log(f"Found match with underscores: {combined_underscore}")
341
+ break
342
+ elif test_path_hyphen.exists():
343
+ current_path = test_path_hyphen
344
+ i += lookahead + 1
345
+ found_match = True
346
+ _log(f"Found match with hyphens: {combined_hyphen}")
347
+ break
348
+
349
+ if not found_match:
350
+ # If no match found, this might be the final segment (file or non-existent dir)
351
+ # Just append remaining segments with '/' and check
352
+ remaining = '/'.join(segments[i:])
353
+ final_path = current_path / remaining
354
+ if final_path.exists():
355
+ return final_path
356
+
357
+ # Try treating remaining as underscore-joined
358
+ remaining_underscore = '_'.join(segments[i:])
359
+ final_path_underscore = current_path / remaining_underscore
360
+ if final_path_underscore.exists():
361
+ return final_path_underscore
362
+
363
+ # Nothing worked, return what we have
364
+ _log(f"Could not match segment '{segment}' at path {current_path}")
365
+ return None
366
+
367
+ return current_path if current_path != Path('/') else None
368
+
287
369
  async def _do_commit(self, project_path: Path):
288
370
  """Perform the actual commit for a specific project."""
289
371
  try: