@adonis-agora/telescope 0.6.0 → 0.7.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 (120) hide show
  1. package/CHANGELOG.md +28 -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_cpu_profiling_provider.d.ts +28 -0
  6. package/dist/providers/telescope_cpu_profiling_provider.d.ts.map +1 -0
  7. package/dist/providers/telescope_cpu_profiling_provider.js +45 -0
  8. package/dist/providers/telescope_cpu_profiling_provider.js.map +1 -0
  9. package/dist/providers/telescope_ui_provider.d.ts.map +1 -1
  10. package/dist/providers/telescope_ui_provider.js +163 -12
  11. package/dist/providers/telescope_ui_provider.js.map +1 -1
  12. package/dist/providers/telescope_watchers_provider.d.ts +10 -0
  13. package/dist/providers/telescope_watchers_provider.d.ts.map +1 -1
  14. package/dist/providers/telescope_watchers_provider.js +32 -0
  15. package/dist/providers/telescope_watchers_provider.js.map +1 -1
  16. package/dist/src/ai/index.d.ts +1 -1
  17. package/dist/src/ai/index.js +1 -1
  18. package/dist/src/alerts/index.d.ts +1 -1
  19. package/dist/src/alerts/index.js +1 -1
  20. package/dist/src/entry.d.ts +8 -0
  21. package/dist/src/entry.d.ts.map +1 -1
  22. package/dist/src/entry.js +8 -0
  23. package/dist/src/entry.js.map +1 -1
  24. package/dist/src/index.d.ts +1 -1
  25. package/dist/src/index.js +1 -1
  26. package/dist/src/mcp/index.d.ts +1 -1
  27. package/dist/src/mcp/index.js +1 -1
  28. package/dist/src/profiling/aggregate-profile.d.ts +21 -0
  29. package/dist/src/profiling/aggregate-profile.d.ts.map +1 -0
  30. package/dist/src/profiling/aggregate-profile.js +124 -0
  31. package/dist/src/profiling/aggregate-profile.js.map +1 -0
  32. package/dist/src/profiling/cpu-profiler.d.ts +59 -0
  33. package/dist/src/profiling/cpu-profiler.d.ts.map +1 -0
  34. package/dist/src/profiling/cpu-profiler.js +94 -0
  35. package/dist/src/profiling/cpu-profiler.js.map +1 -0
  36. package/dist/src/profiling/define_config.d.ts +38 -0
  37. package/dist/src/profiling/define_config.d.ts.map +1 -0
  38. package/dist/src/profiling/define_config.js +23 -0
  39. package/dist/src/profiling/define_config.js.map +1 -0
  40. package/dist/src/profiling/index.d.ts +11 -0
  41. package/dist/src/profiling/index.d.ts.map +1 -0
  42. package/dist/src/profiling/index.js +7 -0
  43. package/dist/src/profiling/index.js.map +1 -0
  44. package/dist/src/profiling/profiler_service.d.ts +100 -0
  45. package/dist/src/profiling/profiler_service.d.ts.map +1 -0
  46. package/dist/src/profiling/profiler_service.js +162 -0
  47. package/dist/src/profiling/profiler_service.js.map +1 -0
  48. package/dist/src/profiling/types.d.ts +86 -0
  49. package/dist/src/profiling/types.d.ts.map +1 -0
  50. package/dist/src/profiling/types.js +5 -0
  51. package/dist/src/profiling/types.js.map +1 -0
  52. package/dist/src/registry.d.ts +28 -0
  53. package/dist/src/registry.d.ts.map +1 -1
  54. package/dist/src/registry.js +20 -0
  55. package/dist/src/registry.js.map +1 -1
  56. package/dist/src/telescope_middleware.d.ts.map +1 -1
  57. package/dist/src/telescope_middleware.js +25 -0
  58. package/dist/src/telescope_middleware.js.map +1 -1
  59. package/dist/src/ui/api.d.ts +41 -1
  60. package/dist/src/ui/api.d.ts.map +1 -1
  61. package/dist/src/ui/api.js +27 -1
  62. package/dist/src/ui/api.js.map +1 -1
  63. package/dist/src/ui/define_config.d.ts +26 -0
  64. package/dist/src/ui/define_config.d.ts.map +1 -1
  65. package/dist/src/ui/define_config.js +8 -0
  66. package/dist/src/ui/define_config.js.map +1 -1
  67. package/dist/src/ui/diagnosis_api.d.ts +33 -0
  68. package/dist/src/ui/diagnosis_api.d.ts.map +1 -0
  69. package/dist/src/ui/diagnosis_api.js +60 -0
  70. package/dist/src/ui/diagnosis_api.js.map +1 -0
  71. package/dist/src/ui/extension_api.d.ts +6 -2
  72. package/dist/src/ui/extension_api.d.ts.map +1 -1
  73. package/dist/src/ui/extension_api.js +7 -2
  74. package/dist/src/ui/extension_api.js.map +1 -1
  75. package/dist/src/ui/guard.d.ts +7 -0
  76. package/dist/src/ui/guard.d.ts.map +1 -1
  77. package/dist/src/ui/guard.js +9 -0
  78. package/dist/src/ui/guard.js.map +1 -1
  79. package/dist/src/ui/http.d.ts +7 -0
  80. package/dist/src/ui/http.d.ts.map +1 -1
  81. package/dist/src/ui/http.js +3 -0
  82. package/dist/src/ui/http.js.map +1 -1
  83. package/dist/src/ui/index.d.ts +8 -2
  84. package/dist/src/ui/index.d.ts.map +1 -1
  85. package/dist/src/ui/index.js +7 -1
  86. package/dist/src/ui/index.js.map +1 -1
  87. package/dist/src/ui/profiles_api.d.ts +48 -0
  88. package/dist/src/ui/profiles_api.d.ts.map +1 -0
  89. package/dist/src/ui/profiles_api.js +94 -0
  90. package/dist/src/ui/profiles_api.js.map +1 -0
  91. package/dist/src/ui/queue_manager_api.d.ts +46 -0
  92. package/dist/src/ui/queue_manager_api.d.ts.map +1 -0
  93. package/dist/src/ui/queue_manager_api.js +118 -0
  94. package/dist/src/ui/queue_manager_api.js.map +1 -0
  95. package/dist/src/ui/schedules_api.d.ts +43 -0
  96. package/dist/src/ui/schedules_api.d.ts.map +1 -0
  97. package/dist/src/ui/schedules_api.js +46 -0
  98. package/dist/src/ui/schedules_api.js.map +1 -0
  99. package/dist/src/watchers/cron_next_run.d.ts +8 -0
  100. package/dist/src/watchers/cron_next_run.d.ts.map +1 -0
  101. package/dist/src/watchers/cron_next_run.js +67 -0
  102. package/dist/src/watchers/cron_next_run.js.map +1 -0
  103. package/dist/src/watchers/define_config.d.ts +28 -1
  104. package/dist/src/watchers/define_config.d.ts.map +1 -1
  105. package/dist/src/watchers/define_config.js +5 -0
  106. package/dist/src/watchers/define_config.js.map +1 -1
  107. package/dist/src/watchers/index.d.ts +7 -4
  108. package/dist/src/watchers/index.d.ts.map +1 -1
  109. package/dist/src/watchers/index.js +5 -2
  110. package/dist/src/watchers/index.js.map +1 -1
  111. package/dist/src/watchers/queue_manager.d.ts +229 -0
  112. package/dist/src/watchers/queue_manager.d.ts.map +1 -0
  113. package/dist/src/watchers/queue_manager.js +223 -0
  114. package/dist/src/watchers/queue_manager.js.map +1 -0
  115. package/dist/src/watchers/schedule_watcher.d.ts +94 -1
  116. package/dist/src/watchers/schedule_watcher.d.ts.map +1 -1
  117. package/dist/src/watchers/schedule_watcher.js +83 -1
  118. package/dist/src/watchers/schedule_watcher.js.map +1 -1
  119. package/dist/stubs/config/telescope_cpu_profiling.stub +0 -0
  120. package/package.json +31 -16
