dirsql-plugin-embeddings 0.1.7__tar.gz → 0.1.9__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 (22) hide show
  1. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/PKG-INFO +18 -9
  2. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/README.md +17 -8
  3. dirsql_plugin_embeddings-0.1.7/e2e-attestations/claude-700-route-pdf.json → dirsql_plugin_embeddings-0.1.9/e2e-attestations/claude-706-widen-glob.json +3 -3
  4. dirsql_plugin_embeddings-0.1.9/e2e-attestations/claude-725-plugin-glob-comment.json +7 -0
  5. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/src/dirsql_plugin_embeddings/dirsql.toml +7 -1
  6. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/.gitignore +0 -0
  7. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/pyproject.toml +0 -0
  8. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/src/dirsql_plugin_embeddings/__init__.py +0 -0
  9. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/src/dirsql_plugin_embeddings/cache.py +0 -0
  10. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/src/dirsql_plugin_embeddings/config.py +0 -0
  11. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/src/dirsql_plugin_embeddings/embedder.py +0 -0
  12. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/src/dirsql_plugin_embeddings/on_file/__init__.py +0 -0
  13. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/src/dirsql_plugin_embeddings/on_file/build_rows.py +0 -0
  14. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/src/dirsql_plugin_embeddings/on_file/on_file.py +0 -0
  15. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/src/dirsql_plugin_embeddings/on_file/read_content.py +0 -0
  16. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/src/dirsql_plugin_embeddings/on_file/read_pdf.py +0 -0
  17. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/src/dirsql_plugin_embeddings/on_file/read_text.py +0 -0
  18. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/src/dirsql_plugin_embeddings/pre_query.py +0 -0
  19. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/testing-conventions.toml +0 -0
  20. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/tests/conftest.py +0 -0
  21. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/tests/e2e/__init__.py +0 -0
  22. {dirsql_plugin_embeddings-0.1.7 → dirsql_plugin_embeddings-0.1.9}/tests/integration/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dirsql-plugin-embeddings
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: First-party dirsql plugin: semantic search via an OpenAI-compatible embeddings endpoint.
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: cachetta>=0.6.15
@@ -10,7 +10,8 @@ Description-Content-Type: text/markdown
10
10
  # dirsql-plugin-embeddings
11
11
 
