@topgunbuild/server 0.10.0 → 0.10.1

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 (38) hide show
  1. package/README.md +64 -0
  2. package/dist/BetterSqlite3Adapter-LUMODVC3.mjs +10 -0
  3. package/dist/BetterSqlite3Adapter-LUMODVC3.mjs.map +1 -0
  4. package/dist/chunk-5CZA6O2S.mjs +782 -0
  5. package/dist/chunk-5CZA6O2S.mjs.map +1 -0
  6. package/dist/chunk-73CP5EN6.mjs +227 -0
  7. package/dist/chunk-73CP5EN6.mjs.map +1 -0
  8. package/dist/chunk-FJ6ZGZIA.mjs +43 -0
  9. package/dist/chunk-FJ6ZGZIA.mjs.map +1 -0
  10. package/dist/chunk-IQNKZPW3.mjs +31660 -0
  11. package/dist/chunk-IQNKZPW3.mjs.map +1 -0
  12. package/dist/chunk-ZTICMRY6.mjs +7 -0
  13. package/dist/chunk-ZTICMRY6.mjs.map +1 -0
  14. package/dist/index.d.mts +5951 -1969
  15. package/dist/index.d.ts +5951 -1969
  16. package/dist/index.js +31309 -13744
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +519 -15487
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/lib-ZCWT55TO.mjs +6 -0
  21. package/dist/lib-ZCWT55TO.mjs.map +1 -0
  22. package/dist/start-server.d.mts +2 -0
  23. package/dist/start-server.d.ts +2 -0
  24. package/dist/start-server.js +31751 -0
  25. package/dist/start-server.js.map +1 -0
  26. package/dist/start-server.mjs +112 -0
  27. package/dist/start-server.mjs.map +1 -0
  28. package/dist/workers/worker-scripts/base.worker.js +477 -0
  29. package/dist/workers/worker-scripts/base.worker.js.map +1 -0
  30. package/dist/workers/worker-scripts/crdt.worker.js +452 -0
  31. package/dist/workers/worker-scripts/crdt.worker.js.map +1 -0
  32. package/dist/workers/worker-scripts/merkle.worker.js +452 -0
  33. package/dist/workers/worker-scripts/merkle.worker.js.map +1 -0
  34. package/dist/workers/worker-scripts/serialization.worker.js +452 -0
  35. package/dist/workers/worker-scripts/serialization.worker.js.map +1 -0
  36. package/dist/workers/worker-scripts/test.worker.js +452 -0
  37. package/dist/workers/worker-scripts/test.worker.js.map +1 -0
  38. package/package.json +6 -3
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # @topgunbuild/server
2
+
3
+ WebSocket server for TopGun with clustering, PostgreSQL adapter, and real-time sync.
4
+
5
+ ## Security
6
+
7
+ ### Debug Endpoints
8
+
9
+ Debug endpoints expose internal CRDT state, operation history, search statistics, and conflict resolution details. **These endpoints should NEVER be enabled in production environments.**
10
+
11
+ #### Available Debug Endpoints
12
+
13
+ | Endpoint | Method | Exposed Data |
14
+ |----------|--------|--------------|
15
+ | `/debug/crdt/export` | POST | Complete CRDT operation history (JSON/CSV/NDJSON) |
16
+ | `/debug/crdt/stats` | POST | CRDT statistics (operation counts, conflict rates) |
17
+ | `/debug/crdt/conflicts` | POST | Resolved conflicts with timestamps and values |
18
+ | `/debug/crdt/operations` | POST | Queryable operation log (by map, node, type) |
19
+ | `/debug/crdt/timeline` | POST | Time-series data of CRDT operations |
20
+ | `/debug/search/explain` | POST | Search query execution plans and debug info |
21
+ | `/debug/search/stats` | GET | Search performance statistics |
22
+ | `/debug/search/history` | POST | Historical search queries and results |
23
+
24
+ #### Security Implications
25
+
26
+ These endpoints:
27
+
28
+ - **Expose internal state** - Complete operation history reveals all data changes
29
+ - **Leak sensitive information** - Conflict resolution shows concurrent writes and their values
30
+ - **Enable timing attacks** - Statistics reveal usage patterns
31
+ - **No authentication** - Endpoints are unprotected when enabled
32
+
33
+ #### Configuration
34
+
35
+ Debug endpoints are controlled by the `TOPGUN_DEBUG_ENDPOINTS` environment variable:
36
+
37
+ ```bash
38
+ # Disable debug endpoints (RECOMMENDED for production)
39
+ TOPGUN_DEBUG_ENDPOINTS=false
40
+
41
+ # Enable debug endpoints (ONLY for development/debugging)
42
+ TOPGUN_DEBUG_ENDPOINTS=true
43
+ ```
44
+
45
+ **Default:** `false`
46
+
47
+ When enabled, the server emits a warning log at startup listing all exposed endpoints.
48
+
49
+ #### Note on TOPGUN_DEBUG
50
+
51
+ The `TOPGUN_DEBUG` environment variable controls general debug logging and does NOT enable debug endpoints. The two variables are intentionally separate to prevent accidental exposure in production.
52
+
53
+ ### Health Endpoints
54
+
55
+ The following endpoints are always enabled and safe for production:
56
+
57
+ - `GET /health` - Returns `{"status": "ok", "timestamp": "..."}`
58
+ - `GET /ready` - Returns `{"ready": true}`
59
+
60
+ These endpoints do not expose sensitive information.
61
+
62
+ ## License
63
+
64
+ MIT
@@ -0,0 +1,10 @@
1
+ import {
2
+ BetterSqlite3Adapter
3
+ } from "./chunk-73CP5EN6.mjs";
4
+ import "./chunk-ZTICMRY6.mjs";
5
+ import "./chunk-5CZA6O2S.mjs";
6
+ import "./chunk-FJ6ZGZIA.mjs";
7
+ export {
8
+ BetterSqlite3Adapter
9
+ };
10
+ //# sourceMappingURL=BetterSqlite3Adapter-LUMODVC3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}