copilot-session-tools 0.19.1__tar.gz → 0.19.2__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.
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/CHANGELOG.md +4 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/PKG-INFO +1 -1
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/pyproject.toml +1 -1
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/pyproject.toml.orig +1 -1
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/__init__.py +1 -1
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/db_search.py +36 -26
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/LICENSE +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/README.md +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/cli.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/content_types.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/database.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/db_retrieval.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/db_schema.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/db_storage.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/html_exporter.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/markdown_exporter.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/py.typed +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/refresh.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/scanner/__init__.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/scanner/cli.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/scanner/content.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/scanner/diff.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/scanner/discovery.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/scanner/git.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/scanner/models.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/scanner/shared.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/scanner/vscode.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/sources.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/transcript_cleanup.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/utils.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/version_check.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/web/__init__.py +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/web/templates/error.html +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/web/templates/index.html +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/web/templates/session.html +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/web/templates/sources.html +0 -0
- {copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/web/webapp.py +0 -0
|
@@ -21,6 +21,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
21
21
|
- **Refresh and fallback**: Chronicle discovery, JSONL enrichment, staleness checks, targeted enrichment, and orphan cleanup now operate per source. Disabled or unavailable sources retain archived content.
|
|
22
22
|
- **Application filters**: The `cli` button now includes only the built-in Copilot CLI source. Every added source gets its own lowercase button, such as `scout`, while VS Code editions remain separate.
|
|
23
23
|
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- **Search**: Queries containing punctuation such as `.`, `/`, `@`, `,`, `+`, or `'` (e.g. `db_search.py`) no longer fail with `fts5: syntax error`. Any non-bareword token is now quoted, while `^` and trailing `*` operators are preserved. Tool, file, command, and thinking searches now match the raw search text instead of the FTS5-escaped string.
|
|
27
|
+
|
|
24
28
|
## [0.17.1] - 2026-06-30
|
|
25
29
|
|
|
26
30
|
### Fixed
|
{copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/db_search.py
RENAMED
|
@@ -18,6 +18,7 @@ class ParsedQuery:
|
|
|
18
18
|
"""Represents a parsed search query with extracted field filters."""
|
|
19
19
|
|
|
20
20
|
fts_query: str # The FTS5 query string for content search
|
|
21
|
+
text_query: str = "" # Unescaped search text (field prefixes removed) for LIKE matching
|
|
21
22
|
role: str | None = None # Extracted role filter (user/assistant)
|
|
22
23
|
workspace: str | None = None # Extracted workspace filter
|
|
23
24
|
workspaces: list[str] | None = None # All extracted workspace filters
|
|
@@ -53,16 +54,21 @@ def _validate_date_format(date_str: str) -> str | None:
|
|
|
53
54
|
return None
|
|
54
55
|
|
|
55
56
|
|
|
57
|
+
# FTS5 bareword characters: ASCII alphanumerics, underscore, non-ASCII, and \x1a
|
|
58
|
+
_FTS5_BAREWORD_RE = re.compile("[A-Za-z0-9_\x1a\u0080-\U0010ffff]+")
|
|
59
|
+
|
|
60
|
+
|
|
56
61
|
def _escape_fts5_token(token: str) -> str:
|
|
57
62
|
"""Escape a single FTS5 token to prevent syntax errors.
|
|
58
63
|
|
|
59
|
-
FTS5
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
FTS5 only accepts unquoted "barewords" made of ASCII letters, digits,
|
|
65
|
+
underscores, and non-ASCII characters. Any other character (``.``, ``/``,
|
|
66
|
+
``-``, ``:``, ``@``, ``,``, ``+``, ``'``, parentheses, ...) is a syntax
|
|
67
|
+
error unless the token is quoted as a string.
|
|
63
68
|
|
|
64
|
-
If a token is already quoted, leave it as-is.
|
|
65
|
-
|
|
69
|
+
If a token is already quoted, leave it as-is. Otherwise, wrap it in quotes
|
|
70
|
+
if it is not a bareword. A leading ``^`` (first-token) and trailing ``*``
|
|
71
|
+
(prefix match) are preserved as operators.
|
|
66
72
|
|
|
67
73
|
Args:
|
|
68
74
|
token: A single search token (word or phrase).
|
|
@@ -74,23 +80,25 @@ def _escape_fts5_token(token: str) -> str:
|
|
|
74
80
|
return token
|
|
75
81
|
|
|
76
82
|
# If already quoted, leave as-is
|
|
77
|
-
if token.startswith('"') and token.endswith('"'):
|
|
83
|
+
if len(token) >= 2 and token.startswith('"') and token.endswith('"'):
|
|
78
84
|
return token
|
|
79
85
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
prefix = "^" if token.startswith("^") else ""
|
|
87
|
+
core = token[len(prefix) :]
|
|
88
|
+
suffix = "*" if core.endswith("*") else ""
|
|
89
|
+
if suffix:
|
|
90
|
+
core = core[:-1]
|
|
85
91
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return
|
|
92
|
+
if not core:
|
|
93
|
+
# Lone operator characters (e.g. "*" or "^") are searched literally
|
|
94
|
+
return '"' + token.replace('"', '""') + '"'
|
|
95
|
+
|
|
96
|
+
if _FTS5_BAREWORD_RE.fullmatch(core):
|
|
97
|
+
return token
|
|
92
98
|
|
|
93
|
-
|
|
99
|
+
# Escape internal quotes by doubling them (FTS5 convention)
|
|
100
|
+
escaped = core.replace('"', '""')
|
|
101
|
+
return f'{prefix}"{escaped}"{suffix}'
|
|
94
102
|
|
|
95
103
|
|
|
96
104
|
def parse_search_query(query: str) -> ParsedQuery:
|
|
@@ -161,6 +169,7 @@ def parse_search_query(query: str) -> ParsedQuery:
|
|
|
161
169
|
# 1. Quoted phrases (keep as-is)
|
|
162
170
|
# 2. Unquoted words (escape special chars and join with spaces for implicit AND)
|
|
163
171
|
|
|
172
|
+
raw_tokens: list[str] = []
|
|
164
173
|
if not remaining_query:
|
|
165
174
|
fts_query = ""
|
|
166
175
|
else:
|
|
@@ -169,13 +178,13 @@ def parse_search_query(query: str) -> ParsedQuery:
|
|
|
169
178
|
# Pattern to match quoted strings or individual words
|
|
170
179
|
token_pattern = r'"[^"]*"|[^\s"]+'
|
|
171
180
|
|
|
172
|
-
for
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if token == '""':
|
|
176
|
-
continue
|
|
181
|
+
query_tokens = [token for token in re.findall(token_pattern, remaining_query) if token != '""']
|
|
182
|
+
for index, token in enumerate(query_tokens):
|
|
183
|
+
raw_tokens.append(token[1:-1] if len(token) >= 2 and token.startswith('"') and token.endswith('"') else token)
|
|
177
184
|
# Escape FTS5 special characters in the token
|
|
178
|
-
|
|
185
|
+
# Quoted phrases and whitespace can separate operators from their operands.
|
|
186
|
+
is_operator = (token == "^" and index + 1 < len(query_tokens)) or (token == "*" and index > 0)
|
|
187
|
+
escaped_token = token if is_operator else _escape_fts5_token(token)
|
|
179
188
|
tokens.append(escaped_token)
|
|
180
189
|
|
|
181
190
|
# Join tokens with space (FTS5 uses implicit AND)
|
|
@@ -183,6 +192,7 @@ def parse_search_query(query: str) -> ParsedQuery:
|
|
|
183
192
|
|
|
184
193
|
return ParsedQuery(
|
|
185
194
|
fts_query=fts_query,
|
|
195
|
+
text_query=" ".join(raw_tokens),
|
|
186
196
|
role=role,
|
|
187
197
|
workspace=workspaces[0] if workspaces else None,
|
|
188
198
|
workspaces=workspaces or None,
|
|
@@ -915,7 +925,7 @@ def execute_search(
|
|
|
915
925
|
)
|
|
916
926
|
|
|
917
927
|
# For tool/file/command/thinking searches, use LIKE matching
|
|
918
|
-
search_terms =
|
|
928
|
+
search_terms = parsed.text_query if fts_query else query
|
|
919
929
|
like_pattern = f"%{search_terms}%"
|
|
920
930
|
|
|
921
931
|
if include_tools and len(results) < limit and search_terms:
|
|
File without changes
|
|
File without changes
|
{copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/cli.py
RENAMED
|
File without changes
|
|
File without changes
|
{copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/database.py
RENAMED
|
File without changes
|
|
File without changes
|
{copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/db_schema.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/py.typed
RENAMED
|
File without changes
|
{copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/refresh.py
RENAMED
|
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
|
{copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/sources.py
RENAMED
|
File without changes
|
|
File without changes
|
{copilot_session_tools-0.19.1 → copilot_session_tools-0.19.2}/src/copilot_session_tools/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|