sensemaking 0.17.0 → 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 +147 -6
- package/dist/cjs/cli/map.js.map +1 -1
- package/dist/cjs/cli/named.js +20 -12
- package/dist/cjs/cli/named.js.map +1 -1
- package/dist/cjs/cli/path.js +190 -29
- package/dist/cjs/cli/path.js.map +1 -1
- package/dist/cjs/cli/peek.js +148 -7
- package/dist/cjs/cli/peek.js.map +1 -1
- package/dist/cjs/cli/related.js +5 -5
- package/dist/cjs/cli/related.js.map +1 -1
- package/dist/cjs/cli/search.js +5 -5
- 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 +187 -62
- 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 +4 -0
- package/dist/cjs/embed/distribution.d.ts +4 -0
- package/dist/cjs/embed/distribution.js +186 -0
- package/dist/cjs/embed/distribution.js.map +1 -0
- package/dist/cjs/embed/langfit.d.cts +2 -5
- package/dist/cjs/embed/langfit.d.ts +2 -5
- package/dist/cjs/embed/langfit.js +73 -63
- 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/static.js +13 -3
- package/dist/cjs/embed/static.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 +5 -5
- package/dist/esm/cli/map.js.map +1 -1
- package/dist/esm/cli/named.js +3 -3
- package/dist/esm/cli/named.js.map +1 -1
- package/dist/esm/cli/path.js +6 -5
- package/dist/esm/cli/path.js.map +1 -1
- package/dist/esm/cli/peek.js +5 -5
- package/dist/esm/cli/peek.js.map +1 -1
- package/dist/esm/cli/related.js +3 -3
- package/dist/esm/cli/related.js.map +1 -1
- package/dist/esm/cli/search.js +2 -2
- 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 +25 -24
- 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 +4 -0
- package/dist/esm/embed/distribution.js +11 -0
- package/dist/esm/embed/distribution.js.map +1 -0
- package/dist/esm/embed/langfit.d.ts +2 -5
- package/dist/esm/embed/langfit.js +13 -13
- 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/static.js +6 -1
- package/dist/esm/embed/static.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
package/README.md
CHANGED
|
@@ -6,14 +6,14 @@ Query and search your markdown notes with context-aware progressive disclosure:
|
|
|
6
6
|
|
|
7
7
|
Markdown notes accumulate: research, decisions, meeting notes, agent output. Past a few dozen, finding the ones relevant to what you're doing means grepping or reading whole folders into context. The structure that makes notes navigable (frontmatter, wikilinks, headings) is exactly what a query needs, but nothing exposes it as a query surface.
|
|
8
8
|
|
|
9
|
-
`sense` indexes all of it into SQLite and reconciles against file timestamps on every query, so results are never stale and nothing has to be running.
|
|
9
|
+
`sense` indexes all of it into a local database (SQLite by default, or the experimental DuckDB store, see Config) and reconciles against file timestamps on every query, so results are never stale and nothing has to be running.
|
|
10
10
|
|
|
11
11
|
## Quick start
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
npm install -g sensemaking
|
|
15
15
|
cd your-notes && sense init
|
|
16
|
-
sense download # the embedding model, once per machine;
|
|
16
|
+
sense download # the embedding model, once per machine; the first vector search fetches it otherwise
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Needs Node 22.20 or newer: the first release whose built-in SQLite has both FTS5, which `sense search` indexes prose with, and row-returning `INSERT ... RETURNING`, which `sense path` and `peek` walk the link graph with.
|
|
@@ -32,8 +32,9 @@ Every file becomes rows in these tables, plus whatever an enabled feature adds o
|
|
|
32
32
|
| table | holds | for |
|
|
33
33
|
|---|---|---|
|
|
34
34
|
| `frontmatter` | one column per key, plus `path`, `_mtime`, `_size`, `_rank`, `_parse_error` | filtering |
|
|
35
|
-
| `content` |
|
|
35
|
+
| `content` | `title`, `summary`, `text`, `path`; on the default `sqlite` store an FTS5 index with machine-written `title_seg`/`summary_seg`/`text_seg` sidecars for matching in Chinese, Japanese, Thai, Khmer, Lao, and Burmese, on `duckdb` a plain table that matches those scripts as substrings | search and ranking |
|
|
36
36
|
| `links` | `src`, `target` as written, `dst` resolved (`NULL` = dead link, but see the skill: a link to an attachment can never resolve) | graph |
|
|
37
|
+
| `tags` | `path`, `tag`; frontmatter and inline `#tags` merged and deduplicated, nested tags stored full | tag filters |
|
|
37
38
|
| `sections` | heading, `level`, `start_line`, `end_line`, `tokens` estimate | structure |
|
|
38
39
|
| `preset_files` | `path`, `preset` | which presets cover which files; `sql --preset` binds these as a `scope` table to join, since `sql` is otherwise index-wide |
|
|
39
40
|
|
|
@@ -62,10 +63,10 @@ ORDER BY bm25(content, 10.0, 5.0, 1.0) LIMIT 10
|
|
|
62
63
|
| `<name> [params...]` | run a query saved in the config; `--list` names them |
|
|
63
64
|
| `init` | write a starter `sense.config.json` |
|
|
64
65
|
| `status` | index location, doc count, per-preset coverage, watcher heartbeat |
|
|
65
|
-
| `download` | fetch the embedding model named in the config (once per machine;
|
|
66
|
+
| `download` | fetch the embedding model named in the config (once per machine; the first vector search fetches it otherwise) |
|
|
66
67
|
| `watch` | keep the index warm in the background (optional; see [WATCH.md](WATCH.md)) |
|
|
67
68
|
|
|
68
|
-
`search` runs one text through every engine its scope has: FTS5 word match (BM25-ranked, bare words AND-join, operators are yours), 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); `similarity` is the cosine against the best-matching chunk; `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.
|
|
69
|
+
`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` 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); `similarity` is the cosine against the best-matching chunk; `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.
|
|
69
70
|
|
|
70
71
|
## Config
|
|
71
72
|
|
|
@@ -90,9 +91,10 @@ ORDER BY bm25(content, 10.0, 5.0, 1.0) LIMIT 10
|
|
|
90
91
|
|
|
91
92
|
| key | holds |
|
|
92
93
|
|---|---|
|
|
93
|
-
| `presets` | named bundles of `include`/`exclude` globs, `k` (result count), `signals` (which engines this scope searches with
|
|
94
|
+
| `presets` | named bundles of `include`/`exclude` globs, `k` (result count), `signals` (which engines this scope searches with, `words`, `links`, `vectors`; every signal whose prerequisites hold, unless the preset lists them exhaustively), `where` (a standing SQL filter). A file is indexed if any preset includes it, embedded if a model is named and some covering preset's `signals` include `vectors`; `status` shows each preset's coverage. |
|
|
94
95
|
| `embed` | the model vectors are built with. Naming one gives the tree vectors; omitting the block means none at all, whatever the presets say. `sense download` fetches it. |
|
|
95
96
|
| `content` | settings for the `content` table. `tokenize` names the FTS5 tokenizer, defaulting to `porter unicode61`: name `trigram` for substring matching inside a Latin word, or `unicode61 tokenchars '-_'` to keep hyphenated terms whole. Languages written without word spaces (Chinese, Japanese, Thai, Khmer, Lao, Burmese) need no decision here: they are indexed per grapheme and searched as ordered phrases, substring semantics, what grep gives, needing no minimum length; naming a tokenizer turns that off, since the tree has then chosen its own scheme. Changing it rebuilds the text index only; vectors, links, and sections are kept. |
|
|
97
|
+
| `store` | backing store engine: `sqlite` (default, zero-dependency, Node's built-in SQLite) or `duckdb` (experimental). The first command that opens a `duckdb` tree installs `@duckdb/node-api` on its own (a one-time native download, ~110 MB). The same commands and table names run on both; what does not port is FTS5 syntax. Under `duckdb`, `search` text and raw `MATCH` reject FTS5's prefix (`foo*`), boolean (`AND`/`OR`/`NOT`), `NEAR`, initial-token (`^`), and column-filter (`title:foo`) operators with a named error that says how to rephrase or set `store` to `sqlite`; bare words and quoted phrases work on both. Raw `sql` is a per-store dialect: the tables and `has`/`basename`/`segment` are portable, but sqlite's FTS5 `MATCH`/`snippet()`/`bm25()` do not run under `duckdb`, so saved queries written in FTS5 syntax are sqlite dialect. Each store keeps its own cache file (`.sense/cache.db`, `.sense/cache.duckdb`); switching stores is a rebuild, not a migration. |
|
|
96
98
|
| `queries` | entries runnable as `sense <name>`, each naming the verb it runs: `{ sql }` for SQL (`?` binds positional args) or `{ search }` for a ranked search with its settings baked in, so `sense hot` needs no flags. Running an entry validates it: a typo'd column errors and exits nonzero, and a parameterised entry validates with any argument, since preparing precedes binding. |
|
|
97
99
|
| `version` | schema version; older configs auto-migrate on load, noted on stderr. |
|
|
98
100
|
|
|
@@ -104,9 +106,9 @@ Two custom SQL functions. `has(field, value)`: array membership on JSON-array fi
|
|
|
104
106
|
|
|
105
107
|
## Providers
|
|
106
108
|
|
|
107
|
-
`embed.provider` picks the wire protocol; `embed.model` names the model. [INTEGRATIONS.md](INTEGRATIONS.md) is the record of what has actually been run and verified against this codebase
|
|
109
|
+
`embed.provider` picks the wire protocol; `embed.model` names the model. [INTEGRATIONS.md](INTEGRATIONS.md) is the record of what has actually been run and verified against this codebase. Only that gets named as a recommendation.
|
|
108
110
|
|
|
109
|
-
**static
|
|
111
|
+
**static**. A local, pure-JS Model2Vec model; no network at query time.
|
|
110
112
|
|
|
111
113
|
```json
|
|
112
114
|
"embed": { "model": "minishlab/potion-retrieval-32M", "provider": "static" }
|
|
@@ -114,7 +116,7 @@ Two custom SQL functions. `has(field, value)`: array membership on JSON-array fi
|
|
|
114
116
|
|
|
115
117
|
`model` is a Hugging Face id, fetched to `~/.sense/models` on first use, or a path to a local directory holding `model.safetensors` and `tokenizer.json`.
|
|
116
118
|
|
|
117
|
-
**openai
|
|
119
|
+
**openai**. Any endpoint serving an OpenAI-shaped `POST /embeddings`.
|
|
118
120
|
|
|
119
121
|
```json
|
|
120
122
|
"embed": { "model": "nomic-embed-text", "provider": "openai", "url": "http://localhost:11434/v1" }
|
|
@@ -122,7 +124,7 @@ Two custom SQL functions. `has(field, value)`: array membership on JSON-array fi
|
|
|
122
124
|
|
|
123
125
|
Ollama serves this shape at `http://localhost:11434/v1`. LM Studio serves the same shape at `http://localhost:1234/v1`, with narrower platform support than Ollama: Apple Silicon only on Mac, AVX2 on Windows. Content stays on the machine for either. Any other OpenAI-shaped endpoint, including a hosted one, works the same way through `provider: "openai"` and its own `url`; a hosted endpoint means tree content is sent to that service.
|
|
124
126
|
|
|
125
|
-
**cohere
|
|
127
|
+
**cohere**. Cohere's native `/v2/embed`, which expresses the doc/query distinction (`input_type`) the OpenAI shape cannot.
|
|
126
128
|
|
|
127
129
|
```json
|
|
128
130
|
"embed": { "model": "embed-v4.0", "provider": "cohere", "key": "COHERE_API_KEY" }
|
|
@@ -146,7 +148,7 @@ These are release gates rather than hopes: every release regenerates the numbers
|
|
|
146
148
|
npx skills add kmalakoff/sensemaking # -g for global, -a claude-code to target
|
|
147
149
|
```
|
|
148
150
|
|
|
149
|
-
|
|
151
|
+
Three skills: `sense` for querying a tree (what each command is for, FTS5 syntax, reading the `via`/`score`/`similarity` columns, worked examples), `sense-setup` for making one, where features, frontmatter conventions, and note size are decisions with consequences either way, and `sense-bases` for translating an Obsidian Bases `.base` file into sense SQL.
|
|
150
152
|
|
|
151
153
|
## Prior art
|
|
152
154
|
|
|
@@ -161,10 +163,10 @@ Two skills: `sense` for querying a tree (what each command is for, FTS5 syntax,
|
|
|
161
163
|
- **Note CLIs (zk):** fixed schema; `sense` filters on arbitrary frontmatter.
|
|
162
164
|
- **Graph/LSP tools (IWE):** structural queries over a markdown graph via LSP/CLI/MCP, retrieval by structure rather than similarity; no SQL, no vector search.
|
|
163
165
|
- **Markdown vector stores (markdown-vdb):** hybrid BM25 + vector search over markdown files, no frontmatter filtering; `sense` treats vectors as one signal alongside SQL, not the whole store.
|
|
164
|
-
- **RAG / vector stores:** similarity can't express `WHERE status = 'active'`. Here vectors are one signal inside `search`: same
|
|
166
|
+
- **RAG / vector stores:** similarity can't express `WHERE status = 'active'`. Here vectors are one signal inside `search`: same database file, filters compose, every row labels its evidence (`via`), and a preset turns vectors off per layer of the tree. No second store, no daemon, no native builds on the default store.
|
|
165
167
|
- **Document-OS apps (Anytype, Logseq, SilverBullet, Capacities):** full applications with their own UI and storage. `sense` is headless: your files stay files, there's no app to run.
|
|
166
168
|
|
|
167
|
-
Dependencies: [yaml](https://github.com/eemeli/yaml), [@huggingface/tokenizers](https://github.com/huggingface/tokenizers.js), [franc-min](https://github.com/wooorm/franc), [mdast-util-from-markdown](https://github.com/syntax-tree/mdast-util-from-markdown), and the five GFM extensions it needs (not the full gfm/tagfilter bundle): [micromark-extension-gfm-autolink-literal](https://github.com/micromark/micromark-extension-gfm-autolink-literal), [micromark-extension-gfm-footnote](https://github.com/micromark/micromark-extension-gfm-footnote), [micromark-extension-gfm-strikethrough](https://github.com/micromark/micromark-extension-gfm-strikethrough), [micromark-extension-gfm-table](https://github.com/micromark/micromark-extension-gfm-table), [micromark-extension-gfm-task-list-item](https://github.com/micromark/micromark-extension-gfm-task-list-item), and their mdast counterparts [mdast-util-gfm-autolink-literal](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal), [mdast-util-gfm-footnote](https://github.com/syntax-tree/mdast-util-gfm-footnote), [mdast-util-gfm-strikethrough](https://github.com/syntax-tree/mdast-util-gfm-strikethrough), [mdast-util-gfm-table](https://github.com/syntax-tree/mdast-util-gfm-table), [mdast-util-gfm-task-list-item](https://github.com/syntax-tree/mdast-util-gfm-task-list-item) (all pure JS),
|
|
169
|
+
Dependencies: [yaml](https://github.com/eemeli/yaml), [@huggingface/tokenizers](https://github.com/huggingface/tokenizers.js), [franc-min](https://github.com/wooorm/franc), [mdast-util-from-markdown](https://github.com/syntax-tree/mdast-util-from-markdown), and the five GFM extensions it needs (not the full gfm/tagfilter bundle): [micromark-extension-gfm-autolink-literal](https://github.com/micromark/micromark-extension-gfm-autolink-literal), [micromark-extension-gfm-footnote](https://github.com/micromark/micromark-extension-gfm-footnote), [micromark-extension-gfm-strikethrough](https://github.com/micromark/micromark-extension-gfm-strikethrough), [micromark-extension-gfm-table](https://github.com/micromark/micromark-extension-gfm-table), [micromark-extension-gfm-task-list-item](https://github.com/micromark/micromark-extension-gfm-task-list-item), and their mdast counterparts [mdast-util-gfm-autolink-literal](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal), [mdast-util-gfm-footnote](https://github.com/syntax-tree/mdast-util-gfm-footnote), [mdast-util-gfm-strikethrough](https://github.com/syntax-tree/mdast-util-gfm-strikethrough), [mdast-util-gfm-table](https://github.com/syntax-tree/mdast-util-gfm-table), [mdast-util-gfm-task-list-item](https://github.com/syntax-tree/mdast-util-gfm-task-list-item) (all pure JS), Node's built-in SQLite, and [install-module-linked](https://github.com/kmalakoff/install-module-linked), which installs the optional `duckdb` store's `@duckdb/node-api` native binding on first use instead of shipping it to every install. No native builds by default.
|
|
168
170
|
|
|
169
171
|
## License
|
|
170
172
|
|
package/dist/cjs/cli/map.js
CHANGED
|
@@ -8,10 +8,36 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return _default;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
var
|
|
11
|
+
var _mapts = require("../commands/map.js");
|
|
12
12
|
var _outputts = require("../output/output.js");
|
|
13
|
-
var
|
|
13
|
+
var _indexts = require("./index.js");
|
|
14
14
|
var _sharedts = require("./shared.js");
|
|
15
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
16
|
+
try {
|
|
17
|
+
var info = gen[key](arg);
|
|
18
|
+
var value = info.value;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
reject(error);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (info.done) resolve(value);
|
|
24
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
25
|
+
}
|
|
26
|
+
function _async_to_generator(fn) {
|
|
27
|
+
return function() {
|
|
28
|
+
var self = this, args = arguments;
|
|
29
|
+
return new Promise(function(resolve, reject) {
|
|
30
|
+
var gen = fn.apply(self, args);
|
|
31
|
+
function _next(value) {
|
|
32
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
33
|
+
}
|
|
34
|
+
function _throw(err) {
|
|
35
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
36
|
+
}
|
|
37
|
+
_next(undefined);
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}
|
|
15
41
|
function _define_property(obj, key, value) {
|
|
16
42
|
if (key in obj) {
|
|
17
43
|
Object.defineProperty(obj, key, {
|
|
@@ -38,12 +64,127 @@ function _object_spread(target) {
|
|
|
38
64
|
}
|
|
39
65
|
return target;
|
|
40
66
|
}
|
|
67
|
+
function _ts_generator(thisArg, body) {
|
|
68
|
+
var f, y, t, _ = {
|
|
69
|
+
label: 0,
|
|
70
|
+
sent: function() {
|
|
71
|
+
if (t[0] & 1) throw t[1];
|
|
72
|
+
return t[1];
|
|
73
|
+
},
|
|
74
|
+
trys: [],
|
|
75
|
+
ops: []
|
|
76
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
77
|
+
return d(g, "next", {
|
|
78
|
+
value: verb(0)
|
|
79
|
+
}), d(g, "throw", {
|
|
80
|
+
value: verb(1)
|
|
81
|
+
}), d(g, "return", {
|
|
82
|
+
value: verb(2)
|
|
83
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
84
|
+
value: function() {
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
}), g;
|
|
88
|
+
function verb(n) {
|
|
89
|
+
return function(v) {
|
|
90
|
+
return step([
|
|
91
|
+
n,
|
|
92
|
+
v
|
|
93
|
+
]);
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function step(op) {
|
|
97
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
98
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
99
|
+
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;
|
|
100
|
+
if (y = 0, t) op = [
|
|
101
|
+
op[0] & 2,
|
|
102
|
+
t.value
|
|
103
|
+
];
|
|
104
|
+
switch(op[0]){
|
|
105
|
+
case 0:
|
|
106
|
+
case 1:
|
|
107
|
+
t = op;
|
|
108
|
+
break;
|
|
109
|
+
case 4:
|
|
110
|
+
_.label++;
|
|
111
|
+
return {
|
|
112
|
+
value: op[1],
|
|
113
|
+
done: false
|
|
114
|
+
};
|
|
115
|
+
case 5:
|
|
116
|
+
_.label++;
|
|
117
|
+
y = op[1];
|
|
118
|
+
op = [
|
|
119
|
+
0
|
|
120
|
+
];
|
|
121
|
+
continue;
|
|
122
|
+
case 7:
|
|
123
|
+
op = _.ops.pop();
|
|
124
|
+
_.trys.pop();
|
|
125
|
+
continue;
|
|
126
|
+
default:
|
|
127
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
128
|
+
_ = 0;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
132
|
+
_.label = op[1];
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
136
|
+
_.label = t[1];
|
|
137
|
+
t = op;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
if (t && _.label < t[2]) {
|
|
141
|
+
_.label = t[2];
|
|
142
|
+
_.ops.push(op);
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
if (t[2]) _.ops.pop();
|
|
146
|
+
_.trys.pop();
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
op = body.call(thisArg, _);
|
|
150
|
+
} catch (e) {
|
|
151
|
+
op = [
|
|
152
|
+
6,
|
|
153
|
+
e
|
|
154
|
+
];
|
|
155
|
+
y = 0;
|
|
156
|
+
} finally{
|
|
157
|
+
f = t = 0;
|
|
158
|
+
}
|
|
159
|
+
if (op[0] & 5) throw op[1];
|
|
160
|
+
return {
|
|
161
|
+
value: op[0] ? op[1] : void 0,
|
|
162
|
+
done: true
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}
|
|
41
166
|
var map = function map(ctx) {
|
|
42
|
-
var values = (0, _sharedts.parse)(ctx.argv, "usage: ".concat(ctx.name, " ").concat(
|
|
167
|
+
var values = (0, _sharedts.parse)(ctx.argv, "usage: ".concat(ctx.name, " ").concat(_indexts.USAGE.map), _object_spread({}, _sharedts.SCOPE, _sharedts.FORMAT, _sharedts.CONFIG)).values;
|
|
43
168
|
var format = (0, _sharedts.formatOf)(values);
|
|
44
|
-
return (0, _sharedts.withDb)(ctx, values.config, function(
|
|
45
|
-
|
|
46
|
-
|
|
169
|
+
return (0, _sharedts.withDb)(ctx, values.config, function(store, cfg) {
|
|
170
|
+
return _async_to_generator(function() {
|
|
171
|
+
var result;
|
|
172
|
+
return _ts_generator(this, function(_state) {
|
|
173
|
+
switch(_state.label){
|
|
174
|
+
case 0:
|
|
175
|
+
return [
|
|
176
|
+
4,
|
|
177
|
+
(0, _mapts.mapTree)(store, cfg, (0, _sharedts.scopeOf)(values))
|
|
178
|
+
];
|
|
179
|
+
case 1:
|
|
180
|
+
result = _state.sent();
|
|
181
|
+
console.log(format === 'json' ? (0, _outputts.stringifyJson)(result, 2) : (0, _outputts.renderMap)(result));
|
|
182
|
+
return [
|
|
183
|
+
2
|
|
184
|
+
];
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
})();
|
|
47
188
|
});
|
|
48
189
|
};
|
|
49
190
|
var _default = map;
|
package/dist/cjs/cli/map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/map.ts"],"sourcesContent":["import { mapTree } from '../commands/
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/map.ts"],"sourcesContent":["import { mapTree } from '../commands/map.ts';\nimport { renderMap, stringifyJson } from '../output/output.ts';\nimport { USAGE } from './index.ts';\nimport { CONFIG, FORMAT, formatOf, parse, SCOPE, scopeOf, withDb } from './shared.ts';\nimport type { Command } from './types.ts';\n\nconst map: Command = (ctx) => {\n const { values } = parse(ctx.argv, `usage: ${ctx.name} ${USAGE.map}`, { ...SCOPE, ...FORMAT, ...CONFIG });\n const format = formatOf(values);\n return withDb(ctx, values.config as string | undefined, async (store, cfg) => {\n const result = await mapTree(store, cfg, scopeOf(values));\n console.log(format === 'json' ? stringifyJson(result, 2) : renderMap(result));\n });\n};\nexport default map;\n"],"names":["map","ctx","values","parse","argv","USAGE","name","SCOPE","FORMAT","CONFIG","format","formatOf","withDb","config","store","cfg","result","mapTree","scopeOf","console","log","stringifyJson","renderMap"],"mappings":";;;;+BAcA;;;eAAA;;;qBAdwB;wBACiB;uBACnB;wBACkD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGxE,IAAMA,MAAe,aAACC;IACpB,IAAM,AAAEC,SAAWC,IAAAA,eAAK,EAACF,IAAIG,IAAI,EAAE,AAAC,UAAqBC,OAAZJ,IAAIK,IAAI,EAAC,KAAa,OAAVD,cAAK,CAACL,GAAG,GAAI,mBAAKO,eAAK,EAAKC,gBAAM,EAAKC,gBAAM,GAA9FP;IACR,IAAMQ,SAASC,IAAAA,kBAAQ,EAACT;IACxB,OAAOU,IAAAA,gBAAM,EAACX,KAAKC,OAAOW,MAAM,EAAwB,SAAOC,OAAOC;;gBAC9DC;;;;wBAAS;;4BAAMC,IAAAA,cAAO,EAACH,OAAOC,KAAKG,IAAAA,iBAAO,EAAChB;;;wBAA3Cc,SAAS;wBACfG,QAAQC,GAAG,CAACV,WAAW,SAASW,IAAAA,uBAAa,EAACL,QAAQ,KAAKM,IAAAA,mBAAS,EAACN;;;;;;QACvE;;AACF;IACA,WAAehB"}
|
package/dist/cjs/cli/named.js
CHANGED
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, // Fallback when the first positional is not a co
|
|
|
10
10
|
return named;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
var
|
|
13
|
+
var _searchts = require("../commands/search.js");
|
|
14
14
|
var _outputts = require("../output/output.js");
|
|
15
15
|
var _sharedts = require("./shared.js");
|
|
16
16
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -181,14 +181,22 @@ function named(ctx, queryName) {
|
|
|
181
181
|
console.error("saved queries: ".concat(Object.keys(cfg.queries).sort().join(', ')));
|
|
182
182
|
process.exit(2);
|
|
183
183
|
}
|
|
184
|
-
if ('sql' in entry)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
184
|
+
if (!('sql' in entry)) return [
|
|
185
|
+
3,
|
|
186
|
+
2
|
|
187
|
+
];
|
|
188
|
+
// A saved statement written against `scope` is preset-agnostic, so the same entry can be
|
|
189
|
+
// re-pointed at another layer from the command line instead of being copied per preset.
|
|
190
|
+
return [
|
|
191
|
+
4,
|
|
192
|
+
(0, _sharedts.runSql)(cfg, entry.sql, params, format, 'query "'.concat(queryName, '"'), values.preset)
|
|
193
|
+
];
|
|
194
|
+
case 1:
|
|
195
|
+
_state.sent();
|
|
196
|
+
return [
|
|
197
|
+
2
|
|
198
|
+
];
|
|
199
|
+
case 2:
|
|
192
200
|
// A saved search's text is fixed in config; there is nowhere for a positional to bind.
|
|
193
201
|
if (params.length > 0) {
|
|
194
202
|
ctx.usageError('"'.concat(queryName, '" is a saved search and takes no positional parameters; edit its "search" in sense.config.json, or use "').concat(ctx.name, ' search" directly'));
|
|
@@ -201,14 +209,14 @@ function named(ctx, queryName) {
|
|
|
201
209
|
noExclude = values['no-exclude'] === true;
|
|
202
210
|
return [
|
|
203
211
|
4,
|
|
204
|
-
(0, _sharedts.withDb)(ctx, configPath, function(
|
|
212
|
+
(0, _sharedts.withDb)(ctx, configPath, function(store, resolvedCfg) {
|
|
205
213
|
return _async_to_generator(function() {
|
|
206
214
|
return _ts_generator(this, function(_state) {
|
|
207
215
|
switch(_state.label){
|
|
208
216
|
case 0:
|
|
209
217
|
return [
|
|
210
218
|
4,
|
|
211
|
-
(0,
|
|
219
|
+
(0, _searchts.search)(store, resolvedCfg, entry.search, {
|
|
212
220
|
k: k,
|
|
213
221
|
where: where,
|
|
214
222
|
preset: preset,
|
|
@@ -230,7 +238,7 @@ function named(ctx, queryName) {
|
|
|
230
238
|
})();
|
|
231
239
|
})
|
|
232
240
|
];
|
|
233
|
-
case
|
|
241
|
+
case 3:
|
|
234
242
|
_state.sent();
|
|
235
243
|
return [
|
|
236
244
|
2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/named.ts"],"sourcesContent":["import { search } from '../commands/
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/named.ts"],"sourcesContent":["import { search } from '../commands/search.ts';\nimport { printRows } from '../output/output.ts';\nimport { CONFIG, FORMAT, parse, parseK, rowFormatOf, runSql, SEARCH_FLAGS, withDb } from './shared.ts';\nimport type { Ctx } from './types.ts';\n\n// Fallback when the first positional is not a command: a saved query, { sql } or { search }.\n// SEARCH_FLAGS override a saved search's fields the same way they override a preset's.\nexport default async function named(ctx: Ctx, queryName: string): Promise<void> {\n const usage = `usage: ${ctx.name} ${queryName} [params...] [--format table|json|csv] [--config path] [--where \"<sql>\"] [--k n] [--preset name] [--include glob ...] [--exclude glob ...] [--no-exclude]`;\n const { values, positionals: params } = parse(ctx.argv, usage, { ...SEARCH_FLAGS, ...FORMAT, ...CONFIG });\n const format = rowFormatOf(values);\n const configPath = values.config as string | undefined;\n\n const cfg = ctx.resolveConfig(configPath);\n const entry = cfg.queries[queryName];\n if (entry === undefined) {\n console.error(`unknown command or saved entry: \"${queryName}\"`);\n console.error(`saved queries: ${Object.keys(cfg.queries).sort().join(', ')}`);\n process.exit(2);\n }\n\n if ('sql' in entry) {\n // A saved statement written against `scope` is preset-agnostic, so the same entry can be\n // re-pointed at another layer from the command line instead of being copied per preset.\n await runSql(cfg, entry.sql, params, format, `query \"${queryName}\"`, values.preset as string | undefined);\n return;\n }\n\n // A saved search's text is fixed in config; there is nowhere for a positional to bind.\n if (params.length > 0) {\n ctx.usageError(`\"${queryName}\" is a saved search and takes no positional parameters; edit its \"search\" in sense.config.json, or use \"${ctx.name} search\" directly`);\n }\n const k = parseK(values.k as string | undefined, ctx.usageError) ?? entry.k;\n const where = (values.where as string | undefined) ?? entry.where;\n const preset = (values.preset as string | undefined) ?? entry.preset;\n const include = (values.include as string[] | undefined) ?? entry.include;\n const exclude = (values.exclude as string[] | undefined) ?? entry.exclude;\n const noExclude = values['no-exclude'] === true;\n await withDb(ctx, configPath, async (store, resolvedCfg) => printRows(await search(store, resolvedCfg, entry.search, { k, where, preset, include, exclude, noExclude }), format));\n}\n"],"names":["named","ctx","queryName","parseK","values","usage","parse","params","format","configPath","cfg","entry","k","where","preset","include","exclude","noExclude","name","argv","SEARCH_FLAGS","FORMAT","CONFIG","positionals","rowFormatOf","config","resolveConfig","queries","undefined","console","error","Object","keys","sort","join","process","exit","runSql","sql","length","usageError","withDb","store","resolvedCfg","search","printRows"],"mappings":";;;;+BAKA,6FAA6F;AAC7F,uFAAuF;AACvF;;;eAA8BA;;;wBAPP;wBACG;wBAC+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAK1E,SAAeA,MAAMC,GAAQ,EAAEC,SAAiB;;YAyBnDC,SACKC,eACCA,gBACCA,iBACAA,iBA5BXC,OACkCC,QAAhCF,QAAqBG,QACvBC,QACAC,YAEAC,KACAC,OAkBAC,GACAC,OACAC,QACAC,SACAC,SACAC;;;;oBA7BAZ,QAAQ,AAAC,UAAqBH,OAAZD,IAAIiB,IAAI,EAAC,KAAa,OAAVhB,WAAU;oBACNI,SAAAA,IAAAA,eAAK,EAACL,IAAIkB,IAAI,EAAEd,OAAO,mBAAKe,sBAAY,EAAKC,gBAAM,EAAKC,gBAAM,IAA9FlB,SAAgCE,OAAhCF,QAAqBG,SAAWD,OAAxBiB;oBACVf,SAASgB,IAAAA,qBAAW,EAACpB;oBACrBK,aAAaL,OAAOqB,MAAM;oBAE1Bf,MAAMT,IAAIyB,aAAa,CAACjB;oBACxBE,QAAQD,IAAIiB,OAAO,CAACzB,UAAU;oBACpC,IAAIS,UAAUiB,WAAW;wBACvBC,QAAQC,KAAK,CAAC,AAAC,oCAA6C,OAAV5B,WAAU;wBAC5D2B,QAAQC,KAAK,CAAC,AAAC,kBAA4D,OAA3CC,OAAOC,IAAI,CAACtB,IAAIiB,OAAO,EAAEM,IAAI,GAAGC,IAAI,CAAC;wBACrEC,QAAQC,IAAI,CAAC;oBACf;yBAEI,CAAA,SAASzB,KAAI,GAAb;;;;oBACF,yFAAyF;oBACzF,wFAAwF;oBACxF;;wBAAM0B,IAAAA,gBAAM,EAAC3B,KAAKC,MAAM2B,GAAG,EAAE/B,QAAQC,QAAQ,AAAC,UAAmB,OAAVN,WAAU,MAAIE,OAAOU,MAAM;;;oBAAlF;oBACA;;;;oBAGF,uFAAuF;oBACvF,IAAIP,OAAOgC,MAAM,GAAG,GAAG;wBACrBtC,IAAIuC,UAAU,CAAC,AAAC,IAAuHvC,OAApHC,WAAU,4GAAmH,OAATD,IAAIiB,IAAI,EAAC;oBAClJ;oBACMN,KAAIT,UAAAA,IAAAA,gBAAM,EAACC,OAAOQ,CAAC,EAAwBX,IAAIuC,UAAU,eAArDrC,qBAAAA,UAA0DQ,MAAMC,CAAC;oBACrEC,SAAST,gBAAAA,OAAOS,KAAK,cAAZT,2BAAAA,gBAAuCO,MAAME,KAAK;oBAC3DC,UAAUV,iBAAAA,OAAOU,MAAM,cAAbV,4BAAAA,iBAAwCO,MAAMG,MAAM;oBAC9DC,WAAWX,kBAAAA,OAAOW,OAAO,cAAdX,6BAAAA,kBAA2CO,MAAMI,OAAO;oBACnEC,WAAWZ,kBAAAA,OAAOY,OAAO,cAAdZ,6BAAAA,kBAA2CO,MAAMK,OAAO;oBACnEC,YAAYb,MAAM,CAAC,aAAa,KAAK;oBAC3C;;wBAAMqC,IAAAA,gBAAM,EAACxC,KAAKQ,YAAY,SAAOiC,OAAOC;;;;;4CAA0B;;gDAAMC,IAAAA,gBAAM,EAACF,OAAOC,aAAahC,MAAMiC,MAAM,EAAE;oDAAEhC,GAAAA;oDAAGC,OAAAA;oDAAOC,QAAAA;oDAAQC,SAAAA;oDAASC,SAAAA;oDAASC,WAAAA;gDAAU;;;;;gDAAzG4B,mBAAS;oDAAC;oDAAmGrC;;;;;;;;;oBAAzK;;;;;;IACF"}
|
package/dist/cjs/cli/path.js
CHANGED
|
@@ -8,10 +8,11 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return _default;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
var
|
|
11
|
+
var _peekts = require("../commands/peek.js");
|
|
12
|
+
var _scopets = require("../commands/scope.js");
|
|
12
13
|
var _traversets = require("../graph/traverse.js");
|
|
13
14
|
var _outputts = require("../output/output.js");
|
|
14
|
-
var
|
|
15
|
+
var _indexts = require("./index.js");
|
|
15
16
|
var _sharedts = require("./shared.js");
|
|
16
17
|
function _array_like_to_array(arr, len) {
|
|
17
18
|
if (len == null || len > arr.length) len = arr.length;
|
|
@@ -21,6 +22,32 @@ function _array_like_to_array(arr, len) {
|
|
|
21
22
|
function _array_with_holes(arr) {
|
|
22
23
|
if (Array.isArray(arr)) return arr;
|
|
23
24
|
}
|
|
25
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
26
|
+
try {
|
|
27
|
+
var info = gen[key](arg);
|
|
28
|
+
var value = info.value;
|
|
29
|
+
} catch (error) {
|
|
30
|
+
reject(error);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (info.done) resolve(value);
|
|
34
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
35
|
+
}
|
|
36
|
+
function _async_to_generator(fn) {
|
|
37
|
+
return function() {
|
|
38
|
+
var self = this, args = arguments;
|
|
39
|
+
return new Promise(function(resolve, reject) {
|
|
40
|
+
var gen = fn.apply(self, args);
|
|
41
|
+
function _next(value) {
|
|
42
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
43
|
+
}
|
|
44
|
+
function _throw(err) {
|
|
45
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
46
|
+
}
|
|
47
|
+
_next(undefined);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
}
|
|
24
51
|
function _define_property(obj, key, value) {
|
|
25
52
|
if (key in obj) {
|
|
26
53
|
Object.defineProperty(obj, key, {
|
|
@@ -100,6 +127,105 @@ function _object_spread_props(target, source) {
|
|
|
100
127
|
function _sliced_to_array(arr, i) {
|
|
101
128
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
102
129
|
}
|
|
130
|
+
function _ts_generator(thisArg, body) {
|
|
131
|
+
var f, y, t, _ = {
|
|
132
|
+
label: 0,
|
|
133
|
+
sent: function() {
|
|
134
|
+
if (t[0] & 1) throw t[1];
|
|
135
|
+
return t[1];
|
|
136
|
+
},
|
|
137
|
+
trys: [],
|
|
138
|
+
ops: []
|
|
139
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
140
|
+
return d(g, "next", {
|
|
141
|
+
value: verb(0)
|
|
142
|
+
}), d(g, "throw", {
|
|
143
|
+
value: verb(1)
|
|
144
|
+
}), d(g, "return", {
|
|
145
|
+
value: verb(2)
|
|
146
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
147
|
+
value: function() {
|
|
148
|
+
return this;
|
|
149
|
+
}
|
|
150
|
+
}), g;
|
|
151
|
+
function verb(n) {
|
|
152
|
+
return function(v) {
|
|
153
|
+
return step([
|
|
154
|
+
n,
|
|
155
|
+
v
|
|
156
|
+
]);
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function step(op) {
|
|
160
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
161
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
162
|
+
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;
|
|
163
|
+
if (y = 0, t) op = [
|
|
164
|
+
op[0] & 2,
|
|
165
|
+
t.value
|
|
166
|
+
];
|
|
167
|
+
switch(op[0]){
|
|
168
|
+
case 0:
|
|
169
|
+
case 1:
|
|
170
|
+
t = op;
|
|
171
|
+
break;
|
|
172
|
+
case 4:
|
|
173
|
+
_.label++;
|
|
174
|
+
return {
|
|
175
|
+
value: op[1],
|
|
176
|
+
done: false
|
|
177
|
+
};
|
|
178
|
+
case 5:
|
|
179
|
+
_.label++;
|
|
180
|
+
y = op[1];
|
|
181
|
+
op = [
|
|
182
|
+
0
|
|
183
|
+
];
|
|
184
|
+
continue;
|
|
185
|
+
case 7:
|
|
186
|
+
op = _.ops.pop();
|
|
187
|
+
_.trys.pop();
|
|
188
|
+
continue;
|
|
189
|
+
default:
|
|
190
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
191
|
+
_ = 0;
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
195
|
+
_.label = op[1];
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
199
|
+
_.label = t[1];
|
|
200
|
+
t = op;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
if (t && _.label < t[2]) {
|
|
204
|
+
_.label = t[2];
|
|
205
|
+
_.ops.push(op);
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
if (t[2]) _.ops.pop();
|
|
209
|
+
_.trys.pop();
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
op = body.call(thisArg, _);
|
|
213
|
+
} catch (e) {
|
|
214
|
+
op = [
|
|
215
|
+
6,
|
|
216
|
+
e
|
|
217
|
+
];
|
|
218
|
+
y = 0;
|
|
219
|
+
} finally{
|
|
220
|
+
f = t = 0;
|
|
221
|
+
}
|
|
222
|
+
if (op[0] & 5) throw op[1];
|
|
223
|
+
return {
|
|
224
|
+
value: op[0] ? op[1] : void 0,
|
|
225
|
+
done: true
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
}
|
|
103
229
|
function _unsupported_iterable_to_array(o, minLen) {
|
|
104
230
|
if (!o) return;
|
|
105
231
|
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
@@ -116,7 +242,7 @@ function parseMaxDepth(depth, usageError) {
|
|
|
116
242
|
return parsed;
|
|
117
243
|
}
|
|
118
244
|
var pathCmd = function pathCmd(ctx) {
|
|
119
|
-
var usage = "usage: ".concat(ctx.name, " ").concat(
|
|
245
|
+
var usage = "usage: ".concat(ctx.name, " ").concat(_indexts.USAGE.path);
|
|
120
246
|
var _parse = (0, _sharedts.parse)(ctx.argv, usage, _object_spread_props(_object_spread({}, _sharedts.SCOPE, _sharedts.FORMAT, _sharedts.CONFIG), {
|
|
121
247
|
'max-depth': {
|
|
122
248
|
type: 'string'
|
|
@@ -126,32 +252,67 @@ var pathCmd = function pathCmd(ctx) {
|
|
|
126
252
|
if (!a || !b) ctx.usageError(usage);
|
|
127
253
|
var maxDepth = parseMaxDepth(values['max-depth'], ctx.usageError);
|
|
128
254
|
var format = (0, _sharedts.formatOf)(values);
|
|
129
|
-
return (0, _sharedts.withDb)(ctx, values.config, function(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
255
|
+
return (0, _sharedts.withDb)(ctx, values.config, function(store, cfg) {
|
|
256
|
+
return _async_to_generator(function() {
|
|
257
|
+
var paths, from, to, allowed, hops, rows;
|
|
258
|
+
return _ts_generator(this, function(_state) {
|
|
259
|
+
switch(_state.label){
|
|
260
|
+
case 0:
|
|
261
|
+
return [
|
|
262
|
+
4,
|
|
263
|
+
store.prepare('SELECT "path" FROM frontmatter')
|
|
264
|
+
];
|
|
265
|
+
case 1:
|
|
266
|
+
return [
|
|
267
|
+
4,
|
|
268
|
+
_state.sent().all()
|
|
269
|
+
];
|
|
270
|
+
case 2:
|
|
271
|
+
paths = _state.sent().map(function(r) {
|
|
272
|
+
return r.path;
|
|
273
|
+
});
|
|
274
|
+
from = (0, _peekts.resolveNote)(paths, a);
|
|
275
|
+
to = (0, _peekts.resolveNote)(paths, b);
|
|
276
|
+
return [
|
|
277
|
+
4,
|
|
278
|
+
(0, _scopets.scopedPaths)(store, cfg, (0, _sharedts.scopeOf)(values))
|
|
279
|
+
];
|
|
280
|
+
case 3:
|
|
281
|
+
allowed = _state.sent();
|
|
282
|
+
return [
|
|
283
|
+
4,
|
|
284
|
+
(0, _traversets.findPath)(store, from, to, {
|
|
285
|
+
maxDepth: maxDepth,
|
|
286
|
+
allowed: allowed
|
|
287
|
+
})
|
|
288
|
+
];
|
|
289
|
+
case 4:
|
|
290
|
+
hops = _state.sent();
|
|
291
|
+
if (format === 'json') {
|
|
292
|
+
console.log(JSON.stringify(hops));
|
|
293
|
+
return [
|
|
294
|
+
2
|
|
295
|
+
];
|
|
296
|
+
}
|
|
297
|
+
if (hops === null) {
|
|
298
|
+
console.log(maxDepth ? "no path within ".concat(maxDepth, " hops") : 'no path');
|
|
299
|
+
return [
|
|
300
|
+
2
|
|
301
|
+
];
|
|
302
|
+
}
|
|
303
|
+
rows = hops.map(function(p, step) {
|
|
304
|
+
return {
|
|
305
|
+
step: step,
|
|
306
|
+
path: p
|
|
307
|
+
};
|
|
308
|
+
});
|
|
309
|
+
(0, _outputts.printRows)(rows, format);
|
|
310
|
+
return [
|
|
311
|
+
2
|
|
312
|
+
];
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
})();
|
|
155
316
|
});
|
|
156
317
|
};
|
|
157
318
|
var _default = pathCmd;
|