@lensmcp/protocol-types 1.25.46 → 1.25.48

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
@@ -31,5 +31,9 @@ export * from './lib/replay.js';
31
31
  export * from './lib/event-loop.js';
32
32
  export * from './lib/workspace-actions.js';
33
33
  export * from './lib/team.js';
34
+ export * from './lib/team-review-changes.js';
34
35
  export * from './lib/team-design.js';
35
36
  export * from './lib/team-library.js';
37
+ export * from './lib/system-report.js';
38
+ export * from './lib/overseer-findings.js';
39
+ export * from './lib/overseer-rounds.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/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.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";export*from"./lib/team.js";export*from"./lib/team-design.js";export*from"./lib/team-library.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/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.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";export*from"./lib/team.js";export*from"./lib/team-review-changes.js";export*from"./lib/team-design.js";export*from"./lib/team-library.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";
@@ -150,10 +150,10 @@ export declare const MemoryOwnerAttrsSchema: z.ZodObject<{
150
150
  }, z.core.$strip>;
151
151
  export type MemoryOwnerAttrs = z.infer<typeof MemoryOwnerAttrsSchema>;
152
152
  export declare const MemoryMutationOperationSchema: z.ZodEnum<{
153
- delete: "delete";
154
- push: "push";
155
153
  set: "set";
154
+ push: "push";
156
155
  add: "add";
156
+ delete: "delete";
157
157
  clear: "clear";
158
158
  subscribe: "subscribe";
159
159
  listen: "listen";
@@ -163,10 +163,10 @@ export type MemoryMutationOperation = z.infer<typeof MemoryMutationOperationSche
163
163
  export declare const MemoryMutationAttrsSchema: z.ZodObject<{
164
164
  ownerNodeId: z.ZodString;
165
165
  operation: z.ZodEnum<{
166
- delete: "delete";
167
- push: "push";
168
166
  set: "set";
167
+ push: "push";
169
168
  add: "add";
169
+ delete: "delete";
170
170
  clear: "clear";
171
171
  subscribe: "subscribe";
172
172
  listen: "listen";
package/lib/context.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  export declare const FlowOriginTypeSchema: z.ZodEnum<{
3
- request: "request";
4
3
  "user-click": "user-click";
5
4
  "user-input": "user-input";
6
5
  keyboard: "keyboard";
@@ -26,6 +25,7 @@ export declare const FlowOriginTypeSchema: z.ZodEnum<{
26
25
  "page-load": "page-load";
27
26
  "form-submit": "form-submit";
28
27
  "input-change": "input-change";
28
+ request: "request";
29
29
  job: "job";
30
30
  }>;
31
31
  export type FlowOriginType = z.infer<typeof FlowOriginTypeSchema>;
@@ -38,7 +38,6 @@ export declare const TraceContextSchema: z.ZodObject<{
38
38
  url: z.ZodOptional<z.ZodString>;
39
39
  flowId: z.ZodOptional<z.ZodString>;
40
40
  originType: z.ZodOptional<z.ZodEnum<{
41
- request: "request";
42
41
  "user-click": "user-click";
43
42
  "user-input": "user-input";
44
43
  keyboard: "keyboard";
@@ -64,6 +63,7 @@ export declare const TraceContextSchema: z.ZodObject<{
64
63
  "page-load": "page-load";
65
64
  "form-submit": "form-submit";
66
65
  "input-change": "input-change";
66
+ request: "request";
67
67
  job: "job";
68
68
  }>>;
69
69
  originNodeId: z.ZodOptional<z.ZodString>;
@@ -968,6 +968,19 @@ export interface DashSummary {
968
968
  };
969
969
  /** `DashSession.setupIssues.length`. */
970
970
  setupIssues?: number;
971
+ /**
972
+ * The pages of the features `lensmcp.json` turns off, by screen id (planning/modules/01-split.md S4): they leave the
973
+ * sidebar, and opening one says it is off and how it comes back. Absent when every page is on, and from a lens
974
+ * before it.
975
+ */
976
+ off?: Record<string, DashOffScreen>;
977
+ }
978
+ /** A page of a feature that is off: the feature (its card id, title and area) and why it is off, in words. */
979
+ export interface DashOffScreen {
980
+ feature: string;
981
+ title: string;
982
+ area: string;
983
+ why: string;
971
984
  }
972
985
  /**
973
986
  * What one run of a route touched, by key, with how many times:
@@ -3610,6 +3623,8 @@ export interface DashAgentFailure {
3610
3623
  stack?: string;
3611
3624
  /** The SDK's id for it (`err_…`), as the agent was told it. */
3612
3625
  errorId?: string;
3626
+ /** A public error — a refusal, a bad input, a thing not found: the lens answered on purpose and the agent was told the message; no stack is kept. */
3627
+ public?: true;
3613
3628
  }
3614
3629
  /** One MCP session — one agent connected through the lensmcp plugin and the shim to this lens. */
3615
3630
  export interface DashAgentSession {
package/lib/edge.d.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  import { z } from 'zod';
2
2
  export declare const EdgeAxisSchema: z.ZodEnum<{
3
- state: "state";
4
- network: "network";
5
- data: "data";
6
3
  db: "db";
7
- visual: "visual";
8
4
  memory: "memory";
5
+ visual: "visual";
9
6
  render: "render";
7
+ state: "state";
8
+ network: "network";
10
9
  backend: "backend";
11
10
  performance: "performance";
12
11
  lifecycle: "lifecycle";
13
12
  ownership: "ownership";
14
13
  caused: "caused";
15
14
  async: "async";
15
+ data: "data";
16
16
  }>;
17
17
  export type EdgeAxis = z.infer<typeof EdgeAxisSchema>;
18
18
  export declare const TraceEdgeSchema: z.ZodObject<{
@@ -20,19 +20,19 @@ export declare const TraceEdgeSchema: z.ZodObject<{
20
20
  from: z.ZodString;
21
21
  to: z.ZodString;
22
22
  axis: z.ZodEnum<{
23
- state: "state";
24
- network: "network";
25
- data: "data";
26
23
  db: "db";
27
- visual: "visual";
28
24
  memory: "memory";
25
+ visual: "visual";
29
26
  render: "render";
27
+ state: "state";
28
+ network: "network";
30
29
  backend: "backend";
31
30
  performance: "performance";
32
31
  lifecycle: "lifecycle";
33
32
  ownership: "ownership";
34
33
  caused: "caused";
35
34
  async: "async";
35
+ data: "data";
36
36
  }>;
37
37
  type: z.ZodString;
38
38
  timestamp: z.ZodNumber;
package/lib/event.d.ts CHANGED
@@ -1,14 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  export declare const EventSourceSchema: z.ZodEnum<{
3
- gateway: "gateway";
4
- ai: "ai";
5
- db: "db";
6
- redis: "redis";
7
- queue: "queue";
8
- external: "external";
9
- visual: "visual";
10
- react: "react";
11
- memory: "memory";
12
3
  nx: "nx";
13
4
  vite: "vite";
14
5
  typescript: "typescript";
@@ -16,42 +7,51 @@ export declare const EventSourceSchema: z.ZodEnum<{
16
7
  rollup: "rollup";
17
8
  "client-runtime": "client-runtime";
18
9
  chrome: "chrome";
10
+ react: "react";
19
11
  valtio: "valtio";
20
12
  nestjs: "nestjs";
21
13
  nextjs: "nextjs";
14
+ db: "db";
15
+ redis: "redis";
16
+ queue: "queue";
17
+ memory: "memory";
18
+ visual: "visual";
22
19
  perf: "perf";
23
20
  security: "security";
21
+ gateway: "gateway";
22
+ external: "external";
23
+ ai: "ai";
24
24
  lens: "lens";
25
25
  custom: "custom";
26
26
  }>;
27
27
  export type EventSource = z.infer<typeof EventSourceSchema>;
28
28
  export declare const EventCategorySchema: z.ZodEnum<{
29
- build: "build";
30
- test: "test";
31
- state: "state";
32
- agent: "agent";
33
- network: "network";
34
- ai: "ai";
35
29
  db: "db";
36
- typecheck: "typecheck";
37
- lint: "lint";
38
- visual: "visual";
39
30
  memory: "memory";
40
- cluster: "cluster";
41
- trace: "trace";
31
+ visual: "visual";
42
32
  security: "security";
33
+ ai: "ai";
34
+ build: "build";
35
+ lint: "lint";
36
+ typecheck: "typecheck";
37
+ test: "test";
43
38
  runtime: "runtime";
44
39
  render: "render";
40
+ trace: "trace";
41
+ state: "state";
42
+ network: "network";
45
43
  backend: "backend";
46
44
  performance: "performance";
47
45
  deps: "deps";
46
+ cluster: "cluster";
47
+ agent: "agent";
48
48
  }>;
49
49
  export type EventCategory = z.infer<typeof EventCategorySchema>;
50
50
  export declare const SeveritySchema: z.ZodEnum<{
51
51
  error: "error";
52
+ debug: "debug";
52
53
  info: "info";
53
54
  warning: "warning";
54
- debug: "debug";
55
55
  fatal: "fatal";
56
56
  }>;
57
57
  export type Severity = z.infer<typeof SeveritySchema>;
@@ -60,15 +60,6 @@ export declare const BaseEventSchema: z.ZodObject<{
60
60
  sessionId: z.ZodString;
61
61
  timestamp: z.ZodNumber;
62
62
  source: z.ZodEnum<{
63
- gateway: "gateway";
64
- ai: "ai";
65
- db: "db";
66
- redis: "redis";
67
- queue: "queue";
68
- external: "external";
69
- visual: "visual";
70
- react: "react";
71
- memory: "memory";
72
63
  nx: "nx";
73
64
  vite: "vite";
74
65
  typescript: "typescript";
@@ -76,40 +67,49 @@ export declare const BaseEventSchema: z.ZodObject<{
76
67
  rollup: "rollup";
77
68
  "client-runtime": "client-runtime";
78
69
  chrome: "chrome";
70
+ react: "react";
79
71
  valtio: "valtio";
80
72
  nestjs: "nestjs";
81
73
  nextjs: "nextjs";
74
+ db: "db";
75
+ redis: "redis";
76
+ queue: "queue";
77
+ memory: "memory";
78
+ visual: "visual";
82
79
  perf: "perf";
83
80
  security: "security";
81
+ gateway: "gateway";
82
+ external: "external";
83
+ ai: "ai";
84
84
  lens: "lens";
85
85
  custom: "custom";
86
86
  }>;
87
87
  category: z.ZodEnum<{
88
- build: "build";
89
- test: "test";
90
- state: "state";
91
- agent: "agent";
92
- network: "network";
93
- ai: "ai";
94
88
  db: "db";
95
- typecheck: "typecheck";
96
- lint: "lint";
97
- visual: "visual";
98
89
  memory: "memory";
99
- cluster: "cluster";
100
- trace: "trace";
90
+ visual: "visual";
101
91
  security: "security";
92
+ ai: "ai";
93
+ build: "build";
94
+ lint: "lint";
95
+ typecheck: "typecheck";
96
+ test: "test";
102
97
  runtime: "runtime";
103
98
  render: "render";
99
+ trace: "trace";
100
+ state: "state";
101
+ network: "network";
104
102
  backend: "backend";
105
103
  performance: "performance";
106
104
  deps: "deps";
105
+ cluster: "cluster";
106
+ agent: "agent";
107
107
  }>;
108
108
  severity: z.ZodEnum<{
109
109
  error: "error";
110
+ debug: "debug";
110
111
  info: "info";
111
112
  warning: "warning";
112
- debug: "debug";
113
113
  fatal: "fatal";
114
114
  }>;
115
115
  context: z.ZodObject<{
@@ -121,7 +121,6 @@ export declare const BaseEventSchema: z.ZodObject<{
121
121
  url: z.ZodOptional<z.ZodString>;
122
122
  flowId: z.ZodOptional<z.ZodString>;
123
123
  originType: z.ZodOptional<z.ZodEnum<{
124
- request: "request";
125
124
  "user-click": "user-click";
126
125
  "user-input": "user-input";
127
126
  keyboard: "keyboard";
@@ -147,6 +146,7 @@ export declare const BaseEventSchema: z.ZodObject<{
147
146
  "page-load": "page-load";
148
147
  "form-submit": "form-submit";
149
148
  "input-change": "input-change";
149
+ request: "request";
150
150
  job: "job";
151
151
  }>>;
152
152
  originNodeId: z.ZodOptional<z.ZodString>;
package/lib/node.d.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  import { z } from 'zod';
2
2
  export declare const TraceNodeTypeSchema: z.ZodEnum<{
3
- page: "page";
4
- route: "route";
5
- session: "session";
6
3
  effect: "effect";
7
4
  timer: "timer";
8
5
  "hmr-update": "hmr-update";
6
+ route: "route";
9
7
  render: "render";
10
8
  promise: "promise";
9
+ session: "session";
11
10
  "browser-context": "browser-context";
12
11
  tab: "tab";
13
12
  renderer: "renderer";
14
13
  router: "router";
14
+ page: "page";
15
15
  component: "component";
16
16
  element: "element";
17
17
  slot: "slot";
@@ -64,9 +64,9 @@ export declare const TraceNodeTypeSchema: z.ZodEnum<{
64
64
  }>;
65
65
  export type TraceNodeType = z.infer<typeof TraceNodeTypeSchema>;
66
66
  export declare const LifecycleSchema: z.ZodEnum<{
67
- completed: "completed";
68
- active: "active";
69
67
  created: "created";
68
+ active: "active";
69
+ completed: "completed";
70
70
  disposed: "disposed";
71
71
  errored: "errored";
72
72
  }>;
@@ -75,18 +75,18 @@ export declare const TraceNodeSchema: z.ZodObject<{
75
75
  id: z.ZodString;
76
76
  parentTraceNodeId: z.ZodOptional<z.ZodString>;
77
77
  type: z.ZodEnum<{
78
- page: "page";
79
- route: "route";
80
- session: "session";
81
78
  effect: "effect";
82
79
  timer: "timer";
83
80
  "hmr-update": "hmr-update";
81
+ route: "route";
84
82
  render: "render";
85
83
  promise: "promise";
84
+ session: "session";
86
85
  "browser-context": "browser-context";
87
86
  tab: "tab";
88
87
  renderer: "renderer";
89
88
  router: "router";
89
+ page: "page";
90
90
  component: "component";
91
91
  element: "element";
92
92
  slot: "slot";
@@ -141,9 +141,9 @@ export declare const TraceNodeSchema: z.ZodObject<{
141
141
  instanceId: z.ZodOptional<z.ZodString>;
142
142
  generation: z.ZodOptional<z.ZodNumber>;
143
143
  lifecycle: z.ZodEnum<{
144
- completed: "completed";
145
- active: "active";
146
144
  created: "created";
145
+ active: "active";
146
+ completed: "completed";
147
147
  disposed: "disposed";
148
148
  errored: "errored";
149
149
  }>;
@@ -156,7 +156,6 @@ export declare const TraceNodeSchema: z.ZodObject<{
156
156
  url: z.ZodOptional<z.ZodString>;
157
157
  flowId: z.ZodOptional<z.ZodString>;
158
158
  originType: z.ZodOptional<z.ZodEnum<{
159
- request: "request";
160
159
  "user-click": "user-click";
161
160
  "user-input": "user-input";
162
161
  keyboard: "keyboard";
@@ -182,6 +181,7 @@ export declare const TraceNodeSchema: z.ZodObject<{
182
181
  "page-load": "page-load";
183
182
  "form-submit": "form-submit";
184
183
  "input-change": "input-change";
184
+ request: "request";
185
185
  job: "job";
186
186
  }>>;
187
187
  originNodeId: z.ZodOptional<z.ZodString>;
@@ -0,0 +1,221 @@
1
+ import type { DashSystemScope, DashSystemUnit } from './system-report.js';
2
+ import type { DashTeamHealthStatus } from './team.js';
3
+ /**
4
+ * The overseer's findings (planning/team/15-the-overseer.md S3): one problem each, kept until it is fixed or dismissed —
5
+ * a markdown file in `~/.lensmcp/overseer/findings/<where>-<NN>-<slug>.md`, its fields in the frontmatter, its evidence
6
+ * and proposal in words in the body, and `index.json` beside them for the dashboard.
7
+ *
8
+ * open ──(a proposal)──▶ proposed ──(the person's Apply)──▶ applied ──(its checks ok for 24 h)──▶ fixed
9
+ * └────────────(the person's Dismiss, from any of them)────────────▶ dismissed
10
+ *
11
+ * The overseer writes and updates findings (`lensmcp agent finding`); only the person applies or dismisses one (the
12
+ * Inbox, `POST /api/overseer/findings/<id>/apply | dismiss`); the report's own run (tier 1, no model) records each
13
+ * sighting and closes what stayed ok — the watcher's record is kept by code, not by the overseer.
14
+ */
15
+ export type DashFindingState = 'open' | 'proposed' | 'applied' | 'fixed' | 'dismissed';
16
+ /** The overseer's read of its check: the problem is real, or the check is wrong (a LensMCP issue, as in 11). */
17
+ export type DashFindingVerdict = 'true' | 'false-alarm';
18
+ /** Whose the problem is: the project's (its team, its code), LensMCP's, the host's, or the person's to decide. */
19
+ export type DashFindingCause = 'project' | 'lensmcp' | 'host' | 'person';
20
+ /** One reading of a finding's checks that was not ok — written when the status or the value moved. */
21
+ export interface DashFindingSighting {
22
+ at: number;
23
+ status: DashTeamHealthStatus;
24
+ value: number;
25
+ }
26
+ /** A change to one task, as `POST /api/team/task/operate` makes it (store.operate). */
27
+ export interface DashFindingOperate {
28
+ priority?: number;
29
+ /** Assign to a session; null takes the assignment off. */
30
+ to?: string | null;
31
+ role?: string;
32
+ /** Take it back from its owner — why. */
33
+ release?: string;
34
+ /** Cancel it — why. */
35
+ cancel?: string;
36
+ note?: string;
37
+ }
38
+ /**
39
+ * One step of a proposal. The first five run on Apply, through the paths the dashboard's own buttons use; the rest are
40
+ * the person's to do — Apply records that they did.
41
+ */
42
+ export type DashFindingAction = {
43
+ kind: 'operate';
44
+ repoId: string;
45
+ taskId: string;
46
+ change: DashFindingOperate;
47
+ } | {
48
+ kind: 'stop-launch';
49
+ repoId: string;
50
+ launchId: string;
51
+ } | {
52
+ kind: 'close-session';
53
+ repoId: string;
54
+ sessionId: string;
55
+ }
56
+ /** A role file written (`POST /api/team/roles`'s body, its requestId aside): uncommitted — the person commits it. */
57
+ | {
58
+ kind: 'role';
59
+ repoId: string;
60
+ role: Record<string, unknown>;
61
+ }
62
+ /** A role switched off or removed (`POST /api/team/roles/remove`). */
63
+ | {
64
+ kind: 'role-off';
65
+ repoId: string;
66
+ id: string;
67
+ why?: string;
68
+ }
69
+ /** A Settings change, made by the person on Settings. */
70
+ | {
71
+ kind: 'settings';
72
+ key: string;
73
+ value: string | number | boolean;
74
+ workspace?: string;
75
+ }
76
+ /** Anything else — a flow.json or goal-rule change, a host fix — in words, done by hand. */
77
+ | {
78
+ kind: 'by-hand';
79
+ text: string;
80
+ }
81
+ /** A LensMCP issue to file, with its draft — Apply files it in the issues folder Settings names (S6); none: the person's. */
82
+ | {
83
+ kind: 'issue';
84
+ title: string;
85
+ draft: string;
86
+ };
87
+ export type DashFindingActionKind = DashFindingAction['kind'];
88
+ /** The kinds Apply runs itself; any other is the person's — but an `issue`, run once the issues folder is set (S6). */
89
+ export declare const FINDING_RUN_KINDS: readonly DashFindingActionKind[];
90
+ export interface DashFindingProposal {
91
+ /** What applying does, in one line: «Cancel the 6 tasks no role takes». */
92
+ summary: string;
93
+ actions: DashFindingAction[];
94
+ at: number;
95
+ }
96
+ /** How one action of an Apply went: run, the person's to do, or refused by the path it went through (its words). */
97
+ export interface DashFindingActionResult {
98
+ action: number;
99
+ kind: DashFindingActionKind;
100
+ outcome: 'ran' | 'yours' | 'failed';
101
+ message?: string;
102
+ }
103
+ /** The newest Apply: every action run (or the person's) — or, not ok, the ones that failed; the finding stays proposed. */
104
+ export interface DashFindingApply {
105
+ at: number;
106
+ ok: boolean;
107
+ results: DashFindingActionResult[];
108
+ }
109
+ export interface DashFindingDismissed {
110
+ at: number;
111
+ why?: string;
112
+ /** The person says the overseer was wrong — counted against it in its record. */
113
+ wrong: boolean;
114
+ /** The worst its checks read when it was dismissed: it is raised again only when they read worse. */
115
+ status: DashTeamHealthStatus;
116
+ value?: number;
117
+ }
118
+ export interface DashFindingFixed {
119
+ at: number;
120
+ /** Its proposal applied and its checks ok for 24 h; its checks ok for 24 h with nothing applied; the overseer said so. */
121
+ how: 'applied' | 'cleared' | 'overseer';
122
+ }
123
+ /**
124
+ * A LensMCP-cause finding filed as an issue in the lensmcp checkout (planning/team/15 S6, SA-D5): its copy in the
125
+ * folder the person set (`issuesDir`, the checkout's `issues/open/`), `overseer-NN-<slug>.md` — never committed by
126
+ * LensMCP: the lensmcp session that fixes it commits it.
127
+ */
128
+ export interface DashFindingIssue {
129
+ /** `overseer-03`. */
130
+ id: string;
131
+ /** Where it was written. */
132
+ file: string;
133
+ at: number;
134
+ /** Of what LensMCP last wrote: while the file still holds it, LensMCP may write it again; once edited, it is the lensmcp session's. */
135
+ sha: string;
136
+ /** A lensmcp session moved it on (the same name in `closed/` or `deferred/`): never written again. */
137
+ moved?: 'closed' | 'deferred';
138
+ }
139
+ export interface DashFinding {
140
+ /** `<where>-<NN>-<slug>`: `foodguard-03-tasks-wait-with-no-agent`, `machine-01-swap-nearly-full`. */
141
+ id: string;
142
+ title: string;
143
+ state: DashFindingState;
144
+ /** The worst its checks read while it was open: a `bad` one is mail in the Inbox, a `warn` waits for the digest. */
145
+ severity: 'warn' | 'bad';
146
+ verdict?: DashFindingVerdict;
147
+ cause?: DashFindingCause;
148
+ /** Where it is: the first check's scope, else the one the overseer named. */
149
+ scope: DashSystemScope;
150
+ /** The report items it is about, by key (`repo:<id>/team.roles.uncovered`) — may be none (found in a transcript). */
151
+ checks: string[];
152
+ /** The unit its sightings' values are in: the first check's. */
153
+ unit?: DashSystemUnit;
154
+ firstSeen: number;
155
+ /** The newest reading that was not ok. */
156
+ lastSeen: number;
157
+ /** Every check read ok since — the watcher's clock to `fixed`. */
158
+ okSince?: number;
159
+ /** When it first read bad: its mail's time. */
160
+ badAt?: number;
161
+ /** The first, then the newest, at most 50. */
162
+ sightings: DashFindingSighting[];
163
+ proposal?: DashFindingProposal;
164
+ apply?: DashFindingApply;
165
+ dismissed?: DashFindingDismissed;
166
+ fixed?: DashFindingFixed;
167
+ /** Filed as a LensMCP issue (cause `lensmcp`, the issues folder set). */
168
+ issue?: DashFindingIssue;
169
+ createdAt: number;
170
+ updatedAt: number;
171
+ /** The evidence and the proposal in words (markdown) — whole on one finding, absent in a list. */
172
+ body?: string;
173
+ }
174
+ /** Who watches the watcher: what became of the overseer's findings — the quality bar, as fidelity.spec is for folds. */
175
+ export interface DashFindingRecord {
176
+ total: number;
177
+ /** Open or proposed: waiting on the overseer or the person. */
178
+ open: number;
179
+ applied: number;
180
+ fixed: number;
181
+ dismissed: number;
182
+ /** Dismissed by the person as wrong. */
183
+ wrong: number;
184
+ /** The overseer's verdicts. */
185
+ trueFindings: number;
186
+ falseAlarms: number;
187
+ }
188
+ /** `GET /api/overseer/findings`. */
189
+ export interface DashFindingsAnswer {
190
+ /** Newest activity first, without their bodies. */
191
+ findings: DashFinding[];
192
+ record: DashFindingRecord;
193
+ /** The repository this dashboard serves — what Team › Health matches a finding's scope to. */
194
+ here?: {
195
+ repoId: string;
196
+ };
197
+ /** Files in the folder that would not read. */
198
+ problems: string[];
199
+ /** The folder LensMCP-cause findings are filed in (S6) — set: Apply runs an `issue` step itself. */
200
+ issuesDir?: string;
201
+ }
202
+ /** `GET /api/overseer/findings/<id>`, `POST …/dismiss`. */
203
+ export interface DashFindingAnswer {
204
+ finding: DashFinding;
205
+ }
206
+ /** `POST /api/overseer/findings/<id>/apply`. */
207
+ export interface DashFindingApplied {
208
+ finding: DashFinding;
209
+ results: DashFindingActionResult[];
210
+ }
211
+ /** Still the overseer's or the person's to settle: open, proposed or applied (not yet fixed). */
212
+ export declare function findingLive(f: Pick<DashFinding, 'state'>): boolean;
213
+ /**
214
+ * Whether Apply runs anything itself, or only records what the person did — an `issue` runs too once the overseer's
215
+ * issues folder is set (S6: Apply files it there).
216
+ */
217
+ export declare function findingRunsActions(p: Pick<DashFindingProposal, 'actions'>, opts?: {
218
+ issuesFolder?: boolean;
219
+ }): boolean;
220
+ /** The live findings about one team check of one repository — what Team › Health shows beside the check. */
221
+ export declare function findingsForCheck(findings: readonly DashFinding[], repoId: string, checkId: string): DashFinding[];
@@ -0,0 +1 @@
1
+ "use strict";var c=Object.defineProperty;var i=(e,n)=>c(e,"name",{value:n,configurable:!0});var u=Object.defineProperty,o=i((e,n)=>u(e,"name",{value:n,configurable:!0}),"t");export const FINDING_RUN_KINDS=["operate","stop-launch","close-session","role","role-off"];export function findingLive(e){return e.state==="open"||e.state==="proposed"||e.state==="applied"}i(findingLive,"findingLive"),o(findingLive,"findingLive");export function findingRunsActions(e,n={}){return e.actions.some(t=>FINDING_RUN_KINDS.includes(t.kind)||t.kind==="issue"&&n.issuesFolder===!0)}i(findingRunsActions,"findingRunsActions"),o(findingRunsActions,"findingRunsActions");export function findingsForCheck(e,n,t){const r=`repo:${n}/team.${t}`;return e.filter(s=>findingLive(s)&&s.checks.includes(r))}i(findingsForCheck,"findingsForCheck"),o(findingsForCheck,"findingsForCheck");
@@ -0,0 +1,111 @@
1
+ import type { DashTeamLaunch, DashTeamLaunchClient } from './team.js';
2
+ /**
3
+ * Running the overseer (planning/team/15 S5, SA-D4 · SA-D6): its settings — one machine's, the same on every dashboard,
4
+ * in `~/.lensmcp/overseer/settings.json` — its rounds, launched by the dashboards (`claude -p` / `codex exec` in its
5
+ * folder, single-flight on the machine, with a deadline and a token budget), and the digests its rounds write.
6
+ *
7
+ * GET /api/overseer DashOverseerStatus
8
+ * POST /api/overseer/settings a DashOverseerSettings patch → DashOverseerStatus (the person's only)
9
+ * POST /api/overseer/rounds { requestId } → DashOverseerStatus — a round now, as the person asks
10
+ * POST /api/overseer/rounds/<id>/stop → DashOverseerStatus
11
+ * GET /api/overseer/digests[/<id>] DashOverseerDigests / { digest }
12
+ */
13
+ export interface DashOverseerSettings {
14
+ /** Off until the person turns it on: no tick, no round. */
15
+ on: boolean;
16
+ /** What a round runs on. */
17
+ client: DashTeamLaunchClient;
18
+ /** In the client's own words; none: its default. */
19
+ model?: string;
20
+ effort?: string;
21
+ /** The folder a round runs in; none: LensMCP's own (`~/.lensmcp/overseer/session`), written again before each round. */
22
+ folder?: string;
23
+ /** The most rounds a day (local), the digest's among them — 1–12, 4 by default. */
24
+ roundsPerDay: number;
25
+ /** The local hour of the day's digest round — 0–23, 8 by default. */
26
+ digestHour: number;
27
+ /** A round is stopped past this many minutes — 5–120, 30 by default. */
28
+ roundMinutes: number;
29
+ /** A round is stopped past this many million tokens (input, cached input and output) — 1–200, 20 by default. */
30
+ roundTokensM: number;
31
+ /**
32
+ * The lensmcp checkout's `issues/open/` (S6, SA-D5): a LensMCP-cause finding is also filed there, as
33
+ * `overseer-NN-<slug>.md` — the number after every overseer issue in open/, deferred/ and closed/. Never committed by
34
+ * LensMCP. None: findings stay in `~/.lensmcp/overseer/findings/` alone.
35
+ */
36
+ issuesDir?: string;
37
+ }
38
+ /** Why a round ran: a new bad item, a warning held a day, the day's digest, or the person asked. */
39
+ export type DashOverseerRoundReason = 'bad' | 'held' | 'digest' | 'asked';
40
+ export interface DashOverseerRound {
41
+ /** Its launch's id. */
42
+ id: string;
43
+ reason: DashOverseerRoundReason;
44
+ /** The report items that woke it (`bad`, `held`). */
45
+ keys: string[];
46
+ startedAt: number;
47
+ /** The launch as the registry reads it: running, exited, stopped (by the person, its deadline or its budget), failed. */
48
+ launch?: DashTeamLaunch;
49
+ /** The tokens it used so far (millions, one decimal), as its output says. */
50
+ tokensM?: number;
51
+ /** Stopped by LensMCP: past its deadline, or past its token budget. */
52
+ stoppedFor?: 'deadline' | 'tokens';
53
+ /** The digest it wrote. */
54
+ digestId?: string;
55
+ }
56
+ /** What the next automatic round waits for — or why none will start. */
57
+ export interface DashOverseerNext {
58
+ /** `off` · `no-folder` (none set up yet, and LensMCP could not write its own) · `running` · `cap` (the day's rounds are used) · `quiet` (nothing woke it). */
59
+ state: 'off' | 'no-folder' | 'running' | 'cap' | 'quiet';
60
+ /** In words. */
61
+ text: string;
62
+ /** The next digest round, when it is on. */
63
+ digestAt?: number;
64
+ }
65
+ /** `GET /api/overseer`. */
66
+ export interface DashOverseerStatus {
67
+ settings: DashOverseerSettings;
68
+ /** The folder a round runs in, and whether its files are there. */
69
+ folder: {
70
+ path: string;
71
+ ready: boolean;
72
+ managed: boolean;
73
+ };
74
+ /** Newest first, at most 20. */
75
+ rounds: DashOverseerRound[];
76
+ /** Rounds started today (local), of `roundsPerDay`. */
77
+ today: number;
78
+ next: DashOverseerNext;
79
+ }
80
+ export interface DashOverseerDigest {
81
+ id: string;
82
+ at: number;
83
+ /** The round that wrote it, when a round did. */
84
+ round?: string;
85
+ reason?: DashOverseerRoundReason;
86
+ /** Markdown. */
87
+ body: string;
88
+ }
89
+ /** `GET /api/overseer/digests` — newest first. */
90
+ export interface DashOverseerDigests {
91
+ digests: DashOverseerDigest[];
92
+ }
93
+ export declare const OVERSEER_SETTINGS_DEFAULTS: DashOverseerSettings;
94
+ export declare const OVERSEER_BOUNDS: {
95
+ readonly roundsPerDay: {
96
+ readonly min: 1;
97
+ readonly max: 12;
98
+ };
99
+ readonly digestHour: {
100
+ readonly min: 0;
101
+ readonly max: 23;
102
+ };
103
+ readonly roundMinutes: {
104
+ readonly min: 5;
105
+ readonly max: 120;
106
+ };
107
+ readonly roundTokensM: {
108
+ readonly min: 1;
109
+ readonly max: 200;
110
+ };
111
+ };
@@ -0,0 +1 @@
1
+ "use strict";export const OVERSEER_SETTINGS_DEFAULTS={on:!1,client:"claude",roundsPerDay:4,digestHour:8,roundMinutes:30,roundTokensM:20},OVERSEER_BOUNDS={roundsPerDay:{min:1,max:12},digestHour:{min:0,max:23},roundMinutes:{min:5,max:120},roundTokensM:{min:1,max:200}};
@@ -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
25
  error: "error";
26
+ debug: "debug";
26
27
  info: "info";
27
28
  warning: "warning";
28
- debug: "debug";
29
29
  fatal: "fatal";
30
30
  }>;
31
31
  title: z.ZodString;
@@ -49,37 +49,37 @@ export declare const AgentBlockingItemSchema: z.ZodObject<{
49
49
  export type AgentBlockingItem = z.infer<typeof AgentBlockingItemSchema>;
50
50
  export declare const AgentChecksSchema: z.ZodObject<{
51
51
  typecheck: z.ZodOptional<z.ZodEnum<{
52
+ unknown: "unknown";
52
53
  passed: "passed";
53
54
  failed: "failed";
54
- unknown: "unknown";
55
55
  }>>;
56
56
  lint: z.ZodOptional<z.ZodEnum<{
57
+ unknown: "unknown";
57
58
  passed: "passed";
58
59
  failed: "failed";
59
- unknown: "unknown";
60
60
  }>>;
61
61
  build: z.ZodOptional<z.ZodEnum<{
62
+ unknown: "unknown";
62
63
  passed: "passed";
63
64
  failed: "failed";
64
- unknown: "unknown";
65
65
  }>>;
66
66
  runtime: z.ZodOptional<z.ZodEnum<{
67
- passed: "passed";
68
- failed: "failed";
69
67
  warning: "warning";
70
68
  unknown: "unknown";
71
- }>>;
72
- visual: z.ZodOptional<z.ZodEnum<{
73
69
  passed: "passed";
74
70
  failed: "failed";
71
+ }>>;
72
+ visual: z.ZodOptional<z.ZodEnum<{
75
73
  warning: "warning";
76
74
  unknown: "unknown";
77
- }>>;
78
- memory: z.ZodOptional<z.ZodEnum<{
79
75
  passed: "passed";
80
76
  failed: "failed";
77
+ }>>;
78
+ memory: z.ZodOptional<z.ZodEnum<{
81
79
  warning: "warning";
82
80
  unknown: "unknown";
81
+ passed: "passed";
82
+ failed: "failed";
83
83
  }>>;
84
84
  }, z.core.$strip>;
85
85
  /**
@@ -92,14 +92,14 @@ export declare const AgentChecksSchema: z.ZodObject<{
92
92
  * bundle it started with until that session ends).
93
93
  */
94
94
  export declare const AgentServerModeSchema: z.ZodEnum<{
95
- shared: "shared";
96
95
  embedded: "embedded";
96
+ shared: "shared";
97
97
  }>;
98
98
  export type AgentServerMode = z.infer<typeof AgentServerModeSchema>;
99
99
  export declare const AgentServerInfoSchema: z.ZodObject<{
100
100
  mode: z.ZodEnum<{
101
- shared: "shared";
102
101
  embedded: "embedded";
102
+ shared: "shared";
103
103
  }>;
104
104
  pid: z.ZodNumber;
105
105
  startedAt: z.ZodString;
@@ -114,9 +114,9 @@ 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>>;
@@ -124,9 +124,9 @@ export declare const AgentCurrentStatusSchema: z.ZodObject<{
124
124
  source: z.ZodString;
125
125
  severity: z.ZodEnum<{
126
126
  error: "error";
127
+ debug: "debug";
127
128
  info: "info";
128
129
  warning: "warning";
129
- debug: "debug";
130
130
  fatal: "fatal";
131
131
  }>;
132
132
  title: z.ZodString;
@@ -151,9 +151,9 @@ export declare const AgentCurrentStatusSchema: z.ZodObject<{
151
151
  source: z.ZodString;
152
152
  severity: z.ZodEnum<{
153
153
  error: "error";
154
+ debug: "debug";
154
155
  info: "info";
155
156
  warning: "warning";
156
- debug: "debug";
157
157
  fatal: "fatal";
158
158
  }>;
159
159
  title: z.ZodString;
@@ -177,43 +177,43 @@ export declare const AgentCurrentStatusSchema: z.ZodObject<{
177
177
  suggestedReads: z.ZodArray<z.ZodString>;
178
178
  checks: z.ZodOptional<z.ZodObject<{
179
179
  typecheck: z.ZodOptional<z.ZodEnum<{
180
+ unknown: "unknown";
180
181
  passed: "passed";
181
182
  failed: "failed";
182
- unknown: "unknown";
183
183
  }>>;
184
184
  lint: z.ZodOptional<z.ZodEnum<{
185
+ unknown: "unknown";
185
186
  passed: "passed";
186
187
  failed: "failed";
187
- unknown: "unknown";
188
188
  }>>;
189
189
  build: z.ZodOptional<z.ZodEnum<{
190
+ unknown: "unknown";
190
191
  passed: "passed";
191
192
  failed: "failed";
192
- unknown: "unknown";
193
193
  }>>;
194
194
  runtime: z.ZodOptional<z.ZodEnum<{
195
- passed: "passed";
196
- failed: "failed";
197
195
  warning: "warning";
198
196
  unknown: "unknown";
199
- }>>;
200
- visual: z.ZodOptional<z.ZodEnum<{
201
197
  passed: "passed";
202
198
  failed: "failed";
199
+ }>>;
200
+ visual: z.ZodOptional<z.ZodEnum<{
203
201
  warning: "warning";
204
202
  unknown: "unknown";
205
- }>>;
206
- memory: z.ZodOptional<z.ZodEnum<{
207
203
  passed: "passed";
208
204
  failed: "failed";
205
+ }>>;
206
+ memory: z.ZodOptional<z.ZodEnum<{
209
207
  warning: "warning";
210
208
  unknown: "unknown";
209
+ passed: "passed";
210
+ failed: "failed";
211
211
  }>>;
212
212
  }, z.core.$strip>>;
213
213
  server: z.ZodOptional<z.ZodObject<{
214
214
  mode: z.ZodEnum<{
215
- shared: "shared";
216
215
  embedded: "embedded";
216
+ shared: "shared";
217
217
  }>;
218
218
  pid: z.ZodNumber;
219
219
  startedAt: z.ZodString;
@@ -328,9 +328,9 @@ declare const CheckEntrySchema: z.ZodObject<{
328
328
  rule: z.ZodOptional<z.ZodString>;
329
329
  severity: z.ZodOptional<z.ZodEnum<{
330
330
  error: "error";
331
+ debug: "debug";
331
332
  info: "info";
332
333
  warning: "warning";
333
- debug: "debug";
334
334
  fatal: "fatal";
335
335
  }>>;
336
336
  file: z.ZodOptional<z.ZodString>;
@@ -417,9 +417,9 @@ export declare const TypecheckErrorsSchema: z.ZodObject<{
417
417
  rule: z.ZodOptional<z.ZodString>;
418
418
  severity: z.ZodOptional<z.ZodEnum<{
419
419
  error: "error";
420
+ debug: "debug";
420
421
  info: "info";
421
422
  warning: "warning";
422
- debug: "debug";
423
423
  fatal: "fatal";
424
424
  }>>;
425
425
  file: z.ZodOptional<z.ZodString>;
@@ -0,0 +1,156 @@
1
+ import type { DashTeamHealthStatus } from './team.js';
2
+ /**
3
+ * The system report (planning/team/15-the-overseer.md, tier 1): the whole machine in one answer — every repository's
4
+ * team, every workspace's lens, the machine itself, and what it all costs — measured by code, no model. The overseer's
5
+ * round reads what changed between two of them; `lensmcp agent overseer`, `/api/system/report` and `system_report`
6
+ * answer one.
7
+ *
8
+ * Every item has the team health check's shape, so the pages and the design read them as they read a check.
9
+ */
10
+ /** What an item is about: the team's work, its agents, a lens, the machine, or the spend. */
11
+ export type DashSystemGroup = 'team' | 'agents' | 'lens' | 'machine' | 'cost';
12
+ /** Where an item was measured: the machine, one repository's team (its coordination store), one workspace's lens. */
13
+ export type DashSystemScope = {
14
+ kind: 'machine';
15
+ } | {
16
+ kind: 'repository';
17
+ repoId: string;
18
+ name: string;
19
+ root?: string;
20
+ } | {
21
+ kind: 'workspace';
22
+ key: string;
23
+ name: string;
24
+ root: string;
25
+ };
26
+ /** One thing an item names — what to open: a task, an agent, a lens resource or a file, a moment. */
27
+ export interface DashSystemExample {
28
+ text: string;
29
+ taskId?: string;
30
+ sessionId?: string;
31
+ /** A lens URI (`process://cluster`) or an absolute file path (`…/.lensmcp/gateway.log`). */
32
+ ref?: string;
33
+ at?: number;
34
+ }
35
+ /** The unit an item's `value` is in, when it is not a count. */
36
+ export type DashSystemUnit = 'count' | 'ms' | 'bytes' | 'percent' | 'usd' | 'load' | 'minutes';
37
+ /** One measure of the system against what it should be — a reason to look, never a verdict on an agent. */
38
+ export interface DashSystemItem {
39
+ /** Unique in a report and the same in the next one: `systemItemKey(scope, id)`. */
40
+ key: string;
41
+ /** What is measured, the same in every scope: `team.roles.uncovered`, `lens.loop-holds`, `machine.disk`. */
42
+ id: string;
43
+ group: DashSystemGroup;
44
+ scope: DashSystemScope;
45
+ title: string;
46
+ status: DashTeamHealthStatus;
47
+ value: number;
48
+ of?: number;
49
+ unit?: DashSystemUnit;
50
+ /** What it should be, in words: «none», «under 2 × the cores», «at least 20 GB free». */
51
+ expected: string;
52
+ /** What was measured and what it means, in one or two sentences. */
53
+ detail: string;
54
+ /** At most five, worst first. */
55
+ examples: DashSystemExample[];
56
+ /**
57
+ * Since when it has not been ok (warn or bad, without a break) — carried from report to report (`reportChanges`);
58
+ * absent while ok or n/a. A warning held for a day wakes the overseer (SA-D4).
59
+ */
60
+ since?: number;
61
+ }
62
+ /** A repository on the machine: its coordination store, and its team's health over the report's day. */
63
+ export interface DashSystemRepository {
64
+ repoId: string;
65
+ name: string;
66
+ root?: string;
67
+ /** The team health report's status over the window — its checks are items `team.<check id>`. */
68
+ status: DashTeamHealthStatus;
69
+ window: {
70
+ from: number;
71
+ to: number;
72
+ };
73
+ totals: {
74
+ tasks: number;
75
+ changes: number;
76
+ goals: number;
77
+ sessions: number;
78
+ actingSessions: number;
79
+ messages: number;
80
+ };
81
+ }
82
+ /** A workspace the machine's lens knows (`~/.lensmcp/workspaces.json`). */
83
+ export interface DashSystemWorkspace {
84
+ key: string;
85
+ name: string;
86
+ root: string;
87
+ base: string;
88
+ /** Its gateway runs (pid and start time both still its own). */
89
+ live: boolean;
90
+ /** A worktree instance of another workspace: that one's key. */
91
+ instanceOf?: string;
92
+ }
93
+ /** A source that could not be read. The items it would have made are absent — not ok. */
94
+ export interface DashSystemProblem {
95
+ /** `systemScopeId(scope)`. */
96
+ scope: string;
97
+ /** `coordination`, `history`, `gateway.log`, `launches`, `disk`… */
98
+ source: string;
99
+ message: string;
100
+ }
101
+ export interface DashSystemReport {
102
+ observedAt: number;
103
+ /** The worst item's. */
104
+ status: DashTeamHealthStatus;
105
+ /** Worst first, then by scope and id. */
106
+ items: DashSystemItem[];
107
+ repositories: DashSystemRepository[];
108
+ workspaces: DashSystemWorkspace[];
109
+ problems: DashSystemProblem[];
110
+ /** The milliseconds each source took — the report runs every 10 minutes and must stay cheap. */
111
+ took: Record<string, number>;
112
+ }
113
+ /**
114
+ * How an item moved between two reports:
115
+ * - `new`: not ok now, and ok (or n/a, or not measured) before;
116
+ * - `worse`: warn → bad;
117
+ * - `better`: bad → warn;
118
+ * - `cleared`: not ok before, ok now — or gone while its scope was read whole in both;
119
+ * - `held`: not ok, unchanged.
120
+ *
121
+ * Not ok before and n/a now (or its scope not read whole) is no change: it was not measured, so nothing is known.
122
+ */
123
+ export type DashSystemChangeKind = 'new' | 'worse' | 'better' | 'cleared' | 'held';
124
+ export interface DashSystemChange {
125
+ key: string;
126
+ id: string;
127
+ group: DashSystemGroup;
128
+ scope: DashSystemScope;
129
+ title: string;
130
+ kind: DashSystemChangeKind;
131
+ /** The status before; absent for `new` of an item not measured before. */
132
+ from?: DashTeamHealthStatus;
133
+ to: DashTeamHealthStatus;
134
+ value: number;
135
+ /** The value before. */
136
+ was?: number;
137
+ /** Not ok since — every kind but `cleared` carries it. */
138
+ since?: number;
139
+ }
140
+ /** `reportChanges(prev, next)`: what moved since the previous report — what wakes the overseer's round. */
141
+ export interface DashSystemChanges {
142
+ /** The previous report's `observedAt`; absent on the first report. */
143
+ from?: number;
144
+ to: number;
145
+ changes: DashSystemChange[];
146
+ }
147
+ /** The scope's id in a key, a problem, a snapshot: `machine`, `repo:<repoId>`, `ws:<key>`. */
148
+ export declare function systemScopeId(scope: DashSystemScope): string;
149
+ /** An item's key: its scope's id, then what it measures — `repo:89fd8a21…/team.roles.uncovered`. */
150
+ export declare function systemItemKey(scope: DashSystemScope, id: string): string;
151
+ /** A value in its unit, as the terminal and the page print it: 18.4 GB, 51.2 s, 87 %, $4.20, load 12.5, 40 min. */
152
+ export declare function systemValue(value: number, unit?: DashSystemUnit): string;
153
+ /** Where an item was measured, in a few words: «machine», «foodguard», «foodguard lens». */
154
+ export declare function systemScopeLabel(scope: DashSystemScope): string;
155
+ /** How bad a status is, for sorting and «worse»: n/a < ok < warn < bad. */
156
+ export declare function systemStatusRank(status: DashTeamHealthStatus): number;
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var r=(e,n)=>o(e,"name",{value:n,configurable:!0});var a=Object.defineProperty,s=r((e,n)=>a(e,"name",{value:n,configurable:!0}),"n");export function systemScopeId(e){return e.kind==="machine"?"machine":e.kind==="repository"?`repo:${e.repoId}`:`ws:${e.key}`}r(systemScopeId,"systemScopeId"),s(systemScopeId,"systemScopeId");export function systemItemKey(e,n){return`${systemScopeId(e)}/${n}`}r(systemItemKey,"systemItemKey"),s(systemItemKey,"systemItemKey");export function systemValue(e,n){switch(n){case"bytes":{const t=e/1073741824;return t>=1?`${t.toFixed(t>=100?0:1)} GB`:`${Math.round(e/1024**2)} MB`}case"ms":return e>=1e3?`${(e/1e3).toFixed(1)} s`:`${Math.round(e)} ms`;case"percent":return`${Math.round(e)} %`;case"usd":return`$${e.toFixed(2)}`;case"load":return`load ${e.toFixed(1)}`;case"minutes":return`${Math.round(e)} min`;default:return String(e)}}r(systemValue,"systemValue"),s(systemValue,"systemValue");export function systemScopeLabel(e){return e.kind==="machine"?"machine":e.kind==="repository"?e.name:`${e.name} lens`}r(systemScopeLabel,"systemScopeLabel"),s(systemScopeLabel,"systemScopeLabel");const u={"n/a":0,ok:1,warn:2,bad:3};export function systemStatusRank(e){return u[e]}r(systemStatusRank,"systemStatusRank"),s(systemStatusRank,"systemStatusRank");
@@ -0,0 +1,57 @@
1
+ /**
2
+ * A run review read by its changes (planning/team/16 GS-D8): one row a change — the build or bug the team made, its
3
+ * tests, its reviews by role, its rounds of rework and where it stands — so a run of 146 tasks reads as its 58 changes.
4
+ * And the reviewed goal's plan and next list (GS-D1–D2). Served in `DashTeamReview` (team.ts), rendered by the review
5
+ * page and the zip's review.md.
6
+ */
7
+ import type { DashTeamGoalPlan, DashTeamOutcome, DashTeamTaskState, DashTeamWrapUp } from './team.js';
8
+ /** One test or review of a change: its task, where it stands, how it ended. */
9
+ export interface DashTeamReviewChangeStep {
10
+ taskId: string;
11
+ state: DashTeamTaskState;
12
+ outcome?: DashTeamOutcome;
13
+ }
14
+ /** A change's reviews for one role — the general reviewer, a goal's specialist — oldest first. */
15
+ export interface DashTeamReviewChangeReviews {
16
+ role: string;
17
+ steps: DashTeamReviewChangeStep[];
18
+ }
19
+ /**
20
+ * Where a change stands. Live: `open` (no one took it yet), `building`, `testing`, `reviewing`, `rework` (a review sent
21
+ * it back, or a test failed). Settled: `approved` (each role's newest review approved it), `done` (settled with no
22
+ * review that approved it — a bug closed won't-fix, a flow with no review), `stopped` (a step of it was cancelled before
23
+ * it was approved), `cancelled`, `moved` (to its goal's next list).
24
+ */
25
+ export type DashTeamReviewChangeState = 'open' | 'building' | 'testing' | 'reviewing' | 'rework' | 'approved' | 'done' | 'stopped' | 'cancelled' | 'moved';
26
+ /** One change of the run: a build or bug the team made, and the flow's tasks for it. */
27
+ export interface DashTeamReviewChange {
28
+ /** The build or bug the change began as. */
29
+ taskId: string;
30
+ kind: 'build' | 'bug';
31
+ title: string;
32
+ role?: string;
33
+ /** Who made it (a session, `user`) and who completed its first build. */
34
+ creator: string;
35
+ builtBy?: string;
36
+ createdAt: number;
37
+ /** When its last task closed — absent while one is still live. */
38
+ closedAt?: number;
39
+ /** Its tests, oldest first — the goal's one test that names it too. */
40
+ tests: DashTeamReviewChangeStep[];
41
+ /** Its reviews by role, in the order each role first reviewed it. */
42
+ reviews: DashTeamReviewChangeReviews[];
43
+ /** Builds and bugs the flow made for it: a review that asked for changes, a test that failed. */
44
+ rework: number;
45
+ /** Every task of its chain, itself included. */
46
+ tasks: number;
47
+ state: DashTeamReviewChangeState;
48
+ }
49
+ /** The reviewed goal's plan as it stands: the work made of it, its next list's size, and its wrap-up. */
50
+ export interface DashTeamReviewPlan extends DashTeamGoalPlan {
51
+ made: number;
52
+ /** Items on its next list. */
53
+ next: number;
54
+ wrapUp?: DashTeamWrapUp;
55
+ }
56
+ /** The review's flags for a goal's checkpoint and for an agent's words. */
57
+ export type DashTeamReviewWordsFlagKind = 'long-checkpoint' | 'glued-words';
@@ -0,0 +1 @@
1
+ "use strict";export{};
package/lib/team.d.ts CHANGED
@@ -13,7 +13,7 @@ export type DashTeamKind = (typeof DASH_TEAM_KINDS)[number];
13
13
  export type DashTeamTaskState = 'open' | 'claimed' | 'recovery' | 'completed' | 'cancelled';
14
14
  export type DashTeamOutcome = 'done' | 'approved' | 'changes-requested' | 'passed' | 'failed' | 'wontfix';
15
15
  /** What a task points at in the lens or the repository. */
16
- export declare const DASH_TEAM_LINK_KINDS: readonly ["task", "flow", "error", "suggestion", "ai-call", "review", "page", "route", "commit", "branch", "worktree", "file"];
16
+ export declare const DASH_TEAM_LINK_KINDS: readonly ["task", "flow", "error", "suggestion", "ai-call", "review", "page", "route", "commit", "branch", "worktree", "file", "finding"];
17
17
  export interface DashTeamLink {
18
18
  kind: (typeof DASH_TEAM_LINK_KINDS)[number];
19
19
  id: string;
@@ -88,6 +88,47 @@ export interface DashTeamTask {
88
88
  team?: DashTeamGoalRole[];
89
89
  /** The open blocking question (`q-…`) it waits for (agent_ask): no one claims it until it is answered. */
90
90
  waitingOn?: string;
91
+ /** A goal's plan (planning/team/16 GS-D1): the tasks of work and hours it runs for, what is made of it, when its hours end. */
92
+ plan?: DashTeamGoalPlan;
93
+ /** A goal's next list (GS-D2): the work found under it and left for the next goals — whole in the drawer. */
94
+ next?: DashTeamNextItem[];
95
+ /** How many items its next list holds (the board). */
96
+ nextCount?: number;
97
+ /** A goal that wraps up (GS-D3): no new work under it; what is held finishes, QA runs, it merges. */
98
+ wrapUp?: DashTeamWrapUp;
99
+ /** A task moved to its goal's next list: the item it became (cancelled, never counted against the plan). */
100
+ movedToNext?: string;
101
+ }
102
+ /** A goal's plan as it stands (planning/team/16 GS-D1). */
103
+ export interface DashTeamGoalPlan {
104
+ /** The tasks of work its agents may make under it — the flow's tests, reviews and rework not counted. */
105
+ builds: number;
106
+ hours: number;
107
+ /** Who set it: its maker, the repository's default, the person. */
108
+ from: 'given' | 'default' | 'person';
109
+ /** Its first claim — the hours run from here (a bridged sleep of the machine not counted). */
110
+ startedAt?: number;
111
+ /** The tasks of work made so far (store.goalPlan). */
112
+ made?: number;
113
+ /** When its hours end. */
114
+ endsAt?: number;
115
+ }
116
+ /** One piece of work found under a goal and left for the next one (GS-D2). */
117
+ export interface DashTeamNextItem {
118
+ id: string;
119
+ at: number;
120
+ /** The session that found it, or `user`. */
121
+ by: string;
122
+ title: string;
123
+ why: string;
124
+ /** The task it was moved from, cancelled «moved to next». */
125
+ from?: string;
126
+ }
127
+ /** A goal wrapping up (GS-D3): when, who asked (a session, `user`, or `lensmcp` when its hours ran out), and why. */
128
+ export interface DashTeamWrapUp {
129
+ at: number;
130
+ by: string;
131
+ why: string;
91
132
  }
92
133
  /** A goal's word for one role: its rules for this goal (after the role's own), what its agents launch with, the paths it reviews too. */
93
134
  export interface DashTeamGoalRole {
@@ -602,7 +643,7 @@ export interface DashTeamReviewDelegation {
602
643
  }
603
644
  /** What the run says about the process — a hint for the person reviewing it, never a verdict. */
604
645
  export interface DashTeamReviewFlag {
605
- kind: 'self-review' | 'manager-did-work' | 'same-model' | 'role-model-mismatch' | 'unjoined-agent' | 'long-wait' | 'silent-claim' | 'rework' | 'no-evidence' | 'recovery' | 'open-under-closed' | 'serial' | 'idle-agent' | 'host-slept' | DashTeamConductKind;
646
+ kind: 'self-review' | 'manager-did-work' | 'same-model' | 'role-model-mismatch' | 'unjoined-agent' | 'long-wait' | 'silent-claim' | 'rework' | 'no-evidence' | 'recovery' | 'open-under-closed' | 'serial' | 'idle-agent' | 'host-slept' | DashTeamConductKind | import('./team-review-changes.js').DashTeamReviewWordsFlagKind;
606
647
  severity: 'info' | 'warn';
607
648
  text: string;
608
649
  taskId?: string;
@@ -695,6 +736,11 @@ export interface DashTeamReview {
695
736
  messages?: number;
696
737
  tasks?: number;
697
738
  };
739
+ /** One row a change, oldest first (planning/team/16 GS-D8) — absent from a server older than it. */
740
+ changes?: import('./team-review-changes.js').DashTeamReviewChange[];
741
+ /** The reviewed goal's plan, and its next list (GS-D1–D2). */
742
+ plan?: import('./team-review-changes.js').DashTeamReviewPlan;
743
+ next?: DashTeamNextItem[];
698
744
  }
699
745
  /** The clients LensMCP launches headless: Codex (`codex exec`) and Claude Code (`claude -p`). */
700
746
  export type DashTeamLaunchClient = 'codex' | 'claude';
@@ -970,7 +1016,7 @@ export interface DashTeamQuestionOption {
970
1016
  label: string;
971
1017
  detail?: string;
972
1018
  }
973
- /** Who answered: the manager it went to, the person (Team › Inbox, the CLI), or the person's delegate — their inbox session. */
1019
+ /** Who answered: the manager it went to, the person (the dashboard's Inbox, the CLI), or the person's delegate — their inbox session. */
974
1020
  export interface DashTeamQuestionAnswer {
975
1021
  text: string;
976
1022
  /** The option picked, 1-based. */
package/lib/team.js CHANGED
@@ -1 +1 @@
1
- "use strict";var o=Object.defineProperty;var r=(t,e)=>o(t,"name",{value:e,configurable:!0});var i=Object.defineProperty,a=r((t,e)=>i(t,"name",{value:e,configurable:!0}),"r");export const DASH_TEAM_KINDS=["goal","build","bug","review","test","qa","docs","marketing","research","chore"],DASH_TEAM_LINK_KINDS=["task","flow","error","suggestion","ai-call","review","page","route","commit","branch","worktree","file"];export function modelClient(t){const e=t?.trim()??"";if(/\b(claude|opus|sonnet|haiku|fable)\b/i.test(e))return"claude";if(/^(gpt|o\d+|codex)\b/i.test(e))return"codex"}r(modelClient,"modelClient"),a(modelClient,"modelClient");
1
+ "use strict";var o=Object.defineProperty;var r=(t,e)=>o(t,"name",{value:e,configurable:!0});var i=Object.defineProperty,a=r((t,e)=>i(t,"name",{value:e,configurable:!0}),"r");export const DASH_TEAM_KINDS=["goal","build","bug","review","test","qa","docs","marketing","research","chore"],DASH_TEAM_LINK_KINDS=["task","flow","error","suggestion","ai-call","review","page","route","commit","branch","worktree","file","finding"];export function modelClient(t){const e=t?.trim()??"";if(/\b(claude|opus|sonnet|haiku|fable)\b/i.test(e))return"claude";if(/^(gpt|o\d+|codex)\b/i.test(e))return"codex"}r(modelClient,"modelClient"),a(modelClient,"modelClient");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.25.46",
3
+ "version": "1.25.48",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",