@lensmcp/protocol-types 1.26.1 → 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.
- package/index.d.ts +14 -1
- package/index.js +1 -1
- package/lib/changes.d.ts +15 -3
- package/lib/cluster-hosts.d.ts +272 -0
- package/lib/cluster-hosts.js +1 -0
- package/lib/dashboard-lint.d.ts +22 -0
- package/lib/dashboard-updates.d.ts +80 -0
- package/lib/dashboard-updates.js +1 -0
- package/lib/dashboard.d.ts +54 -1
- package/lib/docker-errors.d.ts +123 -0
- package/lib/docker-errors.js +1 -0
- package/lib/docker-jobs.d.ts +673 -0
- package/lib/docker-jobs.js +1 -0
- package/lib/docker-report.d.ts +99 -0
- package/lib/docker-report.js +2 -0
- package/lib/docker-runs.d.ts +300 -0
- package/lib/docker-runs.js +3 -0
- package/lib/expected-failure.d.ts +251 -0
- package/lib/expected-failure.js +2 -0
- package/lib/host-agents.d.ts +139 -0
- package/lib/host-agents.js +1 -0
- package/lib/hosts.d.ts +206 -0
- package/lib/hosts.js +1 -0
- package/lib/main-mirror.d.ts +117 -0
- package/lib/main-mirror.js +1 -0
- package/lib/peers.d.ts +1881 -0
- package/lib/peers.js +1 -0
- package/lib/proof.d.ts +32 -0
- package/lib/remote-instances.d.ts +129 -0
- package/lib/remote-instances.js +1 -0
- package/lib/resources.d.ts +2 -0
- package/lib/resources.js +1 -1
- package/lib/static-checks.d.ts +290 -0
- package/lib/static-checks.js +1 -0
- package/lib/team-delivery.d.ts +13 -0
- package/lib/team.d.ts +60 -2
- package/lib/workspace-actions.d.ts +104 -1
- package/lib/workspace-actions.js +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -16,8 +16,10 @@ export * from './lib/dashboard.js';
|
|
|
16
16
|
export * from './lib/dashboard-path.js';
|
|
17
17
|
export * from './lib/dashboard-lint.js';
|
|
18
18
|
export * from './lib/lint-coverage.js';
|
|
19
|
+
export * from './lib/static-checks.js';
|
|
19
20
|
export * from './lib/log-query.js';
|
|
20
21
|
export * from './lib/error-dismissal.js';
|
|
22
|
+
export * from './lib/expected-failure.js';
|
|
21
23
|
export * from './lib/error-cause.js';
|
|
22
24
|
export * from './lib/metrics-reset.js';
|
|
23
25
|
export * from './lib/ai-content.js';
|
|
@@ -35,6 +37,16 @@ export * from './lib/page-visit.js';
|
|
|
35
37
|
export * from './lib/replay.js';
|
|
36
38
|
export * from './lib/event-loop.js';
|
|
37
39
|
export * from './lib/workspace-actions.js';
|
|
40
|
+
export * from './lib/docker-jobs.js';
|
|
41
|
+
export * from './lib/docker-report.js';
|
|
42
|
+
export * from './lib/docker-runs.js';
|
|
43
|
+
export * from './lib/docker-errors.js';
|
|
44
|
+
export * from './lib/peers.js';
|
|
45
|
+
export * from './lib/hosts.js';
|
|
46
|
+
export * from './lib/cluster-hosts.js';
|
|
47
|
+
export * from './lib/dashboard-updates.js';
|
|
48
|
+
export * from './lib/host-agents.js';
|
|
49
|
+
export * from './lib/remote-instances.js';
|
|
38
50
|
export * from './lib/team.js';
|
|
39
51
|
export * from './lib/team-review-changes.js';
|
|
40
52
|
export * from './lib/goal-outcome.js';
|
|
@@ -42,6 +54,7 @@ export * from './lib/role-fidelity.js';
|
|
|
42
54
|
export * from './lib/goal-retro.js';
|
|
43
55
|
export * from './lib/follow-ups.js';
|
|
44
56
|
export * from './lib/changes.js';
|
|
57
|
+
export * from './lib/main-mirror.js';
|
|
45
58
|
export * from './lib/team-design.js';
|
|
46
59
|
export * from './lib/team-library.js';
|
|
47
60
|
export * from './lib/team-skills.js';
|
|
@@ -53,7 +66,7 @@ export * from './lib/overseer-messages.js';
|
|
|
53
66
|
export * from './lib/team-roadmap.js';
|
|
54
67
|
export * from './lib/team-prompts.js';
|
|
55
68
|
export type { TaskTimePhase, TaskAttempt, TaskTiming } from './lib/task-timing.js';
|
|
56
|
-
export type { ProofFingerprint, ProofEvidence, RuntimeProofIdentity } from './lib/proof.js';
|
|
69
|
+
export type { ProofFingerprint, ProofEvidence, ProofHost, RuntimeProofIdentity } from './lib/proof.js';
|
|
57
70
|
export type { GoalAdmission, GoalDeliveryPolicy, DeliveryProofRequirement, PackageContract, PackagePublication, PackageCandidate, DeliveryFailureKind, DeliveryFinding, PackageDelivery, DeliveryAssignment, PackageDeliverySummary, ProofWaiver, ForcedItem, ForcedIntegration, ProofDeferral, TestsWaiver } from './lib/team-delivery.js';
|
|
58
71
|
export { PROOF_ACTIONS, NOT_RUN_KINDS } from './lib/team-delivery.js';
|
|
59
72
|
export type { NotRunKind } from './lib/team-delivery.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/lint-coverage.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.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-origins.js";export*from"./lib/ai-playground.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/team.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/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/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-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-origins.js";export*from"./lib/ai-playground.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/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";
|
package/lib/changes.d.ts
CHANGED
|
@@ -62,6 +62,14 @@ export interface DashChangesCheckout {
|
|
|
62
62
|
missing?: true;
|
|
63
63
|
/** Git could not read it; what it said. */
|
|
64
64
|
error?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The Mac it is on, when not this one (overseer-74 D30): a goal placed on a worker — its checkout read there, through
|
|
67
|
+
* the channel. Its folder is the worker's and is never named here.
|
|
68
|
+
*/
|
|
69
|
+
host?: {
|
|
70
|
+
peer: string;
|
|
71
|
+
name: string;
|
|
72
|
+
};
|
|
65
73
|
}
|
|
66
74
|
export interface DashChanges {
|
|
67
75
|
at: number;
|
|
@@ -168,11 +176,15 @@ export type DashChangesCommitRequest = {
|
|
|
168
176
|
message: string;
|
|
169
177
|
paths: string[];
|
|
170
178
|
};
|
|
171
|
-
/**
|
|
179
|
+
/**
|
|
180
|
+
* What a write on the Changes page did. Main on a worker (planning/docker § 14, slice D34) adds `bring-in` (the
|
|
181
|
+
* organizer brings a worker's sent commits into main), `update-main` («Update from main» on a worker's main) and
|
|
182
|
+
* `send-main` (a worker sends its main's commits), and the outcomes they end with.
|
|
183
|
+
*/
|
|
172
184
|
export interface DashChangesActed {
|
|
173
185
|
key: string;
|
|
174
|
-
action: 'commit' | 'push' | 'update';
|
|
175
|
-
outcome: 'committed' | 'pushed' | 'merged' | 'current' | 'conflicts' | 'asked';
|
|
186
|
+
action: 'commit' | 'push' | 'update' | 'bring-in' | 'update-main' | 'send-main';
|
|
187
|
+
outcome: 'committed' | 'pushed' | 'merged' | 'current' | 'conflicts' | 'asked' | 'brought-in' | 'waiting' | 'not-ff' | 'fast-forward' | 'queued' | 'refused';
|
|
176
188
|
/** One sentence for the person. */
|
|
177
189
|
said: string;
|
|
178
190
|
/** The commit a commit or a merge made. */
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import type { DockerVmRead } from './docker-jobs.js';
|
|
2
|
+
import type { HostAgentsView } from './host-agents.js';
|
|
3
|
+
import type { HostLinkView, HostVersionView } from './hosts.js';
|
|
4
|
+
/**
|
|
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
|
|
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
|
+
* runs this Mac placed there; the jobs waiting at the organizer for a host, with each host's reason; and the
|
|
9
|
+
* placement's decisions, the newest first. Settings › Hosts (slice D19) pairs and revokes; this page only reads.
|
|
10
|
+
*
|
|
11
|
+
* READ ONLY, AND CHEAP: one request reads the files once — `workers.json`, `links.json`, `hub.json`, `placement.db`,
|
|
12
|
+
* `placements.jsonl`, the machine queue's `admission.db`, D16's index of the runs on workers — and writes none. Docker
|
|
13
|
+
* is asked nothing: a worker's VM is its last capacity advert's; this Mac's is the last reading the dashboard holds
|
|
14
|
+
* (Cluster › Docker's) or the last placement decision's, whichever is newer — each said with when it was taken.
|
|
15
|
+
*
|
|
16
|
+
* Every time here is THIS Mac's clock. A worker's queue times, which its advert gives by its own clock, are moved by
|
|
17
|
+
* that clock's offset as it was last heard (placement does the same).
|
|
18
|
+
*/
|
|
19
|
+
export type ClusterLane = 'heavy' | 'light';
|
|
20
|
+
/** One entry of a host's machine queue: a run, or a job waiting there. */
|
|
21
|
+
export interface ClusterQueueEntry {
|
|
22
|
+
state: 'running' | 'waiting';
|
|
23
|
+
lane: ClusterLane;
|
|
24
|
+
label: string;
|
|
25
|
+
/** Its run (`q_…`, `wa_…`) — on a worker, a job this Mac placed there is named by its run's id on the channel. */
|
|
26
|
+
ref: string;
|
|
27
|
+
/** 0 first, 2 last — before ageing. */
|
|
28
|
+
priority: number;
|
|
29
|
+
enqueuedAt: number;
|
|
30
|
+
startedAt?: number;
|
|
31
|
+
/** The host memory it waits for, or was let in by, MiB. */
|
|
32
|
+
needMb: number;
|
|
33
|
+
/** A Docker job's: its budget in the VM, and what its containers hold of it now (none: not sampled). */
|
|
34
|
+
vmMb?: number;
|
|
35
|
+
usedMb?: number;
|
|
36
|
+
/** It runs, or waits to run, alone on its machine. */
|
|
37
|
+
exclusive?: true;
|
|
38
|
+
/** A waiter's own reason, as it last judged it — this Mac's queue alone: a worker's advert carries none. */
|
|
39
|
+
why?: string;
|
|
40
|
+
/** The waiter waits on Docker: memory in its VM, or an engine that does not answer. */
|
|
41
|
+
waitsOnDocker?: true;
|
|
42
|
+
}
|
|
43
|
+
/** A host's machine queue — its own: placement proposes, this queue admits. */
|
|
44
|
+
export interface ClusterQueue {
|
|
45
|
+
running: ClusterQueueEntry[];
|
|
46
|
+
waiting: ClusterQueueEntry[];
|
|
47
|
+
/** An older LensMCP's runner holds the heavy lane. */
|
|
48
|
+
legacy?: true;
|
|
49
|
+
/** What the queue keeps free and runs at once (its `queue-config.json`). */
|
|
50
|
+
limits: {
|
|
51
|
+
reserveMb: number;
|
|
52
|
+
dockerReserveMb: number;
|
|
53
|
+
heavyMax: number;
|
|
54
|
+
lightMax: number;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** The containers LensMCP did not start in a host's VM. */
|
|
58
|
+
export interface ClusterVmOthers {
|
|
59
|
+
/** What they hold together, MiB — none: not read. */
|
|
60
|
+
mb?: number;
|
|
61
|
+
count: number;
|
|
62
|
+
/** The largest first. */
|
|
63
|
+
containers: Array<{
|
|
64
|
+
name: string;
|
|
65
|
+
mb?: number;
|
|
66
|
+
}>;
|
|
67
|
+
/** Past the ones listed. */
|
|
68
|
+
more?: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Docker's VM on a host, as it was last read there — or why it gave no figure. `from`: `advert` — the worker's last
|
|
72
|
+
* capacity advert (its own probe); `docker-page` — the reading Cluster › Docker last had taken on this Mac (an
|
|
73
|
+
* estimate by design: the page starts no container); `placement` — this Mac's VM as the last placement decision read
|
|
74
|
+
* it (admission's own reading). `at`: when it was taken, by this Mac's clock.
|
|
75
|
+
*/
|
|
76
|
+
export type ClusterVm = {
|
|
77
|
+
ok: true;
|
|
78
|
+
from: 'advert' | 'docker-page' | 'placement';
|
|
79
|
+
at: number;
|
|
80
|
+
context?: string;
|
|
81
|
+
version?: string;
|
|
82
|
+
totalMb: number;
|
|
83
|
+
availableMb: number;
|
|
84
|
+
read: DockerVmRead;
|
|
85
|
+
/** With `estimate`: why the VM's own figure was not read. */
|
|
86
|
+
why?: string;
|
|
87
|
+
others?: ClusterVmOthers;
|
|
88
|
+
} | {
|
|
89
|
+
ok: false;
|
|
90
|
+
from: 'advert' | 'docker-page';
|
|
91
|
+
at: number;
|
|
92
|
+
why: string;
|
|
93
|
+
};
|
|
94
|
+
/** A host's machine as it last said it: its memory and what it is. */
|
|
95
|
+
export interface ClusterMachine {
|
|
96
|
+
/** When the figures were taken — a worker's: its advert's moment, moved to this Mac's clock. */
|
|
97
|
+
at: number;
|
|
98
|
+
/** Its free memory (`vm_stat`'s free, inactive, speculative and purgeable pages) and its whole memory, MiB. */
|
|
99
|
+
freeMb: number;
|
|
100
|
+
totalMb: number;
|
|
101
|
+
cpus?: number;
|
|
102
|
+
arch?: string;
|
|
103
|
+
os?: string;
|
|
104
|
+
/** A worker's LensMCP, as its advert said it. */
|
|
105
|
+
lensmcp?: string;
|
|
106
|
+
/** How many images it holds — a worker's. */
|
|
107
|
+
images?: number;
|
|
108
|
+
}
|
|
109
|
+
/** A run this Mac placed on a worker, as this Mac knows it now. */
|
|
110
|
+
export interface ClusterPlacedRun {
|
|
111
|
+
/** Its id on the channel (`q_…`): Cluster › Docker's card for it carries it. */
|
|
112
|
+
run: string;
|
|
113
|
+
job: string;
|
|
114
|
+
label: string;
|
|
115
|
+
lane?: ClusterLane;
|
|
116
|
+
/**
|
|
117
|
+
* `offered` — the worker has not answered yet (it starts it within 30 s or gives it back); `queued` — in the worker's
|
|
118
|
+
* own queue; `running` — let in there.
|
|
119
|
+
*/
|
|
120
|
+
state: 'offered' | 'queued' | 'running';
|
|
121
|
+
/** Offered at, queued at, or running since. */
|
|
122
|
+
since: number;
|
|
123
|
+
attempt?: number;
|
|
124
|
+
/** Its placement (`pl_…`), while the placement queue has it. */
|
|
125
|
+
placement?: string;
|
|
126
|
+
/** The action here that keeps its evidence (`wa_…`, slice D16) — none: no record of it yet. */
|
|
127
|
+
action?: string;
|
|
128
|
+
stage?: string;
|
|
129
|
+
/** Where it waits in the worker's queue, and why. */
|
|
130
|
+
queue?: {
|
|
131
|
+
place?: number;
|
|
132
|
+
of?: number;
|
|
133
|
+
why?: string;
|
|
134
|
+
};
|
|
135
|
+
/** The last word of it from the worker. */
|
|
136
|
+
heardAt?: number;
|
|
137
|
+
}
|
|
138
|
+
/** A host as Cluster › Hosts shows it. */
|
|
139
|
+
export interface ClusterHost {
|
|
140
|
+
/** `local` — this Mac — or the worker's id on the channel. */
|
|
141
|
+
id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
local: boolean;
|
|
144
|
+
/** Its model identifier («Mac14,13»). */
|
|
145
|
+
model?: string;
|
|
146
|
+
/** A worker's whole certificate fingerprint and its short form, from its pin. */
|
|
147
|
+
fingerprint?: string;
|
|
148
|
+
short?: string;
|
|
149
|
+
/** A worker's link and version, as Settings › Hosts reads them. */
|
|
150
|
+
link?: HostLinkView;
|
|
151
|
+
version?: HostVersionView;
|
|
152
|
+
/** Whether placement gives it work now, by placement's own rules — and why not. `stale`: its channel went quiet. */
|
|
153
|
+
work: {
|
|
154
|
+
takes: true;
|
|
155
|
+
} | {
|
|
156
|
+
takes: false;
|
|
157
|
+
why: string;
|
|
158
|
+
stale?: true;
|
|
159
|
+
};
|
|
160
|
+
/** Placement still keeps a record of it, and this Mac has no pin of it: revoked, or forgotten on the other side. */
|
|
161
|
+
unpaired?: true;
|
|
162
|
+
/** When this Mac last heard from the worker — any word: hello, advert, ping. */
|
|
163
|
+
heardAt?: number;
|
|
164
|
+
machine?: ClusterMachine;
|
|
165
|
+
vm?: ClusterVm;
|
|
166
|
+
queue?: ClusterQueue;
|
|
167
|
+
/** What this Mac placed there that is offered, queued or running — the newest first. */
|
|
168
|
+
placed: ClusterPlacedRun[];
|
|
169
|
+
/** Runs this Mac placed there that were lost in the last day: Cluster › Docker lists them. */
|
|
170
|
+
lostToday: number;
|
|
171
|
+
/** Its accounts (never a token) and its agent ceiling — slice D31 (host-agents.ts); none: not read. */
|
|
172
|
+
agents?: HostAgentsView;
|
|
173
|
+
}
|
|
174
|
+
/** A host's numbers as placement weighed them for one job (placement.ts `HostNumbers`). */
|
|
175
|
+
export interface ClusterHostNumbers {
|
|
176
|
+
freeMb: number;
|
|
177
|
+
totalMb: number;
|
|
178
|
+
reserveMb: number;
|
|
179
|
+
/** What the job would wait for there: its need and the reserve, MiB. */
|
|
180
|
+
needMb: number;
|
|
181
|
+
vm?: {
|
|
182
|
+
totalMb: number;
|
|
183
|
+
availableMb: number;
|
|
184
|
+
promisedMb: number;
|
|
185
|
+
needMb: number;
|
|
186
|
+
read: DockerVmRead;
|
|
187
|
+
} | {
|
|
188
|
+
unread: string;
|
|
189
|
+
};
|
|
190
|
+
running: {
|
|
191
|
+
heavy: number;
|
|
192
|
+
light: number;
|
|
193
|
+
};
|
|
194
|
+
waiting: number;
|
|
195
|
+
images?: {
|
|
196
|
+
have: number;
|
|
197
|
+
of: number;
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
/** What one host said to one job (placement.ts `HostLook`). */
|
|
201
|
+
export interface ClusterHostLook {
|
|
202
|
+
host: string;
|
|
203
|
+
name: string;
|
|
204
|
+
state: 'fits' | 'full' | 'never' | 'no-work' | 'avoided' | 'taken';
|
|
205
|
+
why?: string;
|
|
206
|
+
numbers?: ClusterHostNumbers;
|
|
207
|
+
}
|
|
208
|
+
/** A job waiting at the organizer for a host — on no host's card. */
|
|
209
|
+
export interface ClusterWaitingJob {
|
|
210
|
+
placement: string;
|
|
211
|
+
job: string;
|
|
212
|
+
label: string;
|
|
213
|
+
ref: string;
|
|
214
|
+
lane: ClusterLane;
|
|
215
|
+
priority: number;
|
|
216
|
+
attempt: number;
|
|
217
|
+
enqueuedAt: number;
|
|
218
|
+
/** Since when it waits for these reasons, and the reasons in a line (`waiting for a host — this Mac: …; mac-mini: …`). */
|
|
219
|
+
since?: number;
|
|
220
|
+
why?: string;
|
|
221
|
+
/** Each host's reason, as `lensmcp queue status` says it. */
|
|
222
|
+
looks: ClusterHostLook[];
|
|
223
|
+
/** The workers it was lost on before. */
|
|
224
|
+
lostOn: string[];
|
|
225
|
+
}
|
|
226
|
+
export type ClusterDecisionKind = 'place' | 'wait' | 'refuse' | 'started' | 'take-back' | 'retry' | 'no-retry';
|
|
227
|
+
/** One line of `placements.jsonl`: one decision. */
|
|
228
|
+
export interface ClusterDecision {
|
|
229
|
+
at: number;
|
|
230
|
+
placement: string;
|
|
231
|
+
job: string;
|
|
232
|
+
label: string;
|
|
233
|
+
ref: string;
|
|
234
|
+
lane: ClusterLane;
|
|
235
|
+
attempt: number;
|
|
236
|
+
decision: ClusterDecisionKind;
|
|
237
|
+
/** The host chosen, or the one the line is about. */
|
|
238
|
+
host?: string;
|
|
239
|
+
hostName?: string;
|
|
240
|
+
/** Placed on this Mac while it was full: the only host it may go to — it waits in this Mac's queue. */
|
|
241
|
+
waitsThere?: true;
|
|
242
|
+
why: string;
|
|
243
|
+
/** Each host considered, with its reason and its numbers at that moment. */
|
|
244
|
+
hosts: ClusterHostLook[];
|
|
245
|
+
}
|
|
246
|
+
export interface ClusterDecisions {
|
|
247
|
+
/** The newest first — at most `limit`. */
|
|
248
|
+
lines: ClusterDecision[];
|
|
249
|
+
/** The decisions the log keeps (a day's); with `partial`, those of the end of it that was read. */
|
|
250
|
+
total: number;
|
|
251
|
+
partial?: true;
|
|
252
|
+
limit: number;
|
|
253
|
+
}
|
|
254
|
+
/** `GET /api/cluster/hosts`: Cluster › Hosts. */
|
|
255
|
+
export interface ClusterHostsView {
|
|
256
|
+
at: number;
|
|
257
|
+
/** This Mac first, then the paired workers by name. */
|
|
258
|
+
hosts: ClusterHost[];
|
|
259
|
+
/** The jobs waiting at the organizer for a host, in their order. */
|
|
260
|
+
waiting: ClusterWaitingJob[];
|
|
261
|
+
decisions: ClusterDecisions;
|
|
262
|
+
/** This Mac is a worker of another Mac: placement is that Mac's; this one shows its own queue. */
|
|
263
|
+
servesOrganizer?: {
|
|
264
|
+
name: string;
|
|
265
|
+
state: 'pending' | 'paired';
|
|
266
|
+
};
|
|
267
|
+
/** A part that could not be read, and why: the rest of the page stands. */
|
|
268
|
+
unread?: string[];
|
|
269
|
+
}
|
|
270
|
+
/** How many decisions an answer carries unless the page asks for more (`?decisions=`), and the most it may ask for. */
|
|
271
|
+
export declare const CLUSTER_DECISIONS_SHOWN = 25;
|
|
272
|
+
export declare const CLUSTER_DECISIONS_MAX = 500;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const CLUSTER_DECISIONS_SHOWN=25,CLUSTER_DECISIONS_MAX=500;
|
package/lib/dashboard-lint.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LintCoverageKind } from './lint-coverage.js';
|
|
2
|
+
import type { CheckAnswer, LintFinding } from './static-checks.js';
|
|
2
3
|
/**
|
|
3
4
|
* The dashboard's Lint page (Investigate › Lint, `GET /api/lint`): the ESLint findings `lint://errors` and
|
|
4
5
|
* `lint://warnings` hold, grouped and filtered on the server so the answer stays bounded, beside each lint run (when,
|
|
@@ -205,3 +206,24 @@ export interface DashLint {
|
|
|
205
206
|
/** The saved lint of the whole checkout — absent before a full lint. */
|
|
206
207
|
whole?: DashLintWhole;
|
|
207
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* `GET /api/lint/findings?offset=&limit=&detail=1` — the page's full list and its coverage strip, read from the RECORD
|
|
211
|
+
* STORE and not from the bus (planning/checks/00-plan.md § 9): every finding the lint units' kept verdicts hold, a
|
|
212
|
+
* page at a time and each once under the project that owns its file, with the `Coverage` block that says which units
|
|
213
|
+
* those verdicts are of — linted and still fresh, stale, not runnable as ESLint, or failed. It is the answer
|
|
214
|
+
* `lensmcp lint --all --wait 0 --json` prints: nothing is linted to give it. `available: false` — and why — when the
|
|
215
|
+
* workspace has no ESLint or no lint target, or `projects` names one it does not have.
|
|
216
|
+
*
|
|
217
|
+
* `&projects=a,b`: the units those projects own (`lensmcp lint --projects a,b`). `&rest=1`: without the findings the
|
|
218
|
+
* bus holds — the rest of what a run found, which the page lists beside the bus's, each once; `answer.page.listed`
|
|
219
|
+
* counts it, and the totals and the coverage stay the scope's.
|
|
220
|
+
*/
|
|
221
|
+
export type DashLintFindings = {
|
|
222
|
+
at: number;
|
|
223
|
+
available: true;
|
|
224
|
+
answer: CheckAnswer<LintFinding>;
|
|
225
|
+
} | {
|
|
226
|
+
at: number;
|
|
227
|
+
available: false;
|
|
228
|
+
why: string;
|
|
229
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLUSTER › UPDATE MODES — what the dashboard's `/api/updates` answers (planning/updates/00-plan.md, slice U5): whether
|
|
3
|
+
* each service and frontend of THIS dashboard's checkout takes every save live (`hmr`), waits for an update (`manual`)
|
|
4
|
+
* or does not run (`off`: parked); the agents' holds on it; what is collected while held; the last update's outcome.
|
|
5
|
+
*
|
|
6
|
+
* The dashboard only passes the gateway's control-socket answer through (`GET /updates`, `POST /updates/{mode,apply}`),
|
|
7
|
+
* so these are a lock-step copy of the gateway's `libs/cluster/src/executors/gateway/runtime/updates.ts`
|
|
8
|
+
* (`WorkspaceUpdates`, `PieceStatus`, `UpdateOutcome`) — protocol-types imports no gateway code.
|
|
9
|
+
*
|
|
10
|
+
* Only the person changes a mode (UM-D6): the dashboard is a person's surface, as the CLI is; agents read, hold, release
|
|
11
|
+
* and update through their tools.
|
|
12
|
+
*/
|
|
13
|
+
export type DashUpdateMode = 'hmr' | 'manual' | 'off';
|
|
14
|
+
export type DashUpdateState = 'live' | 'held' | 'manual' | 'parked';
|
|
15
|
+
export type DashUpdateOutcomeKind = 'swapped' | 'unchanged' | 'failed' | 'skipped' | 'pending';
|
|
16
|
+
/** One holder of a piece: an agent (its name, else its client), the CLI's person, a script. */
|
|
17
|
+
export interface DashUpdateHolder {
|
|
18
|
+
/** `claude`, `codex`, `cli`, `dashboard`, … */
|
|
19
|
+
client: string;
|
|
20
|
+
session: string;
|
|
21
|
+
/** A name a person reads: the agent's, the goal's. */
|
|
22
|
+
name?: string;
|
|
23
|
+
since: number;
|
|
24
|
+
/** When the hold lapses unless its holder renews it (its session lease, UM-D4). */
|
|
25
|
+
until: number;
|
|
26
|
+
why?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DashUpdateOutcome {
|
|
29
|
+
piece: string;
|
|
30
|
+
outcome: DashUpdateOutcomeKind;
|
|
31
|
+
ms: number;
|
|
32
|
+
errors?: string[];
|
|
33
|
+
/** Why `skipped` or `pending`. */
|
|
34
|
+
why?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface DashUpdatePiece {
|
|
37
|
+
/** The project — a service's or a frontend's, as Cluster › Services names it. */
|
|
38
|
+
piece: string;
|
|
39
|
+
kind: 'service' | 'frontend';
|
|
40
|
+
mode: DashUpdateMode;
|
|
41
|
+
/** Where the mode came from: the checkout's `.lensmcp/updates.json`, the declaration's, or the default (`hmr`). */
|
|
42
|
+
modeFrom: 'checkout' | 'declaration' | 'default';
|
|
43
|
+
state: DashUpdateState;
|
|
44
|
+
holders: DashUpdateHolder[];
|
|
45
|
+
/** While held or manual: the files saved since (the last 50), how many (unknown for a build host's live group), the builds or reloads spared. */
|
|
46
|
+
collected?: {
|
|
47
|
+
files: string[];
|
|
48
|
+
count?: number;
|
|
49
|
+
skipped: number;
|
|
50
|
+
since: number;
|
|
51
|
+
};
|
|
52
|
+
lastUpdate?: DashUpdateOutcome & {
|
|
53
|
+
at: number;
|
|
54
|
+
by?: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** `GET /api/updates`, and the answer of `POST /api/updates/mode`. */
|
|
58
|
+
export interface DashUpdates {
|
|
59
|
+
workspace: string;
|
|
60
|
+
/** The main checkout (its modes the person's) or a worktree (agents set them too, `service_mode`). Absent from an older gateway. */
|
|
61
|
+
checkout?: 'main' | 'worktree';
|
|
62
|
+
/** A worktree's instance name. */
|
|
63
|
+
instance?: string;
|
|
64
|
+
pieces: DashUpdatePiece[];
|
|
65
|
+
holds: Array<{
|
|
66
|
+
holder: {
|
|
67
|
+
client: string;
|
|
68
|
+
session: string;
|
|
69
|
+
name?: string;
|
|
70
|
+
};
|
|
71
|
+
pieces: '*' | string[];
|
|
72
|
+
since: number;
|
|
73
|
+
until: number;
|
|
74
|
+
why?: string;
|
|
75
|
+
}>;
|
|
76
|
+
}
|
|
77
|
+
/** `POST /api/updates/apply`: each piece's outcome — `pending` when its build outlived the wait. */
|
|
78
|
+
export interface DashUpdatesApplied {
|
|
79
|
+
outcomes: DashUpdateOutcome[];
|
|
80
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export{};
|
package/lib/dashboard.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import type { PageVisitNavType, PageVisitRaw, PageVisitReadyBy, PageVisitRequest
|
|
|
16
16
|
import type { WorktreeRunOutcome } from './workspace-actions.js';
|
|
17
17
|
import type { DesignStage } from './goal-design.js';
|
|
18
18
|
import type { DashExternalBefore, DashSqlBefore } from './metrics-reset.js';
|
|
19
|
+
import type { ExpectedFailureMatch } from './expected-failure.js';
|
|
19
20
|
/** Bumped only on a breaking change to the stream framing itself. */
|
|
20
21
|
export declare const DASHBOARD_PROTOCOL = 1;
|
|
21
22
|
/** The swimlane a flow event belongs to (mirrors `FlowArea` in `@lensmcp/core`'s flow-shape). */
|
|
@@ -860,8 +861,10 @@ export interface DashWarning {
|
|
|
860
861
|
* log — an error-level log line no request explains
|
|
861
862
|
* build / typecheck / service — the code or a service is broken right now (standing, not events)
|
|
862
863
|
* lint — ESLint errors as of its last run (nothing re-lints on save, so dated, not "now")
|
|
864
|
+
* container — a container of a Docker job LensMCP ran was killed for running out of memory (docker-errors.ts)
|
|
865
|
+
* docker — Docker stopped answering while LensMCP ran jobs in it: one error, whatever it held
|
|
863
866
|
*/
|
|
864
|
-
export type DashErrorKind = 'server' | 'exception' | 'request' | 'browser' | 'external' | 'queue' | 'log' | 'build' | 'typecheck' | 'lint' | 'service';
|
|
867
|
+
export type DashErrorKind = 'server' | 'exception' | 'request' | 'browser' | 'external' | 'queue' | 'log' | 'build' | 'typecheck' | 'lint' | 'service' | 'container' | 'docker';
|
|
865
868
|
export interface DashErrorOccurrence {
|
|
866
869
|
/** The primary event's id. */
|
|
867
870
|
id: string;
|
|
@@ -883,6 +886,11 @@ export interface DashErrorGroup {
|
|
|
883
886
|
/** Where: the service, host or page. */
|
|
884
887
|
where?: string;
|
|
885
888
|
project?: string;
|
|
889
|
+
/**
|
|
890
|
+
* The services whose calls to this one failed with it. A failed call between the cluster's own services is told
|
|
891
|
+
* once, where it was answered — not a second time as the caller's «external» error.
|
|
892
|
+
*/
|
|
893
|
+
callers?: string[];
|
|
886
894
|
message?: string;
|
|
887
895
|
/** App frames first; framework frames trimmed. */
|
|
888
896
|
stack?: string;
|
|
@@ -905,6 +913,49 @@ export interface DashErrorGroup {
|
|
|
905
913
|
/** Who dismissed it — a person here, a person at the CLI, or an agent — and the reason they gave. */
|
|
906
914
|
dismissedBy?: 'dashboard' | 'cli' | 'agent';
|
|
907
915
|
dismissedReason?: string;
|
|
916
|
+
/** Occurrences of it a standing rule held back (overseer-86): not in `count`. On a group in `DashErrors.expected.groups`, all of them. */
|
|
917
|
+
expectedCount?: number;
|
|
918
|
+
/** The rule that holds it back — on a group in `DashErrors.expected.groups`. */
|
|
919
|
+
expectedBy?: string;
|
|
920
|
+
expectedReason?: string;
|
|
921
|
+
}
|
|
922
|
+
/** A standing rule as Errors lists it (overseer-86, expected-failure.ts `ExpectedRuleView`). */
|
|
923
|
+
export interface DashExpectedRule {
|
|
924
|
+
id: string;
|
|
925
|
+
match: ExpectedFailureMatch;
|
|
926
|
+
/** The match in a line: `auth · GET /session/token · 401`. */
|
|
927
|
+
label: string;
|
|
928
|
+
reason: string;
|
|
929
|
+
by: 'dashboard' | 'cli' | 'agent' | 'repository';
|
|
930
|
+
createdAt: number;
|
|
931
|
+
expiresAt?: number;
|
|
932
|
+
title?: string;
|
|
933
|
+
hits: number;
|
|
934
|
+
lastHitAt?: number;
|
|
935
|
+
lastHour: number;
|
|
936
|
+
/** It matches far more than its usual rate: said once, as «this expected failure is now happening much more often». */
|
|
937
|
+
surge?: {
|
|
938
|
+
since: number;
|
|
939
|
+
lastHour: number;
|
|
940
|
+
usualPerHour: number;
|
|
941
|
+
line: string;
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
/** What the standing rules held back from this list — never silent. */
|
|
945
|
+
export interface DashExpected {
|
|
946
|
+
/** «2 rules held back 61 occurrences in the last hour». */
|
|
947
|
+
line: string;
|
|
948
|
+
/** Rules that held something back in the last hour, and those occurrences. */
|
|
949
|
+
rulesHolding: number;
|
|
950
|
+
lastHour: number;
|
|
951
|
+
/** Occurrences held back across the groups the error log keeps (whole groups and parts of shown ones). */
|
|
952
|
+
held: number;
|
|
953
|
+
/** Every rule in effect. */
|
|
954
|
+
rules: DashExpectedRule[];
|
|
955
|
+
/** Groups every occurrence of which is held back — listed on request, marked «expected». */
|
|
956
|
+
groups: DashErrorGroup[];
|
|
957
|
+
/** Problems reading `lensmcp.json` → `config.expectedFailures`, if any. */
|
|
958
|
+
problems?: string[];
|
|
908
959
|
}
|
|
909
960
|
export interface DashErrors {
|
|
910
961
|
at: number;
|
|
@@ -933,6 +984,8 @@ export interface DashErrors {
|
|
|
933
984
|
* plus any the error log itself let go of. Per-cause drops are on each cause (`DashErrorCause.dropped`).
|
|
934
985
|
*/
|
|
935
986
|
dropped?: number;
|
|
987
|
+
/** What standing rules held back, and the rules (overseer-86). Absent when no rule is in effect, and from an older server. */
|
|
988
|
+
expected?: DashExpected;
|
|
936
989
|
}
|
|
937
990
|
/** Where a cause surfaced: one of its groups, as a row of the cause («GET /documents → 500 ×30»). */
|
|
938
991
|
export interface DashErrorSurface {
|