@lensmcp/protocol-types 1.0.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/LICENSE +202 -0
- package/README.md +128 -0
- package/index.d.ts +10 -0
- package/index.d.ts.map +1 -0
- package/index.js +9 -0
- package/lib/attributes.d.ts +312 -0
- package/lib/attributes.d.ts.map +1 -0
- package/lib/attributes.js +203 -0
- package/lib/context.d.ts +66 -0
- package/lib/context.d.ts.map +1 -0
- package/lib/context.js +41 -0
- package/lib/edge.d.ts +42 -0
- package/lib/edge.d.ts.map +1 -0
- package/lib/edge.js +25 -0
- package/lib/event.d.ts +160 -0
- package/lib/event.d.ts.map +1 -0
- package/lib/event.js +67 -0
- package/lib/node.d.ts +204 -0
- package/lib/node.d.ts.map +1 -0
- package/lib/node.js +98 -0
- package/lib/resources.d.ts +205 -0
- package/lib/resources.d.ts.map +1 -0
- package/lib/resources.js +94 -0
- package/lib/schema-version.d.ts +3 -0
- package/lib/schema-version.d.ts.map +1 -0
- package/lib/schema-version.js +1 -0
- package/lib/source-location.d.ts +11 -0
- package/lib/source-location.d.ts.map +1 -0
- package/lib/source-location.js +9 -0
- package/lib/tokens.d.ts +14 -0
- package/lib/tokens.d.ts.map +1 -0
- package/lib/tokens.js +12 -0
- package/package.json +45 -0
package/lib/node.d.ts
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TraceNodeTypeSchema: z.ZodEnum<{
|
|
3
|
+
effect: "effect";
|
|
4
|
+
timer: "timer";
|
|
5
|
+
"hmr-update": "hmr-update";
|
|
6
|
+
route: "route";
|
|
7
|
+
render: "render";
|
|
8
|
+
promise: "promise";
|
|
9
|
+
session: "session";
|
|
10
|
+
"browser-context": "browser-context";
|
|
11
|
+
tab: "tab";
|
|
12
|
+
renderer: "renderer";
|
|
13
|
+
router: "router";
|
|
14
|
+
page: "page";
|
|
15
|
+
component: "component";
|
|
16
|
+
element: "element";
|
|
17
|
+
slot: "slot";
|
|
18
|
+
"react-mount": "react-mount";
|
|
19
|
+
"react-unmount": "react-unmount";
|
|
20
|
+
hook: "hook";
|
|
21
|
+
"effect-run": "effect-run";
|
|
22
|
+
memo: "memo";
|
|
23
|
+
"memo-compute": "memo-compute";
|
|
24
|
+
"ui-event": "ui-event";
|
|
25
|
+
handler: "handler";
|
|
26
|
+
animation: "animation";
|
|
27
|
+
"animation-frame": "animation-frame";
|
|
28
|
+
transition: "transition";
|
|
29
|
+
"api-client-call": "api-client-call";
|
|
30
|
+
"http-request": "http-request";
|
|
31
|
+
"http-response": "http-response";
|
|
32
|
+
"server-process": "server-process";
|
|
33
|
+
"nest-app": "nest-app";
|
|
34
|
+
"nest-module": "nest-module";
|
|
35
|
+
"nest-provider": "nest-provider";
|
|
36
|
+
"singleton-instance": "singleton-instance";
|
|
37
|
+
"server-request": "server-request";
|
|
38
|
+
guard: "guard";
|
|
39
|
+
controller: "controller";
|
|
40
|
+
"service-method": "service-method";
|
|
41
|
+
loop: "loop";
|
|
42
|
+
"loop-iteration": "loop-iteration";
|
|
43
|
+
"queue-job": "queue-job";
|
|
44
|
+
"db-query": "db-query";
|
|
45
|
+
"redis-op": "redis-op";
|
|
46
|
+
"promise-continuation": "promise-continuation";
|
|
47
|
+
"state-store": "state-store";
|
|
48
|
+
"state-update": "state-update";
|
|
49
|
+
selector: "selector";
|
|
50
|
+
"selector-update": "selector-update";
|
|
51
|
+
"visual-frame": "visual-frame";
|
|
52
|
+
"visual-violation": "visual-violation";
|
|
53
|
+
"style-change": "style-change";
|
|
54
|
+
"layout-change": "layout-change";
|
|
55
|
+
"memory-owner": "memory-owner";
|
|
56
|
+
"memory-mutation": "memory-mutation";
|
|
57
|
+
"memory-retention": "memory-retention";
|
|
58
|
+
"heap-snapshot": "heap-snapshot";
|
|
59
|
+
"build-event": "build-event";
|
|
60
|
+
"lint-event": "lint-event";
|
|
61
|
+
"typecheck-event": "typecheck-event";
|
|
62
|
+
"test-event": "test-event";
|
|
63
|
+
"bundle-report": "bundle-report";
|
|
64
|
+
}>;
|
|
65
|
+
export type TraceNodeType = z.infer<typeof TraceNodeTypeSchema>;
|
|
66
|
+
export declare const LifecycleSchema: z.ZodEnum<{
|
|
67
|
+
created: "created";
|
|
68
|
+
active: "active";
|
|
69
|
+
completed: "completed";
|
|
70
|
+
disposed: "disposed";
|
|
71
|
+
errored: "errored";
|
|
72
|
+
}>;
|
|
73
|
+
export type Lifecycle = z.infer<typeof LifecycleSchema>;
|
|
74
|
+
export declare const TraceNodeSchema: z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
parentTraceNodeId: z.ZodOptional<z.ZodString>;
|
|
77
|
+
type: z.ZodEnum<{
|
|
78
|
+
effect: "effect";
|
|
79
|
+
timer: "timer";
|
|
80
|
+
"hmr-update": "hmr-update";
|
|
81
|
+
route: "route";
|
|
82
|
+
render: "render";
|
|
83
|
+
promise: "promise";
|
|
84
|
+
session: "session";
|
|
85
|
+
"browser-context": "browser-context";
|
|
86
|
+
tab: "tab";
|
|
87
|
+
renderer: "renderer";
|
|
88
|
+
router: "router";
|
|
89
|
+
page: "page";
|
|
90
|
+
component: "component";
|
|
91
|
+
element: "element";
|
|
92
|
+
slot: "slot";
|
|
93
|
+
"react-mount": "react-mount";
|
|
94
|
+
"react-unmount": "react-unmount";
|
|
95
|
+
hook: "hook";
|
|
96
|
+
"effect-run": "effect-run";
|
|
97
|
+
memo: "memo";
|
|
98
|
+
"memo-compute": "memo-compute";
|
|
99
|
+
"ui-event": "ui-event";
|
|
100
|
+
handler: "handler";
|
|
101
|
+
animation: "animation";
|
|
102
|
+
"animation-frame": "animation-frame";
|
|
103
|
+
transition: "transition";
|
|
104
|
+
"api-client-call": "api-client-call";
|
|
105
|
+
"http-request": "http-request";
|
|
106
|
+
"http-response": "http-response";
|
|
107
|
+
"server-process": "server-process";
|
|
108
|
+
"nest-app": "nest-app";
|
|
109
|
+
"nest-module": "nest-module";
|
|
110
|
+
"nest-provider": "nest-provider";
|
|
111
|
+
"singleton-instance": "singleton-instance";
|
|
112
|
+
"server-request": "server-request";
|
|
113
|
+
guard: "guard";
|
|
114
|
+
controller: "controller";
|
|
115
|
+
"service-method": "service-method";
|
|
116
|
+
loop: "loop";
|
|
117
|
+
"loop-iteration": "loop-iteration";
|
|
118
|
+
"queue-job": "queue-job";
|
|
119
|
+
"db-query": "db-query";
|
|
120
|
+
"redis-op": "redis-op";
|
|
121
|
+
"promise-continuation": "promise-continuation";
|
|
122
|
+
"state-store": "state-store";
|
|
123
|
+
"state-update": "state-update";
|
|
124
|
+
selector: "selector";
|
|
125
|
+
"selector-update": "selector-update";
|
|
126
|
+
"visual-frame": "visual-frame";
|
|
127
|
+
"visual-violation": "visual-violation";
|
|
128
|
+
"style-change": "style-change";
|
|
129
|
+
"layout-change": "layout-change";
|
|
130
|
+
"memory-owner": "memory-owner";
|
|
131
|
+
"memory-mutation": "memory-mutation";
|
|
132
|
+
"memory-retention": "memory-retention";
|
|
133
|
+
"heap-snapshot": "heap-snapshot";
|
|
134
|
+
"build-event": "build-event";
|
|
135
|
+
"lint-event": "lint-event";
|
|
136
|
+
"typecheck-event": "typecheck-event";
|
|
137
|
+
"test-event": "test-event";
|
|
138
|
+
"bundle-report": "bundle-report";
|
|
139
|
+
}>;
|
|
140
|
+
logicalId: z.ZodOptional<z.ZodString>;
|
|
141
|
+
instanceId: z.ZodOptional<z.ZodString>;
|
|
142
|
+
generation: z.ZodOptional<z.ZodNumber>;
|
|
143
|
+
lifecycle: z.ZodEnum<{
|
|
144
|
+
created: "created";
|
|
145
|
+
active: "active";
|
|
146
|
+
completed: "completed";
|
|
147
|
+
disposed: "disposed";
|
|
148
|
+
errored: "errored";
|
|
149
|
+
}>;
|
|
150
|
+
context: z.ZodObject<{
|
|
151
|
+
sessionId: z.ZodString;
|
|
152
|
+
browserContextId: z.ZodOptional<z.ZodString>;
|
|
153
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
154
|
+
frameId: z.ZodOptional<z.ZodString>;
|
|
155
|
+
route: z.ZodOptional<z.ZodString>;
|
|
156
|
+
url: z.ZodOptional<z.ZodString>;
|
|
157
|
+
flowId: z.ZodOptional<z.ZodString>;
|
|
158
|
+
originType: z.ZodOptional<z.ZodEnum<{
|
|
159
|
+
"user-click": "user-click";
|
|
160
|
+
"user-input": "user-input";
|
|
161
|
+
keyboard: "keyboard";
|
|
162
|
+
"route-load": "route-load";
|
|
163
|
+
effect: "effect";
|
|
164
|
+
"memo-recompute": "memo-recompute";
|
|
165
|
+
timer: "timer";
|
|
166
|
+
raf: "raf";
|
|
167
|
+
"idle-callback": "idle-callback";
|
|
168
|
+
"websocket-message": "websocket-message";
|
|
169
|
+
"broadcast-channel": "broadcast-channel";
|
|
170
|
+
"post-message": "post-message";
|
|
171
|
+
"storage-event": "storage-event";
|
|
172
|
+
"service-worker-message": "service-worker-message";
|
|
173
|
+
"media-query-change": "media-query-change";
|
|
174
|
+
"visibility-change": "visibility-change";
|
|
175
|
+
resize: "resize";
|
|
176
|
+
"intersection-observer": "intersection-observer";
|
|
177
|
+
"mutation-observer": "mutation-observer";
|
|
178
|
+
"backend-response": "backend-response";
|
|
179
|
+
"hmr-update": "hmr-update";
|
|
180
|
+
}>>;
|
|
181
|
+
originNodeId: z.ZodOptional<z.ZodString>;
|
|
182
|
+
causedByNodeId: z.ZodOptional<z.ZodString>;
|
|
183
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
184
|
+
traceparent: z.ZodOptional<z.ZodString>;
|
|
185
|
+
userActionId: z.ZodOptional<z.ZodString>;
|
|
186
|
+
userIdHash: z.ZodOptional<z.ZodString>;
|
|
187
|
+
tenantIdHash: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
name: z.ZodString;
|
|
190
|
+
startTime: z.ZodNumber;
|
|
191
|
+
endTime: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
file: z.ZodString;
|
|
195
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
198
|
+
componentName: z.ZodOptional<z.ZodString>;
|
|
199
|
+
hookName: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, z.core.$strip>>;
|
|
201
|
+
attributes: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
export type TraceNode = z.infer<typeof TraceNodeSchema>;
|
|
204
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/lib/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuE9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,eAAe;;;;;;EAM1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmB1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
package/lib/node.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SourceLocationSchema } from './source-location.js';
|
|
3
|
+
import { TraceContextSchema } from './context.js';
|
|
4
|
+
export const TraceNodeTypeSchema = z.enum([
|
|
5
|
+
// Browser process tree
|
|
6
|
+
'session',
|
|
7
|
+
'browser-context',
|
|
8
|
+
'tab',
|
|
9
|
+
'renderer',
|
|
10
|
+
'router',
|
|
11
|
+
'route',
|
|
12
|
+
'page',
|
|
13
|
+
// React UI
|
|
14
|
+
'component',
|
|
15
|
+
'element',
|
|
16
|
+
'slot',
|
|
17
|
+
'render',
|
|
18
|
+
'react-mount',
|
|
19
|
+
'react-unmount',
|
|
20
|
+
'hook',
|
|
21
|
+
'effect',
|
|
22
|
+
'effect-run',
|
|
23
|
+
'memo',
|
|
24
|
+
'memo-compute',
|
|
25
|
+
// User interaction
|
|
26
|
+
'ui-event',
|
|
27
|
+
'handler',
|
|
28
|
+
'animation',
|
|
29
|
+
'animation-frame',
|
|
30
|
+
'transition',
|
|
31
|
+
'timer',
|
|
32
|
+
// Network / API
|
|
33
|
+
'api-client-call',
|
|
34
|
+
'http-request',
|
|
35
|
+
'http-response',
|
|
36
|
+
// Backend
|
|
37
|
+
'server-process',
|
|
38
|
+
'nest-app',
|
|
39
|
+
'nest-module',
|
|
40
|
+
'nest-provider',
|
|
41
|
+
'singleton-instance',
|
|
42
|
+
'server-request',
|
|
43
|
+
'guard',
|
|
44
|
+
'controller',
|
|
45
|
+
'service-method',
|
|
46
|
+
'loop',
|
|
47
|
+
'loop-iteration',
|
|
48
|
+
'queue-job',
|
|
49
|
+
'db-query',
|
|
50
|
+
'redis-op',
|
|
51
|
+
'promise',
|
|
52
|
+
'promise-continuation',
|
|
53
|
+
// State
|
|
54
|
+
'state-store',
|
|
55
|
+
'state-update',
|
|
56
|
+
'selector',
|
|
57
|
+
'selector-update',
|
|
58
|
+
// Visual
|
|
59
|
+
'visual-frame',
|
|
60
|
+
'visual-violation',
|
|
61
|
+
'style-change',
|
|
62
|
+
'layout-change',
|
|
63
|
+
// Memory
|
|
64
|
+
'memory-owner',
|
|
65
|
+
'memory-mutation',
|
|
66
|
+
'memory-retention',
|
|
67
|
+
'heap-snapshot',
|
|
68
|
+
// Build / dev
|
|
69
|
+
'build-event',
|
|
70
|
+
'lint-event',
|
|
71
|
+
'typecheck-event',
|
|
72
|
+
'test-event',
|
|
73
|
+
'bundle-report',
|
|
74
|
+
'hmr-update',
|
|
75
|
+
]);
|
|
76
|
+
export const LifecycleSchema = z.enum([
|
|
77
|
+
'created',
|
|
78
|
+
'active',
|
|
79
|
+
'completed',
|
|
80
|
+
'disposed',
|
|
81
|
+
'errored',
|
|
82
|
+
]);
|
|
83
|
+
export const TraceNodeSchema = z.object({
|
|
84
|
+
id: z.string(),
|
|
85
|
+
parentTraceNodeId: z.string().optional(),
|
|
86
|
+
type: TraceNodeTypeSchema,
|
|
87
|
+
logicalId: z.string().optional(),
|
|
88
|
+
instanceId: z.string().optional(),
|
|
89
|
+
generation: z.number().int().nonnegative().optional(),
|
|
90
|
+
lifecycle: LifecycleSchema,
|
|
91
|
+
context: TraceContextSchema,
|
|
92
|
+
name: z.string(),
|
|
93
|
+
startTime: z.number().int().nonnegative(),
|
|
94
|
+
endTime: z.number().int().nonnegative().optional(),
|
|
95
|
+
durationMs: z.number().nonnegative().optional(),
|
|
96
|
+
location: SourceLocationSchema.optional(),
|
|
97
|
+
attributes: z.record(z.string(), z.unknown()),
|
|
98
|
+
});
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Well-known URI schemes used by LensMCP. See `planning/03-mcp-surface.md`.
|
|
4
|
+
* Each scheme maps 1:1 to a FrontMCP @App package.
|
|
5
|
+
*/
|
|
6
|
+
export declare const URI_SCHEMES: readonly ["agent", "events", "build", "lint", "typecheck", "test", "runtime", "render", "visual", "flow", "story", "trace", "graph", "bundle", "security", "perf", "deps", "memory", "browser", "react", "valtio", "nest", "next", "process"];
|
|
7
|
+
export type UriScheme = (typeof URI_SCHEMES)[number];
|
|
8
|
+
export declare const ResourceEnvelopeSchema: z.ZodObject<{
|
|
9
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
10
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
11
|
+
revision: z.ZodNumber;
|
|
12
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type ResourceEnvelope = z.infer<typeof ResourceEnvelopeSchema>;
|
|
15
|
+
export declare const AgentStatusKindSchema: z.ZodEnum<{
|
|
16
|
+
warning: "warning";
|
|
17
|
+
starting: "starting";
|
|
18
|
+
clean: "clean";
|
|
19
|
+
failing: "failing";
|
|
20
|
+
}>;
|
|
21
|
+
export type AgentStatusKind = z.infer<typeof AgentStatusKindSchema>;
|
|
22
|
+
export declare const AgentBlockingItemSchema: z.ZodObject<{
|
|
23
|
+
source: z.ZodString;
|
|
24
|
+
severity: z.ZodEnum<{
|
|
25
|
+
error: "error";
|
|
26
|
+
debug: "debug";
|
|
27
|
+
info: "info";
|
|
28
|
+
warning: "warning";
|
|
29
|
+
fatal: "fatal";
|
|
30
|
+
}>;
|
|
31
|
+
title: z.ZodString;
|
|
32
|
+
fingerprint: z.ZodString;
|
|
33
|
+
resource: z.ZodString;
|
|
34
|
+
pageId: z.ZodOptional<z.ZodString>;
|
|
35
|
+
flowId: z.ZodOptional<z.ZodString>;
|
|
36
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
file: z.ZodString;
|
|
38
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
41
|
+
componentName: z.ZodOptional<z.ZodString>;
|
|
42
|
+
hookName: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type AgentBlockingItem = z.infer<typeof AgentBlockingItemSchema>;
|
|
46
|
+
export declare const AgentChecksSchema: z.ZodObject<{
|
|
47
|
+
typecheck: z.ZodOptional<z.ZodEnum<{
|
|
48
|
+
unknown: "unknown";
|
|
49
|
+
passed: "passed";
|
|
50
|
+
failed: "failed";
|
|
51
|
+
}>>;
|
|
52
|
+
lint: z.ZodOptional<z.ZodEnum<{
|
|
53
|
+
unknown: "unknown";
|
|
54
|
+
passed: "passed";
|
|
55
|
+
failed: "failed";
|
|
56
|
+
}>>;
|
|
57
|
+
build: z.ZodOptional<z.ZodEnum<{
|
|
58
|
+
unknown: "unknown";
|
|
59
|
+
passed: "passed";
|
|
60
|
+
failed: "failed";
|
|
61
|
+
}>>;
|
|
62
|
+
runtime: z.ZodOptional<z.ZodEnum<{
|
|
63
|
+
warning: "warning";
|
|
64
|
+
unknown: "unknown";
|
|
65
|
+
passed: "passed";
|
|
66
|
+
failed: "failed";
|
|
67
|
+
}>>;
|
|
68
|
+
visual: z.ZodOptional<z.ZodEnum<{
|
|
69
|
+
warning: "warning";
|
|
70
|
+
unknown: "unknown";
|
|
71
|
+
passed: "passed";
|
|
72
|
+
failed: "failed";
|
|
73
|
+
}>>;
|
|
74
|
+
memory: z.ZodOptional<z.ZodEnum<{
|
|
75
|
+
warning: "warning";
|
|
76
|
+
unknown: "unknown";
|
|
77
|
+
passed: "passed";
|
|
78
|
+
failed: "failed";
|
|
79
|
+
}>>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export declare const AgentCurrentStatusSchema: z.ZodObject<{
|
|
82
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
83
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
84
|
+
revision: z.ZodNumber;
|
|
85
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
86
|
+
sessionId: z.ZodString;
|
|
87
|
+
status: z.ZodEnum<{
|
|
88
|
+
warning: "warning";
|
|
89
|
+
starting: "starting";
|
|
90
|
+
clean: "clean";
|
|
91
|
+
failing: "failing";
|
|
92
|
+
}>;
|
|
93
|
+
activeTab: z.ZodOptional<z.ZodString>;
|
|
94
|
+
tabsWithIssues: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
95
|
+
blocking: z.ZodArray<z.ZodObject<{
|
|
96
|
+
source: z.ZodString;
|
|
97
|
+
severity: z.ZodEnum<{
|
|
98
|
+
error: "error";
|
|
99
|
+
debug: "debug";
|
|
100
|
+
info: "info";
|
|
101
|
+
warning: "warning";
|
|
102
|
+
fatal: "fatal";
|
|
103
|
+
}>;
|
|
104
|
+
title: z.ZodString;
|
|
105
|
+
fingerprint: z.ZodString;
|
|
106
|
+
resource: z.ZodString;
|
|
107
|
+
pageId: z.ZodOptional<z.ZodString>;
|
|
108
|
+
flowId: z.ZodOptional<z.ZodString>;
|
|
109
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
110
|
+
file: z.ZodString;
|
|
111
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
114
|
+
componentName: z.ZodOptional<z.ZodString>;
|
|
115
|
+
hookName: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
}, z.core.$strip>>;
|
|
118
|
+
warnings: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
119
|
+
source: z.ZodString;
|
|
120
|
+
severity: z.ZodEnum<{
|
|
121
|
+
error: "error";
|
|
122
|
+
debug: "debug";
|
|
123
|
+
info: "info";
|
|
124
|
+
warning: "warning";
|
|
125
|
+
fatal: "fatal";
|
|
126
|
+
}>;
|
|
127
|
+
title: z.ZodString;
|
|
128
|
+
fingerprint: z.ZodString;
|
|
129
|
+
resource: z.ZodString;
|
|
130
|
+
pageId: z.ZodOptional<z.ZodString>;
|
|
131
|
+
flowId: z.ZodOptional<z.ZodString>;
|
|
132
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
file: z.ZodString;
|
|
134
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
137
|
+
componentName: z.ZodOptional<z.ZodString>;
|
|
138
|
+
hookName: z.ZodOptional<z.ZodString>;
|
|
139
|
+
}, z.core.$strip>>;
|
|
140
|
+
}, z.core.$strip>>>;
|
|
141
|
+
suggestedReads: z.ZodArray<z.ZodString>;
|
|
142
|
+
checks: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
typecheck: z.ZodOptional<z.ZodEnum<{
|
|
144
|
+
unknown: "unknown";
|
|
145
|
+
passed: "passed";
|
|
146
|
+
failed: "failed";
|
|
147
|
+
}>>;
|
|
148
|
+
lint: z.ZodOptional<z.ZodEnum<{
|
|
149
|
+
unknown: "unknown";
|
|
150
|
+
passed: "passed";
|
|
151
|
+
failed: "failed";
|
|
152
|
+
}>>;
|
|
153
|
+
build: z.ZodOptional<z.ZodEnum<{
|
|
154
|
+
unknown: "unknown";
|
|
155
|
+
passed: "passed";
|
|
156
|
+
failed: "failed";
|
|
157
|
+
}>>;
|
|
158
|
+
runtime: z.ZodOptional<z.ZodEnum<{
|
|
159
|
+
warning: "warning";
|
|
160
|
+
unknown: "unknown";
|
|
161
|
+
passed: "passed";
|
|
162
|
+
failed: "failed";
|
|
163
|
+
}>>;
|
|
164
|
+
visual: z.ZodOptional<z.ZodEnum<{
|
|
165
|
+
warning: "warning";
|
|
166
|
+
unknown: "unknown";
|
|
167
|
+
passed: "passed";
|
|
168
|
+
failed: "failed";
|
|
169
|
+
}>>;
|
|
170
|
+
memory: z.ZodOptional<z.ZodEnum<{
|
|
171
|
+
warning: "warning";
|
|
172
|
+
unknown: "unknown";
|
|
173
|
+
passed: "passed";
|
|
174
|
+
failed: "failed";
|
|
175
|
+
}>>;
|
|
176
|
+
}, z.core.$strip>>;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
export type AgentCurrentStatus = z.infer<typeof AgentCurrentStatusSchema>;
|
|
179
|
+
export declare const AgentSessionSchema: z.ZodObject<{
|
|
180
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
181
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
182
|
+
revision: z.ZodNumber;
|
|
183
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
184
|
+
sessionId: z.ZodString;
|
|
185
|
+
supportedResources: z.ZodArray<z.ZodString>;
|
|
186
|
+
supportedTools: z.ZodArray<z.ZodString>;
|
|
187
|
+
supportedJobs: z.ZodArray<z.ZodString>;
|
|
188
|
+
supportedChannels: z.ZodArray<z.ZodString>;
|
|
189
|
+
subscribedByDefault: z.ZodArray<z.ZodString>;
|
|
190
|
+
transports: z.ZodArray<z.ZodEnum<{
|
|
191
|
+
stdio: "stdio";
|
|
192
|
+
http: "http";
|
|
193
|
+
socket: "socket";
|
|
194
|
+
}>>;
|
|
195
|
+
host: z.ZodObject<{
|
|
196
|
+
platform: z.ZodString;
|
|
197
|
+
node: z.ZodString;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
|
+
project: z.ZodObject<{
|
|
200
|
+
name: z.ZodString;
|
|
201
|
+
nxVersion: z.ZodOptional<z.ZodString>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
}, z.core.$strip>;
|
|
204
|
+
export type AgentSession = z.infer<typeof AgentSessionSchema>;
|
|
205
|
+
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/lib/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;GAGG;AACH,eAAO,MAAM,WAAW,+OAyBd,CAAC;AACX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAIrD,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAItE,eAAO,MAAM,qBAAqB;;;;;EAKhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;iBASlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAO5B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBASnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAI1E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;iBAgB7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
package/lib/resources.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SCHEMA_VERSION } from './schema-version.js';
|
|
3
|
+
import { SourceLocationSchema } from './source-location.js';
|
|
4
|
+
import { SeveritySchema } from './event.js';
|
|
5
|
+
/**
|
|
6
|
+
* Well-known URI schemes used by LensMCP. See `planning/03-mcp-surface.md`.
|
|
7
|
+
* Each scheme maps 1:1 to a FrontMCP @App package.
|
|
8
|
+
*/
|
|
9
|
+
export const URI_SCHEMES = [
|
|
10
|
+
'agent',
|
|
11
|
+
'events',
|
|
12
|
+
'build',
|
|
13
|
+
'lint',
|
|
14
|
+
'typecheck',
|
|
15
|
+
'test',
|
|
16
|
+
'runtime',
|
|
17
|
+
'render',
|
|
18
|
+
'visual',
|
|
19
|
+
'flow',
|
|
20
|
+
'story',
|
|
21
|
+
'trace',
|
|
22
|
+
'graph',
|
|
23
|
+
'bundle',
|
|
24
|
+
'security',
|
|
25
|
+
'perf',
|
|
26
|
+
'deps',
|
|
27
|
+
'memory',
|
|
28
|
+
'browser',
|
|
29
|
+
'react',
|
|
30
|
+
'valtio',
|
|
31
|
+
'nest',
|
|
32
|
+
'next',
|
|
33
|
+
'process',
|
|
34
|
+
];
|
|
35
|
+
// -------- shared header on every resource JSON --------
|
|
36
|
+
export const ResourceEnvelopeSchema = z.object({
|
|
37
|
+
$schema: z.string().optional(),
|
|
38
|
+
schemaVersion: z.literal(SCHEMA_VERSION),
|
|
39
|
+
revision: z.number().int().nonnegative(),
|
|
40
|
+
updatedAt: z.string().datetime().optional(),
|
|
41
|
+
});
|
|
42
|
+
// -------- agent://current-status --------
|
|
43
|
+
export const AgentStatusKindSchema = z.enum([
|
|
44
|
+
'starting',
|
|
45
|
+
'clean',
|
|
46
|
+
'warning',
|
|
47
|
+
'failing',
|
|
48
|
+
]);
|
|
49
|
+
export const AgentBlockingItemSchema = z.object({
|
|
50
|
+
source: z.string(),
|
|
51
|
+
severity: SeveritySchema,
|
|
52
|
+
title: z.string(),
|
|
53
|
+
fingerprint: z.string(),
|
|
54
|
+
resource: z.string(),
|
|
55
|
+
pageId: z.string().optional(),
|
|
56
|
+
flowId: z.string().optional(),
|
|
57
|
+
location: SourceLocationSchema.optional(),
|
|
58
|
+
});
|
|
59
|
+
export const AgentChecksSchema = z.object({
|
|
60
|
+
typecheck: z.enum(['passed', 'failed', 'unknown']).optional(),
|
|
61
|
+
lint: z.enum(['passed', 'failed', 'unknown']).optional(),
|
|
62
|
+
build: z.enum(['passed', 'failed', 'unknown']).optional(),
|
|
63
|
+
runtime: z.enum(['passed', 'failed', 'warning', 'unknown']).optional(),
|
|
64
|
+
visual: z.enum(['passed', 'failed', 'warning', 'unknown']).optional(),
|
|
65
|
+
memory: z.enum(['passed', 'failed', 'warning', 'unknown']).optional(),
|
|
66
|
+
});
|
|
67
|
+
export const AgentCurrentStatusSchema = ResourceEnvelopeSchema.extend({
|
|
68
|
+
sessionId: z.string(),
|
|
69
|
+
status: AgentStatusKindSchema,
|
|
70
|
+
activeTab: z.string().optional(),
|
|
71
|
+
tabsWithIssues: z.array(z.string()).optional(),
|
|
72
|
+
blocking: z.array(AgentBlockingItemSchema),
|
|
73
|
+
warnings: z.array(AgentBlockingItemSchema).default([]),
|
|
74
|
+
suggestedReads: z.array(z.string()),
|
|
75
|
+
checks: AgentChecksSchema.optional(),
|
|
76
|
+
});
|
|
77
|
+
// -------- agent://session --------
|
|
78
|
+
export const AgentSessionSchema = ResourceEnvelopeSchema.extend({
|
|
79
|
+
sessionId: z.string(),
|
|
80
|
+
supportedResources: z.array(z.string()),
|
|
81
|
+
supportedTools: z.array(z.string()),
|
|
82
|
+
supportedJobs: z.array(z.string()),
|
|
83
|
+
supportedChannels: z.array(z.string()),
|
|
84
|
+
subscribedByDefault: z.array(z.string()),
|
|
85
|
+
transports: z.array(z.enum(['stdio', 'http', 'socket'])),
|
|
86
|
+
host: z.object({
|
|
87
|
+
platform: z.string(),
|
|
88
|
+
node: z.string(),
|
|
89
|
+
}),
|
|
90
|
+
project: z.object({
|
|
91
|
+
name: z.string(),
|
|
92
|
+
nxVersion: z.string().optional(),
|
|
93
|
+
}),
|
|
94
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-version.d.ts","sourceRoot":"","sources":["../../src/lib/schema-version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,EAAG,CAAU,CAAC;AACzC,MAAM,MAAM,aAAa,GAAG,OAAO,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SCHEMA_VERSION = 1;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SourceLocationSchema: z.ZodObject<{
|
|
3
|
+
file: z.ZodString;
|
|
4
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
7
|
+
componentName: z.ZodOptional<z.ZodString>;
|
|
8
|
+
hookName: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type SourceLocation = z.infer<typeof SourceLocationSchema>;
|
|
11
|
+
//# sourceMappingURL=source-location.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-location.d.ts","sourceRoot":"","sources":["../../src/lib/source-location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;iBAO/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const SourceLocationSchema = z.object({
|
|
3
|
+
file: z.string(),
|
|
4
|
+
line: z.number().int().nonnegative().optional(),
|
|
5
|
+
column: z.number().int().nonnegative().optional(),
|
|
6
|
+
symbol: z.string().optional(),
|
|
7
|
+
componentName: z.string().optional(),
|
|
8
|
+
hookName: z.string().optional(),
|
|
9
|
+
});
|
package/lib/tokens.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DI tokens for FrontMCP `@Provider` registrations. Each token is paired
|
|
3
|
+
* with a TypeScript interface declared by the package that owns it, so
|
|
4
|
+
* consumers can type the `this.get(Token)` call by importing the
|
|
5
|
+
* companion type. We keep the *interfaces* abstract in this package and
|
|
6
|
+
* let `@lensmcp/core` etc. ship their concrete classes.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SessionToken: unique symbol;
|
|
9
|
+
export declare const EventBusToken: unique symbol;
|
|
10
|
+
export declare const GraphStoreToken: unique symbol;
|
|
11
|
+
export declare const ResourceStoreToken: unique symbol;
|
|
12
|
+
export declare const StorageToken: unique symbol;
|
|
13
|
+
export type LensmcpToken = typeof SessionToken | typeof EventBusToken | typeof GraphStoreToken | typeof ResourceStoreToken | typeof StorageToken;
|
|
14
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/lib/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,YAAY,eAAyC,CAAC;AACnE,eAAO,MAAM,aAAa,eAAuC,CAAC;AAClE,eAAO,MAAM,eAAe,eAAyC,CAAC;AACtE,eAAO,MAAM,kBAAkB,eAA4C,CAAC;AAC5E,eAAO,MAAM,YAAY,eAAyC,CAAC;AAEnE,MAAM,MAAM,YAAY,GACpB,OAAO,YAAY,GACnB,OAAO,aAAa,GACpB,OAAO,eAAe,GACtB,OAAO,kBAAkB,GACzB,OAAO,YAAY,CAAC"}
|
package/lib/tokens.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DI tokens for FrontMCP `@Provider` registrations. Each token is paired
|
|
3
|
+
* with a TypeScript interface declared by the package that owns it, so
|
|
4
|
+
* consumers can type the `this.get(Token)` call by importing the
|
|
5
|
+
* companion type. We keep the *interfaces* abstract in this package and
|
|
6
|
+
* let `@lensmcp/core` etc. ship their concrete classes.
|
|
7
|
+
*/
|
|
8
|
+
export const SessionToken = Symbol.for('@lensmcp/session/Session');
|
|
9
|
+
export const EventBusToken = Symbol.for('@lensmcp/core/EventBus');
|
|
10
|
+
export const GraphStoreToken = Symbol.for('@lensmcp/core/GraphStore');
|
|
11
|
+
export const ResourceStoreToken = Symbol.for('@lensmcp/core/ResourceStore');
|
|
12
|
+
export const StorageToken = Symbol.for('@lensmcp/storage/Storage');
|