@adonis-agora/telescope 0.4.0 → 0.5.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 (198) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/configure.d.ts.map +1 -1
  3. package/dist/configure.js +6 -0
  4. package/dist/configure.js.map +1 -1
  5. package/dist/providers/telescope_ai_provider.d.ts +9 -1
  6. package/dist/providers/telescope_ai_provider.d.ts.map +1 -1
  7. package/dist/providers/telescope_ai_provider.js +22 -2
  8. package/dist/providers/telescope_ai_provider.js.map +1 -1
  9. package/dist/providers/telescope_alerts_provider.d.ts +1 -0
  10. package/dist/providers/telescope_alerts_provider.d.ts.map +1 -1
  11. package/dist/providers/telescope_alerts_provider.js +37 -1
  12. package/dist/providers/telescope_alerts_provider.js.map +1 -1
  13. package/dist/providers/telescope_mcp_provider.d.ts +26 -0
  14. package/dist/providers/telescope_mcp_provider.d.ts.map +1 -0
  15. package/dist/providers/telescope_mcp_provider.js +114 -0
  16. package/dist/providers/telescope_mcp_provider.js.map +1 -0
  17. package/dist/providers/telescope_provider.d.ts +8 -0
  18. package/dist/providers/telescope_provider.d.ts.map +1 -1
  19. package/dist/providers/telescope_provider.js +56 -1
  20. package/dist/providers/telescope_provider.js.map +1 -1
  21. package/dist/providers/telescope_ui_provider.d.ts +2 -0
  22. package/dist/providers/telescope_ui_provider.d.ts.map +1 -1
  23. package/dist/providers/telescope_ui_provider.js +106 -22
  24. package/dist/providers/telescope_ui_provider.js.map +1 -1
  25. package/dist/providers/telescope_watchers_provider.d.ts +13 -2
  26. package/dist/providers/telescope_watchers_provider.d.ts.map +1 -1
  27. package/dist/providers/telescope_watchers_provider.js +57 -7
  28. package/dist/providers/telescope_watchers_provider.js.map +1 -1
  29. package/dist/src/ai/define_config.d.ts +39 -7
  30. package/dist/src/ai/define_config.d.ts.map +1 -1
  31. package/dist/src/ai/define_config.js +14 -4
  32. package/dist/src/ai/define_config.js.map +1 -1
  33. package/dist/src/ai/diagnosis_coordinator.d.ts +106 -0
  34. package/dist/src/ai/diagnosis_coordinator.d.ts.map +1 -0
  35. package/dist/src/ai/diagnosis_coordinator.js +143 -0
  36. package/dist/src/ai/diagnosis_coordinator.js.map +1 -0
  37. package/dist/src/ai/factory.d.ts +8 -5
  38. package/dist/src/ai/factory.d.ts.map +1 -1
  39. package/dist/src/ai/factory.js +20 -8
  40. package/dist/src/ai/factory.js.map +1 -1
  41. package/dist/src/ai/index.d.ts +3 -1
  42. package/dist/src/ai/index.d.ts.map +1 -1
  43. package/dist/src/ai/index.js +3 -1
  44. package/dist/src/ai/index.js.map +1 -1
  45. package/dist/src/alerts/alert_rule.d.ts +79 -11
  46. package/dist/src/alerts/alert_rule.d.ts.map +1 -1
  47. package/dist/src/alerts/alerter.d.ts +11 -1
  48. package/dist/src/alerts/alerter.d.ts.map +1 -1
  49. package/dist/src/alerts/alerter.js +21 -1
  50. package/dist/src/alerts/alerter.js.map +1 -1
  51. package/dist/src/alerts/alerter_service.d.ts +103 -0
  52. package/dist/src/alerts/alerter_service.d.ts.map +1 -0
  53. package/dist/src/alerts/alerter_service.js +215 -0
  54. package/dist/src/alerts/alerter_service.js.map +1 -0
  55. package/dist/src/alerts/index.d.ts +4 -2
  56. package/dist/src/alerts/index.d.ts.map +1 -1
  57. package/dist/src/alerts/index.js +4 -2
  58. package/dist/src/alerts/index.js.map +1 -1
  59. package/dist/src/alerts/slack_format.d.ts.map +1 -1
  60. package/dist/src/alerts/slack_format.js +35 -2
  61. package/dist/src/alerts/slack_format.js.map +1 -1
  62. package/dist/src/client_errors/config.d.ts +66 -0
  63. package/dist/src/client_errors/config.d.ts.map +1 -0
  64. package/dist/src/client_errors/config.js +17 -0
  65. package/dist/src/client_errors/config.js.map +1 -0
  66. package/dist/src/client_errors/index.d.ts +5 -0
  67. package/dist/src/client_errors/index.d.ts.map +1 -0
  68. package/dist/src/client_errors/index.js +5 -0
  69. package/dist/src/client_errors/index.js.map +1 -0
  70. package/dist/src/client_errors/ingestor.d.ts +87 -0
  71. package/dist/src/client_errors/ingestor.d.ts.map +1 -0
  72. package/dist/src/client_errors/ingestor.js +135 -0
  73. package/dist/src/client_errors/ingestor.js.map +1 -0
  74. package/dist/src/client_errors/rate_limiter.d.ts +53 -0
  75. package/dist/src/client_errors/rate_limiter.d.ts.map +1 -0
  76. package/dist/src/client_errors/rate_limiter.js +83 -0
  77. package/dist/src/client_errors/rate_limiter.js.map +1 -0
  78. package/dist/src/client_errors/validation.d.ts +62 -0
  79. package/dist/src/client_errors/validation.d.ts.map +1 -0
  80. package/dist/src/client_errors/validation.js +109 -0
  81. package/dist/src/client_errors/validation.js.map +1 -0
  82. package/dist/src/define_config.d.ts +120 -0
  83. package/dist/src/define_config.d.ts.map +1 -1
  84. package/dist/src/define_config.js +41 -0
  85. package/dist/src/define_config.js.map +1 -1
  86. package/dist/src/entry.d.ts +20 -0
  87. package/dist/src/entry.d.ts.map +1 -1
  88. package/dist/src/entry.js +20 -0
  89. package/dist/src/entry.js.map +1 -1
  90. package/dist/src/index.d.ts +16 -3
  91. package/dist/src/index.d.ts.map +1 -1
  92. package/dist/src/index.js +15 -2
  93. package/dist/src/index.js.map +1 -1
  94. package/dist/src/mcp/define_config.d.ts +57 -0
  95. package/dist/src/mcp/define_config.d.ts.map +1 -0
  96. package/dist/src/mcp/define_config.js +35 -0
  97. package/dist/src/mcp/define_config.js.map +1 -0
  98. package/dist/src/mcp/index.d.ts +7 -0
  99. package/dist/src/mcp/index.d.ts.map +1 -0
  100. package/dist/src/mcp/index.js +7 -0
  101. package/dist/src/mcp/index.js.map +1 -0
  102. package/dist/src/mcp/server.d.ts +89 -0
  103. package/dist/src/mcp/server.d.ts.map +1 -0
  104. package/dist/src/mcp/server.js +279 -0
  105. package/dist/src/mcp/server.js.map +1 -0
  106. package/dist/src/metrics/pulse.d.ts +158 -0
  107. package/dist/src/metrics/pulse.d.ts.map +1 -0
  108. package/dist/src/metrics/pulse.js +414 -0
  109. package/dist/src/metrics/pulse.js.map +1 -0
  110. package/dist/src/overload_guard.d.ts +77 -0
  111. package/dist/src/overload_guard.d.ts.map +1 -0
  112. package/dist/src/overload_guard.js +134 -0
  113. package/dist/src/overload_guard.js.map +1 -0
  114. package/dist/src/pruner.d.ts +93 -0
  115. package/dist/src/pruner.d.ts.map +1 -0
  116. package/dist/src/pruner.js +120 -0
  117. package/dist/src/pruner.js.map +1 -0
  118. package/dist/src/registry.d.ts +26 -0
  119. package/dist/src/registry.d.ts.map +1 -1
  120. package/dist/src/registry.js +19 -0
  121. package/dist/src/registry.js.map +1 -1
  122. package/dist/src/service.d.ts +16 -1
  123. package/dist/src/service.d.ts.map +1 -1
  124. package/dist/src/service.js +19 -1
  125. package/dist/src/service.js.map +1 -1
  126. package/dist/src/stores/factory.d.ts.map +1 -1
  127. package/dist/src/stores/factory.js +8 -2
  128. package/dist/src/stores/factory.js.map +1 -1
  129. package/dist/src/telescope_middleware.d.ts.map +1 -1
  130. package/dist/src/telescope_middleware.js +3 -1
  131. package/dist/src/telescope_middleware.js.map +1 -1
  132. package/dist/src/ui/api.d.ts +9 -1
  133. package/dist/src/ui/api.d.ts.map +1 -1
  134. package/dist/src/ui/api.js +23 -1
  135. package/dist/src/ui/api.js.map +1 -1
  136. package/dist/src/ui/auth.d.ts +112 -0
  137. package/dist/src/ui/auth.d.ts.map +1 -0
  138. package/dist/src/ui/auth.js +130 -0
  139. package/dist/src/ui/auth.js.map +1 -0
  140. package/dist/src/ui/dashboard_auth.d.ts +34 -0
  141. package/dist/src/ui/dashboard_auth.d.ts.map +1 -0
  142. package/dist/src/ui/dashboard_auth.js +57 -0
  143. package/dist/src/ui/dashboard_auth.js.map +1 -0
  144. package/dist/src/ui/define_config.d.ts +15 -0
  145. package/dist/src/ui/define_config.d.ts.map +1 -1
  146. package/dist/src/ui/define_config.js +4 -0
  147. package/dist/src/ui/define_config.js.map +1 -1
  148. package/dist/src/ui/index.d.ts +7 -1
  149. package/dist/src/ui/index.d.ts.map +1 -1
  150. package/dist/src/ui/index.js +6 -1
  151. package/dist/src/ui/index.js.map +1 -1
  152. package/dist/src/ui/login_page.d.ts +23 -0
  153. package/dist/src/ui/login_page.d.ts.map +1 -0
  154. package/dist/src/ui/login_page.js +170 -0
  155. package/dist/src/ui/login_page.js.map +1 -0
  156. package/dist/src/ui/session_cookie.d.ts +42 -0
  157. package/dist/src/ui/session_cookie.d.ts.map +1 -0
  158. package/dist/src/ui/session_cookie.js +97 -0
  159. package/dist/src/ui/session_cookie.js.map +1 -0
  160. package/dist/src/watchers/define_config.d.ts +115 -12
  161. package/dist/src/watchers/define_config.d.ts.map +1 -1
  162. package/dist/src/watchers/define_config.js +48 -11
  163. package/dist/src/watchers/define_config.js.map +1 -1
  164. package/dist/src/watchers/http_client_watcher.d.ts +91 -31
  165. package/dist/src/watchers/http_client_watcher.d.ts.map +1 -1
  166. package/dist/src/watchers/http_client_watcher.js +161 -53
  167. package/dist/src/watchers/http_client_watcher.js.map +1 -1
  168. package/dist/src/watchers/index.d.ts +9 -5
  169. package/dist/src/watchers/index.d.ts.map +1 -1
  170. package/dist/src/watchers/index.js +6 -2
  171. package/dist/src/watchers/index.js.map +1 -1
  172. package/dist/src/watchers/lucid_query_watcher.d.ts +20 -2
  173. package/dist/src/watchers/lucid_query_watcher.d.ts.map +1 -1
  174. package/dist/src/watchers/lucid_query_watcher.js +44 -10
  175. package/dist/src/watchers/lucid_query_watcher.js.map +1 -1
  176. package/dist/src/watchers/profiling_watcher.d.ts +144 -0
  177. package/dist/src/watchers/profiling_watcher.d.ts.map +1 -0
  178. package/dist/src/watchers/profiling_watcher.js +231 -0
  179. package/dist/src/watchers/profiling_watcher.js.map +1 -0
  180. package/dist/src/watchers/query_family_hash.d.ts +7 -2
  181. package/dist/src/watchers/query_family_hash.d.ts.map +1 -1
  182. package/dist/src/watchers/query_family_hash.js +8 -3
  183. package/dist/src/watchers/query_family_hash.js.map +1 -1
  184. package/dist/src/watchers/record.d.ts.map +1 -1
  185. package/dist/src/watchers/record.js +4 -0
  186. package/dist/src/watchers/record.js.map +1 -1
  187. package/dist/src/watchers/schedule_watcher.d.ts +143 -0
  188. package/dist/src/watchers/schedule_watcher.d.ts.map +1 -0
  189. package/dist/src/watchers/schedule_watcher.js +195 -0
  190. package/dist/src/watchers/schedule_watcher.js.map +1 -0
  191. package/dist/stubs/config/telescope.stub +0 -65
  192. package/dist/stubs/config/telescope_ai.stub +0 -36
  193. package/dist/stubs/config/telescope_alerts.stub +0 -47
  194. package/dist/stubs/config/telescope_mcp.stub +0 -0
  195. package/dist/stubs/config/telescope_ui.stub +0 -53
  196. package/dist/stubs/config/telescope_watchers.stub +0 -41
  197. package/dist/stubs/database/migrations/create_telescope_entries_table.stub +2 -2
  198. package/package.json +12 -2
