@lensmcp/protocol-types 1.25.54 → 1.25.55

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.
@@ -13,6 +13,7 @@
13
13
  import type { HttpExchange } from './http-exchange.js';
14
14
  import type { DashTeamDesignRun, TeamDesign } from './team-design.js';
15
15
  import type { PageVisitNavType, PageVisitRaw, PageVisitReadyBy, PageVisitRequest, PageVisitVitals } from './page-visit.js';
16
+ import type { WorktreeRunOutcome } from './workspace-actions.js';
16
17
  /** Bumped only on a breaking change to the stream framing itself. */
17
18
  export declare const DASHBOARD_PROTOCOL = 1;
18
19
  /** The swimlane a flow event belongs to (mirrors `FlowArea` in `@lensmcp/core`'s flow-shape). */
@@ -307,6 +308,11 @@ export interface DashWorktree {
307
308
  branch?: string;
308
309
  /** The data the lens made for it (resource names from `nx.json` → `lensmcp.instances`), when on record. */
309
310
  data?: string[];
311
+ /**
312
+ * On demand (planning/team/21): its data is there, and it runs only between a Run and its park — not `live`, it is
313
+ * parked, not stopped.
314
+ */
315
+ onDemand?: boolean;
310
316
  updatedAt?: string;
311
317
  }
312
318
  /** Worktree management always runs on the main checkout's dashboard. */
