@lensmcp/protocol-types 1.26.37 → 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 +4 -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/delivery-actions.d.ts +25 -2
- package/lib/delivery-actions.js +1 -1
- package/lib/delivery-status.d.ts +8 -1
- 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 +8 -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 +30 -30
- 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.js +1 -1
- package/lib/team.d.ts +9 -2
- package/lib/team.js +1 -1
- package/package.json +1 -1
package/lib/source.d.ts
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import type { DashChangesFileKind } from './changes.js';
|
|
2
|
+
import type { DashDeliveryActionCheck, DashDeliveryActionRef } from './delivery-actions.js';
|
|
3
|
+
/**
|
|
4
|
+
* Source (issues/closed/hub-15): the one page for the repository's git state — replacing Delivery. The owner,
|
|
5
|
+
* 2026-11-25: «display all worktree, prs, overview … all branches, open prs, worktrees, changes between them, always up
|
|
6
|
+
* to date summary with claude api that read everything and understand the status, source code that can check specific
|
|
7
|
+
* pr changes, or branch source code and edit files all from the page».
|
|
8
|
+
*
|
|
9
|
+
* /source Overview: Claude's summary, then Delivery's status (its hero lines, the lanes, main, …)
|
|
10
|
+
* /source/branches every local branch and origin's
|
|
11
|
+
* /source/prs Delivery's pull requests
|
|
12
|
+
* /source/worktrees every worktree of the repository
|
|
13
|
+
* /source/compare two refs: the commits and files between them, each file's diff
|
|
14
|
+
* /source/code a ref's tree and a file at it — editable by the person
|
|
15
|
+
*
|
|
16
|
+
* Every read is cached and answers at once (stale while it is read again); the writes are the person's alone.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SOURCE_TABS: readonly ["overview", "branches", "prs", "worktrees", "compare", "code"];
|
|
19
|
+
export type SourceTab = (typeof SOURCE_TABS)[number];
|
|
20
|
+
/** Who a branch or a worktree belongs to. */
|
|
21
|
+
export type DashSourceOwner = {
|
|
22
|
+
kind: 'main';
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'goal';
|
|
25
|
+
goalId: string;
|
|
26
|
+
number?: number;
|
|
27
|
+
title: string;
|
|
28
|
+
state: string;
|
|
29
|
+
} | {
|
|
30
|
+
kind: 'package';
|
|
31
|
+
goalId: string;
|
|
32
|
+
packageId: string;
|
|
33
|
+
title?: string;
|
|
34
|
+
state?: string;
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'person';
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'lens';
|
|
39
|
+
name: string;
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'merger';
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'other';
|
|
44
|
+
};
|
|
45
|
+
/** A pull request as a branch row names it. */
|
|
46
|
+
export interface DashSourcePrMark {
|
|
47
|
+
number: number;
|
|
48
|
+
title: string;
|
|
49
|
+
url: string;
|
|
50
|
+
state: 'open' | 'draft' | 'merged' | 'closed';
|
|
51
|
+
ready?: boolean;
|
|
52
|
+
/** Its first reason not to merge, when open and not ready. */
|
|
53
|
+
blocked?: string;
|
|
54
|
+
}
|
|
55
|
+
/** One branch — a local one (with its origin twin's state), or origin's alone. */
|
|
56
|
+
export interface DashSourceBranch {
|
|
57
|
+
/** `main`, `lensmcp/g-…`; an origin-only branch as `origin/<name>`. */
|
|
58
|
+
name: string;
|
|
59
|
+
/** Its full ref: `refs/heads/…`, `refs/remotes/origin/…`. */
|
|
60
|
+
ref: string;
|
|
61
|
+
where: 'local' | 'origin';
|
|
62
|
+
tip: string;
|
|
63
|
+
/** Its upstream (`origin/x`) and how far apart they are — `gone`: the upstream was deleted. */
|
|
64
|
+
upstream?: string;
|
|
65
|
+
toPush?: number;
|
|
66
|
+
toPull?: number;
|
|
67
|
+
gone?: true;
|
|
68
|
+
/** Commits it has that main lacks, and main has that it lacks — undefined: not counted (the read's bound). */
|
|
69
|
+
ahead?: number;
|
|
70
|
+
behind?: number;
|
|
71
|
+
/** Main holds its work: by ancestry, by its merged pull request, or by the overseer's census (a squash landed). */
|
|
72
|
+
merged?: 'ancestor' | 'pr' | 'landed';
|
|
73
|
+
last: {
|
|
74
|
+
sha: string;
|
|
75
|
+
at: number;
|
|
76
|
+
author: string;
|
|
77
|
+
email?: string;
|
|
78
|
+
subject: string;
|
|
79
|
+
};
|
|
80
|
+
owner: DashSourceOwner;
|
|
81
|
+
pr?: DashSourcePrMark;
|
|
82
|
+
/** The worktree that has it checked out. */
|
|
83
|
+
worktree?: {
|
|
84
|
+
key: string;
|
|
85
|
+
root: string;
|
|
86
|
+
name: string;
|
|
87
|
+
main?: true;
|
|
88
|
+
};
|
|
89
|
+
/** The person's: their git identity wrote its last commit, or a `person/` branch. */
|
|
90
|
+
mine?: true;
|
|
91
|
+
/** Its last commit is older than {@link SOURCE_STALE_DAYS} days. */
|
|
92
|
+
stale?: true;
|
|
93
|
+
isMain?: true;
|
|
94
|
+
}
|
|
95
|
+
export declare const SOURCE_STALE_DAYS = 30;
|
|
96
|
+
export interface DashSourceBranches {
|
|
97
|
+
at: number;
|
|
98
|
+
/** What ahead and behind count against: the main branch, its ref and tip. */
|
|
99
|
+
main: {
|
|
100
|
+
name: string;
|
|
101
|
+
ref: string;
|
|
102
|
+
tip?: string;
|
|
103
|
+
upstream?: string;
|
|
104
|
+
};
|
|
105
|
+
/** The person's git identity (`user.name`, `user.email`) — what «mine» reads. */
|
|
106
|
+
me?: {
|
|
107
|
+
name?: string;
|
|
108
|
+
email?: string;
|
|
109
|
+
};
|
|
110
|
+
branches: DashSourceBranch[];
|
|
111
|
+
/** Branches read, and how many past the bound were left out. */
|
|
112
|
+
total: number;
|
|
113
|
+
cut?: number;
|
|
114
|
+
counts: {
|
|
115
|
+
local: number;
|
|
116
|
+
origin: number;
|
|
117
|
+
mine: number;
|
|
118
|
+
goals: number;
|
|
119
|
+
stale: number;
|
|
120
|
+
merged: number;
|
|
121
|
+
unpushed: number;
|
|
122
|
+
};
|
|
123
|
+
/** The local branches «Delete merged branches» may delete now: main holds each, nothing has it checked out, no live goal owns it. */
|
|
124
|
+
deletable: number;
|
|
125
|
+
problems: string[];
|
|
126
|
+
}
|
|
127
|
+
/** Who works in a worktree now. */
|
|
128
|
+
export interface DashSourceHolder {
|
|
129
|
+
kind: 'session' | 'goal' | 'package';
|
|
130
|
+
/** «Claude Code — se-1a2b (working)», «G-12 «Retry the checkout» — its manager», «the package's writer». */
|
|
131
|
+
label: string;
|
|
132
|
+
/** The session's id, or the goal's. */
|
|
133
|
+
id?: string;
|
|
134
|
+
state?: string;
|
|
135
|
+
since?: number;
|
|
136
|
+
}
|
|
137
|
+
export type DashSourceWorktreeGroup = 'main' | 'goal' | 'package' | 'merger' | 'lens' | 'person' | 'other';
|
|
138
|
+
export interface DashSourceWorktree {
|
|
139
|
+
/** `main`, or 12 hex of its path (the Changes page's key). */
|
|
140
|
+
key: string;
|
|
141
|
+
root: string;
|
|
142
|
+
/** Its folder, `~`-relative when under the home. */
|
|
143
|
+
where: string;
|
|
144
|
+
group: DashSourceWorktreeGroup;
|
|
145
|
+
name: string;
|
|
146
|
+
branch?: string;
|
|
147
|
+
head?: string;
|
|
148
|
+
detached?: true;
|
|
149
|
+
/** git lists it, its folder is gone. */
|
|
150
|
+
missing?: true;
|
|
151
|
+
locked?: true;
|
|
152
|
+
/** Its uncommitted files — undefined while not read. */
|
|
153
|
+
dirty?: {
|
|
154
|
+
files: number;
|
|
155
|
+
paths: string[];
|
|
156
|
+
};
|
|
157
|
+
/** When its status was read; `error`: why it was not (a timeout says so). */
|
|
158
|
+
status?: {
|
|
159
|
+
at: number;
|
|
160
|
+
error?: string;
|
|
161
|
+
};
|
|
162
|
+
/** Commits of its HEAD main lacks, and main's it lacks. */
|
|
163
|
+
ahead?: number;
|
|
164
|
+
behind?: number;
|
|
165
|
+
owner: DashSourceOwner;
|
|
166
|
+
holders: DashSourceHolder[];
|
|
167
|
+
/** Its app, as the lens's instances say (Delivery's words). */
|
|
168
|
+
app?: {
|
|
169
|
+
state: string;
|
|
170
|
+
text: string;
|
|
171
|
+
};
|
|
172
|
+
/** A finished goal's worktree: what the goal-end sweep did or keeps. */
|
|
173
|
+
cleanup?: {
|
|
174
|
+
state: string;
|
|
175
|
+
text: string;
|
|
176
|
+
tone: 'ok' | 'warn' | 'bad' | 'muted';
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
export interface DashSourceWorktrees {
|
|
180
|
+
at: number;
|
|
181
|
+
mainRoot: string;
|
|
182
|
+
worktrees: DashSourceWorktree[];
|
|
183
|
+
counts: {
|
|
184
|
+
total: number;
|
|
185
|
+
dirty: number;
|
|
186
|
+
held: number;
|
|
187
|
+
missing: number;
|
|
188
|
+
};
|
|
189
|
+
problems: string[];
|
|
190
|
+
}
|
|
191
|
+
export interface DashSourceWorktreeFiles {
|
|
192
|
+
key: string;
|
|
193
|
+
at: number;
|
|
194
|
+
files: Array<{
|
|
195
|
+
path: string;
|
|
196
|
+
kind: DashChangesFileKind;
|
|
197
|
+
from?: string;
|
|
198
|
+
}>;
|
|
199
|
+
total: number;
|
|
200
|
+
cut?: true;
|
|
201
|
+
}
|
|
202
|
+
/** A ref the page names, resolved. */
|
|
203
|
+
export interface DashSourceRef {
|
|
204
|
+
/** What was asked: `main`, `origin/x`, `#140`, a sha. */
|
|
205
|
+
input: string;
|
|
206
|
+
/** What git was asked for. */
|
|
207
|
+
ref: string;
|
|
208
|
+
sha: string;
|
|
209
|
+
/** How the page shows it: `main`, `#140 lensmcp/g-retry`, `3f2a9c1`. */
|
|
210
|
+
label: string;
|
|
211
|
+
kind: 'branch' | 'origin' | 'pr' | 'commit' | 'tag';
|
|
212
|
+
/** A local branch it is (an edit's target). */
|
|
213
|
+
branch?: string;
|
|
214
|
+
}
|
|
215
|
+
export interface DashSourceCommit {
|
|
216
|
+
sha: string;
|
|
217
|
+
subject: string;
|
|
218
|
+
author: string;
|
|
219
|
+
at: number;
|
|
220
|
+
merge?: true;
|
|
221
|
+
}
|
|
222
|
+
export interface DashSourceChangedFile {
|
|
223
|
+
path: string;
|
|
224
|
+
kind: DashChangesFileKind;
|
|
225
|
+
from?: string;
|
|
226
|
+
added?: number;
|
|
227
|
+
removed?: number;
|
|
228
|
+
binary?: true;
|
|
229
|
+
}
|
|
230
|
+
export interface DashSourceCompare {
|
|
231
|
+
at: number;
|
|
232
|
+
base: DashSourceRef;
|
|
233
|
+
head: DashSourceRef;
|
|
234
|
+
/** Where head left base; the files and commits are head's since then (as GitHub compares). */
|
|
235
|
+
mergeBase?: string;
|
|
236
|
+
/** Head's commits base lacks, and base's head lacks. */
|
|
237
|
+
ahead: number;
|
|
238
|
+
behind: number;
|
|
239
|
+
commits: DashSourceCommit[];
|
|
240
|
+
commitsCut?: true;
|
|
241
|
+
files: DashSourceChangedFile[];
|
|
242
|
+
total: number;
|
|
243
|
+
filesCut?: true;
|
|
244
|
+
added: number;
|
|
245
|
+
removed: number;
|
|
246
|
+
}
|
|
247
|
+
export interface DashSourceDiff {
|
|
248
|
+
path: string;
|
|
249
|
+
text?: string;
|
|
250
|
+
unavailable?: string;
|
|
251
|
+
truncated?: true;
|
|
252
|
+
full?: true;
|
|
253
|
+
}
|
|
254
|
+
export interface DashSourceTreeEntry {
|
|
255
|
+
name: string;
|
|
256
|
+
path: string;
|
|
257
|
+
kind: 'dir' | 'file' | 'link' | 'submodule';
|
|
258
|
+
size?: number;
|
|
259
|
+
}
|
|
260
|
+
export interface DashSourceTree {
|
|
261
|
+
at: number;
|
|
262
|
+
ref: DashSourceRef;
|
|
263
|
+
/** The folder listed: '' for the root. */
|
|
264
|
+
dir: string;
|
|
265
|
+
entries: DashSourceTreeEntry[];
|
|
266
|
+
cut?: true;
|
|
267
|
+
}
|
|
268
|
+
/** Why a file at a ref can be edited from the page, or why not — and where the edit would go. */
|
|
269
|
+
export interface DashSourceEditable {
|
|
270
|
+
ok: boolean;
|
|
271
|
+
/** `worktree`: written and committed in the branch's worktree; `ref`: committed onto the branch with no checkout; `new-branch`: a new `person/…` branch from it, in a worktree LensMCP makes. */
|
|
272
|
+
mode?: 'worktree' | 'ref' | 'new-branch';
|
|
273
|
+
/** The branch it commits on (for `new-branch`, what it starts from). */
|
|
274
|
+
branch?: string;
|
|
275
|
+
why?: string;
|
|
276
|
+
}
|
|
277
|
+
export interface DashSourceFile {
|
|
278
|
+
at: number;
|
|
279
|
+
ref: DashSourceRef;
|
|
280
|
+
path: string;
|
|
281
|
+
/** Its blob, and its mode (`100644`, `100755`). */
|
|
282
|
+
blob?: string;
|
|
283
|
+
mode?: string;
|
|
284
|
+
size: number;
|
|
285
|
+
text?: string;
|
|
286
|
+
lines?: number;
|
|
287
|
+
binary?: true;
|
|
288
|
+
/** Past {@link SOURCE_FILE_MAX}: named, not shown. */
|
|
289
|
+
tooBig?: true;
|
|
290
|
+
/** A secret-named file: metadata only. */
|
|
291
|
+
secret?: true;
|
|
292
|
+
/** What looked like a secret value was replaced before it was sent — such a file is not edited from the page. */
|
|
293
|
+
redacted?: true;
|
|
294
|
+
missing?: true;
|
|
295
|
+
editable: DashSourceEditable;
|
|
296
|
+
}
|
|
297
|
+
/** The most a file view reads, in bytes. */
|
|
298
|
+
export declare const SOURCE_FILE_MAX: number;
|
|
299
|
+
export interface DashSourceSummaryText {
|
|
300
|
+
/** When it was made — the page says «as of». */
|
|
301
|
+
at: number;
|
|
302
|
+
/** The digest it was made from (its key), and when that digest was read. */
|
|
303
|
+
digestKey: string;
|
|
304
|
+
text: string;
|
|
305
|
+
bullets: Array<{
|
|
306
|
+
text: string;
|
|
307
|
+
needsYou?: true;
|
|
308
|
+
}>;
|
|
309
|
+
model: string;
|
|
310
|
+
costUsd?: number;
|
|
311
|
+
trigger: 'auto' | 'click';
|
|
312
|
+
}
|
|
313
|
+
export type DashSourceSummaryState = 'idle' | 'summarising' | 'off' | 'no-key' | 'spent' | 'failed' | 'waiting';
|
|
314
|
+
export interface DashSourceSummary {
|
|
315
|
+
at: number;
|
|
316
|
+
state: DashSourceSummaryState;
|
|
317
|
+
stateText: string;
|
|
318
|
+
summary?: DashSourceSummaryText;
|
|
319
|
+
/** The state moved since the summary was made. */
|
|
320
|
+
stale?: true;
|
|
321
|
+
/** The person's switch «Summarise by itself», and the daily cap the automatic summaries spend from. */
|
|
322
|
+
settings: {
|
|
323
|
+
auto: 'on' | 'off';
|
|
324
|
+
dailyUsd: number;
|
|
325
|
+
};
|
|
326
|
+
/** What the summaries cost today (UTC): every one, then each allowance against its cap. */
|
|
327
|
+
cost: {
|
|
328
|
+
day: string;
|
|
329
|
+
usd: number;
|
|
330
|
+
runs: number;
|
|
331
|
+
auto: {
|
|
332
|
+
spentUsd: number;
|
|
333
|
+
capUsd: number;
|
|
334
|
+
};
|
|
335
|
+
click: {
|
|
336
|
+
spentUsd: number;
|
|
337
|
+
capUsd: number;
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
hasKey: boolean;
|
|
341
|
+
/** This dashboard summarises by itself (the main checkout's). */
|
|
342
|
+
looks: boolean;
|
|
343
|
+
/** When the next automatic summary may run, at the soonest. */
|
|
344
|
+
nextAt?: number;
|
|
345
|
+
canNow: boolean;
|
|
346
|
+
whyNot?: string;
|
|
347
|
+
/** The last failure, said whole. */
|
|
348
|
+
failed?: {
|
|
349
|
+
at: number;
|
|
350
|
+
text: string;
|
|
351
|
+
};
|
|
352
|
+
/** The figures the page's tabs show, from the last digest. */
|
|
353
|
+
counts?: {
|
|
354
|
+
needs: number;
|
|
355
|
+
branches: number;
|
|
356
|
+
prsOpen: number;
|
|
357
|
+
worktreesDirty: number;
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
export declare const SOURCE_SUMMARY_MODEL = "claude-sonnet-5-5";
|
|
361
|
+
export type DashSourceWriteKind = 'save' | 'delete-merged' | 'person-pr';
|
|
362
|
+
/** What a write would do — every precondition and the exact commands — before it runs (as Delivery's ActionDialog). */
|
|
363
|
+
export interface DashSourceWritePlan {
|
|
364
|
+
kind: DashSourceWriteKind;
|
|
365
|
+
title: string;
|
|
366
|
+
ok: boolean;
|
|
367
|
+
refused?: string;
|
|
368
|
+
/** Given back to run it: a change in what it was made on refuses the run. */
|
|
369
|
+
token?: string;
|
|
370
|
+
checks: DashDeliveryActionCheck[];
|
|
371
|
+
commands: string[];
|
|
372
|
+
refs: DashDeliveryActionRef[];
|
|
373
|
+
files: {
|
|
374
|
+
count: number;
|
|
375
|
+
paths: string[];
|
|
376
|
+
};
|
|
377
|
+
never: string;
|
|
378
|
+
/** Where it writes. */
|
|
379
|
+
target: {
|
|
380
|
+
branch?: string;
|
|
381
|
+
path?: string;
|
|
382
|
+
worktree?: string;
|
|
383
|
+
newBranch?: string;
|
|
384
|
+
mode?: DashSourceEditable['mode'];
|
|
385
|
+
};
|
|
386
|
+
/** Refused because someone works there: who, and what to do instead. */
|
|
387
|
+
holder?: {
|
|
388
|
+
who: string;
|
|
389
|
+
alternative: string;
|
|
390
|
+
};
|
|
391
|
+
/** The branches a «Delete merged branches» deletes. */
|
|
392
|
+
branches?: Array<{
|
|
393
|
+
name: string;
|
|
394
|
+
tip: string;
|
|
395
|
+
}>;
|
|
396
|
+
}
|
|
397
|
+
export interface DashSourceWriteDone {
|
|
398
|
+
kind: DashSourceWriteKind;
|
|
399
|
+
did: string[];
|
|
400
|
+
sha?: string;
|
|
401
|
+
branch?: string;
|
|
402
|
+
worktree?: string;
|
|
403
|
+
/** A save on a branch with a pull request: its push. */
|
|
404
|
+
pushed?: {
|
|
405
|
+
ok: boolean;
|
|
406
|
+
text: string;
|
|
407
|
+
};
|
|
408
|
+
pr?: {
|
|
409
|
+
number?: number;
|
|
410
|
+
url?: string;
|
|
411
|
+
};
|
|
412
|
+
/** The branch could open a pull request now (a new `person/` branch). */
|
|
413
|
+
canOpenPr?: true;
|
|
414
|
+
}
|
package/lib/source.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const SOURCE_TABS=["overview","branches","prs","worktrees","compare","code"],SOURCE_STALE_DAYS=30,SOURCE_FILE_MAX=1048576,SOURCE_SUMMARY_MODEL="claude-sonnet-5-5";
|
package/lib/sources.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var U=Object.defineProperty;var u=(e,r)=>U(e,"name",{value:r,configurable:!0});var v=Object.defineProperty,c=u((e,r)=>v(e,"name",{value:r,configurable:!0}),"a"),I=Object.defineProperty,n=c((e,r)=>I(e,"name",{value:r,configurable:!0}),"r");export const SOURCE_KINDS=["queue","loop","store","traffic"],SOURCE_KINDS_READ=["queue","loop","store","traffic"],sourceWireSchema=n(e=>`lensmcp.${e}/v1`,"sourceWireSchema"),QUEUE_WIRE_SCHEMA="lensmcp.queue/v1",LOOP_WIRE_SCHEMA="lensmcp.loop/v1",STORE_WIRE_SCHEMA="lensmcp.store/v1",TRAFFIC_WIRE_SCHEMA="lensmcp.traffic/v1",SOURCE_SNAPSHOT_FIELD={queue:"snapshot",loop:"loop",store:"store",traffic:"traffic"},URI_SOURCES="process://sources",SOURCE_PROVENANCE="reported",QUEUE_OLDEST_WAIT_RULE="queue/oldest-wait",QUEUE_STALLED_RULE="queue/stalled",LOOP_OVERDUE_RULE="loop/overdue",LOOP_FAILING_RULE="loop/failing",LOOP_IDLE_RULE="loop/idle-while-fed",STORE_QUOTA_RULE="store/near-quota",STORE_ERRORS_RULE="store/errors",STORE_ORPHANS_RULE="store/orphans",TRAFFIC_FAILURES_RULE="traffic/failures",TRAFFIC_LATENCY_RULE="traffic/latency",TRAFFIC_RATE_LIMITED_RULE="traffic/rate-limited",SOURCE_RULES=[QUEUE_OLDEST_WAIT_RULE,QUEUE_STALLED_RULE,LOOP_OVERDUE_RULE,LOOP_FAILING_RULE,LOOP_IDLE_RULE,STORE_QUOTA_RULE,STORE_ERRORS_RULE,STORE_ORPHANS_RULE,TRAFFIC_FAILURES_RULE,TRAFFIC_LATENCY_RULE,TRAFFIC_RATE_LIMITED_RULE],SOURCE_EVENT_KINDS=["source-poll","source-declaration","source-event"],CUSTOM_EVENT_SOURCE="custom",QUEUE_EVENTS=["enqueued","admitted","completed","failed","parked"],LOOP_EVENTS=["run-start","run-end"],LOOP_OUTCOMES=["ok","failed","skipped"],STORE_EVENTS=["write","delete","error"],TRAFFIC_EVENTS=["inbound","outbound"],TRAFFIC_OUTCOMES=["ok","failed","rate-limited"],SOURCE_PUSH_EVENTS={queue:QUEUE_EVENTS,loop:LOOP_EVENTS,store:STORE_EVENTS,traffic:TRAFFIC_EVENTS},SOURCE_PUSH_OUTCOMES={queue:[],loop:LOOP_OUTCOMES,store:[],traffic:TRAFFIC_OUTCOMES},SOURCE_POLL_STATES=["current","unreachable","refused","malformed","not-running"],SOURCE_STATES=[...SOURCE_POLL_STATES,"stale","never-polled"],SOURCE_DEFAULT_INTERVAL_SEC=10,SOURCE_MIN_INTERVAL_SEC=2,QUEUE_DEFAULT_OLDEST_WAIT_MIN=10,QUEUE_DEFAULT_STALLED_MIN=15,LOOP_DEFAULT_IDLE_MIN=10,LOOP_OVERDUE_INTERVALS=2,LOOP_FAILING_RUNS=3,SOURCE_FULL_REPORT_MS=6e4,SOURCE_HISTORY_POINTS=60,SOURCE_RUNS_KEPT=30,SOURCE_PUSHED_KEPT=20,STORE_DEFAULT_QUOTA_PCT=90,STORE_DEFAULT_ERROR_RATE_PCT=5,STORE_DEFAULT_ORPHAN_MIN=60,TRAFFIC_DEFAULT_FAILURE_PCT=5,TRAFFIC_DEFAULT_P95_MS=2e3,TRAFFIC_DEFAULT_RATE_LIMITED=1,TRAFFIC_MIN_MESSAGES=10,TRAFFIC_PUSH_WINDOW_MS=10*6e4,TRAFFIC_PUSH_CHANNELS=50,TRAFFIC_PUSH_EVENTS_PER_CHANNEL=1e3,SOURCE_MAX_GROUPS=500,SOURCE_MAX_BYTES=256*1024,SOURCE_STALE_PERIODS=3,SOURCE_STALE_MIN_MS=3e4;export function sourceStaleAfterMs(e){return Math.max(SOURCE_STALE_MIN_MS,SOURCE_STALE_PERIODS*Math.max(0,e))}u(sourceStaleAfterMs,"sourceStaleAfterMs"),c(sourceStaleAfterMs,"sourceStaleAfterMs"),n(sourceStaleAfterMs,"sourceStaleAfterMs");const i=n(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj"),t=n(e=>typeof e=="number"&&Number.isInteger(e)&&e>=0,"isCount"),E=n(e=>typeof e=="number"&&Number.isFinite(e)&&e>0,"isTime"),a=n((e,r)=>typeof e=="string"&&e.length>0&&e.length<=r,"isStr"),L=n(e=>e===void 0||typeof e=="number"&&e>0,"isMin");function _(e){if(!SOURCE_KINDS_READ.includes(e.sourceKind)||typeof e.path!="string"&&!(e.path===void 0&&(e.sourceKind==="traffic"||e.sourceKind==="loop"))||!a(e.name,200)||typeof e.intervalSec!="number"||e.feeds!==void 0&&!a(e.feeds,200))return!1;const r=e.thresholds;if(!i(r))return!1;for(const o of["stalledMin","idleMin","oldestWaitMin","quotaPct","errorRatePct","orphanMin","failurePct","p95Ms","rateLimited"])if(!L(r[o]))return!1;return e.sourceKind!=="queue"||typeof r.oldestWaitMin=="number"}u(_,"_"),c(_,"l"),n(_,"asDecl");const d=n(e=>e===null||typeof e=="string","isIsoOrNull"),l=n(e=>e===void 0||t(e),"isOptCount");function f(e){if(!i(e)||typeof e.at!="string"||!E(e.receivedAt)||!E(e.intervalSec)||!d(e.lastRunAt)||e.nextRunAt!==void 0&&!d(e.nextRunAt))return!1;for(const r of["lastDurationMs","lastItems","runsInWindow","itemsInWindow","failuresInWindow","windowSec"])if(!l(e[r]))return!1;return e.lastOutcome!==void 0&&!LOOP_OUTCOMES.includes(e.lastOutcome)?!1:e.lastError===void 0||typeof e.lastError=="string"}u(f,"d"),c(f,"_"),n(f,"asLoopSnapshot");const T=n(e=>e===void 0||i(e)&&Object.values(e).every(r=>typeof r=="string"),"isLabels");function S(e){if(!i(e)||typeof e.at!="string"||!E(e.receivedAt)||!t(e.objects)||!t(e.bytes)||e.quotaBytes!==void 0&&e.quotaBytes!==null&&!t(e.quotaBytes))return!1;for(const s of["opsInWindow","writesInWindow","deletesInWindow","errorsInWindow","windowSec"])if(!l(e[s]))return!1;if(e.lastWriteAt!==void 0&&!d(e.lastWriteAt)||e.lastError!==void 0&&typeof e.lastError!="string")return!1;const r=e.truncated;if(r!==void 0&&!(i(r)&&t(r.groups)))return!1;const o=e.groups;return o===void 0?!0:Array.isArray(o)&&o.length<=SOURCE_MAX_GROUPS&&o.every(s=>i(s)&&a(s.group,1e3)&&t(s.objects)&&t(s.bytes)&&T(s.labels))}u(S,"S"),c(S,"S"),n(S,"asStoreSnapshot");function R(e){if(!i(e)||typeof e.at!="string"||!E(e.receivedAt)||!Array.isArray(e.channels)||!l(e.windowSec))return!1;const r=e.truncated;return r!==void 0&&!(i(r)&&t(r.channels))?!1:e.channels.length<=SOURCE_MAX_GROUPS&&e.channels.every(o=>{if(!i(o)||!a(o.channel,1e3)||!T(o.labels)||o.direction!==void 0&&o.direction!=="inbound"&&o.direction!=="outbound"||o.counterpart!==void 0&&!a(o.counterpart,200))return!1;for(const s of["messagesInWindow","failuresInWindow","rateLimitedInWindow"])if(!l(o[s]))return!1;return o.p95Ms!==void 0&&!(typeof o.p95Ms=="number"&&Number.isFinite(o.p95Ms)&&o.p95Ms>=0)||o.lastAt!==void 0&&!d(o.lastAt)?!1:o.lastError===void 0||typeof o.lastError=="string"})}u(R,"p"),c(R,"R"),n(R,"asTrafficSnapshot");function p(e){return i(e)&&a(e.digest,100)&&typeof e.at=="string"&&E(e.receivedAt)}u(p,"R"),c(p,"A"),n(p,"asSame");function A(e){if(!i(e)||!a(e.group,1e3)||!t(e.pending))return!1;for(const s of["inFlight","failed","completedInWindow"])if(e[s]!==void 0&&!t(e[s]))return!1;const r=e.oldestPendingAt;if(r!=null&&typeof r!="string")return!1;const o=e.labels;return o===void 0||i(o)&&Object.values(o).every(s=>typeof s=="string")}u(A,"A"),c(A,"O"),n(A,"asGroup");function O(e){if(!i(e)||typeof e.at!="string"||!E(e.receivedAt)||!Array.isArray(e.groups))return!1;const r=e.totals;if(!i(r)||!t(r.groups)||!t(r.pending)||!t(r.inFlight)||!t(r.failed))return!1;const o=e.truncated;return o!==void 0&&!(i(o)&&t(o.groups))?!1:e.groups.length<=SOURCE_MAX_GROUPS&&e.groups.every(A)}u(O,"O"),c(O,"T"),n(O,"asSnapshot");export function asSourcePollRaw(e){if(!i(e)||e.kind!=="source-poll"||!a(e.project,200)||!_(e)||!SOURCE_POLL_STATES.includes(e.state)||!E(e.polledAt)||!E(e.reportEveryMs)||e.path===void 0)return;const r=SOURCE_SNAPSHOT_FIELD[e.sourceKind];for(const s of Object.values(SOURCE_SNAPSHOT_FIELD))if(s!==r&&e[s]!==void 0)return;const o={snapshot:O,loop:f,store:S,traffic:R}[r];if(!(e[r]!==void 0&&!o(e[r]))&&!(e.same!==void 0&&(!p(e.same)||e[r]!==void 0))&&!(e.state==="current"&&e[r]===void 0&&e.same===void 0))return e}u(asSourcePollRaw,"asSourcePollRaw"),c(asSourcePollRaw,"asSourcePollRaw"),n(asSourcePollRaw,"asSourcePollRaw");export function asSourceEventRaw(e){if(!i(e)||e.kind!=="source-event"||!a(e.project,200)||!a(e.name,200))return;const r=e.sourceKind;if(SOURCE_KINDS_READ.includes(r)&&SOURCE_PUSH_EVENTS[r].includes(e.event)&&!(e.item!==void 0&&!a(e.item,200)||e.group!==void 0&&!a(e.group,200))&&!(!l(e.items)||!l(e.durationMs)||!l(e.bytes))&&!(e.outcome!==void 0&&!SOURCE_PUSH_OUTCOMES[r].includes(e.outcome))){for(const o of["object","channel","counterpart","correlation"])if(e[o]!==void 0&&!a(e[o],200))return;if(!(e.error!==void 0&&typeof e.error!="string"))return e}}u(asSourceEventRaw,"asSourceEventRaw"),c(asSourceEventRaw,"asSourceEventRaw"),n(asSourceEventRaw,"asSourceEventRaw");export function asSourceDeclarationRaw(e){if(!(!i(e)||e.kind!=="source-declaration"||!a(e.project,200))&&!(!Array.isArray(e.sources)||!e.sources.every(r=>i(r)&&_(r)))&&!(!Array.isArray(e.problems)||!e.problems.every(r=>typeof r=="string")))return e}u(asSourceDeclarationRaw,"asSourceDeclarationRaw"),c(asSourceDeclarationRaw,"asSourceDeclarationRaw"),n(asSourceDeclarationRaw,"asSourceDeclarationRaw");
|
package/lib/static-checks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var g=Object.defineProperty;var l=(e,t)=>g(e,"name",{value:t,configurable:!0});var y=Object.defineProperty,u=l((e,t)=>y(e,"name",{value:t,configurable:!0}),"l"),m=Object.defineProperty,a=u((e,t)=>m(e,"name",{value:t,configurable:!0}),"l");export const OWNER_WORKSPACE="(workspace)",OWNER_EXTERNAL="(external)";export function workspacePath(e){return e.replace(/\\/g,"/").replace(/^(\.\/)+/,"")}l(workspacePath,"workspacePath"),u(workspacePath,"workspacePath"),a(workspacePath,"workspacePath");export function ownerMap(e){const t=Object.entries(e).map(([o,r])=>({name:o,root:workspacePath(r.root).replace(/\/+$/,"")})).filter(o=>o.root!==""&&o.root!==".").sort((o,r)=>r.root.length-o.root.length||(o.name<r.name?-1:o.name>r.name?1:0)),s=Object.entries(e).filter(([,o])=>["","."].includes(workspacePath(o.root).replace(/\/+$/,""))).map(([o])=>o).sort()[0];return o=>{const r=workspacePath(o);if(r.startsWith("/")||r.startsWith("../")||r===".."||/^[A-Za-z]:\//.test(r)||r.split("/").includes("node_modules"))return OWNER_EXTERNAL;for(const{name:n,root:i}of t)if(r===i||r.startsWith(`${i}/`))return n;return s??OWNER_WORKSPACE}}l(ownerMap,"ownerMap"),u(ownerMap,"ownerMap"),a(ownerMap,"ownerMap");export const 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}`}l(typecheckFindingKey,"typecheckFindingKey"),u(typecheckFindingKey,"typecheckFindingKey"),a(typecheckFindingKey,"typecheckFindingKey");export function lintFindingKey(e){return`${e.file}:${e.line}:${e.col}:${e.ruleId??""}`}l(lintFindingKey,"lintFindingKey"),u(lintFindingKey,"lintFindingKey"),a(lintFindingKey,"lintFindingKey");const f=a((e,t)=>e.file<t.file?-1:e.file>t.file?1:e.line-t.line||e.col-t.col,"byPosition");export function dedupeTypecheckFindings(e,t){const s=new Map;for(const{program:r,diagnostics:n}of e)for(const i of n){const c=typecheckFindingKey(i),d=s.get(c);if(!d){s.set(c,{file:i.file,line:i.line,col:i.col,code:i.code,severity:i.severity,message:i.message,project:t(i.file),programs:[r]});continue}d.programs.includes(r)||d.programs.push(r),i.severity==="error"&&(d.severity="error")}const o=[...s.values()];for(const r of o)r.programs.sort();return o.sort((r,n)=>f(r,n)||(r.code<n.code?-1:r.code>n.code?1:0))}l(dedupeTypecheckFindings,"dedupeTypecheckFindings"),u(dedupeTypecheckFindings,"dedupeTypecheckFindings"),a(dedupeTypecheckFindings,"dedupeTypecheckFindings");export function dedupeLintFindings(e,t){const s=new Map;for(const{unit:n,messages:i}of e)for(const c of i){const d=lintFindingKey(c),p=s.get(d);if(!p){s.set(d,{file:c.file,line:c.line,col:c.col,ruleId:c.ruleId,severity:c.severity,message:c.message,project:t(c.file),units:[n],...c.fixable?{fixable:!0}:{}});continue}p.units.includes(n)||p.units.push(n),c.severity==="error"&&(p.severity="error")}const o=[...s.values()];for(const n of o)n.units.sort();const r=a(n=>n.ruleId??"","rule");return o.sort((n,i)=>f(n,i)||(r(n)<r(i)?-1:r(n)>r(i)?1:0))}l(dedupeLintFindings,"dedupeLintFindings"),u(dedupeLintFindings,"dedupeLintFindings"),a(dedupeLintFindings,"dedupeLintFindings");export function verdictOf(e){const{errors:t,coverage:s}=e;return t>0?"errors":s.toolErrors.length>0||s.inScope<=0||s.checked.count<=0?"no-verdict":s.stale.length>0||s.notCovered.length>0||s.checked.count<s.inScope?"partial":"clean"}l(verdictOf,"verdictOf"),u(verdictOf,"verdictOf"),a(verdictOf,"verdictOf");export function exitCodeOf(e,t={}){return e==="errors"?1:e==="clean"||e==="partial"&&t.allowPartial?0:2}l(exitCodeOf,"exitCodeOf"),u(exitCodeOf,"exitCodeOf"),a(exitCodeOf,"exitCodeOf");
|
package/lib/system-report.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var
|
|
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");
|
package/lib/team-decide.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var R=Object.defineProperty;var p=(e,t)=>R(e,"name",{value:t,configurable:!0});var N=Object.defineProperty,w=p((e,t)=>N(e,"name",{value:t,configurable:!0}),"p"),E=Object.defineProperty,l=w((e,t)=>E(e,"name",{value:t,configurable:!0}),"i");import{TEAM_DESIGN_VERSION as J}from"./team-design.js";const B=["tester","reviewer","qa","docs"],M=".lensmcp/team",O=l(e=>`${M}/roles/${e}.md`,"roleFile"),F=`${M}/project.md`,K=`${M}/flow.json`,C=l(e=>e.slice(e.lastIndexOf("/")+1),"base"),v=l((e,t,n=`${t}s`)=>`${e.toLocaleString("en-US")} ${e===1?t:n}`,"plural"),T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];export const teamDay=l(e=>{const t=new Date(e);return`${t.getDate()} ${T[t.getMonth()]}`},"teamDay");export function designPartKeys(e){return[...e.roles.filter(t=>t.status!=="same").map(t=>`role:${t.id}`),...e.off.filter(t=>!B.includes(t.id)).map(t=>`off:${t.id}`),...e.flow.keep===!1?["flow"]:[],"brief",...e.firstGoals.map((t,n)=>`goal:${n}`)]}p(designPartKeys,"designPartKeys"),w(designPartKeys,"designPartKeys"),l(designPartKeys,"designPartKeys");export function designOpenParts(e){return!e||e.status!=="done"||!e.design?[]:e.accepted&&!e.parts?[]:designPartKeys(e.design).filter(t=>!e.parts?.[t])}p(designOpenParts,"designOpenParts"),w(designOpenParts,"designOpenParts"),l(designOpenParts,"designOpenParts");export const tuneChangeOpen=l(e=>!e.verdict||e.verdict.is==="accepted"&&!!e.verdict.problem,"tuneChangeOpen"),runsGoals=l(e=>e.takes.includes("goal"),"runsGoals");export function managerSeatsShort(e,t){const n=e.agents;if(!(!runsGoals(e)||n===void 0||n===null||n>=t))return`${e.id} agents ${n} is below goals.running ${t}: ${P(e.id,n)}`}p(managerSeatsShort,"managerSeatsShort"),w(managerSeatsShort,"managerSeatsShort"),l(managerSeatsShort,"managerSeatsShort");function P(e,t){const n=e==="manager"?"a manager":`a ${e}`;return t===0?`no goal can have ${n}`:t===1?`only one goal can have ${n} at a time`:`only ${t} goals can have ${n} at a time`}p(P,"M"),w(P,"P"),l(P,"seatsLeft");function j(e,t,n){if(!n||!e.file||!t?.agents)return;const o=n.roles.find(c=>e.file===O(c)),s=t.agents[1];if(!(!o||s===void 0||s===null||s>=n.goalsRunning))return`It sets ${o} agents to ${s}, below goals.running ${n.goalsRunning}: ${P(o,s)}. Leave the line out \u2014 one ${o} per running goal \u2014 or set it to ${n.goalsRunning} or more.`}p(j,"P"),w(j,"W"),l(j,"seatsWhy");const _={new:l(e=>`Adds the ${e} role \u2014 a new file, ${e}.md`,"new"),rewrite:l(e=>`Rewrites ${e}.md whole`,"rewrite"),refine:l(e=>`Writes ${e}.md over LensMCP\u2019s default ${e}`,"refine")};function G(e,t,n){const o={from:"design",runId:e.id,id:n,key:`design:${e.id}:${n}`};if(n.startsWith("role:")){const f=n.slice(5),a=e.now?.roles.find($=>$.id===f),g=t.roles.find($=>$.id===f),y=a?a.is==="new"?"new":a.is==="refines"?"refine":"rewrite":g?.status==="new"?"new":"rewrite";return{...o,file:a?.file??O(f),title:_[y](f),what:y}}if(n.startsWith("off:")){const f=n.slice(4),a=!!t.off.find(g=>g.id===f)?.own;return{...o,file:O(f),title:a?`Drops the ${f} role \u2014 deletes ${f}.md`:`Switches the ${f} role off`,what:a?"drop":"off"}}if(n==="flow"){const f=t.flow.handOffs?.length??0;return{...o,file:K,title:`Adds ${v(f,"hand-off")} to the flow (flow.json)`,what:"flow"}}if(n==="brief")return{...o,file:F,title:e.now?.brief?.exists===!1?"Writes the project brief (project.md)":"Rewrites the project brief (project.md) whole",what:"brief"};const s=Number(n.slice(5)),c=t.firstGoals[s];return{...o,title:`Puts the goal \xAB${c?.title??`first goal ${s+1}`}\xBB on the board`,what:"goal"}}p(G,"L"),w(G,"C"),l(G,"designItem");export function teamAcceptAllPlan(e){const t=[],n=[],o=[],s=l((i,d,m,u=!0)=>n.push({...i,reason:d,why:m,canAccept:u}),"leave"),c=e.tune?.status==="done"?e.tune:void 0;for(const i of c?.tune?.changes??[]){if(!tuneChangeOpen(i))continue;const d={key:`tune:${c.id}:${i.id}`,from:"tune",runId:c.id,id:i.id,file:i.file,title:i.title,what:"edit"};t.push(d);const m=j(d,i.effect,e.seats);i.now?.applies===!1?s(d,"outdated",`It no longer fits ${C(i.file)} as it is now \u2014 the file changed after the tune read it. Tune again for a fresh change.`,!1):m?s(d,"seats",m):o.push(d)}const f=new Map;for(const i of o)f.set(i.file,(f.get(i.file)??0)+1);const a=e.design,g=a?.design,y=[];if(a&&g){const i=teamDay(a.startedAt),d=(c?.tune?.changes??[]).filter(u=>u.verdict?.is==="accepted"&&!u.verdict.problem),m=new Map(d.map(u=>[u.id,u.verdict.at]));for(const u of designOpenParts(a)){const r=G(a,g,u);t.push(r);const x=r.file?C(r.file):"";if(g.version!==J){s(r,"version","It was made by another version of LensMCP and cannot be written \u2014 design again.",!1);continue}if(r.what==="goal"){const h=g.firstGoals[Number(u.slice(5))]?.tasks.length??0;s(r,"goal",`It puts work on the board${h?` \u2014 a goal and ${v(h,"task")}`:""}: a manager staffs it and agents start. Place it yourself.`);continue}if(r.what==="off"||r.what==="drop"){const h=u.slice(4);s(r,"switches-off",r.what==="drop"?`It deletes ${x}: the ${h} role goes, and its open tasks wait for no one.`:`It switches ${h} off: its open tasks wait for no one until another role takes them.`);continue}const b=u.startsWith("role:")?a.now?.roles.find(h=>h.id===u.slice(5)):void 0,k=u==="brief"?a.now?.brief:u==="flow"?a.now?.flow:b?{exists:b.is==="replaces",changedSince:b.changedSince}:void 0;if(!k){s(r,"unknown",`LensMCP cannot tell whether ${x} changed after the design read it on ${i} \u2014 look at it first.`);continue}const A=b?b.undoes??[]:d.filter(h=>h.file===r.file&&h.verdict.at>a.startedAt).map(h=>({id:h.id}));if(A.length){const h=A.map(I=>m.get(I.id)).filter(I=>I!==void 0),L=h.length?` on ${teamDay(Math.max(...h))}`:" since this design ran";s(r,"undoes",`It would undo ${v(A.length,"tune change")} you accepted${L}.`);continue}if(k.exists&&k.changedSince){s(r,"changed-since",`${x} changed after the design read it on ${i}: rewriting it whole would lose those changes.`);continue}const D=j(r,b?.effect,e.seats);if(D){s(r,"seats",D);continue}const S=r.file?f.get(r.file):void 0;if(k.exists&&S){s(r,"clashes",`It rewrites ${x} whole, and \xABAccept all\xBB takes ${v(S,"tune change")} to ${x}: it would undo ${S===1?"it":"them"}.`);continue}y.push(r)}}const $=[];for(const i of[...o,...y]){const d=$.find(m=>m.file===i.file);d?d.items.push(i):$.push({file:i.file,items:[i]})}const H=$.flatMap(i=>i.items),W=new Map(t.map((i,d)=>[i.key,d]));return{items:t,safe:H,left:n.sort((i,d)=>W.get(i.key)-W.get(d.key)),files:$}}p(teamAcceptAllPlan,"teamAcceptAllPlan"),w(teamAcceptAllPlan,"teamAcceptAllPlan"),l(teamAcceptAllPlan,"teamAcceptAllPlan");const q=l(e=>e.length>1?`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`:e.join(""),"listWords");export function tuneHistory(e){const t=e.changes.length,n=new Set(e.changes.map(c=>c.file)).size,o=e.changes.filter(c=>c.verdict?.is==="accepted"&&!c.verdict.problem).length,s=e.changes.filter(c=>c.verdict?.is==="rejected").length;return{proposed:t?`${v(t,"change")} in ${v(n,"file")}`:"no change",parts:t,accepted:o,rejected:s,left:t-o-s}}p(tuneHistory,"tuneHistory"),w(tuneHistory,"tuneHistory"),l(tuneHistory,"tuneHistory");export function designHistory(e){const t=e.design,n=t.off.filter(g=>!B.includes(g.id)).length,o=q([v(t.roles.length,"role"),...n?[`${n} off`]:[],...t.flow.keep===!1?["the flow"]:[],"the brief",...t.firstGoals.length?[v(t.firstGoals.length,"goal")]:[]]),s=designPartKeys(t);if(e.accepted&&!e.parts)return{proposed:o,parts:s.length,accepted:0,rejected:0,left:0,wrote:e.accepted.files.length,goals:e.accepted.goals.length};const c=s.map(g=>e.parts?.[g]?.is),f=c.filter(g=>g==="accepted").length,a=c.filter(g=>g==="rejected").length;return{proposed:o,parts:s.length,accepted:f,rejected:a,left:s.length-f-a}}p(designHistory,"designHistory"),w(designHistory,"designHistory"),l(designHistory,"designHistory");
|
package/lib/team.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DashTeamTaskDesign, DesignStage } from './goal-design.js';
|
|
2
|
+
import type { DashGoalAutoMerge, DashGoalMainFollow, DashMergeOf } from './goal-main-follow.js';
|
|
2
3
|
import type { TaskTiming } from './task-timing.js';
|
|
3
4
|
import type { ForcedIntegration, ForcedItem, GoalAdmission, PackageDeliverySummary } from './team-delivery.js';
|
|
4
5
|
/**
|
|
@@ -11,13 +12,13 @@ import type { ForcedIntegration, ForcedItem, GoalAdmission, PackageDeliverySumma
|
|
|
11
12
|
* What kind of work a task is: it names the role that takes it. `goal`: what a manager breaks into the others' tasks;
|
|
12
13
|
* `marketing`: telling people about the product (launch posts, release notes, landing and store copy).
|
|
13
14
|
*/
|
|
14
|
-
export declare const DASH_TEAM_KINDS: readonly ["goal", "build", "bug", "review", "test", "qa", "docs", "marketing", "research", "chore"];
|
|
15
|
+
export declare const DASH_TEAM_KINDS: readonly ["goal", "build", "bug", "review", "test", "qa", "docs", "marketing", "research", "chore", "merge"];
|
|
15
16
|
export type DashTeamKind = (typeof DASH_TEAM_KINDS)[number];
|
|
16
17
|
/** `design`: a goal waiting for its design to be approved (planning/team/20 DF-D1) — no one claims it, or anything under it. */
|
|
17
18
|
export type DashTeamTaskState = 'design' | 'open' | 'claimed' | 'recovery' | 'completed' | 'cancelled';
|
|
18
19
|
export type DashTeamOutcome = 'done' | 'approved' | 'changes-requested' | 'passed' | 'failed' | 'wontfix';
|
|
19
20
|
/** What a task points at in the lens or the repository. */
|
|
20
|
-
export declare const DASH_TEAM_LINK_KINDS: readonly ["task", "flow", "error", "suggestion", "ai-call", "review", "page", "route", "commit", "branch", "worktree", "file", "finding", "test"];
|
|
21
|
+
export declare const DASH_TEAM_LINK_KINDS: readonly ["task", "flow", "error", "suggestion", "ai-call", "review", "page", "route", "commit", "branch", "worktree", "file", "finding", "test", "canvas"];
|
|
21
22
|
export interface DashTeamLink {
|
|
22
23
|
kind: (typeof DASH_TEAM_LINK_KINDS)[number];
|
|
23
24
|
id: string;
|
|
@@ -106,6 +107,8 @@ export interface DashTeamGoalPr {
|
|
|
106
107
|
mergedAt?: number;
|
|
107
108
|
/** The commit its merge made on origin's main. */
|
|
108
109
|
mergeCommit?: string;
|
|
110
|
+
/** What LensMCP's auto-merge waits on, and the merge it ran (issues/closed/hub-19). */
|
|
111
|
+
autoMerge?: DashGoalAutoMerge;
|
|
109
112
|
}
|
|
110
113
|
export interface DashTeamTask {
|
|
111
114
|
delivery?: PackageDeliverySummary;
|
|
@@ -170,6 +173,10 @@ export interface DashTeamTask {
|
|
|
170
173
|
integration?: DashTeamGoalIntegration;
|
|
171
174
|
/** A goal's ONE pull request as the team keeps it (issues/closed/foodguard-313): on the board and in the drawer. */
|
|
172
175
|
pr?: DashTeamGoalPr;
|
|
176
|
+
/** A goal's branch against origin's main (issues/closed/hub-19): behind it by how much, and whether its manager was told. */
|
|
177
|
+
mainFollow?: DashGoalMainFollow;
|
|
178
|
+
/** A `merge` task's pull request (the PR merger's, hub-19): the goal, the pull request, what it waits on. */
|
|
179
|
+
mergeOf?: DashMergeOf;
|
|
173
180
|
/** Marked done by the person (issues/closed/overseer-70): the commit, why, who — its proof not run, never a QA pass. */
|
|
174
181
|
personDone?: DashTeamPersonDone;
|
|
175
182
|
/** Closed «not run — the person's decision» (issues/closed/overseer-78): who, why — never passed, never written. */
|
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,
|
|
1
|
+
"use strict";var o=Object.defineProperty;var r=(t,e)=>o(t,"name",{value:e,configurable:!0});var i=Object.defineProperty,a=r((t,e)=>i(t,"name",{value:e,configurable:!0}),"r");export const DASH_TEAM_KINDS=["goal","build","bug","review","test","qa","docs","marketing","research","chore","merge"],DASH_TEAM_LINK_KINDS=["task","flow","error","suggestion","ai-call","review","page","route","commit","branch","worktree","file","finding","test","canvas"];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"),a(modelClient,"modelClient");export const DASH_TEAM_SEARCH_QUESTION_MAX=300;
|