@lensmcp/protocol-types 1.26.8 → 1.26.10
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/backlog.d.ts +83 -0
- package/lib/backlog.js +1 -0
- package/lib/dashboard-lint.d.ts +2 -0
- package/lib/dashboard-typecheck.d.ts +109 -0
- package/lib/dashboard-typecheck.js +1 -0
- package/lib/follow-ups.d.ts +4 -0
- package/lib/hosts.d.ts +2 -0
- package/lib/remote-instances.d.ts +6 -0
- package/lib/remote-instances.js +1 -1
- package/lib/sessions.d.ts +233 -0
- package/lib/sessions.js +1 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './lib/flood-guard.js';
|
|
|
15
15
|
export * from './lib/dashboard.js';
|
|
16
16
|
export * from './lib/dashboard-path.js';
|
|
17
17
|
export * from './lib/dashboard-lint.js';
|
|
18
|
+
export * from './lib/dashboard-typecheck.js';
|
|
18
19
|
export * from './lib/lint-coverage.js';
|
|
19
20
|
export * from './lib/static-checks.js';
|
|
20
21
|
export * from './lib/log-query.js';
|
|
@@ -49,6 +50,8 @@ export * from './lib/dashboard-updates.js';
|
|
|
49
50
|
export * from './lib/host-agents.js';
|
|
50
51
|
export * from './lib/remote-instances.js';
|
|
51
52
|
export * from './lib/team.js';
|
|
53
|
+
export * from './lib/sessions.js';
|
|
54
|
+
export * from './lib/backlog.js';
|
|
52
55
|
export * from './lib/team-review-changes.js';
|
|
53
56
|
export * from './lib/goal-outcome.js';
|
|
54
57
|
export * from './lib/role-fidelity.js';
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/dashboard-path.js";export*from"./lib/dashboard-lint.js";export*from"./lib/lint-coverage.js";export*from"./lib/static-checks.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/expected-failure.js";export*from"./lib/error-verdict.js";export*from"./lib/error-cause.js";export*from"./lib/metrics-reset.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";export*from"./lib/docker-jobs.js";export*from"./lib/docker-report.js";export*from"./lib/docker-runs.js";export*from"./lib/docker-errors.js";export*from"./lib/peers.js";export*from"./lib/hosts.js";export*from"./lib/cluster-hosts.js";export*from"./lib/dashboard-updates.js";export*from"./lib/host-agents.js";export*from"./lib/remote-instances.js";export*from"./lib/team.js";export*from"./lib/team-review-changes.js";export*from"./lib/goal-outcome.js";export*from"./lib/role-fidelity.js";export*from"./lib/goal-retro.js";export*from"./lib/follow-ups.js";export*from"./lib/changes.js";export*from"./lib/main-mirror.js";export*from"./lib/team-design.js";export*from"./lib/team-library.js";export*from"./lib/team-skills.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";export*from"./lib/goal-design.js";export*from"./lib/overseer-messages.js";export*from"./lib/team-roadmap.js";export*from"./lib/team-prompts.js";export{PROOF_ACTIONS,NOT_RUN_KINDS}from"./lib/team-delivery.js";
|
|
1
|
+
"use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/dashboard-path.js";export*from"./lib/dashboard-lint.js";export*from"./lib/dashboard-typecheck.js";export*from"./lib/lint-coverage.js";export*from"./lib/static-checks.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/expected-failure.js";export*from"./lib/error-verdict.js";export*from"./lib/error-cause.js";export*from"./lib/metrics-reset.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";export*from"./lib/docker-jobs.js";export*from"./lib/docker-report.js";export*from"./lib/docker-runs.js";export*from"./lib/docker-errors.js";export*from"./lib/peers.js";export*from"./lib/hosts.js";export*from"./lib/cluster-hosts.js";export*from"./lib/dashboard-updates.js";export*from"./lib/host-agents.js";export*from"./lib/remote-instances.js";export*from"./lib/team.js";export*from"./lib/sessions.js";export*from"./lib/backlog.js";export*from"./lib/team-review-changes.js";export*from"./lib/goal-outcome.js";export*from"./lib/role-fidelity.js";export*from"./lib/goal-retro.js";export*from"./lib/follow-ups.js";export*from"./lib/changes.js";export*from"./lib/main-mirror.js";export*from"./lib/team-design.js";export*from"./lib/team-library.js";export*from"./lib/team-skills.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";export*from"./lib/goal-design.js";export*from"./lib/overseer-messages.js";export*from"./lib/team-roadmap.js";export*from"./lib/team-prompts.js";export{PROOF_ACTIONS,NOT_RUN_KINDS}from"./lib/team-delivery.js";
|
package/lib/backlog.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export type BacklogKind = 'bug' | 'feature' | 'task';
|
|
2
|
+
export type BacklogState = 'open' | 'goal' | 'done' | 'dropped';
|
|
3
|
+
export type BacklogPriority = 'high' | 'medium' | 'low';
|
|
4
|
+
export type BacklogRefKind = 'file' | 'route' | 'flow' | 'error' | 'suggestion' | 'goal' | 'url';
|
|
5
|
+
export declare const BACKLOG_KINDS: readonly BacklogKind[];
|
|
6
|
+
export declare const BACKLOG_PRIORITIES: readonly BacklogPriority[];
|
|
7
|
+
export declare const BACKLOG_TITLE_MAX = 200;
|
|
8
|
+
export declare const BACKLOG_BODY_MAX = 8000;
|
|
9
|
+
export declare const BACKLOG_REFS_MAX = 20;
|
|
10
|
+
export interface BacklogRef {
|
|
11
|
+
kind: BacklogRefKind;
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
export interface BacklogAuthor {
|
|
15
|
+
who: 'person' | 'agent';
|
|
16
|
+
client?: 'claude' | 'codex';
|
|
17
|
+
/** The agent's session id or name, as it gave it. */
|
|
18
|
+
session?: string;
|
|
19
|
+
role?: string;
|
|
20
|
+
goalId?: string;
|
|
21
|
+
}
|
|
22
|
+
/** How the item went into a goal: a new goal of its own, combined with others, or a task under a running goal. */
|
|
23
|
+
export interface BacklogGoalLink {
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
how: 'new' | 'combined' | 'task';
|
|
27
|
+
taskId?: string;
|
|
28
|
+
at: number;
|
|
29
|
+
}
|
|
30
|
+
export interface DashBacklogItem {
|
|
31
|
+
/** `bl-` and 10 hex. */
|
|
32
|
+
id: string;
|
|
33
|
+
kind: BacklogKind;
|
|
34
|
+
title: string;
|
|
35
|
+
body?: string;
|
|
36
|
+
priority?: BacklogPriority;
|
|
37
|
+
refs?: BacklogRef[];
|
|
38
|
+
state: BacklogState;
|
|
39
|
+
by: BacklogAuthor;
|
|
40
|
+
createdAt: number;
|
|
41
|
+
updatedAt: number;
|
|
42
|
+
/** Times the same open title was added again: counted, never a second item. */
|
|
43
|
+
seen?: number;
|
|
44
|
+
goal?: BacklogGoalLink;
|
|
45
|
+
/** Why it was dropped or marked done. */
|
|
46
|
+
closedWhy?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface DashBacklogAnswer {
|
|
49
|
+
items: DashBacklogItem[];
|
|
50
|
+
counts: Record<BacklogState, number>;
|
|
51
|
+
/** Making goals needs the team on; adding and editing do not. */
|
|
52
|
+
teamOn: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface DashBacklogAddRequest {
|
|
55
|
+
kind: BacklogKind;
|
|
56
|
+
title: string;
|
|
57
|
+
body?: string;
|
|
58
|
+
priority?: BacklogPriority;
|
|
59
|
+
refs?: BacklogRef[];
|
|
60
|
+
requestId: string;
|
|
61
|
+
}
|
|
62
|
+
export interface DashBacklogUpdateRequest {
|
|
63
|
+
id: string;
|
|
64
|
+
kind?: BacklogKind;
|
|
65
|
+
title?: string;
|
|
66
|
+
body?: string;
|
|
67
|
+
priority?: BacklogPriority | null;
|
|
68
|
+
refs?: BacklogRef[];
|
|
69
|
+
/** The person's only: `dropped` or `done` closes it, `open` reopens it. */
|
|
70
|
+
state?: 'open' | 'done' | 'dropped';
|
|
71
|
+
why?: string;
|
|
72
|
+
}
|
|
73
|
+
/** One item → a new goal that waits in `design`. */
|
|
74
|
+
export interface DashBacklogGoalRequest {
|
|
75
|
+
id: string;
|
|
76
|
+
requestId: string;
|
|
77
|
+
}
|
|
78
|
+
/** One item → a task under a running goal. */
|
|
79
|
+
export interface DashBacklogTaskRequest {
|
|
80
|
+
id: string;
|
|
81
|
+
goalId: string;
|
|
82
|
+
requestId: string;
|
|
83
|
+
}
|
package/lib/backlog.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const BACKLOG_KINDS=["bug","feature","task"],BACKLOG_PRIORITIES=["high","medium","low"],BACKLOG_TITLE_MAX=200,BACKLOG_BODY_MAX=8e3,BACKLOG_REFS_MAX=20;
|
package/lib/dashboard-lint.d.ts
CHANGED
|
@@ -181,6 +181,8 @@ export interface DashLint {
|
|
|
181
181
|
errors: number;
|
|
182
182
|
warnings: number;
|
|
183
183
|
};
|
|
184
|
+
/** The files that hold a finding, both severities — absent from a lens before it said. */
|
|
185
|
+
files?: number;
|
|
184
186
|
/** The same under the filters. */
|
|
185
187
|
matched: {
|
|
186
188
|
errors: number;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { CheckAnswer, TypecheckFinding } from './static-checks.js';
|
|
2
|
+
/** Checks › Types: `GET /api/typecheck` (type errors grouped and filtered, the checkers, the projects) and `GET /api/typecheck/coverage` (the kept verdicts, no wait). */
|
|
3
|
+
export type DashTypecheckGroupBy = 'file' | 'code' | 'project';
|
|
4
|
+
export declare const DASH_TYPECHECK_GROUP_BY: readonly DashTypecheckGroupBy[];
|
|
5
|
+
export interface DashTypecheckQuery {
|
|
6
|
+
by: DashTypecheckGroupBy;
|
|
7
|
+
/** Only the errors of this project (the one owning the file, else the checker's). */
|
|
8
|
+
project?: string;
|
|
9
|
+
/** `TS2322`. */
|
|
10
|
+
code?: string;
|
|
11
|
+
/** Words in the code, message, file or project. */
|
|
12
|
+
q?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface DashTypecheckFinding {
|
|
15
|
+
/** The event that first reported it. */
|
|
16
|
+
id: string;
|
|
17
|
+
/** `TS2322`; `TS?` when the checker named none. */
|
|
18
|
+
code: string;
|
|
19
|
+
message: string;
|
|
20
|
+
/** Relative to the workspace when it is inside it. */
|
|
21
|
+
file?: string;
|
|
22
|
+
line?: number;
|
|
23
|
+
column?: number;
|
|
24
|
+
project: string;
|
|
25
|
+
/** The checkers (by project) that report it now. */
|
|
26
|
+
programs: string[];
|
|
27
|
+
/** Its newest report. */
|
|
28
|
+
at: number;
|
|
29
|
+
}
|
|
30
|
+
export interface DashTypecheckGroup {
|
|
31
|
+
/** The file, the code or the project. */
|
|
32
|
+
key: string;
|
|
33
|
+
count: number;
|
|
34
|
+
projects: string[];
|
|
35
|
+
projectCount: number;
|
|
36
|
+
files: number;
|
|
37
|
+
codes: number;
|
|
38
|
+
lastSeenAt: number;
|
|
39
|
+
findings: DashTypecheckFinding[];
|
|
40
|
+
more: number;
|
|
41
|
+
}
|
|
42
|
+
export type DashTypecheckRunState = 'running' | 'clean' | 'failing' | 'error';
|
|
43
|
+
/** One checker that reports into the lens (`<tool>:<project>`), as its last run left it. */
|
|
44
|
+
export interface DashTypecheckRun {
|
|
45
|
+
id: string;
|
|
46
|
+
tool: string;
|
|
47
|
+
project?: string;
|
|
48
|
+
state: DashTypecheckRunState;
|
|
49
|
+
/** Its newest report, and its first. */
|
|
50
|
+
at: number;
|
|
51
|
+
firstAt: number;
|
|
52
|
+
durationMs?: number;
|
|
53
|
+
errors: number;
|
|
54
|
+
warnings?: number;
|
|
55
|
+
/** Why it gave no verdict. */
|
|
56
|
+
error?: string;
|
|
57
|
+
}
|
|
58
|
+
/** A project of the workspace, the errors held in its files and the checkers of its own. */
|
|
59
|
+
export interface DashTypecheckProject {
|
|
60
|
+
name: string;
|
|
61
|
+
root: string;
|
|
62
|
+
service?: true;
|
|
63
|
+
errors: number;
|
|
64
|
+
/** The checkers that report under its name; none: its files are checked only through the programs that hold them. */
|
|
65
|
+
checkers: string[];
|
|
66
|
+
}
|
|
67
|
+
export interface DashTypecheckFacet {
|
|
68
|
+
name: string;
|
|
69
|
+
errors: number;
|
|
70
|
+
}
|
|
71
|
+
export interface DashTypecheck {
|
|
72
|
+
at: number;
|
|
73
|
+
/** False when this lens does not serve `typecheck://`. */
|
|
74
|
+
served: boolean;
|
|
75
|
+
status: 'unknown' | 'clean' | 'failing';
|
|
76
|
+
/** `none`: no checker has ever reported here — unchecked, not passing. */
|
|
77
|
+
producer: 'none' | 'connected';
|
|
78
|
+
detail?: string;
|
|
79
|
+
/** The newest report is older than the producers' staleness bound. */
|
|
80
|
+
stale?: boolean;
|
|
81
|
+
lastRunAt?: number;
|
|
82
|
+
totals: {
|
|
83
|
+
errors: number;
|
|
84
|
+
files: number;
|
|
85
|
+
projects: number;
|
|
86
|
+
};
|
|
87
|
+
/** The errors under the filters. */
|
|
88
|
+
matched: number;
|
|
89
|
+
query: DashTypecheckQuery;
|
|
90
|
+
groups: DashTypecheckGroup[];
|
|
91
|
+
moreGroups: number;
|
|
92
|
+
runs: DashTypecheckRun[];
|
|
93
|
+
projects: DashTypecheckProject[];
|
|
94
|
+
moreProjects: number;
|
|
95
|
+
facets: {
|
|
96
|
+
projects: DashTypecheckFacet[];
|
|
97
|
+
codes: DashTypecheckFacet[];
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/** The kept verdicts' answer for every program, one finding long — or why there is none (no tsgo, no program). */
|
|
101
|
+
export type DashTypecheckCoverage = {
|
|
102
|
+
at: number;
|
|
103
|
+
available: true;
|
|
104
|
+
answer: CheckAnswer<TypecheckFinding>;
|
|
105
|
+
} | {
|
|
106
|
+
at: number;
|
|
107
|
+
available: false;
|
|
108
|
+
why: string;
|
|
109
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const DASH_TYPECHECK_GROUP_BY=["file","code","project"];
|
package/lib/follow-ups.d.ts
CHANGED
|
@@ -110,6 +110,8 @@ export interface DashFollowUpProposal {
|
|
|
110
110
|
suggestions?: string[];
|
|
111
111
|
/** Open proposals it replaces (Reorganize all): made a goal, they read «combined». */
|
|
112
112
|
replaces?: string[];
|
|
113
|
+
/** The backlog items it covers (`bl-…`, Reorganize all): made a goal, they read `goal`. */
|
|
114
|
+
backlog?: string[];
|
|
113
115
|
/** The finished goals its items come from, by title. */
|
|
114
116
|
goals: Array<{
|
|
115
117
|
id: string;
|
|
@@ -223,6 +225,8 @@ export interface DashFollowUpEstimate {
|
|
|
223
225
|
items: number;
|
|
224
226
|
suggestions: number;
|
|
225
227
|
proposals: number;
|
|
228
|
+
/** Open backlog items it reads (Reorganize all). */
|
|
229
|
+
backlog?: number;
|
|
226
230
|
notRead?: string[];
|
|
227
231
|
model: string;
|
|
228
232
|
inputTokens: number;
|
package/lib/hosts.d.ts
CHANGED
|
@@ -42,6 +42,8 @@ export interface HostVersionView {
|
|
|
42
42
|
at: number;
|
|
43
43
|
/** The waiting-for-person state's: the organizer's version is in the worker's store already. */
|
|
44
44
|
stored?: boolean;
|
|
45
|
+
/** The version folder the worker's launchd agent pins (written by an older install-agent): `detail` says what to run. */
|
|
46
|
+
launchdPins?: string;
|
|
45
47
|
}
|
|
46
48
|
/** A link between two Macs, as one side last saw it. */
|
|
47
49
|
export interface HostLinkView {
|
|
@@ -34,6 +34,12 @@ export declare const MAX_REMOTE_INSTANCE_SEC: number;
|
|
|
34
34
|
export declare const REMOTE_LENS_LABEL = "lensmcp";
|
|
35
35
|
/** The lens dashboard's base path as the worker's gateway serves it: ONE path segment (`/<instance key>`). */
|
|
36
36
|
export declare const REMOTE_DASHBOARD_BASE_PATTERN: RegExp;
|
|
37
|
+
/**
|
|
38
|
+
* Set by the worker on every request a tunnel stream carries to its gateway (planning/sessions S8): its dashboard
|
|
39
|
+
* refuses such a request every Sessions write and every terminal read or write. Only the worker sets it; sent by
|
|
40
|
+
* anyone else it can only refuse.
|
|
41
|
+
*/
|
|
42
|
+
export declare const PEER_TUNNEL_HEADER = "x-lensmcp-peer-tunnel";
|
|
37
43
|
/** `lensmcp.<apex>`: the remote instance's lens, on an origin of its own. */
|
|
38
44
|
export declare function remoteLensHost(apex: string): string;
|
|
39
45
|
/** `POST /remote-instance`. */
|
package/lib/remote-instances.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _=Object.defineProperty;var t=(e,E)=>_(e,"name",{value:E,configurable:!0});var r=Object.defineProperty,n=t((e,E)=>r(e,"name",{value:E,configurable:!0}),"_"),o=Object.defineProperty,A=n((e,E)=>o(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()}`}t(remoteLensHost,"remoteLensHost"),n(remoteLensHost,"remoteLensHost"),A(remoteLensHost,"remoteLensHost");export const REMOTE_INSTANCES_FILE="instances.json";
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import type { HostUsage } from './host-agents.js';
|
|
2
|
+
import type { DashTeamAgentDetail, DashTeamAgentLine, DashTeamAgentMcp, DashTeamAgentModel, DashTeamAgentUsage, DashTeamHostMark, DashTeamLaunchKit, DashTeamUsageLimit } from './team.js';
|
|
3
|
+
export type DashClientSessionKind = 'person' | 'team' | 'outside';
|
|
4
|
+
export type DashClientSessionClient = 'claude' | 'codex';
|
|
5
|
+
export type DashClientSessionState = 'starting' | 'working' | 'your-turn' | 'asking' | 'quiet' | 'ended' | 'lost';
|
|
6
|
+
export type DashTerminalsState = 'off' | 'not-installed' | 'unusable' | 'on';
|
|
7
|
+
export interface DashClientSessionCheckout {
|
|
8
|
+
key: string;
|
|
9
|
+
root: string;
|
|
10
|
+
branch?: string;
|
|
11
|
+
main: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface DashClientSession {
|
|
14
|
+
/** `se-…` (person), the launch id (team), `ext-<12 hex>` (outside). */
|
|
15
|
+
id: string;
|
|
16
|
+
kind: DashClientSessionKind;
|
|
17
|
+
client: DashClientSessionClient;
|
|
18
|
+
name?: string;
|
|
19
|
+
/** Absent: the client's own sign-in. */
|
|
20
|
+
account?: string;
|
|
21
|
+
accountLabel?: string;
|
|
22
|
+
checkout: DashClientSessionCheckout;
|
|
23
|
+
role?: string;
|
|
24
|
+
goalId?: string;
|
|
25
|
+
taskId?: string;
|
|
26
|
+
state: DashClientSessionState;
|
|
27
|
+
stateAt: number;
|
|
28
|
+
asking?: 'permission' | 'question' | 'auth' | 'trust';
|
|
29
|
+
/** Absent: nothing to attach to. */
|
|
30
|
+
terminal?: string;
|
|
31
|
+
threadId?: string;
|
|
32
|
+
startedAt: number;
|
|
33
|
+
endedAt?: number;
|
|
34
|
+
exitCode?: number;
|
|
35
|
+
endedWhy?: 'stopped' | 'exited' | 'restarted';
|
|
36
|
+
lastActivityAt?: number;
|
|
37
|
+
rssMb?: number;
|
|
38
|
+
context?: {
|
|
39
|
+
used: number;
|
|
40
|
+
window: number;
|
|
41
|
+
compactions: number;
|
|
42
|
+
};
|
|
43
|
+
resumedFrom?: string;
|
|
44
|
+
on?: DashTeamHostMark;
|
|
45
|
+
}
|
|
46
|
+
export interface DashClientSessionsAnswer {
|
|
47
|
+
terminals: DashTerminalsState;
|
|
48
|
+
why?: string;
|
|
49
|
+
/** Starting and typing are allowed only on a loopback-bound dashboard. */
|
|
50
|
+
writable: boolean;
|
|
51
|
+
checkouts: DashClientSessionCheckout[];
|
|
52
|
+
/** The key of the checkout this dashboard serves. */
|
|
53
|
+
here?: string;
|
|
54
|
+
sessions: DashClientSession[];
|
|
55
|
+
}
|
|
56
|
+
export interface DashClientSessionStartRequest {
|
|
57
|
+
client: DashClientSessionClient;
|
|
58
|
+
/** null: the client's own sign-in. */
|
|
59
|
+
account: string | null;
|
|
60
|
+
checkout: string;
|
|
61
|
+
role?: string;
|
|
62
|
+
goalId?: string;
|
|
63
|
+
taskId?: string;
|
|
64
|
+
prompt?: string;
|
|
65
|
+
name?: string;
|
|
66
|
+
model?: string;
|
|
67
|
+
effort?: string;
|
|
68
|
+
requestId: string;
|
|
69
|
+
}
|
|
70
|
+
export interface DashClientSessionStopRequest {
|
|
71
|
+
id: string;
|
|
72
|
+
force?: boolean;
|
|
73
|
+
}
|
|
74
|
+
/** `POST /api/sessions/resume` → `{ session }`: the ended session's conversation goes on in a new session. */
|
|
75
|
+
export interface DashClientSessionResumeRequest {
|
|
76
|
+
id: string;
|
|
77
|
+
/** The checkout it goes on in: its own when absent. */
|
|
78
|
+
checkout?: string;
|
|
79
|
+
}
|
|
80
|
+
/** `POST /api/sessions/move` → `{ session }`: a session started outside LensMCP whose process ended, its conversation going on in a session here (S6). */
|
|
81
|
+
export interface DashClientSessionMoveRequest {
|
|
82
|
+
/** Its `ext-…` id. */
|
|
83
|
+
id: string;
|
|
84
|
+
}
|
|
85
|
+
/** `POST /api/sessions/rename` → `{ session }`: an empty name gives it back its default one. */
|
|
86
|
+
export interface DashClientSessionRenameRequest {
|
|
87
|
+
id: string;
|
|
88
|
+
name: string;
|
|
89
|
+
}
|
|
90
|
+
/** `POST /api/sessions/worktree` → `{ checkout }`: a new on-demand worktree of the repository, for a session to start in. */
|
|
91
|
+
export interface DashClientSessionWorktreeRequest {
|
|
92
|
+
name: string;
|
|
93
|
+
}
|
|
94
|
+
/** Where a session's conversation is kept (S3): linked, and how — or not, why, and where LensMCP looked. */
|
|
95
|
+
export interface DashClientSessionTranscript {
|
|
96
|
+
linked: boolean;
|
|
97
|
+
file?: string;
|
|
98
|
+
/** `thread`: Claude Code's id chosen at start, or the thread on record; `hooks`: its hooks named it; `checkout`: the one Codex rollout of its checkout begun after it. */
|
|
99
|
+
how?: 'thread' | 'hooks' | 'checkout';
|
|
100
|
+
bytes?: number;
|
|
101
|
+
why?: string;
|
|
102
|
+
looked?: string[];
|
|
103
|
+
}
|
|
104
|
+
/** A session's context (S4): its newest request's input against its window, each request's, and each compaction. */
|
|
105
|
+
export interface DashClientSessionContext {
|
|
106
|
+
used: number;
|
|
107
|
+
/** The model's window: the client's own word (Codex `model_context_window`, Claude Code's status line), the model's name, or Claude Code's default. */
|
|
108
|
+
window: number;
|
|
109
|
+
windowFrom: 'client' | 'model' | 'default';
|
|
110
|
+
/** Claude Code compacts here, below its window: `CLAUDE_CODE_AUTO_COMPACT_WINDOW` in the session's environment. */
|
|
111
|
+
compactAt?: number;
|
|
112
|
+
compactions: number;
|
|
113
|
+
/** Its newest requests' context, oldest first (at most 200). */
|
|
114
|
+
turns: Array<{
|
|
115
|
+
at?: number;
|
|
116
|
+
used: number;
|
|
117
|
+
}>;
|
|
118
|
+
marks: Array<{
|
|
119
|
+
at?: number;
|
|
120
|
+
tokens?: number;
|
|
121
|
+
trigger?: string;
|
|
122
|
+
}>;
|
|
123
|
+
}
|
|
124
|
+
/** A subagent of the session, as its parent's transcript and its own name it; `live`: running now. */
|
|
125
|
+
export type DashClientSessionSubagent = DashTeamAgentDetail['spawned'][number] & {
|
|
126
|
+
live: boolean;
|
|
127
|
+
lastAt?: number;
|
|
128
|
+
};
|
|
129
|
+
/** The skills the client listed to the model, the role's kit it was given, and those it used. */
|
|
130
|
+
export interface DashClientSessionSkills {
|
|
131
|
+
/** Claude Code's `skill_listing`, Codex's skills block — absent: none in what was read. */
|
|
132
|
+
offered?: string[];
|
|
133
|
+
kit?: DashTeamLaunchKit;
|
|
134
|
+
used: Array<{
|
|
135
|
+
name: string;
|
|
136
|
+
uses: number;
|
|
137
|
+
}>;
|
|
138
|
+
}
|
|
139
|
+
/** A file the session's own calls edited: Edit, Write, MultiEdit, NotebookEdit; Codex `apply_patch`. */
|
|
140
|
+
export interface DashClientSessionEditedFile {
|
|
141
|
+
/** Relative to its checkout; absolute when outside it (`outside`). */
|
|
142
|
+
path: string;
|
|
143
|
+
outside?: boolean;
|
|
144
|
+
edits: number;
|
|
145
|
+
tool: string;
|
|
146
|
+
at?: number;
|
|
147
|
+
}
|
|
148
|
+
/** Its role, goal and task: what it was started with, and the coordination seat its hooks made. */
|
|
149
|
+
export interface DashClientSessionTeam {
|
|
150
|
+
sessionId?: string;
|
|
151
|
+
role?: string;
|
|
152
|
+
roleTitle?: string;
|
|
153
|
+
goal?: {
|
|
154
|
+
id: string;
|
|
155
|
+
title: string;
|
|
156
|
+
state: string;
|
|
157
|
+
};
|
|
158
|
+
task?: {
|
|
159
|
+
id: string;
|
|
160
|
+
title: string;
|
|
161
|
+
state: string;
|
|
162
|
+
};
|
|
163
|
+
holds: Array<{
|
|
164
|
+
id: string;
|
|
165
|
+
title: string;
|
|
166
|
+
kind?: string;
|
|
167
|
+
}>;
|
|
168
|
+
unread?: number;
|
|
169
|
+
}
|
|
170
|
+
/** What Claude Code's status line last handed this session. */
|
|
171
|
+
export interface DashClientSessionStatus {
|
|
172
|
+
at: number;
|
|
173
|
+
costUsd?: number;
|
|
174
|
+
durationMs?: number;
|
|
175
|
+
apiDurationMs?: number;
|
|
176
|
+
linesAdded?: number;
|
|
177
|
+
linesRemoved?: number;
|
|
178
|
+
contextWindow?: number;
|
|
179
|
+
contextUsed?: number;
|
|
180
|
+
}
|
|
181
|
+
/** `GET /api/sessions/one?id=` — a session and what is read of it. Every field past `session` is optional. */
|
|
182
|
+
export interface DashClientSessionDetail {
|
|
183
|
+
session: DashClientSession;
|
|
184
|
+
transcript?: DashClientSessionTranscript;
|
|
185
|
+
model?: string;
|
|
186
|
+
effort?: string;
|
|
187
|
+
models?: DashTeamAgentModel[];
|
|
188
|
+
lastAt?: number;
|
|
189
|
+
/** Its transcript's newest lines, as the agent drawer's tail reads them. */
|
|
190
|
+
tail?: DashTeamAgentLine[];
|
|
191
|
+
/** A team launch's readable lines: the newest of its output, or what its worker Mac reported (S6, S8). */
|
|
192
|
+
lines?: string[];
|
|
193
|
+
/** Too long to read whole: what is counted is from this byte on. */
|
|
194
|
+
readFrom?: number;
|
|
195
|
+
context?: DashClientSessionContext;
|
|
196
|
+
subagents?: DashClientSessionSubagent[];
|
|
197
|
+
skills?: DashClientSessionSkills;
|
|
198
|
+
mcp?: DashTeamAgentMcp[];
|
|
199
|
+
team?: DashClientSessionTeam;
|
|
200
|
+
editedFiles?: DashClientSessionEditedFile[];
|
|
201
|
+
usage?: DashTeamAgentUsage;
|
|
202
|
+
status?: DashClientSessionStatus;
|
|
203
|
+
/** Its account's (or sign-in's) windows, as last kept. */
|
|
204
|
+
accountUsage?: HostUsage;
|
|
205
|
+
/** Codex: how far this session's rollout saw each usage limit move. */
|
|
206
|
+
limits?: DashTeamUsageLimit[];
|
|
207
|
+
}
|
|
208
|
+
export type DashClientSessionLineKind = 'user' | 'reply' | 'tool' | 'result' | 'thinking' | 'compaction';
|
|
209
|
+
/** One line of a session's conversation, from the client's own transcript. */
|
|
210
|
+
export interface DashClientSessionLine {
|
|
211
|
+
/** The byte its transcript line starts at: the lines one transcript line gives share it. */
|
|
212
|
+
offset: number;
|
|
213
|
+
at?: number;
|
|
214
|
+
kind: DashClientSessionLineKind;
|
|
215
|
+
/** The words, cut to a head — a tool call's input, a result's output, a compaction's summary. */
|
|
216
|
+
text: string;
|
|
217
|
+
tool?: string;
|
|
218
|
+
/** A tool call's id, which its result names. */
|
|
219
|
+
callId?: string;
|
|
220
|
+
/** A result: the call failed. */
|
|
221
|
+
error?: boolean;
|
|
222
|
+
/** A compaction: `auto` or `manual`, and the context it began at. */
|
|
223
|
+
trigger?: string;
|
|
224
|
+
tokens?: number;
|
|
225
|
+
}
|
|
226
|
+
/** `GET /api/sessions/conversation?id=&before=<byte>&after=<byte>` — the lines of the bytes [from, to); `more`: older bytes exist. */
|
|
227
|
+
export interface DashClientSessionConversation {
|
|
228
|
+
lines: DashClientSessionLine[];
|
|
229
|
+
from: number;
|
|
230
|
+
to: number;
|
|
231
|
+
more: boolean;
|
|
232
|
+
transcript?: DashClientSessionTranscript;
|
|
233
|
+
}
|
package/lib/sessions.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export{};
|