12
12
  A first-party [`dirsql`](https://github.com/thekevinscott/dirsql) plugin that
13
- adds **semantic search** over a directory of Markdown files and PDFs. It is the worked
13
+ adds **semantic search** over a directory of documents -- Markdown, plain
14
+ text, reStructuredText and PDFs. It is the worked
14
15
  implementation behind the [Search documents by
15
16
  meaning](https://thekevinscott.github.io/dirsql/howto/search-by-meaning) how-to,
16
17
  swapping that guide's local `model2vec` model for any OpenAI-compatible
@@ -30,23 +31,31 @@ is installed alongside it. The fragment declares:
30
31
 
31
32
  - the [`sqlite-vec`](https://github.com/asg017/sqlite-vec) extension, for
32
33
  `vec_distance_cosine()`;
33
- - a `documents` table whose `on-file` hook embeds each `**/*.{md,pdf}` file into
34
- a TEXT `embedding` column;
34
+ - a `documents` table whose `on-file` hook embeds each
35
+ `**/*.{md,markdown,mdx,rst,txt,pdf}` file into a TEXT `embedding` column;
35
36
  - a `pre-query` hook that embeds the incoming question and emits the
36
37
  nearest-neighbor SQL.
37
38
 
38
39
  Both hooks are console scripts that call the same embedder.
39
40
 
40
- Markdown is read as UTF-8 text; a `.pdf` is read with
41
+ Every matched extension except `.pdf` is read as UTF-8 text; a `.pdf` is read with
41
42
  [pypdf](https://pypdf.readthedocs.io), whose per-page extracted text is joined
42
43
  and embedded like any other document. The extension check is case-insensitive
43
44
  (`.PDF` is a PDF), though the glob above is not — globset matches case-sensitively,
44
45
  so an uppercase-suffixed file needs its own `glob` entry to be picked up at all.
45
46
 
46
- A PDF that cannot be parsed aborts the scan rather than being skipped: the hook
47
- exits non-zero and dirsql reports the path and the pypdf reason. A *scanned*,
48
- image-only PDF is not a failure pypdf yields no text, and the file is indexed
49
- with an empty `text`, exactly like an empty `.md`.
47
+ The glob is an allowlist rather than `**/*` on cost, not correctness. Every
48
+ matched file costs a hook subprocess, and every file the plugin can decode costs
49
+ a billed embedding callso pointing `**/*` at a tree containing `node_modules`
50
+ or `.git` makes for a slow and expensive scan. The list is what is worth
51
+ embedding; widening it trades money for recall.
52
+
53
+ A file the plugin cannot read is skipped, not fatal. The hook exits non-zero,
54
+ dirsql names the file on stderr and carries on indexing the rest, and the run
55
+ exits `23` — "completed, some files skipped". From the SDK the same information
56
+ is on `scan_failures()` / `scanFailures()`. A *scanned*, image-only PDF is not a
57
+ failure at all: pypdf yields no text, and the file is indexed with an empty
58
+ `text`, exactly like an empty `.md`.
50
59
 
51
60
  ## Configuration
52
61
 
@@ -1,7 +1,8 @@
1
1
  # dirsql-plugin-embeddings
2
2
 
3
3
  A first-party [`dirsql`](https://github.com/thekevinscott/dirsql) plugin that
4
- adds **semantic search** over a directory of Markdown files and PDFs. It is the worked
4
+ adds **semantic search** over a directory of documents -- Markdown, plain
5
+ text, reStructuredText and PDFs. It is the worked
5
6
  implementation behind the [Search documents by
6
7
  meaning](https://thekevinscott.github.io/dirsql/howto/search-by-meaning) how-to,
7
8
  swapping that guide's local `model2vec` model for any OpenAI-compatible
@@ -21,23 +22,31 @@ is installed alongside it. The fragment declares:
21
22
 
22
23
  - the [`sqlite-vec`](https://github.com/asg017/sqlite-vec) extension, for
23
24
  `vec_distance_cosine()`;
24
- - a `documents` table whose `on-file` hook embeds each `**/*.{md,pdf}` file into
25
- a TEXT `embedding` column;
25
+ - a `documents` table whose `on-file` hook embeds each
26
+ `**/*.{md,markdown,mdx,rst,txt,pdf}` file into a TEXT `embedding` column;
26
27
  - a `pre-query` hook that embeds the incoming question and emits the
27
28
  nearest-neighbor SQL.
28
29
 
29
30
  Both hooks are console scripts that call the same embedder.
30
31
 
31
- Markdown is read as UTF-8 text; a `.pdf` is read with
32
+ Every matched extension except `.pdf` is read as UTF-8 text; a `.pdf` is read with
32
33
  [pypdf](https://pypdf.readthedocs.io), whose per-page extracted text is joined
33
34
  and embedded like any other document. The extension check is case-insensitive
34
35
  (`.PDF` is a PDF), though the glob above is not — globset matches case-sensitively,
35
36
  so an uppercase-suffixed file needs its own `glob` entry to be picked up at all.
36
37
 
37
- A PDF that cannot be parsed aborts the scan rather than being skipped: the hook
38
- exits non-zero and dirsql reports the path and the pypdf reason. A *scanned*,
39
- image-only PDF is not a failure pypdf yields no text, and the file is indexed
40
- with an empty `text`, exactly like an empty `.md`.
38
+ The glob is an allowlist rather than `**/*` on cost, not correctness. Every
39
+ matched file costs a hook subprocess, and every file the plugin can decode costs
40
+ a billed embedding callso pointing `**/*` at a tree containing `node_modules`
41
+ or `.git` makes for a slow and expensive scan. The list is what is worth
42
+ embedding; widening it trades money for recall.
43
+
44
+ A file the plugin cannot read is skipped, not fatal. The hook exits non-zero,
45
+ dirsql names the file on stderr and carries on indexing the rest, and the run
46
+ exits `23` — "completed, some files skipped". From the SDK the same information
47
+ is on `scan_failures()` / `scanFailures()`. A *scanned*, image-only PDF is not a
48
+ failure at all: pypdf yields no text, and the file is indexed with an empty
49
+ `text`, exactly like an empty `.md`.
41
50
 
42
51
  ## Configuration
43
52
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "command": "uv run --with sqlite-vec --with-editable . --with-editable ../../packages/python python -m pytest tests/e2e -x -q",
3
- "ran_at": 1785338799,
3
+ "ran_at": 1785339217,
4
4
  "exit_code": 0,
5
- "commit": "fcca643ac74c98dd9a6b525681711c720c303250",
6
- "branch": "claude/700-route-pdf"
5
+ "commit": "f96d82085395d4e38bd74992a6ae3c7b029d5f60",
6
+ "branch": "claude/706-widen-glob"
7
7
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "command": "uv run --with sqlite-vec --with-editable . --with-editable ../../packages/python python -m pytest tests/e2e -q",
3
+ "ran_at": 1785680099,
4
+ "exit_code": 0,
5
+ "commit": "0030917b47975bfa9b4d7412e7f00ca2b760f292",
6
+ "branch": "claude/725-plugin-glob-comment"
7
+ }
@@ -15,7 +15,13 @@ entrypoint = "sqlite3_vec_init"
15
15
  # The brace is globset alternation, not a dirsql `{name}` placeholder: the core
16
16
  # rewrites those to `*`, but only when the braces hold a bare identifier, so a
17
17
  # comma-separated list reaches globset intact.
18
+ #
19
+ # An allowlist rather than `**/*` because every matched file costs a hook
20
+ # subprocess and, for anything `read_content` can decode, a billed embedding
21
+ # call. Pointed at a tree holding `node_modules` or `.git`, `**/*` is a slow
22
+ # and expensive scan, not a broken one -- unreadable files are skipped. So the
23
+ # list is what is worth embedding, and widening it trades money for recall.
18
24
  [[table]]
19
25
  ddl = "CREATE TABLE documents (path TEXT, text TEXT, embedding TEXT)"
20
- glob = "**/*.{md,pdf}"
26
+ glob = "**/*.{md,markdown,mdx,rst,txt,pdf}"
21
27
  on-file = "dirsql-embeddings-on-file {path}"