@lensmcp/protocol-types 1.25.78 → 1.26.0
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 +10 -1
- package/index.js +1 -1
- 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-context.js +6 -6
- package/lib/ai-origins.js +9 -9
- package/lib/attributes.d.ts +19 -4
- package/lib/attributes.js +1 -1
- package/lib/bounded-clone.js +1 -1
- package/lib/bounded-map.js +1 -1
- package/lib/bounded-writer.js +1 -1
- package/lib/capture-demand.js +1 -1
- package/lib/changes.d.ts +50 -2
- package/lib/context.d.ts +2 -2
- package/lib/dashboard-lint.d.ts +207 -0
- package/lib/dashboard-lint.js +1 -0
- package/lib/dashboard-path.d.ts +15 -0
- package/lib/dashboard-path.js +1 -0
- package/lib/dashboard.d.ts +198 -3
- package/lib/edge.d.ts +8 -8
- package/lib/error-cause.d.ts +69 -0
- package/lib/error-cause.js +5 -0
- package/lib/error-dismissal.js +1 -1
- package/lib/event-loop.d.ts +57 -1
- package/lib/event-loop.js +1 -1
- package/lib/event.d.ts +45 -45
- package/lib/flood-guard.js +1 -1
- package/lib/follow-ups.d.ts +238 -0
- package/lib/follow-ups.js +1 -0
- package/lib/goal-design.d.ts +51 -0
- package/lib/goal-design.js +1 -1
- package/lib/goal-outcome.d.ts +12 -1
- package/lib/goal-retro.d.ts +21 -0
- package/lib/lint-coverage.d.ts +113 -0
- package/lib/lint-coverage.js +1 -0
- package/lib/log-query.js +1 -1
- package/lib/metrics-reset.js +1 -1
- package/lib/node.d.ts +11 -11
- package/lib/overseer-findings.js +1 -1
- package/lib/overseer-rounds.d.ts +2 -0
- package/lib/perf-rules.js +1 -1
- package/lib/pod-memory.d.ts +2 -0
- package/lib/pod-memory.js +1 -1
- package/lib/producer-health.js +1 -1
- package/lib/resources.d.ts +28 -28
- package/lib/role-fidelity.d.ts +210 -0
- package/lib/role-fidelity.js +1 -0
- package/lib/sources.js +1 -1
- package/lib/system-report.js +1 -1
- package/lib/team-delivery.d.ts +61 -3
- package/lib/team-delivery.js +1 -1
- package/lib/team-design.d.ts +224 -0
- package/lib/team-design.js +1 -1
- package/lib/team-prompts.d.ts +16 -7
- package/lib/team-prompts.js +4 -47
- package/lib/team-skills.d.ts +355 -0
- package/lib/team-skills.js +1 -0
- package/lib/team.d.ts +100 -1
- package/lib/team.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/** What a lint run covered (`raw.coverage`): the lens replaces the findings of exactly those files. */
|
|
2
|
+
export type LintCoverageKind = 'tree' | 'paths' | 'changed' | 'incremental';
|
|
3
|
+
/** The saved status an incremental run was computed on top of: this checkout's own, or the main checkout's. */
|
|
4
|
+
export interface LintBaseRef {
|
|
5
|
+
from: 'own' | 'main';
|
|
6
|
+
sha: string;
|
|
7
|
+
run: string;
|
|
8
|
+
}
|
|
9
|
+
export interface LintCoverage {
|
|
10
|
+
kind: LintCoverageKind;
|
|
11
|
+
/** The checkout root, absolute: every path below is relative to it (`.` is the root). */
|
|
12
|
+
root: string;
|
|
13
|
+
dirs: string[];
|
|
14
|
+
/** Files linted one by one. On one event, the part of the list that event carries (`fileCount` counts them all). */
|
|
15
|
+
files: string[];
|
|
16
|
+
/** Files that are gone — deleted, or renamed away: their findings are dropped. Listed like `files`. */
|
|
17
|
+
gone: string[];
|
|
18
|
+
fileCount: number;
|
|
19
|
+
goneCount: number;
|
|
20
|
+
/** On a run's record in `lint://current`, whose `dirs` list is cut: how many folders it covered. */
|
|
21
|
+
dirCount?: number;
|
|
22
|
+
/** Files ESLint linted, and the ones it was given that its config ignores. */
|
|
23
|
+
linted: number;
|
|
24
|
+
notLinted?: number;
|
|
25
|
+
/** A changed run: the files git does not track yet, and the ref it compared with (HEAD without one). */
|
|
26
|
+
untracked?: number;
|
|
27
|
+
since?: string;
|
|
28
|
+
/** The commit the checkout was at, and whether it had uncommitted changes. */
|
|
29
|
+
head?: string;
|
|
30
|
+
dirty?: boolean;
|
|
31
|
+
/** Lintable files with uncommitted changes then: the next incremental run lints them again. `uncommittedMore`: too many to be a base. */
|
|
32
|
+
uncommitted?: string[];
|
|
33
|
+
uncommittedMore?: boolean;
|
|
34
|
+
/** A full or incremental run: each lint input at the root (ESLint's config, package.json, the lockfile, tsconfig) and its content hash — empty when it is not there. */
|
|
35
|
+
inputs?: Array<[string, string]>;
|
|
36
|
+
/** The folder whose lint this is (`.`); `projects`: only the workspace's projects in it were linted. */
|
|
37
|
+
folder?: string;
|
|
38
|
+
projects?: boolean;
|
|
39
|
+
base?: LintBaseRef;
|
|
40
|
+
/** A full run with ESLint's cache off (`--full`). */
|
|
41
|
+
fromZero?: boolean;
|
|
42
|
+
/** The caller passed ESLint its own arguments: the run counts only the files in ESLint's results, and nothing builds on it. */
|
|
43
|
+
narrowed?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** The event kind that carries the rest of a coverage list too long for the run's START. */
|
|
46
|
+
export declare const LINT_COVER_KIND = "lint-cover";
|
|
47
|
+
/** The uncommitted files a status remembers, at most: with more it is not a base. */
|
|
48
|
+
export declare const MAX_LINT_UNCOMMITTED = 500;
|
|
49
|
+
/** The coverage an event carries, checked; undefined when absent, malformed or cut by the bus clamp. */
|
|
50
|
+
export declare function readLintCoverage(raw: unknown): LintCoverage | undefined;
|
|
51
|
+
export interface LintBaseError {
|
|
52
|
+
/** Relative to the base's root. */
|
|
53
|
+
file: string;
|
|
54
|
+
line?: number;
|
|
55
|
+
column?: number;
|
|
56
|
+
rule: string;
|
|
57
|
+
message: string;
|
|
58
|
+
}
|
|
59
|
+
/** A saved full lint a run can build on (`lint://base`): what it was computed on, and what it holds. */
|
|
60
|
+
export interface LintBase {
|
|
61
|
+
/** Whose it is, as the answering lens sees it: its own checkout's, or the main checkout's. */
|
|
62
|
+
from: 'own' | 'main';
|
|
63
|
+
/** The checkout root it is of, the folder in it the full lint is of (`.`), and whether it linted the workspace's projects only. */
|
|
64
|
+
root: string;
|
|
65
|
+
folder: string;
|
|
66
|
+
projects?: boolean;
|
|
67
|
+
/** The run that last brought it up to date, when, and the commit it was computed on. */
|
|
68
|
+
run: string;
|
|
69
|
+
at: number;
|
|
70
|
+
sha?: string;
|
|
71
|
+
/** Why nothing can be built on it, when nothing can. */
|
|
72
|
+
unusable?: string;
|
|
73
|
+
/** Files and folders to lint again whatever git says: uncommitted then, or linted by a run of their own since. */
|
|
74
|
+
again: string[];
|
|
75
|
+
againDirs: string[];
|
|
76
|
+
inputs?: Array<[string, string]>;
|
|
77
|
+
full: {
|
|
78
|
+
at: number;
|
|
79
|
+
sha?: string;
|
|
80
|
+
fromZero?: boolean;
|
|
81
|
+
};
|
|
82
|
+
updates: number;
|
|
83
|
+
errorCount: number;
|
|
84
|
+
warningCount: number;
|
|
85
|
+
/** Every file with findings — path, errors, warnings — up to a cap (`moreFiles` past it). */
|
|
86
|
+
files: Array<[string, number, number]>;
|
|
87
|
+
moreFiles?: number;
|
|
88
|
+
errors: LintBaseError[];
|
|
89
|
+
moreErrors?: number;
|
|
90
|
+
}
|
|
91
|
+
export interface LintBaseAnswer {
|
|
92
|
+
schemaVersion: 1;
|
|
93
|
+
/** In order: this checkout's own saved lint, then the main checkout's. */
|
|
94
|
+
bases: LintBase[];
|
|
95
|
+
why?: string;
|
|
96
|
+
}
|
|
97
|
+
/** What the label is made of: `paths` are the folders and files covered, as the reader shows them (`.` is the whole checkout). */
|
|
98
|
+
export interface LintCoverageWords {
|
|
99
|
+
kind: LintCoverageKind;
|
|
100
|
+
paths: readonly string[];
|
|
101
|
+
more?: number;
|
|
102
|
+
files?: number;
|
|
103
|
+
gone?: number;
|
|
104
|
+
untracked?: number;
|
|
105
|
+
/** What a changed run compared with (HEAD without), or the commit an incremental run built on. */
|
|
106
|
+
since?: string;
|
|
107
|
+
narrowed?: boolean;
|
|
108
|
+
projects?: number;
|
|
109
|
+
}
|
|
110
|
+
/** What a run covered, in words: «whole checkout», «apps/web», «12 changed files since HEAD». */
|
|
111
|
+
export declare function lintCoverageLabel(c: LintCoverageWords, opts?: {
|
|
112
|
+
untracked?: boolean;
|
|
113
|
+
}): string;
|
|
@@ -0,0 +1 @@
|
|
|
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");
|
package/lib/log-query.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var L=Object.defineProperty;var a=(e,t)=>L(e,"name",{value:t,configurable:!0});var d=Object.defineProperty,c=a((e,t)=>d(e,"name",{value:t,configurable:!0}),"a"),h=Object.defineProperty,u=c((e,t)=>h(e,"name",{value:t,configurable:!0}),"c");const p={level:"level",severity:"level",service:"service",svc:"service",src:"service",source:"service",flow:"flow",trace:"trace",request:"trace",category:"category",cat:"category",ms:"ms"},C={warn:"warning",err:"error"},k=/(-?)(?:([A-Za-z]+):)?(?:"([^"]*)"|(\S+))/g;export function parseLogQuery(e){const t=[],r=[];for(const s of e.matchAll(k)){const[o,n,g,y,w]=s,i=(y??w??"").trim(),l=g?p[g.toLowerCase()]:void 0;if(l&&i){const m=l==="level"?C[i.toLowerCase()]??i.toLowerCase():i;t.push({key:l,value:m,negate:n==="-"})}else o.trim()&&r.push(o.trim())}return{tokens:t,text:r.join(" ")}}a(parseLogQuery,"parseLogQuery"),c(parseLogQuery,"parseLogQuery"),u(parseLogQuery,"parseLogQuery");export function formatLogQuery(e){const t=u(r=>/\s/.test(r)?`"${r}"`:r,"quote");return[...e.tokens.map(r=>`${r.negate?"-":""}${r.key}:${t(r.value)}`),e.text].filter(Boolean).join(" ")}a(formatLogQuery,"formatLogQuery"),c(formatLogQuery,"formatLogQuery"),u(formatLogQuery,"formatLogQuery");function v(e,t){if(e===void 0)return!1;const r=/^(>=|<=|>|<|=)?\s*(\d+(?:\.\d+)?)$/.exec(t);if(!r)return!1;const s=Number(r[2]);switch(r[1]){case">":return e>s;case"<":return e<s;case"<=":return e<=s;case"=":return e===s;default:return e>=s}}a(v,"v"),c(v,"h"),u(v,"msMatches");function f(e,t){const r=t.value.toLowerCase();switch(t.key){case"level":return e.severity.toLowerCase()===r;case"service":return e.source.toLowerCase()===r;case"flow":return!!e.flowId&&e.flowId.toLowerCase().startsWith(r);case"trace":return!!e.requestId&&e.requestId.toLowerCase().startsWith(r);case"category":return e.category.toLowerCase()===r;case"ms":return v(e.durationMs,t.value)}}a(f,"l"),c(f,"i"),u(f,"tokenMatches");export function matchesLogQuery(e,t,r){const s=new Map;for(const o of t.tokens){if(o.negate){if(f(e,o))return!1;continue}const n=s.get(o.key);n?n.push(o):s.set(o.key,[o])}for(const o of s.values())if(!o.some(n=>f(e,n)))return!1;if(t.text){const o=`${e.title} ${e.message??""} ${e.source} ${e.flowId??""}`;return r?r(o):o.toLowerCase().includes(t.text.toLowerCase())}return!0}a(matchesLogQuery,"matchesLogQuery"),c(matchesLogQuery,"matchesLogQuery"),u(matchesLogQuery,"matchesLogQuery");
|
package/lib/metrics-reset.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var l=Object.defineProperty;var i=(e,t)=>l(e,"name",{value:t,configurable:!0});var f=Object.defineProperty,a=i((e,t)=>f(e,"name",{value:t,configurable:!0}),"i"),u=Object.defineProperty,c=a((e,t)=>u(e,"name",{value:t,configurable:!0}),"s");import{LENS_EVENT_SOURCE as S}from"./error-dismissal.js";export const METRICS_RESET="metrics-reset",METRICS_RESTORED="metrics-restored",METRICS_SCOPES=["sql","external"],MAX_METRICS_RESET_IDS=500,MAX_METRICS_RESET_ID_LENGTH=512,METRICS_RESET_IDS_PER_EVENT=64;const d=16*1024,p=c(e=>e==="sql"||e==="external","isScope"),E=c(e=>typeof e=="string"&&e.length>0&&e.length<=MAX_METRICS_RESET_ID_LENGTH,"isId");export function readMetricsReset(e){if(e.source!==S||!e.raw||typeof e.raw!="object")return;const t=e.raw,r=t.kind;if(r!==METRICS_RESET&&r!==METRICS_RESTORED)return;const n=t.scope;if(!p(n))return;let s;if(t.ids!==void 0&&(!Array.isArray(t.ids)||(s=[...new Set(t.ids.filter(E))].slice(0,METRICS_RESET_IDS_PER_EVENT),!s.length)))return;if(r===METRICS_RESTORED)return{kind:r,scope:n,...s?{ids:s}:{}};const o=t.at;if(!(typeof o!="number"||!Number.isFinite(o)))return{kind:r,scope:n,at:Math.min(o,e.timestamp),...s?{ids:s}:{}}}i(readMetricsReset,"readMetricsReset"),a(readMetricsReset,"readMetricsReset"),c(readMetricsReset,"readMetricsReset");export function metricsIdBatches(e){const t=[];let r=[],n=0;for(const s of new Set(e.filter(E)))r.length&&(r.length>=METRICS_RESET_IDS_PER_EVENT||n+s.length+3>d)&&(t.push(r),r=[],n=0),r.push(s),n+=s.length+3;return r.length&&t.push(r),t}i(metricsIdBatches,"metricsIdBatches"),a(metricsIdBatches,"metricsIdBatches"),c(metricsIdBatches,"metricsIdBatches");
|
package/lib/node.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const TraceNodeTypeSchema: z.ZodEnum<{
|
|
3
|
+
page: "page";
|
|
4
|
+
route: "route";
|
|
5
|
+
session: "session";
|
|
3
6
|
effect: "effect";
|
|
4
7
|
timer: "timer";
|
|
5
8
|
"hmr-update": "hmr-update";
|
|
6
|
-
route: "route";
|
|
7
9
|
render: "render";
|
|
8
10
|
promise: "promise";
|
|
9
|
-
session: "session";
|
|
10
11
|
"browser-context": "browser-context";
|
|
11
12
|
tab: "tab";
|
|
12
13
|
renderer: "renderer";
|
|
13
14
|
router: "router";
|
|
14
|
-
page: "page";
|
|
15
15
|
component: "component";
|
|
16
16
|
element: "element";
|
|
17
17
|
slot: "slot";
|
|
@@ -64,9 +64,9 @@ export declare const TraceNodeTypeSchema: z.ZodEnum<{
|
|
|
64
64
|
}>;
|
|
65
65
|
export type TraceNodeType = z.infer<typeof TraceNodeTypeSchema>;
|
|
66
66
|
export declare const LifecycleSchema: z.ZodEnum<{
|
|
67
|
-
created: "created";
|
|
68
|
-
active: "active";
|
|
69
67
|
completed: "completed";
|
|
68
|
+
active: "active";
|
|
69
|
+
created: "created";
|
|
70
70
|
disposed: "disposed";
|
|
71
71
|
errored: "errored";
|
|
72
72
|
}>;
|
|
@@ -75,18 +75,18 @@ export declare const TraceNodeSchema: z.ZodObject<{
|
|
|
75
75
|
id: z.ZodString;
|
|
76
76
|
parentTraceNodeId: z.ZodOptional<z.ZodString>;
|
|
77
77
|
type: z.ZodEnum<{
|
|
78
|
+
page: "page";
|
|
79
|
+
route: "route";
|
|
80
|
+
session: "session";
|
|
78
81
|
effect: "effect";
|
|
79
82
|
timer: "timer";
|
|
80
83
|
"hmr-update": "hmr-update";
|
|
81
|
-
route: "route";
|
|
82
84
|
render: "render";
|
|
83
85
|
promise: "promise";
|
|
84
|
-
session: "session";
|
|
85
86
|
"browser-context": "browser-context";
|
|
86
87
|
tab: "tab";
|
|
87
88
|
renderer: "renderer";
|
|
88
89
|
router: "router";
|
|
89
|
-
page: "page";
|
|
90
90
|
component: "component";
|
|
91
91
|
element: "element";
|
|
92
92
|
slot: "slot";
|
|
@@ -141,9 +141,9 @@ export declare const TraceNodeSchema: z.ZodObject<{
|
|
|
141
141
|
instanceId: z.ZodOptional<z.ZodString>;
|
|
142
142
|
generation: z.ZodOptional<z.ZodNumber>;
|
|
143
143
|
lifecycle: z.ZodEnum<{
|
|
144
|
-
created: "created";
|
|
145
|
-
active: "active";
|
|
146
144
|
completed: "completed";
|
|
145
|
+
active: "active";
|
|
146
|
+
created: "created";
|
|
147
147
|
disposed: "disposed";
|
|
148
148
|
errored: "errored";
|
|
149
149
|
}>;
|
|
@@ -156,6 +156,7 @@ export declare const TraceNodeSchema: z.ZodObject<{
|
|
|
156
156
|
url: z.ZodOptional<z.ZodString>;
|
|
157
157
|
flowId: z.ZodOptional<z.ZodString>;
|
|
158
158
|
originType: z.ZodOptional<z.ZodEnum<{
|
|
159
|
+
request: "request";
|
|
159
160
|
"user-click": "user-click";
|
|
160
161
|
"user-input": "user-input";
|
|
161
162
|
keyboard: "keyboard";
|
|
@@ -181,7 +182,6 @@ export declare const TraceNodeSchema: z.ZodObject<{
|
|
|
181
182
|
"page-load": "page-load";
|
|
182
183
|
"form-submit": "form-submit";
|
|
183
184
|
"input-change": "input-change";
|
|
184
|
-
request: "request";
|
|
185
185
|
job: "job";
|
|
186
186
|
}>>;
|
|
187
187
|
originNodeId: z.ZodOptional<z.ZodString>;
|
package/lib/overseer-findings.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var u=Object.defineProperty;var i=(e,n)=>u(e,"name",{value:n,configurable:!0});var f=Object.defineProperty,s=i((e,n)=>f(e,"name",{value:n,configurable:!0}),"i"),d=Object.defineProperty,r=s((e,n)=>d(e,"name",{value:n,configurable:!0}),"s");export const FINDING_RUN_KINDS=["operate","stop-launch","close-session","role","role-off","check","rule","flow","lesson"];export function findingLive(e){return e.state==="open"||e.state==="proposed"||e.state==="applied"}i(findingLive,"findingLive"),s(findingLive,"findingLive"),r(findingLive,"findingLive");export function findingRunsActions(e,n={}){return e.actions.some(o=>FINDING_RUN_KINDS.includes(o.kind)||o.kind==="issue"&&n.issuesFolder===!0)}i(findingRunsActions,"findingRunsActions"),s(findingRunsActions,"findingRunsActions"),r(findingRunsActions,"findingRunsActions");export function findingsForCheck(e,n,o){const c=`repo:${n}/team.${o}`;return e.filter(t=>findingLive(t)&&t.checks.includes(c))}i(findingsForCheck,"findingsForCheck"),s(findingsForCheck,"findingsForCheck"),r(findingsForCheck,"findingsForCheck");
|
package/lib/overseer-rounds.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export interface DashOverseerSettings {
|
|
|
24
24
|
/** In the client's own words; none: its default. */
|
|
25
25
|
model?: string;
|
|
26
26
|
effort?: string;
|
|
27
|
+
/** What its Claude launches spend: LensMCP's own Anthropic key when one is kept (absent, the default), or the client's sign-in. */
|
|
28
|
+
credential?: 'key' | 'sign-in';
|
|
27
29
|
/** The folder a round runs in; none: LensMCP's own (`~/.lensmcp/overseer/session`), written again before each round. */
|
|
28
30
|
folder?: string;
|
|
29
31
|
/** The most rounds a day (local), the digest's among them — 1–12, 4 by default. */
|
package/lib/perf-rules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var c=Object.defineProperty;var a=(r,e)=>c(r,"name",{value:e,configurable:!0});var l=Object.defineProperty,o=a((r,e)=>l(r,"name",{value:e,configurable:!0}),"o"),f=Object.defineProperty,p=o((r,e)=>f(r,"name",{value:e,configurable:!0}),"o");export const PERF_RULE_IDS=["bundle/heavy-barrel-import","pod/heap-budget","pod/retained-generation"],PERF_RULE_EVENT_KINDS=["perf-rule-finding","perf-rule-retracted","perf-rule-scan"],PERF_RULES_DOC="https://github.com/kiwiapps-ltd/lensmcp/blob/main/docs/lensmcp/concepts/memory-and-build-cost.mdx",PERF_RULE_DOCS={"bundle/heavy-barrel-import":`${PERF_RULES_DOC}#bundleheavy-barrel-import`,"pod/heap-budget":`${PERF_RULES_DOC}#podheap-budget`,"pod/retained-generation":`${PERF_RULES_DOC}#podretained-generation`};export function perfRuleFingerprint(r,e,n){return`perf-rule:${r}:${e}:${n}`}a(perfRuleFingerprint,"perfRuleFingerprint"),o(perfRuleFingerprint,"perfRuleFingerprint"),p(perfRuleFingerprint,"perfRuleFingerprint");export function perfRuleScanFingerprint(r,e){return`perf-rule-scan:${r}:${e}`}a(perfRuleScanFingerprint,"perfRuleScanFingerprint"),o(perfRuleScanFingerprint,"perfRuleScanFingerprint"),p(perfRuleScanFingerprint,"perfRuleScanFingerprint");const s=/^[a-z][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/,d=12,y=4e3,t=p((r,e=y)=>typeof r=="string"&&r.length>0&&r.length<=e,"isText");export function asPerfRuleRaw(r){if(!r||typeof r!="object")return;const e=r;if(!PERF_RULE_EVENT_KINDS.includes(e.kind)||typeof e.rule!="string"||!s.test(e.rule)||!t(e.project,512))return;if(e.kind==="perf-rule-scan"){const i=e.open;return!Array.isArray(i)||i.length>256||!i.every(u=>t(u,512))?void 0:r}if(!t(e.subject,512))return;if(e.kind==="perf-rule-retracted")return r;if(e.severity!=="warning"&&e.severity!=="error"||!t(e.title)||!t(e.summary)||!t(e.verify)||!t(e.docs,1024))return;const n=e.fix;if(!(!Array.isArray(n)||n.length===0||n.length>d||!n.every(i=>t(i)))&&!(!e.evidence||typeof e.evidence!="object"||Array.isArray(e.evidence))&&!(!e.cost||typeof e.cost!="object"||Array.isArray(e.cost)))return r}a(asPerfRuleRaw,"asPerfRuleRaw"),o(asPerfRuleRaw,"asPerfRuleRaw"),p(asPerfRuleRaw,"asPerfRuleRaw");
|
package/lib/pod-memory.d.ts
CHANGED
|
@@ -55,6 +55,8 @@ export interface PodMemoryReportRaw extends PodMemoryIdentityRaw {
|
|
|
55
55
|
baseline?: number;
|
|
56
56
|
/** How long the collection paused the pod, ms. */
|
|
57
57
|
gcMs: number;
|
|
58
|
+
/** How long requests in flight held it back, ms, when they did. */
|
|
59
|
+
deferredMs?: number;
|
|
58
60
|
/** The generation the latest swap replaced. */
|
|
59
61
|
previousGen?: number;
|
|
60
62
|
/** Is it still in memory? `null` when there is none. */
|
package/lib/pod-memory.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var n=Object.defineProperty;var o=(r,e)=>n(r,"name",{value:e,configurable:!0});var d=Object.defineProperty,t=o((r,e)=>d(r,"name",{value:e,configurable:!0}),"r"),m=Object.defineProperty,i=t((r,e)=>m(r,"name",{value:e,configurable:!0}),"r");export const POD_MEMORY_KINDS=["pod-memory","pod-memory-retained","pod-memory-released","pod-memory-exited"];export function asPodMemoryRaw(r){if(!r||typeof r!="object")return;const e=r;if(POD_MEMORY_KINDS.includes(e.kind)&&!(typeof e.project!="string"||!e.project)&&!(typeof e.pod!="number"||typeof e.pid!="number")&&!(e.kind==="pod-memory"&&(typeof e.live!="number"||!Number.isFinite(e.live)))&&!((e.kind==="pod-memory-retained"||e.kind==="pod-memory-released")&&typeof e.gen!="number"))return r}o(asPodMemoryRaw,"asPodMemoryRaw"),t(asPodMemoryRaw,"asPodMemoryRaw"),i(asPodMemoryRaw,"asPodMemoryRaw");
|
package/lib/producer-health.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var R=Object.defineProperty;var i=(e,o)=>R(e,"name",{value:o,configurable:!0});var $=Object.defineProperty,d=i((e,o)=>$(e,"name",{value:o,configurable:!0}),"i"),b=Object.defineProperty,m=d((e,o)=>b(e,"name",{value:o,configurable:!0}),"u");import{z as r}from"zod";export const ProducerStateSchema=r.enum(["none","connected"]),ProducerRunStatusSchema=r.enum(["running","clean","failing","error"]),ProducerReportSchema=r.object({id:r.string(),tool:r.string(),project:r.string().optional(),firstReportedAt:r.number().int().nonnegative(),lastReportedAt:r.number().int().nonnegative(),lastRunStatus:ProducerRunStatusSchema,lastRunDurationMs:r.number().int().nonnegative().optional(),errorCount:r.number().int().nonnegative(),warningCount:r.number().int().nonnegative().optional(),error:r.string().optional()}),ProducerHealthSchema=r.object({producer:ProducerStateSchema,producers:r.array(ProducerReportSchema),lastReportedAt:r.number().int().nonnegative().optional(),ageMs:r.number().int().nonnegative().optional(),stale:r.boolean(),detail:r.string()}),PRODUCER_STALE_AFTER_MS=10*6e4;export function summariseProducers(e){const o=e.now??Date.now(),t=[...e.producers].sort((n,h)=>h.lastReportedAt-n.lastReportedAt);if(t.length===0)return{producer:"none",producers:[],stale:!1,detail:`No ${e.domain} producer has ever reported into this session \u2014 this is NOT a clean result, nothing is watching. ${e.noProducerHint}`};const l=t[0].lastReportedAt,u=Math.max(0,o-l),p=u>PRODUCER_STALE_AFTER_MS,g=t.filter(n=>n.lastRunStatus==="failing"),s=t.filter(n=>n.lastRunStatus==="error"),a=[`${t.length} ${e.domain} producer${t.length===1?"":"s"} reporting (${t.map(n=>n.id).join(", ")}); newest report ${c(u)}.`];return s.length>0&&a.push(`${s.length} produced NO verdict (the tool itself failed): ${s.map(n=>`${n.id} \u2014 ${n.error??"unknown error"}`).join("; ")}.`),g.length>0&&a.push(`${g.length} reporting errors.`),p&&a.push(`Older than ${Math.round(PRODUCER_STALE_AFTER_MS/6e4)}m \u2014 the verdict may predate the current source.`),{producer:"connected",producers:t,lastReportedAt:l,ageMs:u,stale:p,detail:a.join(" ")}}i(summariseProducers,"summariseProducers"),d(summariseProducers,"summariseProducers"),m(summariseProducers,"summariseProducers");function c(e){return e<1e3?"just now":e<6e4?`${Math.round(e/1e3)}s ago`:e<36e5?`${Math.round(e/6e4)}m ago`:`${Math.round(e/36e5)}h ago`}i(c,"g"),d(c,"g"),m(c,"describeAge");
|
package/lib/resources.d.ts
CHANGED
|
@@ -14,18 +14,18 @@ export declare const ResourceEnvelopeSchema: z.ZodObject<{
|
|
|
14
14
|
export type ResourceEnvelope = z.infer<typeof ResourceEnvelopeSchema>;
|
|
15
15
|
export declare const AgentStatusKindSchema: z.ZodEnum<{
|
|
16
16
|
warning: "warning";
|
|
17
|
+
starting: "starting";
|
|
17
18
|
clean: "clean";
|
|
18
19
|
failing: "failing";
|
|
19
|
-
starting: "starting";
|
|
20
20
|
}>;
|
|
21
21
|
export type AgentStatusKind = z.infer<typeof AgentStatusKindSchema>;
|
|
22
22
|
export declare const AgentBlockingItemSchema: z.ZodObject<{
|
|
23
23
|
source: z.ZodString;
|
|
24
24
|
severity: z.ZodEnum<{
|
|
25
25
|
error: "error";
|
|
26
|
-
debug: "debug";
|
|
27
26
|
info: "info";
|
|
28
27
|
warning: "warning";
|
|
28
|
+
debug: "debug";
|
|
29
29
|
fatal: "fatal";
|
|
30
30
|
}>;
|
|
31
31
|
title: z.ZodString;
|
|
@@ -49,37 +49,37 @@ export declare const AgentBlockingItemSchema: z.ZodObject<{
|
|
|
49
49
|
export type AgentBlockingItem = z.infer<typeof AgentBlockingItemSchema>;
|
|
50
50
|
export declare const AgentChecksSchema: z.ZodObject<{
|
|
51
51
|
typecheck: z.ZodOptional<z.ZodEnum<{
|
|
52
|
-
unknown: "unknown";
|
|
53
52
|
passed: "passed";
|
|
54
53
|
failed: "failed";
|
|
54
|
+
unknown: "unknown";
|
|
55
55
|
}>>;
|
|
56
56
|
lint: z.ZodOptional<z.ZodEnum<{
|
|
57
|
-
unknown: "unknown";
|
|
58
57
|
passed: "passed";
|
|
59
58
|
failed: "failed";
|
|
59
|
+
unknown: "unknown";
|
|
60
60
|
}>>;
|
|
61
61
|
build: z.ZodOptional<z.ZodEnum<{
|
|
62
|
-
unknown: "unknown";
|
|
63
62
|
passed: "passed";
|
|
64
63
|
failed: "failed";
|
|
64
|
+
unknown: "unknown";
|
|
65
65
|
}>>;
|
|
66
66
|
runtime: z.ZodOptional<z.ZodEnum<{
|
|
67
|
-
warning: "warning";
|
|
68
|
-
unknown: "unknown";
|
|
69
67
|
passed: "passed";
|
|
70
68
|
failed: "failed";
|
|
71
|
-
}>>;
|
|
72
|
-
visual: z.ZodOptional<z.ZodEnum<{
|
|
73
69
|
warning: "warning";
|
|
74
70
|
unknown: "unknown";
|
|
71
|
+
}>>;
|
|
72
|
+
visual: z.ZodOptional<z.ZodEnum<{
|
|
75
73
|
passed: "passed";
|
|
76
74
|
failed: "failed";
|
|
77
|
-
}>>;
|
|
78
|
-
memory: z.ZodOptional<z.ZodEnum<{
|
|
79
75
|
warning: "warning";
|
|
80
76
|
unknown: "unknown";
|
|
77
|
+
}>>;
|
|
78
|
+
memory: z.ZodOptional<z.ZodEnum<{
|
|
81
79
|
passed: "passed";
|
|
82
80
|
failed: "failed";
|
|
81
|
+
warning: "warning";
|
|
82
|
+
unknown: "unknown";
|
|
83
83
|
}>>;
|
|
84
84
|
}, z.core.$strip>;
|
|
85
85
|
/**
|
|
@@ -92,14 +92,14 @@ export declare const AgentChecksSchema: z.ZodObject<{
|
|
|
92
92
|
* bundle it started with until that session ends).
|
|
93
93
|
*/
|
|
94
94
|
export declare const AgentServerModeSchema: z.ZodEnum<{
|
|
95
|
-
embedded: "embedded";
|
|
96
95
|
shared: "shared";
|
|
96
|
+
embedded: "embedded";
|
|
97
97
|
}>;
|
|
98
98
|
export type AgentServerMode = z.infer<typeof AgentServerModeSchema>;
|
|
99
99
|
export declare const AgentServerInfoSchema: z.ZodObject<{
|
|
100
100
|
mode: z.ZodEnum<{
|
|
101
|
-
embedded: "embedded";
|
|
102
101
|
shared: "shared";
|
|
102
|
+
embedded: "embedded";
|
|
103
103
|
}>;
|
|
104
104
|
pid: z.ZodNumber;
|
|
105
105
|
startedAt: z.ZodString;
|
|
@@ -114,9 +114,9 @@ export declare const AgentCurrentStatusSchema: z.ZodObject<{
|
|
|
114
114
|
sessionId: z.ZodString;
|
|
115
115
|
status: z.ZodEnum<{
|
|
116
116
|
warning: "warning";
|
|
117
|
+
starting: "starting";
|
|
117
118
|
clean: "clean";
|
|
118
119
|
failing: "failing";
|
|
119
|
-
starting: "starting";
|
|
120
120
|
}>;
|
|
121
121
|
activeTab: z.ZodOptional<z.ZodString>;
|
|
122
122
|
tabsWithIssues: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -124,9 +124,9 @@ export declare const AgentCurrentStatusSchema: z.ZodObject<{
|
|
|
124
124
|
source: z.ZodString;
|
|
125
125
|
severity: z.ZodEnum<{
|
|
126
126
|
error: "error";
|
|
127
|
-
debug: "debug";
|
|
128
127
|
info: "info";
|
|
129
128
|
warning: "warning";
|
|
129
|
+
debug: "debug";
|
|
130
130
|
fatal: "fatal";
|
|
131
131
|
}>;
|
|
132
132
|
title: z.ZodString;
|
|
@@ -151,9 +151,9 @@ export declare const AgentCurrentStatusSchema: z.ZodObject<{
|
|
|
151
151
|
source: z.ZodString;
|
|
152
152
|
severity: z.ZodEnum<{
|
|
153
153
|
error: "error";
|
|
154
|
-
debug: "debug";
|
|
155
154
|
info: "info";
|
|
156
155
|
warning: "warning";
|
|
156
|
+
debug: "debug";
|
|
157
157
|
fatal: "fatal";
|
|
158
158
|
}>;
|
|
159
159
|
title: z.ZodString;
|
|
@@ -177,43 +177,43 @@ export declare const AgentCurrentStatusSchema: z.ZodObject<{
|
|
|
177
177
|
suggestedReads: z.ZodArray<z.ZodString>;
|
|
178
178
|
checks: z.ZodOptional<z.ZodObject<{
|
|
179
179
|
typecheck: z.ZodOptional<z.ZodEnum<{
|
|
180
|
-
unknown: "unknown";
|
|
181
180
|
passed: "passed";
|
|
182
181
|
failed: "failed";
|
|
182
|
+
unknown: "unknown";
|
|
183
183
|
}>>;
|
|
184
184
|
lint: z.ZodOptional<z.ZodEnum<{
|
|
185
|
-
unknown: "unknown";
|
|
186
185
|
passed: "passed";
|
|
187
186
|
failed: "failed";
|
|
187
|
+
unknown: "unknown";
|
|
188
188
|
}>>;
|
|
189
189
|
build: z.ZodOptional<z.ZodEnum<{
|
|
190
|
-
unknown: "unknown";
|
|
191
190
|
passed: "passed";
|
|
192
191
|
failed: "failed";
|
|
192
|
+
unknown: "unknown";
|
|
193
193
|
}>>;
|
|
194
194
|
runtime: z.ZodOptional<z.ZodEnum<{
|
|
195
|
-
warning: "warning";
|
|
196
|
-
unknown: "unknown";
|
|
197
195
|
passed: "passed";
|
|
198
196
|
failed: "failed";
|
|
199
|
-
}>>;
|
|
200
|
-
visual: z.ZodOptional<z.ZodEnum<{
|
|
201
197
|
warning: "warning";
|
|
202
198
|
unknown: "unknown";
|
|
199
|
+
}>>;
|
|
200
|
+
visual: z.ZodOptional<z.ZodEnum<{
|
|
203
201
|
passed: "passed";
|
|
204
202
|
failed: "failed";
|
|
205
|
-
}>>;
|
|
206
|
-
memory: z.ZodOptional<z.ZodEnum<{
|
|
207
203
|
warning: "warning";
|
|
208
204
|
unknown: "unknown";
|
|
205
|
+
}>>;
|
|
206
|
+
memory: z.ZodOptional<z.ZodEnum<{
|
|
209
207
|
passed: "passed";
|
|
210
208
|
failed: "failed";
|
|
209
|
+
warning: "warning";
|
|
210
|
+
unknown: "unknown";
|
|
211
211
|
}>>;
|
|
212
212
|
}, z.core.$strip>>;
|
|
213
213
|
server: z.ZodOptional<z.ZodObject<{
|
|
214
214
|
mode: z.ZodEnum<{
|
|
215
|
-
embedded: "embedded";
|
|
216
215
|
shared: "shared";
|
|
216
|
+
embedded: "embedded";
|
|
217
217
|
}>;
|
|
218
218
|
pid: z.ZodNumber;
|
|
219
219
|
startedAt: z.ZodString;
|
|
@@ -328,9 +328,9 @@ declare const CheckEntrySchema: z.ZodObject<{
|
|
|
328
328
|
rule: z.ZodOptional<z.ZodString>;
|
|
329
329
|
severity: z.ZodOptional<z.ZodEnum<{
|
|
330
330
|
error: "error";
|
|
331
|
-
debug: "debug";
|
|
332
331
|
info: "info";
|
|
333
332
|
warning: "warning";
|
|
333
|
+
debug: "debug";
|
|
334
334
|
fatal: "fatal";
|
|
335
335
|
}>>;
|
|
336
336
|
file: z.ZodOptional<z.ZodString>;
|
|
@@ -417,9 +417,9 @@ export declare const TypecheckErrorsSchema: z.ZodObject<{
|
|
|
417
417
|
rule: z.ZodOptional<z.ZodString>;
|
|
418
418
|
severity: z.ZodOptional<z.ZodEnum<{
|
|
419
419
|
error: "error";
|
|
420
|
-
debug: "debug";
|
|
421
420
|
info: "info";
|
|
422
421
|
warning: "warning";
|
|
422
|
+
debug: "debug";
|
|
423
423
|
fatal: "fatal";
|
|
424
424
|
}>>;
|
|
425
425
|
file: z.ZodOptional<z.ZodString>;
|