@lensmcp/protocol-types 1.26.33 → 1.26.35
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 +3 -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.js +3 -3
- package/lib/canvas-chat.js +2 -2
- 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.js +1 -1
- package/lib/capture-demand.js +1 -1
- package/lib/dashboard-path.js +1 -1
- package/lib/delivery-status.d.ts +197 -0
- package/lib/delivery-status.js +1 -0
- 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-number.d.ts +20 -0
- package/lib/goal-number.js +1 -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 +2 -2
- 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 +161 -0
- package/lib/pull-requests.js +1 -0
- package/lib/remote-instances.js +1 -1
- package/lib/sources.js +1 -1
- package/lib/static-checks.js +1 -1
- package/lib/system-report.js +1 -1
- package/lib/team-roadmap.d.ts +2 -0
- package/lib/team.d.ts +64 -0
- package/lib/team.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pull requests and the goals they carry (issues/closed/foodguard-312). The owner, 2026-11-25: «i would like to see the
|
|
3
|
+
* prs also … how it's related to goals so each goal when open pr will add specific tag or something that we can verify
|
|
4
|
+
* that it's connected to specific goal».
|
|
5
|
+
*
|
|
6
|
+
* A pull request names a goal four ways, each a {@link PrProof}:
|
|
7
|
+
*
|
|
8
|
+
* label `goal:<the goal id's first 8 characters>` — what `lensmcp agent pr` and the page's «Tag» add
|
|
9
|
+
* body `<!-- lensmcp-goal: <uuid> -->`, and the visible line `LensMCP goal: <title> (<uuid>)`
|
|
10
|
+
* commit one of its commits is the goal's — its message body says `Goal: <uuid>` (LensMCP's squash or merge commit,
|
|
11
|
+
* apps/agent goal-merge.ts), or it is the goal's landed commit or branch tip
|
|
12
|
+
* branch its head branch is the goal's own (`lensmcp/g-…`) or the one `lensmcp agent pr` pushed (`lensmcp/pr/…`)
|
|
13
|
+
*
|
|
14
|
+
* A label or a body says what someone wrote. A goal is **verified** on a pull request only when the goal's landed
|
|
15
|
+
* commit or its branch tip is among the pull request's commits — the code the goal made is the code under review.
|
|
16
|
+
*/
|
|
17
|
+
export type PrProof = 'label' | 'body' | 'commit' | 'branch';
|
|
18
|
+
/** The proofs in the order the page says them: «label · body · commit · branch». */
|
|
19
|
+
export declare const PR_PROOFS: readonly PrProof[];
|
|
20
|
+
/** GitHub's three states, a draft apart from an open one. */
|
|
21
|
+
export type PrState = 'open' | 'draft' | 'merged' | 'closed';
|
|
22
|
+
/** Its checks as one word: any failing, else any still running, else any passed — `none` when there are none. */
|
|
23
|
+
export type PrChecksState = 'failing' | 'pending' | 'passing' | 'none';
|
|
24
|
+
export interface DashPrChecks {
|
|
25
|
+
state: PrChecksState;
|
|
26
|
+
passed: number;
|
|
27
|
+
failed: number;
|
|
28
|
+
pending: number;
|
|
29
|
+
/** Skipped and neutral: neither passed nor failed. */
|
|
30
|
+
skipped: number;
|
|
31
|
+
total: number;
|
|
32
|
+
/** The names of the failing ones, at most five. */
|
|
33
|
+
failing?: string[];
|
|
34
|
+
}
|
|
35
|
+
/** One goal a pull request carries, with how it is proven. */
|
|
36
|
+
export interface DashPrGoal {
|
|
37
|
+
/**
|
|
38
|
+
* The goal's id: whole when this repository's team knows it, or a body or commit names it whole; the label's eight
|
|
39
|
+
* characters when only a label names a goal the team does not know.
|
|
40
|
+
*/
|
|
41
|
+
id: string;
|
|
42
|
+
/** Its number, shown G-44, when the team knows it (issues/closed/foodguard-314). */
|
|
43
|
+
number?: number;
|
|
44
|
+
/** Its title and state, when the team knows it. */
|
|
45
|
+
title?: string;
|
|
46
|
+
state?: string;
|
|
47
|
+
/** This repository's team holds the goal. */
|
|
48
|
+
known: boolean;
|
|
49
|
+
/** How the pull request names it, in {@link PR_PROOFS} order. */
|
|
50
|
+
proofs: PrProof[];
|
|
51
|
+
/** The goal's landed commit or its branch tip is among the pull request's commits. */
|
|
52
|
+
verified: boolean;
|
|
53
|
+
/** Which commit proved it: the goal's landed commit (squash, merge or fast-forward), or a tip of its branch. */
|
|
54
|
+
verifiedBy?: {
|
|
55
|
+
sha: string;
|
|
56
|
+
what: 'landed' | 'tip';
|
|
57
|
+
};
|
|
58
|
+
/** Labelled and marked in its body — what `lensmcp agent pr` and «Tag» leave. */
|
|
59
|
+
tagged: boolean;
|
|
60
|
+
/** «Tag» adds the label and the marker: a goal the team knows, linked by a commit or its branch, not tagged yet. */
|
|
61
|
+
taggable: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface DashPullRequest {
|
|
64
|
+
number: number;
|
|
65
|
+
title: string;
|
|
66
|
+
url: string;
|
|
67
|
+
state: PrState;
|
|
68
|
+
/** Its head and base branches. */
|
|
69
|
+
head: string;
|
|
70
|
+
base: string;
|
|
71
|
+
/** Who opened it (GitHub login). */
|
|
72
|
+
author?: string;
|
|
73
|
+
createdAt: number;
|
|
74
|
+
mergedAt?: number;
|
|
75
|
+
checks: DashPrChecks;
|
|
76
|
+
labels: string[];
|
|
77
|
+
/** How many commits were read — GitHub's list holds a pull request's first {@link PR_COMMITS_READ}. */
|
|
78
|
+
commits: number;
|
|
79
|
+
/** It may hold more commits than were read: a goal's commit past them is not seen. */
|
|
80
|
+
commitsCut?: true;
|
|
81
|
+
/** The goals it carries — none: «no goal». */
|
|
82
|
+
goals: DashPrGoal[];
|
|
83
|
+
/** GitHub's word on whether it merges cleanly into its base. */
|
|
84
|
+
mergeable?: 'mergeable' | 'conflicting' | 'unknown';
|
|
85
|
+
/** GitHub's merge state, lower-case: `clean`, `unstable` (a check failing), `blocked`, `behind`, `dirty`, `draft`… */
|
|
86
|
+
mergeState?: string;
|
|
87
|
+
/** Its reviews: approved, changes asked for, or a review required and not given. Absent: none asked for. */
|
|
88
|
+
review?: 'approved' | 'changes-requested' | 'required';
|
|
89
|
+
/** Open, not a draft, its checks passed, merging cleanly, approved where a review is required. */
|
|
90
|
+
ready: boolean;
|
|
91
|
+
/** Why an open one is not ready, most pressing first: failing checks named, conflicts, behind its base, draft, reviews. */
|
|
92
|
+
blocked?: string[];
|
|
93
|
+
/** The pull request whose head is its base: it merges after that one (a stack). */
|
|
94
|
+
stackedOn?: number;
|
|
95
|
+
/** Its base was a pull request's head that has merged: retarget it to main. */
|
|
96
|
+
retarget?: string;
|
|
97
|
+
}
|
|
98
|
+
/** Pull requests stacked on one another, in merge order: the first merges into main, each next one into the one before. */
|
|
99
|
+
export interface DashPrStack {
|
|
100
|
+
/** Its first pull request's number, as text. */
|
|
101
|
+
id: string;
|
|
102
|
+
numbers: number[];
|
|
103
|
+
/** Every one of them ready: the stack counts once among «ready to merge». */
|
|
104
|
+
ready: boolean;
|
|
105
|
+
}
|
|
106
|
+
/** Why the pull requests could not be read: no `gh`, `gh` not signed in, no GitHub remote, anything else. */
|
|
107
|
+
export type DashPrProblemKind = 'no-gh' | 'signed-out' | 'no-remote' | 'error';
|
|
108
|
+
export interface DashPullRequestsAnswer {
|
|
109
|
+
/** When GitHub was read — at most once a minute per repository. */
|
|
110
|
+
at: number;
|
|
111
|
+
/** The next read of GitHub, no sooner. */
|
|
112
|
+
nextAt: number;
|
|
113
|
+
/** `owner/name`, from the pull requests' addresses. */
|
|
114
|
+
repo?: string;
|
|
115
|
+
/** Open ones first, then the newest. */
|
|
116
|
+
prs: DashPullRequest[];
|
|
117
|
+
/** The open pull requests stacked on one another (two or more), in merge order. */
|
|
118
|
+
stacks: DashPrStack[];
|
|
119
|
+
/** The newest this many were read. */
|
|
120
|
+
limit: number;
|
|
121
|
+
/** The last read failed: why. With `stale`, the pull requests shown are the last ones read. */
|
|
122
|
+
problem?: {
|
|
123
|
+
kind: DashPrProblemKind;
|
|
124
|
+
text: string;
|
|
125
|
+
};
|
|
126
|
+
stale?: true;
|
|
127
|
+
/** Only the pull requests of this goal (`?goal=`). */
|
|
128
|
+
goal?: string;
|
|
129
|
+
}
|
|
130
|
+
/** `POST /api/team/prs/tag`: label and mark one pull request with one goal — the person's click. */
|
|
131
|
+
export interface DashPrTagRequest {
|
|
132
|
+
number: number;
|
|
133
|
+
goalId: string;
|
|
134
|
+
}
|
|
135
|
+
export interface DashPrTagAnswer {
|
|
136
|
+
pr: DashPullRequest;
|
|
137
|
+
/** What was done, in words: the label made, added, the marker written. */
|
|
138
|
+
did: string[];
|
|
139
|
+
}
|
|
140
|
+
/** A pull request GitHub's list gives with its first this many commits. */
|
|
141
|
+
export declare const PR_COMMITS_READ = 100;
|
|
142
|
+
/**
|
|
143
|
+
* The label a goal's pull request carries: `goal:G-44`, its number (issues/closed/foodguard-314) — or, for a goal with
|
|
144
|
+
* none and for labels made before numbers, `goal:` and the id's first eight characters. Group 1: those eight; group 2: the number.
|
|
145
|
+
*/
|
|
146
|
+
export declare const PR_GOAL_LABEL: RegExp;
|
|
147
|
+
/** The hidden marker in a pull request's body. */
|
|
148
|
+
export declare const PR_GOAL_MARKER: RegExp;
|
|
149
|
+
/** The visible line in a pull request's body. */
|
|
150
|
+
export declare const PR_GOAL_LINE: RegExp;
|
|
151
|
+
/**
|
|
152
|
+
* A goal's line in a commit message body (goal-merge.ts goalMergeMessage): `Goal: <id>`, or with its number first,
|
|
153
|
+
* `Goal: G-44 (<id>)` (issues/closed/foodguard-314). The id is the first group either way.
|
|
154
|
+
*/
|
|
155
|
+
export declare const COMMIT_GOAL_LINE: RegExp;
|
|
156
|
+
/** The label of a goal's pull request: `goal:G-44` when the goal has its number, else `goal:` and the id's first eight. */
|
|
157
|
+
export declare function goalLabel(goalId: string, number?: number): string;
|
|
158
|
+
/** The hidden marker naming the goal in a pull request's body. */
|
|
159
|
+
export declare function goalMarker(goalId: string): string;
|
|
160
|
+
/** The visible line naming the goal in a pull request's body: its number (G-44), its title on one line, its id. */
|
|
161
|
+
export declare function goalLine(title: string, goalId: string, number?: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var o=(e,a)=>n(e,"name",{value:a,configurable:!0});var t=Object.defineProperty,f=o((e,a)=>t(e,"name",{value:a,configurable:!0}),"t");export const PR_PROOFS=["label","body","commit","branch"],PR_COMMITS_READ=100,PR_GOAL_LABEL=/^goal:(?:([0-9a-f]{8})|g-(\d{1,9}))$/i,PR_GOAL_MARKER=/<!--\s*lensmcp-goal:\s*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\s*-->/gi,PR_GOAL_LINE=/^LensMCP goal: .*\(([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\)\s*$/gim,COMMIT_GOAL_LINE=/^Goal: (?:G-\d{1,9} \()?([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\)?\s*$/gim;export function goalLabel(e,a){return a!==void 0&&Number.isSafeInteger(a)&&a>0?`goal:G-${a}`:`goal:${e.slice(0,8).toLowerCase()}`}o(goalLabel,"goalLabel"),f(goalLabel,"goalLabel");export function goalMarker(e){return`<!-- lensmcp-goal: ${e.toLowerCase()} -->`}o(goalMarker,"goalMarker"),f(goalMarker,"goalMarker");export function goalLine(e,a,r){const l=e.replace(/[\u0000-\u001f\u007f-\u009f]+/g," ").replace(/\s+/g," ").trim().slice(0,200)||"a goal";return`LensMCP goal: ${r!==void 0&&Number.isSafeInteger(r)&&r>0?`G-${r} \u2014 `:""}${l} (${a.toLowerCase()})`}o(goalLine,"goalLine"),f(goalLine,"goalLine");
|
package/lib/remote-instances.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var t=Object.defineProperty;var _=(E,e)=>t(E,"name",{value:e,configurable:!0});var n=Object.defineProperty,A=_((E,e)=>n(E,"name",{value:e,configurable:!0}),"t");export const REMOTE_INSTANCE_ID_PATTERN=/^[A-Za-z0-9][A-Za-z0-9_-]{7,39}$/,REMOTE_INSTANCE_NAME_PREFIX="g-",MAX_REMOTE_INSTANCE_SEC=14400,REMOTE_LENS_LABEL="lensmcp",REMOTE_DASHBOARD_BASE_PATTERN=/^\/[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/,PEER_TUNNEL_HEADER="x-lensmcp-peer-tunnel";export function remoteLensHost(E){return`${REMOTE_LENS_LABEL}.${E.toLowerCase()}`}_(remoteLensHost,"remoteLensHost"),A(remoteLensHost,"remoteLensHost");export const REMOTE_INSTANCES_FILE="instances.json";
|
package/lib/sources.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var T=Object.defineProperty;var a=(t,r)=>T(t,"name",{value:r,configurable:!0});var U=Object.defineProperty,e=a((t,r)=>U(t,"name",{value:r,configurable:!0}),"r");export const SOURCE_KINDS=["queue","loop","store","traffic"],SOURCE_KINDS_READ=["queue","loop","store","traffic"],sourceWireSchema=e(t=>`lensmcp.${t}/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(t){return Math.max(SOURCE_STALE_MIN_MS,SOURCE_STALE_PERIODS*Math.max(0,t))}a(sourceStaleAfterMs,"sourceStaleAfterMs"),e(sourceStaleAfterMs,"sourceStaleAfterMs");const n=e(t=>typeof t=="object"&&t!==null&&!Array.isArray(t),"isObj"),s=e(t=>typeof t=="number"&&Number.isInteger(t)&&t>=0,"isCount"),E=e(t=>typeof t=="number"&&Number.isFinite(t)&&t>0,"isTime"),u=e((t,r)=>typeof t=="string"&&t.length>0&&t.length<=r,"isStr"),v=e(t=>t===void 0||typeof t=="number"&&t>0,"isMin");function _(t){if(!SOURCE_KINDS_READ.includes(t.sourceKind)||typeof t.path!="string"&&!(t.path===void 0&&(t.sourceKind==="traffic"||t.sourceKind==="loop"))||!u(t.name,200)||typeof t.intervalSec!="number"||t.feeds!==void 0&&!u(t.feeds,200))return!1;const r=t.thresholds;if(!n(r))return!1;for(const o of["stalledMin","idleMin","oldestWaitMin","quotaPct","errorRatePct","orphanMin","failurePct","p95Ms","rateLimited"])if(!v(r[o]))return!1;return t.sourceKind!=="queue"||typeof r.oldestWaitMin=="number"}a(_,"l"),e(_,"asDecl");const l=e(t=>t===null||typeof t=="string","isIsoOrNull"),c=e(t=>t===void 0||s(t),"isOptCount");function d(t){if(!n(t)||typeof t.at!="string"||!E(t.receivedAt)||!E(t.intervalSec)||!l(t.lastRunAt)||t.nextRunAt!==void 0&&!l(t.nextRunAt))return!1;for(const r of["lastDurationMs","lastItems","runsInWindow","itemsInWindow","failuresInWindow","windowSec"])if(!c(t[r]))return!1;return t.lastOutcome!==void 0&&!LOOP_OUTCOMES.includes(t.lastOutcome)?!1:t.lastError===void 0||typeof t.lastError=="string"}a(d,"_"),e(d,"asLoopSnapshot");const f=e(t=>t===void 0||n(t)&&Object.values(t).every(r=>typeof r=="string"),"isLabels");function S(t){if(!n(t)||typeof t.at!="string"||!E(t.receivedAt)||!s(t.objects)||!s(t.bytes)||t.quotaBytes!==void 0&&t.quotaBytes!==null&&!s(t.quotaBytes))return!1;for(const i of["opsInWindow","writesInWindow","deletesInWindow","errorsInWindow","windowSec"])if(!c(t[i]))return!1;if(t.lastWriteAt!==void 0&&!l(t.lastWriteAt)||t.lastError!==void 0&&typeof t.lastError!="string")return!1;const r=t.truncated;if(r!==void 0&&!(n(r)&&s(r.groups)))return!1;const o=t.groups;return o===void 0?!0:Array.isArray(o)&&o.length<=SOURCE_MAX_GROUPS&&o.every(i=>n(i)&&u(i.group,1e3)&&s(i.objects)&&s(i.bytes)&&f(i.labels))}a(S,"S"),e(S,"asStoreSnapshot");function p(t){if(!n(t)||typeof t.at!="string"||!E(t.receivedAt)||!Array.isArray(t.channels)||!c(t.windowSec))return!1;const r=t.truncated;return r!==void 0&&!(n(r)&&s(r.channels))?!1:t.channels.length<=SOURCE_MAX_GROUPS&&t.channels.every(o=>{if(!n(o)||!u(o.channel,1e3)||!f(o.labels)||o.direction!==void 0&&o.direction!=="inbound"&&o.direction!=="outbound"||o.counterpart!==void 0&&!u(o.counterpart,200))return!1;for(const i of["messagesInWindow","failuresInWindow","rateLimitedInWindow"])if(!c(o[i]))return!1;return o.p95Ms!==void 0&&!(typeof o.p95Ms=="number"&&Number.isFinite(o.p95Ms)&&o.p95Ms>=0)||o.lastAt!==void 0&&!l(o.lastAt)?!1:o.lastError===void 0||typeof o.lastError=="string"})}a(p,"R"),e(p,"asTrafficSnapshot");function R(t){return n(t)&&u(t.digest,100)&&typeof t.at=="string"&&E(t.receivedAt)}a(R,"A"),e(R,"asSame");function A(t){if(!n(t)||!u(t.group,1e3)||!s(t.pending))return!1;for(const i of["inFlight","failed","completedInWindow"])if(t[i]!==void 0&&!s(t[i]))return!1;const r=t.oldestPendingAt;if(r!=null&&typeof r!="string")return!1;const o=t.labels;return o===void 0||n(o)&&Object.values(o).every(i=>typeof i=="string")}a(A,"O"),e(A,"asGroup");function O(t){if(!n(t)||typeof t.at!="string"||!E(t.receivedAt)||!Array.isArray(t.groups))return!1;const r=t.totals;if(!n(r)||!s(r.groups)||!s(r.pending)||!s(r.inFlight)||!s(r.failed))return!1;const o=t.truncated;return o!==void 0&&!(n(o)&&s(o.groups))?!1:t.groups.length<=SOURCE_MAX_GROUPS&&t.groups.every(A)}a(O,"T"),e(O,"asSnapshot");export function asSourcePollRaw(t){if(!n(t)||t.kind!=="source-poll"||!u(t.project,200)||!_(t)||!SOURCE_POLL_STATES.includes(t.state)||!E(t.polledAt)||!E(t.reportEveryMs)||t.path===void 0)return;const r=SOURCE_SNAPSHOT_FIELD[t.sourceKind];for(const i of Object.values(SOURCE_SNAPSHOT_FIELD))if(i!==r&&t[i]!==void 0)return;const o={snapshot:O,loop:d,store:S,traffic:p}[r];if(!(t[r]!==void 0&&!o(t[r]))&&!(t.same!==void 0&&(!R(t.same)||t[r]!==void 0))&&!(t.state==="current"&&t[r]===void 0&&t.same===void 0))return t}a(asSourcePollRaw,"asSourcePollRaw"),e(asSourcePollRaw,"asSourcePollRaw");export function asSourceEventRaw(t){if(!n(t)||t.kind!=="source-event"||!u(t.project,200)||!u(t.name,200))return;const r=t.sourceKind;if(SOURCE_KINDS_READ.includes(r)&&SOURCE_PUSH_EVENTS[r].includes(t.event)&&!(t.item!==void 0&&!u(t.item,200)||t.group!==void 0&&!u(t.group,200))&&!(!c(t.items)||!c(t.durationMs)||!c(t.bytes))&&!(t.outcome!==void 0&&!SOURCE_PUSH_OUTCOMES[r].includes(t.outcome))){for(const o of["object","channel","counterpart","correlation"])if(t[o]!==void 0&&!u(t[o],200))return;if(!(t.error!==void 0&&typeof t.error!="string"))return t}}a(asSourceEventRaw,"asSourceEventRaw"),e(asSourceEventRaw,"asSourceEventRaw");export function asSourceDeclarationRaw(t){if(!(!n(t)||t.kind!=="source-declaration"||!u(t.project,200))&&!(!Array.isArray(t.sources)||!t.sources.every(r=>n(r)&&_(r)))&&!(!Array.isArray(t.problems)||!t.problems.every(r=>typeof r=="string")))return t}a(asSourceDeclarationRaw,"asSourceDeclarationRaw"),e(asSourceDeclarationRaw,"asSourceDeclarationRaw");
|
package/lib/static-checks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var d=Object.defineProperty;var l=(e,n)=>d(e,"name",{value:n,configurable:!0});var g=Object.defineProperty,a=l((e,n)=>g(e,"name",{value:n,configurable:!0}),"l");export const OWNER_WORKSPACE="(workspace)",OWNER_EXTERNAL="(external)";export function workspacePath(e){return e.replace(/\\/g,"/").replace(/^(\.\/)+/,"")}l(workspacePath,"workspacePath"),a(workspacePath,"workspacePath");export function ownerMap(e){const n=Object.entries(e).map(([t,r])=>({name:t,root:workspacePath(r.root).replace(/\/+$/,"")})).filter(t=>t.root!==""&&t.root!==".").sort((t,r)=>r.root.length-t.root.length||(t.name<r.name?-1:t.name>r.name?1:0)),s=Object.entries(e).filter(([,t])=>["","."].includes(workspacePath(t.root).replace(/\/+$/,""))).map(([t])=>t).sort()[0];return t=>{const r=workspacePath(t);if(r.startsWith("/")||r.startsWith("../")||r===".."||/^[A-Za-z]:\//.test(r)||r.split("/").includes("node_modules"))return OWNER_EXTERNAL;for(const{name:o,root:i}of n)if(r===i||r.startsWith(`${i}/`))return o;return s??OWNER_WORKSPACE}}l(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"),a(typecheckFindingKey,"typecheckFindingKey");export function lintFindingKey(e){return`${e.file}:${e.line}:${e.col}:${e.ruleId??""}`}l(lintFindingKey,"lintFindingKey"),a(lintFindingKey,"lintFindingKey");const p=a((e,n)=>e.file<n.file?-1:e.file>n.file?1:e.line-n.line||e.col-n.col,"byPosition");export function dedupeTypecheckFindings(e,n){const s=new Map;for(const{program:r,diagnostics:o}of e)for(const i of o){const c=typecheckFindingKey(i),u=s.get(c);if(!u){s.set(c,{file:i.file,line:i.line,col:i.col,code:i.code,severity:i.severity,message:i.message,project:n(i.file),programs:[r]});continue}u.programs.includes(r)||u.programs.push(r),i.severity==="error"&&(u.severity="error")}const t=[...s.values()];for(const r of t)r.programs.sort();return t.sort((r,o)=>p(r,o)||(r.code<o.code?-1:r.code>o.code?1:0))}l(dedupeTypecheckFindings,"dedupeTypecheckFindings"),a(dedupeTypecheckFindings,"dedupeTypecheckFindings");export function dedupeLintFindings(e,n){const s=new Map;for(const{unit:o,messages:i}of e)for(const c of i){const u=lintFindingKey(c),f=s.get(u);if(!f){s.set(u,{file:c.file,line:c.line,col:c.col,ruleId:c.ruleId,severity:c.severity,message:c.message,project:n(c.file),units:[o],...c.fixable?{fixable:!0}:{}});continue}f.units.includes(o)||f.units.push(o),c.severity==="error"&&(f.severity="error")}const t=[...s.values()];for(const o of t)o.units.sort();const r=a(o=>o.ruleId??"","rule");return t.sort((o,i)=>p(o,i)||(r(o)<r(i)?-1:r(o)>r(i)?1:0))}l(dedupeLintFindings,"dedupeLintFindings"),a(dedupeLintFindings,"dedupeLintFindings");export function verdictOf(e){const{errors:n,coverage:s}=e;return n>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"),a(verdictOf,"verdictOf");export function exitCodeOf(e,n={}){return e==="errors"?1:e==="clean"||e==="partial"&&n.allowPartial?0:2}l(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 r=(e,n)=>o(e,"name",{value:n,configurable:!0});var a=Object.defineProperty,s=r((e,n)=>a(e,"name",{value:n,configurable:!0}),"n");export function systemScopeId(e){return e.kind==="machine"?"machine":e.kind==="repository"?`repo:${e.repoId}`:`ws:${e.key}`}r(systemScopeId,"systemScopeId"),s(systemScopeId,"systemScopeId");export function systemItemKey(e,n){return`${systemScopeId(e)}/${n}`}r(systemItemKey,"systemItemKey"),s(systemItemKey,"systemItemKey");export function systemValue(e,n){switch(n){case"bytes":{const t=e/1073741824;return t>=1?`${t.toFixed(t>=100?0:1)} GB`:`${Math.round(e/1024**2)} MB`}case"ms":return e>=1e3?`${(e/1e3).toFixed(1)} s`:`${Math.round(e)} ms`;case"percent":return`${Math.round(e)} %`;case"usd":return`$${e.toFixed(2)}`;case"load":return`load ${e.toFixed(1)}`;case"minutes":return`${Math.round(e)} min`;default:return String(e)}}r(systemValue,"systemValue"),s(systemValue,"systemValue");export function systemScopeLabel(e){return e.kind==="machine"?"machine":e.kind==="repository"?e.name:`${e.name} lens`}r(systemScopeLabel,"systemScopeLabel"),s(systemScopeLabel,"systemScopeLabel");const u={"n/a":0,ok:1,warn:2,bad:3};export function systemStatusRank(e){return u[e]}r(systemStatusRank,"systemStatusRank"),s(systemStatusRank,"systemStatusRank");
|
package/lib/team-roadmap.d.ts
CHANGED
|
@@ -177,6 +177,8 @@ export interface RoadmapGoal {
|
|
|
177
177
|
title: string;
|
|
178
178
|
state: string;
|
|
179
179
|
createdAt: number;
|
|
180
|
+
/** Its number, shown G-44 (issues/closed/foodguard-314). */
|
|
181
|
+
number?: number;
|
|
180
182
|
startedAt?: number;
|
|
181
183
|
completedAt?: number;
|
|
182
184
|
admission?: import('./team-delivery.js').GoalAdmission;
|
package/lib/team.d.ts
CHANGED
|
@@ -62,12 +62,58 @@ export interface DashTeamGoalIntegration {
|
|
|
62
62
|
sha: string;
|
|
63
63
|
tip: string;
|
|
64
64
|
at: number;
|
|
65
|
+
/** Landed by its pull request's merge on GitHub (issues/closed/foodguard-313): its number — `sha` is the merge commit on origin's main. */
|
|
66
|
+
pr?: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A goal's ONE pull request as the team keeps it (issues/closed/foodguard-313), while `flow.json` `delivery.pullRequests`
|
|
70
|
+
* is "on": what LensMCP's last sync found and did, whether a sync is due, the last failure and until when it backs off,
|
|
71
|
+
* and the landing its manager asked — the board's chip and the drawer's line.
|
|
72
|
+
*/
|
|
73
|
+
export interface DashTeamGoalPr {
|
|
74
|
+
number?: number;
|
|
75
|
+
url?: string;
|
|
76
|
+
/** `open` (ready for review), `draft`, `merged`, `closed` (unmerged). None: no pull request yet. */
|
|
77
|
+
state?: 'open' | 'draft' | 'merged' | 'closed';
|
|
78
|
+
/** What it merges into: main, or the branch of the goal it stacks on. */
|
|
79
|
+
base?: string;
|
|
80
|
+
stackedOn?: {
|
|
81
|
+
goalId: string;
|
|
82
|
+
number: number;
|
|
83
|
+
};
|
|
84
|
+
/** The goal branch's commit last pushed as its head. */
|
|
85
|
+
tip?: string;
|
|
86
|
+
/** When LensMCP last brought it up to date, and last read its state on GitHub. */
|
|
87
|
+
syncedAt?: number;
|
|
88
|
+
checkedAt?: number;
|
|
89
|
+
/** A sync is due: since when, and why. */
|
|
90
|
+
due?: {
|
|
91
|
+
at: number;
|
|
92
|
+
why: string;
|
|
93
|
+
};
|
|
94
|
+
/** The last sync failed: what git or gh said, and when the next try is. */
|
|
95
|
+
error?: {
|
|
96
|
+
at: number;
|
|
97
|
+
text: string;
|
|
98
|
+
until: number;
|
|
99
|
+
};
|
|
100
|
+
/** Its manager asked to land the goal (agent_task_update merge): the pull request is marked ready, the person merges it. */
|
|
101
|
+
landing?: {
|
|
102
|
+
at: number;
|
|
103
|
+
by: string;
|
|
104
|
+
tip?: string;
|
|
105
|
+
};
|
|
106
|
+
mergedAt?: number;
|
|
107
|
+
/** The commit its merge made on origin's main. */
|
|
108
|
+
mergeCommit?: string;
|
|
65
109
|
}
|
|
66
110
|
export interface DashTeamTask {
|
|
67
111
|
delivery?: PackageDeliverySummary;
|
|
68
112
|
admission?: GoalAdmission;
|
|
69
113
|
timing?: TaskTiming;
|
|
70
114
|
id: string;
|
|
115
|
+
/** A goal's number (issues/closed/foodguard-314), shown `G-44` (goal-number.ts formatGoalNumber) — none on other tasks, and from an older server. */
|
|
116
|
+
number?: number;
|
|
71
117
|
title: string;
|
|
72
118
|
/** Whole on `/api/team/task`; its first lines on the board. */
|
|
73
119
|
description: string;
|
|
@@ -122,6 +168,8 @@ export interface DashTeamTask {
|
|
|
122
168
|
* to (`sha` — a squash or merge commit, or the branch tip for `ff`), the branch tip it took, when (the drawer).
|
|
123
169
|
*/
|
|
124
170
|
integration?: DashTeamGoalIntegration;
|
|
171
|
+
/** A goal's ONE pull request as the team keeps it (issues/closed/foodguard-313): on the board and in the drawer. */
|
|
172
|
+
pr?: DashTeamGoalPr;
|
|
125
173
|
/** Marked done by the person (issues/closed/overseer-70): the commit, why, who — its proof not run, never a QA pass. */
|
|
126
174
|
personDone?: DashTeamPersonDone;
|
|
127
175
|
/** Closed «not run — the person's decision» (issues/closed/overseer-78): who, why — never passed, never written. */
|
|
@@ -636,6 +684,8 @@ export interface DashTeamGoalChecks {
|
|
|
636
684
|
/** A task named in another's chain: its parent, its children, a blocker. */
|
|
637
685
|
export interface DashTeamTaskRef {
|
|
638
686
|
id: string;
|
|
687
|
+
/** A goal's number (foodguard-314), shown `G-44`. */
|
|
688
|
+
number?: number;
|
|
639
689
|
title: string;
|
|
640
690
|
kind?: DashTeamKind;
|
|
641
691
|
role?: string;
|
|
@@ -1975,6 +2025,18 @@ export interface DashTeamQuestion {
|
|
|
1975
2025
|
createdAt: number;
|
|
1976
2026
|
updatedAt: number;
|
|
1977
2027
|
}
|
|
2028
|
+
/**
|
|
2029
|
+
* What an answer did for its goal's manager (issues/closed/foodguard-309), beside `POST …/questions/<id>/answer`'s
|
|
2030
|
+
* question: a manager that suspended while the goal waited on the person, or one that ended, is resumed in its own
|
|
2031
|
+
* conversation — or a fresh one starts for a goal in recovery — whatever the overseer's «Managers a day». `text` follows
|
|
2032
|
+
* «Its manager»: «is being resumed — launch …», «is not resumed: launching agents is off …». None: its manager is live and
|
|
2033
|
+
* hears the answer, or the goal does not run.
|
|
2034
|
+
*/
|
|
2035
|
+
export interface DashTeamManagerWake {
|
|
2036
|
+
outcome: 'resumed' | 'started' | 'running' | 'refused' | 'none';
|
|
2037
|
+
text: string;
|
|
2038
|
+
launchId?: string;
|
|
2039
|
+
}
|
|
1978
2040
|
/** `GET /api/team/questions[?state=open|answered|all&all=1&limit=]` — newest first, scoped as the checkout's board. */
|
|
1979
2041
|
export interface DashTeamQuestionsAnswer {
|
|
1980
2042
|
questions: DashTeamQuestion[];
|
|
@@ -1990,6 +2052,8 @@ export interface DashTeamQuestionsAnswer {
|
|
|
1990
2052
|
/** A goal the dashboard's search found (`GET /api/team/search`): enough to name it and open it — on the board, or its design. */
|
|
1991
2053
|
export interface DashTeamSearchGoal {
|
|
1992
2054
|
id: string;
|
|
2055
|
+
/** Its number (foodguard-314), shown `G-44`: «G-44» finds it. */
|
|
2056
|
+
number?: number;
|
|
1993
2057
|
title: string;
|
|
1994
2058
|
state: DashTeamTaskState;
|
|
1995
2059
|
priority: number;
|
package/lib/team.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var o=Object.defineProperty;var r=(t,e)=>o(t,"name",{value:e,configurable:!0});var i=Object.defineProperty,n=r((t,e)=>i(t,"name",{value:e,configurable:!0}),"o");export const DASH_TEAM_KINDS=["goal","build","bug","review","test","qa","docs","marketing","research","chore"],DASH_TEAM_LINK_KINDS=["task","flow","error","suggestion","ai-call","review","page","route","commit","branch","worktree","file","finding","test"];export function modelClient(t){const e=t?.trim()??"";if(/\b(claude|opus|sonnet|haiku|fable)\b/i.test(e))return"claude";if(/^(gpt|o\d+|codex)\b/i.test(e))return"codex"}r(modelClient,"modelClient"),n(modelClient,"modelClient");export const DASH_TEAM_SEARCH_QUESTION_MAX=300;
|