@@ -1,4 +1,6 @@
1
+ import { type ClientErrorsConfig, type ResolvedClientErrorsConfig } from './client_errors/config.js';
1
2
  import type { TelescopeExtension } from './extension/types.js';
3
+ import { type PulseCardName } from './metrics/pulse.js';
2
4
  import { type SamplingConfig } from './sampling/sampling.js';
3
5
  import type { TelescopeStore } from './store.js';
4
6
  import { type StoreProvider, storage } from './stores/factory.js';
@@ -90,6 +92,15 @@ export interface TelescopeConfig {
90
92
  * to flag a loop (default 3). Set `enabled: false` to disable detection.
91
93
  */
92
94
  nPlusOne?: NPlusOneConfig;
95
+ /**
96
+ * Pulse — the aggregated "at a glance" health rollup (slowest entries, error
97
+ * rate, throughput, top exceptions, cache hit ratio, slow route/outgoing/job
98
+ * hotspots, N+1, load-by-user) computed on demand from stored entries. Enabled
99
+ * by default over a trailing 1h window with every card; set `enabled: false` to
100
+ * disable the `<path>/api/metrics/pulse` route, tune `windowMs`, or restrict
101
+ * `cards`. See {@link PulseConfig}.
102
+ */
103
+ pulse?: PulseConfig;
93
104
  /**
94
105
  * Live SSE streaming of newly-stored entries to the dashboard. When enabled
95
106
  * (the default), the write path publishes each persisted entry — already
@@ -98,6 +109,69 @@ export interface TelescopeConfig {
98
109
  * connected. Set `stream: { enabled: false }` to turn it off entirely.
99
110
  */
100
111
  stream?: StreamConfig;
112
+ /**
113
+ * Background retention: a pruner deletes stale entries on a timer so the store
114
+ * never grows without bound. OFF unless a `prune` block is supplied — omit it
115
+ * and the store is only bounded by its own cap (the memory ring buffer's
116
+ * `maxEntries`). Supply `prune: { after: '24h' }` to delete entries older than a
117
+ * cutoff, `keepLast` to also cap by count, and `intervalMs` to tune the cadence.
118
+ * See {@link PruneConfig}.
119
+ */
120
+ prune?: PruneConfig;
121
+ /**
122
+ * Overload protection: a guard samples the process event-loop delay and PAUSES
123
+ * ingestion when the p99 lag crosses a threshold, resuming once it recovers — so
124
+ * telescope can never amplify an incident. ON by default at a 200ms threshold;
125
+ * set `overload: false`-style `{ enabled: false }` to disable it. See
126
+ * {@link OverloadConfig}.
127
+ */
128
+ overload?: OverloadConfig;
129
+ /**
130
+ * Public front-end error ingestion: a `POST` endpoint browsers report
131
+ * client-side errors to, recorded as `client_exception` entries through the
132
+ * normal pipeline (family-hash, `failed`/`client`/`user:<id>` tags, sampling,
133
+ * prune, dashboard). DISABLED by default — a public, unauthenticated surface is
134
+ * opt-in; when off, no route is registered at all. Protected by a body byte
135
+ * cap, an in-memory per-IP token bucket, an optional `authorize` hook, and the
136
+ * overload guard's shed flag. See {@link ClientErrorsConfig}.
137
+ */
138
+ clientErrors?: ClientErrorsConfig;
139
+ }
140
+ /** Background-pruner configuration (see {@link TelescopeConfig.prune}). */
141
+ export interface PruneConfig {
142
+ /**
143
+ * Master switch. Defaults to `true` whenever a `prune` block is present, so
144
+ * supplying `prune: { after: '24h' }` is enough to arm it; set `enabled: false`
145
+ * to keep the block for reference while disabling the timer.
146
+ */
147
+ enabled?: boolean;
148
+ /**
149
+ * Age cutoff: entries older than this are deleted each cycle. A raw ms number or
150
+ * a `<int><ms|s|m|h|d>` string (e.g. `'24h'`, `'7d'`). An unparseable value is a
151
+ * boot error, not a silent no-op. Default `'24h'`.
152
+ */
153
+ after?: number | string;
154
+ /**
155
+ * Count-based retention: keep at most the newest N of the entries a cycle would
156
+ * otherwise delete (the store's `keepLast`). Combine with `after` to bound by
157
+ * both age and count. Default unset (pure age-based pruning).
158
+ */
159
+ keepLast?: number;
160
+ /** How often a scheduled prune cycle runs, in ms. Default 60000. */
161
+ intervalMs?: number;
162
+ }
163
+ /** Overload-guard configuration (see {@link TelescopeConfig.overload}). */
164
+ export interface OverloadConfig {
165
+ /** Master switch for overload protection. Default `true`. */
166
+ enabled?: boolean;
167
+ /** p99 event-loop lag (ms) at or above which capture pauses. Default 200. */
168
+ maxEventLoopLagMs?: number;
169
+ /**
170
+ * Startup grace (ms): leading sample windows discarded before the guard can
171
+ * pause, so the synchronous boot stall never trips it on a transient. Default
172
+ * 5000. Never negative.
173
+ */
174
+ startupGraceMs?: number;
101
175
  }
