@lensmcp/protocol-types 1.26.12 → 1.26.14

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 CHANGED
@@ -53,6 +53,7 @@ export * from './lib/peers.js';
53
53
  export * from './lib/hosts.js';
54
54
  export * from './lib/cluster-hosts.js';
55
55
  export * from './lib/dashboard-updates.js';
56
+ export * from './lib/accounts.js';
56
57
  export * from './lib/host-agents.js';
57
58
  export * from './lib/remote-instances.js';
58
59
  export * from './lib/team.js';
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/dashboard-path.js";export*from"./lib/dashboard-lint.js";export*from"./lib/dashboard-typecheck.js";export*from"./lib/lint-coverage.js";export*from"./lib/static-checks.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/expected-failure.js";export*from"./lib/error-verdict.js";export*from"./lib/finding-proof.js";export*from"./lib/error-cause.js";export*from"./lib/metrics-reset.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-cache-facts.js";export*from"./lib/ai-cache.js";export*from"./lib/ai-cache-verdict.js";export*from"./lib/ai-together.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.js";export*from"./lib/ai-compare.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";export*from"./lib/docker-jobs.js";export*from"./lib/docker-report.js";export*from"./lib/docker-runs.js";export*from"./lib/docker-errors.js";export*from"./lib/peers.js";export*from"./lib/hosts.js";export*from"./lib/cluster-hosts.js";export*from"./lib/dashboard-updates.js";export*from"./lib/host-agents.js";export*from"./lib/remote-instances.js";export*from"./lib/team.js";export*from"./lib/sessions.js";export*from"./lib/backlog.js";export*from"./lib/team-review-changes.js";export*from"./lib/goal-outcome.js";export*from"./lib/role-fidelity.js";export*from"./lib/goal-retro.js";export*from"./lib/follow-ups.js";export*from"./lib/changes.js";export*from"./lib/main-mirror.js";export*from"./lib/team-design.js";export*from"./lib/team-library.js";export*from"./lib/team-skills.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";export*from"./lib/goal-design.js";export*from"./lib/overseer-messages.js";export*from"./lib/team-roadmap.js";export*from"./lib/team-prompts.js";export{PROOF_ACTIONS,NOT_RUN_KINDS}from"./lib/team-delivery.js";
1
+ "use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/dashboard-path.js";export*from"./lib/dashboard-lint.js";export*from"./lib/dashboard-typecheck.js";export*from"./lib/lint-coverage.js";export*from"./lib/static-checks.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/expected-failure.js";export*from"./lib/error-verdict.js";export*from"./lib/finding-proof.js";export*from"./lib/error-cause.js";export*from"./lib/metrics-reset.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-cache-facts.js";export*from"./lib/ai-cache.js";export*from"./lib/ai-cache-verdict.js";export*from"./lib/ai-together.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.js";export*from"./lib/ai-compare.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";export*from"./lib/docker-jobs.js";export*from"./lib/docker-report.js";export*from"./lib/docker-runs.js";export*from"./lib/docker-errors.js";export*from"./lib/peers.js";export*from"./lib/hosts.js";export*from"./lib/cluster-hosts.js";export*from"./lib/dashboard-updates.js";export*from"./lib/accounts.js";export*from"./lib/host-agents.js";export*from"./lib/remote-instances.js";export*from"./lib/team.js";export*from"./lib/sessions.js";export*from"./lib/backlog.js";export*from"./lib/team-review-changes.js";export*from"./lib/goal-outcome.js";export*from"./lib/role-fidelity.js";export*from"./lib/goal-retro.js";export*from"./lib/follow-ups.js";export*from"./lib/changes.js";export*from"./lib/main-mirror.js";export*from"./lib/team-design.js";export*from"./lib/team-library.js";export*from"./lib/team-skills.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";export*from"./lib/goal-design.js";export*from"./lib/overseer-messages.js";export*from"./lib/team-roadmap.js";export*from"./lib/team-prompts.js";export{PROOF_ACTIONS,NOT_RUN_KINDS}from"./lib/team-delivery.js";
@@ -0,0 +1,60 @@
1
+ /**
2
+ * The Accounts page (planning/accounts/00-plan.md): every sign-in agents run under, one row each — the client's own
3
+ * sign-ins included — with its nickname, status and quota. `GET /api/accounts` answers it as `rows`, beside the fields
4
+ * the older accounts card reads.
5
+ */
6
+ export type DashAccountClient = 'claude' | 'codex';
7
+ /**
8
+ * One quota window as the row shows it. `usedPercent` is what the client said at `DashAccountRow.readAt`; `reset`: its
9
+ * reset time has passed since — the page reads it 0 %, not the old number.
10
+ */
11
+ export interface DashAccountWindow {
12
+ /** `5-hour`, `weekly`, `weekly Fable`… as the client names it. */
13
+ name: string;
14
+ usedPercent: number;
15
+ resetsAt?: number;
16
+ minutes?: number;
17
+ reset?: true;
18
+ }
19
+ /**
20
+ * - `ready`: signed in, not out of quota.
21
+ * - `out-of-quota`: a window is full or the client said its limit was reached — until `DashAccountRow.until`.
22
+ * - `sign-in-needed`: not signed in (never, or its sign-in ended).
23
+ * - `signing-in`: the client's sign-in runs now (the dashboard started it).
24
+ */
25
+ export type DashAccountStatus = 'ready' | 'out-of-quota' | 'sign-in-needed' | 'signing-in';
26
+ export interface DashAccountRow {
27
+ /** `ac-…`, or `own:claude` / `own:codex` for the client's own sign-in (`~/.claude`, `~/.codex`). */
28
+ id: string;
29
+ /** What the terminal calls it: `lensmcp agent <nick>`. The own sign-ins are `claude` and `codex`. */
30
+ nick: string;
31
+ client: DashAccountClient;
32
+ /** Its name — «The client's own sign-in» for an own one. */
33
+ label: string;
34
+ own?: true;
35
+ /** The plan as the client names it (`Max 20×`, `Team`, `Business`…), when known. */
36
+ plan?: string;
37
+ /** New launches of its client use it (`lensmcp claude`, a goal with no account). */
38
+ default?: true;
39
+ /** Kept for the person's own sessions: no team agent runs on it; `run` starts the client on it by hand. */
40
+ standalone?: {
41
+ run: string;
42
+ };
43
+ status: DashAccountStatus;
44
+ /** Why, in a sentence — the client's words when it said why. */
45
+ statusWhy?: string;
46
+ /** `out-of-quota` until then. */
47
+ until?: number;
48
+ /** Its quota windows, shortest first; empty when never read. */
49
+ windows: DashAccountWindow[];
50
+ /** When `windows` were read, and how (`codex app-server`, `anthropic oauth usage`, `claude status line`). */
51
+ readAt?: number;
52
+ readHow?: string;
53
+ /** Why the newest read failed, when it did — `windows` are then the last good reading. */
54
+ readWhy?: string;
55
+ /** While its sign-in runs: when it started, and the link the client printed. */
56
+ signingIn?: {
57
+ startedAt: number;
58
+ link?: string;
59
+ };
60
+ }
@@ -0,0 +1 @@
1
+ "use strict";export{};
@@ -3,7 +3,7 @@ import type { HostAgentsView } from './host-agents.js';
3
3
  import type { HostLinkView, HostVersionView } from './hosts.js';
