cli-mem 0.2.0__tar.gz → 0.3.0__tar.gz

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.
Files changed (31) hide show
  1. {cli_mem-0.2.0 → cli_mem-0.3.0}/.github/workflows/release.yml +13 -0
  2. {cli_mem-0.2.0 → cli_mem-0.3.0}/PKG-INFO +1 -1
  3. {cli_mem-0.2.0 → cli_mem-0.3.0}/pyproject.toml +1 -1
  4. {cli_mem-0.2.0 → cli_mem-0.3.0}/src/mem/__init__.py +1 -1
  5. {cli_mem-0.2.0 → cli_mem-0.3.0}/src/mem/capture.py +4 -4
  6. {cli_mem-0.2.0 → cli_mem-0.3.0}/src/mem/cli.py +491 -63
  7. {cli_mem-0.2.0 → cli_mem-0.3.0}/src/mem/groups.py +30 -16
  8. {cli_mem-0.2.0 → cli_mem-0.3.0}/src/mem/models.py +22 -0
  9. {cli_mem-0.2.0 → cli_mem-0.3.0}/src/mem/patterns.py +4 -5
  10. {cli_mem-0.2.0 → cli_mem-0.3.0}/src/mem/search.py +3 -1
  11. {cli_mem-0.2.0 → cli_mem-0.3.0}/src/mem/storage.py +48 -19
  12. cli_mem-0.3.0/src/mem/variables.py +324 -0
  13. {cli_mem-0.2.0 → cli_mem-0.3.0}/tests/conftest.py +3 -1
  14. {cli_mem-0.2.0 → cli_mem-0.3.0}/tests/test_capture.py +91 -23
  15. {cli_mem-0.2.0 → cli_mem-0.3.0}/tests/test_groups.py +660 -164
  16. {cli_mem-0.2.0 → cli_mem-0.3.0}/tests/test_patterns.py +53 -20
  17. {cli_mem-0.2.0 → cli_mem-0.3.0}/tests/test_search.py +45 -11
  18. {cli_mem-0.2.0 → cli_mem-0.3.0}/tests/test_storage.py +17 -4
  19. {cli_mem-0.2.0 → cli_mem-0.3.0}/.github/workflows/ci.yml +0 -0
  20. {cli_mem-0.2.0 → cli_mem-0.3.0}/.gitignore +0 -0
  21. {cli_mem-0.2.0 → cli_mem-0.3.0}/ARCHITECTURE.md +0 -0
  22. {cli_mem-0.2.0 → cli_mem-0.3.0}/LICENSE +0 -0
  23. {cli_mem-0.2.0 → cli_mem-0.3.0}/PHILOSOPHY.md +0 -0
  24. {cli_mem-0.2.0 → cli_mem-0.3.0}/README.md +0 -0
  25. {cli_mem-0.2.0 → cli_mem-0.3.0}/assets/.gitkeep +0 -0
  26. {cli_mem-0.2.0 → cli_mem-0.3.0}/docs/decisions/001-jsonl-over-sqlite.md +0 -0
  27. {cli_mem-0.2.0 → cli_mem-0.3.0}/docs/decisions/002-apple-fm-sdk-for-patterns.md +0 -0
  28. {cli_mem-0.2.0 → cli_mem-0.3.0}/docs/decisions/003-no-daemon.md +0 -0
  29. {cli_mem-0.2.0 → cli_mem-0.3.0}/docs/decisions/004-per-repo-jsonl.md +0 -0
  30. {cli_mem-0.2.0 → cli_mem-0.3.0}/hooks/mem.zsh +0 -0
  31. {cli_mem-0.2.0 → cli_mem-0.3.0}/install.sh +0 -0
@@ -18,6 +18,19 @@ jobs:
18
18
  with:
19
19
  python-version: "3.12"
20
20
 
21
+ - name: Verify version matches tag
22
+ run: |
23
+ TAG="${{ github.ref_name }}"
24
+ TAG_VERSION="${TAG#v}"
25
+ PKG_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
26
+ INIT_VERSION=$(python -c "exec(open('src/mem/__init__.py').read()); print(__version__)")
27
+ echo "Tag: $TAG_VERSION | pyproject.toml: $PKG_VERSION | __init__.py: $INIT_VERSION"
28
+ if [ "$TAG_VERSION" != "$PKG_VERSION" ] || [ "$TAG_VERSION" != "$INIT_VERSION" ]; then
29
+ echo "::error::Version mismatch! Tag=$TAG_VERSION pyproject.toml=$PKG_VERSION __init__.py=$INIT_VERSION"
30
+ echo "Fix: update both pyproject.toml and src/mem/__init__.py, commit, then re-tag."
31
+ exit 1
32
+ fi
33
+
21
34
  - name: Build and publish to PyPI
22
35
  env:
23
36
  TWINE_USERNAME: __token__
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cli-mem
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Privacy-first CLI that turns shell history into searchable memory
5
5
  Project-URL: GitHub, https://github.com/matinsaurralde/mem
6
6
  Author: Matias Insaurralde
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "cli-mem"
7
- version = "0.2.0"
7
+ version = "0.3.0"
8
8
  description = "Privacy-first CLI that turns shell history into searchable memory"
9
9
  license = "MIT"
10
10
  readme = "README.md"
@@ -1,3 +1,3 @@
1
1
  """mem — your shell history, understood."""
2
2
 
3
- __version__ = "0.2.0"
3
+ __version__ = "0.3.0"
@@ -108,9 +108,7 @@ class SessionTracker:
108
108
  def _save_state(self, state: SessionState) -> None:
109
109
  """Persist session state to disk."""
110
110
  storage.ensure_dirs()
111
- self._state_path.write_text(
112
- state.model_dump_json(), encoding="utf-8"
113
- )
111
+ self._state_path.write_text(state.model_dump_json(), encoding="utf-8")
114
112
 
115
113
  def _clear_state(self) -> None:
116
114
  """Remove session state file."""
@@ -169,7 +167,8 @@ class SessionTracker:
169
167
  session = WorkSession(
170
168
  id=state.session_id,
171
169
  summary=summary,
172
- started_at=state.last_command_ts - (len(state.commands) * 10), # approximate
170
+ started_at=state.last_command_ts
171
+ - (len(state.commands) * 10), # approximate
173
172
  ended_at=state.last_command_ts,
174
173
  dir="", # not tracked in state for simplicity
175
174
  repo=state.last_repo,
@@ -186,6 +185,7 @@ class SessionTracker:
186
185
  try:
187
186
  import asyncio
188
187
  from mem.patterns import generate_session_summary
188
+
189
189
  result = asyncio.run(generate_session_summary(commands))
190
190
  if result:
191
191
  return result