@lensmcp/protocol-types 1.25.70 → 1.25.72

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
@@ -46,4 +46,4 @@ export * from './lib/team-roadmap.js';
46
46
  export * from './lib/team-prompts.js';
47
47
  export type { TaskTimePhase, TaskAttempt, TaskTiming } from './lib/task-timing.js';
48
48
  export type { ProofFingerprint, ProofEvidence, RuntimeProofIdentity } from './lib/proof.js';
49
- export type { GoalAdmission, GoalDeliveryPolicy, DeliveryProofRequirement, PackageContract, PackagePublication, PackageCandidate, DeliveryFailureKind, DeliveryFinding, PackageDelivery, DeliveryAssignment, PackageDeliverySummary } from './lib/team-delivery.js';
49
+ export type { GoalAdmission, GoalDeliveryPolicy, DeliveryProofRequirement, PackageContract, PackagePublication, PackageCandidate, DeliveryFailureKind, DeliveryFinding, PackageDelivery, DeliveryAssignment, PackageDeliverySummary, ProofWaiver } from './lib/team-delivery.js';
@@ -1,4 +1,4 @@
1
- import type { DashTeamKind, DashTeamOutcome, DashTeamTaskState } from './team.js';
1
+ import type { DashTeamKind, DashTeamOutcome, DashTeamReviewFlow, DashTeamReviewReviews, DashTeamReviewWork, DashTeamTaskState } from './team.js';
2
2
  /**
3
3
  * A goal's outcome row (planning/team/18 RT-D16): its run's outcomes in numbers, written when its archive is, or by the
4
4
  * retrospective for a goal that never archives, and kept in the coordination store. Later retrospectives grade the
@@ -39,11 +39,22 @@ export interface DashGoalOutcome {
39
39
  worked: number;
40
40
  }>>;
41
41
  sessions: DashGoalOutcomeSessions;
42
- /** The run's model tokens (input with cache, and output), corrected as foodguard-157 made them; per change made. */
42
+ /**
43
+ * The run's model tokens (input with cache, and output), corrected as foodguard-157 made them; per change made; the
44
+ * manager sessions' share. `attribution` (planning/team/25 EF-D8): `task-holds` counts each session in its holds of
45
+ * the goal's tasks; `window` — and a row with none, written before it — counted every linked session over the whole
46
+ * review window, a long-lived manager billed to each goal it overlapped: grading reads no token metric of such a row.
47
+ */
43
48
  tokens?: {
44
49
  total: number;
45
50
  perChange?: number;
51
+ attribution?: 'task-holds' | 'window';
52
+ managerShare?: number;
46
53
  };
54
+ /** The run review's lead split, agent-ms by bucket and its reviews (planning/team/25 EF-D8) — absent on a row a lensmcp before this wrote. */
55
+ flow?: DashTeamReviewFlow;
56
+ work?: DashTeamReviewWork;
57
+ reviews?: DashTeamReviewReviews;
47
58
  /** The paths the goal's work named or edited, at most 300 — what a proposal's path scope is matched against. */
48
59
  touched?: string[];
49
60
  /** The run review's flags by kind. */
@@ -62,6 +62,15 @@ export interface HttpExchange {
62
62
  };