4
4
  /**
5
5
  * CLUSTER › HOSTS — what the dashboard's `GET /api/cluster/hosts` answers (planning/docker/00-plan.md § 11 «The
6
- * dashboard», slice D23; issues/open/overseer-74): every host placement places on — this Mac first, then each paired
6
+ * dashboard», slice D23; issues/closed/overseer-74): every host placement places on — this Mac first, then each paired
7
7
  * worker — with its memory and Docker's VM as it last said them, what its machine queue runs and holds waiting, and the
8
8
  * runs this Mac placed there; the jobs waiting at the organizer for a host, with each host's reason; and the
9
9
  * placement's decisions, the newest first. Settings › Hosts (slice D19) pairs and revokes; this page only reads.
@@ -1,6 +1,6 @@
1
1
  import type { WorkspaceActionLane } from './workspace-actions.js';
2
2
  /**
3
- * The Docker work LensMCP runs (planning/docker/00-plan.md, issues/open/overseer-74): what its slices share. A gate
3
+ * The Docker work LensMCP runs (planning/docker/00-plan.md, issues/closed/overseer-74): what its slices share. A gate
4
4
  * stack's containers live in Docker's VM, whose memory the Mac gave away when the VM started — so the machine queue,
5
5
  * which admits by the host's free memory, was blind to them, and a stack started into an OOM that killed the engine.
6
6
  *
@@ -3,7 +3,7 @@ import { type DockerReportService, type DockerRunReport } from './docker-report.
3
3
  import type { RunHost, RunShortened, WorkspaceActionQueue, WorkspaceActionState } from './workspace-actions.js';
4
4
  /**
5
5
  * THE RUNS OF A HOME, AS EVERY SURFACE SHOWS THEM (planning/docker/00-plan.md §§ 1, 4 and 6, slice D9;
6
- * issues/open/overseer-74). A run is shown in four places — `lensmcp docker report`, `lensmcp docker ps`, the
6
+ * issues/closed/overseer-74). A run is shown in four places — `lensmcp docker report`, `lensmcp docker ps`, the
7
7
  * `docker` block of `workspace_action_status`, and Cluster › Docker — and each of them is made here, out of the ONE
8
8
  * reading of a run's record there is ({@link dockerRunReport}). None computes a figure again: a list is reports in
9
9
  * an order, the block is a report cut to what an agent's answer holds, the page draws reports. So no two of them can
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ACCOUNTS AND LIMITS PER HOST (planning/docker/00-plan.md § 13 «Accounts and goal power», slice D31;
3
- * issues/open/overseer-74). Each Mac has its own sign-ins: a worker reports its accounts — id, client, label, whether it
3
+ * issues/closed/overseer-74). Each Mac has its own sign-ins: a worker reports its accounts — id, client, label, whether it
4
4
  * is standalone, which one is selected per client, its quota stop and its usage — in its capacity advert (`agents`),
5
5
  * and the organizer reads that part field by field before it keeps it, per host. NEVER a token, never the path of a
6
6
  * sign-in's folder: the advert names an account by its id and label only, and a part that carries anything shaped like
package/lib/hosts.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { PairingWindowView, PeerPinState, PeerWords } from './peers.js';
2
2
  /**
3
3
  * SETTINGS › HOSTS — what the dashboard's `GET /api/hosts` answers, and its actions' answers (planning/docker/00-plan.md
4
- * §§ 7, 9 and 11 «The dashboard», slice D19; issues/open/overseer-74).
4
+ * §§ 7, 9 and 11 «The dashboard», slice D19; issues/closed/overseer-74).
5
5
  *
6
6
  * On the organizer: this Mac's identity, the peer hub (listening where and why, or not and why), the pairing window
7
7
  * (never its code), the workers — waiting for the person's approval with their four words, or paired with their link
package/lib/peers.d.ts CHANGED
@@ -3,7 +3,7 @@ import { type DockerRunState, type DockerVmRead, type LensJobLinkLoss } from './
3
3
  import type { HostAgentsAdvert } from './host-agents.js';
4
4
  import type { WorkspaceActionLane, WorkspaceActionState } from './workspace-actions.js';
5
5
  /**
6
- * WORKER MACS — the peer contract (planning/docker/00-plan.md §§ 7–10 and «The contract»; issues/open/overseer-74).
6
+ * WORKER MACS — the peer contract (planning/docker/00-plan.md §§ 7–10 and «The contract»; issues/closed/overseer-74).
7
7
  * The organizer is this Mac's LensMCP; a worker is the same LensMCP on another Mac, that runs the organizer's work.
8
8
  * What the slices of Phase 2 share is here: who a peer is, what each side pins, the pairing exchange, and the control
9
9
  * messages of the channel — one discriminated union, each message an envelope with `v: 1`, an id and, for a reply,
@@ -861,7 +861,6 @@ export declare const PeerErrorBodySchema: z.ZodObject<{
861
861
  code: z.ZodEnum<{
862
862
  timeout: "timeout";
863
863
  lost: "lost";
864
- refused: "refused";
865
864
  "unknown-type": "unknown-type";
866
865
  "wrong-direction": "wrong-direction";
867
866
  "bad-message": "bad-message";
@@ -869,6 +868,7 @@ export declare const PeerErrorBodySchema: z.ZodObject<{
869
868
  "not-handled": "not-handled";
870
869
  "too-large": "too-large";
871
870
  busy: "busy";
871
+ refused: "refused";
872
872
  internal: "internal";
873
873
  "no-window": "no-window";
874
874
  "window-used": "window-used";
@@ -910,7 +910,6 @@ export declare const PEER_BODY_SCHEMAS: {
910
910
  code: z.ZodEnum<{
911
911
  timeout: "timeout";
912
912
  lost: "lost";
913
- refused: "refused";
914
913
  "unknown-type": "unknown-type";
915
914
  "wrong-direction": "wrong-direction";
916
915
  "bad-message": "bad-message";
@@ -918,6 +917,7 @@ export declare const PEER_BODY_SCHEMAS: {
918
917
  "not-handled": "not-handled";
919
918
  "too-large": "too-large";
920
919
  busy: "busy";
920
+ refused: "refused";
921
921
  internal: "internal";
922
922
  "no-window": "no-window";
923
923
  "window-used": "window-used";
@@ -976,7 +976,6 @@ export declare const PAIR_BODY_SCHEMAS: {
976
976
  code: z.ZodEnum<{
977
977
  timeout: "timeout";
978
978
  lost: "lost";
979
- refused: "refused";
980
979
  "unknown-type": "unknown-type";
981
980
  "wrong-direction": "wrong-direction";
982
981
  "bad-message": "bad-message";
@@ -984,6 +983,7 @@ export declare const PAIR_BODY_SCHEMAS: {
984
983
  "not-handled": "not-handled";
985
984
  "too-large": "too-large";
986
985
  busy: "busy";
986
+ refused: "refused";
987
987
  internal: "internal";
988
988
  "no-window": "no-window";
989
989
  "window-used": "window-used";
@@ -1167,10 +1167,10 @@ export declare const MAIN_MIRROR_SCHEMAS: {
1167
1167
  }, z.core.$strict>;
1168
1168
  verdict: z.ZodOptional<z.ZodObject<{
1169
1169
  state: z.ZodEnum<{
1170
- waiting: "waiting";
1171
1170
  refused: "refused";
1172
1171
  "in-main": "in-main";
1173
1172
  "brought-in": "brought-in";
1173
+ waiting: "waiting";
1174
1174
  "not-ff": "not-ff";
1175
1175
  }>;
1176
1176
  count: z.ZodNumber;
@@ -1210,11 +1210,11 @@ export declare const MAIN_MIRROR_SCHEMAS: {
1210
1210
  }>;
1211
1211
  update: z.ZodOptional<z.ZodObject<{
1212
1212
  outcome: z.ZodEnum<{
1213
- waiting: "waiting";
1214
1213
  refused: "refused";
1215
- current: "current";
1214
+ waiting: "waiting";
1216
1215
  "fast-forward": "fast-forward";
1217
1216
  merged: "merged";
1217
+ current: "current";
1218
1218
  conflicts: "conflicts";
1219
1219
  }>;
1220
1220
  at: z.ZodNumber;
@@ -1243,10 +1243,10 @@ export declare const MAIN_MIRROR_ANSWER_SCHEMAS: {
1243
1243
  why: z.ZodOptional<z.ZodString>;
1244
1244
  verdict: z.ZodOptional<z.ZodObject<{
1245
1245
  state: z.ZodEnum<{
1246
- waiting: "waiting";
1247
1246
  refused: "refused";
1248
1247
  "in-main": "in-main";
1249
1248
  "brought-in": "brought-in";
1249
+ waiting: "waiting";
1250
1250
  "not-ff": "not-ff";
1251
1251
  }>;
1252
1252
  count: z.ZodNumber;
@@ -1329,11 +1329,11 @@ export declare const PEER_WORK_SCHEMAS: {
1329
1329
  runId: z.ZodString;
1330
1330
  at: z.ZodNumber;
1331
1331
  state: z.ZodEnum<{
1332
- errored: "errored";
1333
1332
  passed: "passed";
1334
1333
  failed: "failed";
1335
1334
  cancelled: "cancelled";
1336
1335
  timeout: "timeout";
1336
+ errored: "errored";
1337
1337
  }>;
1338
1338
  note: z.ZodOptional<z.ZodString>;
1339
1339
  step: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1426,10 +1426,10 @@ export declare const PEER_WORK_SCHEMAS: {
1426
1426
  }, z.core.$strict>;
1427
1427
  why: z.ZodObject<{
1428
1428
  kind: z.ZodEnum<{
1429
- restarting: "restarting";
1430
1429
  protocol: "protocol";
1431
1430
  version: "version";
1432
1431
  installed: "installed";
1432
+ restarting: "restarting";
1433
1433
  "install-failed": "install-failed";
1434
1434
  "restart-failed": "restart-failed";
1435
1435
  "no-store": "no-store";
@@ -1491,18 +1491,18 @@ export declare const StoreReplySchema: z.ZodObject<{
1491
1491
  result: z.ZodOptional<z.ZodUnknown>;
1492
1492
  error: z.ZodOptional<z.ZodObject<{
1493
1493
  name: z.ZodEnum<{
1494
- Error: "Error";
1495
1494
  CoordinationError: "CoordinationError";
1496
1495
  CapacityRefusal: "CapacityRefusal";
1497
1496
  CoordinationBusyError: "CoordinationBusyError";
1498
1497
  StoreCallRefused: "StoreCallRefused";
1498
+ Error: "Error";
1499
1499
  }>;
1500
1500
  message: z.ZodString;
1501
1501
  room: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1502
1502
  step: z.ZodOptional<z.ZodEnum<{
1503
1503
  open: "open";
1504
- commit: "commit";
1505
1504
  write: "write";
1505
+ commit: "commit";
1506
1506
  read: "read";
1507
1507
  }>>;
1508
1508
  waitedMs: z.ZodOptional<z.ZodNumber>;
@@ -1592,8 +1592,8 @@ export declare const PEER_LAUNCH_SCHEMAS: {
1592
1592
  state: z.ZodEnum<{
1593
1593
  running: "running";
1594
1594
  failed: "failed";
1595
- stopped: "stopped";
1596
1595
  exited: "exited";
1596
+ stopped: "stopped";
1597
1597
  }>;
1598
1598
  at: z.ZodNumber;
1599
1599
  pid: z.ZodOptional<z.ZodNumber>;
@@ -1798,9 +1798,9 @@ export declare const GOAL_PEER_SCHEMAS: {
1798
1798
  sha256: z.ZodString;
1799
1799
  }, z.core.$strict>;
1800
1800
  services: z.ZodOptional<z.ZodEnum<{
1801
- always: "always";
1802
1801
  none: "none";
1803
1802
  "on-demand": "on-demand";
1803
+ always: "always";
1804
1804
  }>>;
1805
1805
  at: z.ZodNumber;
1806
1806
  }, z.core.$strict>;
@@ -1817,8 +1817,8 @@ export declare const GOAL_PEER_SCHEMAS: {
1817
1817
  what: z.ZodEnum<{
1818
1818
  files: "files";
1819
1819
  commit: "commit";
1820
- diff: "diff";
1821
1820
  row: "row";
1821
+ diff: "diff";
1822
1822
  commits: "commits";
1823
1823
  against: "against";
1824
1824
  }>;
@@ -1859,10 +1859,10 @@ export declare const GOAL_PEER_ANSWER_SCHEMAS: {
1859
1859
  ref: z.ZodString;
1860
1860
  sha: z.ZodOptional<z.ZodString>;
1861
1861
  mirror: z.ZodOptional<z.ZodEnum<{
1862
- created: "created";
1863
- current: "current";
1864
1862
  "not-ff": "not-ff";
1865
1863
  "fast-forward": "fast-forward";
1864
+ current: "current";
1865
+ created: "created";
1866
1866
  "checked-out": "checked-out";
1867
1867
  }>>;
1868
1868
  told: z.ZodOptional<z.ZodString>;
@@ -1879,10 +1879,10 @@ export declare const GOAL_PEER_ANSWER_SCHEMAS: {
1879
1879
  readonly 'goal.update': z.ZodObject<{
1880
1880
  outcome: z.ZodEnum<{
1881
1881
  refused: "refused";
1882
- current: "current";
1883
- asked: "asked";
1884
1882
  merged: "merged";
1883
+ current: "current";
1885
1884
  conflicts: "conflicts";
1885
+ asked: "asked";
1886
1886
  }>;
1887
1887
  why: z.ZodString;
1888
1888
  sha: z.ZodOptional<z.ZodString>;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * REMOTE INSTANCES — a goal's runtime on a worker Mac, opened from the organizer's URLs (planning/docker/00-plan.md § 13
3
- * «The lens for a remote goal's runtime», slice D35; issues/open/overseer-74). What the peer hub (`apps/agent`
3
+ * «The lens for a remote goal's runtime», slice D35; issues/closed/overseer-74). What the peer hub (`apps/agent`
4
4
  * `peers/remote-instance.ts`) and the dev gateway (`@lensmcp/cluster` `runtime/remote-instances.ts`) share:
5
5
  *
6
6
  * - the route the hub asks of the organizer's gateway on its control socket (`POST/GET/DELETE /remote-instance`) — the
package/lib/sessions.d.ts CHANGED
@@ -42,6 +42,12 @@ export interface DashClientSession {
42
42
  };
43
43
  resumedFrom?: string;
44
44
  on?: DashTeamHostMark;
45
+ /**
46
+ * The session that started it, as a row id of this list, when known (planning/accounts A0): a `codex exec` a Claude
47
+ * session ran (its hooks saw the parent's `CLAUDE_CODE_SESSION_ID`), a Codex sub-agent (its rollout's parent thread).
48
+ * The Accounts page nests a row under its parent.
49
+ */
50
+ parentId?: string;
45
51
  }
46
52
  export interface DashClientSessionsAnswer {
47
53
  terminals: DashTerminalsState;
@@ -121,10 +127,20 @@ export interface DashClientSessionContext {
121
127
  trigger?: string;
122
128
  }>;
123
129
  }
124
- /** A subagent of the session, as its parent's transcript and its own name it; `live`: running now. */
130
+ /**
131
+ * A subagent of the session, as its parent's transcript and its own name it; `live`: running now. With `session`: a
132
+ * session of its own that this one started (planning/accounts A0) — a `codex exec` its shell ran — not one of its
133
+ * client's own subagents: a row of `/api/sessions` (its `parentId` is this session), whose page is its own.
134
+ */
125
135
  export type DashClientSessionSubagent = DashTeamAgentDetail['spawned'][number] & {
126
136
  live: boolean;
127
137
  lastAt?: number;
138
+ session?: {
139
+ id: string;
140
+ client: DashClientSessionClient;
141
+ kind: DashClientSessionKind;
142
+ state: DashClientSessionState;
143
+ };
128
144
  };
129
145
  /** The skills the client listed to the model, the role's kit it was given, and those it used. */
130
146
  export interface DashClientSessionSkills {
@@ -136,6 +136,54 @@ export interface TeamDesignBasis {
136
136
  projects: string[];
137
137
  trackedFiles: number;
138
138
  at: number;
139
+ /**
140
+ * The team's files as the run read them (planning/team/27): `.lensmcp/team/…` path → sha256 of its text. A file whose
141
+ * text is not this any more changed after the run read it — accepting the run's version of it overwrites that change.
142
+ * Absent on runs made before it was kept: those are compared by the file's modification time against the run's start.
143
+ */
144
+ teamFiles?: Record<string, string>;
145
+ }
146
+ /**
147
+ * What a change does to one role file, counted by LensMCP from the file before and after it, with no model
148
+ * (planning/team/27) — so the person reads «+12 skills, −290 characters of rules» instead of a diff. Each field is
149
+ * there only when it moves; `[before, after]` pairs, and lists of what was added and what was removed.
150
+ */
151
+ export interface TeamFileEffect {
152
+ /** The file is new (no file before), or goes (no file after). */
153
+ created?: true;
154
+ deleted?: true;
155
+ /** Characters of the role's own rules (its `<rules>` sections), before → after. */
156
+ rulesChars?: [number, number];
157
+ /** Rule sections (`<rules id=…>`) added and removed, by id. */
158
+ sections?: {
159
+ added: string[];
160
+ removed: string[];
161
+ };
162
+ skills?: {
163
+ added: string[];
164
+ removed: string[];
165
+ };
166
+ /** Tool lines added and removed, and the tools whose reason changed. */
167
+ tools?: {
168
+ added: string[];
169
+ removed: string[];
170
+ reasons: string[];
171
+ };
172
+ owns?: {
173
+ added: string[];
174
+ removed: string[];
175
+ };
176
+ takes?: {
177
+ added: string[];
178
+ removed: string[];
179
+ };
180
+ base?: [string | null, string | null];
181
+ agents?: [number | null, number | null];
182
+ model?: [string | null, string | null];
183
+ effort?: [string | null, string | null];
184
+ start?: [string | null, string | null];
185
+ /** The file is not a role file (the brief): its characters, before → after. */
186
+ chars?: [number, number];
139
187
  }
140
188
  export interface TeamDesign {
141
189
  version: typeof TEAM_DESIGN_VERSION;
@@ -185,6 +233,11 @@ export interface DashTeamDesignRun {
185
233
  files: string[];
186
234
  goals: string[];
187
235
  };
236
+ /**
237
+ * A done design not accepted yet, against the team as it is NOW (planning/team/27): per role what accepting it would
238
+ * change in that role's file, and what it would undo. Worked out on every read with no model; never kept.
239
+ */
240
+ now?: DashTeamDesignNow;
188
241
  /**
189
242
  * How its research went, from the run's record: the tool calls it made of the most it had, its ceiling, its turns,
190
243
  * and why it ended — Claude answered on its own, the ceiling asked for the answer, or the tool calls ran out.
@@ -197,6 +250,46 @@ export interface DashTeamDesignRun {
197
250
  ended: 'answered' | 'ceiling' | 'tool-calls';
198
251
  };
199
252
  }
253
+ /** One role of a design against its file now: what accepting that role would write over what is there. */
254
+ export interface DashTeamDesignRoleNow {
255
+ id: string;
256
+ /** `.lensmcp/team/roles/<id>.md`. */
257
+ file: string;
258
+ /** `new`: no file; `replaces`: the repository's own file, rewritten whole; `refines`: a LensMCP default refined. */
259
+ is: 'new' | 'replaces' | 'refines';
260
+ /** The file now → the file accepting writes. */
261
+ effect: TeamFileEffect;
262
+ /** The file changed after the design read it (its hash, or its modification time on an older run). */
263
+ changedSince?: true;
264
+ /** Tune changes written to this file after the design ran: accepting the role writes over them. */
265
+ undoes?: Array<{
266
+ runId: string;
267
+ id: string;
268
+ title: string;
269
+ }>;
270
+ }
271
+ /** A role the design switches off, and the file that goes (the repository's own) or the default that stops. */
272
+ export interface DashTeamDesignOffNow {
273
+ id: string;
274
+ file: string;
275
+ exists: boolean;
276
+ changedSince?: true;
277
+ }
278
+ export interface DashTeamDesignNow {
279
+ roles: DashTeamDesignRoleNow[];
280
+ off: DashTeamDesignOffNow[];
281
+ /** The brief the design writes, against `.lensmcp/team/project.md` now. */
282
+ brief?: {
283
+ exists: boolean;
284
+ effect: TeamFileEffect;
285
+ changedSince?: true;
286
+ };
287
+ /** The flow file, when the design changes the flow (`keep: false`). */
288
+ flow?: {
289
+ exists: boolean;
290
+ changedSince?: true;
291
+ };
292
+ }
200
293
  /** What the person keeps of a design. Roles they edited carry their own rules. */
201
294
  export interface DashTeamDesignAccept {
202
295
  runId: string;
@@ -353,7 +446,8 @@ export type TeamCheckupGroup = (typeof TEAM_CHECKUP_GROUPS)[number];
353
446
  * `old-flow`, `duplicate-of-base`, `filler-reason`, `cap-mismatch`, `copied`, `check-unread`, `failed-twice`,
354
447
  * `lesson-stale`;
355
448
  * - skills — `skills-unheld`: project skills no role holds; `role-without-skills`: a role whose kind of work has
356
- * project skills and holds none, with a proposed assignment;
449
+ * project skills and holds none — a finding with the names that match, never a patch: names are not the skills'
450
+ * descriptions, and «Tune the team» reads those (planning/team/27 F2);
357
451
  * - weight — `heavy-instructions`: an instruction file an agent's client loads, past 40,000 characters; `heavy-rules`:
358
452
  * a role file's rules past the length a join carries well; `past-cut`, `long-craft`: text a join cuts or carries long;
359
453
  * - proposals — `open-proposal`: a retrospective's or the overseer's open proposal about the team's files.
@@ -371,8 +465,9 @@ export interface TeamCheckupEdit {
371
465
  }
372
466
  /**
373
467
  * A ready patch to one team file. `safe`: mechanical — it changes no rule and takes no tool or skill a role uses (a
374
- * filler reason replaced by the library's own, a name that resolves nowhere removed, the base's version recorded). A
375
- * patch that is not safe is a proposal (a skills assignment): the person picks it by itself.
468
+ * filler tool line removed where the role's base names the tool, or its reason replaced by the one reason the base's
469
+ * family gives it — planning/team/27 F3; a name that resolves nowhere removed; the base's version recorded). A patch
470
+ * that is not safe is one the person picks by itself (a moved base).
376
471
  */
377
472
  export interface TeamCheckupPatch {
378
473
  file: string;
@@ -496,6 +591,21 @@ export interface TeamTuneChange {
496
591
  at: number;
497
592
  problem?: string;
498
593
  };
594
+ /**
595
+ * The change against its file as it is NOW, worked out by LensMCP on every read with no model (planning/team/27) —
596
+ * on a change with no verdict, or accepted but not written; never kept. `changed`: the file is not what the tune read
597
+ * for this change (the diff made now differs from `diff`). `applies`: its edits still stand once and the file still
598
+ * loads after them — else `problem` says why, and accepting would not write it: the page offers to tune again.
599
+ * `diff`: against the file as it is now, when it changed and still applies.
600
+ */
601
+ now?: {
602
+ changed: boolean;
603
+ applies: boolean;
604
+ problem?: string;
605
+ diff?: string;
606
+ };
607
+ /** What it does to its file (against the file as it is now when `now` is set). */
608
+ effect?: TeamFileEffect;
499
609
  }
500
610
  /** A tune's answer, as LensMCP checked it: a change set, never whole roles. */
501
611
  export interface TeamTune {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.26.12",
3
+ "version": "1.26.14",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",