@lensmcp/protocol-types 1.25.55 → 1.25.57

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
@@ -41,3 +41,7 @@ export * from './lib/overseer-findings.js';
41
41
  export * from './lib/overseer-rounds.js';
42
42
  export * from './lib/goal-design.js';
43
43
  export * from './lib/overseer-messages.js';
44
+ export * from './lib/team-roadmap.js';
45
+ export type { TaskTimePhase, TaskAttempt, TaskTiming } from './lib/task-timing.js';
46
+ export type { ProofFingerprint, ProofEvidence, RuntimeProofIdentity } from './lib/proof.js';
47
+ export type { GoalAdmission, GoalDeliveryPolicy, DeliveryProofRequirement, PackageContract, PackagePublication, PackageCandidate, DeliveryFailureKind, DeliveryFinding, PackageDelivery, DeliveryAssignment, PackageDeliverySummary } from './lib/team-delivery.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-review-changes.js";export*from"./lib/goal-outcome.js";export*from"./lib/goal-retro.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";export*from"./lib/goal-design.js";export*from"./lib/overseer-messages.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/goal-outcome.js";export*from"./lib/goal-retro.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";export*from"./lib/goal-design.js";export*from"./lib/overseer-messages.js";export*from"./lib/team-roadmap.js";
@@ -75,7 +75,8 @@ export interface DashSession {
75
75
  eventCount: number;
76
76
  setupIssues: DashSetupIssue[];
77
77
  }
78
- export type DashServiceState = 'up' | 'starting' | 'idle' | 'down' | 'wedged' | 'crash-looping' | 'unknown';
78
+ /** `parked`: the checkout is a parked on-demand worktree (planning/team/21) — nothing of it runs until it is run. */
79
+ export type DashServiceState = 'up' | 'starting' | 'idle' | 'down' | 'wedged' | 'crash-looping' | 'unknown' | 'parked';
79
80
  /** Aggregates over a sliding window (see `DashKpis.windowSec`). `null` = no samples. */
