@lensmcp/protocol-types 1.25.24 → 1.25.26

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.
package/index.d.ts CHANGED
@@ -22,3 +22,5 @@ export * from './lib/perf-rules.js';
22
22
  export * from './lib/sources.js';
23
23
  export * from './lib/page-visit.js';
24
24
  export * from './lib/replay.js';
25
+ export * from './lib/event-loop.js';
26
+ export * from './lib/workspace-actions.js';
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";
1
+ "use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";
@@ -295,6 +295,85 @@ export interface DashWorktree {
295
295
  data?: string[];
296
296
  updatedAt?: string;
297
297
  }
298
+ /** Worktree management always runs on the main checkout's dashboard. */
299
+ export interface DashWorktreeManagement {
300
+ mainRoot: string;
301
+ managementUrl: string;
302
+ canManage: boolean;
303
+ worktrees: Array<{
304
+ key: string;
305
+ name: string;
306
+ root: string;
307
+ state: string;
308
+ branch?: string;
309
+ createdByLens: boolean;
310
+ data: string[];
311
+ }>;
312
+ }
313
+ export interface DashCheckoutChanges {
314
+ root: string;
315
+ head: string;
316
+ branch?: string;
317
+ changes: Array<{
318
+ path: string;
319
+ staged: string;
320
+ unstaged: string;
321
+ from?: string;
322
+ }>;
323
+ }
324
+ export interface DashWorktreeComparison {
325
+ at: number;
326
+ mode: 'working' | 'committed';
327
+ main: DashCheckoutChanges;
328
+ worktree: DashCheckoutChanges;
329
+ ahead: number;
330
+ behind: number;
331
+ files: Array<{
332
+ path: string;
333
+ kind: 'added' | 'deleted' | 'modified';
334
+ binary?: boolean;
335
+ unavailable?: string;
336
+ added?: number;
337
+ removed?: number;
338
+ }>;
339
+ total: number;
340
+ nextOffset?: number;
341
+ partial: boolean;
342
+ notes: string[];
343
+ }
344
+ export interface DashWorktreePatch {
345
+ path: string;
346
+ text?: string;
347
+ unavailable?: string;
348
+ truncated?: boolean;
349
+ }
350
+ export interface DashWorktreeRemoval {
351
+ token: string;
352
+ key: string;
353
+ name: string;
354
+ root: string;
355
+ directoryExists: boolean;
356
+ branch?: string;
357
+ changes: DashCheckoutChanges['changes'];
358
+ ahead: number;
359
+ data: string[];
360
+ canRemove: boolean;
361
+ reason?: string;
362
+ }
363
+ export interface DashWorktreeAction {
364
+ id: string;
365
+ key: string;
366
+ action: 'stop' | 'remove';
367
+ state: 'running' | 'succeeded' | 'failed';
368
+ stage: string;
369
+ startedAt: number;
370
+ finishedAt?: number;
371
+ error?: string;
372
+ directoryExists?: boolean;
373
+ remainingData?: string[];
374
+ remainingDataOmitted?: number;
375
+ branch?: string;
376
+ }
298
377
  export interface DashKpis {
299
378
  at: number;
300
379
  /** The window `last` covers, in seconds. */
@@ -513,6 +592,7 @@ export interface DashSegmentStats {
513
592
  }
514
593
  export interface DashFlowDetail {
515
594
  flowId: string;
595
+ eventLoopIncidents?: import('./event-loop.js').EventLoopIncident[];
516
596
  /** The reducer's own summary (kept as-is for older consumers). */
517
597
  summary: unknown;
518
598
  events: DashFlowNode[];
@@ -0,0 +1,65 @@
1
+ /** A loop is a process/thread lifetime or a browser document, never just a service name. */
2
+ export interface EventLoopIdentity {
3
+ id: string;
4
+ runtime: 'node' | 'browser';
5
+ project: string;
6
+ pid?: number;
7
+ threadId?: number;
8
+ tabId?: string;
9
+ loadId?: string;
10
+ }
11
+ export interface EventLoopScript {
12
+ url: string;
13
+ functionName?: string;
14
+ invoker?: string;
15
+ durationMs: number;
16
+ startAt: number;
17
+ }
18
+ export interface EventLoopEvidence {
19
+ eventId: string;
20
+ title: string;
21
+ kind: string;
22
+ startAt: number;
23
+ endAt: number;
24
+ flowId?: string;
25
+ requestId?: string;
26
+ /** Wall-time overlap is association, never proof that this operation blocked the loop. */
27
+ relation: 'executing' | 'overlap';
28
+ }
29
+ export interface EventLoopIncident {
30
+ id: string;
31
+ loop: EventLoopIdentity;
32
+ startAt: number;
33
+ endAt?: number;
34
+ observedAt: number;
35
+ durationMs: number;
36
+ state: 'recovered' | 'unresponsive' | 'unknown';
37
+ mechanism: 'callback' | 'heartbeat' | 'long-animation-frame' | 'longtask';
38
+ severity: 'warning' | 'error';
39
+ /** Exact async execution context, when measured inside a Node callback. Not a CPU profile. */
40
+ flowId?: string;
41
+ requestId?: string;
42
+ callbackType?: string;
43
+ scripts: EventLoopScript[];
44
+ evidence: EventLoopEvidence[];
45
+ evidenceTruncated: boolean;
46
+ explanation: string;
47
+ }
48
+ export interface EventLoopStatus {
49
+ loop: EventLoopIdentity;
50
+ lastSeen: number;
51
+ state: 'observed' | 'unresponsive' | 'unknown';
52
+ coverage: string;
53
+ meanMs?: number;
54
+ maxMs?: number;
55
+ p99Ms?: number;
56
+ utilization?: number;
57
+ }
58
+ export interface EventLoopsView {
59
+ loops: EventLoopStatus[];
60
+ incidents: EventLoopIncident[];
61
+ /** Bounded result: older incidents can be requested using before. */
62
+ nextBefore?: number;
63
+ persistence: 'disk' | 'memory';
64
+ retentionDays: number;
65
+ }
@@ -0,0 +1 @@
1
+ "use strict";export{};
@@ -0,0 +1,97 @@
1
+ export type WorkspaceActionKind = 'start' | 'stop' | 'restart' | 'migrate' | 'test' | 'e2e' | 'typecheck' | 'lint' | 'build' | 'verify' | 'worktree-stop' | 'worktree-remove';
2
+ export type WorkspaceActionState = 'queued' | 'running' | 'passed' | 'failed' | 'errored' | 'cancelled' | 'timeout';
3
+ export interface WorkspaceActionInput {
4
+ action: WorkspaceActionKind;
5
+ project: string;
6
+ target?: string;
7
+ worktree?: string;
8
+ timeoutMs?: number;
9
+ files?: string[];
10
+ testName?: string;
11
+ hard?: boolean;
12
+ /** Preparation of an existing instance. Only services started by this run are cleaned up. */
13
+ prepare?: {
14
+ migrationProject?: string;
15
+ migrationTarget?: string;
16
+ services?: string[];
17
+ };
18
+ }
19
+ export interface WorkspaceActionDescriptor {
20
+ id: string;
21
+ action: WorkspaceActionKind;
22
+ project: string;
23
+ target?: string;
24
+ runner?: 'jest' | 'vitest' | 'playwright' | 'opaque';
25
+ available: boolean;
26
+ reason?: string;
27
+ prerequisites: string[];
28
+ }
29
+ export interface WorkspaceActionFailure {
30
+ id: string;
31
+ name: string;
32
+ file?: string;
33
+ line?: number;
34
+ message: string;
35
+ occurrences: number;
36
+ }
37
+ export interface WorkspaceActionCounts {
38
+ passed: number;
39
+ failed: number;
40
+ skipped: number;
41
+ total: number;
42
+ }
43
+ export interface WorkspaceActionStep {
44
+ id: string;
45
+ action: WorkspaceActionKind | 'cleanup';
46
+ state: WorkspaceActionState | 'skipped';
47
+ durationMs: number;
48
+ target?: string;
49
+ exitCode?: number | null;
50
+ signal?: string;
51
+ counts?: WorkspaceActionCounts;
52
+ failureKind?: 'assertion' | 'setup' | 'runner-crash' | 'cancelled' | 'timeout' | 'command';
53
+ failures: WorkspaceActionFailure[];
54
+ omittedFailures: number;
55
+ note?: string;
56
+ migrations?: {
57
+ applied: number | null;
58
+ pending: number | null;
59
+ failed?: string;
60
+ };
61
+ worktree?: {
62
+ key: string;
63
+ directoryExists: boolean;
64
+ remainingData?: string[];
65
+ omittedData?: number;
66
+ branch?: string;
67
+ };
68
+ service?: {
69
+ name: string;
70
+ state: string;
71
+ ready: boolean;
72
+ };
73
+ evidence: {
74
+ log: string;
75
+ report?: string;
76
+ attachments?: string;
77
+ };
78
+ }
79
+ export interface WorkspaceActionRun {
80
+ runId: string;
81
+ scope: {
82
+ workspace: string;
83
+ worktree: string;
84
+ project: string;
85
+ };
86
+ action: WorkspaceActionKind;
87
+ state: WorkspaceActionState;
88
+ stage?: string;
89
+ queuedAt: number;
90
+ startedAt?: number;
91
+ completedAt?: number;
92
+ durationMs: number;
93
+ steps: WorkspaceActionStep[];
94
+ note?: string;
95
+ resultRef: string;
96
+ retentionDays: number;
97
+ }
@@ -0,0 +1 @@
1
+ "use strict";export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.25.24",
3
+ "version": "1.25.26",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",