@lensmcp/protocol-types 1.26.2 → 1.26.3

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.
Files changed (63) hide show
  1. package/index.d.ts +13 -1
  2. package/index.js +1 -1
  3. package/lib/ai-call-groups.js +2 -2
  4. package/lib/ai-call-row.js +3 -3
  5. package/lib/ai-call.js +9 -9
  6. package/lib/ai-context.js +6 -6
  7. package/lib/ai-origins.js +9 -9
  8. package/lib/bounded-clone.js +1 -1
  9. package/lib/bounded-map.js +1 -1
  10. package/lib/bounded-writer.js +1 -1
  11. package/lib/capture-demand.js +1 -1
  12. package/lib/changes.d.ts +15 -3
  13. package/lib/cluster-hosts.d.ts +272 -0
  14. package/lib/cluster-hosts.js +1 -0
  15. package/lib/dashboard-lint.d.ts +22 -0
  16. package/lib/dashboard-path.js +1 -1
  17. package/lib/dashboard-updates.d.ts +80 -0
  18. package/lib/dashboard-updates.js +1 -0
  19. package/lib/dashboard.d.ts +8 -1
  20. package/lib/docker-errors.d.ts +123 -0
  21. package/lib/docker-errors.js +1 -0
  22. package/lib/docker-jobs.d.ts +673 -0
  23. package/lib/docker-jobs.js +1 -0
  24. package/lib/docker-report.d.ts +99 -0
  25. package/lib/docker-report.js +2 -0
  26. package/lib/docker-runs.d.ts +300 -0
  27. package/lib/docker-runs.js +3 -0
  28. package/lib/error-cause.js +5 -5
  29. package/lib/error-dismissal.js +1 -1
  30. package/lib/event-loop.js +1 -1
  31. package/lib/expected-failure.js +2 -2
  32. package/lib/flood-guard.js +1 -1
  33. package/lib/goal-design.js +1 -1
  34. package/lib/host-agents.d.ts +139 -0
  35. package/lib/host-agents.js +1 -0
  36. package/lib/hosts.d.ts +206 -0
  37. package/lib/hosts.js +1 -0
  38. package/lib/lint-coverage.js +1 -1
  39. package/lib/log-query.js +1 -1
  40. package/lib/main-mirror.d.ts +117 -0
  41. package/lib/main-mirror.js +1 -0
  42. package/lib/metrics-reset.js +1 -1
  43. package/lib/overseer-findings.js +1 -1
  44. package/lib/peers.d.ts +1881 -0
  45. package/lib/peers.js +1 -0
  46. package/lib/perf-rules.js +1 -1
  47. package/lib/pod-memory.js +1 -1
  48. package/lib/producer-health.js +1 -1
  49. package/lib/proof.d.ts +32 -0
  50. package/lib/remote-instances.d.ts +129 -0
  51. package/lib/remote-instances.js +1 -0
  52. package/lib/resources.d.ts +2 -0
  53. package/lib/resources.js +1 -1
  54. package/lib/sources.js +1 -1
  55. package/lib/static-checks.d.ts +290 -0
  56. package/lib/static-checks.js +1 -0
  57. package/lib/system-report.js +1 -1
  58. package/lib/team-delivery.d.ts +13 -0
  59. package/lib/team.d.ts +60 -2
  60. package/lib/team.js +1 -1
  61. package/lib/workspace-actions.d.ts +104 -1
  62. package/lib/workspace-actions.js +1 -1
  63. package/package.json +1 -1
