sensemaking 0.25.1 → 0.26.0
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.
- package/README.md +13 -9
- package/dist/cjs/cli/index.d.cts +1 -1
- package/dist/cjs/cli/index.d.ts +1 -1
- package/dist/cjs/cli/index.js +1 -1
- package/dist/cjs/cli/index.js.map +1 -1
- package/dist/cjs/cli/path.js +5 -29
- package/dist/cjs/cli/path.js.map +1 -1
- package/dist/cjs/cli/related.js +4 -3
- package/dist/cjs/cli/related.js.map +1 -1
- package/dist/cjs/commands/index.d.cts +6 -3
- package/dist/cjs/commands/index.d.ts +6 -3
- package/dist/cjs/commands/index.js +4 -0
- package/dist/cjs/commands/index.js.map +1 -1
- package/dist/cjs/commands/map.d.cts +14 -5
- package/dist/cjs/commands/map.d.ts +14 -5
- package/dist/cjs/commands/map.js +42 -35
- package/dist/cjs/commands/map.js.map +1 -1
- package/dist/cjs/commands/path.d.cts +14 -0
- package/dist/cjs/commands/path.d.ts +14 -0
- package/dist/cjs/commands/path.js +209 -0
- package/dist/cjs/commands/path.js.map +1 -0
- package/dist/cjs/commands/peek.d.cts +16 -1
- package/dist/cjs/commands/peek.d.ts +16 -1
- package/dist/cjs/commands/peek.js +71 -33
- package/dist/cjs/commands/peek.js.map +1 -1
- package/dist/cjs/commands/related.d.cts +16 -3
- package/dist/cjs/commands/related.d.ts +16 -3
- package/dist/cjs/commands/related.js +131 -98
- package/dist/cjs/commands/related.js.map +1 -1
- package/dist/cjs/commands/scope.d.cts +1 -0
- package/dist/cjs/commands/scope.d.ts +1 -0
- package/dist/cjs/commands/scope.js +149 -0
- package/dist/cjs/commands/scope.js.map +1 -1
- package/dist/cjs/commands/search.d.cts +26 -3
- package/dist/cjs/commands/search.d.ts +26 -3
- package/dist/cjs/commands/search.js +211 -71
- package/dist/cjs/commands/search.js.map +1 -1
- package/dist/cjs/commands/signals.d.cts +4 -3
- package/dist/cjs/commands/signals.d.ts +4 -3
- package/dist/cjs/commands/signals.js +13 -4
- package/dist/cjs/commands/signals.js.map +1 -1
- package/dist/cjs/commands/snapshot.d.cts +3 -0
- package/dist/cjs/commands/snapshot.d.ts +3 -0
- package/dist/cjs/commands/snapshot.js +180 -0
- package/dist/cjs/commands/snapshot.js.map +1 -0
- package/dist/cjs/embed/cohere.js +41 -16
- package/dist/cjs/embed/cohere.js.map +1 -1
- package/dist/cjs/embed/endpoint.d.cts +2 -0
- package/dist/cjs/embed/endpoint.d.ts +2 -0
- package/dist/cjs/embed/endpoint.js +30 -0
- package/dist/cjs/embed/endpoint.js.map +1 -0
- package/dist/cjs/embed/handoff.d.cts +7 -2
- package/dist/cjs/embed/handoff.d.ts +7 -2
- package/dist/cjs/embed/handoff.js +10 -0
- package/dist/cjs/embed/handoff.js.map +1 -1
- package/dist/cjs/embed/http.d.cts +18 -1
- package/dist/cjs/embed/http.d.ts +18 -1
- package/dist/cjs/embed/http.js +239 -40
- package/dist/cjs/embed/http.js.map +1 -1
- package/dist/cjs/embed/openai.js +39 -17
- package/dist/cjs/embed/openai.js.map +1 -1
- package/dist/cjs/embed/query.d.cts +9 -3
- package/dist/cjs/embed/query.d.ts +9 -3
- package/dist/cjs/embed/query.js +257 -90
- package/dist/cjs/embed/query.js.map +1 -1
- package/dist/cjs/embed/registry.d.cts +2 -2
- package/dist/cjs/embed/registry.d.ts +2 -2
- package/dist/cjs/embed/registry.js +36 -4
- package/dist/cjs/embed/registry.js.map +1 -1
- package/dist/cjs/embed/static.js +6 -2
- package/dist/cjs/embed/static.js.map +1 -1
- package/dist/cjs/embed/store.js +42 -77
- package/dist/cjs/embed/store.js.map +1 -1
- package/dist/cjs/embed/types.d.cts +5 -2
- package/dist/cjs/embed/types.d.ts +5 -2
- package/dist/cjs/embed/types.js.map +1 -1
- package/dist/cjs/features/embed.js +290 -43
- package/dist/cjs/features/embed.js.map +1 -1
- package/dist/cjs/graph/traverse.d.cts +2 -2
- package/dist/cjs/graph/traverse.d.ts +2 -2
- package/dist/cjs/graph/traverse.js +15 -5
- package/dist/cjs/graph/traverse.js.map +1 -1
- package/dist/cjs/index.d.cts +2 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/output/output.d.cts +4 -36
- package/dist/cjs/output/output.d.ts +4 -36
- package/dist/cjs/output/output.js +1 -2
- package/dist/cjs/output/output.js.map +1 -1
- package/dist/cjs/scan/pool.d.cts +2 -1
- package/dist/cjs/scan/pool.d.ts +2 -1
- package/dist/cjs/scan/pool.js +116 -27
- package/dist/cjs/scan/pool.js.map +1 -1
- package/dist/cjs/scan/reparse.d.cts +1 -0
- package/dist/cjs/scan/reparse.d.ts +1 -0
- package/dist/cjs/scan/reparse.js +75 -21
- package/dist/cjs/scan/reparse.js.map +1 -1
- package/dist/cjs/store/builder.d.cts +11 -21
- package/dist/cjs/store/builder.d.ts +11 -21
- package/dist/cjs/store/builder.js +1077 -438
- package/dist/cjs/store/builder.js.map +1 -1
- package/dist/cjs/store/duckdb/connection.js +16 -2
- package/dist/cjs/store/duckdb/connection.js.map +1 -1
- package/dist/cjs/store/duckdb/open.d.cts +1 -1
- package/dist/cjs/store/duckdb/open.d.ts +1 -1
- package/dist/cjs/store/duckdb/open.js +73 -65
- package/dist/cjs/store/duckdb/open.js.map +1 -1
- package/dist/cjs/store/duckdb/reconcile.js +533 -15
- package/dist/cjs/store/duckdb/reconcile.js.map +1 -1
- package/dist/cjs/store/embed-scope.js +19 -9
- package/dist/cjs/store/embed-scope.js.map +1 -1
- package/dist/cjs/store/index.d.cts +6 -0
- package/dist/cjs/store/index.d.ts +6 -0
- package/dist/cjs/store/index.js +8 -4
- package/dist/cjs/store/index.js.map +1 -1
- package/dist/cjs/store/open.d.cts +6 -1
- package/dist/cjs/store/open.d.ts +6 -1
- package/dist/cjs/store/open.js +230 -307
- package/dist/cjs/store/open.js.map +1 -1
- package/dist/cjs/store/readiness.d.cts +5 -0
- package/dist/cjs/store/readiness.d.ts +5 -0
- package/dist/cjs/store/readiness.js +39 -0
- package/dist/cjs/store/readiness.js.map +1 -0
- package/dist/cjs/store/reconcile.d.cts +26 -1
- package/dist/cjs/store/reconcile.d.ts +26 -1
- package/dist/cjs/store/reconcile.js +670 -576
- package/dist/cjs/store/reconcile.js.map +1 -1
- package/dist/cjs/store/signature.d.cts +1 -0
- package/dist/cjs/store/signature.d.ts +1 -0
- package/dist/cjs/store/signature.js +9 -0
- package/dist/cjs/store/signature.js.map +1 -1
- package/dist/cjs/store/sqlite/open.d.cts +1 -1
- package/dist/cjs/store/sqlite/open.d.ts +1 -1
- package/dist/cjs/store/sqlite/open.js +84 -90
- package/dist/cjs/store/sqlite/open.js.map +1 -1
- package/dist/cjs/store/sqlite/reconcile.js.map +1 -1
- package/dist/cjs/store/sqlite/store.js +63 -60
- package/dist/cjs/store/sqlite/store.js.map +1 -1
- package/dist/cjs/store/sqlite/vectors.d.cts +2 -2
- package/dist/cjs/store/sqlite/vectors.d.ts +2 -2
- package/dist/cjs/store/sqlite/vectors.js +8 -4
- package/dist/cjs/store/sqlite/vectors.js.map +1 -1
- package/dist/cjs/store/stages.js.map +1 -1
- package/dist/cjs/store/turso/connection.d.cts +1 -0
- package/dist/cjs/store/turso/connection.d.ts +1 -0
- package/dist/cjs/store/turso/connection.js +319 -94
- package/dist/cjs/store/turso/connection.js.map +1 -1
- package/dist/cjs/store/turso/open.d.cts +1 -1
- package/dist/cjs/store/turso/open.d.ts +1 -1
- package/dist/cjs/store/turso/open.js +70 -74
- package/dist/cjs/store/turso/open.js.map +1 -1
- package/dist/cjs/store/turso/store.js +25 -23
- package/dist/cjs/store/turso/store.js.map +1 -1
- package/dist/cjs/store/turso/vectors.d.cts +2 -2
- package/dist/cjs/store/turso/vectors.d.ts +2 -2
- package/dist/cjs/store/turso/vectors.js +26 -16
- package/dist/cjs/store/turso/vectors.js.map +1 -1
- package/dist/cjs/store/types.d.cts +4 -1
- package/dist/cjs/store/types.d.ts +4 -1
- package/dist/cjs/store/types.js.map +1 -1
- package/dist/cjs/store/vectors.d.cts +14 -1
- package/dist/cjs/store/vectors.d.ts +14 -1
- package/dist/cjs/store/vectors.js +61 -0
- package/dist/cjs/store/vectors.js.map +1 -1
- package/dist/cjs/watch.d.cts +6 -0
- package/dist/cjs/watch.d.ts +6 -0
- package/dist/cjs/watch.js +42 -10
- package/dist/cjs/watch.js.map +1 -1
- package/dist/cjs/workers/parse.d.cts +4 -3
- package/dist/cjs/workers/parse.d.ts +4 -3
- package/dist/cjs/workers/parse.js +19 -17
- package/dist/cjs/workers/parse.js.map +1 -1
- package/dist/esm/cli/index.d.ts +1 -1
- package/dist/esm/cli/index.js +1 -1
- package/dist/esm/cli/index.js.map +1 -1
- package/dist/esm/cli/path.js +4 -10
- package/dist/esm/cli/path.js.map +1 -1
- package/dist/esm/cli/related.js +5 -3
- package/dist/esm/cli/related.js.map +1 -1
- package/dist/esm/commands/index.d.ts +6 -3
- package/dist/esm/commands/index.js +1 -0
- package/dist/esm/commands/index.js.map +1 -1
- package/dist/esm/commands/map.d.ts +14 -5
- package/dist/esm/commands/map.js +2 -0
- package/dist/esm/commands/map.js.map +1 -1
- package/dist/esm/commands/path.d.ts +14 -0
- package/dist/esm/commands/path.js +33 -0
- package/dist/esm/commands/path.js.map +1 -0
- package/dist/esm/commands/peek.d.ts +16 -1
- package/dist/esm/commands/peek.js +35 -9
- package/dist/esm/commands/peek.js.map +1 -1
- package/dist/esm/commands/related.d.ts +16 -3
- package/dist/esm/commands/related.js +45 -28
- package/dist/esm/commands/related.js.map +1 -1
- package/dist/esm/commands/scope.d.ts +1 -0
- package/dist/esm/commands/scope.js +58 -0
- package/dist/esm/commands/scope.js.map +1 -1
- package/dist/esm/commands/search.d.ts +26 -3
- package/dist/esm/commands/search.js +85 -18
- package/dist/esm/commands/search.js.map +1 -1
- package/dist/esm/commands/signals.d.ts +4 -3
- package/dist/esm/commands/signals.js +11 -4
- package/dist/esm/commands/signals.js.map +1 -1
- package/dist/esm/commands/snapshot.d.ts +3 -0
- package/dist/esm/commands/snapshot.js +25 -0
- package/dist/esm/commands/snapshot.js.map +1 -0
- package/dist/esm/embed/cohere.js +35 -10
- package/dist/esm/embed/cohere.js.map +1 -1
- package/dist/esm/embed/endpoint.d.ts +2 -0
- package/dist/esm/embed/endpoint.js +11 -0
- package/dist/esm/embed/endpoint.js.map +1 -0
- package/dist/esm/embed/handoff.d.ts +7 -2
- package/dist/esm/embed/handoff.js +7 -0
- package/dist/esm/embed/handoff.js.map +1 -1
- package/dist/esm/embed/http.d.ts +18 -1
- package/dist/esm/embed/http.js +137 -17
- package/dist/esm/embed/http.js.map +1 -1
- package/dist/esm/embed/openai.js +34 -12
- package/dist/esm/embed/openai.js.map +1 -1
- package/dist/esm/embed/query.d.ts +9 -3
- package/dist/esm/embed/query.js +98 -26
- package/dist/esm/embed/query.js.map +1 -1
- package/dist/esm/embed/registry.d.ts +2 -2
- package/dist/esm/embed/registry.js +34 -5
- package/dist/esm/embed/registry.js.map +1 -1
- package/dist/esm/embed/static.js +10 -2
- package/dist/esm/embed/static.js.map +1 -1
- package/dist/esm/embed/store.js +30 -21
- package/dist/esm/embed/store.js.map +1 -1
- package/dist/esm/embed/types.d.ts +5 -2
- package/dist/esm/embed/types.js.map +1 -1
- package/dist/esm/features/embed.js +82 -21
- package/dist/esm/features/embed.js.map +1 -1
- package/dist/esm/graph/traverse.d.ts +2 -2
- package/dist/esm/graph/traverse.js +4 -2
- package/dist/esm/graph/traverse.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/output/output.d.ts +4 -36
- package/dist/esm/output/output.js +1 -2
- package/dist/esm/output/output.js.map +1 -1
- package/dist/esm/scan/pool.d.ts +2 -1
- package/dist/esm/scan/pool.js +80 -23
- package/dist/esm/scan/pool.js.map +1 -1
- package/dist/esm/scan/reparse.d.ts +1 -0
- package/dist/esm/scan/reparse.js +40 -12
- package/dist/esm/scan/reparse.js.map +1 -1
- package/dist/esm/store/builder.d.ts +11 -21
- package/dist/esm/store/builder.js +337 -133
- package/dist/esm/store/builder.js.map +1 -1
- package/dist/esm/store/duckdb/connection.js +9 -1
- package/dist/esm/store/duckdb/connection.js.map +1 -1
- package/dist/esm/store/duckdb/open.d.ts +1 -1
- package/dist/esm/store/duckdb/open.js +13 -9
- package/dist/esm/store/duckdb/open.js.map +1 -1
- package/dist/esm/store/duckdb/reconcile.js +145 -10
- package/dist/esm/store/duckdb/reconcile.js.map +1 -1
- package/dist/esm/store/embed-scope.js +16 -6
- package/dist/esm/store/embed-scope.js.map +1 -1
- package/dist/esm/store/index.d.ts +6 -0
- package/dist/esm/store/index.js +10 -4
- package/dist/esm/store/index.js.map +1 -1
- package/dist/esm/store/open.d.ts +6 -1
- package/dist/esm/store/open.js +77 -87
- package/dist/esm/store/open.js.map +1 -1
- package/dist/esm/store/readiness.d.ts +5 -0
- package/dist/esm/store/readiness.js +11 -0
- package/dist/esm/store/readiness.js.map +1 -0
- package/dist/esm/store/reconcile.d.ts +26 -1
- package/dist/esm/store/reconcile.js +142 -120
- package/dist/esm/store/reconcile.js.map +1 -1
- package/dist/esm/store/signature.d.ts +1 -0
- package/dist/esm/store/signature.js +8 -0
- package/dist/esm/store/signature.js.map +1 -1
- package/dist/esm/store/sqlite/open.d.ts +1 -1
- package/dist/esm/store/sqlite/open.js +12 -12
- package/dist/esm/store/sqlite/open.js.map +1 -1
- package/dist/esm/store/sqlite/reconcile.js +2 -2
- package/dist/esm/store/sqlite/reconcile.js.map +1 -1
- package/dist/esm/store/sqlite/store.js +21 -18
- package/dist/esm/store/sqlite/store.js.map +1 -1
- package/dist/esm/store/sqlite/vectors.d.ts +2 -2
- package/dist/esm/store/sqlite/vectors.js +7 -5
- package/dist/esm/store/sqlite/vectors.js.map +1 -1
- package/dist/esm/store/stages.js.map +1 -1
- package/dist/esm/store/turso/connection.d.ts +1 -0
- package/dist/esm/store/turso/connection.js +97 -28
- package/dist/esm/store/turso/connection.js.map +1 -1
- package/dist/esm/store/turso/open.d.ts +1 -1
- package/dist/esm/store/turso/open.js +9 -8
- package/dist/esm/store/turso/open.js.map +1 -1
- package/dist/esm/store/turso/store.js +16 -14
- package/dist/esm/store/turso/store.js.map +1 -1
- package/dist/esm/store/turso/vectors.d.ts +2 -2
- package/dist/esm/store/turso/vectors.js +27 -17
- package/dist/esm/store/turso/vectors.js.map +1 -1
- package/dist/esm/store/types.d.ts +4 -1
- package/dist/esm/store/types.js.map +1 -1
- package/dist/esm/store/vectors.d.ts +14 -1
- package/dist/esm/store/vectors.js +55 -0
- package/dist/esm/store/vectors.js.map +1 -1
- package/dist/esm/watch.d.ts +6 -0
- package/dist/esm/watch.js +40 -14
- package/dist/esm/watch.js.map +1 -1
- package/dist/esm/workers/parse.d.ts +4 -3
- package/dist/esm/workers/parse.js +19 -17
- package/dist/esm/workers/parse.js.map +1 -1
- package/package.json +1 -1
- package/skills/sense/SKILL.md +4 -2
- package/skills/sense/references/stores/duckdb.md +1 -1
- package/skills/sense-setup/SKILL.md +2 -2
- package/skills/sense-setup/references/embeddings.md +1 -1
- package/skills/sense-setup/references/store-benchmarks.md +5 -5
- package/skills/sense-setup/references/stores/duckdb.md +1 -1
package/README.md
CHANGED
|
@@ -66,11 +66,11 @@ ORDER BY bm25(content, 10.0, 5.0, 1.0) LIMIT 10
|
|
|
66
66
|
| command | does |
|
|
67
67
|
|---|---|
|
|
68
68
|
| `build [--force]` | incrementally update the derived index and prepare every configured search capability; `--force` recreates only `.sense/` |
|
|
69
|
-
| `map` | doc count, frontmatter field coverage, top hubs by link rank, recent changes; hub/recent limits use bytewise path order on ties |
|
|
69
|
+
| `map [--preset name] [--include glob] [--exclude glob] [--no-exclude] [--where "<sql>"]` | doc count, frontmatter field coverage, top hubs by link rank, recent changes; hub/recent limits use bytewise path order on ties |
|
|
70
70
|
| `search "<text>" [--preset name] [--include glob] [--exclude glob] [--no-exclude] [--where "<sql>"] [--k n] [--snippet-char-limit n] [--snippet-count-limit n]` | words + links + vectors, one fused ranked list; `via` labels each row's evidence. `--k` bounds notes returned, `--snippet-char-limit` (default 80) each passage, `--snippet-count-limit` (default 1) passages per note |
|
|
71
|
-
| `peek <path> [--preset name] [--where "<sql>"]` | frontmatter + heading outline (`[L143-162, ~380t]`) + links both ways (first 20 per list, each with its total) |
|
|
72
|
-
| `path <a> <b> [--max-depth n] [--preset name] [--where "<sql>"]` | shortest link chain between two notes, or none within the bound |
|
|
73
|
-
| `related <note> [--k n] [--preset name] [--where "<sql>"]` | notes similar in meaning that `<note>` does not yet link to; reads vectors, so semantic-search cost |
|
|
71
|
+
| `peek <path> [--preset name] [--include glob] [--exclude glob] [--no-exclude] [--where "<sql>"]` | frontmatter + heading outline (`[L143-162, ~380t]`) + links both ways (first 20 per list, each with its total) |
|
|
72
|
+
| `path <a> <b> [--max-depth n] [--preset name] [--include glob] [--exclude glob] [--no-exclude] [--where "<sql>"]` | shortest link chain between two notes, or none within the bound |
|
|
73
|
+
| `related <note> [--k n] [--preset name] [--include glob] [--exclude glob] [--no-exclude] [--where "<sql>"]` | notes similar in meaning that `<note>` does not yet link to; reads vectors, so semantic-search cost |
|
|
74
74
|
| `sql "<statement>" [params...] [--preset name]` | ad-hoc SQL over all the tables; `?` binds positional args. Index-wide by default; `--preset` binds the preset's paths as a `scope` table the statement joins |
|
|
75
75
|
| `<name> [params...]` | run a query saved in the config; `--list` names them |
|
|
76
76
|
| `init` | write a starter `sense.config.json` |
|
|
@@ -78,11 +78,15 @@ ORDER BY bm25(content, 10.0, 5.0, 1.0) LIMIT 10
|
|
|
78
78
|
| `download` | prefetch the embedding model named in the config; build, watch, or a default CLI vector query fetches it when needed otherwise |
|
|
79
79
|
| `watch` | keep the index warm in the background (optional; see [watch coordination](https://github.com/kmalakoff/sensemaking/blob/master/DESIGN.md#watch-coordination)) |
|
|
80
80
|
|
|
81
|
+
Scope flags select from indexed notes; presets are not a security boundary. `peek` rejects an exact path outside the selected scope before trying a basename, resolves a basename only within that scope, and limits resolved outbound links and backlinks to it; unresolved targets remain as written. `path` resolves both endpoints across the indexed tree and applies scope to intermediate notes. `related` resolves its seed across the indexed tree and applies scope to result candidates.
|
|
82
|
+
|
|
81
83
|
Query commands use the config's `"build": true` default to update the index first and prepare only what that operation needs. Core map, peek, path and SQL work do not prepare vectors. Set `"build": false` for a manual-build or watch workflow, or add `--no-build` for one query. These read the last completed generation without scanning source files or repairing missing readiness; they fail with a `sense build` instruction when the requested capability is not ready. This disables Sense index maintenance, not database access or arbitrary SQL.
|
|
82
84
|
|
|
83
|
-
The completed generation stores the exact decoded source used for indexed snippets. A no-build query reads those stored sources and checks readiness for the capabilities it requests; it does not hydrate from newer live files. A default query incrementally scans the configured tree for the capabilities it needs; vector preparation is limited to its eligible scope. `sense build` prepares every configured capability, and `sense watch` keeps them prepared as changes arrive.
|
|
85
|
+
The completed generation stores the exact decoded source used for indexed snippets. A no-build query reads those stored sources and checks readiness for the capabilities it requests; it does not hydrate from newer live files. Public `search`, `mapTree`, `peek`, `findPath`, and `relatedNotes` calls assemble each result inside one committed database snapshot. Search completes provider and model preparation before its final snapshot and rejects an incomplete generation or one built for different feature settings instead of mixing generations. A default query incrementally scans the configured tree for the capabilities it needs; vector preparation is limited to its eligible scope. `sense build` prepares every configured capability, and `sense watch` keeps them prepared as changes arrive.
|
|
86
|
+
|
|
87
|
+
Explicit `sense build` and `sense watch` prepare the index regardless of the config's `build` default. Watch builds before reporting ready, then processes edits; with SQLite, a no-build query can read the previous generation while an edit is being processed. DuckDB permits concurrent cross-process no-build readers only while every handle is observational and read-only; a build or watcher opens the cache read-write and excludes every other process. Turso no-build queries still require a query-capable, exclusive handle. Native contenders wait within a bounded lock budget, then raise `STORE_BUSY`, as described under Store choice. Library callers choose preparation separately at `open`: `open(config)` prepares every configured capability, and `open(config, { build: false })` opens existing compatible state. A build-enabled open repairs incomplete feature state and replaces an incompatible derived cache format; a no-build open reports the required build without rebuilding or repairing the Sense index. The config's `build` setting controls CLI queries only. `build(config, { force: true })` recreates only the derived index. Public `search`, `mapTree`, `peek`, `findPath`, and `relatedNotes` calls on one retained `Store` serialize with one another. Await those calls before running raw SQL, starting a transaction, or closing the handle.
|
|
84
88
|
|
|
85
|
-
|
|
89
|
+
The root `search(store, config, terms, { signal })`, `open(config, { signal })`, and `build(config, { signal })` APIs accept an `AbortSignal`. Cancellation stops supported provider I/O and is checked between phases; synchronous native SQL or CPU work and resource cleanup finish before the promise settles. Cancellation checks preserve `signal.reason`, but a cleanup failure can surface instead or be combined with it in an `AggregateError`.
|
|
86
90
|
|
|
87
91
|
`search` runs one text through every engine its scope has: FTS5 word match (BM25-ranked, bare words AND-join, operators are yours on `sqlite`; on `duckdb` and `turso` the FTS5 operators are a named error, see Config), a personalized-PageRank walk over the link graph, and vector similarity, fused into one list. `via` labels each row's evidence (`match`, `link`, `vector`, combinations). Within the vector signal, candidates rank by the true cosine against the best-matching canonical chunk before `similarity` is rounded to three decimals for display; a zero-direction vector has similarity `0`, exact cosine ties use bytewise path order, and equal-scoring chunks choose the earliest authored chunk. The public search list ranks the combined word, link, and vector candidates by fused reciprocal-rank score. `lines` points at the section that earned the row (a direct read range). A `vector`-only row means the search words don't appear in that note; it showed up because the model judged it semantically related. `--preset` picks a named settings bundle from the config, `--where` filters on frontmatter. `--format json` on any reporting command returns structured output, and `--format csv` writes the row-returning commands one row per line, for redirecting a large result to a file instead of into context; `--version` and `--help` do what they say.
|
|
88
92
|
|
|
@@ -126,11 +130,11 @@ Bare commands use the `default` preset; `--preset` names another; flags override
|
|
|
126
130
|
|
|
127
131
|
### Store choice
|
|
128
132
|
|
|
129
|
-
Choose `sqlite` for the smallest setup, full FTS5 query syntax, and concurrent Sense commands. Choose `duckdb` when the cache should participate in DuckDB analytical work over large datasets or in local/cloud workflows. Choose `turso` for its embedded Rust engine and Tantivy text index. The DuckDB and Turso adapters are experimental
|
|
133
|
+
Choose `sqlite` for the smallest setup, full FTS5 query syntax, and concurrent Sense commands. Choose `duckdb` when the cache should participate in DuckDB analytical work over large datasets or in local/cloud workflows. Choose `turso` for its embedded Rust engine and Tantivy text index. The DuckDB and Turso adapters are experimental and install their native package on first use.
|
|
130
134
|
|
|
131
|
-
The commands and table names are shared. Raw SQL still follows the selected engine's dialect, and advanced FTS5 operators only work on `sqlite`. DuckDB and
|
|
135
|
+
The commands and table names are shared. Raw SQL still follows the selected engine's dialect, and advanced FTS5 operators only work on `sqlite`. Separate DuckDB processes may coexist only when every handle is observational and read-only. A DuckDB build-enabled open or watcher is read-write and excludes all other processes. Turso's observational path remains query-capable, so any Turso handle excludes other processes. Sense waits within a bounded lock budget for exclusive native access, then raises `STORE_BUSY`; neither adapter promises writer/reader coexistence. Public commands on one retained `Store` serialize separately, as described above.
|
|
132
136
|
|
|
133
|
-
Vectors need a model. Naming a Hugging Face id in `embed.model` is consent to fetch it when `sense build`, `sense watch`, or a default CLI vector query first prepares vectors, with progress on stderr, into `~/.sense/models` (huggingface_hub's cache layout, one snapshot directory per resolved revision, shared by every tree, 124 MB, never in the package). `sense download` prefetches the same model ahead of time; it is idempotent and prints the resolved revision. `embed.model` is a Hugging Face id, or a path to a directory holding `model.safetensors` and `tokenizer.json`, which nothing fetches for you. A preset that asks for vectors when a local model path is missing those files is an error naming the fix, rather than a quieter result that would make the same search answer differently before and after; a preset whose `signals` exclude `vectors` never asks, so it is unaffected. An optional top-level `"embed": { "model", "provider", "url", "key" }` block points at any Model2Vec model, local path, or OpenAI-compatible endpoint (Ollama, LM Studio, hosted). Explicit builds and watch prepare all configured vectors. A default CLI vector query prepares only its eligible scope; `--no-build` requires that scope to be ready and never prepares it. Unrelated pending documents do not block either path.
|
|
137
|
+
Vectors need a model. Naming a Hugging Face id in `embed.model` is consent to fetch it when `sense build`, `sense watch`, or a default CLI vector query first prepares vectors, with progress on stderr, into `~/.sense/models` (huggingface_hub's cache layout, one snapshot directory per resolved revision, shared by every tree, 124 MB, never in the package). `sense download` prefetches the same model ahead of time; it is idempotent and prints the resolved revision. `embed.model` is a Hugging Face id, or a path to a directory holding `model.safetensors` and `tokenizer.json`, which nothing fetches for you. A preset that asks for vectors when a local model path is missing those files is an error naming the fix, rather than a quieter result that would make the same search answer differently before and after; a preset whose `signals` exclude `vectors` never asks, so it is unaffected. An optional top-level `"embed": { "model", "provider", "url", "key" }` block points at any Model2Vec model, local path, or OpenAI-compatible endpoint (Ollama, LM Studio, hosted). Changing the provider, model, or effective endpoint invalidates stale vectors; changing chunk size rebuilds the affected embedding rows. Explicit builds and watch prepare all configured vectors. A default CLI vector query prepares only its eligible scope; `--no-build` requires that scope to be ready and never prepares it. Unrelated pending documents do not block either path.
|
|
134
138
|
|
|
135
139
|
Sense adds `has(field, value)` for array membership or string containment and `basename(path)` for path queries on every store. SQLite and DuckDB also provide `segment(terms)` for hand-written matching over text without word spaces. A frontmatter syntax error records `_parse_error` and leaves that file's discovered fields empty; the file's content still enters the index.
|
|
136
140
|
|
package/dist/cjs/cli/index.d.cts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const USAGE: {
|
|
|
7
7
|
readonly download: "download [--config path]";
|
|
8
8
|
readonly sql: "sql \"<statement>\" [params...] [--preset name] [--no-build] [--format table|json|csv] [--config path]";
|
|
9
9
|
readonly search: "search \"<terms>\" [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--k n] [--snippet-char-limit n] [--snippet-count-limit n] [--no-build] [--format table|json|csv] [--config path]";
|
|
10
|
-
readonly map: "map [--no-build] [--format table|json] [--config path]";
|
|
10
|
+
readonly map: "map [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--no-build] [--format table|json] [--config path]";
|
|
11
11
|
readonly peek: "peek <path> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--no-build] [--format table|json] [--config path]";
|
|
12
12
|
readonly path: "path <a> <b> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--max-depth n] [--no-build] [--format table|json] [--config path]";
|
|
13
13
|
readonly related: "related <note> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--k n] [--no-build] [--format table|json|csv] [--config path]";
|
package/dist/cjs/cli/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const USAGE: {
|
|
|
7
7
|
readonly download: "download [--config path]";
|
|
8
8
|
readonly sql: "sql \"<statement>\" [params...] [--preset name] [--no-build] [--format table|json|csv] [--config path]";
|
|
9
9
|
readonly search: "search \"<terms>\" [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--k n] [--snippet-char-limit n] [--snippet-count-limit n] [--no-build] [--format table|json|csv] [--config path]";
|
|
10
|
-
readonly map: "map [--no-build] [--format table|json] [--config path]";
|
|
10
|
+
readonly map: "map [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--no-build] [--format table|json] [--config path]";
|
|
11
11
|
readonly peek: "peek <path> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--no-build] [--format table|json] [--config path]";
|
|
12
12
|
readonly path: "path <a> <b> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--max-depth n] [--no-build] [--format table|json] [--config path]";
|
|
13
13
|
readonly related: "related <note> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--k n] [--no-build] [--format table|json|csv] [--config path]";
|
package/dist/cjs/cli/index.js
CHANGED
|
@@ -54,7 +54,7 @@ var USAGE = {
|
|
|
54
54
|
download: 'download [--config path]',
|
|
55
55
|
sql: 'sql "<statement>" [params...] [--preset name] [--no-build] [--format table|json|csv] [--config path]',
|
|
56
56
|
search: 'search "<terms>" [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where "<sql>"] [--k n] [--snippet-char-limit n] [--snippet-count-limit n] [--no-build] [--format table|json|csv] [--config path]',
|
|
57
|
-
map: 'map [--no-build] [--format table|json] [--config path]',
|
|
57
|
+
map: 'map [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where "<sql>"] [--no-build] [--format table|json] [--config path]',
|
|
58
58
|
peek: 'peek <path> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where "<sql>"] [--no-build] [--format table|json] [--config path]',
|
|
59
59
|
path: 'path <a> <b> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where "<sql>"] [--max-depth n] [--no-build] [--format table|json] [--config path]',
|
|
60
60
|
related: 'related <note> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where "<sql>"] [--k n] [--no-build] [--format table|json|csv] [--config path]'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/index.ts"],"sourcesContent":["import type { Command } from './types.ts';\n\n// Each command's usage line, minus the leading \"usage: <name> \": shared by cli.ts's\n// usage() and the command's own parse() error/--help output so there is one copy, not two.\nexport const USAGE = {\n init: 'init [--model id-or-path] [--provider static|openai|cohere] [--url url]',\n build: 'build [--force] [--config path]',\n watch: 'watch [--force] [--config path]',\n status: 'status [--format table|json] [--config path]',\n download: 'download [--config path]',\n sql: 'sql \"<statement>\" [params...] [--preset name] [--no-build] [--format table|json|csv] [--config path]',\n search: 'search \"<terms>\" [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--k n] [--snippet-char-limit n] [--snippet-count-limit n] [--no-build] [--format table|json|csv] [--config path]',\n map: 'map [--no-build] [--format table|json] [--config path]',\n peek: 'peek <path> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--no-build] [--format table|json] [--config path]',\n path: 'path <a> <b> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--max-depth n] [--no-build] [--format table|json] [--config path]',\n related: 'related <note> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--k n] [--no-build] [--format table|json|csv] [--config path]',\n} as const;\n\n// Lazy registry: a command's imports load only when it runs, so a heavy dependency in one\n// command never taxes the others (or --version/--help). These names are reserved from saved queries.\nexport const COMMANDS: Record<string, () => Promise<{ default: Command }>> = {\n init: () => import('./init.ts'),\n build: () => import('./build.ts'),\n watch: () => import('./watch.ts'),\n status: () => import('./status.ts'),\n download: () => import('./download.ts'),\n sql: () => import('./sql.ts'),\n search: () => import('./search.ts'),\n map: () => import('./map.ts'),\n peek: () => import('./peek.ts'),\n path: () => import('./path.ts'),\n related: () => import('./related.ts'),\n};\n\nexport type { Command, Ctx } from './types.ts';\n"],"names":["COMMANDS","USAGE","init","build","watch","status","download","sql","search","map","peek","path","related"],"mappings":";;;;;;;;;;;QAoBaA;eAAAA;;QAhBAC;eAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAN,IAAMA,QAAQ;IACnBC,MAAM;IACNC,OAAO;IACPC,OAAO;IACPC,QAAQ;IACRC,UAAU;IACVC,KAAK;IACLC,QAAQ;IACRC,KAAK;IACLC,MAAM;IACNC,MAAM;IACNC,SAAS;AACX;AAIO,IAAMZ,WAAgE;IAC3EE,MAAM,SAANA;eAAY;2DAAA,QAAO;;;IACnBC,OAAO,SAAPA;eAAa;2DAAA,QAAO;;;IACpBC,OAAO,SAAPA;eAAa;2DAAA,QAAO;;;IACpBC,QAAQ,SAARA;eAAc;2DAAA,QAAO;;;IACrBC,UAAU,SAAVA;eAAgB;2DAAA,QAAO;;;IACvBC,KAAK,SAALA;eAAW;2DAAA,QAAO;;;IAClBC,QAAQ,SAARA;eAAc;2DAAA,QAAO;;;IACrBC,KAAK,SAALA;eAAW;2DAAA,QAAO;;;IAClBC,MAAM,SAANA;eAAY;2DAAA,QAAO;;;IACnBC,MAAM,SAANA;eAAY;2DAAA,QAAO;;;IACnBC,SAAS,SAATA;eAAe;2DAAA,QAAO;;;AACxB"}
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/index.ts"],"sourcesContent":["import type { Command } from './types.ts';\n\n// Each command's usage line, minus the leading \"usage: <name> \": shared by cli.ts's\n// usage() and the command's own parse() error/--help output so there is one copy, not two.\nexport const USAGE = {\n init: 'init [--model id-or-path] [--provider static|openai|cohere] [--url url]',\n build: 'build [--force] [--config path]',\n watch: 'watch [--force] [--config path]',\n status: 'status [--format table|json] [--config path]',\n download: 'download [--config path]',\n sql: 'sql \"<statement>\" [params...] [--preset name] [--no-build] [--format table|json|csv] [--config path]',\n search: 'search \"<terms>\" [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--k n] [--snippet-char-limit n] [--snippet-count-limit n] [--no-build] [--format table|json|csv] [--config path]',\n map: 'map [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--no-build] [--format table|json] [--config path]',\n peek: 'peek <path> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--no-build] [--format table|json] [--config path]',\n path: 'path <a> <b> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--max-depth n] [--no-build] [--format table|json] [--config path]',\n related: 'related <note> [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude] [--where \"<sql>\"] [--k n] [--no-build] [--format table|json|csv] [--config path]',\n} as const;\n\n// Lazy registry: a command's imports load only when it runs, so a heavy dependency in one\n// command never taxes the others (or --version/--help). These names are reserved from saved queries.\nexport const COMMANDS: Record<string, () => Promise<{ default: Command }>> = {\n init: () => import('./init.ts'),\n build: () => import('./build.ts'),\n watch: () => import('./watch.ts'),\n status: () => import('./status.ts'),\n download: () => import('./download.ts'),\n sql: () => import('./sql.ts'),\n search: () => import('./search.ts'),\n map: () => import('./map.ts'),\n peek: () => import('./peek.ts'),\n path: () => import('./path.ts'),\n related: () => import('./related.ts'),\n};\n\nexport type { Command, Ctx } from './types.ts';\n"],"names":["COMMANDS","USAGE","init","build","watch","status","download","sql","search","map","peek","path","related"],"mappings":";;;;;;;;;;;QAoBaA;eAAAA;;QAhBAC;eAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAN,IAAMA,QAAQ;IACnBC,MAAM;IACNC,OAAO;IACPC,OAAO;IACPC,QAAQ;IACRC,UAAU;IACVC,KAAK;IACLC,QAAQ;IACRC,KAAK;IACLC,MAAM;IACNC,MAAM;IACNC,SAAS;AACX;AAIO,IAAMZ,WAAgE;IAC3EE,MAAM,SAANA;eAAY;2DAAA,QAAO;;;IACnBC,OAAO,SAAPA;eAAa;2DAAA,QAAO;;;IACpBC,OAAO,SAAPA;eAAa;2DAAA,QAAO;;;IACpBC,QAAQ,SAARA;eAAc;2DAAA,QAAO;;;IACrBC,UAAU,SAAVA;eAAgB;2DAAA,QAAO;;;IACvBC,KAAK,SAALA;eAAW;2DAAA,QAAO;;;IAClBC,QAAQ,SAARA;eAAc;2DAAA,QAAO;;;IACrBC,KAAK,SAALA;eAAW;2DAAA,QAAO;;;IAClBC,MAAM,SAANA;eAAY;2DAAA,QAAO;;;IACnBC,MAAM,SAANA;eAAY;2DAAA,QAAO;;;IACnBC,SAAS,SAATA;eAAe;2DAAA,QAAO;;;AACxB"}
|
package/dist/cjs/cli/path.js
CHANGED
|
@@ -8,9 +8,7 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return _default;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
var
|
|
12
|
-
var _scopets = require("../commands/scope.js");
|
|
13
|
-
var _traversets = require("../graph/traverse.js");
|
|
11
|
+
var _pathts = require("../commands/path.js");
|
|
14
12
|
var _outputts = require("../output/output.js");
|
|
15
13
|
var _indexts = require("./index.js");
|
|
16
14
|
var _sharedts = require("./shared.js");
|
|
@@ -259,39 +257,17 @@ var pathCmd = function pathCmd(ctx) {
|
|
|
259
257
|
])
|
|
260
258
|
}, function(store, cfg) {
|
|
261
259
|
return _async_to_generator(function() {
|
|
262
|
-
var
|
|
260
|
+
var hops, rows;
|
|
263
261
|
return _ts_generator(this, function(_state) {
|
|
264
262
|
switch(_state.label){
|
|
265
263
|
case 0:
|
|
266
264
|
return [
|
|
267
265
|
4,
|
|
268
|
-
|
|
266
|
+
(0, _pathts.findPath)(store, cfg, a, b, _object_spread_props(_object_spread({}, (0, _sharedts.scopeOf)(values)), {
|
|
267
|
+
maxDepth: maxDepth
|
|
268
|
+
}))
|
|
269
269
|
];
|
|
270
270
|
case 1:
|
|
271
|
-
return [
|
|
272
|
-
4,
|
|
273
|
-
_state.sent().all()
|
|
274
|
-
];
|
|
275
|
-
case 2:
|
|
276
|
-
paths = _state.sent().map(function(r) {
|
|
277
|
-
return r.path;
|
|
278
|
-
});
|
|
279
|
-
from = (0, _peekts.resolveNote)(paths, a);
|
|
280
|
-
to = (0, _peekts.resolveNote)(paths, b);
|
|
281
|
-
return [
|
|
282
|
-
4,
|
|
283
|
-
(0, _scopets.scopedPaths)(store, cfg, (0, _sharedts.scopeOf)(values))
|
|
284
|
-
];
|
|
285
|
-
case 3:
|
|
286
|
-
allowed = _state.sent();
|
|
287
|
-
return [
|
|
288
|
-
4,
|
|
289
|
-
(0, _traversets.findPath)(store, from, to, {
|
|
290
|
-
maxDepth: maxDepth,
|
|
291
|
-
allowed: allowed
|
|
292
|
-
})
|
|
293
|
-
];
|
|
294
|
-
case 4:
|
|
295
271
|
hops = _state.sent();
|
|
296
272
|
if (format === 'json') {
|
|
297
273
|
console.log(JSON.stringify(hops));
|
package/dist/cjs/cli/path.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/path.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/path.ts"],"sourcesContent":["import { findPath } from '../commands/path.ts';\nimport type { Row } from '../output/output.ts';\nimport { printRows } from '../output/output.ts';\nimport type { BuildRequirement } from '../store/open.ts';\nimport { USAGE } from './index.ts';\nimport { CONFIG, FORMAT, formatOf, NO_BUILD, parse, SCOPE, scopeOf, withDb } from './shared.ts';\nimport type { Command } from './types.ts';\n\n// --max-depth must be a positive integer, mirroring shared.ts's parseK.\nfunction parseMaxDepth(depth: string | undefined, usageError: (message: string) => never): number | undefined {\n if (depth === undefined) return undefined;\n const parsed = Number(depth);\n if (!Number.isInteger(parsed) || parsed <= 0) usageError(`--max-depth expects a positive integer, got \"${depth}\"`);\n return parsed;\n}\n\nconst pathCmd: Command = (ctx) => {\n const usage = `usage: ${ctx.name} ${USAGE.path}`;\n const { values, positionals } = parse(ctx.argv, usage, { ...SCOPE, ...NO_BUILD, ...FORMAT, ...CONFIG, 'max-depth': { type: 'string' } });\n const [a, b] = positionals;\n if (!a || !b) ctx.usageError(usage);\n const maxDepth = parseMaxDepth(values['max-depth'] as string | undefined, ctx.usageError);\n const format = formatOf(values);\n return withDb(ctx, values.config as string | undefined, { noBuild: values['no-build'] === true, requirements: new Set<BuildRequirement>(['core']) }, async (store, cfg) => {\n const hops = await findPath(store, cfg, a, b, { ...scopeOf(values), maxDepth });\n\n if (format === 'json') {\n console.log(JSON.stringify(hops));\n return;\n }\n if (hops === null) {\n console.log(maxDepth ? `no path within ${maxDepth} hops` : 'no path');\n return;\n }\n const rows: Row[] = hops.map((p, step) => ({ step, path: p }));\n printRows(rows, format);\n });\n};\nexport default pathCmd;\n"],"names":["parseMaxDepth","depth","usageError","undefined","parsed","Number","isInteger","pathCmd","ctx","usage","USAGE","name","path","parse","argv","SCOPE","NO_BUILD","FORMAT","CONFIG","type","values","positionals","a","b","maxDepth","format","formatOf","withDb","config","noBuild","requirements","Set","store","cfg","hops","rows","findPath","scopeOf","console","log","JSON","stringify","map","p","step","printRows"],"mappings":";;;;+BAsCA;;;eAAA;;;sBAtCyB;wBAEC;uBAEJ;wBAC4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGlF,wEAAwE;AACxE,SAASA,cAAcC,KAAyB,EAAEC,UAAsC;IACtF,IAAID,UAAUE,WAAW,OAAOA;IAChC,IAAMC,SAASC,OAAOJ;IACtB,IAAI,CAACI,OAAOC,SAAS,CAACF,WAAWA,UAAU,GAAGF,WAAW,AAAC,gDAAqD,OAAND,OAAM;IAC/G,OAAOG;AACT;AAEA,IAAMG,UAAmB,iBAACC;IACxB,IAAMC,QAAQ,AAAC,UAAqBC,OAAZF,IAAIG,IAAI,EAAC,KAAc,OAAXD,cAAK,CAACE,IAAI;IAC9C,IAAgCC,SAAAA,IAAAA,eAAK,EAACL,IAAIM,IAAI,EAAEL,OAAO,wCAAKM,eAAK,EAAKC,kBAAQ,EAAKC,gBAAM,EAAKC,gBAAM;QAAE,aAAa;YAAEC,MAAM;QAAS;SAA5HC,SAAwBP,OAAxBO,QAAQC,cAAgBR,OAAhBQ;IAChB,IAAeA,gCAAAA,iBAARC,IAAQD,iBAALE,IAAKF;IACf,IAAI,CAACC,KAAK,CAACC,GAAGf,IAAIN,UAAU,CAACO;IAC7B,IAAMe,WAAWxB,cAAcoB,MAAM,CAAC,YAAY,EAAwBZ,IAAIN,UAAU;IACxF,IAAMuB,SAASC,IAAAA,kBAAQ,EAACN;IACxB,OAAOO,IAAAA,gBAAM,EAACnB,KAAKY,OAAOQ,MAAM,EAAwB;QAAEC,SAAST,MAAM,CAAC,WAAW,KAAK;QAAMU,cAAc,IAAIC,IAAsB;YAAC;SAAO;IAAE,GAAG,SAAOC,OAAOC;;gBAC3JC,MAUAC;;;;wBAVO;;4BAAMC,IAAAA,gBAAQ,EAACJ,OAAOC,KAAKX,GAAGC,GAAG,wCAAKc,IAAAA,iBAAO,EAACjB;gCAASI,UAAAA;;;;wBAA9DU,OAAO;wBAEb,IAAIT,WAAW,QAAQ;4BACrBa,QAAQC,GAAG,CAACC,KAAKC,SAAS,CAACP;4BAC3B;;;wBACF;wBACA,IAAIA,SAAS,MAAM;4BACjBI,QAAQC,GAAG,CAACf,WAAW,AAAC,kBAA0B,OAATA,UAAS,WAAS;4BAC3D;;;wBACF;wBACMW,OAAcD,KAAKQ,GAAG,CAAC,SAACC,GAAGC;mCAAU;gCAAEA,MAAAA;gCAAMhC,MAAM+B;4BAAE;;wBAC3DE,IAAAA,mBAAS,EAACV,MAAMV;;;;;;QAClB;;AACF;IACA,WAAelB"}
|
package/dist/cjs/cli/related.js
CHANGED
|
@@ -249,7 +249,6 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
249
249
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
250
250
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
251
251
|
}
|
|
252
|
-
var RELATED_DEFAULT_K = 5;
|
|
253
252
|
var relatedCmd = function relatedCmd(ctx) {
|
|
254
253
|
var _parseK;
|
|
255
254
|
var usage = "usage: ".concat(ctx.name, " ").concat(_indexts1.USAGE.related);
|
|
@@ -260,7 +259,7 @@ var relatedCmd = function relatedCmd(ctx) {
|
|
|
260
259
|
})), values = _parse.values, positionals = _parse.positionals;
|
|
261
260
|
var _positionals = _sliced_to_array(positionals, 1), pathArg = _positionals[0];
|
|
262
261
|
if (!pathArg) ctx.usageError(usage);
|
|
263
|
-
var k = (_parseK = (0, _sharedts.parseK)(values.k, ctx.usageError)) !== null && _parseK !== void 0 ? _parseK : RELATED_DEFAULT_K;
|
|
262
|
+
var k = (_parseK = (0, _sharedts.parseK)(values.k, ctx.usageError)) !== null && _parseK !== void 0 ? _parseK : _relatedts.RELATED_DEFAULT_K;
|
|
264
263
|
var format = (0, _sharedts.rowFormatOf)(values);
|
|
265
264
|
var noBuild = values['no-build'] === true;
|
|
266
265
|
return (0, _sharedts.withDb)(ctx, values.config, {
|
|
@@ -303,7 +302,9 @@ var relatedCmd = function relatedCmd(ctx) {
|
|
|
303
302
|
case 4:
|
|
304
303
|
return [
|
|
305
304
|
4,
|
|
306
|
-
(0, _relatedts.relatedNotes)(store, cfg, pathArg, overrides,
|
|
305
|
+
(0, _relatedts.relatedNotes)(store, cfg, pathArg, _object_spread_props(_object_spread({}, overrides), {
|
|
306
|
+
k: k
|
|
307
|
+
}))
|
|
307
308
|
];
|
|
308
309
|
case 5:
|
|
309
310
|
_outputts.printRows.apply(void 0, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/related.ts"],"sourcesContent":["import { relatedNotes, resolveRelatedSeed } from '../commands/related.ts';\nimport { scopedPaths } from '../commands/scope.ts';\nimport { resolveSearch } from '../config/index.ts';\nimport
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/related.ts"],"sourcesContent":["import { RELATED_DEFAULT_K, relatedNotes, resolveRelatedSeed } from '../commands/related.ts';\nimport { scopedPaths } from '../commands/scope.ts';\nimport { resolveSearch } from '../config/index.ts';\nimport { printRows } from '../output/output.ts';\nimport { type BuildRequirement, prepareDocumentEmbeddings } from '../store/open.ts';\nimport { USAGE } from './index.ts';\nimport { CONFIG, FORMAT, NO_BUILD, parse, parseK, rowFormatOf, SCOPE, scopeOf, withDb } from './shared.ts';\nimport type { Command } from './types.ts';\n\nconst relatedCmd: Command = (ctx) => {\n const usage = `usage: ${ctx.name} ${USAGE.related}`;\n const { values, positionals } = parse(ctx.argv, usage, { ...SCOPE, ...NO_BUILD, ...FORMAT, ...CONFIG, k: { type: 'string' } });\n const [pathArg] = positionals;\n if (!pathArg) ctx.usageError(usage);\n const k = parseK(values.k as string | undefined, ctx.usageError) ?? RELATED_DEFAULT_K;\n const format = rowFormatOf(values);\n const noBuild = values['no-build'] === true;\n return withDb(ctx, values.config as string | undefined, { noBuild, requirements: new Set<BuildRequirement>(['core']) }, async (store, cfg, build) => {\n const overrides = scopeOf(values);\n if (build && resolveSearch(cfg, overrides).signals.vectors !== undefined) {\n const path = await resolveRelatedSeed(store, pathArg);\n const allowed = await scopedPaths(store, cfg, overrides);\n await prepareDocumentEmbeddings(store, cfg, new Set([...allowed, path]));\n }\n printRows(await relatedNotes(store, cfg, pathArg, { ...overrides, k }), format);\n });\n};\nexport default relatedCmd;\n"],"names":["relatedCmd","ctx","parseK","usage","USAGE","name","related","parse","argv","SCOPE","NO_BUILD","FORMAT","CONFIG","k","type","values","positionals","pathArg","usageError","RELATED_DEFAULT_K","format","rowFormatOf","noBuild","withDb","config","requirements","Set","store","cfg","build","overrides","path","allowed","scopeOf","resolveSearch","signals","vectors","undefined","resolveRelatedSeed","scopedPaths","prepareDocumentEmbeddings","relatedNotes","printRows"],"mappings":";;;;+BA2BA;;;eAAA;;;yBA3BoE;uBACxC;uBACE;wBACJ;sBACuC;wBAC3C;wBACuE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG7F,IAAMA,aAAsB,oBAACC;QAKjBC;IAJV,IAAMC,QAAQ,AAAC,UAAqBC,OAAZH,IAAII,IAAI,EAAC,KAAiB,OAAdD,eAAK,CAACE,OAAO;IACjD,IAAgCC,SAAAA,IAAAA,eAAK,EAACN,IAAIO,IAAI,EAAEL,OAAO,wCAAKM,eAAK,EAAKC,kBAAQ,EAAKC,gBAAM,EAAKC,gBAAM;QAAEC,GAAG;YAAEC,MAAM;QAAS;SAAlHC,SAAwBR,OAAxBQ,QAAQC,cAAgBT,OAAhBS;IAChB,IAAkBA,gCAAAA,iBAAXC,UAAWD;IAClB,IAAI,CAACC,SAAShB,IAAIiB,UAAU,CAACf;IAC7B,IAAMU,KAAIX,UAAAA,IAAAA,gBAAM,EAACa,OAAOF,CAAC,EAAwBZ,IAAIiB,UAAU,eAArDhB,qBAAAA,UAA0DiB,4BAAiB;IACrF,IAAMC,SAASC,IAAAA,qBAAW,EAACN;IAC3B,IAAMO,UAAUP,MAAM,CAAC,WAAW,KAAK;IACvC,OAAOQ,IAAAA,gBAAM,EAACtB,KAAKc,OAAOS,MAAM,EAAwB;QAAEF,SAAAA;QAASG,cAAc,IAAIC,IAAsB;YAAC;SAAO;IAAE,GAAG,SAAOC,OAAOC,KAAKC;;gBACnIC,WAEEC,MACAC;;;;wBAHFF,YAAYG,IAAAA,iBAAO,EAAClB;6BACtBc,CAAAA,SAASK,IAAAA,sBAAa,EAACN,KAAKE,WAAWK,OAAO,CAACC,OAAO,KAAKC,SAAQ,GAAnER;;;;wBACW;;4BAAMS,IAAAA,6BAAkB,EAACX,OAAOV;;;wBAAvCc,OAAO;wBACG;;4BAAMQ,IAAAA,oBAAW,EAACZ,OAAOC,KAAKE;;;wBAAxCE,UAAU;wBAChB;;4BAAMQ,IAAAA,iCAAyB,EAACb,OAAOC,KAAK,IAAIF,IAAI,AAAC,qBAAGM;gCAASD;;;;wBAAjE;;;wBAEQ;;4BAAMU,IAAAA,uBAAY,EAACd,OAAOC,KAAKX,SAAS,wCAAKa;gCAAWjB,GAAAA;;;;wBAAlE6B,mBAAS;4BAAC;4BAA8DtB;;;;;;;QAC1E;;AACF;IACA,WAAepB"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
export type { TreeMap } from './map.js';
|
|
1
|
+
export type { TreeMap, TreeMapField, TreeMapHub, TreeMapRecent } from './map.js';
|
|
2
2
|
export { mapTree } from './map.js';
|
|
3
|
-
export type {
|
|
3
|
+
export type { PathOptions } from './path.js';
|
|
4
|
+
export { findPath } from './path.js';
|
|
5
|
+
export type { Peek, PeekSection } from './peek.js';
|
|
4
6
|
export { peek, resolveNote } from './peek.js';
|
|
7
|
+
export type { RelatedOptions, RelatedResult } from './related.js';
|
|
5
8
|
export { relatedNotes } from './related.js';
|
|
6
9
|
export { scopedPaths } from './scope.js';
|
|
7
|
-
export type { SearchOptions } from './search.js';
|
|
10
|
+
export type { SearchOptions, SearchResult, SearchResultVia } from './search.js';
|
|
8
11
|
export { search } from './search.js';
|
|
9
12
|
export type { PresetCoverage } from './status.js';
|
|
10
13
|
export { presetCoverage } from './status.js';
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
export type { TreeMap } from './map.js';
|
|
1
|
+
export type { TreeMap, TreeMapField, TreeMapHub, TreeMapRecent } from './map.js';
|
|
2
2
|
export { mapTree } from './map.js';
|
|
3
|
-
export type {
|
|
3
|
+
export type { PathOptions } from './path.js';
|
|
4
|
+
export { findPath } from './path.js';
|
|
5
|
+
export type { Peek, PeekSection } from './peek.js';
|
|
4
6
|
export { peek, resolveNote } from './peek.js';
|
|
7
|
+
export type { RelatedOptions, RelatedResult } from './related.js';
|
|
5
8
|
export { relatedNotes } from './related.js';
|
|
6
9
|
export { scopedPaths } from './scope.js';
|
|
7
|
-
export type { SearchOptions } from './search.js';
|
|
10
|
+
export type { SearchOptions, SearchResult, SearchResultVia } from './search.js';
|
|
8
11
|
export { search } from './search.js';
|
|
9
12
|
export type { PresetCoverage } from './status.js';
|
|
10
13
|
export { presetCoverage } from './status.js';
|
|
@@ -11,6 +11,9 @@ function _export(target, all) {
|
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
_export(exports, {
|
|
14
|
+
get findPath () {
|
|
15
|
+
return _pathts.findPath;
|
|
16
|
+
},
|
|
14
17
|
get mapTree () {
|
|
15
18
|
return _mapts.mapTree;
|
|
16
19
|
},
|
|
@@ -34,6 +37,7 @@ _export(exports, {
|
|
|
34
37
|
}
|
|
35
38
|
});
|
|
36
39
|
var _mapts = require("./map.js");
|
|
40
|
+
var _pathts = require("./path.js");
|
|
37
41
|
var _peekts = require("./peek.js");
|
|
38
42
|
var _relatedts = require("./related.js");
|
|
39
43
|
var _scopets = require("./scope.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/commands/index.ts"],"sourcesContent":["// The three commands: mapTree (orient), search (locate), peek (structure).\n// Each returns data; cli.ts renders. All of them degrade when a feature is off.\n\nexport type { TreeMap } from './map.ts';\nexport { mapTree } from './map.ts';\nexport type { Peek } from './peek.ts';\nexport { peek, resolveNote } from './peek.ts';\nexport { relatedNotes } from './related.ts';\nexport { scopedPaths } from './scope.ts';\nexport type { SearchOptions } from './search.ts';\nexport { search } from './search.ts';\nexport type { PresetCoverage } from './status.ts';\nexport { presetCoverage } from './status.ts';\n"],"names":["mapTree","peek","presetCoverage","relatedNotes","resolveNote","scopedPaths","search"],"mappings":"AAAA,2EAA2E;AAC3E,gFAAgF;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/commands/index.ts"],"sourcesContent":["// The three commands: mapTree (orient), search (locate), peek (structure).\n// Each returns data; cli.ts renders. All of them degrade when a feature is off.\n\nexport type { TreeMap, TreeMapField, TreeMapHub, TreeMapRecent } from './map.ts';\nexport { mapTree } from './map.ts';\nexport type { PathOptions } from './path.ts';\nexport { findPath } from './path.ts';\nexport type { Peek, PeekSection } from './peek.ts';\nexport { peek, resolveNote } from './peek.ts';\nexport type { RelatedOptions, RelatedResult } from './related.ts';\nexport { relatedNotes } from './related.ts';\nexport { scopedPaths } from './scope.ts';\nexport type { SearchOptions, SearchResult, SearchResultVia } from './search.ts';\nexport { search } from './search.ts';\nexport type { PresetCoverage } from './status.ts';\nexport { presetCoverage } from './status.ts';\n"],"names":["findPath","mapTree","peek","presetCoverage","relatedNotes","resolveNote","scopedPaths","search"],"mappings":"AAAA,2EAA2E;AAC3E,gFAAgF;;;;;;;;;;;;QAKvEA;eAAAA,gBAAQ;;QAFRC;eAAAA,cAAO;;QAIPC;eAAAA,YAAI;;QAOJC;eAAAA,wBAAc;;QALdC;eAAAA,uBAAY;;QAFNC;eAAAA,mBAAW;;QAGjBC;eAAAA,oBAAW;;QAEXC;eAAAA,gBAAM;;;qBATS;sBAEC;sBAES;yBAEL;uBACD;wBAEL;wBAEQ"}
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import type { FeatureName, ResolvedConfig, SearchOverrides } from '../config/index.js';
|
|
2
|
-
import type {
|
|
3
|
-
import type { Store } from '../store/types.js';
|
|
2
|
+
import type { FieldStat, Store } from '../store/types.js';
|
|
4
3
|
import type { PresetCoverage } from './status.js';
|
|
5
4
|
export interface TreeMap {
|
|
6
5
|
docs: {
|
|
7
6
|
count: number;
|
|
8
7
|
bytes: number;
|
|
9
8
|
};
|
|
10
|
-
fields:
|
|
9
|
+
fields: TreeMapField[];
|
|
11
10
|
fieldsTotal: number;
|
|
12
11
|
features: {
|
|
13
12
|
on: FeatureName[];
|
|
14
13
|
off: FeatureName[];
|
|
15
14
|
};
|
|
16
15
|
presets: PresetCoverage[];
|
|
17
|
-
hubs:
|
|
18
|
-
recent:
|
|
16
|
+
hubs: TreeMapHub[];
|
|
17
|
+
recent: TreeMapRecent[];
|
|
19
18
|
recentCaveat: string | null;
|
|
20
19
|
}
|
|
20
|
+
export type TreeMapField = FieldStat;
|
|
21
|
+
export type TreeMapHub = {
|
|
22
|
+
path: string;
|
|
23
|
+
rank: number;
|
|
24
|
+
title: string;
|
|
25
|
+
};
|
|
26
|
+
export type TreeMapRecent = {
|
|
27
|
+
path: string;
|
|
28
|
+
modified: string;
|
|
29
|
+
};
|
|
21
30
|
export declare function mapTree(store: Store, cfg: ResolvedConfig, overrides?: SearchOverrides): Promise<TreeMap>;
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import type { FeatureName, ResolvedConfig, SearchOverrides } from '../config/index.js';
|
|
2
|
-
import type {
|
|
3
|
-
import type { Store } from '../store/types.js';
|
|
2
|
+
import type { FieldStat, Store } from '../store/types.js';
|
|
4
3
|
import type { PresetCoverage } from './status.js';
|
|
5
4
|
export interface TreeMap {
|
|
6
5
|
docs: {
|
|
7
6
|
count: number;
|
|
8
7
|
bytes: number;
|
|
9
8
|
};
|
|
10
|
-
fields:
|
|
9
|
+
fields: TreeMapField[];
|
|
11
10
|
fieldsTotal: number;
|
|
12
11
|
features: {
|
|
13
12
|
on: FeatureName[];
|
|
14
13
|
off: FeatureName[];
|
|
15
14
|
};
|
|
16
15
|
presets: PresetCoverage[];
|
|
17
|
-
hubs:
|
|
18
|
-
recent:
|
|
16
|
+
hubs: TreeMapHub[];
|
|
17
|
+
recent: TreeMapRecent[];
|
|
19
18
|
recentCaveat: string | null;
|
|
20
19
|
}
|
|
20
|
+
export type TreeMapField = FieldStat;
|
|
21
|
+
export type TreeMapHub = {
|
|
22
|
+
path: string;
|
|
23
|
+
rank: number;
|
|
24
|
+
title: string;
|
|
25
|
+
};
|
|
26
|
+
export type TreeMapRecent = {
|
|
27
|
+
path: string;
|
|
28
|
+
modified: string;
|
|
29
|
+
};
|
|
21
30
|
export declare function mapTree(store: Store, cfg: ResolvedConfig, overrides?: SearchOverrides): Promise<TreeMap>;
|
package/dist/cjs/commands/map.js
CHANGED
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "mapTree", {
|
|
|
11
11
|
var _indexts = require("../config/index.js");
|
|
12
12
|
var _serialqueryts = require("../lib/serial-query.js");
|
|
13
13
|
var _scopets = require("./scope.js");
|
|
14
|
+
var _snapshotts = require("./snapshot.js");
|
|
14
15
|
var _statusts = require("./status.js");
|
|
15
16
|
function _array_like_to_array(arr, len) {
|
|
16
17
|
if (len == null || len > arr.length) len = arr.length;
|
|
@@ -194,6 +195,12 @@ function mapIndexed(store, cfg, overrides) {
|
|
|
194
195
|
return _ts_generator(this, function(_state) {
|
|
195
196
|
switch(_state.label){
|
|
196
197
|
case 0:
|
|
198
|
+
return [
|
|
199
|
+
4,
|
|
200
|
+
(0, _snapshotts.assertQuerySnapshot)(store, cfg)
|
|
201
|
+
];
|
|
202
|
+
case 1:
|
|
203
|
+
_state.sent();
|
|
197
204
|
_tmp = [
|
|
198
205
|
store
|
|
199
206
|
];
|
|
@@ -201,14 +208,14 @@ function mapIndexed(store, cfg, overrides) {
|
|
|
201
208
|
4,
|
|
202
209
|
(0, _scopets.scopedPaths)(store, cfg, overrides)
|
|
203
210
|
];
|
|
204
|
-
case
|
|
211
|
+
case 2:
|
|
205
212
|
return [
|
|
206
213
|
4,
|
|
207
214
|
_scopets.setupMapScope.apply(void 0, _tmp.concat([
|
|
208
215
|
_state.sent()
|
|
209
216
|
]))
|
|
210
217
|
];
|
|
211
|
-
case
|
|
218
|
+
case 3:
|
|
212
219
|
_state.sent();
|
|
213
220
|
scopeWhere = 'WHERE "path" IN (SELECT "path" FROM _map_scope)';
|
|
214
221
|
scopeAnd = 'AND f."path" IN (SELECT "path" FROM _map_scope)';
|
|
@@ -216,18 +223,18 @@ function mapIndexed(store, cfg, overrides) {
|
|
|
216
223
|
4,
|
|
217
224
|
store.prepare('SELECT COUNT(*) AS count, COALESCE(SUM("_size"), 0) AS bytes FROM frontmatter '.concat(scopeWhere))
|
|
218
225
|
];
|
|
219
|
-
case
|
|
226
|
+
case 4:
|
|
220
227
|
return [
|
|
221
228
|
4,
|
|
222
229
|
_state.sent().get()
|
|
223
230
|
];
|
|
224
|
-
case
|
|
231
|
+
case 5:
|
|
225
232
|
docs = _state.sent();
|
|
226
233
|
return [
|
|
227
234
|
4,
|
|
228
235
|
store.docs.columns()
|
|
229
236
|
];
|
|
230
|
-
case
|
|
237
|
+
case 6:
|
|
231
238
|
columns = _state.sent().filter(function(name) {
|
|
232
239
|
return !_scopets.INTERNAL_COLUMNS.has(name);
|
|
233
240
|
});
|
|
@@ -235,20 +242,20 @@ function mapIndexed(store, cfg, overrides) {
|
|
|
235
242
|
// every distinct type observed across the scope is reported, not just the first.
|
|
236
243
|
allFields = [];
|
|
237
244
|
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
238
|
-
_state.label =
|
|
239
|
-
case
|
|
245
|
+
_state.label = 7;
|
|
246
|
+
case 7:
|
|
240
247
|
_state.trys.push([
|
|
241
|
-
|
|
242
|
-
11,
|
|
248
|
+
7,
|
|
243
249
|
12,
|
|
244
|
-
13
|
|
250
|
+
13,
|
|
251
|
+
14
|
|
245
252
|
]);
|
|
246
253
|
_iterator = chunk(columns, MAP_COLUMN_CHUNK)[Symbol.iterator]();
|
|
247
|
-
_state.label =
|
|
248
|
-
case
|
|
254
|
+
_state.label = 8;
|
|
255
|
+
case 8:
|
|
249
256
|
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
|
|
250
257
|
3,
|
|
251
|
-
|
|
258
|
+
11
|
|
252
259
|
];
|
|
253
260
|
group = _step.value;
|
|
254
261
|
_1 = (_ = (_allFields = allFields).push).apply;
|
|
@@ -259,33 +266,33 @@ function mapIndexed(store, cfg, overrides) {
|
|
|
259
266
|
4,
|
|
260
267
|
store.docs.fieldStats(group, scopeWhere)
|
|
261
268
|
];
|
|
262
|
-
case
|
|
269
|
+
case 9:
|
|
263
270
|
_1.apply(_, _tmp1.concat([
|
|
264
271
|
_to_consumable_array.apply(void 0, [
|
|
265
272
|
_state.sent()
|
|
266
273
|
])
|
|
267
274
|
]));
|
|
268
|
-
_state.label =
|
|
269
|
-
case
|
|
275
|
+
_state.label = 10;
|
|
276
|
+
case 10:
|
|
270
277
|
_iteratorNormalCompletion = true;
|
|
271
278
|
return [
|
|
272
279
|
3,
|
|
273
|
-
|
|
280
|
+
8
|
|
274
281
|
];
|
|
275
|
-
case
|
|
282
|
+
case 11:
|
|
276
283
|
return [
|
|
277
284
|
3,
|
|
278
|
-
|
|
285
|
+
14
|
|
279
286
|
];
|
|
280
|
-
case
|
|
287
|
+
case 12:
|
|
281
288
|
err = _state.sent();
|
|
282
289
|
_didIteratorError = true;
|
|
283
290
|
_iteratorError = err;
|
|
284
291
|
return [
|
|
285
292
|
3,
|
|
286
|
-
|
|
293
|
+
14
|
|
287
294
|
];
|
|
288
|
-
case
|
|
295
|
+
case 13:
|
|
289
296
|
try {
|
|
290
297
|
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
291
298
|
_iterator.return();
|
|
@@ -298,45 +305,45 @@ function mapIndexed(store, cfg, overrides) {
|
|
|
298
305
|
return [
|
|
299
306
|
7
|
|
300
307
|
];
|
|
301
|
-
case
|
|
308
|
+
case 14:
|
|
302
309
|
allFields.sort(function(a, b) {
|
|
303
310
|
return b.coverage - a.coverage;
|
|
304
311
|
});
|
|
305
312
|
fields = allFields.slice(0, 20);
|
|
306
313
|
if (!(0, _indexts.featureEnabled)(cfg, 'rank')) return [
|
|
307
314
|
3,
|
|
308
|
-
|
|
315
|
+
17
|
|
309
316
|
];
|
|
310
317
|
return [
|
|
311
318
|
4,
|
|
312
319
|
store.prepare('SELECT f."path" AS path, round(f."_rank" * 100, 2) AS rank, content.title FROM frontmatter f JOIN content ON content.path = f."path" WHERE f."_rank" IS NOT NULL '.concat(scopeAnd, ' ORDER BY f."_rank" DESC, f."path" ASC LIMIT 8'))
|
|
313
320
|
];
|
|
314
|
-
case
|
|
321
|
+
case 15:
|
|
315
322
|
return [
|
|
316
323
|
4,
|
|
317
324
|
_state.sent().all()
|
|
318
325
|
];
|
|
319
|
-
case
|
|
326
|
+
case 16:
|
|
320
327
|
_tmp2 = _state.sent();
|
|
321
328
|
return [
|
|
322
329
|
3,
|
|
323
|
-
|
|
330
|
+
18
|
|
324
331
|
];
|
|
325
|
-
case 16:
|
|
326
|
-
_tmp2 = [];
|
|
327
|
-
_state.label = 17;
|
|
328
332
|
case 17:
|
|
333
|
+
_tmp2 = [];
|
|
334
|
+
_state.label = 18;
|
|
335
|
+
case 18:
|
|
329
336
|
hubs = _tmp2;
|
|
330
337
|
return [
|
|
331
338
|
4,
|
|
332
339
|
store.prepare('SELECT "path", "_mtime" AS mtime FROM frontmatter '.concat(scopeWhere, ' ORDER BY "_mtime" DESC, "path" ASC LIMIT 5'))
|
|
333
340
|
];
|
|
334
|
-
case
|
|
341
|
+
case 19:
|
|
335
342
|
return [
|
|
336
343
|
4,
|
|
337
344
|
_state.sent().all()
|
|
338
345
|
];
|
|
339
|
-
case
|
|
346
|
+
case 20:
|
|
340
347
|
recent = _state.sent().map(function(r) {
|
|
341
348
|
return {
|
|
342
349
|
path: r.path,
|
|
@@ -347,12 +354,12 @@ function mapIndexed(store, cfg, overrides) {
|
|
|
347
354
|
4,
|
|
348
355
|
store.prepare("SELECT COUNT(*) AS n FROM frontmatter ".concat(scopeWhere, ' GROUP BY CAST("_mtime" / 1000 AS INTEGER) ORDER BY n DESC LIMIT 1'))
|
|
349
356
|
];
|
|
350
|
-
case
|
|
357
|
+
case 21:
|
|
351
358
|
return [
|
|
352
359
|
4,
|
|
353
360
|
_state.sent().get()
|
|
354
361
|
];
|
|
355
|
-
case
|
|
362
|
+
case 22:
|
|
356
363
|
topSecond = _state.sent();
|
|
357
364
|
recentCaveat = topSecond && docs.count > 1 && topSecond.n > docs.count / 2 ? "".concat(topSecond.n, " of ").concat(docs.count, " files share one modified second, so recency likely reflects a checkout or copy, not edit history") : null;
|
|
358
365
|
_tmp3 = {
|
|
@@ -365,7 +372,7 @@ function mapIndexed(store, cfg, overrides) {
|
|
|
365
372
|
4,
|
|
366
373
|
(0, _statusts.presetCoverage)(store, cfg)
|
|
367
374
|
];
|
|
368
|
-
case
|
|
375
|
+
case 23:
|
|
369
376
|
return [
|
|
370
377
|
2,
|
|
371
378
|
(_tmp3.presets = _state.sent(), _tmp3.hubs = hubs, _tmp3.recent = recent, _tmp3.recentCaveat = recentCaveat, _tmp3)
|