@hasna/logs 0.3.25 → 0.3.27

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 (132) hide show
  1. package/README.md +33 -10
  2. package/dashboard/dist/assets/index-C0wZYq1m.js +53 -0
  3. package/dashboard/dist/assets/index-DGNrK5qb.css +1 -0
  4. package/dashboard/dist/index.html +14 -0
  5. package/dist/cli/index.js +8511 -177
  6. package/dist/count-bmj4r2zb.js +10 -0
  7. package/dist/{diagnose-e0w5rwbc.js → diagnose-3q5cy9ra.js} +2 -2
  8. package/dist/{export-c3eqjste.js → export-cngdb9fh.js} +1 -1
  9. package/dist/{http-zm3ph78w.js → http-r0xc3d2s.js} +79 -8
  10. package/dist/index-931pbyn5.js +141 -0
  11. package/dist/index-b5c72f1p.js +7 -0
  12. package/dist/{index-p1vgwwsz.js → index-bnr19y0h.js} +596 -37
  13. package/dist/{index-7w7v7hnr.js → index-by1pdzbr.js} +14 -5
  14. package/dist/{index-3dr7d80h.js → index-e1930v9b.js} +12 -8
  15. package/dist/{index-eh9bkbpa.js → index-e72k53yq.js} +10 -2
  16. package/dist/{index-edn08m6f.js → index-gcd14q2f.js} +9 -6
  17. package/dist/index-hq6kzaah.js +26 -0
  18. package/dist/index-j34f36wy.js +5672 -0
  19. package/dist/index-p4dbdzx4.js +1849 -0
  20. package/dist/{index-5qznfyah.js → index-q27bgpr1.js} +1086 -1646
  21. package/dist/index-t3x838zw.js +2583 -0
  22. package/dist/{index-ww5ggfv3.js → index-zkb3z95a.js} +12 -9
  23. package/dist/index.js +2982 -22
  24. package/dist/{jobs-ypmmc2ma.js → jobs-hsgyhfvm.js} +2 -1
  25. package/dist/mcp/index.js +1473 -4286
  26. package/dist/{query-7jwj05er.js → query-c5a43zx3.js} +3 -2
  27. package/dist/server/index.js +2944 -417
  28. package/dist/storage.js +50 -0
  29. package/package.json +27 -8
  30. package/biome.json +0 -13
  31. package/bun.lock +0 -376
  32. package/dashboard/README.md +0 -73
  33. package/dashboard/bun.lock +0 -526
  34. package/dashboard/eslint.config.js +0 -23
  35. package/dashboard/index.html +0 -13
  36. package/dashboard/package.json +0 -32
  37. package/dashboard/src/App.css +0 -184
  38. package/dashboard/src/App.tsx +0 -49
  39. package/dashboard/src/api.ts +0 -33
  40. package/dashboard/src/assets/hero.png +0 -0
  41. package/dashboard/src/assets/react.svg +0 -1
  42. package/dashboard/src/assets/vite.svg +0 -1
  43. package/dashboard/src/index.css +0 -111
  44. package/dashboard/src/main.tsx +0 -10
  45. package/dashboard/src/pages/Alerts.tsx +0 -69
  46. package/dashboard/src/pages/Issues.tsx +0 -50
  47. package/dashboard/src/pages/Perf.tsx +0 -75
  48. package/dashboard/src/pages/Projects.tsx +0 -67
  49. package/dashboard/src/pages/Summary.tsx +0 -67
  50. package/dashboard/src/pages/Tail.tsx +0 -65
  51. package/dashboard/tsconfig.app.json +0 -28
  52. package/dashboard/tsconfig.json +0 -7
  53. package/dashboard/tsconfig.node.json +0 -26
  54. package/dashboard/vite.config.ts +0 -14
  55. package/dist/count-x3n7qg3c.js +0 -9
  56. package/dist/index-5cj74qka.js +0 -10803
  57. package/dist/index-997bkzr2.js +0 -15
  58. package/dist/index-kezb178p.js +0 -1241
  59. package/dist/index-pen6t0yc.js +0 -10794
  60. package/sdk/package.json +0 -27
  61. package/sdk/src/index.ts +0 -143
  62. package/sdk/src/types.ts +0 -56
  63. package/src/cli/entrypoints.test.ts +0 -63
  64. package/src/cli/index.ts +0 -471
  65. package/src/db/index.test.ts +0 -33
  66. package/src/db/index.ts +0 -189
  67. package/src/db/migrations/001_alert_rules.ts +0 -21
  68. package/src/db/migrations/002_issues.ts +0 -21
  69. package/src/db/migrations/003_retention.ts +0 -15
  70. package/src/db/migrations/004_page_auth.ts +0 -13
  71. package/src/db/pg-migrations.ts +0 -167
  72. package/src/index.ts +0 -1
  73. package/src/lib/alerts.test.ts +0 -67
  74. package/src/lib/alerts.ts +0 -117
  75. package/src/lib/browser-script.test.ts +0 -35
  76. package/src/lib/browser-script.ts +0 -31
  77. package/src/lib/compare.test.ts +0 -52
  78. package/src/lib/compare.ts +0 -85
  79. package/src/lib/count.test.ts +0 -44
  80. package/src/lib/count.ts +0 -55
  81. package/src/lib/diagnose.test.ts +0 -55
  82. package/src/lib/diagnose.ts +0 -91
  83. package/src/lib/export.test.ts +0 -66
  84. package/src/lib/export.ts +0 -65
  85. package/src/lib/github.ts +0 -38
  86. package/src/lib/health.test.ts +0 -48
  87. package/src/lib/health.ts +0 -51
  88. package/src/lib/ingest.test.ts +0 -57
  89. package/src/lib/ingest.ts +0 -78
  90. package/src/lib/issues.test.ts +0 -79
  91. package/src/lib/issues.ts +0 -70
  92. package/src/lib/jobs.test.ts +0 -69
  93. package/src/lib/jobs.ts +0 -63
  94. package/src/lib/lighthouse.ts +0 -65
  95. package/src/lib/package-meta.test.ts +0 -43
  96. package/src/lib/package-meta.ts +0 -80
  97. package/src/lib/page-auth.test.ts +0 -54
  98. package/src/lib/page-auth.ts +0 -48
  99. package/src/lib/parse-time.test.ts +0 -37
  100. package/src/lib/parse-time.ts +0 -14
  101. package/src/lib/perf.test.ts +0 -45
  102. package/src/lib/perf.ts +0 -46
  103. package/src/lib/projects.test.ts +0 -73
  104. package/src/lib/projects.ts +0 -69
  105. package/src/lib/query.test.ts +0 -104
  106. package/src/lib/query.ts +0 -84
  107. package/src/lib/retention.test.ts +0 -42
  108. package/src/lib/retention.ts +0 -62
  109. package/src/lib/rotate.test.ts +0 -37
  110. package/src/lib/rotate.ts +0 -27
  111. package/src/lib/scanner.ts +0 -131
  112. package/src/lib/scheduler.ts +0 -63
  113. package/src/lib/session-context.ts +0 -28
  114. package/src/lib/summarize.test.ts +0 -38
  115. package/src/lib/summarize.ts +0 -23
  116. package/src/mcp/http.test.ts +0 -92
  117. package/src/mcp/http.ts +0 -135
  118. package/src/mcp/index.test.ts +0 -27
  119. package/src/mcp/index.ts +0 -444
  120. package/src/server/index.ts +0 -61
  121. package/src/server/routes/alerts.ts +0 -32
  122. package/src/server/routes/issues.ts +0 -43
  123. package/src/server/routes/jobs.ts +0 -32
  124. package/src/server/routes/logs.ts +0 -113
  125. package/src/server/routes/perf.ts +0 -23
  126. package/src/server/routes/projects.ts +0 -67
  127. package/src/server/routes/stream.ts +0 -43
  128. package/src/server/server.test.ts +0 -194
  129. package/src/types/index.ts +0 -119
  130. package/tsconfig.json +0 -22
  131. /package/dashboard/{public → dist}/favicon.svg +0 -0
  132. /package/dashboard/{public → dist}/icons.svg +0 -0
