vexor 0.21.0__tar.gz → 0.21.1__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 (36) hide show
  1. {vexor-0.21.0 → vexor-0.21.1}/PKG-INFO +1 -1
  2. {vexor-0.21.0 → vexor-0.21.1}/plugins/vexor/.claude-plugin/plugin.json +1 -1
  3. {vexor-0.21.0 → vexor-0.21.1}/vexor/__init__.py +1 -1
  4. {vexor-0.21.0 → vexor-0.21.1}/vexor/cache.py +57 -14
  5. {vexor-0.21.0 → vexor-0.21.1}/.gitignore +0 -0
  6. {vexor-0.21.0 → vexor-0.21.1}/LICENSE +0 -0
  7. {vexor-0.21.0 → vexor-0.21.1}/README.md +0 -0
  8. {vexor-0.21.0 → vexor-0.21.1}/gui/README.md +0 -0
  9. {vexor-0.21.0 → vexor-0.21.1}/plugins/vexor/README.md +0 -0
  10. {vexor-0.21.0 → vexor-0.21.1}/plugins/vexor/skills/vexor-cli/SKILL.md +0 -0
  11. {vexor-0.21.0 → vexor-0.21.1}/plugins/vexor/skills/vexor-cli/references/install-vexor.md +0 -0
  12. {vexor-0.21.0 → vexor-0.21.1}/pyproject.toml +0 -0
  13. {vexor-0.21.0 → vexor-0.21.1}/vexor/__main__.py +0 -0
  14. {vexor-0.21.0 → vexor-0.21.1}/vexor/api.py +0 -0
  15. {vexor-0.21.0 → vexor-0.21.1}/vexor/cli.py +0 -0
  16. {vexor-0.21.0 → vexor-0.21.1}/vexor/config.py +0 -0
  17. {vexor-0.21.0 → vexor-0.21.1}/vexor/modes.py +0 -0
  18. {vexor-0.21.0 → vexor-0.21.1}/vexor/output.py +0 -0
  19. {vexor-0.21.0 → vexor-0.21.1}/vexor/providers/__init__.py +0 -0
  20. {vexor-0.21.0 → vexor-0.21.1}/vexor/providers/gemini.py +0 -0
  21. {vexor-0.21.0 → vexor-0.21.1}/vexor/providers/local.py +0 -0
  22. {vexor-0.21.0 → vexor-0.21.1}/vexor/providers/openai.py +0 -0
  23. {vexor-0.21.0 → vexor-0.21.1}/vexor/search.py +0 -0
  24. {vexor-0.21.0 → vexor-0.21.1}/vexor/services/__init__.py +0 -0
  25. {vexor-0.21.0 → vexor-0.21.1}/vexor/services/cache_service.py +0 -0
  26. {vexor-0.21.0 → vexor-0.21.1}/vexor/services/config_service.py +0 -0
  27. {vexor-0.21.0 → vexor-0.21.1}/vexor/services/content_extract_service.py +0 -0
  28. {vexor-0.21.0 → vexor-0.21.1}/vexor/services/index_service.py +0 -0
  29. {vexor-0.21.0 → vexor-0.21.1}/vexor/services/init_service.py +0 -0
  30. {vexor-0.21.0 → vexor-0.21.1}/vexor/services/js_parser.py +0 -0
  31. {vexor-0.21.0 → vexor-0.21.1}/vexor/services/keyword_service.py +0 -0
  32. {vexor-0.21.0 → vexor-0.21.1}/vexor/services/search_service.py +0 -0
  33. {vexor-0.21.0 → vexor-0.21.1}/vexor/services/skill_service.py +0 -0
  34. {vexor-0.21.0 → vexor-0.21.1}/vexor/services/system_service.py +0 -0
  35. {vexor-0.21.0 → vexor-0.21.1}/vexor/text.py +0 -0
  36. {vexor-0.21.0 → vexor-0.21.1}/vexor/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vexor
3
- Version: 0.21.0
3
+ Version: 0.21.1
4
4
  Summary: A vector-powered CLI for semantic search over files.
5
5
  Project-URL: Repository, https://github.com/scarletkc/vexor