102
176
  /** N+1 detection configuration (see {@link TelescopeConfig.nPlusOne}). */
103
177
  export interface NPlusOneConfig {
@@ -106,6 +180,24 @@ export interface NPlusOneConfig {
106
180
  /** Minimum repetitions of one query template within a trace to flag a loop. Default 3. */
107
181
  threshold?: number;
108
182
  }
183
+ /** Pulse rollup configuration (see {@link TelescopeConfig.pulse}). */
184
+ export interface PulseConfig {
185
+ /** Master switch for the pulse rollup + its route. Default `true`. */
186
+ enabled?: boolean;
187
+ /** Trailing window (ms) the rollup aggregates over. Default 3_600_000 (1h). */
188
+ windowMs?: number;
189
+ /** How many rows each top-N list returns. Default 5. */
190
+ topN?: number;
191
+ /** Throughput bucket count (clamped 1–500). Default 60. */
192
+ buckets?: number;
193
+ /** Min p99 (ms) for a route/outgoing family to count as a slow hotspot. Default 1000. */
194
+ slowRouteMs?: number;
195
+ /**
196
+ * Which cards to compute. Omit for all. `counts` and the window meta are always
197
+ * present; every other card can be toggled off to trim the payload.
198
+ */
199
+ cards?: PulseCardName[];
200
+ }
109
201
  /** Live-stream configuration (see {@link TelescopeConfig.stream}). */
110
202
  export interface StreamConfig {
111
203
  /** Master switch for the SSE live-stream of entries. Default `true`. */
@@ -130,10 +222,38 @@ export interface ResolvedTelescopeConfig {
130
222
  enabled: boolean;
131
223
  threshold: number;
132
224
  };
225
+ /** Resolved pulse-rollup settings. */
226
+ pulse: {
227
+ enabled: boolean;
228
+ windowMs: number;
229
+ topN: number;
230
+ buckets: number;
231
+ slowRouteMs: number;
232
+ cards: PulseCardName[];
233
+ };
133
234
  /** Resolved live-stream settings. */
134
235
  stream: {
135
236
  enabled: boolean;
136
237
  };
238
+ /**
239
+ * Resolved pruner settings. `afterMs`/`intervalMs` are always present (defaulted)
240
+ * so the pruner can act on them directly; it only runs when `enabled` is `true`,
241
+ * which is `false` unless a `prune` block was supplied.
242
+ */
243
+ prune: {
244
+ enabled: boolean;
245
+ afterMs: number;
246
+ keepLast?: number;
247
+ intervalMs: number;
248
+ };
249
+ /** Resolved overload-guard settings (always present; `enabled` defaults `true`). */
250
+ overload: {
251
+ enabled: boolean;
252
+ maxEventLoopLagMs: number;
253
+ startupGraceMs: number;
254
+ };
255
+ /** Resolved client-error ingestion settings (always present; `enabled` defaults `false`). */
256
+ clientErrors: ResolvedClientErrorsConfig;
137
257
  }
138
258
  /**
139
259
  * Identity helper giving `config/telescope.ts` full type-checking. Mirrors the
@@ -1 +1 @@
1
- {"version":3,"file":"define_config.d.ts","sourceRoot":"","sources":["../../src/define_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,KAAK,cAAc,EAAmB,MAAM,wBAAwB,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,KAAK,aAAa,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAElE;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,qDAAqD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AAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAClD,sCAAsC;IACtC,KAAK,EAAE;QACL,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,aAAa,EAAE,CAAC;KACxB,CAAC;IACF,qCAAqC;IACrC,MAAM,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAC7B;;;;OAIG;IACH,KAAK,EAAE;QACL,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,oFAAoF;IACpF,QAAQ,EAAE;QACR,OAAO,EAAE,OAAO,CAAC;QACjB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,6FAA6F;IAC7F,YAAY,EAAE,0BAA0B,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAErE;AAED,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,MAAM,GAAE,eAAoB,GAAG,uBAAuB,CAqCnF;AAkBD,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,aAAa,GACd,MAAM,qBAAqB,CAAC"}
@@ -1,5 +1,16 @@
1
+ import { durationToMs } from './alerts/parse_duration.js';
2
+ import { resolveClientErrors, } from './client_errors/config.js';
3
+ import { PULSE_CARDS } from './metrics/pulse.js';
1
4
  import { resolveSampling } from './sampling/sampling.js';
2
5
  import { storage } from './stores/factory.js';
6
+ /** Default retention age for the pruner when `prune.after` is omitted. */
7
+ const DEFAULT_PRUNE_AFTER = '24h';
8
+ /** Default interval (ms) between scheduled prune cycles. */
9
+ const DEFAULT_PRUNE_INTERVAL_MS = 60_000;
10
+ /** Default p99 event-loop lag (ms) at which the overload guard sheds capture. */
11
+ const DEFAULT_MAX_EVENT_LOOP_LAG_MS = 200;
12
+ /** Default startup grace (ms) the overload guard discards before it can pause. */
13
+ const DEFAULT_STARTUP_GRACE_MS = 5_000;
3
14
  /**
4
15
  * Identity helper giving `config/telescope.ts` full type-checking. Mirrors the
5
16
  * AdonisJS `defineConfig` convention.
@@ -38,9 +49,39 @@ export function resolveConfig(config = {}) {
38
49
  enabled: config.nPlusOne?.enabled ?? true,
39
50
  threshold: config.nPlusOne?.threshold ?? 3,
40
51
  },
52
+ pulse: {
53
+ enabled: config.pulse?.enabled ?? true,
54
+ windowMs: config.pulse?.windowMs ?? 3_600_000,
55
+ topN: config.pulse?.topN ?? 5,
56
+ buckets: config.pulse?.buckets ?? 60,
57
+ slowRouteMs: config.pulse?.slowRouteMs ?? 1000,
58
+ cards: config.pulse?.cards ?? [...PULSE_CARDS],
59
+ },
41
60
  stream: {
42
61
  enabled: config.stream?.enabled ?? true,
43
62
  },
63
+ prune: resolvePrune(config.prune),
64
+ overload: {
65
+ enabled: config.overload?.enabled ?? true,
66
+ maxEventLoopLagMs: config.overload?.maxEventLoopLagMs ?? DEFAULT_MAX_EVENT_LOOP_LAG_MS,
67
+ startupGraceMs: Math.max(0, config.overload?.startupGraceMs ?? DEFAULT_STARTUP_GRACE_MS),
68
+ },
69
+ clientErrors: resolveClientErrors(config.clientErrors),
70
+ };
71
+ }
72
+ /**
73
+ * Resolve the (optional) pruner block. Absent ⇒ disabled. Present ⇒ enabled
74
+ * unless `enabled: false`, with `after`/`intervalMs` defaulted. `after` is parsed
75
+ * here so a bad duration surfaces at boot (config resolution) rather than as a
76
+ * silent runtime skip.
77
+ */
78
+ function resolvePrune(prune) {
79
+ const enabled = prune ? (prune.enabled ?? true) : false;
80
+ return {
81
+ enabled,
82
+ afterMs: durationToMs(prune?.after ?? DEFAULT_PRUNE_AFTER),
83
+ ...(prune?.keepLast !== undefined ? { keepLast: prune.keepLast } : {}),
84
+ intervalMs: prune?.intervalMs ?? DEFAULT_PRUNE_INTERVAL_MS,
44
85
  };
45
86
  }
46
87
  export { storage };
@@ -1 +1 @@
1
- {"version":3,"file":"define_config.js","sourceRoot":"","sources":["../../src/define_config.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,EAAsB,OAAO,EAAE,MAAM,qBAAqB,CAAC;AA8IlE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAAC,MAAuB;IAClD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,aAAa,CAAC,SAA0B,EAAE;IACxD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC/D,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,IAAI;QAC/B,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,QAAQ;QAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;QAC3B,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,IAAI;QACrC,QAAQ,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC;QAC3B,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,EAAE;QACnC,MAAM,EAAE;YACN,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,IAAI,IAAI;YACvC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE;SAChC;QACD,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC1C,QAAQ,EAAE;YACR,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,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AC;SACzF;QACD,YAAY,EAAE,mBAAmB,CAAC,MAAM,CAAC,YAAY,CAAC;KACvD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,YAAY,CAAC,KAA+B;IACnD,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACxD,OAAO;QACL,OAAO;QACP,OAAO,EAAE,YAAY,CAAC,KAAK,EAAE,KAAK,IAAI,mBAAmB,CAAC;QAC1D,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtE,UAAU,EAAE,KAAK,EAAE,UAAU,IAAI,yBAAyB;KAC3D,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -20,6 +20,26 @@ export declare const EntryType: {
20
20
  readonly Log: "log";
21
21
  /** An OUTBOUND HTTP call, recorded by the http-client watcher. */
22
22
  readonly HttpClient: "http-client";
23
+ /**
24
+ * A user-instrumented profiling span — a timed code section (label, duration,
25
+ * nested marks) recorded by the profiling watcher's `profile()` / `startProfile()`
26
+ * helpers. Self-contained timing, not a V8 CPU capture.
27
+ */
28
+ readonly Profile: "profile";
29
+ /**
30
+ * A single scheduled-task run (name, cron/expression, duration, success/failure),
31
+ * recorded by the schedule watcher's `scheduleTask()` / `recordScheduledRun()`
32
+ * helpers. Distinct from a queue {@link EntryType.Job} so schedule health rolls
33
+ * up separately.
34
+ */
35
+ readonly ScheduledTask: "scheduled_task";
36
+ /**
37
+ * A browser/client-reported error ingested via the public client-error
38
+ * endpoint (`POST <path>`). Recorded through the normal pipeline with a
39
+ * family-hash mirroring server exceptions and `failed`/`client`/`user:<id>`
40
+ * tags, so it composes with dedup, prune, sampling, and the dashboard.
41
+ */
42
+ readonly ClientException: "client_exception";
23
43
  };
24
44
  export type BuiltinEntryType = (typeof EntryType)[keyof typeof EntryType];
25
45
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../src/entry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;IACpB,wEAAwE;;IAExE,0DAA0D;;;;;;;;;;IAW1D,kEAAkE;;CAE1D,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAE1E;;;;GAIG;AACH,QAAA,MAAM,aAAa,yDAA0D,CAAC;AAC9E,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED;;;;GAIG;AACH,MAAM,WAAW,KAAK,CAAC,QAAQ,GAAG,OAAO;IACvC,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iCAAiC;IACjC,OAAO,EAAE,QAAQ,CAAC;IAClB,iFAAiF;IACjF,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,oCAAoC;IACpC,MAAM,EAAE,WAAW,CAAC;IACpB,qEAAqE;IACrE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,mCAAmC;IACnC,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW,CAAC,QAAQ,GAAG,OAAO;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO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CAAoC;IACpC,MAAM,EAAE,WAAW,CAAC;IACpB,qEAAqE;IACrE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,mCAAmC;IACnC,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW,CAAC,QAAQ,GAAG,OAAO;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,QAAQ,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,uFAAuF;IACvF,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB"}
package/dist/src/entry.js CHANGED
@@ -21,6 +21,26 @@ export const EntryType = {
21
21
  Log: 'log',
22
22
  /** An OUTBOUND HTTP call, recorded by the http-client watcher. */
23
23
  HttpClient: 'http-client',
24
+ /**
25
+ * A user-instrumented profiling span — a timed code section (label, duration,
26
+ * nested marks) recorded by the profiling watcher's `profile()` / `startProfile()`
27
+ * helpers. Self-contained timing, not a V8 CPU capture.
28
+ */
29
+ Profile: 'profile',
30
+ /**
31
+ * A single scheduled-task run (name, cron/expression, duration, success/failure),
32
+ * recorded by the schedule watcher's `scheduleTask()` / `recordScheduledRun()`
33
+ * helpers. Distinct from a queue {@link EntryType.Job} so schedule health rolls
34
+ * up separately.
35
+ */
36
+ ScheduledTask: 'scheduled_task',
37
+ /**
38
+ * A browser/client-reported error ingested via the public client-error
39
+ * endpoint (`POST <path>`). Recorded through the normal pipeline with a
40
+ * family-hash mirroring server exceptions and `failed`/`client`/`user:<id>`
41
+ * tags, so it composes with dedup, prune, sampling, and the dashboard.
42
+ */
43
+ ClientException: 'client_exception',
24
44
  };
25
45
  /**
26
46
  * Where a batch of entries originated. An entry recorded inside an HTTP request
@@ -1 +1 @@
1
- {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/entry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,wEAAwE;IACxE,OAAO,EAAE,SAAS;IAClB,0DAA0D;IAC1D,UAAU,EAAE,YAAY;IACxB,8DAA8D;IAC9D,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,kEAAkE;IAClE,UAAU,EAAE,aAAa;CACjB,CAAC;AAIX;;;;GAIG;AACH,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAU,CAAC;AAG9E,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,aAAmC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC3F,CAAC"}
1
+ {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/entry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,wEAAwE;IACxE,OAAO,EAAE,SAAS;IAClB,0DAA0D;IAC1D,UAAU,EAAE,YAAY;IACxB,8DAA8D;IAC9D,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,kEAAkE;IAClE,UAAU,EAAE,aAAa;IACzB;;;;OAIG;IACH,OAAO,EAAE,SAAS;IAClB;;;;;OAKG;IACH,aAAa,EAAE,gBAAgB;IAC/B;;;;;OAKG;IACH,eAAe,EAAE,kBAAkB;CAC3B,CAAC;AAIX;;;;GAIG;AACH,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAU,CAAC;AAG9E,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,aAAmC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC3F,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /** Keep in sync with this package's `version` in package.json. */
2
- export declare const VERSION = "0.4.0";
2
+ export declare const VERSION = "0.5.1";
3
3
  export { EntryType, isBatchOrigin } from './entry.js';
4
4
  export type { BatchOrigin, BuiltinEntryType, Entry, RecordInput } from './entry.js';
5
5
  export type { EntryQuery, TelescopeStore } from './store.js';
@@ -22,8 +22,14 @@ export type { ExceptionFamilyParts } from './exception_family_hash.js';
22
22
  export { defineTelescopeExtension } from './extension/types.js';
23
23
  export type { Column, ContainerLike, DashboardSection, DashboardSpec, DataBinding, DataProvider, ExtensionContext, ExtensionEntryType, LinkSpec, Panel, PanelThresholds, TelescopeExtension, } from './extension/types.js';
24
24
  export { ExtensionRegistry } from './extension/registry.js';
25
+ export { ClientErrorIngestor, type ClientErrorHttpContext, type ClientErrorIngestorDeps, type ClientErrorRequest, type ClientErrorResponse, type ClientErrorsConfig, ClientErrorRateLimiter, type ClientErrorValidation, type ClientExceptionContent, DEFAULT_CLIENT_ERRORS_PATH, DEFAULT_MAX_BODY_BYTES, DEFAULT_MAX_TRACKED_IPS, DEFAULT_RATE_LIMIT_PER_MINUTE, resolveClientErrors, type ResolvedClientErrorsConfig, storeRecorder, userIdentityTag, validateClientErrorBody, } from './client_errors/index.js';
25
26
  export { defineConfig, resolveConfig } from './define_config.js';
26
- export type { NPlusOneConfig, RedactConfig, ResolvedTelescopeConfig, StreamConfig, TelescopeConfig, WatcherName, } from './define_config.js';
27
+ export type { NPlusOneConfig, OverloadConfig, PruneConfig, PulseConfig, RedactConfig, ResolvedTelescopeConfig, StreamConfig, TelescopeConfig, WatcherName, } from './define_config.js';
28
+ export { TelescopePruner } from './pruner.js';
29
+ export type { Clock, PruneRun, PruneTrigger, PrunerDeps, PrunerLogger, ResolvedPruneConfig, } from './pruner.js';
30
+ export { OverloadGuard } from './overload_guard.js';
31
+ export type { EventLoopDelayMonitor, OverloadGuardDeps, OverloadLogger, PauseController, ResolvedOverloadConfig, } from './overload_guard.js';
32
+ export { setTelescopePaused } from './registry.js';
27
33
  export { EntryEvents } from './stream/entry_events.js';
28
34
  export type { EntrySubscriber, Unsubscribe } from './stream/entry_events.js';
29
35
  export { StreamingTelescopeStore } from './stream/streaming_store.js';
@@ -38,6 +44,8 @@ export { MetricsService } from './metrics/metrics_service.js';
38
44
  export type { MetricsServiceOptions, StatsQuery, TimeseriesQuery, } from './metrics/metrics_service.js';
39
45
  export { estimateLatencyPercentiles, percentile, summarizeStats, } from './metrics/stats.js';
40
46
  export type { CacheStats, ExceptionGroupStats, FamilyLatency, LatencyPercentilesOverride, LatencyStats, StatsResult, StatusBreakdown, SummarizeStatsInput, } from './metrics/stats.js';
47
+ export { PulseService, PULSE_CARDS, summarizePulse } from './metrics/pulse.js';
48
+ export type { PulseCardName, PulseExceptionGroup, PulseHotspot, PulseNPlusOne, PulseOptions, PulseQuery, PulseRequestHealth, PulseServiceOptions, PulseSlowEntry, PulseSummary, PulseThroughput, PulseUserLoad, } from './metrics/pulse.js';
41
49
  export { bucketTimeseries } from './metrics/timeseries.js';
42
50
  export type { TimeseriesBucket, TimeseriesReport } from './metrics/timeseries.js';
43
51
  export { summarizeTraces } from './metrics/traces.js';
@@ -48,10 +56,15 @@ export { buildHistogram, emptyHistogram, estimatePercentileFromHistogram, HISTOG
48
56
  export { compileRedactSpec, DEFAULT_MASK, DEFAULT_REDACT_KEYS, redact, redactBounded, redactBoundedWith, } from './redaction/redact.js';
49
57
  export type { CompiledRedactSpec, RedactBoundedResult, RedactOptions, } from './redaction/redact.js';
50
58
  export { RedactingTelescopeStore } from './redaction/redacting_store.js';
51
- export { getTelescopeRuntime, resetTelescopeRuntime, setTelescopeEntryEvents, setTelescopeExtensionRegistry, setTelescopeRuntime, } from './registry.js';
59
+ export { getTelescopeRuntime, resetTelescopeRuntime, setTelescopeDiagnosisCoordinator, setTelescopeEntryEvents, setTelescopeExtensionRegistry, setTelescopeRuntime, } from './registry.js';
52
60
  export type { TelescopeRuntime } from './registry.js';
61
+ export { DiagnosisCoordinator, formatDiagnosisMarkdown, } from './ai/diagnosis_coordinator.js';
62
+ export type { DiagnoserLike, DiagnosisCoordinatorOptions, DiagnosisSummary, } from './ai/diagnosis_coordinator.js';
63
+ export { MCP_INTERNAL_ERROR, MCP_METHOD_NOT_FOUND, MCP_TOOL_NAMES, MCP_TOOLS, MCP_UNAUTHORIZED, TelescopeMcpServer, } from './mcp/index.js';
64
+ export type { DiagnoseExceptionHook, JsonRpcRequest, McpToolName, McpToolSpec, ResolvedTelescopeMcpConfig, TelescopeMcpConfig, TelescopeMcpServerOptions, } from './mcp/index.js';
53
65
  export { currentTraceId, getContextAccessor } from './context_accessor.js';
54
66
  export type { ContextAccessor } from './context_accessor.js';
55
67
  export { getDiagnosticsRegistry, isDiagnosticEvent, } from './diagnostics_registry.js';
56
68
  export type { DiagnosticEvent, DiagnosticsRegistry } from './diagnostics_registry.js';
69
+ export { configure } from '../configure.js';
57
70
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGpF,YAAY,EAAE,UAAU,EAAE,cA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+B,CAAC;AACvC,YAAY,EACV,aAAa,EACb,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,WAAW,EACX,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGtF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA"}
package/dist/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Keep in sync with this package's `version` in package.json. */
2
- export const VERSION = '0.4.0';
2
+ export const VERSION = '0.5.1';
3
3
  // — entry model —
4
4
  export { EntryType, isBatchOrigin } from './entry.js';
5
5
  export { InMemoryTelescopeStore } from './stores/memory.js';
@@ -15,8 +15,14 @@ export { exceptionFamilyHash } from './exception_family_hash.js';
15
15
  // — extension SDK —
16
16
  export { defineTelescopeExtension } from './extension/types.js';
17
17
  export { ExtensionRegistry } from './extension/registry.js';
18
+ // — client-error ingestion (public front-end error endpoint) —
19
+ export { ClientErrorIngestor, ClientErrorRateLimiter, DEFAULT_CLIENT_ERRORS_PATH, DEFAULT_MAX_BODY_BYTES, DEFAULT_MAX_TRACKED_IPS, DEFAULT_RATE_LIMIT_PER_MINUTE, resolveClientErrors, storeRecorder, userIdentityTag, validateClientErrorBody, } from './client_errors/index.js';
18
20
  // — config —
19
21
  export { defineConfig, resolveConfig } from './define_config.js';
22
+ // — protective infrastructure (retention pruner + overload guard) —
23
+ export { TelescopePruner } from './pruner.js';
24
+ export { OverloadGuard } from './overload_guard.js';
25
+ export { setTelescopePaused } from './registry.js';
20
26
  // — live-stream (SSE entry-events pub/sub) —
21
27
  export { EntryEvents } from './stream/entry_events.js';
22
28
  export { StreamingTelescopeStore } from './stream/streaming_store.js';
@@ -29,6 +35,7 @@ export { detectNPlusOne, detectNPlusOnePatterns } from './query/n_plus_one.js';
29
35
  // — metrics (stats / timeseries / percentiles / traces / waterfall) —
30
36
  export { MetricsService } from './metrics/metrics_service.js';
31
37
  export { estimateLatencyPercentiles, percentile, summarizeStats, } from './metrics/stats.js';
38
+ export { PulseService, PULSE_CARDS, summarizePulse } from './metrics/pulse.js';
32
39
  export { bucketTimeseries } from './metrics/timeseries.js';
33
40
  export { summarizeTraces } from './metrics/traces.js';
34
41
  export { buildWaterfall } from './metrics/waterfall.js';
@@ -37,8 +44,14 @@ export { buildHistogram, emptyHistogram, estimatePercentileFromHistogram, HISTOG
37
44
  export { compileRedactSpec, DEFAULT_MASK, DEFAULT_REDACT_KEYS, redact, redactBounded, redactBoundedWith, } from './redaction/redact.js';
38
45
  export { RedactingTelescopeStore } from './redaction/redacting_store.js';
39
46
  // — runtime (advanced) —
40
- export { getTelescopeRuntime, resetTelescopeRuntime, setTelescopeEntryEvents, setTelescopeExtensionRegistry, setTelescopeRuntime, } from './registry.js';
47
+ export { getTelescopeRuntime, resetTelescopeRuntime, setTelescopeDiagnosisCoordinator, setTelescopeEntryEvents, setTelescopeExtensionRegistry, setTelescopeRuntime, } from './registry.js';
48
+ // — AI diagnosis coordinator (wires the MCP tool + the alerter; SDK-free) —
49
+ export { DiagnosisCoordinator, formatDiagnosisMarkdown, } from './ai/diagnosis_coordinator.js';
50
+ // — MCP (Model Context Protocol) server — expose telemetry to a coding agent —
51
+ export { MCP_INTERNAL_ERROR, MCP_METHOD_NOT_FOUND, MCP_TOOL_NAMES, MCP_TOOLS, MCP_UNAUTHORIZED, TelescopeMcpServer, } from './mcp/index.js';
41
52
  // — structural ecosystem readers —
42
53
  export { currentTraceId, getContextAccessor } from './context_accessor.js';
43
54
  export { getDiagnosticsRegistry, isDiagnosticEvent, } from './diagnostics_registry.js';
55
+ // Re-export the configure hook from the package root so `node ace configure` finds it
56
+ export { configure } from '../configure.js';
44
57
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,kBAAkB;AAClB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAS3B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAQ9C,gBAAgB;AAChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,eAAe;AACf,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAMrD,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,oBAAoB;AACpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAehE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,aAAa;AACb,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUj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EACnB,MAAM,EACN,aAAa,EACb,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,yBAAyB;AACzB,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,gCAAgC,EAChC,uBAAuB,EACvB,6BAA6B,EAC7B,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAGvB,4EAA4E;AAC5E,OAAO,EACL,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,+BAA+B,CAAC;AAOvC,+EAA+E;AAC/E,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAWxB,mCAAmC;AACnC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAGnC,sFAAsF;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,57 @@
1
+ import { type AuthorizeHook, type UiCredentials } from '../ui/define_config.js';
2
+ /** The tools the MCP server can expose, in catalogue order. */
3
+ export declare const MCP_TOOL_NAMES: readonly ["list_entries", "get_entry", "get_trace", "get_waterfall", "get_health", "diagnose_exception"];
4
+ export type McpToolName = (typeof MCP_TOOL_NAMES)[number];
5
+ /**
6
+ * The shape of `config/telescope_mcp.ts`. The MCP endpoint is a JSON-RPC transport
7
+ * mounted at `path` (default `/telescope/mcp`) that lets a coding agent query the
8
+ * captured telemetry over the Model Context Protocol.
9
+ *
10
+ * Access reuses the SAME guard as the dashboard/metrics API (`AuthorizeHook` +
11
+ * `UiCredentials`): allowed automatically outside production, and in production only
12
+ * when a `token`/`basic` credential — or a custom `authorize` hook — permits it. A
13
+ * denial is surfaced as a JSON-RPC `-32001` error (MCP has no transport 401) so a
14
+ * compliant client can read it.
15
+ */
16
+ export interface TelescopeMcpConfig {
17
+ /** Master switch. When `false`, the provider registers no routes at all. Default `true`. */
18
+ enabled?: boolean;
19
+ /** URL the JSON-RPC endpoint mounts at. Default `/telescope/mcp`. */
20
+ path?: string;
21
+ /**
22
+ * The access-decision hook, identical to the UI/metrics guard. When omitted the
23
+ * default policy is used: allow outside production, otherwise require a configured
24
+ * {@link UiCredentials}. Delegate to your own app auth here.
25
+ */
26
+ authorize?: AuthorizeHook;
27
+ /** Built-in credentials for the default policy (ignored when `authorize` is set). */
28
+ credentials?: UiCredentials;
29
+ /**
30
+ * Which tools to expose. Omit for all six. Restrict this to hand an agent a
31
+ * narrower surface (e.g. read-only `['list_entries', 'get_trace', 'get_health']`).
32
+ */
33
+ tools?: McpToolName[];
34
+ }
35
+ /** The fully-resolved MCP config the provider acts on. */
36
+ export interface ResolvedTelescopeMcpConfig {
37
+ enabled: boolean;
38
+ /** Always a leading-slash, no-trailing-slash path, e.g. `/telescope/mcp`. */
39
+ path: string;
40
+ authorize: AuthorizeHook;
41
+ credentials: UiCredentials;
42
+ /** The enabled tool set. */
43
+ tools: ReadonlySet<McpToolName>;
44
+ }
45
+ /**
46
+ * Identity helper giving `config/telescope_mcp.ts` full type-checking. Mirrors the
47
+ * AdonisJS `defineConfig` convention.
48
+ *
49
+ * ```ts
50
+ * import { defineConfig } from '@adonis-agora/telescope/mcp'
51
+ * export default defineConfig({ path: '/__telescope/mcp' })
52
+ * ```
53
+ */
54
+ export declare function defineConfig(config: TelescopeMcpConfig): TelescopeMcpConfig;
55
+ /** Apply defaults to a (possibly partial) config. */
56
+ export declare function resolveConfig(config?: TelescopeMcpConfig): ResolvedTelescopeMcpConfig;
57
+ //# sourceMappingURL=define_config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define_config.d.ts","sourceRoot":"","sources":["../../../src/mcp/define_config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,aAAa,EAGnB,MAAM,wBAAwB,CAAC;AAEhC,+DAA+D;AAC/D,eAAO,MAAM,cAAc,0GAOjB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB;IACjC,4FAA4F;IAC5F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,qFAAqF;IACrF,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,0DAA0D;AAC1D,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,aAAa,CAAC;IACzB,WAAW,EAAE,aAAa,CAAC;IAC3B,4BAA4B;IAC5B,KAAK,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;CACjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAE3E;AAED,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,MAAM,GAAE,kBAAuB,GAAG,0BAA0B,CAUzF"}
@@ -0,0 +1,35 @@
1
+ import { defaultAuthorize, normalizePath, } from '../ui/define_config.js';
2
+ /** The tools the MCP server can expose, in catalogue order. */
3
+ export const MCP_TOOL_NAMES = [
4
+ 'list_entries',
5
+ 'get_entry',
6
+ 'get_trace',
7
+ 'get_waterfall',
8
+ 'get_health',
9
+ 'diagnose_exception',
10
+ ];
11
+ /**
12
+ * Identity helper giving `config/telescope_mcp.ts` full type-checking. Mirrors the
13
+ * AdonisJS `defineConfig` convention.
14
+ *
15
+ * ```ts
16
+ * import { defineConfig } from '@adonis-agora/telescope/mcp'
17
+ * export default defineConfig({ path: '/__telescope/mcp' })
18
+ * ```
19
+ */
20
+ export function defineConfig(config) {
21
+ return config;
22
+ }
23
+ /** Apply defaults to a (possibly partial) config. */
24
+ export function resolveConfig(config = {}) {
25
+ const credentials = config.credentials ?? {};
26
+ const tools = config.tools !== undefined ? config.tools : MCP_TOOL_NAMES;
27
+ return {
28
+ enabled: config.enabled ?? true,
29
+ path: normalizePath(config.path ?? '/telescope/mcp'),
30
+ authorize: config.authorize ?? defaultAuthorize(credentials),
31
+ credentials,
32
+ tools: new Set(tools),
33
+ };
34
+ }
35
+ //# sourceMappingURL=define_config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define_config.js","sourceRoot":"","sources":["../../../src/mcp/define_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAChB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAEhC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,cAAc;IACd,WAAW;IACX,WAAW;IACX,eAAe;IACf,YAAY;IACZ,oBAAoB;CACZ,CAAC;AA8CX;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,MAA0B;IACrD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,aAAa,CAAC,SAA6B,EAAE;IAC3D,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC;IAC7C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC;IACzE,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,IAAI;QAC/B,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,IAAI,IAAI,gBAAgB,CAAC;QACpD,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,gBAAgB,CAAC,WAAW,CAAC;QAC5D,WAAW;QACX,KAAK,EAAE,IAAI,GAAG,CAAc,KAAK,CAAC;KACnC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** Keep in sync with this package's `version` in package.json. */
2
+ export declare const VERSION = "0.5.1";
3
+ export { defineConfig, resolveConfig, MCP_TOOL_NAMES } from './define_config.js';
4
+ export type { McpToolName, ResolvedTelescopeMcpConfig, TelescopeMcpConfig, } from './define_config.js';
5
+ export { MCP_INTERNAL_ERROR, MCP_METHOD_NOT_FOUND, MCP_TOOLS, MCP_UNAUTHORIZED, TelescopeMcpServer, } from './server.js';
6
+ export type { DiagnoseExceptionHook, JsonRpcRequest, McpToolSpec, TelescopeMcpServerOptions, } from './server.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACjF,YAAY,EACV,WAAW,EACX,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,yBAAyB,GAC1B,MAAM,aAAa,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** Keep in sync with this package's `version` in package.json. */
2
+ export const VERSION = '0.5.1';
3
+ // — config —
4
+ export { defineConfig, resolveConfig, MCP_TOOL_NAMES } from './define_config.js';
5
+ // — server (plain, testable JSON-RPC surface) —
6
+ export { MCP_INTERNAL_ERROR, MCP_METHOD_NOT_FOUND, MCP_TOOLS, MCP_UNAUTHORIZED, TelescopeMcpServer, } from './server.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,aAAa;AACb,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOjF,gDAAgD;AAChD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,aAAa,CAAC"}