aline-ai 0.2.2__py3-none-any.whl → 0.2.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.2.2
3
+ Version: 0.2.3
4
4
  Summary: Shared AI memory; everyone knows everything in teams
5
5
  Author: Sharemind
6
6
  License: MIT
@@ -1,11 +1,11 @@
1
- aline_ai-0.2.2.dist-info/licenses/LICENSE,sha256=H8wTqV5IF1oHw_HbBtS1PSDU8G_q81yblEIL_JfV8Vo,1077
2
- realign/__init__.py,sha256=f1FalM6Y9iEIqHcRYlPxgxYsNHpJAHkmJtFz4WPRUeU,68
1
+ aline_ai-0.2.3.dist-info/licenses/LICENSE,sha256=H8wTqV5IF1oHw_HbBtS1PSDU8G_q81yblEIL_JfV8Vo,1077
2
+ realign/__init__.py,sha256=6iuIYTdZeDYzshM5Mw9bUC2pET6Fut-Xfw0PM84c7tM,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/file_lock.py,sha256=-9c3tMdMj_ZxmasK5y6hV9Gfo6KDsSO3Q7PXiTBhsu4,3369
8
- realign/hooks.py,sha256=80x7kF7t_D2D0TWM4whCU2Id3ItgkPXeREKkz1jfL_c,48751
8
+ realign/hooks.py,sha256=GzkEbW35-ifwAilYbVxDpNURZ_7XrF68DTqDSQ8v7fE,50670
9
9
  realign/logging_config.py,sha256=KvkKktF-bkUu031y9vgUoHpsbnOw7ud25jhpzliNZwA,4929
10
10
  realign/mcp_server.py,sha256=dntFatMpozI80K5hHrIiQ9sviC6ARKTP89goULhi1T4,16477
11
11
  realign/mcp_watcher.py,sha256=ffYOXDLuf9T6Kab3CdGNAOY3DBlAbjZrVrSjM5RdYGU,26828
@@ -14,12 +14,12 @@ realign/commands/__init__.py,sha256=GG6IMw6fUBQAXGJDFJvOOQgv6pkiRSfMh8z3AYXTyRM,
14
14
  realign/commands/auto_commit.py,sha256=jgjAYZHqN34NmQkncZg3Vtwsl3MyAlsvucxEBwUj7ko,7450
15
15
  realign/commands/commit.py,sha256=mlwrv5nfTRY17WlcAdiJKKGh5uM7dGvT7sMxhdbsfkw,12605
16
16
  realign/commands/config.py,sha256=iiu7usqw00djKZja5bx0iDH8DB0vU2maUPMkXLdgXwI,6609
17
- realign/commands/init.py,sha256=52WkcgdTdsvYXYOuTQ0zR1QF6QOWsjWOuu0f8vLhbL4,13452
17
+ realign/commands/init.py,sha256=vOXSAveWgP8TWp0rgqZO8zNRKZMPiaxWsg4PeDZ9RVs,13586
18
18
  realign/commands/search.py,sha256=xTWuX0lpjQPX8cen0ewl-BNF0FeWgjMwN06bdeesED8,18770
19
19
  realign/commands/session_utils.py,sha256=L1DwZIGCOBirp6tkAswACJEeDa6i9aAAfsialAs4rRY,864
20
20
  realign/commands/show.py,sha256=A9LvhOBcY6_HoI76irPB2rBOSgdftBuX2uZiO8IwNoU,16338
21
- aline_ai-0.2.2.dist-info/METADATA,sha256=Eck_4ZFdzNnAcomzVJ5aoK4XgwPKpBmh8NiAzJfN2RE,1398
22
- aline_ai-0.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- aline_ai-0.2.2.dist-info/entry_points.txt,sha256=h-NocHDzSueXfsepHTIdRPNQzhNZQPAztJfldd-mQTE,202
24
- aline_ai-0.2.2.dist-info/top_level.txt,sha256=yIL3s2xv9nf1GwD5n71Aq_JEIV4AfzCIDNKBzewuRm4,8
25
- aline_ai-0.2.2.dist-info/RECORD,,
21
+ aline_ai-0.2.3.dist-info/METADATA,sha256=aHvGzs0gfRaJI8HBTXMA-4h-V42mHAKmMROKjSk75SE,1398
22
+ aline_ai-0.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ aline_ai-0.2.3.dist-info/entry_points.txt,sha256=h-NocHDzSueXfsepHTIdRPNQzhNZQPAztJfldd-mQTE,202
24
+ aline_ai-0.2.3.dist-info/top_level.txt,sha256=yIL3s2xv9nf1GwD5n71Aq_JEIV4AfzCIDNKBzewuRm4,8
25
+ aline_ai-0.2.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.2.2"
3
+ __version__ = "0.2.3"
realign/commands/init.py CHANGED
@@ -126,7 +126,9 @@ def init_repository(
126
126
  "# Uncomment to ignore session files\n"
127
127
  "# sessions/\n\n"
128
128
  "# Ignore metadata files (used internally to prevent duplicate processing)\n"
129
- ".metadata/\n"
129
+ ".metadata/\n\n"
130
+ "# Ignore original sessions (contains potential secrets before redaction)\n"
131
+ "sessions-original/\n"
130
132
  )
