@lensmcp/protocol-types 1.25.33 → 1.25.35
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 +6 -0
- package/index.js +1 -1
- package/lib/ai-call-groups.d.ts +56 -0
- package/lib/ai-call-groups.js +2 -0
- package/lib/ai-call-row.d.ts +80 -0
- package/lib/ai-call-row.js +3 -3
- package/lib/ai-call.d.ts +2 -0
- package/lib/ai-call.js +8 -8
- package/lib/ai-context.d.ts +113 -0
- package/lib/ai-context.js +6 -0
- package/lib/ai-origins.d.ts +72 -0
- package/lib/ai-origins.js +10 -0
- package/lib/dashboard.d.ts +10 -3
- package/lib/event-loop.d.ts +46 -0
- package/lib/event-loop.js +1 -1
- package/lib/team-design.d.ts +228 -0
- package/lib/team-design.js +1 -0
- package/lib/team-library.d.ts +283 -0
- package/lib/team-library.js +1 -0
- package/lib/team.d.ts +209 -0
- package/lib/team.js +1 -0
- package/package.json +1 -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{};
|
package/lib/team.d.ts
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Team page (servers/lensmcp-mcp/src/dashboard/team.ts): the repository's agent team as its coordination store
|
|
3
|
+
* holds it — the agents in their roles, the tasks they take and hand on, each task's work log — and what the person at
|
|
4
|
+
* the machine changes there. The shapes are the store's (libs/storage coordination), cut to what the page shows: a
|
|
5
|
+
* task's whole log comes with the task alone (`/api/team/task`), the board carries its newest lines.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* What kind of work a task is: it names the role that takes it. `goal`: what a manager breaks into the others' tasks;
|
|
9
|
+
* `marketing`: telling people about the product (launch posts, release notes, landing and store copy).
|
|
10
|
+
*/
|
|
11
|
+
export declare const DASH_TEAM_KINDS: readonly ["goal", "build", "bug", "review", "test", "docs", "marketing", "research", "chore"];
|
|
12
|
+
export type DashTeamKind = (typeof DASH_TEAM_KINDS)[number];
|
|
13
|
+
export type DashTeamTaskState = 'open' | 'claimed' | 'recovery' | 'completed' | 'cancelled';
|
|
14
|
+
export type DashTeamOutcome = 'done' | 'approved' | 'changes-requested' | 'passed' | 'failed' | 'wontfix';
|
|
15
|
+
/** What a task points at in the lens or the repository. */
|
|
16
|
+
export declare const DASH_TEAM_LINK_KINDS: readonly ["task", "flow", "error", "suggestion", "ai-call", "review", "page", "route", "commit", "branch", "worktree", "file"];
|
|
17
|
+
export interface DashTeamLink {
|
|
18
|
+
kind: (typeof DASH_TEAM_LINK_KINDS)[number];
|
|
19
|
+
id: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
}
|
|
22
|
+
/** One line of a task's work log. `by`: a session id, `user` (the person at the machine) or `lensmcp` (the team flow, the store). */
|
|
23
|
+
export interface DashTeamLogLine {
|
|
24
|
+
at: number;
|
|
25
|
+
by: string;
|
|
26
|
+
kind: 'progress' | 'decision' | 'blocker' | 'handoff' | 'note' | 'state';
|
|
27
|
+
text: string;
|
|
28
|
+
}
|
|
29
|
+
export interface DashTeamTask {
|
|
30
|
+
id: string;
|
|
31
|
+
title: string;
|
|
32
|
+
/** Whole on `/api/team/task`; its first lines on the board. */
|
|
33
|
+
description: string;
|
|
34
|
+
kind?: DashTeamKind;
|
|
35
|
+
/** The role that may claim it; none: any agent. */
|
|
36
|
+
role?: string;
|
|
37
|
+
/** 0 (drop everything) … 3 (when there is time). */
|
|
38
|
+
priority: number;
|
|
39
|
+
parentId?: string;
|
|
40
|
+
blockedBy?: string[];
|
|
41
|
+
/** Of `blockedBy`, the tasks not completed or cancelled yet — an open task with any is blocked. */
|
|
42
|
+
blockedOn?: string[];
|
|
43
|
+
links?: DashTeamLink[];
|
|
44
|
+
/** The whole log on `/api/team/task`; its newest lines on the board. */
|
|
45
|
+
log: DashTeamLogLine[];
|
|
46
|
+
/** Every line it ever had, those no longer kept counted. */
|
|
47
|
+
logCount: number;
|
|
48
|
+
state: DashTeamTaskState;
|
|
49
|
+
outcome?: DashTeamOutcome;
|
|
50
|
+
/** The session holding it. */
|
|
51
|
+
owner?: string;
|
|
52
|
+
/** The session that must take it. */
|
|
53
|
+
to?: string;
|
|
54
|
+
/** 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. */
|
|
55
|
+
creator: string;
|
|
56
|
+
origin: 'agent' | 'lensmcp';
|
|
57
|
+
worktreeId?: string;
|
|
58
|
+
ownerWorktreeId?: string;
|
|
59
|
+
createdAt: number;
|
|
60
|
+
updatedAt: number;
|
|
61
|
+
leaseUntil?: number;
|
|
62
|
+
checkpoint?: string;
|
|
63
|
+
/** What its owner said changed and how to check it, on completion (cut on the board). */
|
|
64
|
+
result?: string;
|
|
65
|
+
evidence?: string[];
|
|
66
|
+
completedHead?: string | null;
|
|
67
|
+
paths?: string[];
|
|
68
|
+
tags?: string[];
|
|
69
|
+
}
|
|
70
|
+
/** A task named in another's chain: its parent, its children, a blocker. */
|
|
71
|
+
export interface DashTeamTaskRef {
|
|
72
|
+
id: string;
|
|
73
|
+
title: string;
|
|
74
|
+
kind?: DashTeamKind;
|
|
75
|
+
role?: string;
|
|
76
|
+
state: DashTeamTaskState;
|
|
77
|
+
outcome?: DashTeamOutcome;
|
|
78
|
+
owner?: string;
|
|
79
|
+
}
|
|
80
|
+
/** A task under another, and the tasks under it — the hand-off chain is a child of the task it came from. */
|
|
81
|
+
export interface DashTeamTreeNode extends DashTeamTaskRef {
|
|
82
|
+
children: DashTeamTreeNode[];
|
|
83
|
+
}
|
|
84
|
+
/** One coordination session: an agent on the team (a role), or one outside it (no role). */
|
|
85
|
+
export interface DashTeamSession {
|
|
86
|
+
id: string;
|
|
87
|
+
client: string;
|
|
88
|
+
name?: string;
|
|
89
|
+
role?: string;
|
|
90
|
+
/** Who it reports to: `user`, or a session id. */
|
|
91
|
+
manager?: string;
|
|
92
|
+
/** Waiting for work (agent_wait). */
|
|
93
|
+
listening?: boolean;
|
|
94
|
+
objective?: string;
|
|
95
|
+
step?: string;
|
|
96
|
+
/** `stale`: active, but not heard from within its lease. */
|
|
97
|
+
presence: 'active' | 'stale' | 'closed';
|
|
98
|
+
worktreeId: string;
|
|
99
|
+
createdAt: number;
|
|
100
|
+
lastSeenAt: number;
|
|
101
|
+
expiresAt: number;
|
|
102
|
+
}
|
|
103
|
+
/** A checkout of the repository, as an agent's lens last saw it. */
|
|
104
|
+
export interface DashTeamWorktree {
|
|
105
|
+
id: string;
|
|
106
|
+
root: string;
|
|
107
|
+
branch: string | null;
|
|
108
|
+
head: string | null;
|
|
109
|
+
observedAt: number;
|
|
110
|
+
/** Files changed in it, then. */
|
|
111
|
+
changed: number;
|
|
112
|
+
truncated: boolean;
|
|
113
|
+
error?: string;
|
|
114
|
+
}
|
|
115
|
+
/** One role: its active agents (and how many wait for work), its tasks by state. */
|
|
116
|
+
export interface DashTeamRole {
|
|
117
|
+
role: string;
|
|
118
|
+
title: string;
|
|
119
|
+
/** One line: what the role is for. */
|
|
120
|
+
summary: string;
|
|
121
|
+
/** The kinds of task it takes — a task of one goes to it unless the task names another role. */
|
|
122
|
+
takes: DashTeamKind[];
|
|
123
|
+
agents: number;
|
|
124
|
+
listening: number;
|
|
125
|
+
/** The most agents it takes at once (its role file's `agents`): agent_join refuses one more. None: no limit. */
|
|
126
|
+
cap?: number;
|
|
127
|
+
/** Claimable now (blocked ones not counted). */
|
|
128
|
+
open: number;
|
|
129
|
+
claimed: number;
|
|
130
|
+
blocked: number;
|
|
131
|
+
recovery: number;
|
|
132
|
+
}
|
|
133
|
+
/** A message to everyone, or a note — the board's newest. */
|
|
134
|
+
export interface DashTeamNote {
|
|
135
|
+
id: string;
|
|
136
|
+
seq: number;
|
|
137
|
+
sender: string;
|
|
138
|
+
origin: 'agent' | 'lensmcp';
|
|
139
|
+
to?: string;
|
|
140
|
+
kind: 'message' | 'note';
|
|
141
|
+
body: string;
|
|
142
|
+
createdAt: number;
|
|
143
|
+
}
|
|
144
|
+
/** `GET /api/team/board` — `{ same: true, rev }` when `?rev=` is still current. */
|
|
145
|
+
export interface DashTeamBoard {
|
|
146
|
+
repoId: string;
|
|
147
|
+
/** The checkout this dashboard serves. */
|
|
148
|
+
currentWorktreeId: string;
|
|
149
|
+
/** Changes when anything on the board does: a task, a session, an agent going quiet. */
|
|
150
|
+
rev: string;
|
|
151
|
+
/** The store's event sequence. */
|
|
152
|
+
revision: number;
|
|
153
|
+
observedAt: number;
|
|
154
|
+
sessions: DashTeamSession[];
|
|
155
|
+
worktrees: DashTeamWorktree[];
|
|
156
|
+
/** Live tasks first, then finished ones, newest first. */
|
|
157
|
+
tasks: DashTeamTask[];
|
|
158
|
+
notes: DashTeamNote[];
|
|
159
|
+
roles: DashTeamRole[];
|
|
160
|
+
/** More sessions or tasks than the board carries. */
|
|
161
|
+
truncated: boolean;
|
|
162
|
+
}
|
|
163
|
+
export type DashTeamBoardAnswer = DashTeamBoard | {
|
|
164
|
+
same: true;
|
|
165
|
+
rev: string;
|
|
166
|
+
};
|
|
167
|
+
/** `GET /api/team/task?id=` — the task whole, the chain above it (root first), the tasks under it, its blockers. */
|
|
168
|
+
export interface DashTeamTaskWhole {
|
|
169
|
+
task: DashTeamTask;
|
|
170
|
+
ancestors: DashTeamTaskRef[];
|
|
171
|
+
tree: DashTeamTreeNode[];
|
|
172
|
+
/** More tasks under it than the answer carries. */
|
|
173
|
+
treeTruncated?: boolean;
|
|
174
|
+
blockers: DashTeamTaskRef[];
|
|
175
|
+
}
|
|
176
|
+
/** `POST /api/team/task` — a task from the person at the machine. `requestId`: one per submit; a retry sends it again. */
|
|
177
|
+
export interface DashTeamNewTask {
|
|
178
|
+
requestId: string;
|
|
179
|
+
title: string;
|
|
180
|
+
description: string;
|
|
181
|
+
kind?: DashTeamKind;
|
|
182
|
+
role?: string;
|
|
183
|
+
priority?: number;
|
|
184
|
+
parentId?: string;
|
|
185
|
+
to?: string;
|
|
186
|
+
blockedBy?: string[];
|
|
187
|
+
links?: DashTeamLink[];
|
|
188
|
+
}
|
|
189
|
+
/** `POST /api/team/task/operate` — the person changes a task; each change is a line in its log, by `user`. */
|
|
190
|
+
export interface DashTeamOperate {
|
|
191
|
+
requestId: string;
|
|
192
|
+
taskId: string;
|
|
193
|
+
priority?: number;
|
|
194
|
+
/** A session id, or null: anyone in its role. */
|
|
195
|
+
to?: string | null;
|
|
196
|
+
role?: string;
|
|
197
|
+
/** Take a held (or abandoned) task back, with why. */
|
|
198
|
+
release?: string;
|
|
199
|
+
/** Cancel it, with why. */
|
|
200
|
+
cancel?: string;
|
|
201
|
+
note?: string;
|
|
202
|
+
}
|
|
203
|
+
/** `POST /api/team/message` — to one agent, or to everyone (no `to`). */
|
|
204
|
+
export interface DashTeamMessage {
|
|
205
|
+
requestId: string;
|
|
206
|
+
body: string;
|
|
207
|
+
kind: 'message' | 'note';
|
|
208
|
+
to?: string;
|
|
209
|
+
}
|
package/lib/team.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const DASH_TEAM_KINDS=["goal","build","bug","review","test","docs","marketing","research","chore"],DASH_TEAM_LINK_KINDS=["task","flow","error","suggestion","ai-call","review","page","route","commit","branch","worktree","file"];
|