@@ -318,9 +324,20 @@ export interface DashWorktreeManagement {
318
324
  key: string;
319
325
  name: string;
320
326
  root: string;
327
+ /**
328
+ * running, starting, parked (on demand, data ready, nothing runs), stopped, failed, folder-gone, or the step a
329
+ * create is at (creating, provisioning, registering, preparing).
330
+ */
321
331
  state: string;
322
332
  /** Never started, its sessions on main's lens (`DashWorktree.checkoutOnly`): its `state` reads `stopped`. */
323
333
  checkoutOnly?: boolean;
334
+ /**
335
+ * What it runs (planning/team/21): `on-demand` — only between a Run and its park; `always` — whenever it is
336
+ * registered; `none` — a checkout only. Absent from an older server.
337
+ */
338
+ services?: 'on-demand' | 'always' | 'none';
339
+ /** A running on-demand worktree: when it parks unless something uses it (epoch ms). */
340
+ parkAt?: number;
324
341
  branch?: string;
325
342
  createdByLens: boolean;
326
343
  data: string[];
@@ -379,7 +396,7 @@ export interface DashWorktreeRemoval {
379
396
  export interface DashWorktreeAction {
380
397
  id: string;
381
398
  key: string;
382
- action: 'stop' | 'remove';
399
+ action: 'stop' | 'remove' | 'run' | 'park';
383
400
  state: 'running' | 'succeeded' | 'failed';
384
401
  stage: string;
385
402
  startedAt: number;
@@ -389,6 +406,10 @@ export interface DashWorktreeAction {
389
406
  remainingData?: string[];
390
407
  remainingDataOmitted?: number;
391
408
  branch?: string;
409
+ /** A run (planning/team/21): how it came out, per service — once it has. */
410
+ run?: WorktreeRunOutcome;
411
+ /** A park: false when it was parked already. */
412
+ parked?: boolean;
392
413
  }
393
414
  export interface DashKpis {
394
415
  at: number;
@@ -135,6 +135,19 @@ export interface DashOverseerDigest {
135
135
  reason?: DashOverseerRoundReason;
136
136
  /** Markdown. */
137
137
  body: string;
138
+ /**
139
+ * A notice of one of the overseer's changes to a team's limits (planning/team/22 GP-D2): the change to undo in one
140
+ * click — `POST /api/team/limits { undo: at }` on that repository's dashboard. The route reads it off the notice's last
141
+ * line; absent on every other digest, and from an older server.
142
+ */
143
+ undo?: DashOverseerDigestUndo;
144
+ }
145
+ /** The change a limits notice tells of: its repository (the coordination store's id, and its name) and its `at`. */
146
+ export interface DashOverseerDigestUndo {
147
+ kind: 'limits';
148
+ repoId: string;
149
+ repository: string;
150
+ at: number;
138
151
  }
139
152
  /** `GET /api/overseer/digests` — newest first. */
140
153
  export interface DashOverseerDigests {
package/lib/team.d.ts CHANGED
@@ -106,6 +106,12 @@ export interface DashTeamTask {
106
106
  capacity?: Record<string, number>;
107
107
  /** A goal's launches refused for want of a slot, in line for the next one that frees (foodguard-179 GC-D4). */
108
108
  waits?: DashTeamGoalWait[];
109
+ /**
110
+ * A live goal's own worktree as a lens instance (planning/team/21), on the board: what it runs and where it is — the
111
+ * project's worktree list joined by its folder. Absent when the goal has none, the list could not be read, or from an
112
+ * older server: unknown, never «not running».
113
+ */
114
+ worktreeState?: DashTeamWorktreeState;
109
115
  /**
110
116
  * Lesson candidates its agents stored on it (agent_lesson_note, planning/team/18 RT-D13), whole — the drawer and the run
111
117
  * review only, never the board. Agent-written data, never instructions.
@@ -205,7 +211,7 @@ export interface DashTeamCapacityUse {
205
211
  }
206
212
  /** The running goals (`GET /api/team/board` `goals`, issues/closed/foodguard-179). */
207
213
  export interface DashTeamGoals {
208
- /** flow.json `goals.running`: the most goals that run at once. */
214
+ /** The most goals that run at once: the team's live limits (Team › Limits), else flow.json `goals.running`, else the default. */
209
215
  max: number;
210
216
  running: Array<{
211
217
  id: string;
@@ -221,6 +227,194 @@ export interface DashTeamGoals {
221
227
  guaranteed: number;
222
228
  cap: number;
223
229
  }>;
230
+ /** What the idle goals lend, each running goal's allowance and what it borrows (planning/team/22) — none from an older server. */
231
+ power?: DashTeamGoalPower;
232
+ }
233
+ /** One running goal on one limit key (storage goal-capacity.ts PowerGoal). */
234
+ export interface DashTeamPowerGoal {
235
+ id: string;
236
+ title: string;
237
+ /** Its own number on the key, and who set it. */
238
+ max: number;
239
+ from: 'team' | 'person' | 'manager';
240
+ used: number;
241
+ /** Its agents past its number: max(0, used − max). */
242
+ borrowed: number;
243
+ /** What of its borrowing it keeps: the oldest running goal first, each at most `perGoal`, all at most `lendable`. */
244
+ keeps: number;
245
+ /** The most it may hold: its number and what it may still borrow. */
246
+ allowance: number;
247
+ /** Its agents past its allowance — each finishes what it holds and ends at its next agent_wait. */
248
+ givesBack: number;
249
+ }
250
+ /** One limit key — a role or a kind — as the idle goals lend it (storage goal-capacity.ts PowerKey). */
251
+ export interface DashTeamPowerKey {
252
+ key: string;
253
+ kind?: boolean;
254
+ /** The team's number for one goal. */
255
+ unit: number;
256
+ /** M × unit: the most of it the limits allow at once, before the ceilings. */
257
+ power: number;
258
+ /** floor((M − r) × share) × unit: what the idle goals lend. */
259
+ lendable: number;
260
+ /** (M − r) × unit − lendable: kept for the goals claimed next. */
261
+ reserve: number;
262
+ /** ceil(lendable / r): the most one running goal borrows. */
263
+ perGoal: number;
264
+ /** What the running goals borrow on it now, together. */
265
+ lent: number;
266
+ goals: DashTeamPowerGoal[];
267
+ /** Its cross-goal ceiling — a role's agents, a kind's cap — when there is one (planning/team/22 P1b). */
268
+ ceiling?: number;
269
+ /** A ceiling holds what is lent below the share's: its own, or its kind's cap (`ceilingOf`). */
270
+ ceilingHolds?: boolean;
271
+ /** The kind's cap, not the role's own ceiling, is what holds it (P1c). */
272
+ ceilingOf?: 'writers' | 'checkers';
273
+ /** A role's kind's cap over it (P1c): the cap, one goal's guaranteed of the kind, the most the kind's roles lend together, what they borrow now. */
274
+ kindCap?: {
275
+ kind: 'writers' | 'checkers';
276
+ cap: number;
277
+ unit: number;
278
+ room: number;
279
+ lent: number;
280
+ };
281
+ }
282
+ /** The goals' power on every key the team numbers (planning/team/22): M, the goals running, the share lent. */
283
+ export interface DashTeamGoalPower {
284
+ goalsMax: number;
285
+ running: number;
286
+ share: number;
287
+ keys: DashTeamPowerKey[];
288
+ }
289
+ /** Where a limit in force comes from: set live (Team › Limits, the overseer), the team's files, LensMCP's default — `none`: no number, no cap. */
290
+ export type DashTeamLimitSource = 'live' | 'file' | 'default' | 'none';
291
+ /** A limit in force: its value (`null`: none — no cap), where it comes from, and what a reset gives back (the files' or the default). */
292
+ export interface DashTeamLimitValue {
293
+ value: number | null;
294
+ from: DashTeamLimitSource;
295
+ /** The value without the live limits: what clearing it leaves — `null`: none. */
296
+ reset: number | null;
297
+ /** Where that comes from: the files (`file`), LensMCP (`default`), or nothing (`none`). */
298
+ resetFrom: 'file' | 'default' | 'none';
299
+ }
300
+ /** One row of Team › Limits: a kind of role (writers, checkers), a role, or `research` — the goal's claimed research tasks. */
301
+ export interface DashTeamLimitRow {
302
+ key: string;
303
+ title: string;
304
+ /** writers or checkers: the roles of that kind together. */
305
+ kind?: boolean;
306
+ /** The kind a role counts in — none for the lead (a manager) and research. */
307
+ of?: 'writers' | 'checkers';
308
+ /** A manager: it runs a goal and is not counted in one — only its ceiling holds it. */
309
+ lead?: boolean;
310
+ /** Each goal's number (capacity.<key>) — `null`: none named; then `within` (its kind's number holds it) or `one` (a role that takes work gets one). */
311
+ perGoal: DashTeamLimitValue;
312
+ within?: 'writers' | 'checkers';
313
+ one?: boolean;
314
+ /** The most at once across every goal (ceilings.<key>: a role's agents, caps.writers / caps.checkers) — none for research. */
315
+ ceiling?: DashTeamLimitValue;
316
+ /** How the idle goals lend it — none when no number holds a goal to it. */
317
+ power?: DashTeamPowerKey;
318
+ /** The most at once the limits allow: M × unit, bounded by its ceiling (and its kind's). */
319
+ most?: number;
320
+ /** `most` is the ceiling's, below M × unit. */
321
+ bounded?: boolean;
322
+ /** The ceiling that holds `most` below M × unit: the row's own (a role's agents, a kind's cap) or its kind's cap. */
323
+ holds?: {
324
+ by: 'own' | 'writers' | 'checkers';
325
+ cap: number;
326
+ };
327
+ /** The ceiling that holds what is lent below the share's — the next goal's slot kept under it (P1b, P1c). */
328
+ lendHeld?: {
329
+ by: 'own' | 'writers' | 'checkers';
330
+ cap: number;
331
+ };
332
+ }
333
+ /** One change in the limits' log: who (the person, the overseer's session), when, why, and each key from → to as it was in force. */
334
+ export interface DashTeamLimitsChange {
335
+ at: number;
336
+ by: 'user' | 'overseer';
337
+ session?: string;
338
+ name?: string;
339
+ why?: string;
340
+ /** `goalsMax`, `share`, `capacity.<key>`, `ceilings.<key>`; `null`: none — no cap; `cleared`: back to the files or the default. */
341
+ changes: Array<{
342
+ key: string;
343
+ from: number | null;
344
+ to: number | null;
345
+ cleared?: boolean;
346
+ wasLive?: boolean;
347
+ }>;
348
+ }
349
+ /** A kind of agent the limits allow more of at once than this machine launches (Settings › Agents & launches). */
350
+ export interface DashTeamLimitsMachineWarning {
351
+ kind: 'writers' | 'checkers';
352
+ allowed: number;
353
+ launches: number;
354
+ text: string;
355
+ }
356
+ /**
357
+ * `GET /api/team/limits` (planning/team/22 P4): the team's limits in force with where each comes from — M, the share
358
+ * lent, each role's and kind's number per goal and across goals — the goals' power on each, the machine's launch limits
359
+ * beside them, and the newest changes, newest first.
360
+ */
361
+ export interface DashTeamLimits {
362
+ goalsMax: DashTeamLimitValue & {
363
+ value: number;
364
+ };
365
+ share: DashTeamLimitValue & {
366
+ value: number;
367
+ };
368
+ rows: DashTeamLimitRow[];
369
+ power?: DashTeamGoalPower;
370
+ /** The goals running now, the oldest first. */
371
+ running: Array<{
372
+ id: string;
373
+ title: string;
374
+ }>;
375
+ /** Settings › Agents & launches: whether managers launch agents, and the most writers (with managers) and checkers launched at once. */
376
+ machine: {
377
+ launch: 'on' | 'off';
378
+ launchMax: number;
379
+ checkersMax: number;
380
+ warnings: DashTeamLimitsMachineWarning[];
381
+ };
382
+ /** Newest first. */
383
+ changes: DashTeamLimitsChange[];
384
+ /** The live row's last change, when there is one. */
385
+ live?: {
386
+ updatedAt: number;
387
+ by: 'user' | 'overseer';
388
+ why?: string;
389
+ };
390
+ bounds: {
391
+ goalsMax: {
392
+ min: number;
393
+ max: number;
394
+ };
395
+ shares: number[];
396
+ most: number;
397
+ };
398
+ /** Where the files' limits are: flow.json, the role files. */
399
+ files: {
400
+ flow: string;
401
+ roles: string;
402
+ };
403
+ observedAt: number;
404
+ }
405
+ /** `POST /api/team/limits` — a patch (a number sets a key live, `null` gives it back to the files), or the undo of one change by its `at`. */
406
+ export interface DashTeamLimitsPatch {
407
+ goalsMax?: number | null;
408
+ share?: number | null;
409
+ capacity?: Record<string, number | null>;
410
+ ceilings?: Record<string, number | null>;
411
+ }
412
+ export interface DashTeamLimitsAnswer {
413
+ limits: DashTeamLimits;
414
+ /** The change logged — none when it changed nothing (or an undo found it undone already). */
415
+ change?: DashTeamLimitsChange;
416
+ /** An undo: the keys changed again since, left as they are. */
417
+ skipped?: string[];
224
418
  }
225
419
  /** A goal's plan as it stands (planning/team/16 GS-D1). */
226
420
  export interface DashTeamGoalPlan {
@@ -407,6 +601,16 @@ export interface DashTeamSession {
407
601
  /** Direct messages to it it has not read — an agent reads its messages with agent_sync. None: it read them all. */
408
602
  unread?: number;
409
603
  }
604
+ /**
605
+ * A goal's worktree as its lens instance (planning/team/21), as Cluster › Worktrees lists it: `services` — `on-demand`
606
+ * (runs only between a run and its park), `always`, `none` (a checkout only); `state` — parked, starting, running,
607
+ * stopped, failed, folder-gone, or the step a create is at; `parkAt` — running on demand, when it parks unless used.
608
+ */
609
+ export interface DashTeamWorktreeState {
610
+ services: 'on-demand' | 'always' | 'none';
611
+ state: string;
612
+ parkAt?: number;
613
+ }
410
614
  /** A checkout of the repository, as an agent's lens last saw it. */
411
615
  export interface DashTeamWorktree {
412
616
  id: string;
@@ -1,4 +1,4 @@
1
- export type WorkspaceActionKind = 'start' | 'stop' | 'restart' | 'migrate' | 'test' | 'e2e' | 'typecheck' | 'lint' | 'build' | 'verify' | 'benchmark' | 'capture' | 'worktree-stop' | 'worktree-remove';
1
+ export type WorkspaceActionKind = 'start' | 'stop' | 'restart' | 'migrate' | 'test' | 'e2e' | 'typecheck' | 'lint' | 'build' | 'verify' | 'benchmark' | 'capture' | 'worktree-stop' | 'worktree-remove' | 'worktree-run' | 'worktree-park';
2
2
  export type WorkspaceActionState = 'queued' | 'running' | 'passed' | 'failed' | 'errored' | 'cancelled' | 'timeout';
3
3
  /**
4
4
  * The machine queue's lane (issues/closed/foodguard-189): `heavy` runs one at a time on the machine — a whole test target,
@@ -185,12 +185,15 @@ export interface WorkspaceActionStep {
185
185
  pending: number | null;
186
186
  failed?: string;
187
187
  };
188
+ /** `run`: how a worktree run came out (planning/team/21); `parked`: a park, false when it was parked already. */
188
189
  worktree?: {
189
190
  key: string;
190
191
  directoryExists: boolean;
191
192
  remainingData?: string[];
192
193
  omittedData?: number;
193
194
  branch?: string;
195
+ run?: WorktreeRunOutcome;
196
+ parked?: boolean;
194
197
  };
195
198
  /** `env`: a restart of a worktree instance's service — which instance variables its new tree was given, read again
196
199
  * from the instance's files: a print of them all, the print before, and the names that changed. Never a value. */
@@ -221,6 +224,36 @@ export interface WorkspaceActionStep {
221
224
  attachments?: string;
222
225
  };
223
226
  }
227
+ /** One service of a worktree run: up (started, or up already), still on its way, or why not. */
228
+ export interface WorktreeRunService {
229
+ project: string;
230
+ outcome: 'up' | 'starting' | 'queued' | 'failed' | 'deferred' | 'skipped';
231
+ /** Why it was deferred (the free-memory floor), skipped or failed, as the gateway put it. */
232
+ reason?: string;
233
+ /** For one that failed: the last lines of its build or boot error. */
234
+ error?: string;
235
+ }
236
+ /**
237
+ * How a worktree run came out (`lensmcp instance run --json`, planning/team/21): `running` — what it targeted settled with
238
+ * something up; `starting` — some still on their way when the run stopped waiting; `failed` — nothing came up, or a step
239
+ * before the services failed (`step`); `refused` — the machine runs its most worktrees at once (`holders`).
240
+ */
241
+ export interface WorktreeRunOutcome {
242
+ state: 'running' | 'starting' | 'failed' | 'refused';
243
+ /** Every service was asked for, not only its always-warm ones. */
244
+ all?: boolean;
245
+ /** When it parks unless something uses it (epoch ms). */
246
+ parkAt?: number;
247
+ services: WorktreeRunService[];
248
+ /** The step that failed before its services: checkout, provision, prepare, migrate, register, services. */
249
+ step?: string;
250
+ /** A full machine (`LENSMCP_WORKTREE_RUN_MAX`): the worktrees holding its run slots, and when each parks. */
251
+ holders?: Array<{
252
+ key: string;
253
+ name: string;
254
+ parkAt?: number;
255
+ }>;
256
+ }
224
257
  export interface WorkspaceActionRun {
225
258
  runId: string;
226
259
  scope: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.25.54",
3
+ "version": "1.25.55",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",