pluresdb 1.0.1 → 1.3.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.
Files changed (79) hide show
  1. package/README.md +100 -5
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/better-sqlite3-shared.d.ts +12 -0
  4. package/dist/better-sqlite3-shared.d.ts.map +1 -0
  5. package/dist/better-sqlite3-shared.js +143 -0
  6. package/dist/better-sqlite3-shared.js.map +1 -0
  7. package/dist/better-sqlite3.d.ts +4 -0
  8. package/dist/better-sqlite3.d.ts.map +1 -0
  9. package/dist/better-sqlite3.js +8 -0
  10. package/dist/better-sqlite3.js.map +1 -0
  11. package/dist/cli.d.ts.map +1 -1
  12. package/dist/cli.js +21 -16
  13. package/dist/cli.js.map +1 -1
  14. package/dist/node-index.d.ts +98 -2
  15. package/dist/node-index.d.ts.map +1 -1
  16. package/dist/node-index.js +312 -6
  17. package/dist/node-index.js.map +1 -1
  18. package/dist/node-wrapper.d.ts.map +1 -1
  19. package/dist/node-wrapper.js +5 -3
  20. package/dist/node-wrapper.js.map +1 -1
  21. package/dist/types/index.d.ts.map +1 -1
  22. package/dist/types/index.js.map +1 -1
  23. package/dist/types/node-types.d.ts +12 -0
  24. package/dist/types/node-types.d.ts.map +1 -1
  25. package/dist/types/node-types.js.map +1 -1
  26. package/dist/vscode/extension.d.ts.map +1 -1
  27. package/dist/vscode/extension.js +4 -4
  28. package/dist/vscode/extension.js.map +1 -1
  29. package/examples/basic-usage.d.ts +1 -1
  30. package/examples/vscode-extension-example/src/extension.ts +15 -6
  31. package/examples/vscode-extension-integration.d.ts +24 -17
  32. package/examples/vscode-extension-integration.js +140 -106
  33. package/examples/vscode-extension-integration.ts +1 -1
  34. package/{src → legacy}/benchmarks/memory-benchmarks.ts +85 -51
  35. package/{src → legacy}/benchmarks/run-benchmarks.ts +32 -10
  36. package/legacy/better-sqlite3-shared.ts +157 -0
  37. package/legacy/better-sqlite3.ts +4 -0
  38. package/{src → legacy}/cli.ts +14 -4
  39. package/{src → legacy}/config.ts +2 -1
  40. package/{src → legacy}/core/crdt.ts +4 -1
  41. package/{src → legacy}/core/database.ts +57 -22
  42. package/{src → legacy}/healthcheck.ts +11 -5
  43. package/{src → legacy}/http/api-server.ts +125 -21
  44. package/{src → legacy}/index.ts +2 -2
  45. package/{src → legacy}/logic/rules.ts +3 -1
  46. package/{src → legacy}/main.ts +11 -4
  47. package/legacy/node-index.ts +823 -0
  48. package/{src → legacy}/node-wrapper.ts +18 -9
  49. package/{src → legacy}/sqlite-compat.ts +63 -16
  50. package/{src → legacy}/sqlite3-compat.ts +2 -2
  51. package/{src → legacy}/storage/kv-storage.ts +3 -1
  52. package/{src → legacy}/tests/core.test.ts +37 -13
  53. package/{src → legacy}/tests/fixtures/test-data.json +6 -1
  54. package/{src → legacy}/tests/integration/api-server.test.ts +110 -8
  55. package/{src → legacy}/tests/integration/mesh-network.test.ts +8 -2
  56. package/{src → legacy}/tests/logic.test.ts +6 -2
  57. package/{src → legacy}/tests/performance/load.test.ts +4 -2
  58. package/{src → legacy}/tests/security/input-validation.test.ts +5 -1
  59. package/{src → legacy}/tests/unit/core.test.ts +13 -3
  60. package/{src → legacy}/tests/unit/subscriptions.test.ts +1 -1
  61. package/{src → legacy}/tests/vscode_extension_test.ts +39 -11
  62. package/{src → legacy}/types/node-types.ts +14 -0
  63. package/{src → legacy}/vscode/extension.ts +37 -14
  64. package/package.json +19 -9
  65. package/scripts/compiled-crud-verify.ts +3 -1
  66. package/scripts/dogfood.ts +55 -16
  67. package/scripts/postinstall.js +4 -3
  68. package/scripts/release-check.js +190 -0
  69. package/scripts/run-tests.ts +5 -2
  70. package/scripts/update-changelog.js +214 -0
  71. package/web/svelte/package.json +5 -5
  72. package/src/node-index.ts +0 -385
  73. /package/{src → legacy}/main.rs +0 -0
  74. /package/{src → legacy}/network/websocket-server.ts +0 -0
  75. /package/{src → legacy}/tests/fixtures/performance-data.json +0 -0
  76. /package/{src → legacy}/tests/unit/vector-search.test.ts +0 -0
  77. /package/{src → legacy}/types/index.ts +0 -0
  78. /package/{src → legacy}/util/debug.ts +0 -0
  79. /package/{src → legacy}/vector/index.ts +0 -0
@@ -3,7 +3,9 @@ import type { NodeRecord } from "../types/index.ts";
3
3
  // Minimal DB interface to avoid circular imports
4
4
  export interface DatabaseLike {
5
5
  put(id: string, data: Record<string, unknown>): Promise<void>;
6
- get<T = Record<string, unknown>>(id: string): Promise<(T & { id: string }) | null>;
6
+ get<T = Record<string, unknown>>(
7
+ id: string,
8
+ ): Promise<(T & { id: string }) | null>;
7
9
  }
8
10
 
9
11
  export interface RuleContext {
@@ -1,5 +1,5 @@
1
1
  import { GunDB } from "./core/database.ts";
2
- import { debugLog } from "./util/debug.ts";
2
+ import { debugLog as _debugLog } from "./util/debug.ts";
3
3
  import { startApiServer } from "./http/api-server.ts";
4
4
  import { loadConfig, saveConfig } from "./config.ts";
5
5
 
@@ -118,7 +118,9 @@ if (import.meta.main) {
118
118
  const db = new GunDB();
119
119
  await db.ready(kvPath);
120
120
  const results = await db.vectorSearch(query, k);
121
- console.log(JSON.stringify(results.map((n) => ({ id: n.id, data: n.data }))));
121
+ console.log(
122
+ JSON.stringify(results.map((n) => ({ id: n.id, data: n.data }))),
123
+ );
122
124
  await db.close();
123
125
  break;
124
126
  }
@@ -150,7 +152,9 @@ if (import.meta.main) {
150
152
  const db = new GunDB();
151
153
  await db.ready(kvPath);
152
154
  const rows = await db.instancesOf(typeName);
153
- console.log(JSON.stringify(rows.map((n) => ({ id: n.id, data: n.data }))));
155
+ console.log(
156
+ JSON.stringify(rows.map((n) => ({ id: n.id, data: n.data }))),
157
+ );
154
158
  await db.close();
155
159
  break;
156
160
  }
@@ -162,7 +166,10 @@ if (import.meta.main) {
162
166
  const db = new GunDB();
163
167
  await db.ready(kvPath);
164
168
  const nodes = await db.getAll();
165
- const out = nodes.map((node) => ({ id: node.id, data: node.data as Record<string, unknown> }));
169
+ const out = nodes.map((node) => ({
170
+ id: node.id,
171
+ data: node.data as Record<string, unknown>,
172
+ }));
166
173
  console.log(JSON.stringify(out));
167
174
  await db.close();
168
175
  break;