131
133
  gitignore_path.write_text(gitignore_content, encoding="utf-8")
132
134
 
realign/hooks.py CHANGED
@@ -987,35 +987,75 @@ def process_sessions(
987
987
  user = user or get_git_user()
988
988
  logger.debug(f"Git user: {user}")
989
989
 
990
- # Copy all sessions to repo (with optional redaction)
990
+ # Pre-commit mode: Copy sessions to repo (with optional redaction)
991
+ # Prepare-commit-msg mode: Reuse already copied sessions from .realign/sessions/
991
992
  session_relpaths = []
992
993
  session_metadata_map = {} # Map session_relpath -> content_size
993
994
  any_redacted = False
994
- for session_file in session_files:
995
- try:
996
- _, session_relpath, was_redacted, content_size = copy_session_to_repo(
997
- session_file, repo_root, user, config
998
- )
999
- session_relpaths.append(session_relpath)
1000
- session_metadata_map[session_relpath] = content_size
1001
- if was_redacted:
1002
- any_redacted = True
1003
- except Exception as e:
1004
- logger.error(f"Failed to copy session file {session_file}: {e}", exc_info=True)
1005
- print(f"Warning: Could not copy session file {session_file}: {e}", file=sys.stderr)
1006
- continue
1007
995
 
1008
- if not session_relpaths:
1009
- logger.warning("No session files copied successfully")
1010
- return {
1011
- "summary": "",
1012
- "session_relpaths": [],
1013
- "redacted": False,
1014
- "summary_entries": [],
1015
- "summary_model": "",
1016
- }
996
+ if pre_commit_mode:
997
+ # Pre-commit: Copy and redact sessions (heavy work done here)
998
+ logger.info("Pre-commit mode: Copying and processing sessions")
999
+ for session_file in session_files:
1000
+ try:
1001
+ _, session_relpath, was_redacted, content_size = copy_session_to_repo(
1002
+ session_file, repo_root, user, config
1003
+ )
1004
+ session_relpaths.append(session_relpath)
1005
+ session_metadata_map[session_relpath] = content_size
1006
+ if was_redacted:
1007
+ any_redacted = True
1008
+ except Exception as e:
1009
+ logger.error(f"Failed to copy session file {session_file}: {e}", exc_info=True)
1010
+ print(f"Warning: Could not copy session file {session_file}: {e}", file=sys.stderr)
1011
+ continue
1017
1012
 
1018
- logger.info(f"Copied {len(session_relpaths)} session(s): {session_relpaths}")
1013
+ if not session_relpaths:
1014
+ logger.warning("No session files copied successfully")
1015
+ return {
1016
+ "summary": "",
1017
+ "session_relpaths": [],
1018
+ "redacted": False,
1019
+ "summary_entries": [],
1020
+ "summary_model": "",
1021
+ }
1022
+
1023
+ logger.info(f"Copied {len(session_relpaths)} session(s): {session_relpaths}")
1024
+ else:
1025
+ # Prepare-commit-msg: Just find existing sessions in .realign/sessions/
1026
+ # No need to copy again - pre-commit already did this
1027
+ logger.info("Prepare-commit-msg mode: Using existing sessions from .realign/sessions/")
1028
+ sessions_dir = repo_root / ".realign" / "sessions"
1029
+
1030
+ if sessions_dir.exists():
1031
+ # Find all session files that were processed by pre-commit
1032
+ for session_file in sessions_dir.glob("*.jsonl"):
1033
+ # Skip agent sessions (these are sub-tasks)
1034
+ if session_file.name.startswith("agent-"):
1035
+ continue
1036
+
1037
+ session_relpath = str(session_file.relative_to(repo_root))
1038
+ session_relpaths.append(session_relpath)
1039
+
1040
+ # Get file size
1041
+ try:
1042
+ content_size = session_file.stat().st_size
1043
+ session_metadata_map[session_relpath] = content_size
1044
+ except Exception as e:
1045
+ logger.warning(f"Could not get size for {session_relpath}: {e}")
1046
+ session_metadata_map[session_relpath] = 0
1047
+
1048
+ if not session_relpaths:
1049
+ logger.warning("No existing session files found in .realign/sessions/")
1050
+ return {
1051
+ "summary": "",
1052
+ "session_relpaths": [],
1053
+ "redacted": False,
1054
+ "summary_entries": [],
1055
+ "summary_model": "",
1056
+ }
1057
+
1058
+ logger.info(f"Found {len(session_relpaths)} existing session(s): {session_relpaths}")
1019
1059
 
1020
1060
  # If pre-commit mode, save metadata and return session paths (summary will be generated later)
1021
1061
  if pre_commit_mode: