@lensmcp/protocol-types 1.26.2 → 1.26.4

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.d.ts CHANGED
@@ -169,6 +169,11 @@ export interface DashTeamTask {
169
169
  * older server: unknown, never «not running».
170
170
  */
171
171
  worktreeState?: DashTeamWorktreeState;
172
+ /**
173
+ * A goal's: the worker Macs its agents run on — a live session's `peer` host (overseer-74 D29), slice D32. Absent: on
174
+ * the organizer only.
175
+ */
176
+ on?: DashTeamHostMark[];
172
177
  /**
173
178
  * Lesson candidates its agents stored on it (agent_lesson_note, planning/team/18 RT-D13), whole — the drawer and the run
174
179
  * review only, never the board. Agent-written data, never instructions.
@@ -688,6 +693,38 @@ export interface DashTeamSession {
688
693
  expiresAt: number;
689
694
  /** Direct messages to it it has not read — an agent reads its messages with agent_sync. None: it read them all. */
690
695
  unread?: number;
696
+ /** The worker Mac it runs on — its `peer` host as D29 records it (slice D32). Absent: on the organizer. */
697
+ on?: DashTeamHostMark;
698
+ }
699
+ /**
700
+ * Where a session, a launch or a goal runs when that is a worker Mac (overseer-74, slice D32) — its `peer` host as D29
701
+ * records it: the worker by its pin's name; on a worker's own dashboard, `self` for that Mac («on this Mac»). Unmarked:
702
+ * the organizer.
703
+ */
704
+ export interface DashTeamHostMark {
705
+ /** The Mac's name, as this Mac's pin says it — or the start of its fingerprint, for a worker this Mac does not pin. */
706
+ name: string;
707
+ /** Its certificate's fingerprint, when known. */
708
+ fingerprint?: string;
709
+ /** The Mac showing the page: «on this Mac». */
710
+ self?: true;
711
+ }
712
+ /**
713
+ * A worker Mac's Team board is the organizer's, read through the link (overseer-74, slice D32; DW-Q2 decided: read-only).
714
+ * Absent on the organizer's own board.
715
+ */
716
+ export interface DashTeamRemote {
717
+ /** The organizer's name, as this Mac's pin says it. */
718
+ organizer: string;
719
+ /** Why every write is refused here — shown on each write control: «The board is «<organizer>»'s: act on it there». */
720
+ readOnly: string;
721
+ /** When the organizer answered the board shown, by this Mac's clock. */
722
+ readAt: number;
723
+ /** The read failed — the link is down, the organizer did not answer: the board shown is the last one read (none: never read). */
724
+ stale?: {
725
+ why: string;
726
+ since: number;
727
+ };
691
728
  }
692
729
  /**
693
730
  * A goal's worktree as its lens instance (planning/team/21), as Cluster › Worktrees lists it: `services` — `on-demand`
@@ -775,6 +812,8 @@ export interface DashTeamBoard {
775
812
  * worktree's tasks. The agents, worktrees and notes are the whole team's either way.
776
813
  */
777
814
  scope?: DashTeamBoardScope;
815
+ /** On a worker Mac: this board is the organizer's, read through the link, and read-only here (slice D32). */
816
+ remote?: DashTeamRemote;
778
817
  }