80
81
  export interface DashWindowStats {
81
82
  count: number;
@@ -277,12 +278,17 @@ export interface DashCluster {
277
278
  * — left out of `worktrees`: `lensmcp instance prune` forgets them and drops the data the lens made for them.
278
279
  */
279
280
  worktreesGone?: number;
280
- /** Set when THIS dashboard is a worktree instance's: whose worktree it is. */
281
+ /**
282
+ * Set when THIS dashboard is a worktree instance's: whose worktree it is. `parked`: an on-demand worktree that is parked
283
+ * — nothing of it runs and its pages show what its last run recorded; it runs from the main checkout's Cluster ›
284
+ * Worktrees (`baseDashboard`) or `lensmcp instance run <name>`.
285
+ */
281
286
  instance?: {
282
287
  name: string;
283
288
  baseKey: string;
284
289
  apex: string;
285
290
  baseDashboard: string;
291
+ parked?: true;
286
292
  };
287
293
  }
288
294
  /** One worktree instance of the project (a git worktree served beside the main checkout under its own hosts). */
@@ -300,7 +306,10 @@ export interface DashWorktree {
300
306
  * Neither stopped nor offline; `lensmcp instance start --name=<name>` serves it on its own. Absent once started.
301
307
  */
302
308
  checkoutOnly?: boolean;
303
- /** Its dashboard's path under the lens host (`/foodguard-gate1`); a checkout only's is the main checkout's. */
309
+ /**
310
+ * Its dashboard's path under the lens host (`/foodguard-gate1`); a checkout only's is the main checkout's. A parked
311
+ * on-demand worktree's opens too: the gateway keeps its dashboard while nothing else of it runs.
312
+ */
304
313
  dashboard: string;
305
314
  /** The checkout, shortened for display (`~/…/fg/gate1`). */
306
315
  root: string;
@@ -960,6 +969,13 @@ export type DashStreamEvent = {
960
969
  type: 'summary';
961
970
  data: DashSummary;
962
971
  }
972
+ /** Small invalidation frame; the roadmap is fetched only after a relevant change. */
973
+ | {
974
+ type: 'roadmap-revision';
975
+ data: {
976
+ stamp: string;
977
+ };
978
+ }
963
979
  /** Every 15 s on every connection — what tells a tab its stream is alive when its page's frames are quiet. */
964
980
  | {
965
981
  type: 'ping';
@@ -971,7 +987,7 @@ export type DashStreamEventType = DashStreamEvent['type'];
971
987
  * `ping` go to every tab, `summary` too (asked or not); `logs-resync` goes with `logs`, and the log backlog is sent
972
988
  * only to a tab that asks for `logs`. A tab that sends no `topics` gets every frame (a UI from before topics).
973
989
  */
974
- export type DashStreamTopic = 'summary' | 'session' | 'cluster' | 'kpis' | 'flows' | 'flow-rev' | 'logs' | 'diagnostics' | 'errors';
990
+ export type DashStreamTopic = 'summary' | 'session' | 'cluster' | 'kpis' | 'flows' | 'flow-rev' | 'logs' | 'diagnostics' | 'errors' | 'roadmap-revision';
975
991
  export declare const DASH_STREAM_TOPICS: readonly DashStreamTopic[];
976
992
  /**
977
993
  * The shell's numbers — the sidebar's badges, the top bar's counters, the scope card — for a tab whose page does not
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","db-connection","other"],DASH_STREAM_TOPICS=["summary","session","cluster","kpis","flows","flow-rev","logs","diagnostics","errors"],DASH_AI_TRIGGERS=["auto","click","agent"];
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"],DASH_STREAM_TOPICS=["summary","session","cluster","kpis","flows","flow-rev","logs","diagnostics","errors","roadmap-revision"],DASH_AI_TRIGGERS=["auto","click","agent"];
package/lib/proof.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ /** Gateway identity and hashes, never database URLs, credentials or environment values. */
2
+ export interface RuntimeProofIdentity {
3
+ workspaceKey: string;
4
+ name: string;
5
+ candidate: string;
6
+ environmentKeys: string[];
7
+ environmentHash: string;
8
+ configurationHash: string;
9
+ }
10
+ /** Identity of a proof's source and declared execution inputs. Secret values are never retained. */
11
+ export interface ProofFingerprint {
12
+ version: 1;
13
+ key: string;
14
+ candidate: string;
15
+ tree: string;
16
+ repository: string;
17
+ workingDirectory: string;
18
+ invocationHash: string;
19
+ environmentHash: string;
20
+ runtime: string;
21
+ runnerHash: string;
22
+ files: Record<string, string>;
23
+ runtimeBinding?: RuntimeProofIdentity;
24
+ }
25
+ export interface ProofEvidence {
26
+ fingerprint?: ProofFingerprint;
27
+ eligible: boolean;
28
+ reason?: string;
29
+ verifiedAt?: number;
30
+ }
package/lib/proof.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";export{};
@@ -0,0 +1,20 @@
1
+ /** Observed task states, not estimates of model thinking time or CPU usage. */
2
+ export type TaskTimePhase = 'ready' | 'owned' | 'executionQueue' | 'execution' | 'decision' | 'blocked' | 'recovery' | 'ended';
3
+ export interface TaskAttempt {
4
+ generation: number;
5
+ owner: string;
6
+ startedAt: number;
7
+ endedAt?: number;
8
+ outcome?: string;
9
+ }
10
+ export interface TaskTiming {
11
+ /** First instrumentation observation; earlier history is deliberately not reconstructed. */
12
+ observedAt: number;
13
+ at: number;
14
+ phase: TaskTimePhase;
15
+ /** Claimed states are only vouched for through this lease. */
16
+ until?: number;
17
+ endedAt?: number;
18
+ milliseconds: Partial<Record<TaskTimePhase, number>>;
19
+ attempts: TaskAttempt[];
20
+ }
@@ -0,0 +1 @@
1
+ "use strict";export{};
@@ -0,0 +1,124 @@
1
+ import type { DeliveryProfile } from './team-roadmap.js';
2
+ import type { ProofEvidence } from './proof.js';
3
+ import type { CandidateRuntimeRequirement } from './workspace-actions.js';
4
+ /** A deliberate stop in admission; a draining goal retains capacity until held work and jobs settle. */
5
+ export interface GoalAdmission {
6
+ mode: 'draining' | 'paused';
7
+ at: number;
8
+ by: string;
9
+ reason: string;
10
+ }
11
+ /** Pinned by the approved design. Absence preserves the legacy hand-off engine. */
12
+ export interface GoalDeliveryPolicy {
13
+ version: 1;
14
+ profile: DeliveryProfile;
15
+ }
16
+ export interface DeliveryProofRequirement {
17
+ id: string;
18
+ action: 'test' | 'typecheck' | 'lint' | 'build' | 'e2e' | 'verify';
19
+ project: string;
20
+ target?: string;
21
+ files?: string[];
22
+ related?: string[];
23
+ proofFiles?: string[];
24
+ candidateRuntime?: CandidateRuntimeRequirement;
25
+ }
26
+ /** Scope, ownership and proof declared together before independent writers start. */
27
+ export interface PackageContract {
28
+ acceptance: string[];
29
+ testPaths: string[];
30
+ proofs: DeliveryProofRequirement[];
31
+ /** Additional reviews; the normal reviewer and goal-mandated specialists are never removed. */
32
+ reviewRoles?: string[];
33
+ }
34
+ export interface PackagePublication {
35
+ sha: string;
36
+ base: string;
37
+ paths: string[];
38
+ by: string;
39
+ taskId: string;
40
+ at: number;
41
+ }
42
+ export interface PackageCandidate {
43
+ sha: string;
44
+ base: string;
45
+ inputs: string[];
46
+ ref: string;
47
+ root: string;
48
+ worktreeId: string;
49
+ at: number;
50
+ proofs: Array<{
51
+ requirementId: string;
52
+ runId: string;
53
+ state: 'queued' | 'passed' | 'failed' | 'invalid';
54
+ reservedAt?: number;
55
+ supersededAt?: number;
56
+ evidence?: ProofEvidence;
57
+ reason?: string;
58
+ }>;
59
+ reviews: Array<{
60
+ role: string;
61
+ taskId: string;
62
+ state: 'pending' | 'approved' | 'changes-requested';
63
+ by?: string;
64
+ }>;
65
+ supersededAt?: number;
66
+ integratedAt?: number;
67
+ /** Reserved native integration, preventing publication while the Git CAS is in flight. */
68
+ integratingAt?: number;
69
+ }
70
+ export type DeliveryFailureKind = 'product' | 'test' | 'environment' | 'stale';
71
+ export interface DeliveryFinding {
72
+ id: string;
73
+ candidate: string;
74
+ source: string;
75
+ summary: string;
76
+ kind?: DeliveryFailureKind;
77
+ owner?: string;
78
+ repairTask?: string;
79
+ resolvedAt?: number;
80
+ }
81
+ export interface PackageDelivery {
82
+ version: 1;
83
+ contract: PackageContract;
84
+ /** Resolved normal/specialist roles, pinned when the package is declared. */
85
+ reviewRoles: string[];
86
+ testTaskId?: string;
87
+ base: string;
88
+ writersStarted?: boolean;
89
+ implementation?: PackagePublication;
90
+ tests?: PackagePublication;
91
+ candidates: PackageCandidate[];
92
+ current?: string;
93
+ findings: DeliveryFinding[];
94
+ /** One failed repaired revision counts once, even when several checks fail concurrently. */
95
+ failedRepairs: string[];
96
+ diagnosis?: {
97
+ at: number;
98
+ by: string;
99
+ after: string[];
100
+ text: string;
101
+ };
102
+ }
103
+ export interface DeliveryAssignment {
104
+ packageId: string;
105
+ stage: 'implementation' | 'test-author' | 'preliminary-review' | 'final-review' | 'repair';
106
+ candidate?: string;
107
+ failureKind?: DeliveryFailureKind;
108
+ writer?: 'implementation' | 'tests';
109
+ }
110
+ /** Bounded list/read summary; revision history and fingerprints stay behind the package/job handles. */
111
+ export interface PackageDeliverySummary {
112
+ state: 'building' | 'authoring-tests' | 'preparing' | 'verifying' | 'needs-repair' | 'ready' | 'integrating' | 'integrated';
113
+ candidate?: string;
114
+ proofs: {
115
+ passed: number;
116
+ required: number;
117
+ };
118
+ reviews: {
119
+ approved: number;
120
+ required: number;
121
+ };
122
+ unresolvedFindings: number;
123
+ revisions: number;
124
+ }
@@ -0,0 +1 @@
1
+ "use strict";export{};
@@ -0,0 +1,319 @@
1
+ /** Forward delivery planning. Times are UTC milliseconds; estimates are continuous agent-work minutes. */
2
+ export type DeliveryProfile = 'compact' | 'feature' | 'high-risk';
3
+ export interface DurationRange {
4
+ low: number;
5
+ working: number;
6
+ high: number;
7
+ }
8
+ export interface DeliveryResources {
9
+ writers: number;
10
+ checkers: number;
11
+ heavy: number;
12
+ light: number;
13
+ }
14
+ export interface GoalDependency {
15
+ goalId: string;
16
+ output: string;
17
+ revision?: string;
18
+ }
19
+ export interface GoalSchedule {
20
+ goalId: string;
21
+ epicId?: string;
22
+ profile: DeliveryProfile;
23
+ dependencies: GoalDependency[];
24
+ estimate?: DurationRange;
25
+ remaining?: DurationRange;
26
+ priority: number;
27
+ notBefore?: number;
28
+ /** Unknown human decision duration is an explicit blocker, never guessed. */
29
+ humanWait?: boolean;
30
+ resources: DeliveryResources;
31
+ baseline?: {
32
+ start: number;
33
+ finish: number;
34
+ };
35
+ /** A 2–4 word name for the timeline bar (planning/team/24); the title stays everywhere else. */
36
+ label?: string;
37
+ /** Who set `estimate`/`remaining`, when and why (RM-D2: agent hours, kept as minutes in the ranges above). */
38
+ estimateSource?: EstimateSource;
39
+ }
40
+ /** Where a goal's estimate came from: the person's numbers, or an accepted planner proposal. */
41
+ export interface EstimateSource {
42
+ by: 'user' | 'planner';
43
+ at: number;
44
+ /** The planner proposal the estimate was accepted from. */
45
+ proposalId?: string;
46
+ confidence?: 'low' | 'medium' | 'high';
47
+ /** One or two sentences: what the estimate rests on. */
48
+ why?: string;
49
+ /** Finished goals of this repository it was compared with, and how long each really took. */
50
+ comparedWith?: Array<{
51
+ goalId: string;
52
+ title: string;
53
+ actualHours: number;
54
+ }>;
55
+ }
56
+ /**
57
+ * A link between two top-level goals (planning/team/24 RM-D7): `goal` is the one that waits or yields, `on` the other.
58
+ * needs `goal` is not claimed until `on` is completed (a completed goal is merged: managers merge before completing,
59
+ * native delivery integrates before it may complete); a cancelled `on` blocks until the link is removed
60
+ * after order only: `goal` ranks below `on`, but starts first when `on` cannot and a slot would sit idle
61
+ * apart never at the same time (same files): `goal` is not claimed while `on` runs — either order
62
+ */
63
+ export type GoalLinkKind = 'needs' | 'after' | 'apart';
64
+ export declare const GOAL_LINK_KINDS: readonly GoalLinkKind[];
65
+ export interface GoalLink {
66
+ goal: string;
67
+ on: string;
68
+ kind: GoalLinkKind;
69
+ why?: string;
70
+ by: 'user' | 'planner';
71
+ at: number;
72
+ }
73
+ /**
74
+ * One change to the roadmap (planning/team/24). The prompt bar, the Order view, the drawer and an accepted planner
75
+ * proposal all send these, as `{ action: 'ops', ops, reason, revision, requestId, preview }`. Hours are agent hours.
76
+ */
77
+ export type RoadmapOp = {
78
+ op: 'move';
79
+ goalId: string;
80
+ to: 'top' | 'bottom' | {
81
+ before: string;
82
+ } | {
83
+ after: string;
84
+ };
85
+ } | {
86
+ op: 'order';
87
+ goalIds: string[];
88
+ } | {
89
+ op: 'postpone';
90
+ goalId: string;
91
+ until: number | null;
92
+ } | {
93
+ op: 'link';
94
+ goal: string;
95
+ on: string;
96
+ kind: GoalLinkKind;
97
+ why?: string;
98
+ } | {
99
+ op: 'unlink';
100
+ goal: string;
101
+ on: string;
102
+ kind?: GoalLinkKind;
103
+ } | {
104
+ op: 'pin';
105
+ goalId: string;
106
+ pinned: boolean;
107
+ } | {
108
+ op: 'estimate';
109
+ goalId: string;
110
+ hours: {
111
+ low: number;
112
+ likely: number;
113
+ high: number;
114
+ };
115
+ remaining?: boolean;
116
+ source?: Omit<EstimateSource, 'at' | 'by'>;
117
+ } | {
118
+ op: 'label';
119
+ goalId: string;
120
+ label: string;
121
+ };
122
+ export declare const ROADMAP_OPS: readonly ["move", "order", "postpone", "link", "unlink", "pin", "estimate", "label"];
123
+ export interface DeliveryEpic {
124
+ id: string;
125
+ title: string;
126
+ description: string;
127
+ createdAt: number;
128
+ }
129
+ export interface AcceptedGoalOutput {
130
+ goalId: string;
131
+ output: string;
132
+ revision: string;
133
+ integratedAt: number;
134
+ }
135
+ export interface DeliveryAudit {
136
+ at: number;
137
+ by: string;
138
+ action: string;
139
+ reason: string;
140
+ goalId?: string;
141
+ }
142
+ export interface DeliveryState {
143
+ version: 1;
144
+ revision: number;
145
+ epics: DeliveryEpic[];
146
+ schedules: GoalSchedule[];
147
+ outputs: AcceptedGoalOutput[];
148
+ audit: DeliveryAudit[];
149
+ /** The ranked goals, first first (RM-D6): the claim order. Goals not in it rank after it, by priority then age. */
150
+ order?: string[];
151
+ /** Goals a re-plan never moves. */
152
+ pinned?: string[];
153
+ links?: GoalLink[];
154
+ }
155
+ export interface RoadmapGoal {
156
+ id: string;
157
+ title: string;
158
+ state: string;
159
+ createdAt: number;
160
+ startedAt?: number;
161
+ completedAt?: number;
162
+ admission?: import('./team-delivery.js').GoalAdmission;
163
+ schedule?: GoalSchedule;
164
+ forecast?: {
165
+ start: DurationRange;
166
+ finish: DurationRange;
167
+ };
168
+ blockers: string[];
169
+ /** The task's own priority: P0 jumps the ranked order (RM-D6). */
170
+ priority?: number;
171
+ /** 1-based place in the effective order, for goals not completed or cancelled. */
172
+ rank?: number;
173
+ pinned?: boolean;
174
+ /** Where its design is, when it has one (`approved` is the only stage that lets it start). */
175
+ design?: string;
176
+ }
177
+ export interface RoadmapAnswer {
178
+ now: number;
179
+ revision: number;
180
+ calendar: 'continuous';
181
+ /** Preview/apply changes compared at the same instant, excluding clock drift. */
182
+ impact?: string[];
183
+ limits: DeliveryResources & {
184
+ goals: number;
185
+ };
186
+ epics: DeliveryEpic[];
187
+ goals: RoadmapGoal[];
188
+ outputs: AcceptedGoalOutput[];
189
+ audit: DeliveryAudit[];
190
+ /** The effective order (state order + every other live goal, P0 first, `needs`/`after` predecessors above). */
191
+ order: string[];
192
+ pinned: string[];
193
+ links: GoalLink[];
194
+ /**
195
+ * The same goals planned with 1–4 goals at once (planning/team/24 RM-D1): when everything with a forecast finishes,
196
+ * and how many live goals get no forecast under that shape.
197
+ */
198
+ shapes?: Array<{
199
+ goals: number;
200
+ finish?: DurationRange;
201
+ unplaced: number;
202
+ }>;
203
+ /** The newest change Undo restores (RM-D8: 24 h). */
204
+ undo?: {
205
+ at: number;
206
+ reason: string;
207
+ until: number;
208
+ };
209
+ /** Finished goals with an estimate: how many landed within their low–high range, and the median actual ÷ likely. */
210
+ accuracy?: {
211
+ goals: number;
212
+ withinRange: number;
213
+ medianRatio?: number;
214
+ };
215
+ }
216
+ /** A goal's part of a planner proposal (planning/team/24 R3). Hours are agent hours. */
217
+ export interface PlannerGoalProposal {
218
+ goalId: string;
219
+ title: string;
220
+ label?: string;
221
+ /** `remaining` for a running goal: the time left, not the whole. */
222
+ estimate?: {
223
+ low: number;
224
+ likely: number;
225
+ high: number;
226
+ confidence: 'low' | 'medium' | 'high';
227
+ remaining?: boolean;
228
+ };
229
+ why?: string;
230
+ comparedWith?: Array<{
231
+ goalId: string;
232
+ title: string;
233
+ actualHours: number;
234
+ }>;
235
+ links?: Array<{
236
+ on: string;
237
+ kind: GoalLinkKind;
238
+ why: string;
239
+ }>;
240
+ /** Backlog clean-up suggestions (RM-D12): never applied, only shown. */
241
+ hints?: Array<{
242
+ kind: 'split' | 'merge' | 'epic' | 'cancel' | 'other';
243
+ text: string;
244
+ with?: string[];
245
+ }>;
246
+ /** Design prerequisite keys it could not match to a goal. */
247
+ unmapped?: string[];
248
+ state: 'proposed' | 'accepted' | 'skipped';
249
+ }
250
+ export interface PlannerProposal {
251
+ id: string;
252
+ at: number;
253
+ /** `all` = Plan all (a click), `goal` = one goal on design approval, `remaining` = a running goal past its high. */
254
+ kind: 'all' | 'goal' | 'remaining';
255
+ state: 'running' | 'ready' | 'failed' | 'decided';
256
+ model?: string;
257
+ costUsd?: number;
258
+ /** The AI ledger id of the call (Diagnose › Runs). */
259
+ runId?: string;
260
+ /** The order it proposes for the goals it planned, first first, and why. */
261
+ order?: string[];
262
+ orderWhy?: string;
263
+ orderState?: 'proposed' | 'accepted' | 'skipped';
264
+ goals: PlannerGoalProposal[];
265
+ unmappedPrerequisites?: Array<{
266
+ key: string;
267
+ seenIn: string[];
268
+ why: string;
269
+ }>;
270
+ /** What LensMCP dropped from the answer and why (unknown ids, cycles, bad ranges) — never silently. */
271
+ dropped?: string[];
272
+ error?: string;
273
+ }
274
+ /** GET /api/team/roadmap/planner. */
275
+ export interface RoadmapPlannerState {
276
+ /** Settings › Agent teams `roadmapPlanner`. */
277
+ on: boolean;
278
+ /** A working Anthropic key is there. */
279
+ key: boolean;
280
+ model: string;
281
+ spentToday: number;
282
+ dailyUsd: number;
283
+ /** Goals live and not estimated (what Plan all would plan). */
284
+ unplanned: number;
285
+ /** When «next week» starts (RM-D9: Settings `roadmapWeekStart` + `roadmapDayStart`, the machine's time zone), UTC ms. */
286
+ nextWeekAt: number;
287
+ /** Tomorrow at the day's start hour, UTC ms. */
288
+ tomorrowAt: number;
289
+ proposals: PlannerProposal[];
290
+ }
291
+ /**
292
+ * POST /api/team/roadmap/ask `{ text, revision }`: Claude reads the sentence into operations; LensMCP previews them at
293
+ * the given revision. Nothing is applied — the page sends `ops` back as `{ action: 'ops', preview: false }`.
294
+ */
295
+ export interface RoadmapAskAnswer {
296
+ text: string;
297
+ ops: Array<{
298
+ op: RoadmapOp;
299
+ label: string;
300
+ }>;
301
+ /** «4 goals at once»: applied through Team › Limits (goalsMax), not the roadmap state. */
302
+ shape?: {
303
+ goals: number;
304
+ label: string;
305
+ };
306
+ /** When it cannot tell which goal is meant: a question and the candidates. */
307
+ clarify?: {
308
+ question: string;
309
+ options: Array<{
310
+ goalId: string;
311
+ title: string;
312
+ }>;
313
+ };
314
+ /** The ops previewed (absent when there are none or a question is asked). */
315
+ preview?: RoadmapAnswer;
316
+ /** What it could not do, in words. */
317
+ note?: string;
318
+ costUsd?: number;
319
+ }
@@ -0,0 +1 @@
1
+ "use strict";export const GOAL_LINK_KINDS=["needs","after","apart"],ROADMAP_OPS=["move","order","postpone","link","unlink","pin","estimate","label"];
package/lib/team.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import type { DashTeamTaskDesign } from './goal-design.js';
2
+ import type { TaskTiming } from './task-timing.js';
3
+ import type { GoalAdmission, PackageDeliverySummary } from './team-delivery.js';
2
4
  /**
3
5
  * The Team page (servers/lensmcp-mcp/src/dashboard/team.ts): the repository's agent team as its coordination store
4
6
  * holds it — the agents in their roles, the tasks they take and hand on, each task's work log — and what the person at
@@ -28,7 +30,17 @@ export interface DashTeamLogLine {
28
30
  kind: 'progress' | 'decision' | 'blocker' | 'handoff' | 'note' | 'state';
29
31
  text: string;
30
32
  }
33
+ /** How LensMCP landed a goal on main (storage flow.ts GoalIntegration): its strategy, main's new commit, the tip it took. */
34
+ export interface DashTeamGoalIntegration {
35
+ strategy: 'squash' | 'merge' | 'ff';
36
+ sha: string;
37
+ tip: string;
38
+ at: number;
39
+ }
31
40
  export interface DashTeamTask {
41
+ delivery?: PackageDeliverySummary;
42
+ admission?: GoalAdmission;
43
+ timing?: TaskTiming;
32
44
  id: string;
33
45
  title: string;
34
46
  /** Whole on `/api/team/task`; its first lines on the board. */
@@ -58,6 +70,10 @@ export interface DashTeamTask {
58
70
  outcome?: DashTeamOutcome;
59
71
  /** The session holding it. */
60
72
  owner?: string;
73
+ /** Stable cohesive scope shared by implementation, checks and repairs. */
74
+ packageId?: string;
75
+ /** Earlier task this one repairs, without declaring new scope. */
76
+ repairOf?: string;
61
77
  /** The session that must take it. */
62
78
  to?: string;
63
79
  /** A session id, `user` — the person's tasks (the Team page, an accepted team design) — or `lensmcp`: the team flow's hand-offs, the operator CLI's. */
@@ -73,6 +89,11 @@ export interface DashTeamTask {
73
89
  result?: string;
74
90
  evidence?: string[];
75
91
  completedHead?: string | null;
92
+ /**
93
+ * A goal LensMCP landed on main (agent_task_update merge, flow.json goal.merge): the strategy, the commit main moved
94
+ * to (`sha` — a squash or merge commit, or the branch tip for `ff`), the branch tip it took, when (the drawer).
95
+ */
96
+ integration?: DashTeamGoalIntegration;
76
97
  paths?: string[];
77
98
  tags?: string[];
78
99
  /** A review's items, whole (the drawer): each point it checks and its verdict (planning/team/06-team-operations.md OP-D3). */
@@ -418,6 +439,12 @@ export interface DashTeamLimitsAnswer {
418
439
  }
419
440
  /** A goal's plan as it stands (planning/team/16 GS-D1). */
420
441
  export interface DashTeamGoalPlan {
442
+ /** Absent on legacy goals, which retain their accepted elapsed deadline. */
443
+ timePolicy?: 'forecast' | 'deadline';
444
+ forecastAt?: number;
445
+ forecastCheckpointAt?: number;
446
+ /** Pinned budget contract; absent means the legacy task count. */
447
+ units?: 'tasks' | 'packages';
421
448
  /** The tasks of work its agents may make under it — the flow's tests, reviews and rework not counted. */
422
449
  builds: number;
423
450
  hours: number;
@@ -568,7 +595,7 @@ export interface DashTeamHost {
568
595
  rssMb?: number;
569
596
  }
570
597
  /** Why a session ended: closed by itself or the person, its CLI's SessionEnd, a subagent that stopped, its host process gone, a join never used, quiet past the lease with no host to vouch for it. */
571
- export type DashTeamClosedReason = 'closed' | 'session-end' | 'stopped' | 'host-gone' | 'unused' | 'lost';
598
+ export type DashTeamClosedReason = 'closed' | 'session-end' | 'stopped' | 'host-gone' | 'unused' | 'lost' | 'suspended';
572
599
  /** One coordination session: an agent on the team (a role), or one outside it (no role). */
573
600
  export interface DashTeamSession {
574
601
  id: string;
@@ -981,7 +1008,8 @@ export interface DashTeamReviewAgent {
981
1008
  outcomes: Partial<Record<DashTeamOutcome, number>>;
982
1009
  /** Its own transcript, folded — `tail` left out (the zip has its lines in the window). */
983
1010
  transcript?: Omit<DashTeamAgentDetail, 'tail'>;
984
- /** Its model usage in the run's window, from its own lines in it — `transcript.usage` is of its whole transcript. */
1011
+ /** Usage during recorded task holds, deduplicated by transcript. No hold means unattributed; not zero usage. */
1012
+ usageAttribution?: 'task-holds' | 'unattributed' | 'shared-transcript';
985
1013
  usage?: DashTeamAgentUsage;
986
1014
  }
987
1015
  /** One thing that happened, in time order. */
@@ -1060,6 +1088,10 @@ export interface DashTeamReviewMetrics {
1060
1088
  }
1061
1089
  /** A run's model usage: per client, and both clients' normalized fields summed — never one client's meaning added to another's. */
1062
1090
  export interface DashTeamReviewUsage {
1091
+ /** Older exports may use the whole window; new reports count only recorded task holds. */
1092
+ attribution?: 'task-holds';
1093
+ /** Linked transcripts with no recorded hold for this goal; their tokens are not charged to it. */
1094
+ unattributedTranscripts?: number;
1063
1095
  codex?: DashTeamAgentUsage & {
1064
1096
  agents: number;
1065
1097
  };
@@ -1171,6 +1203,8 @@ export interface DashTeamLaunch {
1171
1203
  /** Its coordination session once it joined (its hooks name the launch), and its client's thread or session id. */
1172
1204
  sessionId?: string;
1173
1205
  threadId?: string;
1206
+ /** Original launch whose native conversation this launch resumes. */
1207
+ resumedFrom?: string;
1174
1208
  /** The newest lines of its output, readable — what it said before it joined, or why it ended. */
1175
1209
  tail?: string[];
1176
1210
  }
@@ -6,7 +6,17 @@ export type WorkspaceActionState = 'queued' | 'running' | 'passed' | 'failed' |
6
6
  * typecheck, a lint, a build.
7
7
  */
8
8
  export type WorkspaceActionLane = 'light' | 'heavy';
9
+ /** An isolated candidate runtime; services and preparation are pinned in the package contract. */
10
+ export interface CandidateRuntimeRequirement {
11
+ services: string[];
12
+ requiredModules?: string[];
13
+ }
9
14
  export interface WorkspaceActionInput {
15
+ candidateRuntime?: CandidateRuntimeRequirement;
16
+ /** When supplied, refuse a different/dirty candidate rather than silently testing the latest checkout. */
17
+ candidate?: string;
18
+ /** Additional ignored fixtures/configuration to fingerprint; tracked inputs already belong to the candidate tree. */
19
+ proofFiles?: string[];
10
20
  action: WorkspaceActionKind;
11
21
  /** The Nx project — absent only for a run over `affected` projects. */
12
22
  project?: string;
@@ -163,6 +173,8 @@ export interface WorkspaceActionCounts {
163
173
  total: number;
164
174
  }
165
175
  export interface WorkspaceActionStep {
176
+ /** The actual executable and arguments; environment values remain private. */
177
+ command?: string[];
166
178
  id: string;
167
179
  /** The project it ran — a run over several projects (`affected`) has one step each. */
168
180
  project?: string;
@@ -255,6 +267,8 @@ export interface WorktreeRunOutcome {
255
267
  }>;
256
268
  }
257
269
  export interface WorkspaceActionRun {
270
+ /** Command success and reusable candidate proof are separate verdicts. */
271
+ proof?: ProofEvidence;
258
272
  runId: string;
259
273
  scope: {
260
274
  workspace: string;
@@ -294,3 +308,4 @@ export interface WorkspaceActionQueue {
294
308
  why?: string;
295
309
  waitedMs?: number;
296
310
  }
311
+ import type { ProofEvidence } from './proof.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.25.55",
3
+ "version": "1.25.57",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",