@@ -0,0 +1,290 @@
1
+ /**
2
+ * Static checks — the one answer `lensmcp typecheck` and `lensmcp lint` give, the same in the CLI's `--json`, the MCP
3
+ * tools and the record store (planning/checks/00-plan.md § 1–2; issues: overseer-75).
4
+ *
5
+ * FoodGuard's first Main QA spent 34.4 minutes type checking to find 2 errors from one missing field, and nothing it
6
+ * printed said what had been checked. So an answer here is only the errors — each once, under the project that owns
7
+ * its file — and a coverage block that says what the answer is worth: what was checked, what is stale, what has no
8
+ * producer, and which checkers gave no verdict. A checker that failed is never counted as clean.
9
+ */
10
+ export type StaticCheckKind = 'typecheck' | 'lint';
11
+ /** `warm`: from the checkout's current state. `cold`: at an exact SHA, in a clean checkout. */
12
+ export type StaticCheckMode = 'warm' | 'cold';
13
+ export type StaticCheckVerdict = 'clean' | 'errors' | 'partial' | 'no-verdict';
14
+ /** 0 clean and fully covered · 1 errors · 2 no verdict or incomplete coverage. */
15
+ export type StaticCheckExitCode = 0 | 1 | 2;
16
+ /** How the programs in scope were chosen. `adhoc`: paths handed to `lensmcp lint` as before — never «all». */
17
+ export type ScopeKind = 'changed' | 'all' | 'services' | 'projects' | 'affected' | 'files' | 'diff' | 'adhoc';
18
+ /** How a program is checked: tsgo on the tsconfig as it is, tsgo through the shim, or the workspace's ESLint. */
19
+ export type StaticCheckRoute = 'tsgo-shim' | 'tsgo' | 'eslint';
20
+ export type StaticFindingSeverity = 'error' | 'warning';
21
+ /** The owner of a workspace file no project's root holds. */
22
+ export declare const OWNER_WORKSPACE = "(workspace)";
23
+ /** The owner of a file under `node_modules`, or outside the checkout. */
24
+ export declare const OWNER_EXTERNAL = "(external)";
25
+ /** One type error, once, wherever it was found. Key: (file, line, col, code) — never the message. */
26
+ export interface TypecheckFinding {
27
+ /** Workspace-relative, POSIX. */
28
+ file: string;
29
+ /** 1-based. */
30
+ line: number;
31
+ /** 1-based. */
32
+ col: number;
33
+ /** `TS2322`. */
34
+ code: string;
35
+ severity: StaticFindingSeverity;
36
+ /** The first reporting program's text: tsgo and tsc truncate printed types differently. */
37
+ message: string;
38
+ /** The Nx project that OWNS `file` (longest root prefix), or {@link OWNER_WORKSPACE} / {@link OWNER_EXTERNAL}. */
39
+ project: string;
40
+ /** Every program that reported it, by tsconfig path (sorted). */
41
+ programs: string[];
42
+ }
43
+ /** One lint finding, once. Key: (file, line, col, ruleId). */
44
+ export interface LintFinding {
45
+ file: string;
46
+ line: number;
47
+ col: number;
48
+ /** null: a fatal parse error. */
49
+ ruleId: string | null;
50
+ severity: StaticFindingSeverity;
51
+ message: string;
52
+ /** The owner of `file`. */
53
+ project: string;
54
+ /** The lint units that reported it (sorted). */
55
+ units: string[];
56
+ fixable?: boolean;
57
+ }
58
+ export interface ProjectGroup<F> {
59
+ project: string;
60
+ errorCount: number;
61
+ warningCount: number;
62
+ findings: F[];
63
+ }
64
+ export interface CheckAnswer<F> {
65
+ check: StaticCheckKind;
66
+ mode: StaticCheckMode;
67
+ verdict: StaticCheckVerdict;
68
+ exitCode: StaticCheckExitCode;
69
+ scope: {
70
+ kind: ScopeKind;
71
+ asked: string[];
72
+ inScope: number;
73
+ empty?: true;
74
+ };
75
+ /**
76
+ * Exact, whatever the page holds. `notKept`: findings counted in `errors` / `warnings` that no page lists — a
77
+ * program's record keeps its first 50,000 diagnostics, and counts the rest.
78
+ */
79
+ totals: {
80
+ errors: number;
81
+ warnings: number;
82
+ projects: number;
83
+ notKept?: number;
84
+ };
85
+ /** One page, by project. */
86
+ groups: ProjectGroup<F>[];
87
+ /**
88
+ * `listed`: the listing left out what the caller already shows (lint: the dashboard's Lint page, beside the lens
89
+ * bus's findings), and its pages hold this many in all. `totals`, the verdict and the coverage stay the scope's.
90
+ */
91
+ page: {
92
+ offset: number;
93
+ limit: number;
94
+ nextOffset?: number;
95
+ listed?: number;
96
+ };
97
+ coverage: Coverage;
98
+ /** The checkout the answer reflects. */
99
+ head: {
100
+ sha: string;
101
+ dirty: boolean;
102
+ };
103
+ /** Cold: the exact SHA. */
104
+ sha?: string;
105
+ /** Cold: how many programs started from the last green run's build info, and how many from zero. */
106
+ seeded?: {
107
+ seeded: number;
108
+ fromZero: number;
109
+ };
110
+ /** The caller waited: for how long, how many programs were checked again meanwhile, and how many had their files listed first. */
111
+ waited?: {
112
+ ms: number;
113
+ rechecked: number;
114
+ listed?: number;
115
+ };
116
+ /** A cold run the tool submitted instead of blocking on it. */
117
+ queued?: {
118
+ id: string;
119
+ place: number;
120
+ };
121
+ at: number;
122
+ }
123
+ export interface Coverage {
124
+ inScope: number;
125
+ checked: {
126
+ count: number;
127
+ byRoute: Record<StaticCheckRoute, number>;
128
+ /**
129
+ * Typecheck only: how many of the checked programs were shown to answer as the workspace's own `tsc` does
130
+ * (`lensmcp typecheck --parity`). `programs`: the ones a proof has something to say about and that are not proven —
131
+ * it found a difference, or it no longer stands; a program never proven is counted, not listed. `programsMore`:
132
+ * how many the list leaves out.
133
+ */
134
+ parity: {
135
+ proven: number;
136
+ unproven: number;
137
+ differs: number;
138
+ programs?: ParityNote[];
139
+ programsMore?: number;
140
+ };
141
+ /** Lint only: how many of the checked units started from ESLint's per-file cache — a change in another file is not seen by a cached result. */
142
+ cached?: number;
143
+ oldestVerdictAt?: number;
144
+ /** Only when asked for in detail: 290 items would not fit an agent's answer. */
145
+ items?: CheckedProgram[];
146
+ };
147
+ /** Inputs changed after the last verdict, or never checked. */
148
+ stale: StaleProgram[];
149
+ notCovered: UncoveredProgram[];
150
+ /** Never counted as clean. */
151
+ toolErrors: ToolErrorProgram[];
152
+ }
153
+ /** A checked program whose parity proof says something other than «proven», and what. */
154
+ export interface ParityNote {
155
+ /** The tsconfig path. */
156
+ program: string;
157
+ /** `differs`: tsc and LensMCP's check were compared and do not report the same. `unproven`: its proof no longer stands, or compared nothing. */
158
+ parity: 'unproven' | 'differs';
159
+ why: string;
160
+ }
161
+ export interface CheckedProgram {
162
+ /** The tsconfig path (typecheck) or the unit's name (lint). */
163
+ program: string;
164
+ project: string;
165
+ compiler: {
166
+ name: 'tsgo' | 'eslint';
167
+ version: string;
168
+ };
169
+ route: StaticCheckRoute;
170
+ reflects: {
171
+ sha: string;
172
+ dirty: boolean;
173
+ inputsHash: string;
174
+ };
175
+ at: number;
176
+ durationMs: number;
177
+ peakMb?: number;
178
+ /** `sampled` is a lower bound. */
179
+ peakHow?: 'footprint' | 'maxrss' | 'sampled';
180
+ parity?: 'proven' | 'unproven' | 'differs';
181
+ /** Cold: started from a seed whose inputs matched exactly. */
182
+ seeded?: true;
183
+ /** Lint: ESLint's per-file cache answered — a change in another file is not seen. */
184
+ cached?: true;
185
+ errorCount: number;
186
+ }
187
+ export interface StaleProgram {
188
+ program: string;
189
+ project: string;
190
+ lastVerdictAt?: number;
191
+ lastErrorCount?: number;
192
+ /** The first changed inputs; `changedCount` counts them all. */
193
+ changed: string[];
194
+ changedCount: number;
195
+ }
196
+ export declare const UNCOVERED_REASONS: readonly ["no-route", "needs-build", "tsgo-refused", "parity-unproven", "parity-differs", "held-for-memory", "not-in-census"];
197
+ export type UncoveredReason = (typeof UNCOVERED_REASONS)[number];
198
+ export interface UncoveredProgram {
199
+ program?: string;
200
+ project?: string;
201
+ reason: UncoveredReason;
202
+ detail: string;
203
+ }
204
+ export declare const TOOL_ERROR_KINDS: readonly ["config-refused", "program-error", "timeout", "signal", "exit-without-diagnostics", "spawn-failed", "unparseable-output"];
205
+ export type ToolErrorKind = (typeof TOOL_ERROR_KINDS)[number];
206
+ export interface ToolErrorProgram {
207
+ program: string;
208
+ project: string;
209
+ kind: ToolErrorKind;
210
+ /** The first compiler code, when the tool error has one (`TS18003`). */
211
+ code?: string;
212
+ detail: string;
213
+ at: number;
214
+ }
215
+ /**
216
+ * A type error's identity: where it is and which one — never the message, which tsgo and tsc print differently (a
217
+ * long type is cut at different lengths), and never the program, so one error in a shared file is one finding however
218
+ * many programs reach it.
219
+ */
220
+ export declare function typecheckFindingKey(f: Pick<TypecheckFinding, 'file' | 'line' | 'col' | 'code'>): string;
221
+ /** A lint finding's identity. A fatal parse error has no rule: it is keyed on its position alone. */
222
+ export declare function lintFindingKey(f: Pick<LintFinding, 'file' | 'line' | 'col' | 'ruleId'>): string;
223
+ /** One diagnostic as a program's verdict holds it: `file` workspace-relative POSIX, positions 1-based. */
224
+ export interface ReportedDiagnostic {
225
+ file: string;
226
+ line: number;
227
+ col: number;
228
+ code: string;
229
+ severity: StaticFindingSeverity;
230
+ message: string;
231
+ }
232
+ /** One lint message as a unit's record holds it. */
233
+ export interface ReportedLintMessage {
234
+ file: string;
235
+ line: number;
236
+ col: number;
237
+ ruleId: string | null;
238
+ severity: StaticFindingSeverity;
239
+ message: string;
240
+ fixable?: boolean;
241
+ }
242
+ /**
243
+ * Every program's diagnostics as findings, each once: the message of the first program that reported it (programs are
244
+ * read in the order given), every reporting program listed, and the owner of its file. An error from any program makes
245
+ * the finding an error. Sorted by file, line, col, code.
246
+ */
247
+ export declare function dedupeTypecheckFindings(reports: ReadonlyArray<{
248
+ program: string;
249
+ diagnostics: readonly ReportedDiagnostic[];
250
+ }>, ownerOf: (file: string) => string): TypecheckFinding[];
251
+ /** Every unit's messages as findings, each once — as {@link dedupeTypecheckFindings}, keyed by rule. */
252
+ export declare function dedupeLintFindings(reports: ReadonlyArray<{
253
+ unit: string;
254
+ messages: readonly ReportedLintMessage[];
255
+ }>, ownerOf: (file: string) => string): LintFinding[];
256
+ /** What a verdict is read from: the error findings (lint warnings never count) and what the answer covered. */
257
+ export interface VerdictInput {
258
+ /** `totals.errors`. */
259
+ errors: number;
260
+ coverage: {
261
+ inScope: number;
262
+ checked: {
263
+ count: number;
264
+ };
265
+ stale: readonly unknown[];
266
+ notCovered: readonly unknown[];
267
+ toolErrors: readonly unknown[];
268
+ };
269
+ }
270
+ /**
271
+ * The verdict of an answer.
272
+ *
273
+ * | Case | Verdict |
274
+ * |---|---|
275
+ * | Any error finding | `errors`, whatever the coverage |
276
+ * | A tool error and no error findings | `no-verdict`: a checker that failed needs a look |
277
+ * | Nothing in scope, or nothing checked | `no-verdict`: nothing was verified |
278
+ * | No errors; some stale or not covered | `partial` |
279
+ * | No errors; every program in scope checked and fresh | `clean` |
280
+ *
281
+ * A program in scope that is in none of the lists counts as not covered: `clean` needs every one of them checked.
282
+ */
283
+ export declare function verdictOf(input: VerdictInput): StaticCheckVerdict;
284
+ /**
285
+ * The exit code of a verdict: 0 clean · 1 errors · 2 no verdict or incomplete coverage. `allowPartial` accepts a clean
286
+ * answer that is partly stale or uncovered (0); it never accepts `no-verdict`. A usage error is 2 as well.
287
+ */
288
+ export declare function exitCodeOf(verdict: StaticCheckVerdict, opts?: {
289
+ allowPartial?: boolean;
290
+ }): StaticCheckExitCode;
@@ -0,0 +1 @@
1
+ "use strict";var g=Object.defineProperty;var c=(e,n)=>g(e,"name",{value:n,configurable:!0});var y=Object.defineProperty,u=c((e,n)=>y(e,"name",{value:n,configurable:!0}),"c"),v=Object.defineProperty,l=u((e,n)=>v(e,"name",{value:n,configurable:!0}),"c");export const OWNER_WORKSPACE="(workspace)",OWNER_EXTERNAL="(external)",UNCOVERED_REASONS=["no-route","needs-build","tsgo-refused","parity-unproven","parity-differs","held-for-memory","not-in-census"],TOOL_ERROR_KINDS=["config-refused","program-error","timeout","signal","exit-without-diagnostics","spawn-failed","unparseable-output"];export function typecheckFindingKey(e){return`${e.file}:${e.line}:${e.col}:${e.code}`}c(typecheckFindingKey,"typecheckFindingKey"),u(typecheckFindingKey,"typecheckFindingKey"),l(typecheckFindingKey,"typecheckFindingKey");export function lintFindingKey(e){return`${e.file}:${e.line}:${e.col}:${e.ruleId??""}`}c(lintFindingKey,"lintFindingKey"),u(lintFindingKey,"lintFindingKey"),l(lintFindingKey,"lintFindingKey");const p=l((e,n)=>e.file<n.file?-1:e.file>n.file?1:e.line-n.line||e.col-n.col,"byPosition");export function dedupeTypecheckFindings(e,n){const i=new Map;for(const{program:t,diagnostics:r}of e)for(const o of r){const s=typecheckFindingKey(o),d=i.get(s);if(!d){i.set(s,{file:o.file,line:o.line,col:o.col,code:o.code,severity:o.severity,message:o.message,project:n(o.file),programs:[t]});continue}d.programs.includes(t)||d.programs.push(t),o.severity==="error"&&(d.severity="error")}const f=[...i.values()];for(const t of f)t.programs.sort();return f.sort((t,r)=>p(t,r)||(t.code<r.code?-1:t.code>r.code?1:0))}c(dedupeTypecheckFindings,"dedupeTypecheckFindings"),u(dedupeTypecheckFindings,"dedupeTypecheckFindings"),l(dedupeTypecheckFindings,"dedupeTypecheckFindings");export function dedupeLintFindings(e,n){const i=new Map;for(const{unit:r,messages:o}of e)for(const s of o){const d=lintFindingKey(s),a=i.get(d);if(!a){i.set(d,{file:s.file,line:s.line,col:s.col,ruleId:s.ruleId,severity:s.severity,message:s.message,project:n(s.file),units:[r],...s.fixable?{fixable:!0}:{}});continue}a.units.includes(r)||a.units.push(r),s.severity==="error"&&(a.severity="error")}const f=[...i.values()];for(const r of f)r.units.sort();const t=l(r=>r.ruleId??"","rule");return f.sort((r,o)=>p(r,o)||(t(r)<t(o)?-1:t(r)>t(o)?1:0))}c(dedupeLintFindings,"dedupeLintFindings"),u(dedupeLintFindings,"dedupeLintFindings"),l(dedupeLintFindings,"dedupeLintFindings");export function verdictOf(e){const{errors:n,coverage:i}=e;return n>0?"errors":i.toolErrors.length>0||i.inScope<=0||i.checked.count<=0?"no-verdict":i.stale.length>0||i.notCovered.length>0||i.checked.count<i.inScope?"partial":"clean"}c(verdictOf,"verdictOf"),u(verdictOf,"verdictOf"),l(verdictOf,"verdictOf");export function exitCodeOf(e,n={}){return e==="errors"?1:e==="clean"||e==="partial"&&n.allowPartial?0:2}c(exitCodeOf,"exitCodeOf"),u(exitCodeOf,"exitCodeOf"),l(exitCodeOf,"exitCodeOf");
@@ -1 +1 @@
1
- "use strict";var o=Object.defineProperty;var r=(e,n)=>o(e,"name",{value:n,configurable:!0});var a=Object.defineProperty,s=r((e,n)=>a(e,"name",{value:n,configurable:!0}),"n");export function systemScopeId(e){return e.kind==="machine"?"machine":e.kind==="repository"?`repo:${e.repoId}`:`ws:${e.key}`}r(systemScopeId,"systemScopeId"),s(systemScopeId,"systemScopeId");export function systemItemKey(e,n){return`${systemScopeId(e)}/${n}`}r(systemItemKey,"systemItemKey"),s(systemItemKey,"systemItemKey");export function systemValue(e,n){switch(n){case"bytes":{const t=e/1073741824;return t>=1?`${t.toFixed(t>=100?0:1)} GB`:`${Math.round(e/1024**2)} MB`}case"ms":return e>=1e3?`${(e/1e3).toFixed(1)} s`:`${Math.round(e)} ms`;case"percent":return`${Math.round(e)} %`;case"usd":return`$${e.toFixed(2)}`;case"load":return`load ${e.toFixed(1)}`;case"minutes":return`${Math.round(e)} min`;default:return String(e)}}r(systemValue,"systemValue"),s(systemValue,"systemValue");export function systemScopeLabel(e){return e.kind==="machine"?"machine":e.kind==="repository"?e.name:`${e.name} lens`}r(systemScopeLabel,"systemScopeLabel"),s(systemScopeLabel,"systemScopeLabel");const u={"n/a":0,ok:1,warn:2,bad:3};export function systemStatusRank(e){return u[e]}r(systemStatusRank,"systemStatusRank"),s(systemStatusRank,"systemStatusRank");
1
+ "use strict";var o=Object.defineProperty;var s=(e,t)=>o(e,"name",{value:t,configurable:!0});var u=Object.defineProperty,n=s((e,t)=>u(e,"name",{value:t,configurable:!0}),"r"),c=Object.defineProperty,r=n((e,t)=>c(e,"name",{value:t,configurable:!0}),"n");export function systemScopeId(e){return e.kind==="machine"?"machine":e.kind==="repository"?`repo:${e.repoId}`:`ws:${e.key}`}s(systemScopeId,"systemScopeId"),n(systemScopeId,"systemScopeId"),r(systemScopeId,"systemScopeId");export function systemItemKey(e,t){return`${systemScopeId(e)}/${t}`}s(systemItemKey,"systemItemKey"),n(systemItemKey,"systemItemKey"),r(systemItemKey,"systemItemKey");export function systemValue(e,t){switch(t){case"bytes":{const a=e/1073741824;return a>=1?`${a.toFixed(a>=100?0:1)} GB`:`${Math.round(e/1024**2)} MB`}case"ms":return e>=1e3?`${(e/1e3).toFixed(1)} s`:`${Math.round(e)} ms`;case"percent":return`${Math.round(e)} %`;case"usd":return`$${e.toFixed(2)}`;case"load":return`load ${e.toFixed(1)}`;case"minutes":return`${Math.round(e)} min`;default:return String(e)}}s(systemValue,"systemValue"),n(systemValue,"systemValue"),r(systemValue,"systemValue");export function systemScopeLabel(e){return e.kind==="machine"?"machine":e.kind==="repository"?e.name:`${e.name} lens`}s(systemScopeLabel,"systemScopeLabel"),n(systemScopeLabel,"systemScopeLabel"),r(systemScopeLabel,"systemScopeLabel");const m={"n/a":0,ok:1,warn:2,bad:3};export function systemStatusRank(e){return m[e]}s(systemStatusRank,"systemStatusRank"),n(systemStatusRank,"systemStatusRank"),r(systemStatusRank,"systemStatusRank");
@@ -45,6 +45,19 @@ export interface DeliveryProofRequirement {
45
45
  related?: string[];
46
46
  proofFiles?: string[];
47
47
  candidateRuntime?: CandidateRuntimeRequirement;
48
+ /**
49
+ * A job the candidate's `lensmcp.json` declares (`jobs.<name>`; planning/docker § 12, slice D26): the proof is that
50
+ * job's run — action `e2e`, under a Compose project of its own — and its fingerprint is the job's (its name and
51
+ * declaration, its declared `inputs.files`), not a command line's. It needs no `candidateRuntime` (the job brings its
52
+ * own stack) and takes no target, files, related sources or proof files: its manifest says what it runs and reads.
53
+ */
54
+ job?: string;
55
+ /**
56
+ * Where a {@link job}'s proof runs (slice D26): `local` — this Mac —, `auto` — placement chooses once a worker Mac is
57
+ * paired, and this Mac when none is —, or a paired worker Mac's name. Left out: this Mac, as before. A proof made on a
58
+ * worker counts exactly when the same proof made here would: its `host` is evidence, never what it proves.
59
+ */
60
+ host?: string;
48
61
  }
