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.
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/PKG-INFO +1 -1
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/pyproject.toml +1 -1
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/__init__.py +1 -1
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/cli.py +14 -8
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/uv.lock +1 -1
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/.github/workflows/ci.yml +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/.github/workflows/release.yml +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/.gitignore +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/.pre-commit-config.yaml +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/.python-version +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/AGENTS.md +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/LICENSE +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/README.md +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/docs/api.md +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/docs/ci-private-submodules.md +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/claude.py +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/codex.py +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/models.py +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/output.py +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/src/agent_chat_reader/py.typed +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/templates/licenses/Apache-2.0 +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/templates/licenses/MIT +0 -0
- {agent_chat_reader-0.1.2 → agent_chat_reader-0.1.3}/templates/licenses/README.md +0 -0
- {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.
|
|
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
|
|
@@ -58,12 +58,12 @@ def _title_key(title: str) -> str:
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
def cmd_find(
|
|
61
|
-
|
|
61
|
+
keywords: list[str],
|
|
62
62
|
*,
|
|
63
63
|
source_filter: str | None,
|
|
64
64
|
include_subagents: bool,
|
|
65
65
|
) -> int:
|
|
66
|
-
"""Search sessions for
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|