@@ -0,0 +1,229 @@
1
+ /**
2
+ * The Live Queue Manager driver for the OPTIONAL `@adonisjs/queue` peer (whose engine is
3
+ * `@boringnode/queue`).
4
+ *
5
+ * ## Why this does NOT mirror `nestjs-telescope`'s `BullMqQueueManager` operation-for-operation
6
+ * `nestjs-telescope`'s `BullMqQueueManager` (`packages/bullmq/src/bull-mq-queue-manager.ts`) is
7
+ * built on BullMQ, whose `Queue` exposes: enumerate/discover queues (via Nest's `DiscoveryService`),
8
+ * `getJobCounts()` per state, `getJobs(state, start, end)` (paginated, BY STATE), `getJob(id)`,
9
+ * `job.retry()`, `job.remove()`, `job.promote()`, and `queue.add()`. `@boringnode/queue` is a
10
+ * DIFFERENT engine with a materially smaller public surface (checked against the published
11
+ * `Adapter` interface across every release from 0.5.0 through the current 0.7.1 — the `Adapter`
12
+ * type has not changed in that window):
13
+ *
14
+ * - **SUPPORTED**: `Adapter.getJob(jobId, queue)` (single job by id), `Adapter.retryJob(jobId,
15
+ * queue, retryAt?)`, `Adapter.sizeOf(queue)` (a PENDING-only count), and enqueue via
16
+ * `Adapter.push`/`Adapter.pushOn` (the lower-level calls `Job.dispatch(payload).toQueue(name)`
17
+ * resolves to).
18
+ * - **NOT SUPPORTED — no such method exists on the `Adapter` interface, in any published version**:
19
+ * listing/paginating jobs BY STATE (there is no `getJobs`/`listJobs`/`findByStatus`), removing a
20
+ * job, promoting a delayed job, or per-state counts (`sizeOf` is pending-only; there is no
21
+ * `getJobCounts` equivalent). There is also no `listQueues()` — queues are just string names
22
+ * passed at dispatch time, with no registry to enumerate.
23
+ *
24
+ * Rather than fake the missing operations (a fabricated `listJobs` that silently returns `[]`, or a
25
+ * `remove()` that no-ops and lies about succeeding), this driver ships EXACTLY what the engine
26
+ * supports and advertises the rest as absent via {@link capabilities} — the same
27
+ * "optional-method-presence advertises capability" idea `nestjs-telescope`'s `QueueManager` SPI
28
+ * uses, computed here from what the resolved adapter itself exposes rather than guessed. A
29
+ * dashboard built against this driver gets: configured queue names + a pending count, single-job
30
+ * lookup by id, retry-by-id, and enqueue — a genuinely smaller but honest console.
31
+ *
32
+ * ## Why `queues` must be configured explicitly
33
+ * `@boringnode/queue` has no `listQueues()` / registry to enumerate — queue names only exist as
34
+ * strings passed at `.toQueue(name)` / dispatch time. So, like `nestjs-telescope`'s
35
+ * `BullMqQueueManager` constructor's OPTIONAL `queueNames` allow-list (there, discovery is the
36
+ * default and the list narrows it), here the list is NOT optional: there is nothing to discover, so
37
+ * the host declares the queue names it wants surfaced (`config/telescope_watchers.ts`'s
38
+ * `queueManager.queues`).
39
+ *
40
+ * ## Why the adapter is duck-typed rather than importing `@boringnode/queue`'s types
41
+ * `@boringnode/queue` is not installed in THIS repo (same stance as `queue_watcher.ts`'s
42
+ * `AcquiredJobLike`) — it is a peer the host app brings. {@link QueueAdapterLike} /
43
+ * {@link QueueLike} model only the fields/methods this driver reads, read defensively.
44
+ * {@link QueueLike.use} — resolving a specific named adapter off the top-level `queue` service via
45
+ * `.use(name?)` — follows the standard AdonisJS "Manager" convention used throughout the framework
46
+ * (`db.connection()`, `mail.use()`, `redis.connection()`, …); it was NOT directly confirmed against
47
+ * `@boringnode/queue`'s public `.d.ts` (the research pass that grounded `retryJob`/`getJob`/`sizeOf`/
48
+ * `push`/`pushOn` did not enumerate `QueueManager`'s own top-level methods), so this is a
49
+ * well-precedented but unverified structural assumption — if a real app's `queue` service doesn't
50
+ * expose `.use()`, {@link QueueManagerDriver} falls back to treating the service AS the adapter
51
+ * directly (see `resolveAdapter`), and degrades to `configured === false` if neither shape matches.
52
+ */
53
+ /** The job-execution states `@boringnode/queue`'s own `JobStatus` type distinguishes. Named exactly
54
+ * as the engine names them (NOT remapped to BullMQ's `waiting`/`paused` vocabulary) since this
55
+ * driver is not pretending to be a BullMQ-compatible surface. */
56
+ export type QueueState = 'pending' | 'active' | 'delayed' | 'failed' | 'completed';
57
+ export declare const QUEUE_STATES: readonly QueueState[];
58
+ export declare function isQueueState(value: unknown): value is QueueState;
59
+ /** The mutating actions a driver MAY support; presence in {@link QueueManagerDriver.capabilities}
60
+ * (not mere method presence — see the module doc) is what the UI uses to show/hide the button. */
61
+ export type QueueActionName = 'retry' | 'remove' | 'promote' | 'enqueue';
62
+ export declare const QUEUE_ACTIONS: readonly QueueActionName[];
63
+ export declare function isQueueAction(value: unknown): value is QueueActionName;
64
+ /**
65
+ * Per-state job counts. Every field is `number | null` (`null` = "this driver cannot report this
66
+ * state's count") rather than a fabricated `0`, because `@boringnode/queue` genuinely cannot report
67
+ * anything beyond a pending count today (see the module doc) — `0` would silently claim "empty" for
68
+ * states the driver simply never asked about.
69
+ */
70
+ export interface QueueCounts {
71
+ pending: number | null;
72
+ active: number | null;
73
+ delayed: number | null;
74
+ failed: number | null;
75
+ completed: number | null;
76
+ }
77
+ export interface QueueSummary {
78
+ driver: string;
79
+ queue: string;
80
+ counts: QueueCounts;
81
+ /** The mutating actions available for THIS queue (currently identical across queues for this
82
+ * driver — it varies per-queue only for drivers like SQS where only some queues have a DLQ). */
83
+ actions: QueueActionName[];
84
+ }
85
+ /**
86
+ * The structural slice of `@boringnode/queue`'s `JobRecord` this driver reads. NOT verified against
87
+ * installed types (the peer isn't installed here — see the module doc); every field is optional so a
88
+ * shape drift in the engine degrades to `null`/defaults rather than throwing.
89
+ */
90
+ export interface QueueJobRecordLike {
91
+ id?: string | number;
92
+ name?: string;
93
+ queue?: string;
94
+ payload?: unknown;
95
+ status?: string;
96
+ attempts?: number;
97
+ maxAttempts?: number;
98
+ createdAt?: string | number | Date;
99
+ processedAt?: string | number | Date | null;
100
+ finishedAt?: string | number | Date | null;
101
+ error?: string | null;
102
+ result?: unknown;
103
+ }
104
+ export interface QueueJob {
105
+ id: string;
106
+ name: string | null;
107
+ /** `null` when the record's `status` isn't one of {@link QUEUE_STATES} (unknown/engine-internal). */
108
+ state: QueueState | null;
109
+ attemptsMade: number | null;
110
+ maxAttempts: number | null;
111
+ createdAt: string | null;
112
+ processedAt: string | null;
113
+ finishedAt: string | null;
114
+ failedReason: string | null;
115
+ }
116
+ export interface QueueJobDetail extends QueueJob {
117
+ payload: unknown;
118
+ result: unknown;
119
+ }
120
+ /**
121
+ * Kept for interface parity with the NestJS sibling's paginated `JobPage` and for a FUTURE driver
122
+ * that can genuinely list jobs (e.g. one that introspects a Knex-adapter jobs table directly rather
123
+ * than going through `Adapter`) — {@link QueueManagerDriver} does NOT implement `listJobs` at all
124
+ * (see the module doc), so this type is unused by the shipped driver today.
125
+ */
126
+ export interface JobPage {
127
+ jobs: QueueJob[];
128
+ nextCursor: string | null;
129
+ total: number | null;
130
+ }
131
+ /** What the UI's `GET .../queues/live` response advertises about mutation support. */
132
+ export interface QueueCapabilities {
133
+ mutationsEnabled: boolean;
134
+ actions: QueueActionName[];
135
+ }
136
+ /**
137
+ * SPI a queue manager driver implements. `listJobs`/`remove`/`promote` are OPTIONAL (presence would
138
+ * advertise capability for a future driver); {@link QueueManagerDriver} implements none of them —
139
+ * see the module doc for why.
140
+ */
141
+ export interface QueueManager {
142
+ readonly driver: string;
143
+ listQueues(): Promise<QueueSummary[]>;
144
+ getJob(queue: string, id: string): Promise<QueueJobDetail | null>;
145
+ listJobs?(queue: string, state: QueueState, page: {
146
+ cursor?: string;
147
+ limit?: number;
148
+ }): Promise<JobPage>;
149
+ retry?(queue: string, id: string): Promise<void>;
150
+ remove?(queue: string, id: string): Promise<void>;
151
+ promote?(queue: string, id: string): Promise<void>;
152
+ enqueue?(queue: string, payload: unknown, opts: {
153
+ name?: string;
154
+ }): Promise<{
155
+ id: string | null;
156
+ }>;
157
+ /**
158
+ * OPTIONAL, more precise capability advertisement than method presence: a driver whose actions
159
+ * depend on the RESOLVED RUNTIME adapter (not just which methods the class defines — see
160
+ * {@link QueueManagerDriver.capabilities}) exposes this so route handlers check it FIRST, falling
161
+ * back to `typeof manager[method] === 'function'` (the NestJS `BullMqQueueManager` convention,
162
+ * still valid for a driver whose methods are unconditionally defined) when it's absent.
163
+ */
164
+ readonly capabilities?: QueueActionName[];
165
+ }
166
+ /** The structural slice of `@boringnode/queue`'s `Adapter` interface this driver calls — confirmed
167
+ * against the published `.d.ts` (see the module doc for exactly which methods were verified). */
168
+ export interface QueueAdapterLike {
169
+ getJob(jobId: string, queue: string): Promise<QueueJobRecordLike | null>;
170
+ retryJob?(jobId: string, queue: string, retryAt?: Date): Promise<void>;
171
+ sizeOf?(queue: string): Promise<number>;
172
+ size?(): Promise<number>;
173
+ /** Enqueue onto the adapter's DEFAULT queue (the shape `Adapter.push` is documented with). */
174
+ push?(payload: unknown, opts?: Record<string, unknown>): Promise<unknown>;
175
+ /** Enqueue onto a NAMED queue (the shape `Adapter.pushOn` is documented with). Preferred over
176
+ * `push` here since this driver always has an explicit target queue. */
177
+ pushOn?(queue: string, payload: unknown, opts?: Record<string, unknown>): Promise<unknown>;
178
+ }
179
+ /** The structural slice of `@adonisjs/queue`'s exported `queue` service (itself a re-export of
180
+ * `@boringnode/queue`'s `QueueManager`) this driver resolves an adapter from. See the module doc's
181
+ * "unverified structural assumption" note on `.use()`. */
182
+ export interface QueueLike {
183
+ use?(adapterName?: string): QueueAdapterLike;
184
+ }
185
+ export interface QueueManagerDriverOptions {
186
+ /** Explicit queue names to surface — REQUIRED (see the module doc: there is no discovery API). */
187
+ queues: string[];
188
+ /** Which configured `@boringnode/queue` adapter to resolve via `queue.use(name)`. Omit to use the
189
+ * manager's own default adapter (`use()` with no argument). */
190
+ adapter?: string;
191
+ }
192
+ /**
193
+ * The Live Queue Manager driver for `@adonisjs/queue` / `@boringnode/queue`. Constructed by
194
+ * `TelescopeWatchersProvider` from `config/telescope_watchers.ts`'s `queueManager` block, exactly
195
+ * like the queue watcher's own opt-in stance: absent config / absent peer / an unresolvable adapter
196
+ * all degrade to `configured === false` (an empty, clearly-labelled UI state), never a throw.
197
+ */
198
+ export declare class QueueManagerDriver implements QueueManager {
199
+ readonly driver = "boringnode";
200
+ private readonly adapter;
201
+ private readonly queues;
202
+ constructor(queueService: QueueLike | null, options: QueueManagerDriverOptions);
203
+ /** Whether an adapter was actually resolved. `false` ⇒ every method below degrades safely
204
+ * (`listQueues` returns queues with all-null counts and no actions; `getJob` resolves `null`). */
205
+ get configured(): boolean;
206
+ /** The mutating actions this driver can genuinely perform — derived from what the RESOLVED
207
+ * adapter exposes, not guessed. `remove`/`promote` are never included: `@boringnode/queue`'s
208
+ * `Adapter` interface exposes neither (see the module doc). */
209
+ get capabilities(): QueueActionName[];
210
+ listQueues(): Promise<QueueSummary[]>;
211
+ private countsFor;
212
+ getJob(queue: string, id: string): Promise<QueueJobDetail | null>;
213
+ /** Throws when the resolved adapter has no `retryJob` — the route layer only calls this when
214
+ * {@link capabilities} already advertised `'retry'`, so this is a defensive backstop, not the
215
+ * primary gate. */
216
+ retry(queue: string, id: string): Promise<void>;
217
+ /**
218
+ * Enqueue a new job. Prefers `pushOn(queue, payload, opts)` (explicit target queue) over
219
+ * `push(payload, opts)` (the adapter's own default queue, with `queue` passed through `opts` on a
220
+ * best-effort basis — some adapters read a `queue` option, some don't; see the module doc's
221
+ * uncertainty note). Throws when neither is available.
222
+ */
223
+ enqueue(queue: string, payload: unknown, opts?: {
224
+ name?: string;
225
+ }): Promise<{
226
+ id: string | null;
227
+ }>;
228
+ }
229
+ //# sourceMappingURL=queue_manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue_manager.d.ts","sourceRoot":"","sources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,cAAc,GAAG,IAAI,CAAC;IAWvE;;wBAEoB;IACd,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOrD;;;;;OAKG;IACG,OAAO,CACX,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,IAAI,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAO,GAC3B,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CAelC"}
@@ -0,0 +1,223 @@
1
+ /**
2
+ * The Live Queue Manager driver for the OPTIONAL `@adonisjs/queue` peer (whose engine is
3
+ * `@boringnode/queue`).
4
+ *
5
+ * ## Why this does NOT mirror `nestjs-telescope`'s `BullMqQueueManager` operation-for-operation
6
+ * `nestjs-telescope`'s `BullMqQueueManager` (`packages/bullmq/src/bull-mq-queue-manager.ts`) is
7
+ * built on BullMQ, whose `Queue` exposes: enumerate/discover queues (via Nest's `DiscoveryService`),
8
+ * `getJobCounts()` per state, `getJobs(state, start, end)` (paginated, BY STATE), `getJob(id)`,
9
+ * `job.retry()`, `job.remove()`, `job.promote()`, and `queue.add()`. `@boringnode/queue` is a
10
+ * DIFFERENT engine with a materially smaller public surface (checked against the published
11
+ * `Adapter` interface across every release from 0.5.0 through the current 0.7.1 — the `Adapter`
12
+ * type has not changed in that window):
13
+ *
14
+ * - **SUPPORTED**: `Adapter.getJob(jobId, queue)` (single job by id), `Adapter.retryJob(jobId,
15
+ * queue, retryAt?)`, `Adapter.sizeOf(queue)` (a PENDING-only count), and enqueue via
16
+ * `Adapter.push`/`Adapter.pushOn` (the lower-level calls `Job.dispatch(payload).toQueue(name)`
17
+ * resolves to).
18
+ * - **NOT SUPPORTED — no such method exists on the `Adapter` interface, in any published version**:
19
+ * listing/paginating jobs BY STATE (there is no `getJobs`/`listJobs`/`findByStatus`), removing a
20
+ * job, promoting a delayed job, or per-state counts (`sizeOf` is pending-only; there is no
21
+ * `getJobCounts` equivalent). There is also no `listQueues()` — queues are just string names
22
+ * passed at dispatch time, with no registry to enumerate.
23
+ *
24
+ * Rather than fake the missing operations (a fabricated `listJobs` that silently returns `[]`, or a
25
+ * `remove()` that no-ops and lies about succeeding), this driver ships EXACTLY what the engine
26
+ * supports and advertises the rest as absent via {@link capabilities} — the same
27
+ * "optional-method-presence advertises capability" idea `nestjs-telescope`'s `QueueManager` SPI
28
+ * uses, computed here from what the resolved adapter itself exposes rather than guessed. A
29
+ * dashboard built against this driver gets: configured queue names + a pending count, single-job
30
+ * lookup by id, retry-by-id, and enqueue — a genuinely smaller but honest console.
31
+ *
32
+ * ## Why `queues` must be configured explicitly
33
+ * `@boringnode/queue` has no `listQueues()` / registry to enumerate — queue names only exist as
34
+ * strings passed at `.toQueue(name)` / dispatch time. So, like `nestjs-telescope`'s
35
+ * `BullMqQueueManager` constructor's OPTIONAL `queueNames` allow-list (there, discovery is the
36
+ * default and the list narrows it), here the list is NOT optional: there is nothing to discover, so
37
+ * the host declares the queue names it wants surfaced (`config/telescope_watchers.ts`'s
38
+ * `queueManager.queues`).
39
+ *
40
+ * ## Why the adapter is duck-typed rather than importing `@boringnode/queue`'s types
41
+ * `@boringnode/queue` is not installed in THIS repo (same stance as `queue_watcher.ts`'s
42
+ * `AcquiredJobLike`) — it is a peer the host app brings. {@link QueueAdapterLike} /
43
+ * {@link QueueLike} model only the fields/methods this driver reads, read defensively.
44
+ * {@link QueueLike.use} — resolving a specific named adapter off the top-level `queue` service via
45
+ * `.use(name?)` — follows the standard AdonisJS "Manager" convention used throughout the framework
46
+ * (`db.connection()`, `mail.use()`, `redis.connection()`, …); it was NOT directly confirmed against
47
+ * `@boringnode/queue`'s public `.d.ts` (the research pass that grounded `retryJob`/`getJob`/`sizeOf`/
48
+ * `push`/`pushOn` did not enumerate `QueueManager`'s own top-level methods), so this is a
49
+ * well-precedented but unverified structural assumption — if a real app's `queue` service doesn't
50
+ * expose `.use()`, {@link QueueManagerDriver} falls back to treating the service AS the adapter
51
+ * directly (see `resolveAdapter`), and degrades to `configured === false` if neither shape matches.
52
+ */
53
+ export const QUEUE_STATES = [
54
+ 'pending',
55
+ 'active',
56
+ 'delayed',
57
+ 'failed',
58
+ 'completed',
59
+ ];
60
+ export function isQueueState(value) {
61
+ return typeof value === 'string' && QUEUE_STATES.includes(value);
62
+ }
63
+ export const QUEUE_ACTIONS = ['retry', 'remove', 'promote', 'enqueue'];
64
+ export function isQueueAction(value) {
65
+ return typeof value === 'string' && QUEUE_ACTIONS.includes(value);
66
+ }
67
+ /** Resolve the adapter this driver calls, or `null` when it can't be reached (peer absent / `.use`
68
+ * threw / neither the Manager nor the direct-adapter shape matched) — the driver stays fully
69
+ * constructible either way; `configured` reports the outcome for the UI. */
70
+ function resolveAdapter(queueService, adapterName) {
71
+ if (queueService === null)
72
+ return null;
73
+ try {
74
+ if (typeof queueService.use === 'function') {
75
+ return queueService.use(adapterName);
76
+ }
77
+ // No `.use` — tolerate a `queue` service that IS itself adapter-shaped (e.g. a single-adapter
78
+ // setup, or a test double), rather than assuming the Manager convention unconditionally.
79
+ const asAdapter = queueService;
80
+ return typeof asAdapter.getJob === 'function' ? asAdapter : null;
81
+ }
82
+ catch {
83
+ return null;
84
+ }
85
+ }
86
+ /**
87
+ * The Live Queue Manager driver for `@adonisjs/queue` / `@boringnode/queue`. Constructed by
88
+ * `TelescopeWatchersProvider` from `config/telescope_watchers.ts`'s `queueManager` block, exactly
89
+ * like the queue watcher's own opt-in stance: absent config / absent peer / an unresolvable adapter
90
+ * all degrade to `configured === false` (an empty, clearly-labelled UI state), never a throw.
91
+ */
92
+ export class QueueManagerDriver {
93
+ driver = 'boringnode';
94
+ adapter;
95
+ queues;
96
+ constructor(queueService, options) {
97
+ this.queues = options.queues;
98
+ this.adapter = resolveAdapter(queueService, options.adapter);
99
+ }
100
+ /** Whether an adapter was actually resolved. `false` ⇒ every method below degrades safely
101
+ * (`listQueues` returns queues with all-null counts and no actions; `getJob` resolves `null`). */
102
+ get configured() {
103
+ return this.adapter !== null;
104
+ }
105
+ /** The mutating actions this driver can genuinely perform — derived from what the RESOLVED
106
+ * adapter exposes, not guessed. `remove`/`promote` are never included: `@boringnode/queue`'s
107
+ * `Adapter` interface exposes neither (see the module doc). */
108
+ get capabilities() {
109
+ if (this.adapter === null)
110
+ return [];
111
+ const actions = [];
112
+ if (typeof this.adapter.retryJob === 'function')
113
+ actions.push('retry');
114
+ if (typeof this.adapter.pushOn === 'function' || typeof this.adapter.push === 'function') {
115
+ actions.push('enqueue');
116
+ }
117
+ return actions;
118
+ }
119
+ async listQueues() {
120
+ const actions = this.capabilities;
121
+ return Promise.all(this.queues.map(async (queue) => ({
122
+ driver: this.driver,
123
+ queue,
124
+ counts: await this.countsFor(queue),
125
+ actions,
126
+ })));
127
+ }
128
+ async countsFor(queue) {
129
+ const counts = {
130
+ pending: null,
131
+ active: null,
132
+ delayed: null,
133
+ failed: null,
134
+ completed: null,
135
+ };
136
+ if (this.adapter && typeof this.adapter.sizeOf === 'function') {
137
+ try {
138
+ counts.pending = await this.adapter.sizeOf(queue);
139
+ }
140
+ catch {
141
+ // A count failure degrades to "unknown", never breaks the queue list.
142
+ }
143
+ }
144
+ return counts;
145
+ }
146
+ async getJob(queue, id) {
147
+ if (this.adapter === null)
148
+ return null;
149
+ const raw = await this.adapter.getJob(id, queue);
150
+ if (raw === null || raw === undefined)
151
+ return null;
152
+ return {
153
+ ...toJob(raw),
154
+ payload: raw.payload ?? null,
155
+ result: raw.result ?? null,
156
+ };
157
+ }
158
+ /** Throws when the resolved adapter has no `retryJob` — the route layer only calls this when
159
+ * {@link capabilities} already advertised `'retry'`, so this is a defensive backstop, not the
160
+ * primary gate. */
161
+ async retry(queue, id) {
162
+ if (!this.adapter?.retryJob) {
163
+ throw new Error('This queue adapter does not support retrying a job.');
164
+ }
165
+ await this.adapter.retryJob(id, queue);
166
+ }
167
+ /**
168
+ * Enqueue a new job. Prefers `pushOn(queue, payload, opts)` (explicit target queue) over
169
+ * `push(payload, opts)` (the adapter's own default queue, with `queue` passed through `opts` on a
170
+ * best-effort basis — some adapters read a `queue` option, some don't; see the module doc's
171
+ * uncertainty note). Throws when neither is available.
172
+ */
173
+ async enqueue(queue, payload, opts = {}) {
174
+ if (this.adapter === null) {
175
+ throw new Error('The queue adapter is not configured.');
176
+ }
177
+ const pushOpts = opts.name !== undefined ? { name: opts.name } : {};
178
+ if (typeof this.adapter.pushOn === 'function') {
179
+ const result = await this.adapter.pushOn(queue, payload, pushOpts);
180
+ return { id: idOf(result) };
181
+ }
182
+ if (typeof this.adapter.push === 'function') {
183
+ const result = await this.adapter.push(payload, { ...pushOpts, queue });
184
+ return { id: idOf(result) };
185
+ }
186
+ throw new Error('This queue adapter does not support enqueueing a job.');
187
+ }
188
+ }
189
+ /** Map a raw job record to its public {@link QueueJob} projection. */
190
+ function toJob(raw) {
191
+ const status = typeof raw.status === 'string' ? raw.status : undefined;
192
+ return {
193
+ id: String(raw.id ?? ''),
194
+ name: typeof raw.name === 'string' ? raw.name : null,
195
+ state: isQueueState(status) ? status : null,
196
+ attemptsMade: typeof raw.attempts === 'number' ? raw.attempts : null,
197
+ maxAttempts: typeof raw.maxAttempts === 'number' ? raw.maxAttempts : null,
198
+ createdAt: toIso(raw.createdAt),
199
+ processedAt: toIso(raw.processedAt),
200
+ finishedAt: toIso(raw.finishedAt),
201
+ failedReason: typeof raw.error === 'string' ? raw.error : null,
202
+ };
203
+ }
204
+ function toIso(value) {
205
+ if (value === null || value === undefined)
206
+ return null;
207
+ const date = value instanceof Date ? value : new Date(value);
208
+ return Number.isNaN(date.getTime()) ? null : date.toISOString();
209
+ }
210
+ /** Best-effort extraction of an id off whatever `push`/`pushOn`/`retryJob` resolve with — the exact
211
+ * return shape of the `Adapter` push family wasn't confirmed (see the module doc), so this reads
212
+ * defensively rather than assuming a specific shape. */
213
+ function idOf(result) {
214
+ if (typeof result === 'string' || typeof result === 'number')
215
+ return String(result);
216
+ if (result && typeof result === 'object' && 'id' in result) {
217
+ const id = result.id;
218
+ if (typeof id === 'string' || typeof id === 'number')
219
+ return String(id);
220
+ }
221
+ return null;
222
+ }
223
+ //# sourceMappingURL=queue_manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue_manager.js","sourceRoot":"","sources":["../../../src/watchers/queue_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAOH,MAAM,CAAC,MAAM,YAAY,GAA0B;IACjD,SAAS;IACT,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,WAAW;CACZ,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,YAAkC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC1F,CAAC;AAMD,MAAM,CAAC,MAAM,aAAa,GAA+B,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAEnG,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,aAAmC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC3F,CAAC;AA8ID;;6EAE6E;AAC7E,SAAS,cAAc,CACrB,YAA8B,EAC9B,WAA+B;IAE/B,IAAI,YAAY,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,CAAC;QACH,IAAI,OAAO,YAAY,CAAC,GAAG,KAAK,UAAU,EAAE,CAAC;YAC3C,OAAO,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACvC,CAAC;QACD,8FAA8F;QAC9F,yFAAyF;QACzF,MAAM,SAAS,GAAG,YAA2C,CAAC;QAC9D,OAAO,OAAO,SAAS,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;IACnE,CAAC;I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,QAAQ;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;IACpF,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;QAC3D,MAAM,EAAE,GAAI,MAA2B,CAAC,EAAE,CAAC;QAC3C,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAQ;YAAE,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -58,6 +58,43 @@ export interface ScheduledTaskOptions {
58
58
  /** The schedule kind. Default `'cron'`. */
