@lensmcp/protocol-types 1.25.0 → 1.25.2

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.
@@ -516,7 +516,9 @@ export interface DashLogsFrame {
516
516
  export type DashProblemSeverity = 'high' | 'medium' | 'low';
517
517
  export type DashProblemKind = 'n-plus-one' | 'db-in-loop' | 'render-storm' | 'slow-path' | 'slow-route' | 'slow-query' | 'missing-index' | 'leak' | 'server-error' | 'browser-error' | 'failed-span' | 'egress-failing' | 'egress-slow' | 'duplicate-requests' | 'build' | 'typecheck' | 'lint' | 'service'
518
518
  /** A performance rule's finding (`perf://rules`): build or memory cost, with its fix and how to verify it. */
519
- | 'perf-rule' | 'other';
519
+ | 'perf-rule'
520
+ /** A service could not get a database connection, and why (`db://pool`): a hot swap or a blocked loop, a full pool, Postgres full. */
521
+ | 'db-connection' | 'other';
520
522
  export interface DashProblem {
521
523
  /** Stable across updates — the card's identity for the resolved-lifecycle. */
522
524
  id: string;
@@ -1233,6 +1235,62 @@ export interface DashDbStore {
1233
1235
  /** Connections to the server, all databases. */
1234
1236
  connections?: number;
1235
1237
  }
1238
+ /**
1239
+ * Data › Databases › Connections: who holds the server's connections, against its limit — read from `pg_stat_activity`
1240
+ * (every database on the server: `max_connections` is the server's). A connection the lens's pg tap opened names its
1241
+ * service and app generation (`foodguard lens:engine:g12`), so a generation a hot swap replaced shows apart.
1242
+ */
1243
+ export interface DashDbConnections {
1244
+ at: number;
1245
+ store: string;
1246
+ state: 'ok' | 'error';
1247
+ reason?: string;
1248
+ /** `max_connections`, and the slots kept for superusers and `pg_use_reserved_connections` — what the apps cannot use. */
1249
+ max?: number;
1250
+ reserved?: number;
1251
+ /** Client connections now (every database). */
1252
+ used?: number;
1253
+ /** One row per application name (and database), the most connections first. */
1254
+ apps: DashDbConnApp[];
1255
+ /** The sessions worth a look: open in a transaction, waiting on a lock, or running for over a second. */
1256
+ sessions: DashDbConnSession[];
1257
+ }
1258
+ export interface DashDbConnApp {
1259
+ /** As Postgres has it: `foodguard lens:engine:g12`. */
1260
+ app: string;
1261
+ /** From the lens's tag: the service, and the app generation that opened the connections. */
1262
+ service?: string;
1263
+ generation?: number;
1264
+ /** An older generation of a service whose newer one holds connections too — a hot swap that never closed its pool. */
1265
+ leftover?: boolean;
1266
+ database?: string;
1267
+ total: number;
1268
+ active: number;
1269
+ idle: number;
1270
+ idleInTransaction: number;
1271
+ waiting: number;
1272
+ /** The oldest of these connections, ms. */
1273
+ oldestMs?: number;
1274
+ }
1275
+ export interface DashDbConnSession {
1276
+ pid: number;
1277
+ app: string;
1278
+ service?: string;
1279
+ generation?: number;
1280
+ database?: string;
1281
+ state: string;
1282
+ /** `Lock: transactionid` — what it waits on. */
1283
+ waiting?: string;
1284
+ /** How long its transaction has been open, and how long it has been in this state, ms. */
1285
+ xactMs?: number;
1286
+ stateMs?: number;
1287
+ /** Its statement as a shape (no values): the SQL catalog's id, name and template. */
1288
+ statement?: {
1289
+ id: string;
1290
+ name?: string;
1291
+ text: string;
1292
+ };
1293
+ }
1236
1294
  export interface DashDbDatabase {
1237
1295
  name: string;
1238
1296
  bytes?: number;
@@ -1912,6 +1970,8 @@ export interface DashAiRun {
1912
1970
  workspace: string;
1913
1971
  /** `queued`: waiting for a free slot (`queue` says how many are ahead); one job per target, at most N at once. */
1914
1972
  status: 'queued' | 'running' | 'done' | 'failed';
1973
+ /** Started by itself (Settings › Features — a route that changed, a statement once named); absent: someone asked. */
1974
+ trigger?: 'auto';
1915
1975
  queue?: {
1916
1976
  ahead: number;
1917
1977
  max: number;
@@ -2060,6 +2120,66 @@ export interface DashReviewMark {
2060
2120
  overall?: number;
2061
2121
  warning?: boolean;
2062
2122
  }
2123
+ /**
2124
+ * A target's review as a drawer or a list shows it without opening it — read only, nothing is started
2125
+ * (`/api/ai/review-status`, `/api/ai/review-marks`). `none`: never reviewed; `reviewing`: a run waits or runs now
2126
+ * (`progress`); `reviewed`: its newest review holds, as far as the lens has checked (`checkedAt`); `stale`: it no
2127
+ * longer holds — the thing or the instructions changed since (`why`); `failed`: the newest run failed (`why`). The
2128
+ * newest finished review comes with each state but `none`.
2129
+ */
2130
+ export interface DashReviewStatus {
2131
+ /** `<kind>:<id>`. */
2132
+ target: string;
2133
+ state: 'none' | 'reviewing' | 'reviewed' | 'stale' | 'failed';
2134
+ /** Why it is out of date, or why its newest run failed. */
2135
+ why?: string;
2136
+ /** When the lens last asked the analyzer whether the review still holds against the thing as it is now; absent: not yet. */
2137
+ checkedAt?: number;
2138
+ review?: DashReviewSummary;
2139
+ /** The run waiting or running now: its step, how many are ahead of it, how far Claude got. */
2140
+ progress?: {
2141
+ runId: string;
2142
+ status: 'queued' | 'running';
2143
+ startedAt: number;
2144
+ step?: string;
2145
+ ahead?: number;
2146
+ turns?: number;
2147
+ tools?: number;
2148
+ };
2149
+ /** The newest run, when it failed: when, and its error. */
2150
+ failed?: {
2151
+ runId: string;
2152
+ at: number;
2153
+ error: string;
2154
+ };
2155
+ }
2156
+ /** A finished review in a few lines: when, its score, what it is about, the changes it asks for first. */
2157
+ export interface DashReviewSummary {
2158
+ runId: string;
2159
+ at: number;
2160
+ analyzerName: string;
2161
+ overall?: number;
2162
+ /** Under the indicator set's line (70): a warning to coding agents. */
2163
+ warning?: boolean;
2164
+ /** What the reviewed thing is, as the review named it. */
2165
+ title?: string;
2166
+ /** The review's own summary, clipped — in a drawer's status (`review-status`), not in a list's marks. */
2167
+ summary?: string;
2168
+ /** How many changes it asks for, and the first three, most worth doing first. */
2169
+ findings: number;
2170
+ top: Array<{
2171
+ priority: DashAiFinding['priority'];
2172
+ title: string;
2173
+ }>;
2174
+ /** A statement reviewed only in an earlier version under its name: that version's id. */
2175
+ of?: string;
2176
+ }
2177
+ /** `/api/ai/review-marks?kind=`: each target of a kind with a review or a run, by its id — a list's review chip. */
2178
+ export interface DashReviewMarks {
2179
+ at: number;
2180
+ kind: DashAiRun['target']['kind'];
2181
+ marks: Record<string, DashReviewStatus>;
2182
+ }
2063
2183
  /** What became of a suggestion: new, accepted (for a coding agent to do), applied, or dismissed. */
2064
2184
  export type DashSuggestionState = 'new' | 'accepted' | 'applied' | 'dismissed';
2065
2185
  /**
package/lib/dashboard.js CHANGED
@@ -1 +1 @@
1
- "use strict";export const DASHBOARD_PROTOCOL=1,DASH_PERF_KINDS=["n-plus-one","db-in-loop","render-storm","slow-path","slow-route","slow-query","missing-index","leak","egress-slow","duplicate-requests","perf-rule","other"];
1
+ "use strict";export const DASHBOARD_PROTOCOL=1,DASH_PERF_KINDS=["n-plus-one","db-in-loop","render-storm","slow-path","slow-route","slow-query","missing-index","leak","egress-slow","duplicate-requests","perf-rule","db-connection","other"];
package/lib/event.d.ts CHANGED
@@ -47,10 +47,10 @@ export declare const EventCategorySchema: z.ZodEnum<{
47
47
  }>;
48
48
  export type EventCategory = z.infer<typeof EventCategorySchema>;
49
49
  export declare const SeveritySchema: z.ZodEnum<{
50
+ error: "error";
50
51
  debug: "debug";
51
52
  info: "info";
52
53
  warning: "warning";
53
- error: "error";
54
54
  fatal: "fatal";
55
55
  }>;
56
56
  export type Severity = z.infer<typeof SeveritySchema>;
@@ -104,10 +104,10 @@ export declare const BaseEventSchema: z.ZodObject<{
104
104
  agent: "agent";
105
105
  }>;
106
106
  severity: z.ZodEnum<{
107
+ error: "error";
107
108
  debug: "debug";
108
109
  info: "info";
109
110
  warning: "warning";
110
- error: "error";
111
111
  fatal: "fatal";
112
112
  }>;
113
113
  context: z.ZodObject<{
@@ -14,18 +14,18 @@ export declare const ResourceEnvelopeSchema: z.ZodObject<{
14
14
  export type ResourceEnvelope = z.infer<typeof ResourceEnvelopeSchema>;
15
15
  export declare const AgentStatusKindSchema: z.ZodEnum<{
16
16
  warning: "warning";
17
- starting: "starting";
18
17
  clean: "clean";
19
18
  failing: "failing";
19
+ starting: "starting";
20
20
  }>;
21
21
  export type AgentStatusKind = z.infer<typeof AgentStatusKindSchema>;
22
22
  export declare const AgentBlockingItemSchema: z.ZodObject<{
23
23
  source: z.ZodString;
24
24
  severity: z.ZodEnum<{
25
+ error: "error";
25
26
  debug: "debug";
26
27
  info: "info";
27
28
  warning: "warning";
28
- error: "error";
29
29
  fatal: "fatal";
30
30
  }>;
31
31
  title: z.ZodString;
@@ -50,36 +50,36 @@ export type AgentBlockingItem = z.infer<typeof AgentBlockingItemSchema>;
50
50
  export declare const AgentChecksSchema: z.ZodObject<{
51
51
  typecheck: z.ZodOptional<z.ZodEnum<{
52
52
  unknown: "unknown";
53
- failed: "failed";
54
53
  passed: "passed";
54
+ failed: "failed";
55
55
  }>>;
56
56
  lint: z.ZodOptional<z.ZodEnum<{
57
57
  unknown: "unknown";
58
- failed: "failed";
59
58
  passed: "passed";
59
+ failed: "failed";
60
60
  }>>;
61
61
  build: z.ZodOptional<z.ZodEnum<{
62
62
  unknown: "unknown";
63
- failed: "failed";
64
63
  passed: "passed";
64
+ failed: "failed";
65
65
  }>>;
66
66
  runtime: z.ZodOptional<z.ZodEnum<{
67
67
  warning: "warning";
68
68
  unknown: "unknown";
69
- failed: "failed";
70
69
  passed: "passed";
70
+ failed: "failed";
71
71
  }>>;
72
72
  visual: z.ZodOptional<z.ZodEnum<{
73
73
  warning: "warning";
74
74
  unknown: "unknown";
75
- failed: "failed";
76
75
  passed: "passed";
76
+ failed: "failed";
77
77
  }>>;
78
78
  memory: z.ZodOptional<z.ZodEnum<{
79
79
  warning: "warning";
80
80
  unknown: "unknown";
81
- failed: "failed";
82
81
  passed: "passed";
82
+ failed: "failed";
83
83
  }>>;
84
84
  }, z.core.$strip>;
85
85
  /**
@@ -114,19 +114,19 @@ export declare const AgentCurrentStatusSchema: z.ZodObject<{
114
114
  sessionId: z.ZodString;
115
115
  status: z.ZodEnum<{
116
116
  warning: "warning";
117
- starting: "starting";
118
117
  clean: "clean";
119
118
  failing: "failing";
119
+ starting: "starting";
120
120
  }>;
121
121
  activeTab: z.ZodOptional<z.ZodString>;
122
122
  tabsWithIssues: z.ZodOptional<z.ZodArray<z.ZodString>>;
123
123
  blocking: z.ZodArray<z.ZodObject<{
124
124
  source: z.ZodString;
125
125
  severity: z.ZodEnum<{
126
+ error: "error";
126
127
  debug: "debug";
127
128
  info: "info";
128
129
  warning: "warning";
129
- error: "error";
130
130
  fatal: "fatal";
131
131
  }>;
132
132
  title: z.ZodString;
@@ -150,10 +150,10 @@ export declare const AgentCurrentStatusSchema: z.ZodObject<{
150
150
  warnings: z.ZodDefault<z.ZodArray<z.ZodObject<{
151
151
  source: z.ZodString;
152
152
  severity: z.ZodEnum<{
153
+ error: "error";
153
154
  debug: "debug";
154
155
  info: "info";
155
156
  warning: "warning";
156
- error: "error";
157
157
  fatal: "fatal";
158
158
  }>;
159
159
  title: z.ZodString;
@@ -178,36 +178,36 @@ export declare const AgentCurrentStatusSchema: z.ZodObject<{
178
178
  checks: z.ZodOptional<z.ZodObject<{
179
179
  typecheck: z.ZodOptional<z.ZodEnum<{
180
180
  unknown: "unknown";
181
- failed: "failed";
182
181
  passed: "passed";
182
+ failed: "failed";
183
183
  }>>;
184
184
  lint: z.ZodOptional<z.ZodEnum<{
185
185
  unknown: "unknown";
186
- failed: "failed";
187
186
  passed: "passed";
187
+ failed: "failed";
188
188
  }>>;
189
189
  build: z.ZodOptional<z.ZodEnum<{
190
190
  unknown: "unknown";
191
- failed: "failed";
192
191
  passed: "passed";
192
+ failed: "failed";
193
193
  }>>;
194
194
  runtime: z.ZodOptional<z.ZodEnum<{
195
195
  warning: "warning";
196
196
  unknown: "unknown";
197
- failed: "failed";
198
197
  passed: "passed";
198
+ failed: "failed";
199
199
  }>>;
200
200
  visual: z.ZodOptional<z.ZodEnum<{
201
201
  warning: "warning";
202
202
  unknown: "unknown";
203
- failed: "failed";
204
203
  passed: "passed";
204
+ failed: "failed";
205
205
  }>>;
206
206
  memory: z.ZodOptional<z.ZodEnum<{
207
207
  warning: "warning";
208
208
  unknown: "unknown";
209
- failed: "failed";
210
209
  passed: "passed";
210
+ failed: "failed";
211
211
  }>>;
212
212
  }, z.core.$strip>>;
213
213
  server: z.ZodOptional<z.ZodObject<{
@@ -327,10 +327,10 @@ declare const CheckEntrySchema: z.ZodObject<{
327
327
  code: z.ZodOptional<z.ZodString>;
328
328
  rule: z.ZodOptional<z.ZodString>;
329
329
  severity: z.ZodOptional<z.ZodEnum<{
330
+ error: "error";
330
331
  debug: "debug";
331
332
  info: "info";
332
333
  warning: "warning";
333
- error: "error";
334
334
  fatal: "fatal";
335
335
  }>>;
336
336
  file: z.ZodOptional<z.ZodString>;
@@ -356,9 +356,9 @@ export declare const TypecheckCurrentSchema: z.ZodObject<{
356
356
  lastReportedAt: z.ZodNumber;
357
357
  lastRunStatus: z.ZodEnum<{
358
358
  error: "error";
359
+ running: "running";
359
360
  clean: "clean";
360
361
  failing: "failing";
361
- running: "running";
362
362
  }>;
363
363
  lastRunDurationMs: z.ZodOptional<z.ZodNumber>;
364
364
  errorCount: z.ZodNumber;
@@ -395,9 +395,9 @@ export declare const TypecheckErrorsSchema: z.ZodObject<{
395
395
  lastReportedAt: z.ZodNumber;
396
396
  lastRunStatus: z.ZodEnum<{
397
397
  error: "error";
398
+ running: "running";
398
399
  clean: "clean";
399
400
  failing: "failing";
400
- running: "running";
401
401
  }>;
402
402
  lastRunDurationMs: z.ZodOptional<z.ZodNumber>;
403
403
  errorCount: z.ZodNumber;
@@ -416,10 +416,10 @@ export declare const TypecheckErrorsSchema: z.ZodObject<{
416
416
  code: z.ZodOptional<z.ZodString>;
417
417
  rule: z.ZodOptional<z.ZodString>;
418
418
  severity: z.ZodOptional<z.ZodEnum<{
419
+ error: "error";
419
420
  debug: "debug";
420
421
  info: "info";
421
422
  warning: "warning";
422
- error: "error";
423
423
  fatal: "fatal";
424
424
  }>>;
425
425
  file: z.ZodOptional<z.ZodString>;
@@ -446,9 +446,9 @@ export declare const LintCurrentSchema: z.ZodObject<{
446
446
  lastReportedAt: z.ZodNumber;
447
447
  lastRunStatus: z.ZodEnum<{
448
448
  error: "error";
449
+ running: "running";
449
450
  clean: "clean";
450
451
  failing: "failing";
451
- running: "running";
452
452
  }>;
453
453
  lastRunDurationMs: z.ZodOptional<z.ZodNumber>;
454
454
  errorCount: z.ZodNumber;
@@ -487,9 +487,9 @@ export declare const BuildCurrentSchema: z.ZodObject<{
487
487
  lastReportedAt: z.ZodNumber;
488
488
  lastRunStatus: z.ZodEnum<{
489
489
  error: "error";
490
+ running: "running";
490
491
  clean: "clean";
491
492
  failing: "failing";
492
- running: "running";
493
493
  }>;
494
494
  lastRunDurationMs: z.ZodOptional<z.ZodNumber>;
495
495
  errorCount: z.ZodNumber;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.25.0",
3
+ "version": "1.25.2",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",