package/README.md CHANGED
@@ -21,6 +21,8 @@ logs --help
21
21
  - `logs tail`
22
22
  - `logs summary`
23
23
  - `logs push`
24
+ - `logs events`
25
+ - `logs test-reports`
24
26
  - `logs scan`
25
27
  - `logs diagnose`
26
28
 
@@ -30,20 +32,20 @@ logs --help
30
32
  logs-mcp
31
33
  ```
32
34
 
33
- 6 tools available.
35
+ Includes log search, raw event search/watch/export, projected test-report search/get, storage sync, scan, issue, and performance tools.
34
36
 
35
37
  ## HTTP mode
36
38
 
37
39
  Run a shared Streamable HTTP MCP server (127.0.0.1 only):
38
40
 
39
41
  ```bash
40
- logs-mcp --http # default port 8820
41
- logs-mcp --http --port 8820
42
+ logs-mcp --http # default port 8864
43
+ logs-mcp --http --port 8864
42
44
  MCP_HTTP=1 logs-mcp
43
45
  ```
44
46
 
45
- - Health: `GET http://127.0.0.1:8820/health`
46
- - MCP: `POST http://127.0.0.1:8820/mcp`
47
+ - Health: `GET http://127.0.0.1:8864/health`
48
+ - MCP: `POST http://127.0.0.1:8864/mcp`
47
49
 