59
59
  kind?: ScheduleKind;
60
60
  }
61
+ /**
62
+ * A registration describing "this scheduled task EXISTS" — independent of any individual run. See
63
+ * {@link ScheduleWatcher.register} for why this is a separate call from {@link ScheduledRun}.
64
+ */
65
+ export interface ScheduleRegistration {
66
+ /** The task name. Re-registering the same name REPLACES the prior registration (idempotent). */
67
+ name: string;
68
+ /** The cron/interval expression (e.g. `'0 * * * *'`), when the schedule has one. */
69
+ schedule?: string | null;
70
+ /** The schedule kind. Default `'cron'`. */
71
+ kind?: ScheduleKind;
72
+ /**
73
+ * IANA timezone the cron expression is evaluated in (e.g. `'America/Sao_Paulo'`). Only meaningful
74
+ * for `kind: 'cron'`; passed straight through to `cron-parser`. Defaults to the server's local TZ.
75
+ */
76
+ timezone?: string | null;
77
+ }
78
+ /**
79
+ * A registered schedule enriched with its computed next-run time — what
80
+ * {@link ScheduleWatcher.list} / {@link listRegisteredSchedules} return. Deliberately does NOT
81
+ * include last-run data (status/duration/lastRunAt): that lives in the recorded `scheduled_task`
82
+ * entries this same watcher writes, and joining the two is the UI API layer's job (it already holds
83
+ * a `TelescopeService` to query them) — the registry itself only knows what was registered.
84
+ */
85
+ export interface RegisteredSchedule {
86
+ name: string;
87
+ kind: ScheduleKind;
88
+ schedule: string | null;
89
+ timezone: string | null;
90
+ /**
91
+ * ISO timestamp of the next fire, computed from `schedule` via `cron-parser` (see
92
+ * `cron_next_run.ts`). `null` when: the kind isn't `'cron'`, no `schedule` was given, the OPTIONAL
93
+ * `cron-parser` peer isn't installed, or the expression failed to parse — every case is a genuine
94
+ * "unknown", not an error.
95
+ */
96
+ nextRunAt: string | null;
97
+ }
61
98
  /**
62
99
  * Records each scheduled-task run as a `scheduled_task` telescope entry — capturing
63
100
  * the task name, cron/interval expression, duration and outcome
@@ -86,6 +123,23 @@ export interface ScheduledTaskOptions {
86
123
  * is fire-and-forget and fully guarded: a telescope failure can never break (or
87
124
  * delay) a scheduled task.
88
125
  *
126
+ * ## The "Live Schedules" registry — the same explicit-integration philosophy, one layer up
127
+ * `recordScheduledRun`/`scheduleTask` answer "what already ran?"; they say nothing about "what
128
+ * schedules EXIST and when will they next fire?" — because, per the section above, AdonisJS gives us
129
+ * no registry of that to read (no `@Cron()` scanning, no `SchedulerRegistry`). {@link register} /
130
+ * {@link registerSchedule} closes that gap the same way: an EXPLICIT, idempotent call the host makes
131
+ * once per scheduled task (typically right next to where it wires the task into whatever scheduler
132
+ * it uses — `adonisjs-scheduler`, `@adonis-agora/durable`'s `@Scheduled`, a hand-rolled interval,
133
+ * …), analogous to how `nestjs-telescope`'s schedule package reads `@nestjs/schedule`'s
134
+ * `SchedulerRegistry` — except here nothing can be read, only told.
135
+ *
136
+ * `nextRunAt` is computed from the registered cron expression via the OPTIONAL `cron-parser` peer
137
+ * (see `cron_next_run.ts`); it is `null` for non-cron kinds or when the peer is absent — an honest
138
+ * "unknown" rather than a guess. There is deliberately no `running`/active-state field (unlike the
139
+ * NestJS `ScheduledTask.running`, which reads a real `CronJob.running` flag off `@nestjs/schedule`'s
140
+ * internals): AdonisJS has no equivalent object to read a running/stopped flag off, so faking one
141
+ * would be strictly worse than omitting it.
142
+ *
89
143
  * Idiomatic Adonis: a plain class, no DI decorators. The provider constructs it
90
144
  * from `config/telescope_watchers.ts` and calls {@link start} to publish it as the
91
145
  * default backing the bare {@link scheduleTask} / {@link recordScheduledRun}
@@ -95,13 +149,33 @@ export declare class ScheduleWatcher {
95
149
  readonly type: "scheduled_task";
96
150
  private readonly slowMs;
97
151
  private readonly clock;
152
+ private readonly registrations;
98
153
  constructor(options?: ScheduleWatcherOptions);
99
154
  /** Publish this configured instance as the default the standalone helpers
100
155
  * inherit. Does NOT patch any global. Named `start`/`stop` to match the other
101
156
  * watchers' provider lifecycle. */
