agent-chat-reader 0.1.2__tar.gz → 0.1.3__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 (25) hide show
  1. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/PKG-INFO +1 -1
  2. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/pyproject.toml +1 -1
  3. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/__init__.py +1 -1
  4. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/cli.py +14 -8
  5. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/uv.lock +1 -1
  6. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  7. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/.github/workflows/ci.yml +0 -0
  8. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/.github/workflows/release.yml +0 -0
  9. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/.gitignore +0 -0
  10. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/.pre-commit-config.yaml +0 -0
  11. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/.python-version +0 -0
  12. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/AGENTS.md +0 -0
  13. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/LICENSE +0 -0
  14. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/README.md +0 -0
  15. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/docs/api.md +0 -0
  16. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/docs/ci-private-submodules.md +0 -0
  17. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/claude.py +0 -0
  18. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/codex.py +0 -0
  19. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/models.py +0 -0
  20. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/output.py +0 -0
  21. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/py.typed +0 -0
  22. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/templates/licenses/Apache-2.0 +0 -0
  23. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/templates/licenses/MIT +0 -0
  24. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/templates/licenses/README.md +0 -0
  25. {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/tests/test_package.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-chat-reader
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Read and search Codex CLI and Claude Code chat history from the terminal.
5
5
  Project-URL: Homepage, https://github.com/alik-git/agent-chat-reader
6
6
  Project-URL: Repository, https://github.com/alik-git/agent-chat-reader
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "agent-chat-reader"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  description = "Read and search Codex CLI and Claude Code chat history from the terminal."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -2,6 +2,6 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- __version__ = "0.1.2"
5
+ __version__ = "0.1.3"
6
6
 
7
7
  __all__ = ["__version__"]
@@ -58,12 +58,12 @@ def _title_key(title: str) -> str:
58
58
 
59
59
 
60
60
  def cmd_find(
61
- keyword: str,
61
+ keywords: list[str],
62
62
  *,
63
63
  source_filter: str | None,
64
64
  include_subagents: bool,
65
65
  ) -> int:
66
- """Search sessions for a keyword, deduplicating continuation sessions."""
66
+ """Search sessions for keywords (AND logic), deduplicating continuation sessions."""
67
67
  sessions: list[SessionMeta] = []
68
68
  if source_filter != "claude":
69
69
  sessions += codex.list_sessions(include_subagents=include_subagents)
@@ -71,7 +71,12 @@ def cmd_find(
71
71
  sessions += claude.list_sessions()
72
72
 
73
73
  sessions = sorted(sessions, key=lambda s: s.mtime, reverse=True)
74
- keyword_lower = keyword.lower()
74
+ keywords_lower = [k.lower() for k in keywords]
75
+
76
+ def _turn_matches(text: str) -> bool:
77
+ """Return True if the turn contains all keywords (AND)."""
78
+ text_lower = text.lower()
79
+ return all(k in text_lower for k in keywords_lower)
75
80
 
76
81
  # Collect hits per session, then group by title to deduplicate continuations.
77
82
  # Each group keeps the most-recent session's metadata as the representative.
@@ -89,7 +94,7 @@ def cmd_find(
89
94
  hits: list[FindHit] = [
90
95
  (t.role, t.text[:120].replace("\n", " "), t.timestamp)
91
96
  for t in turns
92
- if keyword_lower in t.text.lower()
97
+ if _turn_matches(t.text)
93
98
  ]
94
99
  if not hits:
95
100
  continue
@@ -99,12 +104,12 @@ def cmd_find(
99
104
  groups[key] = (s, hits, 1)
100
105
  else:
101
106
  rep, existing_hits, count = groups[key]
102
- # Merge hits, keeping the most-recent session as representative.
103
107
  rep = s if s.mtime > rep.mtime else rep
104
108
  groups[key] = (rep, existing_hits + hits, count + 1)
105
109
 
106
110
  if not groups:
107
- print(f"No sessions found containing {keyword!r}")
111
+ query = " AND ".join(f"{k!r}" for k in keywords)
112
+ print(f"No sessions found containing {query}")
108
113
  return 0
109
114
 
110
115
  for rep, hits, count in groups.values():
@@ -165,8 +170,9 @@ def main(argv: list[str] | None = None) -> int:
165
170
  p.add_argument(
166
171
  "--find",
167
172
  "-f",
173
+ nargs="+",
168
174
  metavar="KEYWORD",
169
- help="Search sessions for keyword",
175
+ help="Search sessions (multiple keywords = AND logic)",
170
176
  )
171
177
  p.add_argument("--source", choices=["codex", "claude"], help="Filter to one source")
172
178
  p.add_argument(
@@ -204,7 +210,7 @@ def main(argv: list[str] | None = None) -> int:
204
210
  )
205
211
  if args.find:
206
212
  return cmd_find(
207
- args.find,
213
+ args.find, # list[str] from nargs="+"
208
214
  source_filter=args.source,
209
215
  include_subagents=args.include_subagents,
210
216
  )
@@ -8,7 +8,7 @@ resolution-markers = [
8
8
 
9
9
  [[package]]
10
10
  name = "agent-chat-reader"
11
- version = "0.1.2"
11
+ version = "0.1.3"
12
12
  source = { editable = "." }
13
13
 
14
14
  [package.optional-dependencies]