48
50
  Stdio remains the default when no `--http` flag is passed.
49
51
 
@@ -53,16 +55,37 @@ Stdio remains the default when no `--http` flag is passed.
53
55
  logs-serve
54
56
  ```
55
57
 
56
- ## Cloud Sync
58
+ By default the API is locked unless an API token is configured or trusted
59
+ loopback mode is explicitly enabled:
57
60
 
58
- This package supports cloud sync via `@hasna/cloud`:
61
+ ```bash
62
+ HASNA_LOGS_API_TOKEN="$(openssl rand -hex 32)" logs-serve
63
+ # or, for local-only development:
64
+ logs-serve --local-open
65
+ ```
66
+
67
+ Use `Authorization: Bearer <token>` or `X-Logs-Token: <token>` for `/api/*`
68
+ requests. Browser ingest tokens remain scoped write-only tokens for browser
69
+ capture and do not grant general API access.
70
+
71
+ Page scanner credentials are encrypted at rest with a generated local
72
+ `page-auth.key` under the logs data directory. For deployments that need a
73
+ managed secret, set `HASNA_LOGS_SECRET_KEY` or `LOGS_SECRET_KEY`:
59
74
 
60
75
  ```bash
61
- cloud setup
62
- cloud sync push --service logs
63
- cloud sync pull --service logs
76
+ export HASNA_LOGS_SECRET_KEY="$(openssl rand -hex 32)"
64
77
  ```
65
78
 
79
+ ## Remote Sync
80
+
81
+ Logs stores data locally in SQLite and can optionally push/pull service-owned tables to PostgreSQL, including AWS RDS:
82
+
83
+ Configure `HASNA_LOGS_DATABASE_URL` or `LOGS_DATABASE_URL`, then use `logs storage status`, `logs storage push`, `logs storage pull`, or `logs storage sync`.
84
+
85
+ The MCP server also exposes `storage_status`, `storage_push`, `storage_pull`, and `storage_sync`.
86
+
87
+ `LOGS_DATABASE_URL` is accepted as the non-Hasna fallback database URL.
88
+
66
89
  ## Data Directory
67
90
 
68
91
  Data is stored in `~/.hasna/logs/`.