6
6
  Author: scarletkc
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vexor",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "description": "A vector-powered CLI for semantic search over files (Vexor skill bundle).",
5
5
  "author": {
6
6
  "name": "scarletkc"
@@ -15,7 +15,7 @@ __all__ = [
15
15
  "set_data_dir",
16
16
  ]
17
17
 
18
- __version__ = "0.21.0"
18
+ __version__ = "0.21.1"
19
19
 
20
20
 
21
21
  def get_version() -> str:
@@ -143,8 +143,17 @@ def cache_file(root: Path, model: str, include_hidden: bool) -> Path: # pragma:
143
143
  return cache_db_path()
144
144
 
145
145
 
146
- def _connect(db_path: Path) -> sqlite3.Connection:
147
- conn = sqlite3.connect(db_path)
146
+ def _connect(
147
+ db_path: Path,
148
+ *,
149
+ readonly: bool = False,
150
+ query_only: bool = False,
151
+ ) -> sqlite3.Connection:
152
+ if readonly:
153
+ db_uri = f"file:{db_path.as_posix()}?mode=ro"
154
+ conn = sqlite3.connect(db_uri, uri=True)
155
+ else:
156
+ conn = sqlite3.connect(db_path)
148
157
  conn.row_factory = sqlite3.Row
149
158
  try:
150
159
  conn.execute("PRAGMA journal_mode = WAL;")
@@ -155,9 +164,23 @@ def _connect(db_path: Path) -> sqlite3.Connection:
155
164
  conn.execute("PRAGMA temp_store = MEMORY;")
156
165
  conn.execute("PRAGMA busy_timeout = 5000;")
157
166
  conn.execute("PRAGMA foreign_keys = ON;")
167
+ if readonly or query_only:
168
+ conn.execute("PRAGMA query_only = ON;")
158
169
  return conn
159
170
 
160
171
 
172
+ def _ensure_schema_readonly(
173
+ conn: sqlite3.Connection,
174
+ *,
175
+ tables: Sequence[str],
176
+ ) -> None:
177
+ if _schema_needs_reset(conn):
178
+ raise sqlite3.OperationalError("Schema reset required")
179
+ for table in tables:
180
+ if not _table_exists(conn, table):
181
+ raise sqlite3.OperationalError(f"Missing table: {table}")
182
+
183
+
161
184
  def _table_exists(conn: sqlite3.Connection, table: str) -> bool:
162
185
  row = conn.execute(
163
186
  "SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",
@@ -883,9 +906,15 @@ def load_index(
883
906
  if not db_path.exists():
884
907
  raise FileNotFoundError(db_path)
885
908
 
886
- conn = _connect(db_path)
909
+ conn = _connect(db_path, readonly=True)
887
910
  try:
888
- _ensure_schema(conn)
911
+ try:
912
+ _ensure_schema_readonly(
913
+ conn,
914
+ tables=("index_metadata", "indexed_file", "indexed_chunk", "chunk_meta"),
915
+ )
916
+ except sqlite3.OperationalError:
917
+ raise FileNotFoundError(db_path)
889
918
  key = _cache_key(
890
919
  root,
891
920
  include_hidden,
@@ -993,9 +1022,20 @@ def load_index_vectors(
993
1022
  if not db_path.exists():
994
1023
  raise FileNotFoundError(db_path)
995
1024
 
996
- conn = _connect(db_path)
1025
+ conn = _connect(db_path, readonly=True)
997
1026
  try:
998
- _ensure_schema(conn)
1027
+ try:
1028
+ _ensure_schema_readonly(
1029
+ conn,
1030
+ tables=(
1031
+ "index_metadata",
1032
+ "indexed_file",
1033
+ "indexed_chunk",
1034
+ "chunk_embedding",
1035
+ ),
1036
+ )
1037
+ except sqlite3.OperationalError:
1038
+ raise FileNotFoundError(db_path)
999
1039
  key = _cache_key(
1000
1040
  root,
1001
1041
  include_hidden,
@@ -1149,12 +1189,15 @@ def load_chunk_metadata(
1149
1189
  db_path = cache_db_path()
1150
1190
  owns_connection = conn is None
1151
1191
  try:
1152
- connection = conn or _connect(db_path)
1192
+ connection = conn or _connect(db_path, readonly=True)
1153
1193
  except sqlite3.OperationalError:
1154
1194
  return {}
1155
1195
  try:
1156
1196
  try:
1157
- _ensure_schema(connection)
1197
+ _ensure_schema_readonly(
1198
+ connection,
1199
+ tables=("indexed_chunk", "chunk_meta"),
1200
+ )
1158
1201
  except sqlite3.OperationalError:
1159
1202
  return {}
1160
1203
  results: dict[int, dict] = {}
@@ -1193,12 +1236,12 @@ def load_query_vector(
1193
1236
  db_path = cache_db_path()
1194
1237
  owns_connection = conn is None
1195
1238
  try:
1196
- connection = conn or _connect(db_path)
1239
+ connection = conn or _connect(db_path, readonly=True)
1197
1240
  except sqlite3.OperationalError:
1198
1241
  return None
1199
1242
  try:
1200
1243
  try:
1201
- _ensure_schema(connection)
1244
+ _ensure_schema_readonly(connection, tables=("query_cache",))
1202
1245
  except sqlite3.OperationalError:
1203
1246
  return None
1204
1247
  row = connection.execute(
@@ -1270,12 +1313,12 @@ def load_embedding_cache(
1270
1313
  db_path = cache_db_path()
1271
1314
  owns_connection = conn is None
1272
1315
  try:
1273
- connection = conn or _connect(db_path)
1316
+ connection = conn or _connect(db_path, readonly=True)
1274
1317
  except sqlite3.OperationalError:
1275
1318
  return {}
1276
1319
  try:
1277
1320
  try:
1278
- _ensure_schema(connection)
1321
+ _ensure_schema_readonly(connection, tables=("embedding_cache",))
1279
1322
  except sqlite3.OperationalError:
1280
1323
  return {}
1281
1324
  results: dict[str, np.ndarray] = {}
@@ -1433,12 +1476,12 @@ def list_cache_entries() -> list[dict[str, object]]:
1433
1476
  return []
1434
1477
 
1435
1478
  try:
1436
- conn = _connect(db_path)
1479
+ conn = _connect(db_path, readonly=True)
1437
1480
  except sqlite3.OperationalError:
1438
1481
  return []
1439
1482
  try:
1440
1483
  try:
1441
- _ensure_schema(conn)
1484
+ _ensure_schema_readonly(conn, tables=("index_metadata", "indexed_file"))
1442
1485
  except sqlite3.OperationalError:
1443
1486
  return []
1444
1487
  rows = conn.execute(
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