@lensmcp/protocol-types 1.25.32 → 1.25.34

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.
@@ -0,0 +1,228 @@
1
+ import type { DashTeamKind } from './team.js';
2
+ /**
3
+ * Team design (planning/team/01-team-design.md): LensMCP reads a project — a dossier it builds itself, then Claude's
4
+ * own research with the code tools — and proposes the team that should work on it: the project as understood, its
5
+ * goals with evidence, whether it splits at all, the roles cut along its seams with their rules, the defaults it does
6
+ * not need, the flow, and the first goals. The person accepts on the Team page; only then are `.lensmcp/team/` files
7
+ * written. These are the shapes the run, the dashboard and MCP share; the model's answer is checked into them.
8
+ */
9
+ export declare const TEAM_DESIGN_VERSION = 1;
10
+ /** A part of the project that can move on its own — or cannot: `coupling` says how much it depends on the others. */
11
+ export interface TeamDesignDomain {
12
+ /** Stable, kebab-case. */
13
+ id: string;
14
+ name: string;
15
+ /** What it is and does, in a sentence or two. */
16
+ what: string;
17
+ /** Repository paths it lives in. */
18
+ paths: string[];
19
+ /** Ids of the domains it depends on. */
20
+ dependsOn: string[];
21
+ coupling: 'low' | 'medium' | 'high';
22
+ }
23
+ /** A check the project already has — a command a role runs before it says done. */
24
+ export interface TeamDesignGate {
25
+ command: string;
26
+ what: string;
27
+ /** When it applies: "every change", "a change under apps/web", "before a release"… */
28
+ when: string;
29
+ /** LensMCP found the script or target it names (package.json scripts, a project's targets, CI). */
30
+ checked?: boolean;
31
+ }
32
+ /** What the project is working towards, from what it shows: docs, plans, recent commits, open issues, the lens. */
33
+ export interface TeamDesignGoal {
34
+ id: string;
35
+ title: string;
36
+ why: string;
37
+ /** `file:<path>[:line]`, `commit:<sha or subject>`, `lens:<what>` — where it was read. */
38
+ evidence: string[];
39
+ horizon: 'now' | 'next' | 'later';
40
+ }
41
+ /** One proposed role — a brief an agent can work from — in the shape of a `.lensmcp/team/roles/<id>.md` file. */
42
+ export interface TeamDesignRole {
43
+ id: string;
44
+ title: string;
45
+ summary: string;
46
+ /** Why this project needs it. */
47
+ why: string;
48
+ /** The default role it refines (builder, reviewer, …), when it does. */
49
+ basedOn?: string;
50
+ /** Paths it owns — where it works and others do not. */
51
+ owns: string[];
52
+ takes: DashTeamKind[];
53
+ creates: DashTeamKind[] | 'any';
54
+ wip: number;
55
+ worktree: 'own' | 'shared' | 'any';
56
+ /** How many agents to run in it, and whether to start them now or once the work is there. */
57
+ agents: number;
58
+ start: 'now' | 'later';
59
+ /** Its rules, as tagged sections (`<rules id note>…</rules>`). */
60
+ rules: string;
61
+ /** The LensMCP tools and resources it should reach for first. */
62
+ uses: string[];
63
+ /** Against the repository's current team: a new role, one that changes a role it has, or one it already has as is. */
64
+ status?: 'new' | 'changes' | 'same';
65
+ }
66
+ /** A default role this project does not need — accepted, it is written with `off: true`. */
67
+ export interface TeamDesignOff {
68
+ id: string;
69
+ why: string;
70
+ }
71
+ /**
72
+ * A hand-off, in the shape of `.lensmcp/team/flow.json`'s entries (libs/storage coordination/flow.ts). The work a chain
73
+ * is about is its nearest build or bug: `after` holds the hand-off for one of them, `paths` for work on those paths
74
+ * (prefixes or globs); `to: owner` sends it back to whoever did the work (`builder`: its older name); `join` makes it
75
+ * once, when every task of the completed one's kind under the same parent completed with this outcome.
76
+ */
77
+ export interface TeamDesignHandOff {
78
+ on: {
79
+ kind: DashTeamKind;
80
+ outcome: string;
81
+ after?: 'build' | 'bug';
82
+ paths?: string[];
83
+ };
84
+ create: {
85
+ kind: DashTeamKind;
86
+ role?: string;
87
+ to?: 'owner' | 'builder';
88
+ join?: boolean;
89
+ title: string;
90
+ description: string;
91
+ };
92
+ }
93
+ /** Keep the flow the repository has, or replace it. */
94
+ export type TeamDesignFlow = {
95
+ keep: true;
96
+ why?: string;
97
+ } | {
98
+ keep: false;
99
+ handOffs: TeamDesignHandOff[];
100
+ why: string;
101
+ };
102
+ /** A goal to put on the board when the design is accepted, with the tasks it breaks into. */
103
+ export interface TeamDesignFirstGoal {
104
+ title: string;
105
+ description: string;
106
+ priority: number;
107
+ tasks: Array<{
108
+ kind: DashTeamKind;
109
+ role?: string;
110
+ title: string;
111
+ description: string;
112
+ priority: number;
113
+ paths: string[];
114
+ }>;
115
+ }
116
+ /** What LensMCP's checks did to the model's answer before anyone saw it — never silent. */
117
+ export interface TeamDesignCheck {
118
+ level: 'dropped' | 'changed' | 'warning';
119
+ what: string;
120
+ why: string;
121
+ }
122
+ /** The project as the design read it: when the project has moved on far enough, the page offers to design again. */
123
+ export interface TeamDesignBasis {
124
+ head: string | null;
125
+ branch: string | null;
126
+ /** The projects (Nx / workspace packages) it saw, by root. */
127
+ projects: string[];
128
+ trackedFiles: number;
129
+ at: number;
130
+ }
131
+ export interface TeamDesign {
132
+ version: typeof TEAM_DESIGN_VERSION;
133
+ project: {
134
+ name: string;
135
+ summary: string;
136
+ /** Who it serves. */
137
+ users: string;
138
+ stack: string[];
139
+ domains: TeamDesignDomain[];
140
+ qualityGates: TeamDesignGate[];
141
+ risks: string[];
142
+ };
143
+ goals: TeamDesignGoal[];
144
+ /** Does the project split into parallel work at all: a team, a small team (one builder and a checker), or one agent. */
145
+ fit: {
146
+ verdict: 'team' | 'small-team' | 'single-agent';
147
+ why: string;
148
+ parallel: string[];
149
+ };
150
+ roles: TeamDesignRole[];
151
+ off: TeamDesignOff[];
152
+ flow: TeamDesignFlow;
153
+ firstGoals: TeamDesignFirstGoal[];
154
+ /** What it could not assess, and why. */
155
+ limits: string[];
156
+ /** 0–1. */
157
+ confidence: number;
158
+ checks: TeamDesignCheck[];
159
+ basis: TeamDesignBasis;
160
+ }
161
+ /** A design run as the Team page shows it: the run (status, steps, cost — a DashAiRun's) and, once done, its design. */
162
+ export interface DashTeamDesignRun {
163
+ id: string;
164
+ status: 'queued' | 'running' | 'done' | 'failed';
165
+ startedAt: number;
166
+ finishedAt?: number;
167
+ costUsd?: number;
168
+ model?: string;
169
+ steps: string[];
170
+ error?: string;
171
+ refused?: 'no-key' | 'over-daily-cap' | 'no-room';
172
+ design?: TeamDesign;
173
+ /** The design was accepted (when, and what it wrote). */
174
+ accepted?: {
175
+ at: number;
176
+ files: string[];
177
+ goals: string[];
178
+ };
179
+ }
180
+ /** What the person keeps of a design. Roles they edited carry their own rules. */
181
+ export interface DashTeamDesignAccept {
182
+ runId: string;
183
+ roles: Array<{
184
+ id: string;
185
+ rules?: string;
186
+ }>;
187
+ /** Default roles to switch off. */
188
+ off: string[];
189
+ flow: boolean;
190
+ /** Write `.lensmcp/team/project.md`. */
191
+ brief: boolean;
192
+ /** Indexes into `firstGoals` to create on the board. */
193
+ goals: number[];
194
+ /** Overwrite files the repository already has (they are listed to the person first). */
195
+ force: boolean;
196
+ }
197
+ /** What accepting wrote, and what it kept because a file was already there and `force` was not given. */
198
+ export interface DashTeamDesignAccepted {
199
+ written: string[];
200
+ kept: string[];
201
+ goals: string[];
202
+ problems: string[];
203
+ /** Whether the agents on the team were told to agent_join again (a team file that changed). */
204
+ notified?: boolean;
205
+ }
206
+ /** Whether a design still fits the project: what changed since it was made, and whether that is enough to design again. */
207
+ export interface DashTeamDesignFit {
208
+ fits: boolean;
209
+ /** What moved since, in words: commits since its HEAD, projects added or gone, tracked files. */
210
+ changed: string[];
211
+ /** The project as it is now. */
212
+ now: TeamDesignBasis;
213
+ }
214
+ /**
215
+ * `GET /api/team/design` — and `team_design` over MCP: the newest run whole (its design once done), the newest design
216
+ * when that is another run, every run (without their designs), whether a key can pay for one, and — when asked
217
+ * (`?fits=1`) — whether the newest design still fits the project.
218
+ */
219
+ export interface DashTeamDesignState {
220
+ /** A working key can pay for a design: an Anthropic key, or one of the provider of the model Settings chose for it. */
221
+ ready: boolean;
222
+ latest?: DashTeamDesignRun;
223
+ /** The newest finished design, when the newest run is another (one running now, one that failed). */
224
+ done?: DashTeamDesignRun;
225
+ /** Newest first, at most 20, without their designs. */
226
+ runs: DashTeamDesignRun[];
227
+ fits?: DashTeamDesignFit;
228
+ }
@@ -0,0 +1 @@
1
+ "use strict";export const TEAM_DESIGN_VERSION=1;
@@ -0,0 +1,283 @@
1
+ import type { DashTeamKind, DashTeamOutcome } from './team.js';
2
+ /**
3
+ * The role library and the team as the person shapes it on the Team page (planning/team/02-role-library.md, RL1): the
4
+ * base roles LensMCP ships and its team templates, the repository's members built on them (`.lensmcp/team/roles/`),
5
+ * and the person's writes — a member added, edited or removed, a template previewed and applied. Served by
6
+ * servers/lensmcp-mcp/src/dashboard/team-library.ts; the data comes from `@lensmcp/storage` (library.ts,
7
+ * team-files.ts, templates.ts).
8
+ */
9
+ export type DashTeamRoleFamily = 'lead' | 'build' | 'check' | 'support' | 'market';
10
+ export type DashTeamWorktreePolicy = 'own' | 'shared' | 'any';
11
+ /** A LensMCP tool a role works with, and when to reach for it. */
12
+ export interface DashTeamRoleTool {
13
+ name: string;
14
+ when: string;
15
+ }
16
+ /** One tagged section of a role's craft: `<instructions id="…" note="…">`. */
17
+ export interface DashTeamRoleSection {
18
+ tag: string;
19
+ id: string;
20
+ note?: string;
21
+ }
22
+ /** A library role in brief — a card. Its tools by name; `GET /api/team/library/role` has each one's when. */
23
+ export interface DashTeamLibraryRole {
24
+ id: string;
25
+ title: string;
26
+ family: DashTeamRoleFamily;
27
+ /** Moves when what the role tells an agent changes. */
28
+ version: number;
29
+ /** Other names that resolve to it — the default it stands behind. */
30
+ aliases: string[];
31
+ summary: string;
32
+ takes: DashTeamKind[];
33
+ creates: DashTeamKind[] | 'any';
34
+ wip: number;
35
+ worktree: DashTeamWorktreePolicy;
36
+ /** Stack words it fits. */
37
+ fits: string[];
38
+ skills: string[];
39
+ tools: string[];
40
+ /** The id a member built on it gets in a repository: the default's it stands behind (`reviewer`), else its own. */
41
+ member: string;
42
+ /** The default role it stands behind, when it does. */
43
+ default?: string;
44
+ sections: DashTeamRoleSection[];
45
+ /** How long its craft is, in characters. */
46
+ chars: number;
47
+ /** `team://library/<id>` — where an agent reads it whole. */
48
+ uri: string;
49
+ }
50
+ /** `GET /api/team/library/role?id=` — one library role whole (by its id or an alias). */
51
+ export interface DashTeamLibraryRoleWhole extends Omit<DashTeamLibraryRole, 'tools'> {
52
+ tools: DashTeamRoleTool[];
53
+ sha: string;
54
+ /** Its craft, as tagged sections — read-only beside a member's own rules. */
55
+ instructions: string;
56
+ }
57
+ /** A member a template staffs. */
58
+ export interface DashTeamTemplateMember {
59
+ /** The library role it builds on. */
60
+ role: string;
61
+ /** Its id in the repository: `.lensmcp/team/roles/<member>.md`. */
62
+ member: string;
63
+ title: string;
64
+ agents: number;
65
+ start?: 'now' | 'later';
66
+ }
67
+ /**
68
+ * A hand-off of a template's own flow (TeamDesignHandOff without the text it may leave out: its title and description
69
+ * are its own, else the default flow's for the same step). `role` names a library role.
70
+ */
71
+ export interface DashTeamTemplateHandOff {
72
+ on: {
73
+ kind: DashTeamKind;
74
+ outcome: DashTeamOutcome;
75
+ after?: 'build' | 'bug';
76
+ paths?: string[];
77
+ };
78
+ create: {
79
+ kind: DashTeamKind;
80
+ role?: string;
81
+ to?: 'owner';
82
+ join?: boolean;
83
+ title?: string;
84
+ description?: string;
85
+ };
86
+ }
87
+ export interface DashTeamTemplate {
88
+ id: string;
89
+ title: string;
90
+ summary: string;
91
+ fits: string[];
92
+ roles: DashTeamTemplateMember[];
93
+ flow: 'default' | DashTeamTemplateHandOff[];
94
+ /** When it fits, and how to adjust it. */
95
+ about: string;
96
+ }
97
+ /** `GET /api/team/library` — the base roles by family, in brief, and the team templates. */
98
+ export interface DashTeamLibrary {
99
+ /** Moves when any role or template does. */
100
+ sha: string;
101
+ families: Array<{
102
+ family: DashTeamRoleFamily;
103
+ title: string;
104
+ roles: DashTeamLibraryRole[];
105
+ }>;
106
+ templates: DashTeamTemplate[];
107
+ }
108
+ /** Where a member's field came from: its file, its library base, the default role's text — tools and skills from both. */
109
+ export type DashTeamFieldSource = 'file' | 'base' | 'default' | 'base+file';
110
+ /** One member of the repository's team, as its files make it. */
111
+ export interface DashTeamMember {
112
+ id: string;
113
+ title: string;
114
+ summary: string;
115
+ takes: DashTeamKind[];
116
+ creates: DashTeamKind[] | 'any';
117
+ wip: number;
118
+ worktree: DashTeamWorktreePolicy;
119
+ /** The library role it builds on — or, while the library has no entry behind a default, that default's id. */
120
+ base?: string;
121
+ /** The base's title and version, when it is a library role. */
122
+ baseTitle?: string;
123
+ baseVersion?: number;
124
+ /** The paths it changes and others do not. */
125
+ owns: string[];
126
+ /** The LensMCP tools it works with — from its base, or added by its file. */
127
+ tools: Array<DashTeamRoleTool & {
128
+ from: 'base' | 'file';
129
+ }>;
130
+ skills: Array<{
131
+ name: string;
132
+ from: 'base' | 'file';
133
+ }>;
134
+ /** Wants `wants` agents (none said: no number), has `has` active ones now — `listening` of them waiting for work. */
135
+ staffing: {
136
+ wants?: number;
137
+ start?: 'now' | 'later';
138
+ has: number;
139
+ listening: number;
140
+ };
141
+ /** The repository's own rules for it, as tagged sections — empty when it has none. */
142
+ rules: string;
143
+ /** `default`: no file — LensMCP's default (built on its library role); `file`: the repository's file; `design`: a file an accepted team design wrote. */
144
+ source: 'default' | 'file' | 'design';
145
+ /** Its file, when it has one: `.lensmcp/team/roles/<id>.md`. */
146
+ file?: string;
147
+ /** One of the seven defaults (removing it switches it off; deleting its file brings the default back). */
148
+ isDefault: boolean;
149
+ fields: Record<string, DashTeamFieldSource>;
150
+ /** Why its file was not read (the default stood in) — empty when it was. */
151
+ problems: string[];
152
+ }
153
+ /** `GET /api/team/roles` — the team as the checkout's files make it. */
154
+ export interface DashTeamMembers {
155
+ members: DashTeamMember[];
156
+ /** Defaults switched off (`off: true`), each with its file. */
157
+ off: Array<{
158
+ id: string;
159
+ file: string;
160
+ }>;
161
+ flow: {
162
+ from: string;
163
+ };
164
+ /** Every file that was skipped, and why. */
165
+ problems: Array<{
166
+ file: string;
167
+ problem: string;
168
+ }>;
169
+ files: {
170
+ roles: string;
171
+ flow: string;
172
+ project: string;
173
+ };
174
+ }
175
+ /** One file a write would make: `write` (new — or already exactly so: `same`), `overwrite` (forced), `keep` (left as it is). */
176
+ export interface DashTeamFilePlan {
177
+ path: string;
178
+ exists: boolean;
179
+ action: 'write' | 'overwrite' | 'keep';
180
+ same?: true;
181
+ }
182
+ /**
183
+ * `POST /api/team/roles` — a member created or changed: its file written as an overlay on its base (only what differs
184
+ * from it). Fields left out come from the base; `force` writes over a file that is there.
185
+ */
186
+ export interface DashTeamMemberEdit {
187
+ /** One per submit. */
188
+ requestId: string;
189
+ /** Its id — when absent, the id a member built on `base` gets (`reviewer` for code-reviewer). */
190
+ id?: string;
191
+ /** A library role (id or alias); none for a role of the repository's own (it then needs title, summary and rules). */
192
+ base?: string;
193
+ title?: string;
194
+ summary?: string;
195
+ owns?: string[];
196
+ takes?: DashTeamKind[];
197
+ creates?: DashTeamKind[] | 'any';
198
+ wip?: number;
199
+ worktree?: DashTeamWorktreePolicy;
200
+ agents?: number;
201
+ start?: 'now' | 'later';
202
+ /** Tools added to the base's (one the base has, named again, takes this when). */
203
+ tools?: DashTeamRoleTool[];
204
+ /** Skills added to the base's. */
205
+ skills?: string[];
206
+ /** The repository's own rules for it — tagged sections, or plain lines (wrapped in `<rules id="role.<id>">`). */
207
+ rules?: string;
208
+ force?: boolean;
209
+ }
210
+ /** `POST /api/team/roles`'s answer: what happened to the file, and the member as it is now. */
211
+ export interface DashTeamMemberWritten {
212
+ file: DashTeamFilePlan;
213
+ written: boolean;
214
+ problems: string[];
215
+ member?: DashTeamMember;
216
+ /** Whether the agents on the team were told to agent_join again (a file that changed, a requestId). */
217
+ notified?: boolean;
218
+ /** On a refusal (409): why, in words — the dashboard's fetch reads only this from an error answer. */
219
+ error?: string;
220
+ }
221
+ /** `POST /api/team/roles/remove` — `{ requestId, id, why? }`: a default switched off, a role of the repository's own deleted. */
222
+ export interface DashTeamMemberRemoved {
223
+ path: string;
224
+ action: 'off' | 'deleted';
225
+ /** Whether the agents on the team were told to agent_join again. */
226
+ notified?: boolean;
227
+ /** Why they were not, when they were not. */
228
+ problems?: string[];
229
+ }
230
+ /** `POST /api/team/roles/on` — `{ requestId, id }`: a switched-off default back on the team. */
231
+ export interface DashTeamMemberOn {
232
+ path: string;
233
+ /** Its file deleted (it only switched the role off), or its `off: true` line taken out (the file holds more). */
234
+ action: 'deleted' | 'changed';
235
+ /** Whether the agents on the team were told to agent_join again. */
236
+ notified?: boolean;
237
+ /** Why they were not, when they were not. */
238
+ problems?: string[];
239
+ }
240
+ /** `GET /api/team/paths?under=` — the tracked folders (with their file counts) and files directly under a path. */
241
+ export interface DashTeamPaths {
242
+ under: string;
243
+ dirs: Array<{
244
+ path: string;
245
+ files: number;
246
+ }>;
247
+ files: string[];
248
+ /** More files than the answer carries, or the tracked-file list was cut. */
249
+ cut?: string;
250
+ /** Why nothing could be listed (not a Git checkout, git failed). */
251
+ why?: string;
252
+ }
253
+ /** `POST /api/team/templates/preview` — `{ requestId?, template, force? }`. */
254
+ export interface DashTeamTemplatePreview {
255
+ template: {
256
+ id: string;
257
+ title: string;
258
+ summary: string;
259
+ };
260
+ members: DashTeamTemplateMember[];
261
+ /** The defaults it switches off. */
262
+ off: string[];
263
+ /** What it leaves as it is, and why. */
264
+ notes: string[];
265
+ files: DashTeamFilePlan[];
266
+ problems: string[];
267
+ }
268
+ /** `POST /api/team/templates/apply` — `{ requestId, template, force? }`. */
269
+ export interface DashTeamTemplateApplied {
270
+ template: {
271
+ id: string;
272
+ title: string;
273
+ summary: string;
274
+ };
275
+ members: DashTeamTemplateMember[];
276
+ off: string[];
277
+ notes: string[];
278
+ written: string[];
279
+ kept: string[];
280
+ problems: string[];
281
+ /** The team was told (one broadcast note) — something changed. */
282
+ notified: boolean;
283
+ }
@@ -0,0 +1 @@
1
+ "use strict";export{};