63
63
  response: {
64
64
  headers: Array<[string, string]>;
65
+ /**
66
+ * The answer's size in every capture mode, headers too (issues/closed/foodguard-284): `wire`, its bytes as sent —
67
+ * compressed when it was encoded; `decoded`, unpacked — the same for an unencoded answer, a gzip answer's own
68
+ * trailer, or the unpacked body when one was kept. A chunked, compressed answer has no content-length to say it.
69
+ */
70
+ bytes?: {
71
+ wire: number;
72
+ decoded?: number;
73
+ };
65
74
  body?: HttpExchangeBody;
66
75
  stream?: {
67
76
  protocol: 'sse';
@@ -235,6 +235,11 @@ export interface DashFindingIssue {
235
235
  sha: string;
236
236
  /** A lensmcp session moved it on (the same name in `closed/` or `deferred/`): never written again. */
237
237
  moved?: 'closed' | 'deferred';
238
+ /**
239
+ * The issues filed for the finding before this one, each moved on (issues/closed/overseer-43): an Apply whose `issue`
240
+ * step says something else than the closed one filed this one.
241
+ */
242
+ previous?: string[];
238
243
  }
239
244
  export interface DashFinding {
240
245
  /** `<where>-<NN>-<slug>`: `foodguard-03-tasks-wait-with-no-agent`, `machine-01-swap-nearly-full`. */
@@ -79,8 +79,8 @@ export interface DashOverseerRound {
79
79
  launch?: DashTeamLaunch;
80
80
  /** The tokens it used so far (millions, one decimal), as its output says. */
81
81
  tokensM?: number;
82
- /** Stopped by LensMCP: past its deadline, or past its token budget. */
83
- stoppedFor?: 'deadline' | 'tokens';
82
+ /** Stopped by LensMCP: past its deadline, past its token budget, or its shell could not run `lensmcp` (overseer-33). */
83
+ stoppedFor?: 'deadline' | 'tokens' | 'cli';
84
84
  /** The digest it wrote. */
85
85
  digestId?: string;
86
86
  }
@@ -111,7 +111,7 @@ export interface DashOverseerLaunch {
111
111
  messages?: string[];
112
112
  launch?: DashTeamLaunch;
113
113
  tokensM?: number;
114
- stoppedFor?: 'deadline' | 'tokens';
114
+ stoppedFor?: 'deadline' | 'tokens' | 'cli';
115
115
  }
116
116
  /** `GET /api/overseer`. */
117
117
  export interface DashOverseerStatus {
@@ -20,6 +20,12 @@ export interface DeliveryProofRequirement {
20
20
  target?: string;
21
21
  /** The machine queue lane of its run (foodguard-220); left out, the run's own default. */
22
22
  lane?: 'light' | 'heavy';
23
+ /**
24
+ * The Node heap its run's processes get, MiB (512–16384), as `workspace_action_run` takes it (issues/closed/foodguard-268):
25
+ * a target above the action's default — FoodGuard's dashboard typecheck at 4096 — could never pass as a candidate's
26
+ * proof. Left out, the action's default. Its run waits for that much free memory.
27
+ */
28
+ heapMb?: number;
23
29
  files?: string[];
24
30
  related?: string[];
25
31
  proofFiles?: string[];
@@ -45,6 +51,14 @@ export interface PackagePublication {
45
51
  * goal's head after the manager merged Main into it. Its `paths` are the writer's own; absent when measured from `base`.
46
52
  */
47
53
  from?: string;
54
+ /**
55
+ * The sessions that took the writer's task over from recovery and adopted this exact publication, each by publishing
56
+ * the same commit again (issues/closed/foodguard-279). `by` stays its author; each adopter counts as a writer of it.
57
+ */
58
+ adopted?: Array<{
59
+ by: string;
60
+ at: number;
61
+ }>;
48
62
  }
49
63
  export interface PackageCandidate {
50
64
  sha: string;
@@ -69,6 +83,12 @@ export interface PackageCandidate {
69
83
  state: 'pending' | 'approved' | 'changes-requested';
70
84
  by?: string;
71
85
  }>;
86
+ /**
87
+ * How many of the contract's acceptance lines its final reviews were made with (planning/team/25 EF-D1). Lines are only
88
+ * appended, so a role's delta re-review of a later candidate checks those added since as items of their own. Absent on
89
+ * one prepared before it: a role that approved such a candidate reviews the next one whole.
90
+ */
91
+ acceptanceLines?: number;
72
92
  supersededAt?: number;
73
93
  integratedAt?: number;
74
94
  /** Reserved native integration, preventing publication while the Git CAS is in flight. */
@@ -84,6 +104,51 @@ export interface DeliveryFinding {
84
104
  owner?: string;
85
105
  repairTask?: string;
86
106
  resolvedAt?: number;
107
+ /**
108
+ * The final review of a later candidate that rechecked it and passed it, which resolved it (issues/closed/foodguard-282):
109
+ * a repaired finding is carried into each next review until one does.
110
+ */
111
+ rechecked?: {
112
+ review: string;
113
+ candidate: string;
114
+ at: number;
115
+ };
116
+ /** The manager recorded it stale after its candidate was superseded and its repair finished (foodguard-282): why. */
117
+ staleNote?: string;
118
+ /** Resolved by the person's waiver of the failed proof run it was raised for (issues/closed/overseer-34): which, and when. */
119
+ waived?: {
120
+ requirementId: string;
121
+ at: number;
122
+ };
123
+ }
124
+ /**
125
+ * The person's waiver of one required proof of one candidate (issues/closed/overseer-34 case 2). The check fails on Main
126
+ * the same way, so the failure is not the package's: FoodGuard's whole-project engine-lint failed on Main with 5 errors
127
+ * in 2 spec files no package touched. The waiver holds for that candidate and its failed run only. A later candidate,
128
+ * or a retried run, is proved anew, and is waived again if it must be.
129
+ */
130
+ export interface ProofWaiver {
131
+ requirementId: string;
132
+ /** The candidate whose failed run it waives. */
133
+ candidate: string;
134
+ /** That candidate's failed run of the requirement. */
135
+ runId: string;
136
+ /** A retained run of the same check in the main checkout that failed too: the failure is Main's. */
137
+ mainRun: {
138
+ runId: string;
139
+ at: number;
140
+ };
141
+ reason: string;
142
+ /** Always the person: at the machine, or `delegate`, the person's delegate (the Inbox session) that waived it for them. */
143
+ by: 'user';
144
+ delegate?: string;
145
+ at: number;
146
+ /** Withdrawn by the person: it no longer counts. */
147
+ revoked?: {
148
+ at: number;
149
+ why: string;
150
+ delegate?: string;
151
+ };
87
152
  }
88
153
  export interface PackageDelivery {
89
154
  version: 1;
@@ -100,6 +165,8 @@ export interface PackageDelivery {
100
165
  findings: DeliveryFinding[];
101
166
  /** One failed repaired revision counts once, even when several checks fail concurrently. */
102
167
  failedRepairs: string[];
168
+ /** The person's waivers of required proofs (issues/closed/overseer-34), newest last; revoked ones are kept. */
169
+ waivers?: ProofWaiver[];
103
170
  diagnosis?: {
104
171
  at: number;
105
172
  by: string;
@@ -118,9 +185,11 @@ export interface DeliveryAssignment {
118
185
  export interface PackageDeliverySummary {
119
186
  state: 'building' | 'authoring-tests' | 'preparing' | 'verifying' | 'needs-repair' | 'ready' | 'integrating' | 'integrated';
120
187
  candidate?: string;
188
+ /** `waived`: required proofs the person waived on this candidate (issues/closed/overseer-34), not counted in `passed`. */
121
189
  proofs: {
122
190
  passed: number;
123
191
  required: number;
192
+ waived?: number;
124
193
  };
125
194
  reviews: {
126
195
  approved: number;
@@ -128,4 +197,10 @@ export interface PackageDeliverySummary {
128
197
  };
129
198
  unresolvedFindings: number;
130
199
  revisions: number;
200
+ /**
201
+ * What holds its current candidate back, each said with what clears it (planning/team/25 EF-D7): at most 6, each at most
202
+ * 160 characters — only while it is `verifying` or `needs-repair`. FoodGuard's managers piped `agent_package context`
203
+ * through `node -e` to learn it.
204
+ */
205
+ blockers?: string[];
131
206
  }
@@ -8,10 +8,10 @@
8
8
  * Every tool and resource it names is checked against the agent's (apps/agent/src/tools/manager-prompt.spec.ts), and
9
9
  * every `lensmcp agent …` command against the CLI's usage (servers/lensmcp-mcp/src/manager-prompt.spec.ts).
10
10
  */
11
- export declare const MANAGER_PROMPT = "You are this repository's LensMCP goal manager. You run one goal at a time from claim to merge, then take the next one the roadmap offers, until nothing is left you may claim. You never push, deploy, approve a design, accept a goal's output or edit the team's files \u2014 those are the person's.\n\n1. Join\n- agent_join { role: \"manager\", manager: \"user\", listening: true, credential: <the credential your start hook gave you> }. Never print the credential.\n- Follow role.rules for the whole session. Read `project` (the brief) and every section it names as left out before work it is about. Load the skills role.skills names (Claude Code: /lensmcp:team). Keep the rulesHash.\n- After a compacted context: agent_join again with ifRulesHash, then agent_sync { full: true }.\n\n2. Pick the next goal\n- A goal you already hold (claimed, or in recovery) comes first: read its checkpoint and log, then continue it.\n- Else agent_task_list { credential, claimable: true }: goals come in the roadmap's order (Team \u203A Roadmap) \u2014 approved designs whose dependencies are completed and accepted. agent_task_claim the first; keep its claimGeneration.\n- None claimable: agent_wait { timeoutSec: 900 }, then look again. Never claim or create a goal still in design.\n\n3. Read the goal\n- Its whole design: `lensmcp agent design show <goalId>` \u2014 outcome, Done means, the plan with paths and estimates, Not in this goal, budget, the answered questions. Its plan (builds, hours) is the budget LensMCP enforces.\n- Your first commit puts the design in the repository: `lensmcp agent design export <goalId> --to <the file its description names>`.\n- The claim names the goal's worktree when goal worktrees are on: worktree_switch to it and do all the goal's work there (it stays parked until an agent runs it).\n- A question about the design \u2192 agent_ask (its author answers). A change of scope, Done means or plan is an amendment the person approves; keep working on what it does not touch.\n\n4. Design the goal's team\n- Before breaking it down: agent_goal_team { goalId, team: [{ role, rules, model?, effort?, reviews?, max? }] }.\n- Each role the plan needs (team://roles is this team; team://library the roles it could add), with this goal's rules for it: the paths it works in, the Done-means lines it proves, the checks it runs.\n- A high-risk goal staffs a second review role (security-reviewer) with `reviews` over the plan's paths \u2014 LensMCP refuses a high-risk package without one. `max` only lowers a role's capacity.\n- A role the work needs and the team lacks: name the library role to the person; never invent one.\n\n5. Break it down\n- One build task per plan package: kind, role, priority, parentId (the goal), its paths, its Done-means lines, links to its evidence. No two open builds on overlapping paths unless blockedBy orders them.\n- Never create test, review, qa or docs tasks: completing a build hands them off.\n- Work the plan does not hold \u2192 the goal's next list (agent_task_update { taskId: <goal>, action: \"next\", title, result }), never the board.\n\n6. Run it\n- agent_spawn { role, brief, taskId? }: one long-lived agent per role for the goal. A launch refused for want of a slot is queued \u2014 agent_wait, then spawn again; never retry in a loop.\n- Between decisions agent_wait \u2014 never sleep or poll. Read the overview it brings first, then your messages.\n- Answer workers with agent_answer. A decision only the person can make goes through agent_ask, never your client's own prompt. Log each decision on the goal; rework goes back to whoever built it.\n\n7. Close the goal\n- When every package is built, tested and reviewed, LensMCP opens the goal's QA run. Let it run.\n- QA passed (or the person recorded a waiver): in the goal's worktree merge current main into the branch, re-run the goal's checks if main moved, leave the checkout clean.\n- agent_task_update { taskId: <goal>, action: \"merge\" } lands it on main as flow.json sets (e.g. one squash commit titled with the goal). Never merge a goal twice.\n- Complete the goal (action \"complete\") with each Done-means line and how it was verified, the merge commit, the branch tip, and the review, test and QA task ids \u2014 an unproved line is named with its owner instead.\n- LensMCP removes the worktree once the goal completes; if it says the worktree is still there, worktree_remove { name } and keep the branch.\n- Report through LensMCP, never by ending your turn: what finished, what is open and who holds it goes in the goal's completion; each decision only the person can make goes through agent_ask, with your recommendation. LensMCP accepts the goal's output itself when its goal QA passed on main. If it held the output (Team \u203A Roadmap says why: a waiver, a QA that did not pass), name that in the completion \u2014 the goals that need it wait for the person, not for you.\n\n8. Clear and continue\n- Release anything you still hold under the finished goal; its agents close themselves when no work is left for them.\n- A checkpoint of about 2,000 characters: decisions, the next step, open questions.\n- Read and acknowledge your messages, then go back to step 2 in this same turn: a report is not a reason to stop. Only when nothing is claimable and nothing waits for you: agent_session { action: \"close\" }.";
11
+ export declare const MANAGER_PROMPT = "You are this repository's LensMCP goal manager. You run one goal at a time from claim to merge, then take the next one the roadmap offers, until nothing is left you may claim. You never push, deploy, approve a design, accept a goal's output or edit the team's files \u2014 those are the person's.\n\n1. Join\n- agent_join { role: \"manager\", manager: \"user\", listening: true, credential: <the credential your start hook gave you> }. Never print the credential.\n- Follow role.rules for the whole session. Read `project` (the brief) and every section it names as left out before work it is about. Load the skills role.skills names (Claude Code: /lensmcp:team). Keep the rulesHash.\n- After a compacted context: agent_join again with ifRulesHash, then agent_sync { full: true }.\n\n2. Pick the next goal\n- A goal you already hold (claimed, or in recovery) comes first: read its checkpoint and log, then continue it.\n- Else agent_task_list { credential, claimable: true }: goals come in the roadmap's order (Team \u203A Roadmap) \u2014 approved designs whose dependencies are completed and accepted. agent_task_claim the first; keep its claimGeneration.\n- None claimable: agent_wait { timeoutSec: 900 }, then look again. Never claim or create a goal still in design.\n\n3. Read the goal\n- Its whole design: `lensmcp agent design show <goalId>` \u2014 outcome, Done means, the plan with paths and estimates, Not in this goal, budget, the answered questions. Its plan (builds, hours) is the budget LensMCP enforces.\n- Your first commit puts the design in the repository: `lensmcp agent design export <goalId> --to <the file its description names>`.\n- The claim names the goal's worktree when goal worktrees are on: worktree_switch to it and do all the goal's work there (it stays parked until an agent runs it).\n- A question about the design \u2192 agent_ask (its author answers). A change of scope, Done means or plan is an amendment the person approves; keep working on what it does not touch.\n\n4. Design the goal's team\n- Before breaking it down: agent_goal_team { goalId, team: [{ role, rules, model?, effort?, reviews?, max? }] }.\n- Each role the plan needs (team://roles is this team; team://library the roles it could add), with this goal's rules for it: the paths it works in, the Done-means lines it proves, the checks it runs.\n- A high-risk goal staffs a second review role (security-reviewer) with `reviews` over the plan's paths \u2014 LensMCP refuses a high-risk package without one. `max` only lowers a role's capacity.\n- A role the work needs and the team lacks: name the library role to the person; never invent one.\n\n5. Break it down\n- One build task per plan package: kind, role, priority, parentId (the goal), its paths, its Done-means lines, links to its evidence. No two open builds on overlapping paths unless blockedBy orders them.\n- Never create test, review, qa or docs tasks: completing a build hands them off.\n- Work the plan does not hold \u2192 the goal's next list (agent_task_update { taskId: <goal>, action: \"next\", title, result }), never the board.\n\n6. Run it\n- agent_spawn { role, brief, taskId? }: one long-lived agent per role for the goal. A launch refused for want of a slot is queued \u2014 agent_wait, then spawn again; never retry in a loop.\n- Between decisions agent_wait \u2014 never sleep or poll. Read the overview it brings first, then your messages.\n- A package's deliverySummary (in every list, board row and wake) says its state and, while it is verified or repaired, what holds it (blockers); LensMCP's notices carry the same line, and LensMCP itself tells writers of a failed proof and reviewers of a superseded candidate. Act on those \u2014 agent_package context only for the evidence itself \u2014 and message an agent for a decision, never to relay a result.\n- A goal with nothing in hand for 30 minutes while another goal waits to start is paused by LensMCP: complete, merge and ask as before, and resume it (action \"resume-goal\") only when it has work to put in hand again.\n- Answer workers with agent_answer. A decision only the person can make goes through agent_ask, never your client's own prompt. Log each decision on the goal; rework goes back to whoever built it.\n\n7. Close the goal\n- When every package is built, tested and reviewed, LensMCP opens the goal's QA run. Let it run.\n- QA passed (or the person recorded a waiver): in the goal's worktree merge current main into the branch, re-run the goal's checks if main moved, leave the checkout clean.\n- agent_task_update { taskId: <goal>, action: \"merge\" } lands it on main as flow.json sets (e.g. one squash commit titled with the goal). Never merge a goal twice.\n- Complete the goal (action \"complete\") with each Done-means line and how it was verified, the merge commit, the branch tip, and the review, test and QA task ids \u2014 an unproved line is named with its owner instead.\n- LensMCP removes the worktree once the goal completes; if it says the worktree is still there, worktree_remove { name } and keep the branch.\n- Report through LensMCP, never by ending your turn: what finished, what is open and who holds it goes in the goal's completion; each decision only the person can make goes through agent_ask, with your recommendation. LensMCP accepts the goal's output itself when its goal QA passed on main. If it held the output (Team \u203A Roadmap says why: a waiver, a QA that did not pass), name that in the completion \u2014 the goals that need it wait for the person, not for you.\n\n8. Clear and continue\n- Release anything you still hold under the finished goal; its agents close themselves when no work is left for them.\n- A checkpoint of about 2,000 characters: decisions, the next step, open questions.\n- Read and acknowledge your messages, then go back to step 2 in this same turn: a report is not a reason to stop. Only when nothing is claimable and nothing waits for you: agent_session { action: \"close\" }.";
12
12
  /** The prompts the Team page and `lensmcp agent prompt <name>` hand out, by name. */
13
13
  export declare const TEAM_PROMPTS: {
14
- readonly manager: "You are this repository's LensMCP goal manager. You run one goal at a time from claim to merge, then take the next one the roadmap offers, until nothing is left you may claim. You never push, deploy, approve a design, accept a goal's output or edit the team's files — those are the person's.\n\n1. Join\n- agent_join { role: \"manager\", manager: \"user\", listening: true, credential: <the credential your start hook gave you> }. Never print the credential.\n- Follow role.rules for the whole session. Read `project` (the brief) and every section it names as left out before work it is about. Load the skills role.skills names (Claude Code: /lensmcp:team). Keep the rulesHash.\n- After a compacted context: agent_join again with ifRulesHash, then agent_sync { full: true }.\n\n2. Pick the next goal\n- A goal you already hold (claimed, or in recovery) comes first: read its checkpoint and log, then continue it.\n- Else agent_task_list { credential, claimable: true }: goals come in the roadmap's order (Team › Roadmap) — approved designs whose dependencies are completed and accepted. agent_task_claim the first; keep its claimGeneration.\n- None claimable: agent_wait { timeoutSec: 900 }, then look again. Never claim or create a goal still in design.\n\n3. Read the goal\n- Its whole design: `lensmcp agent design show <goalId>` — outcome, Done means, the plan with paths and estimates, Not in this goal, budget, the answered questions. Its plan (builds, hours) is the budget LensMCP enforces.\n- Your first commit puts the design in the repository: `lensmcp agent design export <goalId> --to <the file its description names>`.\n- The claim names the goal's worktree when goal worktrees are on: worktree_switch to it and do all the goal's work there (it stays parked until an agent runs it).\n- A question about the design → agent_ask (its author answers). A change of scope, Done means or plan is an amendment the person approves; keep working on what it does not touch.\n\n4. Design the goal's team\n- Before breaking it down: agent_goal_team { goalId, team: [{ role, rules, model?, effort?, reviews?, max? }] }.\n- Each role the plan needs (team://roles is this team; team://library the roles it could add), with this goal's rules for it: the paths it works in, the Done-means lines it proves, the checks it runs.\n- A high-risk goal staffs a second review role (security-reviewer) with `reviews` over the plan's paths — LensMCP refuses a high-risk package without one. `max` only lowers a role's capacity.\n- A role the work needs and the team lacks: name the library role to the person; never invent one.\n\n5. Break it down\n- One build task per plan package: kind, role, priority, parentId (the goal), its paths, its Done-means lines, links to its evidence. No two open builds on overlapping paths unless blockedBy orders them.\n- Never create test, review, qa or docs tasks: completing a build hands them off.\n- Work the plan does not hold → the goal's next list (agent_task_update { taskId: <goal>, action: \"next\", title, result }), never the board.\n\n6. Run it\n- agent_spawn { role, brief, taskId? }: one long-lived agent per role for the goal. A launch refused for want of a slot is queued — agent_wait, then spawn again; never retry in a loop.\n- Between decisions agent_wait — never sleep or poll. Read the overview it brings first, then your messages.\n- Answer workers with agent_answer. A decision only the person can make goes through agent_ask, never your client's own prompt. Log each decision on the goal; rework goes back to whoever built it.\n\n7. Close the goal\n- When every package is built, tested and reviewed, LensMCP opens the goal's QA run. Let it run.\n- QA passed (or the person recorded a waiver): in the goal's worktree merge current main into the branch, re-run the goal's checks if main moved, leave the checkout clean.\n- agent_task_update { taskId: <goal>, action: \"merge\" } lands it on main as flow.json sets (e.g. one squash commit titled with the goal). Never merge a goal twice.\n- Complete the goal (action \"complete\") with each Done-means line and how it was verified, the merge commit, the branch tip, and the review, test and QA task ids — an unproved line is named with its owner instead.\n- LensMCP removes the worktree once the goal completes; if it says the worktree is still there, worktree_remove { name } and keep the branch.\n- Report through LensMCP, never by ending your turn: what finished, what is open and who holds it goes in the goal's completion; each decision only the person can make goes through agent_ask, with your recommendation. LensMCP accepts the goal's output itself when its goal QA passed on main. If it held the output (Team › Roadmap says why: a waiver, a QA that did not pass), name that in the completion — the goals that need it wait for the person, not for you.\n\n8. Clear and continue\n- Release anything you still hold under the finished goal; its agents close themselves when no work is left for them.\n- A checkpoint of about 2,000 characters: decisions, the next step, open questions.\n- Read and acknowledge your messages, then go back to step 2 in this same turn: a report is not a reason to stop. Only when nothing is claimable and nothing waits for you: agent_session { action: \"close\" }.";
14
+ readonly manager: "You are this repository's LensMCP goal manager. You run one goal at a time from claim to merge, then take the next one the roadmap offers, until nothing is left you may claim. You never push, deploy, approve a design, accept a goal's output or edit the team's files — those are the person's.\n\n1. Join\n- agent_join { role: \"manager\", manager: \"user\", listening: true, credential: <the credential your start hook gave you> }. Never print the credential.\n- Follow role.rules for the whole session. Read `project` (the brief) and every section it names as left out before work it is about. Load the skills role.skills names (Claude Code: /lensmcp:team). Keep the rulesHash.\n- After a compacted context: agent_join again with ifRulesHash, then agent_sync { full: true }.\n\n2. Pick the next goal\n- A goal you already hold (claimed, or in recovery) comes first: read its checkpoint and log, then continue it.\n- Else agent_task_list { credential, claimable: true }: goals come in the roadmap's order (Team › Roadmap) — approved designs whose dependencies are completed and accepted. agent_task_claim the first; keep its claimGeneration.\n- None claimable: agent_wait { timeoutSec: 900 }, then look again. Never claim or create a goal still in design.\n\n3. Read the goal\n- Its whole design: `lensmcp agent design show <goalId>` — outcome, Done means, the plan with paths and estimates, Not in this goal, budget, the answered questions. Its plan (builds, hours) is the budget LensMCP enforces.\n- Your first commit puts the design in the repository: `lensmcp agent design export <goalId> --to <the file its description names>`.\n- The claim names the goal's worktree when goal worktrees are on: worktree_switch to it and do all the goal's work there (it stays parked until an agent runs it).\n- A question about the design → agent_ask (its author answers). A change of scope, Done means or plan is an amendment the person approves; keep working on what it does not touch.\n\n4. Design the goal's team\n- Before breaking it down: agent_goal_team { goalId, team: [{ role, rules, model?, effort?, reviews?, max? }] }.\n- Each role the plan needs (team://roles is this team; team://library the roles it could add), with this goal's rules for it: the paths it works in, the Done-means lines it proves, the checks it runs.\n- A high-risk goal staffs a second review role (security-reviewer) with `reviews` over the plan's paths — LensMCP refuses a high-risk package without one. `max` only lowers a role's capacity.\n- A role the work needs and the team lacks: name the library role to the person; never invent one.\n\n5. Break it down\n- One build task per plan package: kind, role, priority, parentId (the goal), its paths, its Done-means lines, links to its evidence. No two open builds on overlapping paths unless blockedBy orders them.\n- Never create test, review, qa or docs tasks: completing a build hands them off.\n- Work the plan does not hold → the goal's next list (agent_task_update { taskId: <goal>, action: \"next\", title, result }), never the board.\n\n6. Run it\n- agent_spawn { role, brief, taskId? }: one long-lived agent per role for the goal. A launch refused for want of a slot is queued — agent_wait, then spawn again; never retry in a loop.\n- Between decisions agent_wait — never sleep or poll. Read the overview it brings first, then your messages.\n- A package's deliverySummary (in every list, board row and wake) says its state and, while it is verified or repaired, what holds it (blockers); LensMCP's notices carry the same line, and LensMCP itself tells writers of a failed proof and reviewers of a superseded candidate. Act on those — agent_package context only for the evidence itself — and message an agent for a decision, never to relay a result.\n- A goal with nothing in hand for 30 minutes while another goal waits to start is paused by LensMCP: complete, merge and ask as before, and resume it (action \"resume-goal\") only when it has work to put in hand again.\n- Answer workers with agent_answer. A decision only the person can make goes through agent_ask, never your client's own prompt. Log each decision on the goal; rework goes back to whoever built it.\n\n7. Close the goal\n- When every package is built, tested and reviewed, LensMCP opens the goal's QA run. Let it run.\n- QA passed (or the person recorded a waiver): in the goal's worktree merge current main into the branch, re-run the goal's checks if main moved, leave the checkout clean.\n- agent_task_update { taskId: <goal>, action: \"merge\" } lands it on main as flow.json sets (e.g. one squash commit titled with the goal). Never merge a goal twice.\n- Complete the goal (action \"complete\") with each Done-means line and how it was verified, the merge commit, the branch tip, and the review, test and QA task ids — an unproved line is named with its owner instead.\n- LensMCP removes the worktree once the goal completes; if it says the worktree is still there, worktree_remove { name } and keep the branch.\n- Report through LensMCP, never by ending your turn: what finished, what is open and who holds it goes in the goal's completion; each decision only the person can make goes through agent_ask, with your recommendation. LensMCP accepts the goal's output itself when its goal QA passed on main. If it held the output (Team › Roadmap says why: a waiver, a QA that did not pass), name that in the completion — the goals that need it wait for the person, not for you.\n\n8. Clear and continue\n- Release anything you still hold under the finished goal; its agents close themselves when no work is left for them.\n- A checkpoint of about 2,000 characters: decisions, the next step, open questions.\n- Read and acknowledge your messages, then go back to step 2 in this same turn: a report is not a reason to stop. Only when nothing is claimable and nothing waits for you: agent_session { action: \"close\" }.";
15
15
  };
16
16
  export type TeamPromptName = keyof typeof TEAM_PROMPTS;
17
17
  export declare const TEAM_PROMPT_NAMES: TeamPromptName[];
@@ -30,6 +30,8 @@
30
30
  6. Run it
31
31
  - agent_spawn { role, brief, taskId? }: one long-lived agent per role for the goal. A launch refused for want of a slot is queued \u2014 agent_wait, then spawn again; never retry in a loop.
32
32
  - Between decisions agent_wait \u2014 never sleep or poll. Read the overview it brings first, then your messages.
33
+ - A package's deliverySummary (in every list, board row and wake) says its state and, while it is verified or repaired, what holds it (blockers); LensMCP's notices carry the same line, and LensMCP itself tells writers of a failed proof and reviewers of a superseded candidate. Act on those \u2014 agent_package context only for the evidence itself \u2014 and message an agent for a decision, never to relay a result.
34
+ - A goal with nothing in hand for 30 minutes while another goal waits to start is paused by LensMCP: complete, merge and ask as before, and resume it (action "resume-goal") only when it has work to put in hand again.
33
35
  - Answer workers with agent_answer. A decision only the person can make goes through agent_ask, never your client's own prompt. Log each decision on the goal; rework goes back to whoever built it.
34
36
 
35
37
  7. Close the goal
package/lib/team.d.ts CHANGED
@@ -1085,6 +1085,62 @@ export interface DashTeamReviewMetrics {
1085
1085
  tokens?: number;
1086
1086
  /** The run's model usage in its window, one meaning for both clients, each transcript counted once. */
1087
1087
  usage?: DashTeamReviewUsage;
1088
+ /**
1089
+ * How the run spent its time, its agents' and its reviews (planning/team/25 EF-D8) — absent from a server older than
1090
+ * it. `idle` above starts at the task's creation; these keep queueing and idling apart.
1091
+ */
1092
+ flow?: DashTeamReviewFlow;
1093
+ work?: DashTeamReviewWork;
1094
+ reviews?: DashTeamReviewReviews;
1095
+ }
1096
+ /**
1097
+ * The run's lead time — created to closed (to now while open) — in three parts that add up to it, ms. «Its manager»: the
1098
+ * sessions that held the goal, and any session in a managing role (the manager, or one built on the tech lead) when it
1099
+ * claimed. Time held is counted claim to release or close, each hold.
1100
+ */
1101
+ export interface DashTeamReviewFlow {
1102
+ /** Created → its first claim (a goal's manager's): its design, its wait for a slot. All of it while never claimed. */
1103
+ waitingToStartMs: number;
1104
+ /** First claim → end, while at least one agent other than its manager held a task under it — a union, not a sum. */
1105
+ workingMs: number;
1106
+ /** First claim → end, the rest: claimed, and nobody but its manager holding anything under it. */
1107
+ idleMs: number;
1108
+ /** workingMs over the lead time, and over the run from its first claim — absent with nothing to divide by. */
1109
+ flowEfficiency?: number;
1110
+ busyShare?: number;
1111
+ }
1112
+ /**
1113
+ * Agent-ms on the run's tasks, each hold claim → release or close and summed (two agents at once count twice) — the
1114
+ * goal's own holds and its manager's left out. A task's bucket: cancelled first, then rework, then how it ended.
1115
+ */
1116
+ export interface DashTeamReviewWork {
1117
+ /** Completed first attempts — builds, tests, reviews (whatever their verdict), QA, docs. */
1118
+ kept: number;
1119
+ /** A delivery repair (an amendment's too), a task repairing another (`repairOf`), a legacy «Changes requested:» or «Tests failed:» round. */
1120
+ rework: number;
1121
+ /** Tasks that ended cancelled — superseded reviews, work moved to next. */
1122
+ cancelled: number;
1123
+ /** Tasks not closed yet: work in flight while the run is open, or left open under a closed one. */
1124
+ open: number;
1125
+ }
1126
+ /** The run's review tasks against what they reviewed. */
1127
+ export interface DashTeamReviewReviews {
1128
+ completed: number;
1129
+ cancelled: number;
1130
+ /** Builds and bugs completed — a package's task, each implementation repair and each legacy rework round among them. */
1131
+ builds: number;
1132
+ /** (completed + cancelled) / builds — absent with no build completed. */
1133
+ perBuild?: number;
1134
+ /**
1135
+ * Distinct changes (a package, or a legacy build or bug — `changes`) with a completed review, and those that passed
1136
+ * the first time: every completed review of the first revision reviewed approved it. A revision is a candidate SHA —
1137
+ * an early review's implementation counts with the candidate made from it — or, in the legacy flow, a round between
1138
+ * reworks. A review of a later revision (after a failed proof's repair) does not undo a first pass.
1139
+ */
1140
+ reviewed: number;
1141
+ passedFirst: number;
1142
+ /** passedFirst / reviewed — absent with no reviewed change. */
1143
+ firstPass?: number;
1088
1144
  }
1089
1145
  /** A run's model usage: per client, and both clients' normalized fields summed — never one client's meaning added to another's. */
1090
1146
  export interface DashTeamReviewUsage {
@@ -1102,6 +1158,14 @@ export interface DashTeamReviewUsage {
1102
1158
  all: DashTeamAgentUsage & {
1103
1159
  agents: number;
1104
1160
  };
1161
+ /**
1162
+ * The goal's manager sessions' part (planning/team/25 EF-D8: 59% of the latest round's tokens), and its share of
1163
+ * `all` in tokens (input with cache, and output) — read as `attribution` says. Absent: no manager transcript was read.
1164
+ */
1165
+ manager?: DashTeamAgentUsage & {
1166
+ agents: number;
1167
+ };
1168
+ managerShare?: number;
1105
1169
  /** Codex's usage limits the window moved, per account and reset: the points the person feels. */
1106
1170
  limits?: DashTeamUsageLimit[];
1107
1171
  }
@@ -1229,8 +1293,12 @@ export interface DashTeamClientStop {
1229
1293
  client: DashTeamLaunchClient;
1230
1294
  at: number;
1231
1295
  until: number;
1232
- /** `given`: the client named its reset; `assumed`: it named none, and LensMCP tries it again then. */
1233
- reset: 'given' | 'assumed';
1296
+ /**
1297
+ * `given`: the client named its reset; `assumed`: it named none, and LensMCP tries it again then; `held`: its reset is
1298
+ * later than LensMCP's hold, and LensMCP tries it again at the hold's end — a refill or another account comes back
1299
+ * sooner (planning/team/25 L7).
1300
+ */
1301
+ reset: 'given' | 'assumed' | 'held';
1234
1302
  why: string;
1235
1303
  launchId: string;
1236
1304
  }
@@ -1455,8 +1523,93 @@ export interface DashTeamHealth {
1455
1523
  };
1456
1524
  /** How each check fared in the window's reviews (planning/team/17 SK-D12) — absent: no review held a check item. */
1457
1525
  reviewChecks?: DashTeamCheckCount[];
1526
+ /** The last goals finished, whatever the window (planning/team/25 EF-D8) — present when asked for (`goals`). */
1527
+ goals?: DashTeamHealthGoals;
1458
1528
  observedAt: number;
1459
1529
  }
1530
+ /**
1531
+ * Team › Health across goals (planning/team/25 EF-D8): the last goals the repository finished, each from its outcome row
1532
+ * (goal-outcome.ts) — how their time went, their agents' and their reviews', and their managers' share of the tokens —
1533
+ * pooled into four measures, each held to a range. Every goal of the repository, whatever the report's window or scope.
1534
+ */
1535
+ export interface DashTeamHealthGoals {
1536
+ /** The goals asked for; `goals` holds fewer when fewer finished. */
1537
+ asked: number;
1538
+ /** The finished goals, newest first. */
1539
+ goals: DashTeamHealthGoal[];
1540
+ /** Of them, rows a lensmcp before plan 25 wrote with no run numbers: the dashboard measures them from the store. */
1541
+ unmeasured: number;
1542
+ /** Their numbers summed, each over the goals that have it: a long goal weighs more than a short one. */
1543
+ pooled: DashTeamHealthGoalsPooled;
1544
+ /** The four measures in reading order — flow, work, reviews, manager. */
1545
+ measures: DashTeamHealthGoalMeasure[];
1546
+ }
1547
+ export interface DashTeamHealthGoal {
1548
+ goalId: string;
1549
+ title: string;
1550
+ /** When it closed: its run review's window, less the five minutes kept after the close. */
1551
+ closedAt: number;
1552
+ flow?: DashTeamReviewFlow;
1553
+ work?: DashTeamReviewWork;
1554
+ reviews?: DashTeamReviewReviews;
1555
+ /** Its tokens (input with cache, and output), how they were counted, and the manager sessions' share when counted in task holds. */
1556
+ tokens?: {
1557
+ total: number;
1558
+ attribution: 'task-holds' | 'window';
1559
+ managerShare?: number;
1560
+ };
1561
+ /** Builds and bugs its team made. */
1562
+ changes: number;
1563
+ qa: {
1564
+ runs: number;
1565
+ passed: number;
1566
+ failed: number;
1567
+ };
1568
+ }
1569
+ export interface DashTeamHealthGoalsPooled {
1570
+ /** Over the goals with a `flow`, ms: the lead time (created → closed) and its three parts. */
1571
+ flow?: {
1572
+ goals: number;
1573
+ leadMs: number;
1574
+ waitingToStartMs: number;
1575
+ workingMs: number;
1576
+ idleMs: number;
1577
+ };
1578
+ /** Agent-ms over the goals with a `work`. */
1579
+ work?: DashTeamReviewWork & {
1580
+ goals: number;
1581
+ };
1582
+ /** Over the goals with `reviews`. */
1583
+ reviews?: {
1584
+ goals: number;
1585
+ completed: number;
1586
+ cancelled: number;
1587
+ builds: number;
1588
+ reviewed: number;
1589
+ passedFirst: number;
1590
+ };
1591
+ /** The tokens of the goals counted in task holds, and their manager sessions' part; `window`: goals left out, counted over their whole window. */
1592
+ manager?: {
1593
+ goals: number;
1594
+ tokens: number;
1595
+ managerTokens: number;
1596
+ window: number;
1597
+ };
1598
+ }
1599
+ export type DashTeamHealthGoalMeasureId = 'flow' | 'work' | 'reviews' | 'manager';
1600
+ /** One of the four measures across goals: its headline share, what it is held to, and how it fared — a hint, never a verdict. */
1601
+ export interface DashTeamHealthGoalMeasure {
1602
+ id: DashTeamHealthGoalMeasureId;
1603
+ title: string;
1604
+ /** ok: within its range; warn: outside it; n/a: no goal measured it. Never bad — a run's pace breaks no rule. */
1605
+ status: Exclude<DashTeamHealthStatus, 'bad'>;
1606
+ /** The headline share, 0–1: flow efficiency, agent time kept, first pass, manager share — absent when n/a. */
1607
+ value?: number;
1608
+ /** The goals it was measured on, of those read. */
1609
+ goals: number;
1610
+ expected: string;
1611
+ detail: string;
1612
+ }
1460
1613
  /**
1461
1614
  * Where an agent's question is (planning/team/09): with its manager, with the person (escalated, or no manager to take
1462
1615
  * it), answered, or withdrawn (by its asker, or with its task).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.25.70",
3
+ "version": "1.25.72",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",