@lensmcp/protocol-types 1.25.36 → 1.25.38
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/lib/team-library.d.ts +4 -0
- package/lib/team.d.ts +239 -1
- package/package.json +1 -1
package/lib/team-library.d.ts
CHANGED
|
@@ -141,6 +141,8 @@ export interface DashTeamMember {
|
|
|
141
141
|
/** The model and reasoning effort its file names for its agents (the manager spawns them with these) — none: the spawner's. */
|
|
142
142
|
model?: string;
|
|
143
143
|
effort?: string;
|
|
144
|
+
/** The client its file names for its launched agents (`codex` | `claude`) — none: the spawner's. */
|
|
145
|
+
client?: 'codex' | 'claude';
|
|
144
146
|
/** The repository's own rules for it, as tagged sections — empty when it has none. */
|
|
145
147
|
rules: string;
|
|
146
148
|
/** `default`: no file — LensMCP's default (built on its library role); `file`: the repository's file; `design`: a file an accepted team design wrote. */
|
|
@@ -205,6 +207,8 @@ export interface DashTeamMemberEdit {
|
|
|
205
207
|
/** The model (at most 80 characters) and effort (at most 40) its agents run on, in their client's words — empty or left out: none. */
|
|
206
208
|
model?: string;
|
|
207
209
|
effort?: string;
|
|
210
|
+
/** The client its launched agents run on — left out: none (the spawner's). */
|
|
211
|
+
client?: 'codex' | 'claude';
|
|
208
212
|
/** Tools added to the base's (one the base has, named again, takes this when). */
|
|
209
213
|
tools?: DashTeamRoleTool[];
|
|
210
214
|
/** Skills added to the base's. */
|
package/lib/team.d.ts
CHANGED
|
@@ -89,6 +89,8 @@ export interface DashTeamSession {
|
|
|
89
89
|
role?: string;
|
|
90
90
|
/** Who it reports to: `user`, or a session id. */
|
|
91
91
|
manager?: string;
|
|
92
|
+
/** The launch that started it (`agent_spawn`), when a manager launched it. */
|
|
93
|
+
launch?: string;
|
|
92
94
|
/** Waiting for work (agent_wait). */
|
|
93
95
|
listening?: boolean;
|
|
94
96
|
objective?: string;
|
|
@@ -99,6 +101,8 @@ export interface DashTeamSession {
|
|
|
99
101
|
createdAt: number;
|
|
100
102
|
lastSeenAt: number;
|
|
101
103
|
expiresAt: number;
|
|
104
|
+
/** Direct messages to it it has not read — an agent reads its messages with agent_sync. None: it read them all. */
|
|
105
|
+
unread?: number;
|
|
102
106
|
}
|
|
103
107
|
/** A checkout of the repository, as an agent's lens last saw it. */
|
|
104
108
|
export interface DashTeamWorktree {
|
|
@@ -127,6 +131,8 @@ export interface DashTeamRole {
|
|
|
127
131
|
/** The model and reasoning effort its role file asks for — the manager spawns its agents with them (planning/team/03). */
|
|
128
132
|
model?: string;
|
|
129
133
|
effort?: string;
|
|
134
|
+
/** The client its role file asks its launched agents to run on — none: the spawner's (planning/team/05). */
|
|
135
|
+
client?: DashTeamLaunchClient;
|
|
130
136
|
/** Claimable now (blocked ones not counted). */
|
|
131
137
|
open: number;
|
|
132
138
|
claimed: number;
|
|
@@ -210,6 +216,30 @@ export interface DashTeamMessage {
|
|
|
210
216
|
kind: 'message' | 'note';
|
|
211
217
|
to?: string;
|
|
212
218
|
}
|
|
219
|
+
/** A message by or to one agent, and whether its recipient read it. */
|
|
220
|
+
export interface DashTeamAgentMessage {
|
|
221
|
+
id: string;
|
|
222
|
+
seq: number;
|
|
223
|
+
/** A session id, or `user`: the person (this page, the operator CLI). */
|
|
224
|
+
from: string;
|
|
225
|
+
/** The session it is to; none: to every agent. */
|
|
226
|
+
to?: string;
|
|
227
|
+
kind: 'message' | 'note';
|
|
228
|
+
/** Cut past a few thousand characters. */
|
|
229
|
+
body: string;
|
|
230
|
+
createdAt: number;
|
|
231
|
+
/** Its recipient fetched it (agent_sync). */
|
|
232
|
+
read: boolean;
|
|
233
|
+
/** Its recipient acknowledged it. */
|
|
234
|
+
acked: boolean;
|
|
235
|
+
}
|
|
236
|
+
/** `GET /api/team/messages?session=` — the agent's newest direct messages, by it and to it, and the notes it sent; newest last. */
|
|
237
|
+
export interface DashTeamAgentMessages {
|
|
238
|
+
sessionId: string;
|
|
239
|
+
messages: DashTeamAgentMessage[];
|
|
240
|
+
/** Direct messages to it it has not read — all of them, not only those listed. */
|
|
241
|
+
unread: number;
|
|
242
|
+
}
|
|
213
243
|
/**
|
|
214
244
|
* What an agent's OWN transcript says (planning/team/03-agent-transcripts.md) — the Codex rollout or the Claude Code
|
|
215
245
|
* transcript its coordination session is linked to: by its hooks' native key, or by the `agent_join` answer that names
|
|
@@ -274,6 +304,8 @@ export interface DashTeamAgentDetail extends DashTeamAgentBrief {
|
|
|
274
304
|
/** The transcript file (absolute). */
|
|
275
305
|
file?: string;
|
|
276
306
|
bytes?: number;
|
|
307
|
+
/** Too long to read whole: read from this byte on — its newest part; the counts below are of that part. */
|
|
308
|
+
readFrom?: number;
|
|
277
309
|
threadId?: string;
|
|
278
310
|
parentThreadId?: string;
|
|
279
311
|
/** How it was started: `cli`, `vscode`, `exec`, `subagent` (Codex); the entrypoint (Claude Code). */
|
|
@@ -302,7 +334,10 @@ export interface DashTeamAgentDetail extends DashTeamAgentBrief {
|
|
|
302
334
|
output: number;
|
|
303
335
|
total: number;
|
|
304
336
|
};
|
|
305
|
-
/**
|
|
337
|
+
/**
|
|
338
|
+
* Agents it spawned (Codex subagents; Claude Code subagents), newest last — when (`at`), the task name it gave
|
|
339
|
+
* (`task`) and the start of what it told the agent (`message`), when the transcript says.
|
|
340
|
+
*/
|
|
306
341
|
spawned: Array<{
|
|
307
342
|
threadId: string;
|
|
308
343
|
nickname?: string;
|
|
@@ -310,7 +345,210 @@ export interface DashTeamAgentDetail extends DashTeamAgentBrief {
|
|
|
310
345
|
sessionId?: string;
|
|
311
346
|
model?: string;
|
|
312
347
|
effort?: string;
|
|
348
|
+
at?: number;
|
|
349
|
+
task?: string;
|
|
350
|
+
message?: string;
|
|
313
351
|
}>;
|
|
314
352
|
/** Its newest lines, oldest first. */
|
|
315
353
|
tail: DashTeamAgentLine[];
|
|
316
354
|
}
|
|
355
|
+
/** `who` in a review: a session id, `user` (the person) or `lensmcp` (the team flow, the operator CLI). */
|
|
356
|
+
export type DashTeamReviewActor = string;
|
|
357
|
+
/** A task of the run: the task reviewed (depth 0) or one under it, whole — with its timings. */
|
|
358
|
+
export interface DashTeamReviewTask extends DashTeamTask {
|
|
359
|
+
/** 0: the task reviewed; 1: its children; … */
|
|
360
|
+
depth: number;
|
|
361
|
+
/** The first claim, and when it was completed or cancelled. */
|
|
362
|
+
claimedAt?: number;
|
|
363
|
+
closedAt?: number;
|
|
364
|
+
/** created → first claim; first claim → closed (or now while held) — ms. */
|
|
365
|
+
waited?: number;
|
|
366
|
+
worked?: number;
|
|
367
|
+
/** How many times it was claimed (a recovery or take-back makes a second). */
|
|
368
|
+
claims: number;
|
|
369
|
+
/** The task whose outcome the team flow made it from, and the tasks its own outcome made. */
|
|
370
|
+
handedFrom?: string;
|
|
371
|
+
handedTo?: string[];
|
|
372
|
+
}
|
|
373
|
+
/** An agent of the run: a session that worked on its tasks, or an agent one of them spawned (with or without a session). */
|
|
374
|
+
export interface DashTeamReviewAgent {
|
|
375
|
+
/** Its team session — absent: a spawned agent that never joined the team (known from its spawner's transcript). */
|
|
376
|
+
sessionId?: string;
|
|
377
|
+
/** Codex thread / Claude Code session or agent id, when its transcript is linked or its spawner named it. */
|
|
378
|
+
threadId?: string;
|
|
379
|
+
client: string;
|
|
380
|
+
name?: string;
|
|
381
|
+
nickname?: string;
|
|
382
|
+
/** Its role now, and every role it joined in the window, in order. */
|
|
383
|
+
role?: string;
|
|
384
|
+
roles: Array<{
|
|
385
|
+
role: string;
|
|
386
|
+
at: number;
|
|
387
|
+
}>;
|
|
388
|
+
/** Who it reports to (`user` or a session) and the agent whose transcript spawned it. */
|
|
389
|
+
manager?: DashTeamReviewActor;
|
|
390
|
+
spawnedBy?: DashTeamReviewActor;
|
|
391
|
+
objective?: string;
|
|
392
|
+
step?: string;
|
|
393
|
+
createdAt?: number;
|
|
394
|
+
lastSeenAt?: number;
|
|
395
|
+
/** In this run: tasks it created, claimed, completed; ms it held tasks; messages it sent and got. */
|
|
396
|
+
created: number;
|
|
397
|
+
claimed: number;
|
|
398
|
+
completed: number;
|
|
399
|
+
held: number;
|
|
400
|
+
sent: number;
|
|
401
|
+
received: number;
|
|
402
|
+
/** The tasks it claimed, by kind (`build: 2`), and the outcomes it gave. */
|
|
403
|
+
kinds: Partial<Record<DashTeamKind, number>>;
|
|
404
|
+
outcomes: Partial<Record<DashTeamOutcome, number>>;
|
|
405
|
+
/** Its own transcript, folded — `tail` left out (the zip has its lines in the window). */
|
|
406
|
+
transcript?: Omit<DashTeamAgentDetail, 'tail'>;
|
|
407
|
+
}
|
|
408
|
+
/** One thing that happened, in time order. */
|
|
409
|
+
export interface DashTeamReviewEvent {
|
|
410
|
+
at: number;
|
|
411
|
+
kind: 'task.created' | 'task.claimed' | 'task.log' | 'task.handoff' | 'task.completed' | 'task.cancelled' | 'task.recovery' | 'task.checkpoint' | 'message' | 'joined' | 'spawn' | 'model';
|
|
412
|
+
by?: DashTeamReviewActor;
|
|
413
|
+
/** The task it is about, the session or thread it went to. */
|
|
414
|
+
taskId?: string;
|
|
415
|
+
to?: string;
|
|
416
|
+
/** One line, at most 400 characters. */
|
|
417
|
+
text: string;
|
|
418
|
+
}
|
|
419
|
+
/** A message of the run: through LensMCP (agent_message — a note to all when `to` is absent) or between a client's own agents (Codex send_message). */
|
|
420
|
+
export interface DashTeamReviewMessage {
|
|
421
|
+
at: number;
|
|
422
|
+
from: DashTeamReviewActor;
|
|
423
|
+
to?: string;
|
|
424
|
+
via: 'lensmcp' | 'client';
|
|
425
|
+
kind: 'message' | 'note';
|
|
426
|
+
body: string;
|
|
427
|
+
}
|
|
428
|
+
/** Work given to someone else: a task created for a role or an agent, a hand-off, an assignment, a spawned agent, a re-route. */
|
|
429
|
+
export interface DashTeamReviewDelegation {
|
|
430
|
+
at: number;
|
|
431
|
+
kind: 'create' | 'assign' | 'handoff' | 'spawn' | 'reroute' | 'take-back' | 'cancel';
|
|
432
|
+
from: DashTeamReviewActor;
|
|
433
|
+
/** A session, a thread (spawned), or `role:<id>`. */
|
|
434
|
+
to: string;
|
|
435
|
+
taskId?: string;
|
|
436
|
+
/** For a spawn: the model and effort it was spawned with (absent: its spawner's). */
|
|
437
|
+
model?: string;
|
|
438
|
+
effort?: string;
|
|
439
|
+
text?: string;
|
|
440
|
+
}
|
|
441
|
+
/** What the run says about the process — a hint for the person reviewing it, never a verdict. */
|
|
442
|
+
export interface DashTeamReviewFlag {
|
|
443
|
+
kind: 'self-review' | 'manager-did-work' | 'same-model' | 'role-model-mismatch' | 'unjoined-agent' | 'long-wait' | 'silent-claim' | 'rework' | 'no-evidence' | 'recovery' | 'open-under-closed' | 'serial' | 'idle-agent';
|
|
444
|
+
severity: 'info' | 'warn';
|
|
445
|
+
text: string;
|
|
446
|
+
taskId?: string;
|
|
447
|
+
sessionId?: string;
|
|
448
|
+
}
|
|
449
|
+
export interface DashTeamReviewMetrics {
|
|
450
|
+
/** The window's length — ms. */
|
|
451
|
+
elapsed: number;
|
|
452
|
+
tasks: number;
|
|
453
|
+
byKind: Partial<Record<DashTeamKind, number>>;
|
|
454
|
+
byState: Partial<Record<DashTeamTaskState, number>>;
|
|
455
|
+
byOutcome: Partial<Record<DashTeamOutcome, number>>;
|
|
456
|
+
/** Agents with a session; spawned agents that never joined. */
|
|
457
|
+
agents: number;
|
|
458
|
+
unjoined: number;
|
|
459
|
+
/** The most tasks held at once, and the ms with none held while the run was open. */
|
|
460
|
+
maxParallel: number;
|
|
461
|
+
idle: number;
|
|
462
|
+
/** created → first claim, ms: the median and the longest. */
|
|
463
|
+
waitMedian?: number;
|
|
464
|
+
waitMax?: number;
|
|
465
|
+
/** changes-requested reviews, failed tests, bugs filed, recoveries, hand-offs, messages (direct and notes). */
|
|
466
|
+
rework: number;
|
|
467
|
+
failed: number;
|
|
468
|
+
bugs: number;
|
|
469
|
+
recoveries: number;
|
|
470
|
+
handoffs: number;
|
|
471
|
+
messages: number;
|
|
472
|
+
notes: number;
|
|
473
|
+
/** Summed over the agents' whole transcripts (a transcript can span more than this run). */
|
|
474
|
+
tokens?: number;
|
|
475
|
+
}
|
|
476
|
+
/** `GET /api/team/review?id=` — a task's run whole: the task, the tasks under it, its agents, the flow, messages and delegations. */
|
|
477
|
+
export interface DashTeamReview {
|
|
478
|
+
version: 1;
|
|
479
|
+
generatedAt: number;
|
|
480
|
+
repoId: string;
|
|
481
|
+
/** The task reviewed — usually a goal. */
|
|
482
|
+
taskId: string;
|
|
483
|
+
title: string;
|
|
484
|
+
/** From 5 minutes before the task was created to 5 minutes after it closed — `open`: still running, to now. */
|
|
485
|
+
window: {
|
|
486
|
+
from: number;
|
|
487
|
+
to: number;
|
|
488
|
+
open: boolean;
|
|
489
|
+
};
|
|
490
|
+
/** The task reviewed first, then the tasks under it in creation order. */
|
|
491
|
+
tasks: DashTeamReviewTask[];
|
|
492
|
+
agents: DashTeamReviewAgent[];
|
|
493
|
+
timeline: DashTeamReviewEvent[];
|
|
494
|
+
messages: DashTeamReviewMessage[];
|
|
495
|
+
delegations: DashTeamReviewDelegation[];
|
|
496
|
+
flags: DashTeamReviewFlag[];
|
|
497
|
+
metrics: DashTeamReviewMetrics;
|
|
498
|
+
/** The team as it is now: each role, its cap, model and effort; where the flow came from. */
|
|
499
|
+
team: {
|
|
500
|
+
roles: Array<{
|
|
501
|
+
id: string;
|
|
502
|
+
title: string;
|
|
503
|
+
agents?: number;
|
|
504
|
+
model?: string;
|
|
505
|
+
effort?: string;
|
|
506
|
+
}>;
|
|
507
|
+
flowFrom: string;
|
|
508
|
+
};
|
|
509
|
+
/** Items left out past a cap. */
|
|
510
|
+
truncated?: {
|
|
511
|
+
timeline?: number;
|
|
512
|
+
messages?: number;
|
|
513
|
+
tasks?: number;
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
/** The clients LensMCP launches headless: Codex (`codex exec`) and Claude Code (`claude -p`). */
|
|
517
|
+
export type DashTeamLaunchClient = 'codex' | 'claude';
|
|
518
|
+
/** An agent a manager launched (`agent_spawn`): what it runs, where, and how it is doing. */
|
|
519
|
+
export interface DashTeamLaunch {
|
|
520
|
+
id: string;
|
|
521
|
+
role: string;
|
|
522
|
+
client: DashTeamLaunchClient;
|
|
523
|
+
model?: string;
|
|
524
|
+
effort?: string;
|
|
525
|
+
/** The session that launched it (a manager), and the goal and task it was launched for. */
|
|
526
|
+
by: string;
|
|
527
|
+
goalId?: string;
|
|
528
|
+
taskId?: string;
|
|
529
|
+
/** The checkout it works in — its goal's worktree — and that worktree's branch. */
|
|
530
|
+
worktree: string;
|
|
531
|
+
branch?: string;
|
|
532
|
+
pid: number;
|
|
533
|
+
/** `running` until it exits; `stopped` by the person or its deadline; `failed`: it could not start. */
|
|
534
|
+
state: 'running' | 'exited' | 'stopped' | 'failed';
|
|
535
|
+
startedAt: number;
|
|
536
|
+
/** When it is stopped if still running. */
|
|
537
|
+
deadline: number;
|
|
538
|
+
endedAt?: number;
|
|
539
|
+
exitCode?: number;
|
|
540
|
+
/** Its coordination session once it joined (its hooks name the launch), and its client's thread or session id. */
|
|
541
|
+
sessionId?: string;
|
|
542
|
+
threadId?: string;
|
|
543
|
+
/** The newest lines of its output, readable — what it said before it joined, or why it ended. */
|
|
544
|
+
tail?: string[];
|
|
545
|
+
}
|
|
546
|
+
/** `GET /api/team/launches` — the repository's launched agents, newest first, and whether launching is on. */
|
|
547
|
+
export interface DashTeamLaunchesAnswer {
|
|
548
|
+
/** Features › Team launches agents. */
|
|
549
|
+
enabled: boolean;
|
|
550
|
+
/** The most launches running at once (Features), and how many run now. */
|
|
551
|
+
max: number;
|
|
552
|
+
running: number;
|
|
553
|
+
launches: DashTeamLaunch[];
|
|
554
|
+
}
|