779
818
  export interface DashTeamBoardScope {
780
819
  worktreeId: string;
@@ -796,6 +835,8 @@ export interface DashTeamTaskWhole {
796
835
  blockers: DashTeamTaskRef[];
797
836
  /** Its agents' questions, oldest first (planning/team/09) — absent when it has none. */
798
837
  questions?: DashTeamQuestion[];
838
+ /** On a worker Mac: the organizer's task, read through the link — stale when the read failed and this is the last one read (slice D32). */
839
+ remote?: DashTeamRemote;
799
840
  }
800
841
  /** `POST /api/team/task` — a task from the person at the machine. `requestId`: one per submit; a retry sends it again. */
801
842
  export interface DashTeamNewTask {
@@ -1380,8 +1421,23 @@ export interface DashTeamLaunch {
1380
1421
  account?: string;
1381
1422
  accountLabel?: string;
1382
1423
  pid: number;
1383
- /** `running` until it exits; `stopped` by the person or its deadline; `failed`: it could not start. */
1384
- state: 'running' | 'exited' | 'stopped' | 'failed';
1424
+ /**
1425
+ * `running` until it exits; `stopped` by the person or its deadline; `failed`: it could not start; `lost`: it runs on a
1426
+ * worker Mac that went silent (planning/docker § 13, D29) — never a verdict of its own, and it reads `running` again
1427
+ * when its worker reports it running.
1428
+ */
1429
+ state: 'running' | 'exited' | 'stopped' | 'failed' | 'lost';
1430
+ /**
1431
+ * The worker Mac it runs on (planning/docker § 13, D29) — absent: this Mac. Its `pid` is 0 here: the worker's own
1432
+ * process id is `peer.pid`, and this Mac never asks `ps` about it nor signals it; its liveness is the worker's reports
1433
+ * (`heardAt`, the last of them).
1434
+ */
1435
+ peer?: {
1436
+ name: string;
1437
+ fingerprint: string;
1438
+ pid?: number;
1439
+ heardAt?: number;
1440
+ };
1385
1441
  startedAt: number;
1386
1442
  /** When it is stopped if still running. */
1387
1443
  deadline: number;
@@ -1396,6 +1452,8 @@ export interface DashTeamLaunch {
1396
1452
  movedFrom?: string;
1397
1453
  /** The newest lines of its output, readable — what it said before it joined, or why it ended. */
1398
1454
  tail?: string[];
1455
+ /** The worker Mac it runs on — its host as placement recorded it (overseer-74 D29), shown «on <host>» (D32). Absent: this Mac. */
1456
+ on?: DashTeamHostMark;
1399
1457
  }
1400
1458
  /** `GET /api/team/launches` — the repository's launched agents, newest first, and whether launching is on. */
1401
1459
  export interface DashTeamLaunchesAnswer {
@@ -1,5 +1,50 @@
1
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
- export type WorkspaceActionState = 'queued' | 'running' | 'passed' | 'failed' | 'errored' | 'cancelled' | 'timeout';
2
+ /**
3
+ * How a run stands. `lost` (planning/docker/00-plan.md § 10 «A worker that disappears», slices D16 and D18): a run on a
4
+ * worker Mac ({@link RunHost}) whose worker went silent — no word from it for 45 s. Nobody knows how its command would
5
+ * have ended, so it is never «passed» and never a proof; a worker that comes back finds it lost still, and anything it
6
+ * sends of it after is refused. Only a remote run is ever lost: a run on this Mac whose runner went quiet reads `errored`.
7
+ */
8
+ export type WorkspaceActionState = 'queued' | 'running' | 'passed' | 'failed' | 'errored' | 'cancelled' | 'timeout' | 'lost';
9
+ /** The ends of a run: it is over, and its verdict will not change. */
10
+ export declare const WORKSPACE_ACTION_ENDS: readonly WorkspaceActionState[];
11
+ /**
12
+ * The Mac a run ran on, when it is not this one (planning/docker/00-plan.md §§ 10 and 12, slice D16): a worker paired with
13
+ * this organizer, as its peer hub knows it. EVIDENCE of where the run was — as a proof's `runtime` and `runnerHash` are —
14
+ * never one of a proof's candidate inputs. The contract's `peers.ts` names this shape for a proof's `host`.
15
+ */
16
+ export interface RunHost {
17
+ /** The worker's id on the channel: what its pinned certificate is known by. */
18
+ peer: string;
19
+ /** Its name, as the person paired it: «mac-mini». */
20
+ name: string;
21
+ /** What it said of itself when the run was placed: its architecture (`arm64`), its macOS, its Docker engine and its LensMCP. */
22
+ arch: string;
23
+ os: string;
24
+ /** None: its Docker did not answer when it said them. */
25
+ docker?: string;
26
+ lensmcp: string;
27
+ }
28
+ /** A stream of a run's evidence that reached its cap: how much of it was kept, and when it stopped. Nothing past it was kept. */
29
+ export interface RunShortenedStream {
30
+ capBytes: number;
31
+ keptBytes: number;
32
+ at: number;
33
+ }
34
+ /**
35
+ * What of a remote run's evidence reached its cap (plan § 10: 64 MiB of log, 256 MiB of artifacts per run) — none:
36
+ * every byte that came was kept. The log ends with a line that says so; the artifact cut short and the ones not kept
37
+ * after it are named in `files` (the first five; `filesMore` counts the others sent).
38
+ */
39
+ export interface RunShortened {
40
+ log?: RunShortenedStream;
41
+ artifacts?: RunShortenedStream & {
42
+ files?: string[];
43
+ filesMore?: number;
44
+ };
45
+ samples?: RunShortenedStream;
46
+ events?: RunShortenedStream;
47
+ }
3
48
  /**
4
49
  * The machine queue's lane (issues/closed/foodguard-189): `heavy` runs one at a time on the machine — a whole test target,
5
50
  * e2e, verify, anything over an hour, a test on an integration or e2e harness target (foodguard-220); `light` runs a few at once, admitted by free memory — specs by file or relation, a
@@ -79,6 +124,19 @@ export interface WorkspaceActionInput {
79
124
  themes?: Array<'light' | 'dark'>;
80
125
  compare?: boolean;
81
126
  };
127
+ /**
128
+ * e2e of a job the checkout's `lensmcp.json` declares (`jobs.<name>`; planning/docker § 1): the job's own command,
129
+ * admitted and run as `lensmcp queue run --job <name>` is — by the memory it declares on the Mac and in Docker's
130
+ * VM, under a Compose project of its own, taken down however it ends. The run carries its {@link WorkspaceActionRun.docker} block.
131
+ */
132
+ job?: string;
133
+ /**
134
+ * Where a {@link job}'s run goes (planning/docker §§ 11–12, slice D26): `local` — this Mac —, `auto` — placement
135
+ * chooses once a worker Mac is paired, and this Mac when none is —, or a paired worker Mac's name. Left out: this Mac.
136
+ * On a worker the checkout is shipped as a candidate (its commit, one diff of its uncommitted changes, the job's
137
+ * declared inputs); the action follows the run there and its verdict is the action's ({@link WorkspaceActionRun.placedOn}).
138
+ */
139
+ host?: string;
82
140
  }
83
141
  export interface WorkspaceBenchmarkRoute {
84
142
  method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
@@ -311,6 +369,50 @@ export interface WorkspaceActionRun {
311
369
  };
312
370
  resultRef: string;
313
371
  retentionDays: number;
372
+ /**
373
+ * A declared job's run (`input.job`): what its containers hold against their budget, the kills, Docker's VM, its
374
+ * stage and URL, what its cleanup left ({@link DockerRunBlock}) — the run's record in this home's registry as it
375
+ * stands when the status is read. Before the queue let it in: its id and its job alone. A run on a worker
376
+ * ({@link host}) carries the block its worker last told of it: its containers are in that worker's VM.
377
+ */
378
+ docker?: DockerRunBlock;
379
+ /** It runs, or ran, on a worker Mac ({@link RunHost}) — none: on this one. Its evidence streamed here as it happened. */
380
+ host?: RunHost;
381
+ /** What of its evidence reached its cap, past which nothing was kept ({@link RunShortened}). */
382
+ shortened?: RunShortened;
383
+ /** A run lost with its worker: whether it was placed again, once, elsewhere — and why, or why not ({@link RunRetry}). */
384
+ retry?: RunRetry;
385
+ /** A job's run this action placed on a worker Mac (slice D26): the run there, whose verdict, steps and proof are this action's ({@link RunPlacedOn}). */
386
+ placedOn?: RunPlacedOn;
387
+ }
388
+ /**
389
+ * The run on a worker Mac an action of a job followed (planning/docker § 12, slice D26) — `workspace_action_run { job,
390
+ * host }`, or a package's proof that names a host. The peer hub records the worker's run as a workspace action of its
391
+ * own (`runId`, its id on the channel `run`, slice D16); the action that placed it takes that run's verdict, steps and
392
+ * evidence when it ends, and the organizer's judgement of the proof the worker made.
393
+ */
394
+ export interface RunPlacedOn {
395
+ /** The worker's run as this Mac recorded it (`wa_…`), and its id on the channel and on the worker (`q_…`). */
396
+ runId: string;
397
+ run: string;
398
+ /**
399
+ * The checkout was shipped with changes — a commit plus one diff of what it had not committed —, so the run was a
400
+ * TEST run: it makes no proof, whatever it passed. Why it was not its exact commit.
401
+ */
402
+ testRun?: string;
403
+ }
404
+ /**
405
+ * What became of a run lost with its worker (planning/docker/00-plan.md § 10 «one retry elsewhere», slice D22): placed
406
+ * again ONCE, on another Mac, as the run `next` — or not, and why: a second loss, a paid run, or a job its manifest does
407
+ * not mark `retryable`. A reader that sees it placed again follows `next` rather than running the job again.
408
+ */
409
+ export interface RunRetry {
410
+ at: number;
411
+ /** It was placed again — never on the worker it was lost on. */
412
+ placed: boolean;
413
+ why: string;
414
+ /** The run that takes it up (its `q_…` id), when it was placed again. */
415
+ next?: string;
314
416
  }
315
417
  export interface WorkspaceActionQueue {
316
418
  lane: WorkspaceActionLane;
@@ -320,3 +422,4 @@ export interface WorkspaceActionQueue {
320
422
  waitedMs?: number;
321
423
  }
322
424
  import type { ProofEvidence } from './proof.js';
425
+ import type { DockerRunBlock } from './docker-runs.js';
@@ -1 +1 @@
1
- "use strict";export{};
1
+ "use strict";export const WORKSPACE_ACTION_ENDS=["passed","failed","errored","cancelled","timeout","lost"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.26.2",
3
+ "version": "1.26.4",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",