sensemaking 0.17.1 → 0.18.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 +15 -13
- package/dist/cjs/cli/map.js +144 -3
- package/dist/cjs/cli/map.js.map +1 -1
- package/dist/cjs/cli/named.js +19 -11
- package/dist/cjs/cli/named.js.map +1 -1
- package/dist/cjs/cli/path.js +186 -26
- package/dist/cjs/cli/path.js.map +1 -1
- package/dist/cjs/cli/peek.js +145 -4
- package/dist/cjs/cli/peek.js.map +1 -1
- package/dist/cjs/cli/related.js +2 -2
- package/dist/cjs/cli/related.js.map +1 -1
- package/dist/cjs/cli/search.js +2 -2
- package/dist/cjs/cli/search.js.map +1 -1
- package/dist/cjs/cli/shared.d.cts +3 -3
- package/dist/cjs/cli/shared.d.ts +3 -3
- package/dist/cjs/cli/shared.js +156 -58
- package/dist/cjs/cli/shared.js.map +1 -1
- package/dist/cjs/cli/sql.js +151 -10
- package/dist/cjs/cli/sql.js.map +1 -1
- package/dist/cjs/cli/status.js +177 -52
- package/dist/cjs/cli/status.js.map +1 -1
- package/dist/cjs/commands/map.d.cts +2 -2
- package/dist/cjs/commands/map.d.ts +2 -2
- package/dist/cjs/commands/map.js +373 -67
- package/dist/cjs/commands/map.js.map +1 -1
- package/dist/cjs/commands/peek.d.cts +2 -2
- package/dist/cjs/commands/peek.d.ts +2 -2
- package/dist/cjs/commands/peek.js +321 -79
- package/dist/cjs/commands/peek.js.map +1 -1
- package/dist/cjs/commands/related.d.cts +2 -2
- package/dist/cjs/commands/related.d.ts +2 -2
- package/dist/cjs/commands/related.js +55 -10
- package/dist/cjs/commands/related.js.map +1 -1
- package/dist/cjs/commands/scope.d.cts +7 -7
- package/dist/cjs/commands/scope.d.ts +7 -7
- package/dist/cjs/commands/scope.js +382 -45
- package/dist/cjs/commands/scope.js.map +1 -1
- package/dist/cjs/commands/search.d.cts +2 -2
- package/dist/cjs/commands/search.d.ts +2 -2
- package/dist/cjs/commands/search.js +292 -99
- package/dist/cjs/commands/search.js.map +1 -1
- package/dist/cjs/commands/signals.d.cts +4 -10
- package/dist/cjs/commands/signals.d.ts +4 -10
- package/dist/cjs/commands/signals.js +91 -45
- package/dist/cjs/commands/signals.js.map +1 -1
- package/dist/cjs/commands/status.d.cts +2 -2
- package/dist/cjs/commands/status.d.ts +2 -2
- package/dist/cjs/commands/status.js +247 -10
- package/dist/cjs/commands/status.js.map +1 -1
- package/dist/cjs/config/access.d.cts +1 -0
- package/dist/cjs/config/access.d.ts +1 -0
- package/dist/cjs/config/access.js +7 -0
- package/dist/cjs/config/access.js.map +1 -1
- package/dist/cjs/config/index.d.cts +1 -1
- package/dist/cjs/config/index.d.ts +1 -1
- package/dist/cjs/config/index.js +3 -0
- package/dist/cjs/config/index.js.map +1 -1
- package/dist/cjs/config/types.d.cts +1 -0
- package/dist/cjs/config/types.d.ts +1 -0
- package/dist/cjs/config/types.js.map +1 -1
- package/dist/cjs/config/validate.js +10 -1
- package/dist/cjs/config/validate.js.map +1 -1
- package/dist/cjs/embed/distribution.d.cts +3 -3
- package/dist/cjs/embed/distribution.d.ts +3 -3
- package/dist/cjs/embed/distribution.js +162 -6
- package/dist/cjs/embed/distribution.js.map +1 -1
- package/dist/cjs/embed/langfit.d.cts +2 -2
- package/dist/cjs/embed/langfit.d.ts +2 -2
- package/dist/cjs/embed/langfit.js +57 -44
- package/dist/cjs/embed/langfit.js.map +1 -1
- package/dist/cjs/embed/query.d.cts +6 -13
- package/dist/cjs/embed/query.d.ts +6 -13
- package/dist/cjs/embed/query.js +56 -168
- package/dist/cjs/embed/query.js.map +1 -1
- package/dist/cjs/embed/types.d.cts +1 -0
- package/dist/cjs/embed/types.d.ts +1 -0
- package/dist/cjs/embed/types.js +11 -2
- package/dist/cjs/embed/types.js.map +1 -1
- package/dist/cjs/errors.d.cts +1 -1
- package/dist/cjs/errors.d.ts +1 -1
- package/dist/cjs/errors.js.map +1 -1
- package/dist/cjs/features/embed.js +218 -11
- package/dist/cjs/features/embed.js.map +1 -1
- package/dist/cjs/features/index.d.cts +1 -1
- package/dist/cjs/features/index.d.ts +1 -1
- package/dist/cjs/features/index.js +6 -0
- package/dist/cjs/features/index.js.map +1 -1
- package/dist/cjs/features/links.d.cts +7 -2
- package/dist/cjs/features/links.d.ts +7 -2
- package/dist/cjs/features/links.js +710 -198
- package/dist/cjs/features/links.js.map +1 -1
- package/dist/cjs/features/rank.js +231 -31
- package/dist/cjs/features/rank.js.map +1 -1
- package/dist/cjs/features/sections.js +218 -8
- package/dist/cjs/features/sections.js.map +1 -1
- package/dist/cjs/features/tags.js +236 -40
- package/dist/cjs/features/tags.js.map +1 -1
- package/dist/cjs/features/types.d.cts +9 -5
- package/dist/cjs/features/types.d.ts +9 -5
- package/dist/cjs/graph/traverse.d.cts +2 -2
- package/dist/cjs/graph/traverse.d.ts +2 -2
- package/dist/cjs/graph/traverse.js +321 -42
- package/dist/cjs/graph/traverse.js.map +1 -1
- package/dist/cjs/index.d.cts +3 -2
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/guarded-tick.d.cts +1 -0
- package/dist/cjs/lib/guarded-tick.d.ts +1 -0
- package/dist/cjs/lib/guarded-tick.js +19 -0
- package/dist/cjs/lib/guarded-tick.js.map +1 -0
- package/dist/cjs/output/column-hint.d.cts +1 -2
- package/dist/cjs/output/column-hint.d.ts +1 -2
- package/dist/cjs/output/column-hint.js +1 -4
- package/dist/cjs/output/column-hint.js.map +1 -1
- package/dist/cjs/output/output.d.cts +2 -1
- package/dist/cjs/output/output.d.ts +2 -1
- package/dist/cjs/output/output.js +515 -97
- package/dist/cjs/output/output.js.map +1 -1
- package/dist/cjs/scan/frontmatter.js.map +1 -1
- package/dist/cjs/scan/index.js.map +1 -1
- package/dist/cjs/scan/reparse.d.cts +10 -0
- package/dist/cjs/scan/reparse.d.ts +10 -0
- package/dist/cjs/scan/reparse.js +104 -0
- package/dist/cjs/scan/reparse.js.map +1 -0
- package/dist/cjs/store/duckdb/batch.d.cts +16 -0
- package/dist/cjs/store/duckdb/batch.d.ts +16 -0
- package/dist/cjs/store/duckdb/batch.js +208 -0
- package/dist/cjs/store/duckdb/batch.js.map +1 -0
- package/dist/cjs/store/duckdb/connection.d.cts +5 -0
- package/dist/cjs/store/duckdb/connection.d.ts +5 -0
- package/dist/cjs/store/duckdb/connection.js +772 -0
- package/dist/cjs/store/duckdb/connection.js.map +1 -0
- package/dist/cjs/store/duckdb/lexical.d.cts +10 -0
- package/dist/cjs/store/duckdb/lexical.d.ts +10 -0
- package/dist/cjs/store/duckdb/lexical.js +502 -0
- package/dist/cjs/store/duckdb/lexical.js.map +1 -0
- package/dist/cjs/store/duckdb/native.d.cts +3 -0
- package/dist/cjs/store/duckdb/native.d.ts +3 -0
- package/dist/cjs/store/duckdb/native.js +360 -0
- package/dist/cjs/store/duckdb/native.js.map +1 -0
- package/dist/cjs/store/duckdb/open.d.cts +12 -0
- package/dist/cjs/store/duckdb/open.d.ts +12 -0
- package/dist/cjs/store/duckdb/open.js +501 -0
- package/dist/cjs/store/duckdb/open.js.map +1 -0
- package/dist/cjs/store/duckdb/reconcile.d.cts +6 -0
- package/dist/cjs/store/duckdb/reconcile.d.ts +6 -0
- package/dist/cjs/store/duckdb/reconcile.js +753 -0
- package/dist/cjs/store/duckdb/reconcile.js.map +1 -0
- package/dist/cjs/store/duckdb/sql-functions.d.cts +2 -0
- package/dist/cjs/store/duckdb/sql-functions.d.ts +2 -0
- package/dist/cjs/store/duckdb/sql-functions.js +203 -0
- package/dist/cjs/store/duckdb/sql-functions.js.map +1 -0
- package/dist/cjs/store/duckdb/store.d.cts +5 -0
- package/dist/cjs/store/duckdb/store.d.ts +5 -0
- package/dist/cjs/store/duckdb/store.js +504 -0
- package/dist/cjs/store/duckdb/store.js.map +1 -0
- package/dist/cjs/store/duckdb/vectors.d.cts +9 -0
- package/dist/cjs/store/duckdb/vectors.d.ts +9 -0
- package/dist/cjs/store/duckdb/vectors.js +502 -0
- package/dist/cjs/store/duckdb/vectors.js.map +1 -0
- package/dist/cjs/store/index.d.cts +7 -0
- package/dist/cjs/store/index.d.ts +7 -0
- package/dist/cjs/store/index.js +201 -0
- package/dist/cjs/store/index.js.map +1 -0
- package/dist/cjs/store/meta.d.cts +3 -0
- package/dist/cjs/store/meta.d.ts +3 -0
- package/dist/cjs/store/meta.js +215 -0
- package/dist/cjs/store/meta.js.map +1 -0
- package/dist/cjs/store/shared.d.cts +5 -0
- package/dist/cjs/store/shared.d.ts +5 -0
- package/dist/cjs/store/shared.js +252 -0
- package/dist/cjs/store/shared.js.map +1 -0
- package/dist/cjs/store/sql-functions.d.cts +2 -0
- package/dist/cjs/store/sql-functions.d.ts +2 -0
- package/dist/cjs/store/sql-functions.js +48 -0
- package/dist/cjs/store/sql-functions.js.map +1 -0
- package/dist/cjs/store/sqlite/connection.d.cts +3 -0
- package/dist/cjs/store/sqlite/connection.d.ts +3 -0
- package/dist/cjs/store/sqlite/connection.js +516 -0
- package/dist/cjs/store/sqlite/connection.js.map +1 -0
- package/dist/cjs/store/sqlite/lexical.d.cts +2 -0
- package/dist/cjs/store/sqlite/lexical.d.ts +2 -0
- package/dist/cjs/store/sqlite/lexical.js +177 -0
- package/dist/cjs/store/sqlite/lexical.js.map +1 -0
- package/dist/cjs/{db → store/sqlite}/open.d.cts +5 -5
- package/dist/cjs/{db → store/sqlite}/open.d.ts +5 -5
- package/dist/cjs/store/sqlite/open.js +604 -0
- package/dist/cjs/store/sqlite/open.js.map +1 -0
- package/dist/cjs/store/sqlite/reconcile.d.cts +10 -0
- package/dist/cjs/store/sqlite/reconcile.d.ts +10 -0
- package/dist/cjs/store/sqlite/reconcile.js +1020 -0
- package/dist/cjs/store/sqlite/reconcile.js.map +1 -0
- package/dist/cjs/store/sqlite/sql-functions.js +34 -0
- package/dist/cjs/store/sqlite/sql-functions.js.map +1 -0
- package/dist/cjs/store/sqlite/store.d.cts +5 -0
- package/dist/cjs/store/sqlite/store.d.ts +5 -0
- package/dist/cjs/store/sqlite/store.js +588 -0
- package/dist/cjs/store/sqlite/store.js.map +1 -0
- package/dist/cjs/store/sqlite/vectors.d.cts +13 -0
- package/dist/cjs/store/sqlite/vectors.d.ts +13 -0
- package/dist/cjs/store/sqlite/vectors.js +470 -0
- package/dist/cjs/store/sqlite/vectors.js.map +1 -0
- package/dist/cjs/store/transaction.d.cts +5 -0
- package/dist/cjs/store/transaction.d.ts +5 -0
- package/dist/cjs/store/transaction.js +297 -0
- package/dist/cjs/store/transaction.js.map +1 -0
- package/dist/cjs/store/types.d.cts +91 -0
- package/dist/cjs/store/types.d.ts +91 -0
- package/dist/cjs/store/types.js +15 -0
- package/dist/cjs/store/types.js.map +1 -0
- package/dist/cjs/watch.d.cts +3 -0
- package/dist/cjs/watch.d.ts +3 -0
- package/dist/cjs/watch.js +215 -73
- package/dist/cjs/watch.js.map +1 -1
- package/dist/esm/cli/map.js +4 -4
- package/dist/esm/cli/map.js.map +1 -1
- package/dist/esm/cli/named.js +2 -2
- package/dist/esm/cli/named.js.map +1 -1
- package/dist/esm/cli/path.js +4 -4
- package/dist/esm/cli/path.js.map +1 -1
- package/dist/esm/cli/peek.js +4 -4
- package/dist/esm/cli/peek.js.map +1 -1
- package/dist/esm/cli/related.js +2 -2
- package/dist/esm/cli/related.js.map +1 -1
- package/dist/esm/cli/search.js +1 -1
- package/dist/esm/cli/search.js.map +1 -1
- package/dist/esm/cli/shared.d.ts +3 -3
- package/dist/esm/cli/shared.js +17 -17
- package/dist/esm/cli/shared.js.map +1 -1
- package/dist/esm/cli/sql.js +2 -2
- package/dist/esm/cli/sql.js.map +1 -1
- package/dist/esm/cli/status.js +23 -22
- package/dist/esm/cli/status.js.map +1 -1
- package/dist/esm/commands/map.d.ts +2 -2
- package/dist/esm/commands/map.js +51 -41
- package/dist/esm/commands/map.js.map +1 -1
- package/dist/esm/commands/peek.d.ts +2 -2
- package/dist/esm/commands/peek.js +58 -50
- package/dist/esm/commands/peek.js.map +1 -1
- package/dist/esm/commands/related.d.ts +2 -2
- package/dist/esm/commands/related.js +9 -9
- package/dist/esm/commands/related.js.map +1 -1
- package/dist/esm/commands/scope.d.ts +7 -7
- package/dist/esm/commands/scope.js +28 -17
- package/dist/esm/commands/scope.js.map +1 -1
- package/dist/esm/commands/search.d.ts +2 -2
- package/dist/esm/commands/search.js +42 -35
- package/dist/esm/commands/search.js.map +1 -1
- package/dist/esm/commands/signals.d.ts +4 -10
- package/dist/esm/commands/signals.js +17 -13
- package/dist/esm/commands/signals.js.map +1 -1
- package/dist/esm/commands/status.d.ts +2 -2
- package/dist/esm/commands/status.js +13 -7
- package/dist/esm/commands/status.js.map +1 -1
- package/dist/esm/config/access.d.ts +1 -0
- package/dist/esm/config/access.js +5 -0
- package/dist/esm/config/access.js.map +1 -1
- package/dist/esm/config/index.d.ts +1 -1
- package/dist/esm/config/index.js +1 -1
- package/dist/esm/config/index.js.map +1 -1
- package/dist/esm/config/types.d.ts +1 -0
- package/dist/esm/config/types.js.map +1 -1
- package/dist/esm/config/validate.js +10 -1
- package/dist/esm/config/validate.js.map +1 -1
- package/dist/esm/embed/distribution.d.ts +3 -3
- package/dist/esm/embed/distribution.js +5 -5
- package/dist/esm/embed/distribution.js.map +1 -1
- package/dist/esm/embed/langfit.d.ts +2 -2
- package/dist/esm/embed/langfit.js +4 -4
- package/dist/esm/embed/langfit.js.map +1 -1
- package/dist/esm/embed/query.d.ts +6 -13
- package/dist/esm/embed/query.js +23 -84
- package/dist/esm/embed/query.js.map +1 -1
- package/dist/esm/embed/types.d.ts +1 -0
- package/dist/esm/embed/types.js +5 -3
- package/dist/esm/embed/types.js.map +1 -1
- package/dist/esm/errors.d.ts +1 -1
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/features/embed.js +22 -10
- package/dist/esm/features/embed.js.map +1 -1
- package/dist/esm/features/index.d.ts +1 -1
- package/dist/esm/features/index.js +1 -1
- package/dist/esm/features/index.js.map +1 -1
- package/dist/esm/features/links.d.ts +7 -2
- package/dist/esm/features/links.js +124 -97
- package/dist/esm/features/links.js.map +1 -1
- package/dist/esm/features/rank.js +15 -8
- package/dist/esm/features/rank.js.map +1 -1
- package/dist/esm/features/sections.js +20 -7
- package/dist/esm/features/sections.js.map +1 -1
- package/dist/esm/features/tags.js +19 -18
- package/dist/esm/features/tags.js.map +1 -1
- package/dist/esm/features/types.d.ts +9 -5
- package/dist/esm/features/types.js +1 -1
- package/dist/esm/features/types.js.map +1 -1
- package/dist/esm/graph/traverse.d.ts +2 -2
- package/dist/esm/graph/traverse.js +26 -23
- package/dist/esm/graph/traverse.js.map +1 -1
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/guarded-tick.d.ts +1 -0
- package/dist/esm/lib/guarded-tick.js +8 -0
- package/dist/esm/lib/guarded-tick.js.map +1 -0
- package/dist/esm/output/column-hint.d.ts +1 -2
- package/dist/esm/output/column-hint.js +3 -2
- package/dist/esm/output/column-hint.js.map +1 -1
- package/dist/esm/output/output.d.ts +2 -1
- package/dist/esm/output/output.js +27 -23
- package/dist/esm/output/output.js.map +1 -1
- package/dist/esm/scan/frontmatter.js +1 -1
- package/dist/esm/scan/frontmatter.js.map +1 -1
- package/dist/esm/scan/index.js +1 -1
- package/dist/esm/scan/index.js.map +1 -1
- package/dist/esm/scan/reparse.d.ts +10 -0
- package/dist/esm/scan/reparse.js +30 -0
- package/dist/esm/scan/reparse.js.map +1 -0
- package/dist/esm/store/duckdb/batch.d.ts +16 -0
- package/dist/esm/store/duckdb/batch.js +96 -0
- package/dist/esm/store/duckdb/batch.js.map +1 -0
- package/dist/esm/store/duckdb/connection.d.ts +5 -0
- package/dist/esm/store/duckdb/connection.js +97 -0
- package/dist/esm/store/duckdb/connection.js.map +1 -0
- package/dist/esm/store/duckdb/lexical.d.ts +10 -0
- package/dist/esm/store/duckdb/lexical.js +163 -0
- package/dist/esm/store/duckdb/lexical.js.map +1 -0
- package/dist/esm/store/duckdb/native.d.ts +3 -0
- package/dist/esm/store/duckdb/native.js +96 -0
- package/dist/esm/store/duckdb/native.js.map +1 -0
- package/dist/esm/store/duckdb/open.d.ts +12 -0
- package/dist/esm/store/duckdb/open.js +127 -0
- package/dist/esm/store/duckdb/open.js.map +1 -0
- package/dist/esm/store/duckdb/reconcile.d.ts +6 -0
- package/dist/esm/store/duckdb/reconcile.js +141 -0
- package/dist/esm/store/duckdb/reconcile.js.map +1 -0
- package/dist/esm/store/duckdb/sql-functions.d.ts +2 -0
- package/dist/esm/store/duckdb/sql-functions.js +56 -0
- package/dist/esm/store/duckdb/sql-functions.js.map +1 -0
- package/dist/esm/store/duckdb/store.d.ts +5 -0
- package/dist/esm/store/duckdb/store.js +104 -0
- package/dist/esm/store/duckdb/store.js.map +1 -0
- package/dist/esm/store/duckdb/vectors.d.ts +9 -0
- package/dist/esm/store/duckdb/vectors.js +171 -0
- package/dist/esm/store/duckdb/vectors.js.map +1 -0
- package/dist/esm/store/index.d.ts +7 -0
- package/dist/esm/store/index.js +35 -0
- package/dist/esm/store/index.js.map +1 -0
- package/dist/esm/store/meta.d.ts +3 -0
- package/dist/esm/store/meta.js +17 -0
- package/dist/esm/store/meta.js.map +1 -0
- package/dist/esm/store/shared.d.ts +5 -0
- package/dist/esm/store/shared.js +24 -0
- package/dist/esm/store/shared.js.map +1 -0
- package/dist/esm/store/sql-functions.d.ts +2 -0
- package/dist/esm/store/sql-functions.js +29 -0
- package/dist/esm/store/sql-functions.js.map +1 -0
- package/dist/esm/store/sqlite/connection.d.ts +3 -0
- package/dist/esm/store/sqlite/connection.js +50 -0
- package/dist/esm/store/sqlite/connection.js.map +1 -0
- package/dist/esm/store/sqlite/lexical.d.ts +2 -0
- package/dist/esm/store/sqlite/lexical.js +21 -0
- package/dist/esm/store/sqlite/lexical.js.map +1 -0
- package/dist/esm/{db → store/sqlite}/open.d.ts +5 -5
- package/dist/esm/store/sqlite/open.js +193 -0
- package/dist/esm/store/sqlite/open.js.map +1 -0
- package/dist/esm/store/sqlite/reconcile.d.ts +10 -0
- package/dist/esm/{db → store/sqlite}/reconcile.js +101 -99
- package/dist/esm/store/sqlite/reconcile.js.map +1 -0
- package/dist/esm/store/sqlite/sql-functions.js +23 -0
- package/dist/esm/store/sqlite/sql-functions.js.map +1 -0
- package/dist/esm/store/sqlite/store.d.ts +5 -0
- package/dist/esm/store/sqlite/store.js +82 -0
- package/dist/esm/store/sqlite/store.js.map +1 -0
- package/dist/esm/store/sqlite/vectors.d.ts +13 -0
- package/dist/esm/store/sqlite/vectors.js +90 -0
- package/dist/esm/store/sqlite/vectors.js.map +1 -0
- package/dist/esm/store/transaction.d.ts +5 -0
- package/dist/esm/store/transaction.js +57 -0
- package/dist/esm/store/transaction.js.map +1 -0
- package/dist/esm/store/types.d.ts +91 -0
- package/dist/esm/store/types.js +11 -0
- package/dist/esm/store/types.js.map +1 -0
- package/dist/esm/watch.d.ts +3 -0
- package/dist/esm/watch.js +39 -22
- package/dist/esm/watch.js.map +1 -1
- package/package.json +3 -1
- package/schema.json +5 -0
- package/skills/sense/EXAMPLES.md +3 -3
- package/skills/sense/SKILL.md +16 -14
- package/skills/sense-bases/EXAMPLES.md +2 -2
- package/skills/sense-bases/SKILL.md +6 -6
- package/skills/sense-setup/EXAMPLES.md +1 -1
- package/skills/sense-setup/SKILL.md +5 -4
- package/dist/cjs/db/index.d.cts +0 -4
- package/dist/cjs/db/index.d.ts +0 -4
- package/dist/cjs/db/index.js +0 -42
- package/dist/cjs/db/index.js.map +0 -1
- package/dist/cjs/db/open.js +0 -230
- package/dist/cjs/db/open.js.map +0 -1
- package/dist/cjs/db/reconcile.d.cts +0 -10
- package/dist/cjs/db/reconcile.d.ts +0 -10
- package/dist/cjs/db/reconcile.js +0 -579
- package/dist/cjs/db/reconcile.js.map +0 -1
- package/dist/cjs/db/shared.d.cts +0 -5
- package/dist/cjs/db/shared.d.ts +0 -5
- package/dist/cjs/db/shared.js +0 -45
- package/dist/cjs/db/shared.js.map +0 -1
- package/dist/cjs/db/sql-functions.js +0 -64
- package/dist/cjs/db/sql-functions.js.map +0 -1
- package/dist/esm/db/index.d.ts +0 -4
- package/dist/esm/db/index.js +0 -5
- package/dist/esm/db/index.js.map +0 -1
- package/dist/esm/db/open.js +0 -165
- package/dist/esm/db/open.js.map +0 -1
- package/dist/esm/db/reconcile.d.ts +0 -10
- package/dist/esm/db/reconcile.js.map +0 -1
- package/dist/esm/db/shared.d.ts +0 -5
- package/dist/esm/db/shared.js +0 -20
- package/dist/esm/db/shared.js.map +0 -1
- package/dist/esm/db/sql-functions.js +0 -47
- package/dist/esm/db/sql-functions.js.map +0 -1
- /package/dist/cjs/{db → store/sqlite}/sql-functions.d.cts +0 -0
- /package/dist/cjs/{db → store/sqlite}/sql-functions.d.ts +0 -0
- /package/dist/esm/{db → store/sqlite}/sql-functions.d.ts +0 -0
|
@@ -10,6 +10,131 @@ Object.defineProperty(exports, "sections", {
|
|
|
10
10
|
});
|
|
11
11
|
var _indexts = require("../chunk/index.js");
|
|
12
12
|
var _fencests = require("./fences.js");
|
|
13
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
14
|
+
try {
|
|
15
|
+
var info = gen[key](arg);
|
|
16
|
+
var value = info.value;
|
|
17
|
+
} catch (error) {
|
|
18
|
+
reject(error);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (info.done) resolve(value);
|
|
22
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
23
|
+
}
|
|
24
|
+
function _async_to_generator(fn) {
|
|
25
|
+
return function() {
|
|
26
|
+
var self = this, args = arguments;
|
|
27
|
+
return new Promise(function(resolve, reject) {
|
|
28
|
+
var gen = fn.apply(self, args);
|
|
29
|
+
function _next(value) {
|
|
30
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
31
|
+
}
|
|
32
|
+
function _throw(err) {
|
|
33
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
34
|
+
}
|
|
35
|
+
_next(undefined);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function _ts_generator(thisArg, body) {
|
|
40
|
+
var f, y, t, _ = {
|
|
41
|
+
label: 0,
|
|
42
|
+
sent: function() {
|
|
43
|
+
if (t[0] & 1) throw t[1];
|
|
44
|
+
return t[1];
|
|
45
|
+
},
|
|
46
|
+
trys: [],
|
|
47
|
+
ops: []
|
|
48
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
49
|
+
return d(g, "next", {
|
|
50
|
+
value: verb(0)
|
|
51
|
+
}), d(g, "throw", {
|
|
52
|
+
value: verb(1)
|
|
53
|
+
}), d(g, "return", {
|
|
54
|
+
value: verb(2)
|
|
55
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
56
|
+
value: function() {
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
}), g;
|
|
60
|
+
function verb(n) {
|
|
61
|
+
return function(v) {
|
|
62
|
+
return step([
|
|
63
|
+
n,
|
|
64
|
+
v
|
|
65
|
+
]);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function step(op) {
|
|
69
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
70
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
71
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
72
|
+
if (y = 0, t) op = [
|
|
73
|
+
op[0] & 2,
|
|
74
|
+
t.value
|
|
75
|
+
];
|
|
76
|
+
switch(op[0]){
|
|
77
|
+
case 0:
|
|
78
|
+
case 1:
|
|
79
|
+
t = op;
|
|
80
|
+
break;
|
|
81
|
+
case 4:
|
|
82
|
+
_.label++;
|
|
83
|
+
return {
|
|
84
|
+
value: op[1],
|
|
85
|
+
done: false
|
|
86
|
+
};
|
|
87
|
+
case 5:
|
|
88
|
+
_.label++;
|
|
89
|
+
y = op[1];
|
|
90
|
+
op = [
|
|
91
|
+
0
|
|
92
|
+
];
|
|
93
|
+
continue;
|
|
94
|
+
case 7:
|
|
95
|
+
op = _.ops.pop();
|
|
96
|
+
_.trys.pop();
|
|
97
|
+
continue;
|
|
98
|
+
default:
|
|
99
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
100
|
+
_ = 0;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
104
|
+
_.label = op[1];
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
108
|
+
_.label = t[1];
|
|
109
|
+
t = op;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
if (t && _.label < t[2]) {
|
|
113
|
+
_.label = t[2];
|
|
114
|
+
_.ops.push(op);
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
if (t[2]) _.ops.pop();
|
|
118
|
+
_.trys.pop();
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
op = body.call(thisArg, _);
|
|
122
|
+
} catch (e) {
|
|
123
|
+
op = [
|
|
124
|
+
6,
|
|
125
|
+
e
|
|
126
|
+
];
|
|
127
|
+
y = 0;
|
|
128
|
+
} finally{
|
|
129
|
+
f = t = 0;
|
|
130
|
+
}
|
|
131
|
+
if (op[0] & 5) throw op[1];
|
|
132
|
+
return {
|
|
133
|
+
value: op[0] ? op[1] : void 0,
|
|
134
|
+
done: true
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
13
138
|
// Headings outside fenced code blocks.
|
|
14
139
|
function extract(raw) {
|
|
15
140
|
var lines = raw.split('\n');
|
|
@@ -37,17 +162,102 @@ function extract(raw) {
|
|
|
37
162
|
var sections = {
|
|
38
163
|
name: 'sections',
|
|
39
164
|
schema: function schema(db) {
|
|
40
|
-
|
|
165
|
+
return _async_to_generator(function() {
|
|
166
|
+
return _ts_generator(this, function(_state) {
|
|
167
|
+
switch(_state.label){
|
|
168
|
+
case 0:
|
|
169
|
+
return [
|
|
170
|
+
4,
|
|
171
|
+
db.exec('CREATE TABLE IF NOT EXISTS sections ("path" TEXT, idx INTEGER, level INTEGER, heading TEXT, start_line INTEGER, end_line INTEGER, tokens INTEGER, PRIMARY KEY ("path", idx))')
|
|
172
|
+
];
|
|
173
|
+
case 1:
|
|
174
|
+
_state.sent();
|
|
175
|
+
return [
|
|
176
|
+
2
|
|
177
|
+
];
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
})();
|
|
41
181
|
},
|
|
42
182
|
extract: extract,
|
|
43
|
-
remove: function remove(db,
|
|
44
|
-
|
|
183
|
+
remove: function remove(db, paths) {
|
|
184
|
+
return _async_to_generator(function() {
|
|
185
|
+
return _ts_generator(this, function(_state) {
|
|
186
|
+
switch(_state.label){
|
|
187
|
+
case 0:
|
|
188
|
+
if (paths.length === 0) return [
|
|
189
|
+
2
|
|
190
|
+
];
|
|
191
|
+
return [
|
|
192
|
+
4,
|
|
193
|
+
db.runBatch('DELETE FROM sections WHERE "path" = ?', paths.map(function(p) {
|
|
194
|
+
return [
|
|
195
|
+
p
|
|
196
|
+
];
|
|
197
|
+
}))
|
|
198
|
+
];
|
|
199
|
+
case 1:
|
|
200
|
+
_state.sent();
|
|
201
|
+
return [
|
|
202
|
+
2
|
|
203
|
+
];
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
})();
|
|
45
207
|
},
|
|
46
|
-
store: function store(db,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return
|
|
50
|
-
|
|
208
|
+
store: function store(db, docs) {
|
|
209
|
+
return _async_to_generator(function() {
|
|
210
|
+
var rows, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _loop, _iterator, _step;
|
|
211
|
+
return _ts_generator(this, function(_state) {
|
|
212
|
+
switch(_state.label){
|
|
213
|
+
case 0:
|
|
214
|
+
rows = [];
|
|
215
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
216
|
+
try {
|
|
217
|
+
_loop = function() {
|
|
218
|
+
var _step_value = _step.value, path = _step_value.path, extracted = _step_value.extracted;
|
|
219
|
+
extracted.forEach(function(s, idx) {
|
|
220
|
+
return rows.push([
|
|
221
|
+
path,
|
|
222
|
+
idx,
|
|
223
|
+
s.level,
|
|
224
|
+
s.heading,
|
|
225
|
+
s.startLine,
|
|
226
|
+
s.endLine,
|
|
227
|
+
s.tokens
|
|
228
|
+
]);
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
for(_iterator = docs[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
232
|
+
} catch (err) {
|
|
233
|
+
_didIteratorError = true;
|
|
234
|
+
_iteratorError = err;
|
|
235
|
+
} finally{
|
|
236
|
+
try {
|
|
237
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
238
|
+
_iterator.return();
|
|
239
|
+
}
|
|
240
|
+
} finally{
|
|
241
|
+
if (_didIteratorError) {
|
|
242
|
+
throw _iteratorError;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (rows.length === 0) return [
|
|
247
|
+
2
|
|
248
|
+
];
|
|
249
|
+
return [
|
|
250
|
+
4,
|
|
251
|
+
db.runBatch('INSERT INTO sections ("path", idx, level, heading, start_line, end_line, tokens) VALUES (?, ?, ?, ?, ?, ?, ?)', rows)
|
|
252
|
+
];
|
|
253
|
+
case 1:
|
|
254
|
+
_state.sent();
|
|
255
|
+
return [
|
|
256
|
+
2
|
|
257
|
+
];
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
})();
|
|
51
261
|
}
|
|
52
262
|
};
|
|
53
263
|
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/features/sections.ts"],"sourcesContent":["import { estimateTokens } from '../chunk/index.ts';\nimport { fenceTracker } from './fences.ts';\nimport type { Feature } from './types.ts';\n\n// sections(path, idx, level, heading, start_line, end_line, tokens): the heading outline,\n// 1-indexed over the raw file so a row is a direct Read range; tokens is estimateTokens (D5),\n// CJK-aware rather than a flat chars/4.\n\nexport interface Section {\n level: number;\n heading: string;\n startLine: number;\n endLine: number;\n tokens: number;\n}\n\n// Headings outside fenced code blocks.\nfunction extract(raw: string): Section[] {\n const lines = raw.split('\\n');\n const found: Section[] = [];\n const fence = fenceTracker();\n for (let i = 0; i < lines.length; i++) {\n if (fence.feed(lines[i])) continue;\n if (fence.inFence) continue;\n const m = lines[i].match(/^(#{1,6}) +(.*)/);\n if (m) found.push({ level: m[1].length, heading: m[2].trim(), startLine: i + 1, endLine: lines.length, tokens: 0 });\n }\n for (let s = 0; s < found.length; s++) {\n if (s + 1 < found.length) found[s].endLine = found[s + 1].startLine - 1;\n const text = lines.slice(found[s].startLine - 1, found[s].endLine).join('\\n');\n found[s].tokens = Math.ceil(estimateTokens(text));\n }\n return found;\n}\n\nexport const sections: Feature = {\n name: 'sections',\n schema(db) {\n db.exec(`CREATE TABLE IF NOT EXISTS sections (\"path\" TEXT, idx INTEGER, level INTEGER, heading TEXT, start_line INTEGER, end_line INTEGER, tokens INTEGER, PRIMARY KEY (\"path\", idx))`);\n },\n extract,\n remove(db,
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/features/sections.ts"],"sourcesContent":["import { estimateTokens } from '../chunk/index.ts';\nimport { fenceTracker } from './fences.ts';\nimport type { Feature } from './types.ts';\n\n// sections(path, idx, level, heading, start_line, end_line, tokens): the heading outline,\n// 1-indexed over the raw file so a row is a direct Read range; tokens is estimateTokens (D5),\n// CJK-aware rather than a flat chars/4.\n\nexport interface Section {\n level: number;\n heading: string;\n startLine: number;\n endLine: number;\n tokens: number;\n}\n\n// Headings outside fenced code blocks.\nfunction extract(raw: string): Section[] {\n const lines = raw.split('\\n');\n const found: Section[] = [];\n const fence = fenceTracker();\n for (let i = 0; i < lines.length; i++) {\n if (fence.feed(lines[i])) continue;\n if (fence.inFence) continue;\n const m = lines[i].match(/^(#{1,6}) +(.*)/);\n if (m) found.push({ level: m[1].length, heading: m[2].trim(), startLine: i + 1, endLine: lines.length, tokens: 0 });\n }\n for (let s = 0; s < found.length; s++) {\n if (s + 1 < found.length) found[s].endLine = found[s + 1].startLine - 1;\n const text = lines.slice(found[s].startLine - 1, found[s].endLine).join('\\n');\n found[s].tokens = Math.ceil(estimateTokens(text));\n }\n return found;\n}\n\nexport const sections: Feature = {\n name: 'sections',\n async schema(db) {\n await db.exec(`CREATE TABLE IF NOT EXISTS sections (\"path\" TEXT, idx INTEGER, level INTEGER, heading TEXT, start_line INTEGER, end_line INTEGER, tokens INTEGER, PRIMARY KEY (\"path\", idx))`);\n },\n extract,\n async remove(db, paths) {\n if (paths.length === 0) return;\n await db.runBatch(\n 'DELETE FROM sections WHERE \"path\" = ?',\n paths.map((p) => [p])\n );\n },\n async store(db, docs) {\n const rows: unknown[][] = [];\n for (const { path, extracted } of docs) (extracted as Section[]).forEach((s, idx) => rows.push([path, idx, s.level, s.heading, s.startLine, s.endLine, s.tokens]));\n if (rows.length === 0) return;\n await db.runBatch('INSERT INTO sections (\"path\", idx, level, heading, start_line, end_line, tokens) VALUES (?, ?, ?, ?, ?, ?, ?)', rows);\n },\n};\n"],"names":["sections","extract","raw","lines","split","found","fence","fenceTracker","i","length","feed","inFence","m","match","push","level","heading","trim","startLine","endLine","tokens","s","text","slice","join","Math","ceil","estimateTokens","name","schema","db","exec","remove","paths","runBatch","map","p","store","docs","rows","path","extracted","forEach","idx"],"mappings":";;;;+BAmCaA;;;eAAAA;;;uBAnCkB;wBACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAe7B,uCAAuC;AACvC,SAASC,QAAQC,GAAW;IAC1B,IAAMC,QAAQD,IAAIE,KAAK,CAAC;IACxB,IAAMC,QAAmB,EAAE;IAC3B,IAAMC,QAAQC,IAAAA,sBAAY;IAC1B,IAAK,IAAIC,IAAI,GAAGA,IAAIL,MAAMM,MAAM,EAAED,IAAK;QACrC,IAAIF,MAAMI,IAAI,CAACP,KAAK,CAACK,EAAE,GAAG;QAC1B,IAAIF,MAAMK,OAAO,EAAE;QACnB,IAAMC,IAAIT,KAAK,CAACK,EAAE,CAACK,KAAK,CAAC;QACzB,IAAID,GAAGP,MAAMS,IAAI,CAAC;YAAEC,OAAOH,CAAC,CAAC,EAAE,CAACH,MAAM;YAAEO,SAASJ,CAAC,CAAC,EAAE,CAACK,IAAI;YAAIC,WAAWV,IAAI;YAAGW,SAAShB,MAAMM,MAAM;YAAEW,QAAQ;QAAE;IACnH;IACA,IAAK,IAAIC,IAAI,GAAGA,IAAIhB,MAAMI,MAAM,EAAEY,IAAK;QACrC,IAAIA,IAAI,IAAIhB,MAAMI,MAAM,EAAEJ,KAAK,CAACgB,EAAE,CAACF,OAAO,GAAGd,KAAK,CAACgB,IAAI,EAAE,CAACH,SAAS,GAAG;QACtE,IAAMI,OAAOnB,MAAMoB,KAAK,CAAClB,KAAK,CAACgB,EAAE,CAACH,SAAS,GAAG,GAAGb,KAAK,CAACgB,EAAE,CAACF,OAAO,EAAEK,IAAI,CAAC;QACxEnB,KAAK,CAACgB,EAAE,CAACD,MAAM,GAAGK,KAAKC,IAAI,CAACC,IAAAA,uBAAc,EAACL;IAC7C;IACA,OAAOjB;AACT;AAEO,IAAML,WAAoB;IAC/B4B,MAAM;IACAC,QAAN,SAAMA,OAAOC,EAAE;;;;;wBACb;;4BAAMA,GAAGC,IAAI,CAAC;;;wBAAd;;;;;;QACF;;IACA9B,SAAAA;IACM+B,QAAN,SAAMA,OAAOF,EAAE,EAAEG,KAAK;;;;;wBACpB,IAAIA,MAAMxB,MAAM,KAAK,GAAG;;;wBACxB;;4BAAMqB,GAAGI,QAAQ,CACf,yCACAD,MAAME,GAAG,CAAC,SAACC;uCAAM;oCAACA;iCAAE;;;;wBAFtB;;;;;;QAIF;;IACMC,OAAN,SAAMA,MAAMP,EAAE,EAAEQ,IAAI;;gBACZC,MACD,2BAAA,mBAAA,uBAAA,WAAA;;;;wBADCA;wBACD,kCAAA,2BAAA;;;gCAAA,kBAAA,aAAQC,mBAAAA,MAAMC,wBAAAA;gCAAsBA,UAAwBC,OAAO,CAAC,SAACrB,GAAGsB;2CAAQJ,KAAKzB,IAAI,CAAC;wCAAC0B;wCAAMG;wCAAKtB,EAAEN,KAAK;wCAAEM,EAAEL,OAAO;wCAAEK,EAAEH,SAAS;wCAAEG,EAAEF,OAAO;wCAAEE,EAAED,MAAM;qCAAC;;;4BAAhK,IAAK,YAA6BkB,2BAA7B,6BAAA,QAAA,yBAAA;;4BAAA;4BAAA;;;qCAAA,6BAAA;oCAAA;;;oCAAA;0CAAA;;;;wBACL,IAAIC,KAAK9B,MAAM,KAAK,GAAG;;;wBACvB;;4BAAMqB,GAAGI,QAAQ,CAAC,iHAAiHK;;;wBAAnI;;;;;;QACF;;AACF"}
|
|
@@ -17,6 +17,32 @@ function _array_like_to_array(arr, len) {
|
|
|
17
17
|
function _array_without_holes(arr) {
|
|
18
18
|
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
19
19
|
}
|
|
20
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
21
|
+
try {
|
|
22
|
+
var info = gen[key](arg);
|
|
23
|
+
var value = info.value;
|
|
24
|
+
} catch (error) {
|
|
25
|
+
reject(error);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (info.done) resolve(value);
|
|
29
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
30
|
+
}
|
|
31
|
+
function _async_to_generator(fn) {
|
|
32
|
+
return function() {
|
|
33
|
+
var self = this, args = arguments;
|
|
34
|
+
return new Promise(function(resolve, reject) {
|
|
35
|
+
var gen = fn.apply(self, args);
|
|
36
|
+
function _next(value) {
|
|
37
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
38
|
+
}
|
|
39
|
+
function _throw(err) {
|
|
40
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
41
|
+
}
|
|
42
|
+
_next(undefined);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
}
|
|
20
46
|
function _iterable_to_array(iter) {
|
|
21
47
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
|
|
22
48
|
return Array.from(iter);
|
|
@@ -28,6 +54,105 @@ function _non_iterable_spread() {
|
|
|
28
54
|
function _to_consumable_array(arr) {
|
|
29
55
|
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
30
56
|
}
|
|
57
|
+
function _ts_generator(thisArg, body) {
|
|
58
|
+
var f, y, t, _ = {
|
|
59
|
+
label: 0,
|
|
60
|
+
sent: function() {
|
|
61
|
+
if (t[0] & 1) throw t[1];
|
|
62
|
+
return t[1];
|
|
63
|
+
},
|
|
64
|
+
trys: [],
|
|
65
|
+
ops: []
|
|
66
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
67
|
+
return d(g, "next", {
|
|
68
|
+
value: verb(0)
|
|
69
|
+
}), d(g, "throw", {
|
|
70
|
+
value: verb(1)
|
|
71
|
+
}), d(g, "return", {
|
|
72
|
+
value: verb(2)
|
|
73
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
74
|
+
value: function() {
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
}), g;
|
|
78
|
+
function verb(n) {
|
|
79
|
+
return function(v) {
|
|
80
|
+
return step([
|
|
81
|
+
n,
|
|
82
|
+
v
|
|
83
|
+
]);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function step(op) {
|
|
87
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
88
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
89
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
90
|
+
if (y = 0, t) op = [
|
|
91
|
+
op[0] & 2,
|
|
92
|
+
t.value
|
|
93
|
+
];
|
|
94
|
+
switch(op[0]){
|
|
95
|
+
case 0:
|
|
96
|
+
case 1:
|
|
97
|
+
t = op;
|
|
98
|
+
break;
|
|
99
|
+
case 4:
|
|
100
|
+
_.label++;
|
|
101
|
+
return {
|
|
102
|
+
value: op[1],
|
|
103
|
+
done: false
|
|
104
|
+
};
|
|
105
|
+
case 5:
|
|
106
|
+
_.label++;
|
|
107
|
+
y = op[1];
|
|
108
|
+
op = [
|
|
109
|
+
0
|
|
110
|
+
];
|
|
111
|
+
continue;
|
|
112
|
+
case 7:
|
|
113
|
+
op = _.ops.pop();
|
|
114
|
+
_.trys.pop();
|
|
115
|
+
continue;
|
|
116
|
+
default:
|
|
117
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
118
|
+
_ = 0;
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
122
|
+
_.label = op[1];
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
126
|
+
_.label = t[1];
|
|
127
|
+
t = op;
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
if (t && _.label < t[2]) {
|
|
131
|
+
_.label = t[2];
|
|
132
|
+
_.ops.push(op);
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
if (t[2]) _.ops.pop();
|
|
136
|
+
_.trys.pop();
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
op = body.call(thisArg, _);
|
|
140
|
+
} catch (e) {
|
|
141
|
+
op = [
|
|
142
|
+
6,
|
|
143
|
+
e
|
|
144
|
+
];
|
|
145
|
+
y = 0;
|
|
146
|
+
} finally{
|
|
147
|
+
f = t = 0;
|
|
148
|
+
}
|
|
149
|
+
if (op[0] & 5) throw op[1];
|
|
150
|
+
return {
|
|
151
|
+
value: op[0] ? op[1] : void 0,
|
|
152
|
+
done: true
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
31
156
|
function _unsupported_iterable_to_array(o, minLen) {
|
|
32
157
|
if (!o) return;
|
|
33
158
|
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
@@ -150,50 +275,121 @@ function extract(_raw, body, _search, data) {
|
|
|
150
275
|
var tags = {
|
|
151
276
|
name: 'tags',
|
|
152
277
|
schema: function schema(db) {
|
|
153
|
-
|
|
154
|
-
|
|
278
|
+
return _async_to_generator(function() {
|
|
279
|
+
return _ts_generator(this, function(_state) {
|
|
280
|
+
switch(_state.label){
|
|
281
|
+
case 0:
|
|
282
|
+
return [
|
|
283
|
+
4,
|
|
284
|
+
db.exec('CREATE TABLE IF NOT EXISTS tags ("path" TEXT, tag TEXT, PRIMARY KEY ("path", tag))')
|
|
285
|
+
];
|
|
286
|
+
case 1:
|
|
287
|
+
_state.sent();
|
|
288
|
+
return [
|
|
289
|
+
4,
|
|
290
|
+
db.exec('CREATE INDEX IF NOT EXISTS tags_tag ON tags(tag)')
|
|
291
|
+
];
|
|
292
|
+
case 2:
|
|
293
|
+
_state.sent();
|
|
294
|
+
return [
|
|
295
|
+
2
|
|
296
|
+
];
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
})();
|
|
155
300
|
},
|
|
156
301
|
extract: extract,
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
insert.run(path, tag);
|
|
182
|
-
}
|
|
183
|
-
} catch (err) {
|
|
184
|
-
_didIteratorError = true;
|
|
185
|
-
_iteratorError = err;
|
|
186
|
-
} finally{
|
|
187
|
-
try {
|
|
188
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
189
|
-
_iterator.return();
|
|
302
|
+
remove: // Blanket clear-then-reinsert (store() below always writes the full found list back), so
|
|
303
|
+
// remove() covers both a vanished file and a reparsed one that already had rows -- no
|
|
304
|
+
// per-file NOT IN diffing, which cannot be expressed as one statement shared across files.
|
|
305
|
+
function remove(db, paths) {
|
|
306
|
+
return _async_to_generator(function() {
|
|
307
|
+
return _ts_generator(this, function(_state) {
|
|
308
|
+
switch(_state.label){
|
|
309
|
+
case 0:
|
|
310
|
+
if (paths.length === 0) return [
|
|
311
|
+
2
|
|
312
|
+
];
|
|
313
|
+
return [
|
|
314
|
+
4,
|
|
315
|
+
db.runBatch('DELETE FROM tags WHERE "path" = ?', paths.map(function(p) {
|
|
316
|
+
return [
|
|
317
|
+
p
|
|
318
|
+
];
|
|
319
|
+
}))
|
|
320
|
+
];
|
|
321
|
+
case 1:
|
|
322
|
+
_state.sent();
|
|
323
|
+
return [
|
|
324
|
+
2
|
|
325
|
+
];
|
|
190
326
|
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
327
|
+
});
|
|
328
|
+
})();
|
|
329
|
+
},
|
|
330
|
+
store: function store(db, docs) {
|
|
331
|
+
return _async_to_generator(function() {
|
|
332
|
+
var rows, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator, _step, _step_value, path, extracted, _iterator1, _step1, tag;
|
|
333
|
+
return _ts_generator(this, function(_state) {
|
|
334
|
+
switch(_state.label){
|
|
335
|
+
case 0:
|
|
336
|
+
rows = [];
|
|
337
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined, _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
338
|
+
try {
|
|
339
|
+
for(_iterator = docs[Symbol.iterator](); !(_iteratorNormalCompletion1 = (_step = _iterator.next()).done); _iteratorNormalCompletion1 = true){
|
|
340
|
+
_step_value = _step.value, path = _step_value.path, extracted = _step_value.extracted;
|
|
341
|
+
try {
|
|
342
|
+
for(_iterator1 = extracted[Symbol.iterator](); !(_iteratorNormalCompletion = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion = true){
|
|
343
|
+
tag = _step1.value;
|
|
344
|
+
rows.push([
|
|
345
|
+
path,
|
|
346
|
+
tag
|
|
347
|
+
]);
|
|
348
|
+
}
|
|
349
|
+
} catch (err) {
|
|
350
|
+
_didIteratorError = true;
|
|
351
|
+
_iteratorError = err;
|
|
352
|
+
} finally{
|
|
353
|
+
try {
|
|
354
|
+
if (!_iteratorNormalCompletion && _iterator1.return != null) {
|
|
355
|
+
_iterator1.return();
|
|
356
|
+
}
|
|
357
|
+
} finally{
|
|
358
|
+
if (_didIteratorError) {
|
|
359
|
+
throw _iteratorError;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
} catch (err) {
|
|
365
|
+
_didIteratorError1 = true;
|
|
366
|
+
_iteratorError1 = err;
|
|
367
|
+
} finally{
|
|
368
|
+
try {
|
|
369
|
+
if (!_iteratorNormalCompletion1 && _iterator.return != null) {
|
|
370
|
+
_iterator.return();
|
|
371
|
+
}
|
|
372
|
+
} finally{
|
|
373
|
+
if (_didIteratorError1) {
|
|
374
|
+
throw _iteratorError1;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if (rows.length === 0) return [
|
|
379
|
+
2
|
|
380
|
+
];
|
|
381
|
+
return [
|
|
382
|
+
4,
|
|
383
|
+
db.runBatch('INSERT OR IGNORE INTO tags ("path", tag) VALUES (?, ?)', rows)
|
|
384
|
+
];
|
|
385
|
+
case 1:
|
|
386
|
+
_state.sent();
|
|
387
|
+
return [
|
|
388
|
+
2
|
|
389
|
+
];
|
|
194
390
|
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
391
|
+
});
|
|
392
|
+
})();
|
|
197
393
|
}
|
|
198
394
|
};
|
|
199
395
|
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/features/tags.ts"],"sourcesContent":["import { maskRegions } from './fences.ts';\nimport type { Feature } from './types.ts';\n\n// tags(path, tag): Obsidian's file.tags grain -- frontmatter list/string tags plus inline\n// #tags from the prose, deduplicated, source not distinguished. Nested tags store full\n// (book/scifi); `tag = 'book' OR tag LIKE 'book/%'` is how a caller matches the parent too.\n\n// Obsidian treats [[#Heading]] as a same-note link, not a tag.\nconst WIKILINK_RE = /\\[\\[.*?\\]\\]/g; // to the first ]], so a heading holding a lone ] still masks\n// Obsidian doesn't read tags inside HTML markup.\nconst HTML_TAG_RE = /<\\/?[a-zA-Z][^>]*>/g; // tag-shaped only: a comparison's `< 5` must not open a span\n// Anchors on start-of-line or a preceding whitespace/(/[ so `a#b` and URL fragments don't count.\nconst INLINE_TAG_RE = /(?:^|[\\s([])#([\\p{L}\\p{N}_/-]+)/gu;\n// A markdown link destination `](...)` -- `[text](#anchor)` is a same-page link, not a tag.\nconst LINK_DEST_RE = /\\]\\((?:[^()]|\\([^()]*\\))*\\)/g; // one paren-nesting level, as CommonMark destinations allow: (https://x/a_(b)#frag)\n\n// Strips a leading # (frontmatter entries may carry one) and a trailing /; rejects an\n// all-digit result -- a tag needs at least one non-digit character.\nfunction normalizeTag(raw: string): string | null {\n const stripped = raw.replace(/^#/, '').replace(/\\/+$/, '');\n if (!stripped || /^\\d+$/.test(stripped)) return null;\n return stripped;\n}\n\n// data.tags: a YAML list (Obsidian also accepts a bare string). Null members and non-string\n// members are skipped rather than throwing -- `tags:\\n -` parses to [null].\nfunction frontmatterTags(data?: Record<string, unknown>): string[] {\n const raw = data?.tags;\n const list = Array.isArray(raw) ? raw : typeof raw === 'string' ? [raw] : [];\n const found: string[] = [];\n for (const item of list) {\n if (typeof item !== 'string') continue;\n const tag = normalizeTag(item);\n if (tag) found.push(tag);\n }\n return found;\n}\n\n// #tag tokens outside fenced code blocks, inline code spans, wikilinks, HTML tags, HTML blocks,\n// <!-- --> comments, and link destinations. maskRegions() handles all of those region-level\n// concerns (and code spans, masked once there); this loop only does per-line tag extraction.\nfunction inlineTags(body: string): string[] {\n const found: string[] = [];\n for (const line of maskRegions(body).split('\\n')) {\n if (!line.includes('#')) continue; // most lines; skip the regex work\n let cleaned = line;\n if (cleaned.includes('[[')) cleaned = cleaned.replace(WIKILINK_RE, (m) => ' '.repeat(m.length));\n if (cleaned.includes('](')) cleaned = cleaned.replace(LINK_DEST_RE, (m) => ' '.repeat(m.length));\n if (cleaned.includes('<')) cleaned = cleaned.replace(HTML_TAG_RE, (m) => ' '.repeat(m.length));\n for (const m of cleaned.matchAll(INLINE_TAG_RE)) {\n const tag = normalizeTag(m[1]);\n if (tag) found.push(tag);\n }\n }\n return found;\n}\n\nfunction extract(_raw: string, body: string, _search?: { title: string; summary: string }, data?: Record<string, unknown>): string[] {\n return [...new Set([...frontmatterTags(data), ...inlineTags(body)])].sort();\n}\n\nexport const tags: Feature = {\n name: 'tags',\n schema(db) {\n db.exec('CREATE TABLE IF NOT EXISTS tags (\"path\" TEXT, tag TEXT, PRIMARY KEY (\"path\", tag))');\n db.exec('CREATE INDEX IF NOT EXISTS tags_tag ON tags(tag)');\n },\n extract,\n //
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/features/tags.ts"],"sourcesContent":["import { maskRegions } from './fences.ts';\nimport type { Feature } from './types.ts';\n\n// tags(path, tag): Obsidian's file.tags grain -- frontmatter list/string tags plus inline\n// #tags from the prose, deduplicated, source not distinguished. Nested tags store full\n// (book/scifi); `tag = 'book' OR tag LIKE 'book/%'` is how a caller matches the parent too.\n\n// Obsidian treats [[#Heading]] as a same-note link, not a tag.\nconst WIKILINK_RE = /\\[\\[.*?\\]\\]/g; // to the first ]], so a heading holding a lone ] still masks\n// Obsidian doesn't read tags inside HTML markup.\nconst HTML_TAG_RE = /<\\/?[a-zA-Z][^>]*>/g; // tag-shaped only: a comparison's `< 5` must not open a span\n// Anchors on start-of-line or a preceding whitespace/(/[ so `a#b` and URL fragments don't count.\nconst INLINE_TAG_RE = /(?:^|[\\s([])#([\\p{L}\\p{N}_/-]+)/gu;\n// A markdown link destination `](...)` -- `[text](#anchor)` is a same-page link, not a tag.\nconst LINK_DEST_RE = /\\]\\((?:[^()]|\\([^()]*\\))*\\)/g; // one paren-nesting level, as CommonMark destinations allow: (https://x/a_(b)#frag)\n\n// Strips a leading # (frontmatter entries may carry one) and a trailing /; rejects an\n// all-digit result -- a tag needs at least one non-digit character.\nfunction normalizeTag(raw: string): string | null {\n const stripped = raw.replace(/^#/, '').replace(/\\/+$/, '');\n if (!stripped || /^\\d+$/.test(stripped)) return null;\n return stripped;\n}\n\n// data.tags: a YAML list (Obsidian also accepts a bare string). Null members and non-string\n// members are skipped rather than throwing -- `tags:\\n -` parses to [null].\nfunction frontmatterTags(data?: Record<string, unknown>): string[] {\n const raw = data?.tags;\n const list = Array.isArray(raw) ? raw : typeof raw === 'string' ? [raw] : [];\n const found: string[] = [];\n for (const item of list) {\n if (typeof item !== 'string') continue;\n const tag = normalizeTag(item);\n if (tag) found.push(tag);\n }\n return found;\n}\n\n// #tag tokens outside fenced code blocks, inline code spans, wikilinks, HTML tags, HTML blocks,\n// <!-- --> comments, and link destinations. maskRegions() handles all of those region-level\n// concerns (and code spans, masked once there); this loop only does per-line tag extraction.\nfunction inlineTags(body: string): string[] {\n const found: string[] = [];\n for (const line of maskRegions(body).split('\\n')) {\n if (!line.includes('#')) continue; // most lines; skip the regex work\n let cleaned = line;\n if (cleaned.includes('[[')) cleaned = cleaned.replace(WIKILINK_RE, (m) => ' '.repeat(m.length));\n if (cleaned.includes('](')) cleaned = cleaned.replace(LINK_DEST_RE, (m) => ' '.repeat(m.length));\n if (cleaned.includes('<')) cleaned = cleaned.replace(HTML_TAG_RE, (m) => ' '.repeat(m.length));\n for (const m of cleaned.matchAll(INLINE_TAG_RE)) {\n const tag = normalizeTag(m[1]);\n if (tag) found.push(tag);\n }\n }\n return found;\n}\n\nfunction extract(_raw: string, body: string, _search?: { title: string; summary: string }, data?: Record<string, unknown>): string[] {\n return [...new Set([...frontmatterTags(data), ...inlineTags(body)])].sort();\n}\n\nexport const tags: Feature = {\n name: 'tags',\n async schema(db) {\n await db.exec('CREATE TABLE IF NOT EXISTS tags (\"path\" TEXT, tag TEXT, PRIMARY KEY (\"path\", tag))');\n await db.exec('CREATE INDEX IF NOT EXISTS tags_tag ON tags(tag)');\n },\n extract,\n // Blanket clear-then-reinsert (store() below always writes the full found list back), so\n // remove() covers both a vanished file and a reparsed one that already had rows -- no\n // per-file NOT IN diffing, which cannot be expressed as one statement shared across files.\n async remove(db, paths) {\n if (paths.length === 0) return;\n await db.runBatch(\n 'DELETE FROM tags WHERE \"path\" = ?',\n paths.map((p) => [p])\n );\n },\n async store(db, docs) {\n const rows: unknown[][] = [];\n for (const { path, extracted } of docs) for (const tag of extracted as string[]) rows.push([path, tag]);\n if (rows.length === 0) return;\n await db.runBatch('INSERT OR IGNORE INTO tags (\"path\", tag) VALUES (?, ?)', rows);\n },\n};\n"],"names":["tags","WIKILINK_RE","HTML_TAG_RE","INLINE_TAG_RE","LINK_DEST_RE","normalizeTag","raw","stripped","replace","test","frontmatterTags","data","list","Array","isArray","found","item","tag","push","inlineTags","body","maskRegions","split","line","includes","cleaned","m","repeat","length","matchAll","extract","_raw","_search","Set","sort","name","schema","db","exec","remove","paths","runBatch","map","p","store","docs","rows","path","extracted"],"mappings":"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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { DatabaseSync } from 'node:sqlite';
|
|
2
1
|
import type { Block } from '../chunk/index.js';
|
|
3
2
|
import type { Config, FeatureName } from '../config/index.js';
|
|
4
3
|
import type { FileStat } from '../scan/index.js';
|
|
4
|
+
import type { Connection } from '../store/types.js';
|
|
5
5
|
export interface ReconcileDelta {
|
|
6
6
|
files: FileStat[];
|
|
7
7
|
reparsed: string[];
|
|
@@ -9,16 +9,20 @@ export interface ReconcileDelta {
|
|
|
9
9
|
vanished: string[];
|
|
10
10
|
linksChanged?: boolean;
|
|
11
11
|
}
|
|
12
|
+
export interface ExtractedDoc {
|
|
13
|
+
path: string;
|
|
14
|
+
extracted: unknown;
|
|
15
|
+
}
|
|
12
16
|
export interface Feature {
|
|
13
17
|
name: FeatureName;
|
|
14
|
-
schema(db:
|
|
18
|
+
schema(db: Connection): Promise<void>;
|
|
15
19
|
extract?(raw: string, body: string, search?: {
|
|
16
20
|
title: string;
|
|
17
21
|
summary: string;
|
|
18
22
|
}, data?: Record<string, unknown>, cfg?: Config, blocks?: Block[]): unknown;
|
|
19
|
-
remove?(db:
|
|
20
|
-
store?(db:
|
|
21
|
-
afterReconcile?(db:
|
|
23
|
+
remove?(db: Connection, paths: string[], delta: ReconcileDelta): Promise<void>;
|
|
24
|
+
store?(db: Connection, docs: ExtractedDoc[], delta: ReconcileDelta): Promise<void>;
|
|
25
|
+
afterReconcile?(db: Connection, delta: ReconcileDelta): Promise<void>;
|
|
22
26
|
enabledForFile?(cfg: Config, file: FileStat): boolean;
|
|
23
27
|
signature?(cfg: Config): string | undefined;
|
|
24
28
|
}
|