102
157
  start(): void;
103
- /** Unpublish this instance as the default (if it is). Never touches globals. */
158
+ /** Unpublish this instance as the default (if it is). Never touches globals. Registrations are
159
+ * kept (a `stop`/`start` cycle — e.g. hot reload — shouldn't lose them), so a fresh `start()`
160
+ * sees the same registry; call {@link unregister} explicitly to drop one. */
104
161
  stop(): void;
162
+ /**
163
+ * Register (or re-register — idempotent by `name`) a schedule so it shows up in
164
+ * {@link list} with a computed `nextRunAt`, joined against its `scheduled_task` run history by the
165
+ * UI layer. Call this once per scheduled task, e.g. right after wiring it into your scheduler:
166
+ *
167
+ * @example
168
+ * import { registerSchedule, scheduleTask } from '@adonis-agora/telescope/watchers'
169
+ * registerSchedule({ name: 'prune-sessions', schedule: '0 * * * *', kind: 'cron' })
170
+ * scheduler.call(() => scheduleTask('prune-sessions', () => Session.pruneExpired(), {
171
+ * schedule: '0 * * * *',
172
+ * })).hourly()
173
+ */
174
+ register(registration: ScheduleRegistration): void;
175
+ /** Drop a registration (the task was removed / the app is shutting it down). No-op if unknown. */
176
+ unregister(name: string): void;
177
+ /** Every registered schedule, with `nextRunAt` computed from `now`. Order is registration order. */
178
+ list(): RegisteredSchedule[];
105
179
  /** Record one already-completed scheduled run. Fire-and-forget; never throws. */
