@lensmcp/protocol-types 1.26.36 → 1.26.38
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 +7 -0
- package/index.js +1 -1
- package/lib/account-drain.js +1 -1
- package/lib/ai-cache-facts.js +1 -1
- package/lib/ai-cache-verdict.js +1 -1
- package/lib/ai-cache.js +3 -3
- package/lib/ai-call-groups.js +2 -2
- package/lib/ai-call-row.js +3 -3
- package/lib/ai-call.js +9 -9
- package/lib/ai-compare.js +3 -3
- package/lib/ai-context.js +6 -6
- package/lib/ai-origins.js +9 -9
- package/lib/ai-together.js +5 -5
- package/lib/bounded-clone.js +1 -1
- package/lib/bounded-map.js +1 -1
- package/lib/bounded-writer.js +1 -1
- package/lib/canvas-attachments.js +1 -1
- package/lib/canvas-catalog.d.ts +10 -5
- package/lib/canvas-catalog.js +1 -1
- package/lib/canvas-chat.js +2 -2
- package/lib/canvas-diagram.d.ts +130 -0
- package/lib/canvas-diagram.js +8 -0
- package/lib/canvas-editing.js +4 -4
- package/lib/canvas-frame-policy.js +1 -1
- package/lib/canvas-hub.js +1 -1
- package/lib/canvas.d.ts +9 -5
- package/lib/capture-demand.js +1 -1
- package/lib/dashboard-path.js +1 -1
- package/lib/dashboard.d.ts +2 -0
- package/lib/delivery-actions.d.ts +257 -0
- package/lib/delivery-actions.js +1 -0
- package/lib/delivery-status.d.ts +201 -4
- package/lib/docker-errors.js +1 -1
- package/lib/docker-jobs.js +1 -1
- package/lib/docker-report.js +2 -2
- package/lib/docker-runs.js +3 -3
- package/lib/error-cause.js +6 -6
- package/lib/error-dismissal.js +1 -1
- package/lib/error-verdict.js +3 -3
- package/lib/event-loop.js +1 -1
- package/lib/expected-failure.js +2 -2
- package/lib/finding-proof.js +1 -1
- package/lib/flood-guard.js +1 -1
- package/lib/goal-design.js +1 -1
- package/lib/goal-main-follow.d.ts +103 -0
- package/lib/goal-main-follow.js +1 -0
- package/lib/goal-number.js +1 -1
- package/lib/goal-process.d.ts +449 -0
- package/lib/goal-process.js +1 -0
- package/lib/goal-review.d.ts +126 -0
- package/lib/goal-review.js +6 -0
- package/lib/host-agents.js +1 -1
- package/lib/lens-hosts.js +1 -1
- package/lib/lint-coverage.js +1 -1
- package/lib/lint-ignores.js +2 -2
- package/lib/log-query.js +1 -1
- package/lib/metrics-reset.js +1 -1
- package/lib/overseer-findings.js +1 -1
- package/lib/peers.d.ts +31 -31
- package/lib/peers.js +1 -1
- package/lib/perf-rules.js +1 -1
- package/lib/pod-memory.js +1 -1
- package/lib/producer-health.js +1 -1
- package/lib/pull-requests.d.ts +33 -2
- package/lib/remote-instances.js +1 -1
- package/lib/source.d.ts +414 -0
- package/lib/source.js +1 -0
- package/lib/sources.js +1 -1
- package/lib/static-checks.js +1 -1
- package/lib/system-report.js +1 -1
- package/lib/team-decide.d.ts +191 -0
- package/lib/team-decide.js +1 -0
- package/lib/team-design.d.ts +43 -7
- package/lib/team-design.js +1 -1
- package/lib/team-library.d.ts +2 -0
- package/lib/team-roadmap.d.ts +44 -2
- package/lib/team.d.ts +63 -3
- package/lib/team.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import type { DashGoalReview } from './goal-review.js';
|
|
2
|
+
import type { DashGoalCleanup, DashGoalLanding } from './delivery-status.js';
|
|
3
|
+
import type { DashMergeQueueItem } from './goal-main-follow.js';
|
|
4
|
+
import type { TaskTiming } from './task-timing.js';
|
|
5
|
+
import type { DashTeamStep, DashTeamWorktreeState } from './team.js';
|
|
6
|
+
/**
|
|
7
|
+
* Team › Process (issues/closed/hub-10): the process one goal actually ran, step by step, from the store's own records —
|
|
8
|
+
* its worktree and managers, its packages with their checkouts, writers, candidates, reviews and runs, its goal QA's
|
|
9
|
+
* logged steps, how it landed, the Main QA run that judged it — and «How a goal runs here»: the repository's live settings
|
|
10
|
+
* that shape it, each with where the person changes it. The owner, 2026-11-25: «i need somehow to display me the actual
|
|
11
|
+
* process of these things so i can review and adjust».
|
|
12
|
+
*
|
|
13
|
+
* GET /api/team/process «How a goal runs here» and the newest goals to pick
|
|
14
|
+
* GET /api/team/process?goal=<ref> … and one goal's process (`ref`: its id, 8 or more of its first characters, or G-n)
|
|
15
|
+
*/
|
|
16
|
+
export interface DashGoalProcessAnswer {
|
|
17
|
+
at: number;
|
|
18
|
+
how: DashGoalHow;
|
|
19
|
+
/** The newest goals, by number: what the page offers to open when none is named. */
|
|
20
|
+
goals: DashGoalProcessHead[];
|
|
21
|
+
process?: DashGoalProcess;
|
|
22
|
+
/** Why the goal named could not be read. */
|
|
23
|
+
problem?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface DashGoalProcessHead {
|
|
26
|
+
id: string;
|
|
27
|
+
number?: number;
|
|
28
|
+
title: string;
|
|
29
|
+
state: string;
|
|
30
|
+
outcome?: string;
|
|
31
|
+
updatedAt: number;
|
|
32
|
+
}
|
|
33
|
+
/** Where a setting is changed: a page of the dashboard, or a key of a team file. */
|
|
34
|
+
export interface DashGoalHowChange {
|
|
35
|
+
/** `limits`: Team › Limits; `roles`: Team › Roles; `settings`: a Settings page (`page`); `board`: Team › Board (Main QA's pause); `file`: a team file. */
|
|
36
|
+
where: 'limits' | 'roles' | 'settings' | 'board' | 'file';
|
|
37
|
+
/** A Settings page's id (`team`), when `where` is `settings`. */
|
|
38
|
+
page?: string;
|
|
39
|
+
/** The team file, repository-relative (`.lensmcp/team/flow.json`), and its key (`delivery.checkouts`). */
|
|
40
|
+
file?: string;
|
|
41
|
+
key?: string;
|
|
42
|
+
/** What the link says. */
|
|
43
|
+
label: string;
|
|
44
|
+
}
|
|
45
|
+
/** One statement of «How a goal runs here»: what LensMCP does here, in plain words, with this repository's numbers. */
|
|
46
|
+
export interface DashGoalHowLine {
|
|
47
|
+
id: string;
|
|
48
|
+
/** The step of the process it is about. */
|
|
49
|
+
step: 'goal' | 'packages' | 'parallel' | 'capacity' | 'agents' | 'qa' | 'landing' | 'main-qa';
|
|
50
|
+
text: string;
|
|
51
|
+
/** Where each number in it comes from, in a few words: «flow.json caps.writers», «live, set 14:02», «LensMCP's default». */
|
|
52
|
+
from?: string;
|
|
53
|
+
/** Something about it the person should know now (Main QA paused, a cap below a goal's capacity). */
|
|
54
|
+
warn?: string;
|
|
55
|
+
change?: DashGoalHowChange;
|
|
56
|
+
}
|
|
57
|
+
export interface DashGoalHow {
|
|
58
|
+
lines: DashGoalHowLine[];
|
|
59
|
+
/** The numbers behind the lines, for the flags and the page's own words. */
|
|
60
|
+
values: DashGoalHowValues;
|
|
61
|
+
}
|
|
62
|
+
export interface DashGoalHowValues {
|
|
63
|
+
checkouts: 'separate' | 'shared';
|
|
64
|
+
writersCap?: number;
|
|
65
|
+
checkersCap?: number;
|
|
66
|
+
qaRuns: number;
|
|
67
|
+
goalsMax: number;
|
|
68
|
+
/** Each goal's capacity, by key (`writers`, `reviewer`, `research`…). */
|
|
69
|
+
capacity: Record<string, number>;
|
|
70
|
+
goalQaBudgetMinutes: number | null;
|
|
71
|
+
mainQa: {
|
|
72
|
+
auto: boolean;
|
|
73
|
+
debounceMinutes: number;
|
|
74
|
+
budgetMinutes: number | null;
|
|
75
|
+
paused?: {
|
|
76
|
+
at: number;
|
|
77
|
+
runTitle: string;
|
|
78
|
+
reason?: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
merge?: 'squash' | 'merge' | 'ff';
|
|
82
|
+
pullRequests: boolean;
|
|
83
|
+
launch: {
|
|
84
|
+
on: boolean;
|
|
85
|
+
max: number;
|
|
86
|
+
checkersMax: number;
|
|
87
|
+
autoManagers: boolean;
|
|
88
|
+
};
|
|
89
|
+
leadGuard?: string;
|
|
90
|
+
}
|
|
91
|
+
/** A link from the page to what an item is: a task's drawer, a run's log, a checkout's changes. */
|
|
92
|
+
export interface DashProcessLink {
|
|
93
|
+
task?: string;
|
|
94
|
+
run?: string;
|
|
95
|
+
checkout?: string;
|
|
96
|
+
session?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface DashGoalProcess {
|
|
99
|
+
goal: DashProcessGoal;
|
|
100
|
+
worktree?: DashProcessWorktree;
|
|
101
|
+
managers: DashProcessManager[];
|
|
102
|
+
packages: DashProcessPackage[];
|
|
103
|
+
/** The goal's QA runs (`qa` tasks of goal level under it), oldest first. */
|
|
104
|
+
qa: DashProcessQa[];
|
|
105
|
+
/** The rest of the work under the goal — docs, research, a probe, a re-check — oldest first, at most {@link PROCESS_OTHERS_MAX}. */
|
|
106
|
+
others: DashProcessTask[];
|
|
107
|
+
othersMore?: number;
|
|
108
|
+
landing: DashProcessLanding;
|
|
109
|
+
/** Its pull request with the PR merger once the goal completed (issues/closed/hub-19): the merge task, and it in words. */
|
|
110
|
+
merge?: DashMergeQueueItem & {
|
|
111
|
+
text: string;
|
|
112
|
+
};
|
|
113
|
+
mainQa: DashProcessMainQa;
|
|
114
|
+
flags: DashProcessFlag[];
|
|
115
|
+
/** What a live goal waits on right now, and since when — none once it ended (hub-10 «Now»). */
|
|
116
|
+
now?: DashProcessNow;
|
|
117
|
+
/** The span the timeline draws: the goal's first claim (else its making) to its end (else now). */
|
|
118
|
+
span: {
|
|
119
|
+
from: number;
|
|
120
|
+
to: number;
|
|
121
|
+
};
|
|
122
|
+
/** The most packages at work at one time, and when. */
|
|
123
|
+
peak?: {
|
|
124
|
+
packages: number;
|
|
125
|
+
at: number;
|
|
126
|
+
};
|
|
127
|
+
/** What was read in part: the tasks under the goal past the cap, the runs not read, a log cut. */
|
|
128
|
+
partial?: string[];
|
|
129
|
+
}
|
|
130
|
+
export declare const PROCESS_OTHERS_MAX = 30;
|
|
131
|
+
export interface DashProcessGoal {
|
|
132
|
+
id: string;
|
|
133
|
+
number?: number;
|
|
134
|
+
title: string;
|
|
135
|
+
state: string;
|
|
136
|
+
outcome?: string;
|
|
137
|
+
createdAt: number;
|
|
138
|
+
startedAt?: number;
|
|
139
|
+
endedAt?: number;
|
|
140
|
+
/** Its design: the version it runs, when it was approved, by whom — none on a goal made before designs. */
|
|
141
|
+
design?: {
|
|
142
|
+
version: number;
|
|
143
|
+
versions: number;
|
|
144
|
+
stage: string;
|
|
145
|
+
approvedAt?: number;
|
|
146
|
+
file?: string;
|
|
147
|
+
};
|
|
148
|
+
/** What it was planned at: its design's decision, and the plan it runs for. */
|
|
149
|
+
estimate?: {
|
|
150
|
+
packages?: number;
|
|
151
|
+
builds?: number;
|
|
152
|
+
hours?: number;
|
|
153
|
+
spendUsd?: number;
|
|
154
|
+
from?: string;
|
|
155
|
+
units?: string;
|
|
156
|
+
};
|
|
157
|
+
/** `high-risk`, `standard`… — the delivery profile its design pinned. */
|
|
158
|
+
profile?: string;
|
|
159
|
+
timing?: TaskTiming;
|
|
160
|
+
/** The person paused or drained it: when and why, as it stands now. */
|
|
161
|
+
admission?: {
|
|
162
|
+
mode: string;
|
|
163
|
+
at: number;
|
|
164
|
+
reason: string;
|
|
165
|
+
};
|
|
166
|
+
/** Its launches that waited for a slot, as its log says them: the role, when it began to wait, when that role launched next. */
|
|
167
|
+
capWaits: Array<{
|
|
168
|
+
role: string;
|
|
169
|
+
since: number;
|
|
170
|
+
until?: number;
|
|
171
|
+
machine?: boolean;
|
|
172
|
+
}>;
|
|
173
|
+
/** Its review canvas — what the person reviews, before and after (issues/closed/hub-18); none: not made yet. */
|
|
174
|
+
review?: DashGoalReview;
|
|
175
|
+
}
|
|
176
|
+
export interface DashProcessWorktree {
|
|
177
|
+
path: string;
|
|
178
|
+
name?: string;
|
|
179
|
+
branch?: string;
|
|
180
|
+
/** Whether its folder is on this disk now. */
|
|
181
|
+
onDisk: boolean;
|
|
182
|
+
/** Its key on the Changes page (`/changes/<key>`), while it is on disk. */
|
|
183
|
+
key?: string;
|
|
184
|
+
/** What it runs, as Cluster › Worktrees last read it — none: not read. */
|
|
185
|
+
app?: DashTeamWorktreeState;
|
|
186
|
+
/** What the goal-end sweep did with it (issues/closed/foodguard-321) — none: not swept. */
|
|
187
|
+
cleanup?: DashGoalCleanup;
|
|
188
|
+
/** LensMCP's own note of what became of it at the goal's end. */
|
|
189
|
+
note?: string;
|
|
190
|
+
}
|
|
191
|
+
export interface DashProcessManager {
|
|
192
|
+
sessionId: string;
|
|
193
|
+
/** Which claim of the goal it held (1, 2, …). */
|
|
194
|
+
generation: number;
|
|
195
|
+
startedAt: number;
|
|
196
|
+
endedAt?: number;
|
|
197
|
+
/** How its claim ended: `done`, `recovery` (its session ended), … — none: it holds it. */
|
|
198
|
+
outcome?: string;
|
|
199
|
+
launch?: string;
|
|
200
|
+
client?: string;
|
|
201
|
+
model?: string;
|
|
202
|
+
effort?: string;
|
|
203
|
+
/** The account's nickname or name — none: its own sign-in. */
|
|
204
|
+
account?: string;
|
|
205
|
+
/** Who started it: the person, or a manager's spawn. */
|
|
206
|
+
by?: string;
|
|
207
|
+
suspends: number[];
|
|
208
|
+
wakes: number[];
|
|
209
|
+
/** Why its session closed, as the store records it (`suspended`, `session-end`…). */
|
|
210
|
+
closed?: string;
|
|
211
|
+
}
|
|
212
|
+
/** One task of the process, briefly: who held it and when. */
|
|
213
|
+
export interface DashProcessTask {
|
|
214
|
+
id: string;
|
|
215
|
+
title: string;
|
|
216
|
+
kind?: string;
|
|
217
|
+
role?: string;
|
|
218
|
+
state: string;
|
|
219
|
+
outcome?: string;
|
|
220
|
+
createdAt: number;
|
|
221
|
+
/** Its first claim, and its end. */
|
|
222
|
+
claimedAt?: number;
|
|
223
|
+
endedAt?: number;
|
|
224
|
+
/** The agents that held it, in order. */
|
|
225
|
+
owners: string[];
|
|
226
|
+
claims: number;
|
|
227
|
+
}
|
|
228
|
+
export interface DashProcessCheckout {
|
|
229
|
+
/** Whose it is: a writer's (`implementation`, `tests`), the shared one (`work`), or a candidate's. */
|
|
230
|
+
of: 'implementation' | 'tests' | 'work' | 'candidate';
|
|
231
|
+
path: string;
|
|
232
|
+
branch?: string;
|
|
233
|
+
/** When LensMCP made it: the first task that worked in it, or the candidate's preparation. */
|
|
234
|
+
createdAt?: number;
|
|
235
|
+
/** Whether its folder is on this disk now — `false`: removed (LensMCP removes a package's checkouts once it integrates). */
|
|
236
|
+
onDisk: boolean;
|
|
237
|
+
/** The candidate's commit, for a candidate's checkout. */
|
|
238
|
+
sha?: string;
|
|
239
|
+
/** Its key on the Changes page (`/changes/<key>`), while it is on disk. */
|
|
240
|
+
key?: string;
|
|
241
|
+
}
|
|
242
|
+
export interface DashProcessWriter extends DashProcessTask {
|
|
243
|
+
writer: 'implementation' | 'tests';
|
|
244
|
+
/** `implementation`, `test-author`, `repair`. */
|
|
245
|
+
stage: string;
|
|
246
|
+
/** Its writer's publication, when this task made it: the commit and when. */
|
|
247
|
+
published?: {
|
|
248
|
+
sha: string;
|
|
249
|
+
at: number;
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
export interface DashProcessReview extends DashProcessTask {
|
|
253
|
+
/** `preliminary` (an early look) or `final` (of a candidate). */
|
|
254
|
+
stage: 'preliminary' | 'final';
|
|
255
|
+
candidate?: string;
|
|
256
|
+
/** Its round of the role on this package: 1, 2, … */
|
|
257
|
+
round: number;
|
|
258
|
+
}
|
|
259
|
+
export interface DashProcessCandidate {
|
|
260
|
+
sha: string;
|
|
261
|
+
at: number;
|
|
262
|
+
root?: string;
|
|
263
|
+
supersededAt?: number;
|
|
264
|
+
integratedAt?: number;
|
|
265
|
+
proofs: Array<{
|
|
266
|
+
requirementId: string;
|
|
267
|
+
action?: string;
|
|
268
|
+
runId: string;
|
|
269
|
+
state: string;
|
|
270
|
+
lane?: string;
|
|
271
|
+
}>;
|
|
272
|
+
/** Its reviews: the role, the verdict, the task — `carried`: an approval of an earlier candidate with the same patch. */
|
|
273
|
+
reviews: Array<{
|
|
274
|
+
role: string;
|
|
275
|
+
state: string;
|
|
276
|
+
taskId: string;
|
|
277
|
+
carried?: boolean;
|
|
278
|
+
}>;
|
|
279
|
+
/** From its preparation to its first final review's claim — none: none was claimed. */
|
|
280
|
+
reviewWaitMs?: number;
|
|
281
|
+
/** Of the package's writers (`writersOf`), those that held no task of the goal while it waited (`writersIdle`). */
|
|
282
|
+
writersIdle?: number;
|
|
283
|
+
writersOf?: number;
|
|
284
|
+
}
|
|
285
|
+
export interface DashProcessRun {
|
|
286
|
+
runId: string;
|
|
287
|
+
action: string;
|
|
288
|
+
project?: string;
|
|
289
|
+
target?: string;
|
|
290
|
+
state: string;
|
|
291
|
+
lane?: 'light' | 'heavy';
|
|
292
|
+
queuedAt?: number;
|
|
293
|
+
startedAt?: number;
|
|
294
|
+
completedAt?: number;
|
|
295
|
+
durationMs?: number;
|
|
296
|
+
waitedMs?: number;
|
|
297
|
+
/** What it ran over: named files, the specs related to files, a whole target, the affected projects. */
|
|
298
|
+
scope?: 'files' | 'related' | 'test' | 'target' | 'affected';
|
|
299
|
+
/** It ran out of its heap and ran again at a larger one — or was not — as its step says. */
|
|
300
|
+
heap?: string;
|
|
301
|
+
counts?: {
|
|
302
|
+
passed: number;
|
|
303
|
+
failed: number;
|
|
304
|
+
skipped: number;
|
|
305
|
+
total: number;
|
|
306
|
+
};
|
|
307
|
+
/** Why it is listed: a candidate's proof (its requirement), or a QA step's run (its step). */
|
|
308
|
+
for: {
|
|
309
|
+
proof?: string;
|
|
310
|
+
step?: string;
|
|
311
|
+
package?: string;
|
|
312
|
+
};
|
|
313
|
+
/** It is not kept any more (runs are kept 30 days), or not in this home. */
|
|
314
|
+
gone?: true;
|
|
315
|
+
}
|
|
316
|
+
export interface DashProcessPackage {
|
|
317
|
+
id: string;
|
|
318
|
+
title: string;
|
|
319
|
+
/** `separate`: a checkout per writer; `shared`: one for both — chosen when it was declared. */
|
|
320
|
+
mode: 'separate' | 'shared';
|
|
321
|
+
state: string;
|
|
322
|
+
createdAt: number;
|
|
323
|
+
/** When its candidate integrated into the goal's branch. */
|
|
324
|
+
integratedAt?: number;
|
|
325
|
+
/** When its last task ended — for a package that never integrated. */
|
|
326
|
+
endedAt?: number;
|
|
327
|
+
checkouts: DashProcessCheckout[];
|
|
328
|
+
writers: DashProcessWriter[];
|
|
329
|
+
candidates: DashProcessCandidate[];
|
|
330
|
+
reviews: DashProcessReview[];
|
|
331
|
+
runs: DashProcessRun[];
|
|
332
|
+
findings: {
|
|
333
|
+
total: number;
|
|
334
|
+
open: number;
|
|
335
|
+
};
|
|
336
|
+
waivers: number;
|
|
337
|
+
forced: number;
|
|
338
|
+
testsWaived?: boolean;
|
|
339
|
+
/** The tasks it was declared to wait for (`blockedBy`) — another package, as a rule — and when the last of them finished. */
|
|
340
|
+
after?: Array<{
|
|
341
|
+
id: string;
|
|
342
|
+
title: string;
|
|
343
|
+
endedAt?: number;
|
|
344
|
+
}>;
|
|
345
|
+
/** When it could start: its declaration, or the end of the last task it waited for. None: one of them has not ended. */
|
|
346
|
+
readyAt?: number;
|
|
347
|
+
/** From {@link readyAt} to its first writer's claim — how long it waited for a writer once it could start. */
|
|
348
|
+
startWaitMs?: number;
|
|
349
|
+
}
|
|
350
|
+
export interface DashProcessQaStep extends DashTeamStep {
|
|
351
|
+
/** Its time, start to end, when it logged both — and whether it ran past its budget. */
|
|
352
|
+
ms?: number;
|
|
353
|
+
overBudget?: boolean;
|
|
354
|
+
/** Its runs, as read from the machine queue. */
|
|
355
|
+
runs: DashProcessRun[];
|
|
356
|
+
/** It ran wider than the diff reached: a whole target, or the affected graph. */
|
|
357
|
+
wider?: string;
|
|
358
|
+
/** A run of it went in the heavy lane. */
|
|
359
|
+
heavy?: boolean;
|
|
360
|
+
}
|
|
361
|
+
export interface DashProcessQa extends DashProcessTask {
|
|
362
|
+
budgetMinutes?: number | null;
|
|
363
|
+
steps: DashProcessQaStep[];
|
|
364
|
+
/**
|
|
365
|
+
* Its step times do not measure its steps: most were logged done in one write each (no start before their end), or
|
|
366
|
+
* within a minute of each other — the times are when they were written, not how long each ran.
|
|
367
|
+
*/
|
|
368
|
+
loggedAfter?: {
|
|
369
|
+
atOnce: number;
|
|
370
|
+
ended: number;
|
|
371
|
+
inAMinute: number;
|
|
372
|
+
};
|
|
373
|
+
/** The person's waivers of its runs (issues/closed/foodguard-326): which runs, why, by which question. */
|
|
374
|
+
waivers: Array<{
|
|
375
|
+
runs: string[];
|
|
376
|
+
why: string;
|
|
377
|
+
at: number;
|
|
378
|
+
question?: string;
|
|
379
|
+
}>;
|
|
380
|
+
/** Its execution time against its budget: claimed to its end, less the time it was blocked or in recovery. */
|
|
381
|
+
workedMs?: number;
|
|
382
|
+
overBudget?: boolean;
|
|
383
|
+
/** Its result's first lines: what it says it ran and found. */
|
|
384
|
+
verdict?: string;
|
|
385
|
+
}
|
|
386
|
+
export interface DashProcessLanding {
|
|
387
|
+
/** `squash`, `merge`, `ff` by LensMCP; `pull-request`; `by-hand`; none yet (`pending`), or nothing on main (`none`). */
|
|
388
|
+
how: 'lensmcp' | 'pull-request' | 'by-hand' | 'pending' | 'none';
|
|
389
|
+
kind?: string;
|
|
390
|
+
sha?: string;
|
|
391
|
+
at?: number;
|
|
392
|
+
pr?: number;
|
|
393
|
+
/** Delivery's reading (delivery/landing.ts): its one phrase and the person's steps — none when it could not be read. */
|
|
394
|
+
delivery?: DashGoalLanding;
|
|
395
|
+
text: string;
|
|
396
|
+
}
|
|
397
|
+
export interface DashProcessMainQa {
|
|
398
|
+
/** `ran`: a main run whose range holds the landing finished; `running`: one is open; `waiting`: none yet — `when` says when; `paused`; `off`; `not-landed`. */
|
|
399
|
+
state: 'ran' | 'running' | 'waiting' | 'paused' | 'off' | 'not-landed' | 'unknown';
|
|
400
|
+
run?: {
|
|
401
|
+
id: string;
|
|
402
|
+
title: string;
|
|
403
|
+
state: string;
|
|
404
|
+
outcome?: string;
|
|
405
|
+
head?: string;
|
|
406
|
+
base?: string;
|
|
407
|
+
createdAt: number;
|
|
408
|
+
endedAt?: number;
|
|
409
|
+
};
|
|
410
|
+
text: string;
|
|
411
|
+
/** When the lens makes the next main run, by its rule — none when it will not by itself. */
|
|
412
|
+
when?: number;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* What a live goal waits on right now (hub-10 «Now»), from what the store holds — no GitHub call: its open tasks' parked
|
|
416
|
+
* and suspended claims (the holder's own reason, and until when the claim is kept), its manager's suspension, the
|
|
417
|
+
* questions waiting on the person, its launches waiting for a slot, and its manager's last log line.
|
|
418
|
+
*/
|
|
419
|
+
export interface DashProcessNow {
|
|
420
|
+
items: DashProcessNowItem[];
|
|
421
|
+
/** The CI run ids those texts name («run 45639283079»), first seen first. */
|
|
422
|
+
ci: string[];
|
|
423
|
+
}
|
|
424
|
+
export interface DashProcessNowItem {
|
|
425
|
+
kind: 'suspended' | 'parked' | 'manager-suspended' | 'question' | 'cap' | 'manager-log';
|
|
426
|
+
/** Since when it waits — or, for a log line, when it was written. */
|
|
427
|
+
since: number;
|
|
428
|
+
/** A kept claim's end: past it the claim goes to recovery. */
|
|
429
|
+
until?: number;
|
|
430
|
+
/** The holder's or the asker's own words, or the log line — cut. */
|
|
431
|
+
text: string;
|
|
432
|
+
/** The task it is about, to open its drawer; a question's id. */
|
|
433
|
+
task?: {
|
|
434
|
+
id: string;
|
|
435
|
+
title: string;
|
|
436
|
+
role?: string;
|
|
437
|
+
};
|
|
438
|
+
question?: string;
|
|
439
|
+
role?: string;
|
|
440
|
+
}
|
|
441
|
+
export interface DashProcessFlag {
|
|
442
|
+
id: string;
|
|
443
|
+
kind: 'qa-wider' | 'qa-heavy' | 'qa-over-budget' | 'qa-logged-after' | 'cap-wait' | 'start-wait' | 'review-wait' | 'main-qa-missing' | 'qa-not-run' | 'run-gone';
|
|
444
|
+
tone: 'warn' | 'bad' | 'muted';
|
|
445
|
+
text: string;
|
|
446
|
+
link?: DashProcessLink & {
|
|
447
|
+
setting?: DashGoalHowChange;
|
|
448
|
+
};
|
|
449
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const PROCESS_OTHERS_MAX=30;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A goal's review canvas (issues/closed/hub-18): what the person reviews of a finished goal — what it was before
|
|
3
|
+
* and what it is after, in their product's data rather than its code. The owner, 2026-11-25: «i also want to have a good
|
|
4
|
+
* canvas related to each goal and pr so it can be used to see what it was and what is after the pr … so the final canvas
|
|
5
|
+
* will actually be my data to review and not code to review».
|
|
6
|
+
*
|
|
7
|
+
* LensMCP writes its skeleton when the goal's QA passes (apps/canvas review-canvas.ts), and tells the goal's manager in
|
|
8
|
+
* the message that wakes it. The manager fills it before it completes the goal — a goal with a design completes only
|
|
9
|
+
* once every section here is filled ({@link reviewCanvasGaps}). It never holds the merge: the goal's pull request merges
|
|
10
|
+
* on its checks, and what the person finds wrong on the canvas becomes a follow-up goal («Something's wrong»).
|
|
11
|
+
*/
|
|
12
|
+
/** LensMCP's label on a goal's review canvas: the Canvases page and the canvas page know it by it. */
|
|
13
|
+
export declare const REVIEW_CANVAS_TAG = "goal-review";
|
|
14
|
+
/** What a section of the review canvas asks for — its heading, and the prompt the skeleton puts under it. */
|
|
15
|
+
export interface ReviewSection {
|
|
16
|
+
key: 'was' | 'now' | 'diagram' | 'check' | 'shots' | 'proven' | 'left';
|
|
17
|
+
heading: string;
|
|
18
|
+
ask: string;
|
|
19
|
+
/** It may say «none: <why>» — a docs-only goal, or one with no app behaviour. */
|
|
20
|
+
none?: true;
|
|
21
|
+
/** It holds a ```diagram fence of kind before-after. */
|
|
22
|
+
diagram?: true;
|
|
23
|
+
}
|
|
24
|
+
/** The sections, top to bottom, in the person's words. Code appears only under {@link REVIEW_FILES_HEADING}, at the end. */
|
|
25
|
+
export declare const REVIEW_SECTIONS: readonly ReviewSection[];
|
|
26
|
+
/** The last section: the changed files, collapsed — the only code on the canvas. */
|
|
27
|
+
export declare const REVIEW_FILES_HEADING = "Files changed";
|
|
28
|
+
/** The words that open each of the skeleton's prompts: a blockquote that begins with them is still to fill. */
|
|
29
|
+
export declare const REVIEW_TO_FILL = "**To fill \u2014**";
|
|
30
|
+
export type ReviewGapProblem = 'missing' | 'empty' | 'prompt' | 'none-why' | 'no-diagram' | 'not-before-after' | 'files-not-last' | 'files-open';
|
|
31
|
+
/** One thing the review canvas still lacks, with the words a refusal says. */
|
|
32
|
+
export interface ReviewGap {
|
|
33
|
+
/** The section's key, or `files` for «Files changed», `canvas` for the whole. */
|
|
34
|
+
key: ReviewSection['key'] | 'files' | 'canvas';
|
|
35
|
+
heading: string;
|
|
36
|
+
problem: ReviewGapProblem;
|
|
37
|
+
text: string;
|
|
38
|
+
}
|
|
39
|
+
/** A heading as the rules compare it: lower case, «->» an arrow, its punctuation and spaces folded. */
|
|
40
|
+
export declare function reviewHeadingKey(heading: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* What the review canvas still lacks — none: it is filled. The rules, in order:
|
|
43
|
+
*
|
|
44
|
+
* 1. every section of {@link REVIEW_SECTIONS} is there, as a `##` heading (in any order);
|
|
45
|
+
* 2. each holds words of its own — the skeleton's «To fill» prompt, comments and blank lines are not words;
|
|
46
|
+
* 3. «What you can check yourself» and «Screenshots» may say «none: <why>» — never a bare «none»;
|
|
47
|
+
* 4. «Before → after» holds a ```diagram fence of `kind: before-after`;
|
|
48
|
+
* 5. no «To fill» prompt is left anywhere, «Files changed» included;
|
|
49
|
+
* 6. «Files changed», when there, is the last section, inside `<Details>` — the only code is collapsed, at the end.
|
|
50
|
+
*
|
|
51
|
+
* The canvas checker (it draws, apps/canvas review-canvas.ts) is the other half of the gate.
|
|
52
|
+
*/
|
|
53
|
+
export declare function reviewCanvasGaps(mdx: string): ReviewGap[];
|
|
54
|
+
/** The gaps as one refusal's text: each on its own line. */
|
|
55
|
+
export declare function reviewGapsText(gaps: readonly ReviewGap[], max?: number): string;
|
|
56
|
+
/** The person's word on a review canvas: the goal looks right, or something is wrong — a follow-up goal. */
|
|
57
|
+
export declare const GOAL_REVIEW_VERDICTS: readonly ["looks-right", "something-wrong"];
|
|
58
|
+
export type GoalReviewVerdictKind = (typeof GOAL_REVIEW_VERDICTS)[number];
|
|
59
|
+
/** «Something's wrong»'s one line: what the person found. */
|
|
60
|
+
export declare const GOAL_REVIEW_NOTE_MAX = 300;
|
|
61
|
+
/** A goal a review's «Something's wrong» made. */
|
|
62
|
+
export interface DashGoalReviewFollowUp {
|
|
63
|
+
id: string;
|
|
64
|
+
number?: number;
|
|
65
|
+
title: string;
|
|
66
|
+
state?: string;
|
|
67
|
+
}
|
|
68
|
+
/** The person's newest word on the review. */
|
|
69
|
+
export interface DashGoalReviewVerdict {
|
|
70
|
+
kind: GoalReviewVerdictKind;
|
|
71
|
+
at: number;
|
|
72
|
+
note?: string;
|
|
73
|
+
/** «Something's wrong»: the follow-up goal it made. */
|
|
74
|
+
followUp?: DashGoalReviewFollowUp;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A goal's review canvas as the dashboard shows it — Team › Process, the goal's drawer, Delivery's row, the canvas page's
|
|
78
|
+
* dock (`GET /api/team/goal-review?goal=`).
|
|
79
|
+
*/
|
|
80
|
+
export interface DashGoalReview {
|
|
81
|
+
canvasId: string;
|
|
82
|
+
/** When LensMCP made its skeleton, and who (`lensmcp`). */
|
|
83
|
+
at: number;
|
|
84
|
+
by: string;
|
|
85
|
+
/** Where the person opens it: the canvas's own link. */
|
|
86
|
+
url?: string;
|
|
87
|
+
/**
|
|
88
|
+
* `filled`: every section says what it should, and it draws; `unfilled`: what it lacks is in `gaps`; `gone`: the canvas
|
|
89
|
+
* is not in this machine's canvas store; `unread`: not read now.
|
|
90
|
+
*/
|
|
91
|
+
state: 'filled' | 'unfilled' | 'gone' | 'unread';
|
|
92
|
+
/** What it lacks, each in a line (the gate's words). */
|
|
93
|
+
gaps?: string[];
|
|
94
|
+
/** The version the person sees. */
|
|
95
|
+
version?: number;
|
|
96
|
+
verdict?: DashGoalReviewVerdict;
|
|
97
|
+
/** Every follow-up goal its «Something's wrong» made, oldest first. */
|
|
98
|
+
followUps?: DashGoalReviewFollowUp[];
|
|
99
|
+
}
|
|
100
|
+
/** `GET /api/team/goal-review?goal=`: the goal, whether it has a design (the gate holds its completion), and its review. */
|
|
101
|
+
export interface DashGoalReviewAnswer {
|
|
102
|
+
goal: {
|
|
103
|
+
id: string;
|
|
104
|
+
number?: number;
|
|
105
|
+
title: string;
|
|
106
|
+
state: string;
|
|
107
|
+
hasDesign: boolean;
|
|
108
|
+
};
|
|
109
|
+
review?: DashGoalReview;
|
|
110
|
+
/** No review canvas yet: why, in words — it is made when the goal's QA passes. */
|
|
111
|
+
why?: string;
|
|
112
|
+
}
|
|
113
|
+
/** `POST /api/team/goal-review`: the person's «Looks right» or «Something's wrong» (with its one line). */
|
|
114
|
+
export interface DashGoalReviewVerdictRequest {
|
|
115
|
+
goal: string;
|
|
116
|
+
verdict: GoalReviewVerdictKind;
|
|
117
|
+
note?: string;
|
|
118
|
+
}
|
|
119
|
+
/** A goal's review as Delivery's row shows it: where it is, and the person's word. */
|
|
120
|
+
export interface DashGoalReviewBrief {
|
|
121
|
+
canvasId: string;
|
|
122
|
+
url?: string;
|
|
123
|
+
verdict?: GoalReviewVerdictKind;
|
|
124
|
+
at?: number;
|
|
125
|
+
followUp?: DashGoalReviewFollowUp;
|
|
126
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";var y=Object.defineProperty;var l=(r,s)=>y(r,"name",{value:s,configurable:!0});var k=Object.defineProperty,c=l((r,s)=>k(r,"name",{value:s,configurable:!0}),"l");export const REVIEW_CANVAS_TAG="goal-review",REVIEW_SECTIONS=[{key:"was",heading:"What it was",ask:"today's behaviour, in the product's terms and data: what the person sees and does now. A goal that is docs-only, or has no app behaviour, says so here."},{key:"now",heading:"What it is now",ask:"the same, after this goal: what the person sees and does now, in the same terms."},{key:"diagram",heading:"Before \u2192 after",ask:"a `diagram` fence of kind before-after: the flow today and after this goal, in the product's words \u2014 never code.",diagram:!0},{key:"check",heading:"What you can check yourself",ask:"the pages and flows to open in the goal's running app, each a link to its host, and the data rows or answers that changed \u2014 before/after tables of the real values QA read. If there is none, say \xABnone:\xBB and why.",none:!0},{key:"shots",heading:"Screenshots",ask:"before and after, when the goal has a UI. If there is none, say \xABnone:\xBB and why.",none:!0},{key:"proven",heading:"What was proven",ask:"each Done line with its evidence \u2014 QA's steps, runs, stories \u2014 and anything waived: who waived it, and why."},{key:"left",heading:"What it did not change, and risks",ask:"what is left, the risks, and the follow-ups."}],REVIEW_FILES_HEADING="Files changed",REVIEW_TO_FILL="**To fill \u2014**";const x=/^\s{0,3}(`{3,}|~{3,})\s*([A-Za-z0-9_-]*)/,b=/^\s{0,3}##\s+(.+?)\s*#*\s*$/;export function reviewHeadingKey(r){return r.toLowerCase().replace(/->|=>/g,"\u2192").replace(/[*_`«»"'.:]/g,"").replace(/\s+/g," ").trim()}l(reviewHeadingKey,"reviewHeadingKey"),c(reviewHeadingKey,"reviewHeadingKey");function w(r){const s=r.replace(/\r\n?/g,`
|
|
2
|
+
`).split(`
|
|
3
|
+
`);let h=0;if(s[0]?.trim()==="---"){const t=s.findIndex((e,a)=>a>0&&e.trim()==="---");t>0&&(h=t+1)}const n=[];let i,o;for(;h<s.length;h++){const t=s[h],e=x.exec(t);if(o){e&&e[1].startsWith(o.mark[0])&&e[1].length>=o.mark.length&&!t.trim().slice(e[1].length).trim()?(i?.fences.push({info:o.info,body:o.body.join(`
|
|
4
|
+
`)}),i?.lines.push(t),o=void 0):(o.body.push(t),i?.lines.push(t));continue}if(e){o={mark:e[1],info:(e[2]??"").toLowerCase(),body:[]},i?.lines.push(t);continue}const a=b.exec(t);if(a){i={heading:a[1],at:n.length,lines:[],fences:[]},n.push(i);continue}i?.lines.push(t)}return o&&i&&i.fences.push({info:o.info,body:o.body.join(`
|
|
5
|
+
`)}),n}l(w,"k"),c(w,"partsOf");function f(r){const s=[];let h=0,n=!1,i=!1;for(const o of r){const t=o.trim();if(i){(t.includes("*/}")||t.includes("-->"))&&(i=!1);continue}if(/^\{\/\*/.test(t)||t.startsWith("<!--")){!t.includes("*/}")&&!t.includes("-->")&&(i=!0);continue}if(t.startsWith(">")){if(t.replace(/^>\s?/,"").trim().startsWith(REVIEW_TO_FILL)){h++,n=!0;continue}if(n)continue}else n=!1;!t||/^<\/?Details\b[^>]*>$/.test(t)||s.push(t)}return{words:s,prompts:h}}l(f,"p"),c(f,"wordsOf");const B=/^(?:\*\*|_)?none(?:\*\*|_)?\s*(?:[:—–-]\s*)?(.*)$/i;export function reviewCanvasGaps(r){const s=w(r),h=new Map;for(const e of s)h.has(reviewHeadingKey(e.heading))||h.set(reviewHeadingKey(e.heading),e);const n=[],i=c(e=>{const a=reviewHeadingKey(e);return h.get(a)??s.find(d=>reviewHeadingKey(d.heading).startsWith(`${a} `))},"find");for(const e of REVIEW_SECTIONS){const a=i(e.heading),d=`\xAB${e.heading}\xBB`;if(!a){n.push({key:e.key,heading:e.heading,problem:"missing",text:`${d} is missing \u2014 add it as \`## ${e.heading}\`: ${e.ask}`});continue}const{words:g,prompts:u}=f(a.lines),m=a.fences.filter(p=>p.info==="diagram");if(!g.length&&!m.length){n.push({key:e.key,heading:e.heading,problem:u?"prompt":"empty",text:`${d} is ${u?"still the skeleton's prompt":"empty"} \u2014 ${e.ask}`});continue}if(u&&n.push({key:e.key,heading:e.heading,problem:"prompt",text:`${d} still holds the skeleton's \xABTo fill\xBB prompt \u2014 take it out once the section says it`}),e.none&&g.length===1){const p=B.exec(g[0]);p&&!p[1].replace(/[.\s*_]/g,"")&&n.push({key:e.key,heading:e.heading,problem:"none-why",text:`${d} says \xABnone\xBB with no why \u2014 write \xABnone: <why>\xBB (docs-only, no app behaviour, no UI)`})}e.diagram&&(m.length?m.some(p=>/^\s*kind\s*:\s*['"]?before-after['"]?\s*(?:#.*)?$/m.test(p.body))||n.push({key:e.key,heading:e.heading,problem:"not-before-after",text:`${d}'s \`\`\`diagram is not \`kind: before-after\` \u2014 this section shows what it was and what it is now side by side`}):n.push({key:e.key,heading:e.heading,problem:"no-diagram",text:`${d} has no \`\`\`diagram fence \u2014 draw the flow before and after as \`kind: before-after\`, with \`before\` and \`after\` nodes in the product's words`}))}const o=i(REVIEW_FILES_HEADING);if(o){const{prompts:e}=f(o.lines);e&&n.push({key:"files",heading:REVIEW_FILES_HEADING,problem:"prompt",text:`\xAB${REVIEW_FILES_HEADING}\xBB is still the skeleton's prompt \u2014 list the changed files, or take the section out`}),o.at!==s.length-1&&n.push({key:"files",heading:REVIEW_FILES_HEADING,problem:"files-not-last",text:`\xAB${REVIEW_FILES_HEADING}\xBB is not the last section \u2014 the code comes last, after what the person reviews`}),f(o.lines).words.length&&!o.lines.some(a=>/^\s*<Details\b/.test(a))&&n.push({key:"files",heading:REVIEW_FILES_HEADING,problem:"files-open",text:`\xAB${REVIEW_FILES_HEADING}\xBB is not collapsed \u2014 put its list inside \`<Details summary="Files changed">\``})}const t=new Set([...REVIEW_SECTIONS.map(e=>e.heading),REVIEW_FILES_HEADING].map(reviewHeadingKey));for(const e of s){const a=reviewHeadingKey(e.heading);t.has(a)||[...t].some(d=>a.startsWith(`${d} `))||f(e.lines).prompts&&n.push({key:"canvas",heading:e.heading,problem:"prompt",text:`\xAB${e.heading}\xBB still holds a \xABTo fill\xBB prompt`})}return n}l(reviewCanvasGaps,"reviewCanvasGaps"),c(reviewCanvasGaps,"reviewCanvasGaps");export function reviewGapsText(r,s=12){return[...r.slice(0,s).map(h=>`- ${h.text}`),...r.length>s?[`- and ${r.length-s} more`]:[]].join(`
|
|
6
|
+
`)}l(reviewGapsText,"reviewGapsText"),c(reviewGapsText,"reviewGapsText");export const GOAL_REVIEW_VERDICTS=["looks-right","something-wrong"],GOAL_REVIEW_NOTE_MAX=300;
|
package/lib/host-agents.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var c=Object.defineProperty;var o=(t,e)=>c(t,"name",{value:e,configurable:!0});var u=Object.defineProperty,n=o((t,e)=>u(t,"name",{value:e,configurable:!0}),"s"),i=Object.defineProperty,s=n((t,e)=>i(t,"name",{value:e,configurable:!0}),"o");export const HOST_AGENT_CLIENTS=["claude","codex"],HOST_AGENTS_FILES={agents:"host-agents.json",ceilings:"host-ceilings.json"},HOST_AGENTS_LIMITS={accounts:32,windows:6,label:60,why:300,plan:40,name:40,agents:64},HOST_ACCOUNT_ID=/^ac-[a-z0-9]{1,12}-[a-f0-9]{6}$/;const r=[/\bsk-[A-Za-z0-9_-]{16,}/,/\b[rs]k_(?:live|test)_[A-Za-z0-9]{12,}/,/\bgh[pousr]_[A-Za-z0-9]{20,}|\bgithub_pat_[A-Za-z0-9_]{20,}/,/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/,/\bxox[abposr]-[A-Za-z0-9-]{10,}/,/\bAIza[0-9A-Za-z_-]{30,}/,/\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{4,}/,/-----BEGIN [A-Z ]*(?:PRIVATE KEY|CERTIFICATE)-----/,/\bbearer\s+[A-Za-z0-9._~+/=-]{12,}/i],A=/[A-Za-z0-9+/_=-]{32,}/g;export function tokenShaped(t){if(r.some(e=>e.test(t)))return!0;for(const e of t.match(A)??[])if(/\d/.test(e)&&/[A-Za-z]/.test(e))return!0;return!1}o(tokenShaped,"tokenShaped"),n(tokenShaped,"tokenShaped"),s(tokenShaped,"tokenShaped");export function withoutTokens(t){let e=t;for(const a of r)e=e.replace(new RegExp(a.source,a.flags.includes("g")?a.flags:`${a.flags}g`),"\u2026");return e.replace(A,a=>/\d/.test(a)&&/[A-Za-z]/.test(a)?"\u2026":a)}o(withoutTokens,"withoutTokens"),n(withoutTokens,"withoutTokens"),s(withoutTokens,"withoutTokens");
|
package/lib/lens-hosts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var c=Object.defineProperty;var r=(e,n)=>c(e,"name",{value:n,configurable:!0});var i=Object.defineProperty,t=r((e,n)=>i(e,"name",{value:n,configurable:!0}),"t"),u=Object.defineProperty,o=t((e,n)=>u(e,"name",{value:n,configurable:!0}),"r");export const LENS_HOST="lensmcp.localhost",LEGACY_LENS_HOST="lensmcp.local",CANVAS_LINK_PATH="/canvas";export function lensOrigin(e={}){const n=e.port!==void 0&&e.port!==443?`:${e.port}`:"";return`https://${e.host||LENS_HOST}${n}`}r(lensOrigin,"lensOrigin"),t(lensOrigin,"lensOrigin"),o(lensOrigin,"lensOrigin");export function dashboardLink(e,n="",a={}){const s=e.replace(/\/+$/,"");return`${lensOrigin(a)}${s}/${n.replace(/^\/+/,"")}`}r(dashboardLink,"dashboardLink"),t(dashboardLink,"dashboardLink"),o(dashboardLink,"dashboardLink");export function canvasKeyFreeLink(e,n={}){return`${lensOrigin(n)}${CANVAS_LINK_PATH}/${e}`}r(canvasKeyFreeLink,"canvasKeyFreeLink"),t(canvasKeyFreeLink,"canvasKeyFreeLink"),o(canvasKeyFreeLink,"canvasKeyFreeLink");export function gatewayPortFromEnv(e){const n=Number((e.LENSMCP_GATEWAY_PORTS??"").split(",")[0]);return Number.isInteger(n)&&n>0&&n<65536?n:void 0}r(gatewayPortFromEnv,"gatewayPortFromEnv"),t(gatewayPortFromEnv,"gatewayPortFromEnv"),o(gatewayPortFromEnv,"gatewayPortFromEnv");export function currentLensHost(e){return e.trim().toLowerCase()===LEGACY_LENS_HOST?LENS_HOST:e}r(currentLensHost,"currentLensHost"),t(currentLensHost,"currentLensHost"),o(currentLensHost,"currentLensHost");
|
package/lib/lint-coverage.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var C=Object.defineProperty;var p=(e,r)=>C(e,"name",{value:r,configurable:!0});var k=Object.defineProperty,h=p((e,r)=>k(e,"name",{value:r,configurable:!0}),"g"),A=Object.defineProperty,d=h((e,r)=>A(e,"name",{value:r,configurable:!0}),"i");import{TRUNCATION_MARKER_KEY as j}from"./bounded-clone.js";export const LINT_COVER_KIND="lint-cover",MAX_LINT_UNCOMMITTED=500;const L=["tree","paths","changed","incremental"],m=d(e=>Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.length>0):[],"strings"),i=d(e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.floor(e):void 0,"count"),l=d(e=>typeof e=="string"&&e?e:void 0,"text");export function readLintCoverage(e){if(!e||typeof e!="object"||e[j])return;const r=e.coverage;if(!r||typeof r!="object")return;const t=r,n=t.kind,a=t.root;if(!L.includes(n)||typeof a!="string"||!a)return;const u=m(t.dirs),o=m(t.files),g=m(t.gone),$=i(t.notLinted),y=i(t.untracked),s=t.base&&typeof t.base=="object"?t.base:void 0,v=s&&l(s.sha)&&l(s.run)?{from:s.from==="main"?"main":"own",sha:s.sha,run:s.run}:void 0,b=Array.isArray(t.inputs)?t.inputs.flatMap(f=>Array.isArray(f)&&typeof f[0]=="string"&&typeof f[1]=="string"?[[f[0],f[1]]]:[]):void 0;return{kind:n,root:a,dirs:u,files:o,gone:g,fileCount:i(t.fileCount)??o.length,goneCount:i(t.goneCount)??g.length,linted:i(t.linted)??0,...i(t.dirCount)!==void 0?{dirCount:i(t.dirCount)}:{},...$?{notLinted:$}:{},...y?{untracked:y}:{},...l(t.since)?{since:t.since}:{},...l(t.head)?{head:t.head}:{},...typeof t.dirty=="boolean"?{dirty:t.dirty}:{},...Array.isArray(t.uncommitted)?{uncommitted:m(t.uncommitted)}:{},...t.uncommittedMore===!0?{uncommittedMore:!0}:{},...b?{inputs:b}:{},...l(t.folder)?{folder:t.folder}:{},...t.projects===!0?{projects:!0}:{},...v?{base:v}:{},...t.fromZero===!0?{fromZero:!0}:{},...t.narrowed===!0?{narrowed:!0}:{}}}p(readLintCoverage,"readLintCoverage"),h(readLintCoverage,"readLintCoverage"),d(readLintCoverage,"readLintCoverage");const c=d((e,r)=>`${e} ${r}${e===1?"":"s"}`,"some");export function lintCoverageLabel(e,r={}){const t=e.files??0,n=e.gone??0;if(e.kind==="changed"){const o=`since ${e.since??"HEAD"}`;if(!t)return`${c(n,"deleted file")} ${o}`;const g=r.untracked&&e.untracked?` (${e.untracked} untracked)`:"";return`${c(t,"changed file")} ${o}${g}${n?`, ${n} deleted`:""}`}if(e.kind==="incremental"){const o=e.since?` since ${e.since.slice(0,7)}`:"";return!t&&!n?`nothing changed${o}`:t?`${c(t,"file")} changed${o}${n?`, ${n} deleted`:""}`:`${c(n,"file")} deleted${o}`}if(e.kind==="tree"&&e.projects)return`the workspace\u2019s ${c(e.projects,"project")}`;if(e.kind==="tree"&&e.paths[0]===".")return"whole checkout";if(e.narrowed)return`${c(t,"file")} ESLint linted with the caller\u2019s arguments`;const a=e.paths.slice(0,3).join(", "),u=(e.more??0)+Math.max(0,e.paths.length-3);return u?`${a} +${u} more`:a}p(lintCoverageLabel,"lintCoverageLabel"),h(lintCoverageLabel,"lintCoverageLabel"),d(lintCoverageLabel,"lintCoverageLabel");
|