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
package/dist/cjs/cli/peek.js
CHANGED
|
@@ -20,6 +20,32 @@ function _array_like_to_array(arr, len) {
|
|
|
20
20
|
function _array_with_holes(arr) {
|
|
21
21
|
if (Array.isArray(arr)) return arr;
|
|
22
22
|
}
|
|
23
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
24
|
+
try {
|
|
25
|
+
var info = gen[key](arg);
|
|
26
|
+
var value = info.value;
|
|
27
|
+
} catch (error) {
|
|
28
|
+
reject(error);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (info.done) resolve(value);
|
|
32
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
33
|
+
}
|
|
34
|
+
function _async_to_generator(fn) {
|
|
35
|
+
return function() {
|
|
36
|
+
var self = this, args = arguments;
|
|
37
|
+
return new Promise(function(resolve, reject) {
|
|
38
|
+
var gen = fn.apply(self, args);
|
|
39
|
+
function _next(value) {
|
|
40
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
41
|
+
}
|
|
42
|
+
function _throw(err) {
|
|
43
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
44
|
+
}
|
|
45
|
+
_next(undefined);
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
}
|
|
23
49
|
function _define_property(obj, key, value) {
|
|
24
50
|
if (key in obj) {
|
|
25
51
|
Object.defineProperty(obj, key, {
|
|
@@ -76,6 +102,105 @@ function _object_spread(target) {
|
|
|
76
102
|
function _sliced_to_array(arr, i) {
|
|
77
103
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
78
104
|
}
|
|
105
|
+
function _ts_generator(thisArg, body) {
|
|
106
|
+
var f, y, t, _ = {
|
|
107
|
+
label: 0,
|
|
108
|
+
sent: function() {
|
|
109
|
+
if (t[0] & 1) throw t[1];
|
|
110
|
+
return t[1];
|
|
111
|
+
},
|
|
112
|
+
trys: [],
|
|
113
|
+
ops: []
|
|
114
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
115
|
+
return d(g, "next", {
|
|
116
|
+
value: verb(0)
|
|
117
|
+
}), d(g, "throw", {
|
|
118
|
+
value: verb(1)
|
|
119
|
+
}), d(g, "return", {
|
|
120
|
+
value: verb(2)
|
|
121
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
122
|
+
value: function() {
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
}), g;
|
|
126
|
+
function verb(n) {
|
|
127
|
+
return function(v) {
|
|
128
|
+
return step([
|
|
129
|
+
n,
|
|
130
|
+
v
|
|
131
|
+
]);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function step(op) {
|
|
135
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
136
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
137
|
+
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;
|
|
138
|
+
if (y = 0, t) op = [
|
|
139
|
+
op[0] & 2,
|
|
140
|
+
t.value
|
|
141
|
+
];
|
|
142
|
+
switch(op[0]){
|
|
143
|
+
case 0:
|
|
144
|
+
case 1:
|
|
145
|
+
t = op;
|
|
146
|
+
break;
|
|
147
|
+
case 4:
|
|
148
|
+
_.label++;
|
|
149
|
+
return {
|
|
150
|
+
value: op[1],
|
|
151
|
+
done: false
|
|
152
|
+
};
|
|
153
|
+
case 5:
|
|
154
|
+
_.label++;
|
|
155
|
+
y = op[1];
|
|
156
|
+
op = [
|
|
157
|
+
0
|
|
158
|
+
];
|
|
159
|
+
continue;
|
|
160
|
+
case 7:
|
|
161
|
+
op = _.ops.pop();
|
|
162
|
+
_.trys.pop();
|
|
163
|
+
continue;
|
|
164
|
+
default:
|
|
165
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
166
|
+
_ = 0;
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
170
|
+
_.label = op[1];
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
174
|
+
_.label = t[1];
|
|
175
|
+
t = op;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
if (t && _.label < t[2]) {
|
|
179
|
+
_.label = t[2];
|
|
180
|
+
_.ops.push(op);
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
if (t[2]) _.ops.pop();
|
|
184
|
+
_.trys.pop();
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
op = body.call(thisArg, _);
|
|
188
|
+
} catch (e) {
|
|
189
|
+
op = [
|
|
190
|
+
6,
|
|
191
|
+
e
|
|
192
|
+
];
|
|
193
|
+
y = 0;
|
|
194
|
+
} finally{
|
|
195
|
+
f = t = 0;
|
|
196
|
+
}
|
|
197
|
+
if (op[0] & 5) throw op[1];
|
|
198
|
+
return {
|
|
199
|
+
value: op[0] ? op[1] : void 0,
|
|
200
|
+
done: true
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
79
204
|
function _unsupported_iterable_to_array(o, minLen) {
|
|
80
205
|
if (!o) return;
|
|
81
206
|
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
@@ -90,10 +215,26 @@ var peekCmd = function peekCmd(ctx) {
|
|
|
90
215
|
var _positionals = _sliced_to_array(positionals, 1), pathArg = _positionals[0];
|
|
91
216
|
if (!pathArg) ctx.usageError(usage);
|
|
92
217
|
var format = (0, _sharedts.formatOf)(values);
|
|
93
|
-
return (0, _sharedts.withDb)(ctx, values.config, function(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
218
|
+
return (0, _sharedts.withDb)(ctx, values.config, function(store, cfg) {
|
|
219
|
+
return _async_to_generator(function() {
|
|
220
|
+
var overrides, result;
|
|
221
|
+
return _ts_generator(this, function(_state) {
|
|
222
|
+
switch(_state.label){
|
|
223
|
+
case 0:
|
|
224
|
+
overrides = (0, _sharedts.scopeOf)(values);
|
|
225
|
+
return [
|
|
226
|
+
4,
|
|
227
|
+
(0, _peekts.peek)(store, cfg, pathArg, overrides)
|
|
228
|
+
];
|
|
229
|
+
case 1:
|
|
230
|
+
result = _state.sent();
|
|
231
|
+
console.log(format === 'json' ? (0, _outputts.stringifyJson)(result, 2) : (0, _outputts.renderPeek)(result));
|
|
232
|
+
return [
|
|
233
|
+
2
|
|
234
|
+
];
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
})();
|
|
97
238
|
});
|
|
98
239
|
};
|
|
99
240
|
var _default = peekCmd;
|
package/dist/cjs/cli/peek.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/peek.ts"],"sourcesContent":["import { peek } from '../commands/peek.ts';\nimport { renderPeek } 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 peekCmd: Command = (ctx) => {\n const usage = `usage: ${ctx.name} ${USAGE.peek}`;\n const { values, positionals } = parse(ctx.argv, usage, { ...SCOPE, ...FORMAT, ...CONFIG });\n const [pathArg] = positionals;\n if (!pathArg) ctx.usageError(usage);\n const format = formatOf(values);\n return withDb(ctx, values.config as string | undefined, (
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/peek.ts"],"sourcesContent":["import { peek } from '../commands/peek.ts';\nimport { renderPeek, 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 peekCmd: Command = (ctx) => {\n const usage = `usage: ${ctx.name} ${USAGE.peek}`;\n const { values, positionals } = parse(ctx.argv, usage, { ...SCOPE, ...FORMAT, ...CONFIG });\n const [pathArg] = positionals;\n if (!pathArg) ctx.usageError(usage);\n const format = formatOf(values);\n return withDb(ctx, values.config as string | undefined, async (store, cfg) => {\n const overrides = scopeOf(values);\n const result = await peek(store, cfg, pathArg, overrides);\n console.log(format === 'json' ? stringifyJson(result, 2) : renderPeek(result));\n });\n};\nexport default peekCmd;\n"],"names":["peekCmd","ctx","usage","USAGE","name","peek","parse","argv","SCOPE","FORMAT","CONFIG","values","positionals","pathArg","usageError","format","formatOf","withDb","config","store","cfg","overrides","result","scopeOf","console","log","stringifyJson","renderPeek"],"mappings":";;;;+BAkBA;;;eAAA;;;sBAlBqB;wBACqB;uBACpB;wBACkD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGxE,IAAMA,UAAmB,iBAACC;IACxB,IAAMC,QAAQ,AAAC,UAAqBC,OAAZF,IAAIG,IAAI,EAAC,KAAc,OAAXD,cAAK,CAACE,IAAI;IAC9C,IAAgCC,SAAAA,IAAAA,eAAK,EAACL,IAAIM,IAAI,EAAEL,OAAO,mBAAKM,eAAK,EAAKC,gBAAM,EAAKC,gBAAM,IAA/EC,SAAwBL,OAAxBK,QAAQC,cAAgBN,OAAhBM;IAChB,IAAkBA,gCAAAA,iBAAXC,UAAWD;IAClB,IAAI,CAACC,SAASZ,IAAIa,UAAU,CAACZ;IAC7B,IAAMa,SAASC,IAAAA,kBAAQ,EAACL;IACxB,OAAOM,IAAAA,gBAAM,EAAChB,KAAKU,OAAOO,MAAM,EAAwB,SAAOC,OAAOC;;gBAC9DC,WACAC;;;;wBADAD,YAAYE,IAAAA,iBAAO,EAACZ;wBACX;;4BAAMN,IAAAA,YAAI,EAACc,OAAOC,KAAKP,SAASQ;;;wBAAzCC,SAAS;wBACfE,QAAQC,GAAG,CAACV,WAAW,SAASW,IAAAA,uBAAa,EAACJ,QAAQ,KAAKK,IAAAA,oBAAU,EAACL;;;;;;QACxE;;AACF;IACA,WAAetB"}
|
package/dist/cjs/cli/related.js
CHANGED
|
@@ -245,7 +245,7 @@ var relatedCmd = function relatedCmd(ctx) {
|
|
|
245
245
|
if (!pathArg) ctx.usageError(usage);
|
|
246
246
|
var k = (_parseK = (0, _sharedts.parseK)(values.k, ctx.usageError)) !== null && _parseK !== void 0 ? _parseK : RELATED_DEFAULT_K;
|
|
247
247
|
var format = (0, _sharedts.rowFormatOf)(values);
|
|
248
|
-
return (0, _sharedts.withDb)(ctx, values.config, function(
|
|
248
|
+
return (0, _sharedts.withDb)(ctx, values.config, function(store, cfg) {
|
|
249
249
|
return _async_to_generator(function() {
|
|
250
250
|
var overrides;
|
|
251
251
|
return _ts_generator(this, function(_state) {
|
|
@@ -254,7 +254,7 @@ var relatedCmd = function relatedCmd(ctx) {
|
|
|
254
254
|
overrides = (0, _sharedts.scopeOf)(values);
|
|
255
255
|
return [
|
|
256
256
|
4,
|
|
257
|
-
(0, _relatedts.relatedNotes)(
|
|
257
|
+
(0, _relatedts.relatedNotes)(store, cfg, pathArg, overrides, k)
|
|
258
258
|
];
|
|
259
259
|
case 1:
|
|
260
260
|
_outputts.printRows.apply(void 0, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/related.ts"],"sourcesContent":["import { relatedNotes } from '../commands/related.ts';\nimport type { Row } from '../output/output.ts';\nimport { printRows } from '../output/output.ts';\nimport { USAGE } from './index.ts';\nimport { CONFIG, FORMAT, parse, parseK, rowFormatOf, SCOPE, scopeOf, withDb } from './shared.ts';\nimport type { Command } from './types.ts';\n\nconst RELATED_DEFAULT_K = 5;\n\nconst relatedCmd: Command = (ctx) => {\n const usage = `usage: ${ctx.name} ${USAGE.related}`;\n const { values, positionals } = parse(ctx.argv, usage, { ...SCOPE, ...FORMAT, ...CONFIG, k: { type: 'string' } });\n const [pathArg] = positionals;\n if (!pathArg) ctx.usageError(usage);\n const k = parseK(values.k as string | undefined, ctx.usageError) ?? RELATED_DEFAULT_K;\n const format = rowFormatOf(values);\n return withDb(ctx, values.config as string | undefined, async (
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/related.ts"],"sourcesContent":["import { relatedNotes } from '../commands/related.ts';\nimport type { Row } from '../output/output.ts';\nimport { printRows } from '../output/output.ts';\nimport { USAGE } from './index.ts';\nimport { CONFIG, FORMAT, parse, parseK, rowFormatOf, SCOPE, scopeOf, withDb } from './shared.ts';\nimport type { Command } from './types.ts';\n\nconst RELATED_DEFAULT_K = 5;\n\nconst relatedCmd: Command = (ctx) => {\n const usage = `usage: ${ctx.name} ${USAGE.related}`;\n const { values, positionals } = parse(ctx.argv, usage, { ...SCOPE, ...FORMAT, ...CONFIG, k: { type: 'string' } });\n const [pathArg] = positionals;\n if (!pathArg) ctx.usageError(usage);\n const k = parseK(values.k as string | undefined, ctx.usageError) ?? RELATED_DEFAULT_K;\n const format = rowFormatOf(values);\n return withDb(ctx, values.config as string | undefined, async (store, cfg) => {\n const overrides = scopeOf(values);\n printRows((await relatedNotes(store, cfg, pathArg, overrides, k)) as Row[], format);\n });\n};\nexport default relatedCmd;\n"],"names":["RELATED_DEFAULT_K","relatedCmd","ctx","parseK","usage","USAGE","name","related","parse","argv","SCOPE","FORMAT","CONFIG","k","type","values","positionals","pathArg","usageError","format","rowFormatOf","withDb","config","store","cfg","overrides","scopeOf","relatedNotes","printRows"],"mappings":";;;;+BAqBA;;;eAAA;;;yBArB6B;wBAEH;uBACJ;wBAC6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGnF,IAAMA,oBAAoB;AAE1B,IAAMC,aAAsB,oBAACC;QAKjBC;IAJV,IAAMC,QAAQ,AAAC,UAAqBC,OAAZH,IAAII,IAAI,EAAC,KAAiB,OAAdD,cAAK,CAACE,OAAO;IACjD,IAAgCC,SAAAA,IAAAA,eAAK,EAACN,IAAIO,IAAI,EAAEL,OAAO,wCAAKM,eAAK,EAAKC,gBAAM,EAAKC,gBAAM;QAAEC,GAAG;YAAEC,MAAM;QAAS;SAArGC,SAAwBP,OAAxBO,QAAQC,cAAgBR,OAAhBQ;IAChB,IAAkBA,gCAAAA,iBAAXC,UAAWD;IAClB,IAAI,CAACC,SAASf,IAAIgB,UAAU,CAACd;IAC7B,IAAMS,KAAIV,UAAAA,IAAAA,gBAAM,EAACY,OAAOF,CAAC,EAAwBX,IAAIgB,UAAU,eAArDf,qBAAAA,UAA0DH;IACpE,IAAMmB,SAASC,IAAAA,qBAAW,EAACL;IAC3B,OAAOM,IAAAA,gBAAM,EAACnB,KAAKa,OAAOO,MAAM,EAAwB,SAAOC,OAAOC;;gBAC9DC;;;;wBAAAA,YAAYC,IAAAA,iBAAO,EAACX;wBACf;;4BAAMY,IAAAA,uBAAY,EAACJ,OAAOC,KAAKP,SAASQ,WAAWZ;;;wBAA9De,mBAAS;4BAAE;4BAAiET;;;;;;;QAC9E;;AACF;IACA,WAAelB"}
|
package/dist/cjs/cli/search.js
CHANGED
|
@@ -223,14 +223,14 @@ var searchCmd = function searchCmd(ctx) {
|
|
|
223
223
|
format = (0, _sharedts.rowFormatOf)(values);
|
|
224
224
|
return [
|
|
225
225
|
4,
|
|
226
|
-
(0, _sharedts.withDb)(ctx, values.config, function(
|
|
226
|
+
(0, _sharedts.withDb)(ctx, values.config, function(store, cfg) {
|
|
227
227
|
return _async_to_generator(function() {
|
|
228
228
|
return _ts_generator(this, function(_state) {
|
|
229
229
|
switch(_state.label){
|
|
230
230
|
case 0:
|
|
231
231
|
return [
|
|
232
232
|
4,
|
|
233
|
-
(0, _searchts.search)(
|
|
233
|
+
(0, _searchts.search)(store, cfg, terms, _object_spread({
|
|
234
234
|
k: k
|
|
235
235
|
}, (0, _sharedts.scopeOf)(values)))
|
|
236
236
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/search.ts"],"sourcesContent":["import { search } from '../commands/search.ts';\nimport { printRows } from '../output/output.ts';\nimport { USAGE } from './index.ts';\nimport { CONFIG, FORMAT, parse, parseK, rowFormatOf, SEARCH_FLAGS, scopeOf, withDb } from './shared.ts';\nimport type { Command } from './types.ts';\n\nconst searchCmd: Command = async (ctx) => {\n const usage = `usage: ${ctx.name} ${USAGE.search}`;\n const { values, positionals } = parse(ctx.argv, usage, { ...SEARCH_FLAGS, ...FORMAT, ...CONFIG });\n const [terms] = positionals;\n if (!terms) ctx.usageError(usage);\n const k = parseK(values.k as string | undefined, ctx.usageError);\n const format = rowFormatOf(values);\n await withDb(ctx, values.config as string | undefined, async (
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/search.ts"],"sourcesContent":["import { search } from '../commands/search.ts';\nimport { printRows } from '../output/output.ts';\nimport { USAGE } from './index.ts';\nimport { CONFIG, FORMAT, parse, parseK, rowFormatOf, SEARCH_FLAGS, scopeOf, withDb } from './shared.ts';\nimport type { Command } from './types.ts';\n\nconst searchCmd: Command = async (ctx) => {\n const usage = `usage: ${ctx.name} ${USAGE.search}`;\n const { values, positionals } = parse(ctx.argv, usage, { ...SEARCH_FLAGS, ...FORMAT, ...CONFIG });\n const [terms] = positionals;\n if (!terms) ctx.usageError(usage);\n const k = parseK(values.k as string | undefined, ctx.usageError);\n const format = rowFormatOf(values);\n await withDb(ctx, values.config as string | undefined, async (store, cfg) => printRows(await search(store, cfg, terms, { k, ...scopeOf(values) }), format));\n};\nexport default searchCmd;\n"],"names":["searchCmd","ctx","usage","parse","values","positionals","terms","k","format","USAGE","name","search","argv","SEARCH_FLAGS","FORMAT","CONFIG","usageError","parseK","rowFormatOf","withDb","config","store","cfg","scopeOf","printRows"],"mappings":";;;;+BAeA;;;eAAA;;;wBAfuB;wBACG;uBACJ;wBACoE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG1F,IAAMA,YAAqB,mBAAOC;;YAC1BC,OAC0BC,QAAxBC,QAAQC,aACAA,cAATC,OAEDC,GACAC;;;;oBALAN,QAAQ,AAAC,UAAqBO,OAAZR,IAAIS,IAAI,EAAC,KAAgB,OAAbD,cAAK,CAACE,MAAM;oBAChBR,SAAAA,IAAAA,eAAK,EAACF,IAAIW,IAAI,EAAEV,OAAO,mBAAKW,sBAAY,EAAKC,gBAAM,EAAKC,gBAAM,IAAtFX,SAAwBD,OAAxBC,QAAQC,cAAgBF,OAAhBE;oBACAA,gCAAAA,iBAATC,QAASD;oBAChB,IAAI,CAACC,OAAOL,IAAIe,UAAU,CAACd;oBACrBK,IAAIU,IAAAA,gBAAM,EAACb,OAAOG,CAAC,EAAwBN,IAAIe,UAAU;oBACzDR,SAASU,IAAAA,qBAAW,EAACd;oBAC3B;;wBAAMe,IAAAA,gBAAM,EAAClB,KAAKG,OAAOgB,MAAM,EAAwB,SAAOC,OAAOC;;;;;4CAAkB;;gDAAMX,IAAAA,gBAAM,EAACU,OAAOC,KAAKhB,OAAO;oDAAEC,GAAAA;mDAAMgB,IAAAA,iBAAO,EAACnB;;;;;gDAA1DoB,mBAAS;oDAAC;oDAA4DhB;;;;;;;;;oBAAnJ;;;;;;IACF;;IACA,WAAeR"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ParseArgsOptionsConfig } from 'node:util';
|
|
2
2
|
import type { ResolvedConfig, SearchOverrides } from '../config/index.js';
|
|
3
|
-
import type { OpenResult } from '../db/index.js';
|
|
4
3
|
import type { RowFormat } from '../output/output.js';
|
|
4
|
+
import type { OpenResult } from '../store/index.js';
|
|
5
5
|
import type { Ctx } from './types.js';
|
|
6
6
|
export declare const FORMAT: ParseArgsOptionsConfig;
|
|
7
7
|
export declare const CONFIG: ParseArgsOptionsConfig;
|
|
@@ -17,6 +17,6 @@ export declare function parse(argv: string[], usage: string, options: ParseArgsO
|
|
|
17
17
|
};
|
|
18
18
|
export declare function parseK(k: string | undefined, usageError: (message: string) => never): number | undefined;
|
|
19
19
|
export declare function printWarnings(warnings: string[]): void;
|
|
20
|
-
export declare function withDb(ctx: Ctx, configPath: string | undefined, fn: (
|
|
21
|
-
export declare function runSql(cfg: ResolvedConfig, sql: string, params: string[], format: RowFormat, label: string, preset?: string): void
|
|
20
|
+
export declare function withDb(ctx: Ctx, configPath: string | undefined, fn: (store: OpenResult['store'], cfg: ResolvedConfig) => void | Promise<void>): Promise<void>;
|
|
21
|
+
export declare function runSql(cfg: ResolvedConfig, sql: string, params: string[], format: RowFormat, label: string, preset?: string): Promise<void>;
|
|
22
22
|
export {};
|
package/dist/cjs/cli/shared.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ParseArgsOptionsConfig } from 'node:util';
|
|
2
2
|
import type { ResolvedConfig, SearchOverrides } from '../config/index.js';
|
|
3
|
-
import type { OpenResult } from '../db/index.js';
|
|
4
3
|
import type { RowFormat } from '../output/output.js';
|
|
4
|
+
import type { OpenResult } from '../store/index.js';
|
|
5
5
|
import type { Ctx } from './types.js';
|
|
6
6
|
export declare const FORMAT: ParseArgsOptionsConfig;
|
|
7
7
|
export declare const CONFIG: ParseArgsOptionsConfig;
|
|
@@ -17,6 +17,6 @@ export declare function parse(argv: string[], usage: string, options: ParseArgsO
|
|
|
17
17
|
};
|
|
18
18
|
export declare function parseK(k: string | undefined, usageError: (message: string) => never): number | undefined;
|
|
19
19
|
export declare function printWarnings(warnings: string[]): void;
|
|
20
|
-
export declare function withDb(ctx: Ctx, configPath: string | undefined, fn: (
|
|
21
|
-
export declare function runSql(cfg: ResolvedConfig, sql: string, params: string[], format: RowFormat, label: string, preset?: string): void
|
|
20
|
+
export declare function withDb(ctx: Ctx, configPath: string | undefined, fn: (store: OpenResult['store'], cfg: ResolvedConfig) => void | Promise<void>): Promise<void>;
|
|
21
|
+
export declare function runSql(cfg: ResolvedConfig, sql: string, params: string[], format: RowFormat, label: string, preset?: string): Promise<void>;
|
|
22
22
|
export {};
|
package/dist/cjs/cli/shared.js
CHANGED
|
@@ -48,10 +48,10 @@ _export(exports, {
|
|
|
48
48
|
});
|
|
49
49
|
var _nodeutil = require("node:util");
|
|
50
50
|
var _indexts = require("../config/index.js");
|
|
51
|
-
var _indexts1 = require("../db/index.js");
|
|
52
51
|
var _columnhintts = require("../output/column-hint.js");
|
|
53
52
|
var _outputts = require("../output/output.js");
|
|
54
53
|
var _searcherrorts = require("../output/search-error.js");
|
|
54
|
+
var _indexts1 = require("../store/index.js");
|
|
55
55
|
function _array_like_to_array(arr, len) {
|
|
56
56
|
if (len == null || len > arr.length) len = arr.length;
|
|
57
57
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
@@ -382,37 +382,47 @@ function printWarnings(warnings) {
|
|
|
382
382
|
}
|
|
383
383
|
function withDb(ctx, configPath, fn) {
|
|
384
384
|
return _async_to_generator(function() {
|
|
385
|
-
var cfg,
|
|
385
|
+
var cfg, _ref, store, warnings;
|
|
386
386
|
return _ts_generator(this, function(_state) {
|
|
387
387
|
switch(_state.label){
|
|
388
388
|
case 0:
|
|
389
389
|
cfg = ctx.resolveConfig(configPath);
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
390
|
+
return [
|
|
391
|
+
4,
|
|
392
|
+
(0, _indexts1.openStore)(cfg)
|
|
393
|
+
];
|
|
393
394
|
case 1:
|
|
395
|
+
_ref = _state.sent(), store = _ref.store, warnings = _ref.warnings;
|
|
396
|
+
printWarnings(warnings);
|
|
397
|
+
_state.label = 2;
|
|
398
|
+
case 2:
|
|
394
399
|
_state.trys.push([
|
|
395
|
-
|
|
400
|
+
2,
|
|
396
401
|
,
|
|
397
|
-
|
|
398
|
-
|
|
402
|
+
4,
|
|
403
|
+
6
|
|
399
404
|
]);
|
|
400
405
|
return [
|
|
401
406
|
4,
|
|
402
|
-
fn(
|
|
407
|
+
fn(store, cfg)
|
|
403
408
|
];
|
|
404
|
-
case
|
|
409
|
+
case 3:
|
|
405
410
|
_state.sent();
|
|
406
411
|
return [
|
|
407
412
|
3,
|
|
408
|
-
|
|
413
|
+
6
|
|
409
414
|
];
|
|
410
|
-
case
|
|
411
|
-
|
|
415
|
+
case 4:
|
|
416
|
+
return [
|
|
417
|
+
4,
|
|
418
|
+
store.close()
|
|
419
|
+
];
|
|
420
|
+
case 5:
|
|
421
|
+
_state.sent();
|
|
412
422
|
return [
|
|
413
423
|
7
|
|
414
424
|
];
|
|
415
|
-
case
|
|
425
|
+
case 6:
|
|
416
426
|
return [
|
|
417
427
|
2
|
|
418
428
|
];
|
|
@@ -425,52 +435,140 @@ function withDb(ctx, configPath, fn) {
|
|
|
425
435
|
// shadowing the base tables, cannot cover `content`, because FTS5 `MATCH` uses the table name
|
|
426
436
|
// as a hidden column and a view has none. A flag that silently scoped three tables of four
|
|
427
437
|
// would look scoped and not be.
|
|
428
|
-
function bindScope(
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
438
|
+
function bindScope(store, cfg, preset) {
|
|
439
|
+
return _async_to_generator(function() {
|
|
440
|
+
var name, insert;
|
|
441
|
+
return _ts_generator(this, function(_state) {
|
|
442
|
+
switch(_state.label){
|
|
443
|
+
case 0:
|
|
444
|
+
name = (0, _indexts.resolvePreset)(cfg, preset).name; // unknown names throw, listing what is declared
|
|
445
|
+
return [
|
|
446
|
+
4,
|
|
447
|
+
store.exec('DROP TABLE IF EXISTS temp.scope')
|
|
448
|
+
];
|
|
449
|
+
case 1:
|
|
450
|
+
_state.sent();
|
|
451
|
+
return [
|
|
452
|
+
4,
|
|
453
|
+
store.exec('CREATE TEMP TABLE scope ("path" TEXT PRIMARY KEY)')
|
|
454
|
+
];
|
|
455
|
+
case 2:
|
|
456
|
+
_state.sent();
|
|
457
|
+
return [
|
|
458
|
+
4,
|
|
459
|
+
store.prepare('INSERT INTO temp.scope ("path") SELECT "path" FROM preset_files WHERE preset = ?')
|
|
460
|
+
];
|
|
461
|
+
case 3:
|
|
462
|
+
insert = _state.sent();
|
|
463
|
+
return [
|
|
464
|
+
4,
|
|
465
|
+
insert.run(name)
|
|
466
|
+
];
|
|
467
|
+
case 4:
|
|
468
|
+
_state.sent();
|
|
469
|
+
return [
|
|
470
|
+
2
|
|
471
|
+
];
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
})();
|
|
433
475
|
}
|
|
434
476
|
function runSql(cfg, sql, params, format, label, preset) {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
477
|
+
return _async_to_generator(function() {
|
|
478
|
+
var _sql_match, placeholderCount, _ref, store, warnings, _statement, statement, columns, err, hinted;
|
|
479
|
+
return _ts_generator(this, function(_state) {
|
|
480
|
+
switch(_state.label){
|
|
481
|
+
case 0:
|
|
482
|
+
placeholderCount = ((_sql_match = sql.match(/\?/g)) !== null && _sql_match !== void 0 ? _sql_match : []).length;
|
|
483
|
+
if (params.length !== placeholderCount) {
|
|
484
|
+
console.error("".concat(label, " expects ").concat(placeholderCount, " parameter(s), got ").concat(params.length));
|
|
485
|
+
process.exit(2);
|
|
486
|
+
}
|
|
487
|
+
// Naming a preset and never joining it would return the whole index while reading as scoped,
|
|
488
|
+
// which is the one hazard of binding rather than applying. Refuse instead.
|
|
489
|
+
if (preset !== undefined && !/\bscope\b/i.test(sql)) {
|
|
490
|
+
console.error('--preset binds a temporary "scope" table of the preset\'s paths, and '.concat(label, " never joins it, so the preset would have no effect"));
|
|
491
|
+
console.error('add: JOIN scope ON scope."path" = <table>."path"');
|
|
492
|
+
process.exit(2);
|
|
493
|
+
}
|
|
494
|
+
return [
|
|
495
|
+
4,
|
|
496
|
+
(0, _indexts1.openStore)(cfg)
|
|
497
|
+
];
|
|
498
|
+
case 1:
|
|
499
|
+
_ref = _state.sent(), store = _ref.store, warnings = _ref.warnings;
|
|
500
|
+
printWarnings(warnings);
|
|
501
|
+
if (!(preset !== undefined)) return [
|
|
502
|
+
3,
|
|
503
|
+
3
|
|
504
|
+
];
|
|
505
|
+
return [
|
|
506
|
+
4,
|
|
507
|
+
bindScope(store, cfg, preset)
|
|
508
|
+
];
|
|
509
|
+
case 2:
|
|
510
|
+
_state.sent();
|
|
511
|
+
_state.label = 3;
|
|
512
|
+
case 3:
|
|
513
|
+
_state.trys.push([
|
|
514
|
+
3,
|
|
515
|
+
6,
|
|
516
|
+
,
|
|
517
|
+
9
|
|
518
|
+
]);
|
|
519
|
+
return [
|
|
520
|
+
4,
|
|
521
|
+
store.raw.prepare(sql)
|
|
522
|
+
];
|
|
523
|
+
case 4:
|
|
524
|
+
statement = _state.sent();
|
|
525
|
+
columns = statement.columns().map(function(c) {
|
|
526
|
+
return c.name;
|
|
527
|
+
});
|
|
528
|
+
return [
|
|
529
|
+
4,
|
|
530
|
+
(0, _outputts.printRowStream)((_statement = statement).iterate.apply(_statement, _to_consumable_array(params)), format, columns)
|
|
531
|
+
];
|
|
532
|
+
case 5:
|
|
533
|
+
_state.sent();
|
|
534
|
+
return [
|
|
535
|
+
3,
|
|
536
|
+
9
|
|
537
|
+
];
|
|
538
|
+
case 6:
|
|
539
|
+
err = _state.sent();
|
|
540
|
+
return [
|
|
541
|
+
4,
|
|
542
|
+
store.docs.columns()
|
|
543
|
+
];
|
|
544
|
+
case 7:
|
|
545
|
+
hinted = _columnhintts.columnHint.apply(void 0, [
|
|
546
|
+
_state.sent(),
|
|
547
|
+
err
|
|
548
|
+
]);
|
|
549
|
+
return [
|
|
550
|
+
4,
|
|
551
|
+
store.close()
|
|
552
|
+
];
|
|
553
|
+
case 8:
|
|
554
|
+
_state.sent();
|
|
555
|
+
// A saved query or ad-hoc SQL can carry `content MATCH ?` too, so the same FTS5
|
|
556
|
+
// punctuation trap applies -- the bound parameters are the search terms there. SQL
|
|
557
|
+
// without MATCH gets its error verbatim; search advice on a plain typo would mislead.
|
|
558
|
+
if (/\bMATCH\b/i.test(sql)) throw (0, _searcherrorts.searchError)(hinted, params.join(' '));
|
|
559
|
+
throw hinted;
|
|
560
|
+
case 9:
|
|
561
|
+
return [
|
|
562
|
+
4,
|
|
563
|
+
store.close()
|
|
564
|
+
];
|
|
565
|
+
case 10:
|
|
566
|
+
_state.sent();
|
|
567
|
+
return [
|
|
568
|
+
2
|
|
569
|
+
];
|
|
570
|
+
}
|
|
463
571
|
});
|
|
464
|
-
|
|
465
|
-
} catch (err) {
|
|
466
|
-
var hinted = (0, _columnhintts.columnHint)(db, err); // pragma needs the db still open
|
|
467
|
-
db.close();
|
|
468
|
-
// A saved query or ad-hoc SQL can carry `content MATCH ?` too, so the same FTS5
|
|
469
|
-
// punctuation trap applies -- the bound parameters are the search terms there. SQL
|
|
470
|
-
// without MATCH gets its error verbatim; search advice on a plain typo would mislead.
|
|
471
|
-
if (/\bMATCH\b/i.test(sql)) throw (0, _searcherrorts.searchError)(hinted, params.join(' '));
|
|
472
|
-
throw hinted;
|
|
473
|
-
}
|
|
474
|
-
db.close();
|
|
572
|
+
})();
|
|
475
573
|
}
|
|
476
574
|
/* 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/cli/shared.ts"],"sourcesContent":["import type { ParseArgsOptionsConfig } from 'node:util';\nimport { parseArgs } from 'node:util';\nimport type { ResolvedConfig, SearchOverrides } from '../config/index.ts';\nimport { resolvePreset } from '../config/index.ts';\nimport type { OpenResult } from '../db/index.ts';\nimport { open } from '../db/index.ts';\nimport { columnHint } from '../output/column-hint.ts';\nimport type { Row, RowFormat } from '../output/output.ts';\nimport { printRowStream } from '../output/output.ts';\nimport { searchError } from '../output/search-error.ts';\nimport type { Ctx } from './types.ts';\n\n// Spreadable option fragments -- one flag name keeps one meaning across every command's table.\nexport const FORMAT: ParseArgsOptionsConfig = { format: { type: 'string', default: 'table' } };\nexport const CONFIG: ParseArgsOptionsConfig = { config: { type: 'string' } };\n// The scope vocabulary every scoped command shares: named preset, ad hoc include/exclude\n// globs, a where SQL condition. search adds k on top.\nexport const SCOPE: ParseArgsOptionsConfig = {\n where: { type: 'string' },\n preset: { type: 'string' },\n include: { type: 'string', multiple: true },\n exclude: { type: 'string', multiple: true },\n // Widening, which no other flag can express: --include and --exclude each override their\n // own side of the preset, so neither can drop an exclusion the preset declares.\n 'no-exclude': { type: 'boolean', default: false },\n};\nexport const SEARCH_FLAGS: ParseArgsOptionsConfig = { ...SCOPE, k: { type: 'string' } };\n\ntype Values = Record<string, string | boolean | string[] | undefined>;\n\n// The SCOPE fragment's parsed values as the overrides every scoped command passes down. One\n// place to read them, so a new scope field is added to the fragment and here, not in each\n// command's call.\nexport function scopeOf(values: Values): SearchOverrides {\n return {\n preset: values.preset as string | undefined,\n include: values.include as string[] | undefined,\n exclude: values.exclude as string[] | undefined,\n where: values.where as string | undefined,\n noExclude: values['no-exclude'] === true,\n };\n}\n\n// An unrecognised value used to fall through to `table`, so a typo looked like it worked.\n// parseArgs is strict about flag names; this is the same strictness for the value.\nfunction pickFormat<T extends string>(values: Values, allowed: readonly T[]): T {\n const format = String(values.format);\n if ((allowed as readonly string[]).includes(format)) return format as T;\n console.error(`unknown --format \"${format}\"; expected ${allowed.join(', ')}`);\n process.exit(2);\n}\n\nexport function formatOf(values: Values): 'table' | 'json' {\n return pickFormat(values, ['table', 'json'] as const);\n}\n\n// csv is a row set rendered as rows; map, peek, status, and path render structures instead,\n// and take formatOf.\nexport function rowFormatOf(values: Values): RowFormat {\n return pickFormat(values, ['table', 'json', 'csv'] as const);\n}\n\n// Per-command parseArgs: strict (a foreign flag exits 2), and every table gets --help for free.\nexport function parse(argv: string[], usage: string, options: ParseArgsOptionsConfig): { values: Values; positionals: string[] } {\n let values: Values;\n let positionals: string[];\n try {\n ({ values, positionals } = parseArgs({\n args: argv,\n options: { ...options, help: { type: 'boolean', default: false, short: 'h' } },\n strict: true,\n allowPositionals: true,\n }));\n } catch (err) {\n console.error((err as Error).message);\n console.error(usage);\n process.exit(2);\n }\n if (values.help) {\n console.log(usage);\n process.exit(0);\n }\n return { values, positionals };\n}\n\n// --k must be a positive integer: SQLite reads a bound LIMIT of -1 as \"unlimited\" and 0 as\n// \"nothing\", and parseInt would silently truncate \"5.9\" -- all three are caller mistakes\n// worth a usage error, matching the config-level SavedSearch validation.\nexport function parseK(k: string | undefined, usageError: (message: string) => never): number | undefined {\n if (k === undefined) return undefined;\n const parsed = Number(k);\n if (!Number.isInteger(parsed) || parsed <= 0) usageError(`--k expects a positive integer, got \"${k}\"`);\n return parsed;\n}\n\n// Shared open-query-close envelope for commands that touch the tree.\n\nexport function printWarnings(warnings: string[]): void {\n for (const w of warnings) console.warn(w);\n}\n\nexport async function withDb(ctx: Ctx, configPath: string | undefined, fn: (db: OpenResult['db'], cfg: ResolvedConfig) => void | Promise<void>): Promise<void> {\n const cfg = ctx.resolveConfig(configPath);\n const { db, warnings } = open(cfg);\n printWarnings(warnings);\n try {\n await fn(db, cfg);\n } finally {\n db.close();\n }\n}\n\n// `--preset` on SQL binds the scope rather than applying it: the statement joins `scope`\n// itself. Filtering behind the query's back is not available -- the obvious version, temp views\n// shadowing the base tables, cannot cover `content`, because FTS5 `MATCH` uses the table name\n// as a hidden column and a view has none. A flag that silently scoped three tables of four\n// would look scoped and not be.\nfunction bindScope(db: OpenResult['db'], cfg: ResolvedConfig, preset: string): void {\n const { name } = resolvePreset(cfg, preset); // unknown names throw, listing what is declared\n db.exec('DROP TABLE IF EXISTS temp.scope');\n db.exec('CREATE TEMP TABLE scope (\"path\" TEXT PRIMARY KEY)');\n db.prepare('INSERT INTO temp.scope (\"path\") SELECT \"path\" FROM preset_files WHERE preset = ?').run(name);\n}\n\n// An unbound `?` silently binds NULL, so mismatched param counts fail loudly instead.\nexport function runSql(cfg: ResolvedConfig, sql: string, params: string[], format: RowFormat, label: string, preset?: string): void {\n const placeholderCount = (sql.match(/\\?/g) ?? []).length;\n if (params.length !== placeholderCount) {\n console.error(`${label} expects ${placeholderCount} parameter(s), got ${params.length}`);\n process.exit(2);\n }\n // Naming a preset and never joining it would return the whole index while reading as scoped,\n // which is the one hazard of binding rather than applying. Refuse instead.\n if (preset !== undefined && !/\\bscope\\b/i.test(sql)) {\n console.error(`--preset binds a temporary \"scope\" table of the preset's paths, and ${label} never joins it, so the preset would have no effect`);\n console.error(`add: JOIN scope ON scope.\"path\" = <table>.\"path\"`);\n process.exit(2);\n }\n const { db, warnings } = open(cfg);\n printWarnings(warnings);\n if (preset !== undefined) bindScope(db, cfg, preset);\n // Streamed rather than collected: `sql` is the one caller whose result size is the\n // statement's business, not this package's, so the rows are never held here in bulk.\n // columns() reads the statement's own metadata, so a 0-row csv still has its header.\n // A mid-stream SQLite error (e.g. SQLITE_BUSY outlasting busy_timeout) can still leave\n // partial output; the nonzero exit code is the caller's signal, output completeness is not\n // guaranteed on failure.\n try {\n const statement = db.prepare(sql);\n statement.setReadBigInts(true); // int64 past 2^53 arrives as BigInt instead of throwing at step time\n const columns = statement.columns().map((c) => c.name);\n printRowStream(statement.iterate(...params) as Iterable<Row>, format, columns);\n } catch (err) {\n const hinted = columnHint(db, err as Error); // pragma needs the db still open\n db.close();\n // A saved query or ad-hoc SQL can carry `content MATCH ?` too, so the same FTS5\n // punctuation trap applies -- the bound parameters are the search terms there. SQL\n // without MATCH gets its error verbatim; search advice on a plain typo would mislead.\n if (/\\bMATCH\\b/i.test(sql)) throw searchError(hinted, params.join(' '));\n throw hinted;\n }\n db.close();\n}\n"],"names":["CONFIG","FORMAT","SCOPE","SEARCH_FLAGS","formatOf","parse","parseK","printWarnings","rowFormatOf","runSql","scopeOf","withDb","format","type","default","config","where","preset","include","multiple","exclude","k","values","noExclude","pickFormat","allowed","String","includes","console","error","join","process","exit","argv","usage","options","positionals","parseArgs","args","help","short","strict","allowPositionals","err","message","log","usageError","undefined","parsed","Number","isInteger","warnings","w","warn","ctx","configPath","fn","cfg","open","db","resolveConfig","close","bindScope","name","resolvePreset","exec","prepare","run","sql","params","label","placeholderCount","match","length","test","statement","setReadBigInts","columns","map","c","printRowStream","iterate","hinted","columnHint","searchError"],"mappings":";;;;;;;;;;;QAcaA;eAAAA;;QADAC;eAAAA;;QAIAC;eAAAA;;QASAC;eAAAA;;QA0BGC;eAAAA;;QAWAC;eAAAA;;QAyBAC;eAAAA;;QASAC;eAAAA;;QAvCAC;eAAAA;;QAmEAC;eAAAA;;QA5FAC;eAAAA;;QAoEMC;eAAAA;;;wBApGI;uBAEI;wBAET;4BACM;wBAEI;6BACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIrB,IAAMV,SAAiC;IAAEW,QAAQ;QAAEC,MAAM;QAAUC,SAAS;IAAQ;AAAE;AACtF,IAAMd,SAAiC;IAAEe,QAAQ;QAAEF,MAAM;IAAS;AAAE;AAGpE,IAAMX,QAAgC;IAC3Cc,OAAO;QAAEH,MAAM;IAAS;IACxBI,QAAQ;QAAEJ,MAAM;IAAS;IACzBK,SAAS;QAAEL,MAAM;QAAUM,UAAU;IAAK;IAC1CC,SAAS;QAAEP,MAAM;QAAUM,UAAU;IAAK;IAC1C,yFAAyF;IACzF,gFAAgF;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F,IAAI,aAAaa,IAAI,CAACN,MAAM,MAAMgB,IAAAA,0BAAW,EAACF,QAAQb,OAAOvC,IAAI,CAAC;QAClE,MAAMoD;IACR;IACAvB,GAAGE,KAAK;AACV"}
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/cli/shared.ts"],"sourcesContent":["import type { ParseArgsOptionsConfig } from 'node:util';\nimport { parseArgs } from 'node:util';\nimport type { ResolvedConfig, SearchOverrides } from '../config/index.ts';\nimport { resolvePreset } from '../config/index.ts';\nimport { columnHint } from '../output/column-hint.ts';\nimport type { Row, RowFormat } from '../output/output.ts';\nimport { printRowStream } from '../output/output.ts';\nimport { searchError } from '../output/search-error.ts';\nimport type { OpenResult } from '../store/index.ts';\nimport { openStore } from '../store/index.ts';\nimport type { Store } from '../store/types.ts';\nimport type { Ctx } from './types.ts';\n\n// Spreadable option fragments -- one flag name keeps one meaning across every command's table.\nexport const FORMAT: ParseArgsOptionsConfig = { format: { type: 'string', default: 'table' } };\nexport const CONFIG: ParseArgsOptionsConfig = { config: { type: 'string' } };\n// The scope vocabulary every scoped command shares: named preset, ad hoc include/exclude\n// globs, a where SQL condition. search adds k on top.\nexport const SCOPE: ParseArgsOptionsConfig = {\n where: { type: 'string' },\n preset: { type: 'string' },\n include: { type: 'string', multiple: true },\n exclude: { type: 'string', multiple: true },\n // Widening, which no other flag can express: --include and --exclude each override their\n // own side of the preset, so neither can drop an exclusion the preset declares.\n 'no-exclude': { type: 'boolean', default: false },\n};\nexport const SEARCH_FLAGS: ParseArgsOptionsConfig = { ...SCOPE, k: { type: 'string' } };\n\ntype Values = Record<string, string | boolean | string[] | undefined>;\n\n// The SCOPE fragment's parsed values as the overrides every scoped command passes down. One\n// place to read them, so a new scope field is added to the fragment and here, not in each\n// command's call.\nexport function scopeOf(values: Values): SearchOverrides {\n return {\n preset: values.preset as string | undefined,\n include: values.include as string[] | undefined,\n exclude: values.exclude as string[] | undefined,\n where: values.where as string | undefined,\n noExclude: values['no-exclude'] === true,\n };\n}\n\n// An unrecognised value used to fall through to `table`, so a typo looked like it worked.\n// parseArgs is strict about flag names; this is the same strictness for the value.\nfunction pickFormat<T extends string>(values: Values, allowed: readonly T[]): T {\n const format = String(values.format);\n if ((allowed as readonly string[]).includes(format)) return format as T;\n console.error(`unknown --format \"${format}\"; expected ${allowed.join(', ')}`);\n process.exit(2);\n}\n\nexport function formatOf(values: Values): 'table' | 'json' {\n return pickFormat(values, ['table', 'json'] as const);\n}\n\n// csv is a row set rendered as rows; map, peek, status, and path render structures instead,\n// and take formatOf.\nexport function rowFormatOf(values: Values): RowFormat {\n return pickFormat(values, ['table', 'json', 'csv'] as const);\n}\n\n// Per-command parseArgs: strict (a foreign flag exits 2), and every table gets --help for free.\nexport function parse(argv: string[], usage: string, options: ParseArgsOptionsConfig): { values: Values; positionals: string[] } {\n let values: Values;\n let positionals: string[];\n try {\n ({ values, positionals } = parseArgs({\n args: argv,\n options: { ...options, help: { type: 'boolean', default: false, short: 'h' } },\n strict: true,\n allowPositionals: true,\n }));\n } catch (err) {\n console.error((err as Error).message);\n console.error(usage);\n process.exit(2);\n }\n if (values.help) {\n console.log(usage);\n process.exit(0);\n }\n return { values, positionals };\n}\n\n// --k must be a positive integer: SQLite reads a bound LIMIT of -1 as \"unlimited\" and 0 as\n// \"nothing\", and parseInt would silently truncate \"5.9\" -- all three are caller mistakes\n// worth a usage error, matching the config-level SavedSearch validation.\nexport function parseK(k: string | undefined, usageError: (message: string) => never): number | undefined {\n if (k === undefined) return undefined;\n const parsed = Number(k);\n if (!Number.isInteger(parsed) || parsed <= 0) usageError(`--k expects a positive integer, got \"${k}\"`);\n return parsed;\n}\n\n// Shared open-query-close envelope for commands that touch the tree.\n\nexport function printWarnings(warnings: string[]): void {\n for (const w of warnings) console.warn(w);\n}\n\nexport async function withDb(ctx: Ctx, configPath: string | undefined, fn: (store: OpenResult['store'], cfg: ResolvedConfig) => void | Promise<void>): Promise<void> {\n const cfg = ctx.resolveConfig(configPath);\n const { store, warnings } = await openStore(cfg);\n printWarnings(warnings);\n try {\n await fn(store, cfg);\n } finally {\n await store.close();\n }\n}\n\n// `--preset` on SQL binds the scope rather than applying it: the statement joins `scope`\n// itself. Filtering behind the query's back is not available -- the obvious version, temp views\n// shadowing the base tables, cannot cover `content`, because FTS5 `MATCH` uses the table name\n// as a hidden column and a view has none. A flag that silently scoped three tables of four\n// would look scoped and not be.\nasync function bindScope(store: Store, cfg: ResolvedConfig, preset: string): Promise<void> {\n const { name } = resolvePreset(cfg, preset); // unknown names throw, listing what is declared\n await store.exec('DROP TABLE IF EXISTS temp.scope');\n await store.exec('CREATE TEMP TABLE scope (\"path\" TEXT PRIMARY KEY)');\n const insert = await store.prepare('INSERT INTO temp.scope (\"path\") SELECT \"path\" FROM preset_files WHERE preset = ?');\n await insert.run(name);\n}\n\n// An unbound `?` silently binds NULL, so mismatched param counts fail loudly instead.\nexport async function runSql(cfg: ResolvedConfig, sql: string, params: string[], format: RowFormat, label: string, preset?: string): Promise<void> {\n const placeholderCount = (sql.match(/\\?/g) ?? []).length;\n if (params.length !== placeholderCount) {\n console.error(`${label} expects ${placeholderCount} parameter(s), got ${params.length}`);\n process.exit(2);\n }\n // Naming a preset and never joining it would return the whole index while reading as scoped,\n // which is the one hazard of binding rather than applying. Refuse instead.\n if (preset !== undefined && !/\\bscope\\b/i.test(sql)) {\n console.error(`--preset binds a temporary \"scope\" table of the preset's paths, and ${label} never joins it, so the preset would have no effect`);\n console.error(`add: JOIN scope ON scope.\"path\" = <table>.\"path\"`);\n process.exit(2);\n }\n const { store, warnings } = await openStore(cfg);\n printWarnings(warnings);\n if (preset !== undefined) await bindScope(store, cfg, preset);\n // Streamed rather than collected: `sql` is the one caller whose result size is the\n // statement's business, not this package's, so the rows are never held here in bulk.\n // columns() reads the statement's own metadata, so a 0-row csv still has its header.\n // A mid-stream SQLite error (e.g. SQLITE_BUSY outlasting busy_timeout) can still leave\n // partial output; the nonzero exit code is the caller's signal, output completeness is not\n // guaranteed on failure.\n try {\n const statement = await store.raw.prepare(sql);\n const columns = statement.columns().map((c) => c.name);\n await printRowStream(statement.iterate(...params) as AsyncIterable<Row>, format, columns);\n } catch (err) {\n const hinted = columnHint(await store.docs.columns(), err as Error); // columns read while the store is still open\n await store.close();\n // A saved query or ad-hoc SQL can carry `content MATCH ?` too, so the same FTS5\n // punctuation trap applies -- the bound parameters are the search terms there. SQL\n // without MATCH gets its error verbatim; search advice on a plain typo would mislead.\n if (/\\bMATCH\\b/i.test(sql)) throw searchError(hinted, params.join(' '));\n throw hinted;\n }\n await store.close();\n}\n"],"names":["CONFIG","FORMAT","SCOPE","SEARCH_FLAGS","formatOf","parse","parseK","printWarnings","rowFormatOf","runSql","scopeOf","withDb","format","type","default","config","where","preset","include","multiple","exclude","k","values","noExclude","pickFormat","allowed","String","includes","console","error","join","process","exit","argv","usage","options","positionals","parseArgs","args","help","short","strict","allowPositionals","err","message","log","usageError","undefined","parsed","Number","isInteger","warnings","w","warn","ctx","configPath","fn","cfg","store","resolveConfig","openStore","close","bindScope","name","insert","resolvePreset","exec","prepare","run","sql","params","label","placeholderCount","statement","columns","hinted","match","length","test","raw","map","c","printRowStream","iterate","docs","columnHint","searchError"],"mappings":";;;;;;;;;;;QAeaA;eAAAA;;QADAC;eAAAA;;QAIAC;eAAAA;;QASAC;eAAAA;;QA0BGC;eAAAA;;QAWAC;eAAAA;;QAyBAC;eAAAA;;QASAC;eAAAA;;QAvCAC;eAAAA;;QAoEMC;eAAAA;;QA7FNC;eAAAA;;QAoEMC;eAAAA;;;wBArGI;uBAEI;4BACH;wBAEI;6BACH;wBAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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