49
62
  /** Scope, ownership and proof declared together before independent writers start. */
50
63
  export interface PackageContract {
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 {
package/lib/team.js CHANGED
@@ -1 +1 @@
1
- "use strict";var o=Object.defineProperty;var r=(t,e)=>o(t,"name",{value:e,configurable:!0});var i=Object.defineProperty,n=r((t,e)=>i(t,"name",{value:e,configurable:!0}),"o");export const DASH_TEAM_KINDS=["goal","build","bug","review","test","qa","docs","marketing","research","chore"],DASH_TEAM_LINK_KINDS=["task","flow","error","suggestion","ai-call","review","page","route","commit","branch","worktree","file","finding","test"];export function modelClient(t){const e=t?.trim()??"";if(/\b(claude|opus|sonnet|haiku|fable)\b/i.test(e))return"claude";if(/^(gpt|o\d+|codex)\b/i.test(e))return"codex"}r(modelClient,"modelClient"),n(modelClient,"modelClient");export const DASH_TEAM_SEARCH_QUESTION_MAX=300;
1
+ "use strict";var i=Object.defineProperty;var r=(t,e)=>i(t,"name",{value:e,configurable:!0});var n=Object.defineProperty,o=r((t,e)=>n(t,"name",{value:e,configurable:!0}),"r"),a=Object.defineProperty,c=o((t,e)=>a(t,"name",{value:e,configurable:!0}),"o");export const DASH_TEAM_KINDS=["goal","build","bug","review","test","qa","docs","marketing","research","chore"],DASH_TEAM_LINK_KINDS=["task","flow","error","suggestion","ai-call","review","page","route","commit","branch","worktree","file","finding","test"];export function modelClient(t){const e=t?.trim()??"";if(/\b(claude|opus|sonnet|haiku|fable)\b/i.test(e))return"claude";if(/^(gpt|o\d+|codex)\b/i.test(e))return"codex"}r(modelClient,"modelClient"),o(modelClient,"modelClient"),c(modelClient,"modelClient");export const DASH_TEAM_SEARCH_QUESTION_MAX=300;
@@ -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.3",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",