106
180
  record(run: ScheduledRun): void;
107
181
  /**
@@ -119,6 +193,25 @@ export declare class ScheduleWatcher {
119
193
  /** Map a scheduled run to a telescope {@link RecordInput}. Exported so the entry
120
194
  * shape can be unit-tested without a live watcher. */
121
195
  export declare function buildScheduleEntry(run: ScheduledRun, slowMs?: number): RecordInput<ScheduleEntryContent>;
196
+ /** Map a registration + "now" to its {@link RegisteredSchedule}, computing `nextRunAt` for
197
+ * `cron`-kind entries. Exported so it's unit-testable without a live watcher. */
198
+ export declare function toRegisteredSchedule(reg: ScheduleRegistration, nowMs: number): RegisteredSchedule;
199
+ /**
200
+ * Register (or re-register) a schedule through the provider-published default watcher, so it shows
201
+ * up in the dashboard's Live Schedules view. A NO-OP when the schedule watcher is not enabled, so
202
+ * it's safe to call unconditionally (e.g. at the top of a boot file that wires up cron jobs).
203
+ *
204
+ * @example
205
+ * import { registerSchedule } from '@adonis-agora/telescope/watchers'
206
+ * registerSchedule({ name: 'prune-sessions', schedule: '0 * * * *', kind: 'cron' })
207
+ */
208
+ export declare function registerSchedule(registration: ScheduleRegistration): void;
209
+ /** Drop a registration through the provider-published default watcher. A no-op when the schedule
210
+ * watcher is not enabled or the name was never registered. */
211
+ export declare function unregisterSchedule(name: string): void;
212
+ /** Every registered schedule (with computed `nextRunAt`) through the provider-published default
213
+ * watcher, or `[]` when the schedule watcher is not enabled. */
214
+ export declare function listRegisteredSchedules(): RegisteredSchedule[];
122
215
  /**
123
216
  * Record one scheduled-task run through the provider-published default watcher.
124
217
  * A NO-OP when the schedule watcher is not enabled, so it is safe to call from a
@@ -1 +1 @@
1
- {"version":3,"file":"schedule_watcher.d.ts","sourceRoot":"","sources":["../../../src/watchers/schedule_watcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1D,sDAAsD;AACtD,eAAO,MAAM,yBAAyB,kBAA0B,CAAC;AAEjE,2DAA2D;AAC3D,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEvD,4EAA4E;AAC5E,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE1D,qDAAqD;AACrD,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;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