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
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get DUCKDB_PACKAGE () {
|
|
13
|
+
return DUCKDB_PACKAGE;
|
|
14
|
+
},
|
|
15
|
+
get duckdbApi () {
|
|
16
|
+
return duckdbApi;
|
|
17
|
+
},
|
|
18
|
+
get loadOrInstall () {
|
|
19
|
+
return loadOrInstall;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var _nodefs = require("node:fs");
|
|
23
|
+
var _nodemodule = /*#__PURE__*/ _interop_require_default(require("node:module"));
|
|
24
|
+
var _nodepath = require("node:path");
|
|
25
|
+
var _nodeurl = require("node:url");
|
|
26
|
+
var _errorsts = require("../../errors.js");
|
|
27
|
+
function _array_like_to_array(arr, len) {
|
|
28
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
29
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
30
|
+
return arr2;
|
|
31
|
+
}
|
|
32
|
+
function _array_without_holes(arr) {
|
|
33
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
34
|
+
}
|
|
35
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
36
|
+
try {
|
|
37
|
+
var info = gen[key](arg);
|
|
38
|
+
var value = info.value;
|
|
39
|
+
} catch (error) {
|
|
40
|
+
reject(error);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (info.done) resolve(value);
|
|
44
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
45
|
+
}
|
|
46
|
+
function _async_to_generator(fn) {
|
|
47
|
+
return function() {
|
|
48
|
+
var self = this, args = arguments;
|
|
49
|
+
return new Promise(function(resolve, reject) {
|
|
50
|
+
var gen = fn.apply(self, args);
|
|
51
|
+
function _next(value) {
|
|
52
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
53
|
+
}
|
|
54
|
+
function _throw(err) {
|
|
55
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
56
|
+
}
|
|
57
|
+
_next(undefined);
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function _interop_require_default(obj) {
|
|
62
|
+
return obj && obj.__esModule ? obj : {
|
|
63
|
+
default: obj
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
67
|
+
if (typeof WeakMap !== "function") return null;
|
|
68
|
+
var cacheBabelInterop = new WeakMap();
|
|
69
|
+
var cacheNodeInterop = new WeakMap();
|
|
70
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
71
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
72
|
+
})(nodeInterop);
|
|
73
|
+
}
|
|
74
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
75
|
+
if (!nodeInterop && obj && obj.__esModule) return obj;
|
|
76
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") return {
|
|
77
|
+
default: obj
|
|
78
|
+
};
|
|
79
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
80
|
+
if (cache && cache.has(obj)) return cache.get(obj);
|
|
81
|
+
var newObj = {
|
|
82
|
+
__proto__: null
|
|
83
|
+
};
|
|
84
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
85
|
+
for(var key in obj){
|
|
86
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
87
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
88
|
+
if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
|
|
89
|
+
else newObj[key] = obj[key];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
newObj.default = obj;
|
|
93
|
+
if (cache) cache.set(obj, newObj);
|
|
94
|
+
return newObj;
|
|
95
|
+
}
|
|
96
|
+
function _iterable_to_array(iter) {
|
|
97
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
|
|
98
|
+
return Array.from(iter);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function _non_iterable_spread() {
|
|
102
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
103
|
+
}
|
|
104
|
+
function _to_consumable_array(arr) {
|
|
105
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
106
|
+
}
|
|
107
|
+
function _ts_generator(thisArg, body) {
|
|
108
|
+
var f, y, t, _ = {
|
|
109
|
+
label: 0,
|
|
110
|
+
sent: function() {
|
|
111
|
+
if (t[0] & 1) throw t[1];
|
|
112
|
+
return t[1];
|
|
113
|
+
},
|
|
114
|
+
trys: [],
|
|
115
|
+
ops: []
|
|
116
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
117
|
+
return d(g, "next", {
|
|
118
|
+
value: verb(0)
|
|
119
|
+
}), d(g, "throw", {
|
|
120
|
+
value: verb(1)
|
|
121
|
+
}), d(g, "return", {
|
|
122
|
+
value: verb(2)
|
|
123
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
124
|
+
value: function() {
|
|
125
|
+
return this;
|
|
126
|
+
}
|
|
127
|
+
}), g;
|
|
128
|
+
function verb(n) {
|
|
129
|
+
return function(v) {
|
|
130
|
+
return step([
|
|
131
|
+
n,
|
|
132
|
+
v
|
|
133
|
+
]);
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function step(op) {
|
|
137
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
138
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
139
|
+
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;
|
|
140
|
+
if (y = 0, t) op = [
|
|
141
|
+
op[0] & 2,
|
|
142
|
+
t.value
|
|
143
|
+
];
|
|
144
|
+
switch(op[0]){
|
|
145
|
+
case 0:
|
|
146
|
+
case 1:
|
|
147
|
+
t = op;
|
|
148
|
+
break;
|
|
149
|
+
case 4:
|
|
150
|
+
_.label++;
|
|
151
|
+
return {
|
|
152
|
+
value: op[1],
|
|
153
|
+
done: false
|
|
154
|
+
};
|
|
155
|
+
case 5:
|
|
156
|
+
_.label++;
|
|
157
|
+
y = op[1];
|
|
158
|
+
op = [
|
|
159
|
+
0
|
|
160
|
+
];
|
|
161
|
+
continue;
|
|
162
|
+
case 7:
|
|
163
|
+
op = _.ops.pop();
|
|
164
|
+
_.trys.pop();
|
|
165
|
+
continue;
|
|
166
|
+
default:
|
|
167
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
168
|
+
_ = 0;
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
172
|
+
_.label = op[1];
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
176
|
+
_.label = t[1];
|
|
177
|
+
t = op;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
if (t && _.label < t[2]) {
|
|
181
|
+
_.label = t[2];
|
|
182
|
+
_.ops.push(op);
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
if (t[2]) _.ops.pop();
|
|
186
|
+
_.trys.pop();
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
op = body.call(thisArg, _);
|
|
190
|
+
} catch (e) {
|
|
191
|
+
op = [
|
|
192
|
+
6,
|
|
193
|
+
e
|
|
194
|
+
];
|
|
195
|
+
y = 0;
|
|
196
|
+
} finally{
|
|
197
|
+
f = t = 0;
|
|
198
|
+
}
|
|
199
|
+
if (op[0] & 5) throw op[1];
|
|
200
|
+
return {
|
|
201
|
+
value: op[0] ? op[1] : void 0,
|
|
202
|
+
done: true
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
207
|
+
if (!o) return;
|
|
208
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
209
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
210
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
211
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
212
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
213
|
+
}
|
|
214
|
+
var DUCKDB_PACKAGE = '@duckdb/node-api';
|
|
215
|
+
// install-module-linked itself is small, but its target (@duckdb/node-api) is not: deferred the
|
|
216
|
+
// same way embed/static.ts defers @huggingface/tokenizers, so requiring it stays inside the
|
|
217
|
+
// already-gated branch below rather than running for every store/index.ts load.
|
|
218
|
+
var _require = typeof require === 'undefined' ? _nodemodule.default.createRequire(require("url").pathToFileURL(__filename).toString()) : require;
|
|
219
|
+
var _dirname = (0, _nodepath.dirname)(typeof __filename !== 'undefined' ? __filename : (0, _nodeurl.fileURLToPath)(require("url").pathToFileURL(__filename).toString()));
|
|
220
|
+
// Walks up from this file's own directory to find the real package.json, rather than a fixed
|
|
221
|
+
// dot-count from __dirname (xz-compat's `../../node_modules`): `tsds test:node` runs straight
|
|
222
|
+
// off src/, one directory shallower than dist/{cjs,esm}/store/duckdb sits under the built
|
|
223
|
+
// package, so a hardcoded depth is right for one and wrong for the other. Works the same way
|
|
224
|
+
// for a globally-installed `sense`, whose node_modules this resolves to -- never the caller's
|
|
225
|
+
// cwd.
|
|
226
|
+
function packageNodeModules() {
|
|
227
|
+
var dir = _dirname;
|
|
228
|
+
for(;;){
|
|
229
|
+
var candidate = (0, _nodepath.join)(dir, 'package.json');
|
|
230
|
+
if ((0, _nodefs.existsSync)(candidate)) {
|
|
231
|
+
var pkg = JSON.parse((0, _nodefs.readFileSync)(candidate, 'utf8'));
|
|
232
|
+
if (pkg.name === 'sensemaking') return (0, _nodepath.join)(dir, 'node_modules');
|
|
233
|
+
}
|
|
234
|
+
var parent = (0, _nodepath.dirname)(dir);
|
|
235
|
+
if (parent === dir) throw new Error('could not locate the sensemaking package root to install @duckdb/node-api into');
|
|
236
|
+
dir = parent;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
var installing = new Map();
|
|
240
|
+
// De-dupes concurrent installs within this process (see spawn-term's loadInk for the shape).
|
|
241
|
+
// The install here is async -- the load site already awaits a dynamic import -- so a bare
|
|
242
|
+
// attempted flag (xz-compat's `installationAttempted`, enough for its synchronous single-target
|
|
243
|
+
// install) isn't enough on its own; concurrent callers instead await the same in-flight promise,
|
|
244
|
+
// keyed by specifier and target so tests exercising several installs in one process don't share
|
|
245
|
+
// one slot. A failed install is not cached, so a later call retries.
|
|
246
|
+
function installOnce(specifier, nodeModulesPath) {
|
|
247
|
+
var key = "".concat(specifier, "\n").concat(nodeModulesPath);
|
|
248
|
+
var promise = installing.get(key);
|
|
249
|
+
if (!promise) {
|
|
250
|
+
var installModuleLinked = _require('install-module-linked').default;
|
|
251
|
+
promise = installModuleLinked(specifier, nodeModulesPath).then(function() {}, function(err) {
|
|
252
|
+
installing.delete(key);
|
|
253
|
+
throw err;
|
|
254
|
+
});
|
|
255
|
+
installing.set(key, promise);
|
|
256
|
+
}
|
|
257
|
+
return promise;
|
|
258
|
+
}
|
|
259
|
+
// Node caches a bare specifier's package resolution -- including a "not found" miss -- for the
|
|
260
|
+
// life of the process, so retrying `import(importName)` right after installing sees the same
|
|
261
|
+
// stale miss and falls through to a bogus index.js guess instead of the package's real entry
|
|
262
|
+
// (verified against a real global install: the plain-specifier retry failed there, this did
|
|
263
|
+
// not). Reading the freshly-installed package's own package.json and importing its entry file
|
|
264
|
+
// by an absolute file: URL sidesteps that stale cache instead of re-resolving the bare name.
|
|
265
|
+
function resolveEntryUrl(importName, nodeModulesPath) {
|
|
266
|
+
var _pkg_main;
|
|
267
|
+
var pkgDir = _nodepath.join.apply(void 0, [
|
|
268
|
+
nodeModulesPath
|
|
269
|
+
].concat(_to_consumable_array(importName.split('/'))));
|
|
270
|
+
var pkg = JSON.parse((0, _nodefs.readFileSync)((0, _nodepath.join)(pkgDir, 'package.json'), 'utf8'));
|
|
271
|
+
var entry = typeof pkg.exports === 'string' ? pkg.exports : (_pkg_main = pkg.main) !== null && _pkg_main !== void 0 ? _pkg_main : 'index.js';
|
|
272
|
+
return (0, _nodeurl.pathToFileURL)((0, _nodepath.join)(pkgDir, entry)).href;
|
|
273
|
+
}
|
|
274
|
+
function loadOrInstall(importName, nodeModulesPath) {
|
|
275
|
+
return _async_to_generator(function() {
|
|
276
|
+
var unused, installErr, loadErr;
|
|
277
|
+
return _ts_generator(this, function(_state) {
|
|
278
|
+
switch(_state.label){
|
|
279
|
+
case 0:
|
|
280
|
+
_state.trys.push([
|
|
281
|
+
0,
|
|
282
|
+
2,
|
|
283
|
+
,
|
|
284
|
+
10
|
|
285
|
+
]);
|
|
286
|
+
return [
|
|
287
|
+
4,
|
|
288
|
+
Promise.resolve(importName).then(function(p) {
|
|
289
|
+
return /*#__PURE__*/ _interop_require_wildcard(require(p));
|
|
290
|
+
})
|
|
291
|
+
];
|
|
292
|
+
case 1:
|
|
293
|
+
return [
|
|
294
|
+
2,
|
|
295
|
+
_state.sent()
|
|
296
|
+
];
|
|
297
|
+
case 2:
|
|
298
|
+
unused = _state.sent();
|
|
299
|
+
console.error('sense: store "duckdb" needs '.concat(DUCKDB_PACKAGE, "; installing it now (one-time download, ~110MB)..."));
|
|
300
|
+
_state.label = 3;
|
|
301
|
+
case 3:
|
|
302
|
+
_state.trys.push([
|
|
303
|
+
3,
|
|
304
|
+
5,
|
|
305
|
+
,
|
|
306
|
+
6
|
|
307
|
+
]);
|
|
308
|
+
return [
|
|
309
|
+
4,
|
|
310
|
+
installOnce(importName, nodeModulesPath)
|
|
311
|
+
];
|
|
312
|
+
case 4:
|
|
313
|
+
_state.sent();
|
|
314
|
+
return [
|
|
315
|
+
3,
|
|
316
|
+
6
|
|
317
|
+
];
|
|
318
|
+
case 5:
|
|
319
|
+
installErr = _state.sent();
|
|
320
|
+
throw new _errorsts.SenseError('STORE_DEPENDENCY_MISSING', 'store "duckdb" needs '.concat(DUCKDB_PACKAGE, ", and installing it automatically failed (").concat(installErr.message, "); this can happen offline, in a sandboxed environment, or when node_modules is read-only or owned by another user (e.g. under a global install) -- run `npm install ").concat(DUCKDB_PACKAGE, "` yourself and try again"));
|
|
321
|
+
case 6:
|
|
322
|
+
_state.trys.push([
|
|
323
|
+
6,
|
|
324
|
+
8,
|
|
325
|
+
,
|
|
326
|
+
9
|
|
327
|
+
]);
|
|
328
|
+
return [
|
|
329
|
+
4,
|
|
330
|
+
Promise.resolve(resolveEntryUrl(importName, nodeModulesPath)).then(function(p) {
|
|
331
|
+
return /*#__PURE__*/ _interop_require_wildcard(require(p));
|
|
332
|
+
})
|
|
333
|
+
];
|
|
334
|
+
case 7:
|
|
335
|
+
return [
|
|
336
|
+
2,
|
|
337
|
+
_state.sent()
|
|
338
|
+
];
|
|
339
|
+
case 8:
|
|
340
|
+
loadErr = _state.sent();
|
|
341
|
+
throw new _errorsts.SenseError('STORE_DEPENDENCY_MISSING', 'store "duckdb" installed '.concat(DUCKDB_PACKAGE, " but it could not be loaded (").concat(loadErr.message, "); it may not be available for this platform (").concat(process.platform, "-").concat(process.arch, ") -- run `npm install ").concat(DUCKDB_PACKAGE, "` to see the underlying error"));
|
|
342
|
+
case 9:
|
|
343
|
+
return [
|
|
344
|
+
3,
|
|
345
|
+
10
|
|
346
|
+
];
|
|
347
|
+
case 10:
|
|
348
|
+
return [
|
|
349
|
+
2
|
|
350
|
+
];
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
})();
|
|
354
|
+
}
|
|
355
|
+
var duckdbApiPromise;
|
|
356
|
+
function duckdbApi() {
|
|
357
|
+
if (!duckdbApiPromise) duckdbApiPromise = loadOrInstall(DUCKDB_PACKAGE, packageNodeModules());
|
|
358
|
+
return duckdbApiPromise;
|
|
359
|
+
}
|
|
360
|
+
/* 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; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/ai/sensemaking/src/store/duckdb/native.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport Module from 'node:module';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport { SenseError } from '../../errors.ts';\n\nexport const DUCKDB_PACKAGE = '@duckdb/node-api';\n\n// install-module-linked itself is small, but its target (@duckdb/node-api) is not: deferred the\n// same way embed/static.ts defers @huggingface/tokenizers, so requiring it stays inside the\n// already-gated branch below rather than running for every store/index.ts load.\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\nconst _dirname = dirname(typeof __filename !== 'undefined' ? __filename : fileURLToPath(import.meta.url));\n\n// Walks up from this file's own directory to find the real package.json, rather than a fixed\n// dot-count from __dirname (xz-compat's `../../node_modules`): `tsds test:node` runs straight\n// off src/, one directory shallower than dist/{cjs,esm}/store/duckdb sits under the built\n// package, so a hardcoded depth is right for one and wrong for the other. Works the same way\n// for a globally-installed `sense`, whose node_modules this resolves to -- never the caller's\n// cwd.\nfunction packageNodeModules(): string {\n let dir = _dirname;\n for (;;) {\n const candidate = join(dir, 'package.json');\n if (existsSync(candidate)) {\n const pkg = JSON.parse(readFileSync(candidate, 'utf8')) as { name?: string };\n if (pkg.name === 'sensemaking') return join(dir, 'node_modules');\n }\n const parent = dirname(dir);\n if (parent === dir) throw new Error('could not locate the sensemaking package root to install @duckdb/node-api into');\n dir = parent;\n }\n}\n\nconst installing = new Map<string, Promise<void>>();\n\n// De-dupes concurrent installs within this process (see spawn-term's loadInk for the shape).\n// The install here is async -- the load site already awaits a dynamic import -- so a bare\n// attempted flag (xz-compat's `installationAttempted`, enough for its synchronous single-target\n// install) isn't enough on its own; concurrent callers instead await the same in-flight promise,\n// keyed by specifier and target so tests exercising several installs in one process don't share\n// one slot. A failed install is not cached, so a later call retries.\nfunction installOnce(specifier: string, nodeModulesPath: string): Promise<void> {\n const key = `${specifier}\\n${nodeModulesPath}`;\n let promise = installing.get(key);\n if (!promise) {\n const installModuleLinked = (_require('install-module-linked') as { default: (specifier: string, nodeModulesPath: string) => Promise<string> }).default;\n promise = installModuleLinked(specifier, nodeModulesPath).then(\n () => {},\n (err) => {\n installing.delete(key);\n throw err;\n }\n );\n installing.set(key, promise);\n }\n return promise;\n}\n\n// Node caches a bare specifier's package resolution -- including a \"not found\" miss -- for the\n// life of the process, so retrying `import(importName)` right after installing sees the same\n// stale miss and falls through to a bogus index.js guess instead of the package's real entry\n// (verified against a real global install: the plain-specifier retry failed there, this did\n// not). Reading the freshly-installed package's own package.json and importing its entry file\n// by an absolute file: URL sidesteps that stale cache instead of re-resolving the bare name.\nfunction resolveEntryUrl(importName: string, nodeModulesPath: string): string {\n const pkgDir = join(nodeModulesPath, ...importName.split('/'));\n const pkg = JSON.parse(readFileSync(join(pkgDir, 'package.json'), 'utf8')) as { main?: string; exports?: string };\n const entry = typeof pkg.exports === 'string' ? pkg.exports : (pkg.main ?? 'index.js');\n return pathToFileURL(join(pkgDir, entry)).href;\n}\n\n// Import-then-install-then-retry, over an injectable target so the failure path (import AND\n// install both fail) can be exercised for real in tests without downloading @duckdb/node-api's\n// real ~110MB native binding. Production always passes @duckdb/node-api's own name; the thrown\n// error names @duckdb/node-api regardless, since that is what a real user needs to install.\nexport async function loadOrInstall<T>(importName: string, nodeModulesPath: string): Promise<T> {\n try {\n return (await import(importName)) as T;\n } catch {\n console.error(`sense: store \"duckdb\" needs ${DUCKDB_PACKAGE}; installing it now (one-time download, ~110MB)...`);\n try {\n await installOnce(importName, nodeModulesPath);\n } catch (installErr) {\n throw new SenseError(\n 'STORE_DEPENDENCY_MISSING',\n `store \"duckdb\" needs ${DUCKDB_PACKAGE}, and installing it automatically failed (${(installErr as Error).message}); this can happen offline, in a sandboxed environment, or when node_modules is read-only or owned by another user (e.g. under a global install) -- run \\`npm install ${DUCKDB_PACKAGE}\\` yourself and try again`\n );\n }\n try {\n return (await import(resolveEntryUrl(importName, nodeModulesPath))) as T;\n } catch (loadErr) {\n throw new SenseError('STORE_DEPENDENCY_MISSING', `store \"duckdb\" installed ${DUCKDB_PACKAGE} but it could not be loaded (${(loadErr as Error).message}); it may not be available for this platform (${process.platform}-${process.arch}) -- run \\`npm install ${DUCKDB_PACKAGE}\\` to see the underlying error`);\n }\n }\n}\n\nlet duckdbApiPromise: Promise<typeof import('@duckdb/node-api')> | undefined;\n\n// The one accessor every consumer of @duckdb/node-api (open.ts, sql-functions.ts, vectors.ts)\n// must go through, rather than each doing its own `import('@duckdb/node-api')`: once a fresh\n// install has happened in this process, Node keeps returning that pre-install \"not found\" miss\n// to any NEW bare-specifier lookup of the same path, so a second independent import elsewhere\n// in the process fails even though the package is now genuinely on disk (the same stale-cache\n// problem loadOrInstall works around for its own retry). Caching the resolved module here means\n// only the first caller ever resolves the bare specifier at all.\nexport function duckdbApi(): Promise<typeof import('@duckdb/node-api')> {\n if (!duckdbApiPromise) duckdbApiPromise = loadOrInstall<typeof import('@duckdb/node-api')>(DUCKDB_PACKAGE, packageNodeModules());\n return duckdbApiPromise;\n}\n"],"names":["DUCKDB_PACKAGE","duckdbApi","loadOrInstall","_require","require","Module","createRequire","_dirname","dirname","__filename","fileURLToPath","packageNodeModules","dir","candidate","join","existsSync","pkg","JSON","parse","readFileSync","name","parent","Error","installing","Map","installOnce","specifier","nodeModulesPath","key","promise","get","installModuleLinked","default","then","err","delete","set","resolveEntryUrl","importName","pkgDir","split","entry","exports","main","pathToFileURL","href","installErr","loadErr","console","error","SenseError","message","process","platform","arch","duckdbApiPromise"],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ResolvedConfig } from '../../config/index.js';
|
|
2
|
+
import type { Store } from '../types.js';
|
|
3
|
+
export declare const DB_FILENAME = "cache.duckdb";
|
|
4
|
+
export declare const SCHEMA_VERSION = "2";
|
|
5
|
+
export interface OpenResult {
|
|
6
|
+
store: Store;
|
|
7
|
+
cfg: ResolvedConfig;
|
|
8
|
+
dbPath: string;
|
|
9
|
+
parsed: number;
|
|
10
|
+
warnings: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function openDuckdb(cfg: ResolvedConfig): Promise<OpenResult>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ResolvedConfig } from '../../config/index.js';
|
|
2
|
+
import type { Store } from '../types.js';
|
|
3
|
+
export declare const DB_FILENAME = "cache.duckdb";
|
|
4
|
+
export declare const SCHEMA_VERSION = "2";
|
|
5
|
+
export interface OpenResult {
|
|
6
|
+
store: Store;
|
|
7
|
+
cfg: ResolvedConfig;
|
|
8
|
+
dbPath: string;
|
|
9
|
+
parsed: number;
|
|
10
|
+
warnings: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function openDuckdb(cfg: ResolvedConfig): Promise<OpenResult>;
|