@lensmcp/protocol-types 1.17.3 → 1.18.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/lib/resources.d.ts +33 -0
- package/lib/resources.d.ts.map +1 -1
- package/lib/resources.js +24 -0
- package/package.json +1 -1
package/lib/resources.d.ts
CHANGED
|
@@ -78,6 +78,30 @@ export declare const AgentChecksSchema: z.ZodObject<{
|
|
|
78
78
|
failed: "failed";
|
|
79
79
|
}>>;
|
|
80
80
|
}, z.core.$strip>;
|
|
81
|
+
/**
|
|
82
|
+
* How the MCP server answering this read is being served.
|
|
83
|
+
*
|
|
84
|
+
* `shared` means ONE server for the workspace, reached by every agent session
|
|
85
|
+
* through a thin stdio shim — so `sessionId` below is the SHARED lens session
|
|
86
|
+
* and other sessions are reading the same state. `embedded` means this server
|
|
87
|
+
* belongs to one agent session and dies with it (and therefore keeps serving the
|
|
88
|
+
* bundle it started with until that session ends).
|
|
89
|
+
*/
|
|
90
|
+
export declare const AgentServerModeSchema: z.ZodEnum<{
|
|
91
|
+
embedded: "embedded";
|
|
92
|
+
shared: "shared";
|
|
93
|
+
}>;
|
|
94
|
+
export type AgentServerMode = z.infer<typeof AgentServerModeSchema>;
|
|
95
|
+
export declare const AgentServerInfoSchema: z.ZodObject<{
|
|
96
|
+
mode: z.ZodEnum<{
|
|
97
|
+
embedded: "embedded";
|
|
98
|
+
shared: "shared";
|
|
99
|
+
}>;
|
|
100
|
+
pid: z.ZodNumber;
|
|
101
|
+
startedAt: z.ZodString;
|
|
102
|
+
url: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
export type AgentServerInfo = z.infer<typeof AgentServerInfoSchema>;
|
|
81
105
|
export declare const AgentCurrentStatusSchema: z.ZodObject<{
|
|
82
106
|
$schema: z.ZodOptional<z.ZodString>;
|
|
83
107
|
schemaVersion: z.ZodLiteral<1>;
|
|
@@ -174,6 +198,15 @@ export declare const AgentCurrentStatusSchema: z.ZodObject<{
|
|
|
174
198
|
failed: "failed";
|
|
175
199
|
}>>;
|
|
176
200
|
}, z.core.$strip>>;
|
|
201
|
+
server: z.ZodOptional<z.ZodObject<{
|
|
202
|
+
mode: z.ZodEnum<{
|
|
203
|
+
embedded: "embedded";
|
|
204
|
+
shared: "shared";
|
|
205
|
+
}>;
|
|
206
|
+
pid: z.ZodNumber;
|
|
207
|
+
startedAt: z.ZodString;
|
|
208
|
+
url: z.ZodOptional<z.ZodString>;
|
|
209
|
+
}, z.core.$strip>>;
|
|
177
210
|
}, z.core.$strip>;
|
|
178
211
|
export type AgentCurrentStatus = z.infer<typeof AgentCurrentStatusSchema>;
|
|
179
212
|
/**
|
package/lib/resources.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/lib/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;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,eA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resources.js
CHANGED
|
@@ -65,6 +65,25 @@ export const AgentChecksSchema = z.object({
|
|
|
65
65
|
visual: z.enum(['passed', 'failed', 'warning', 'unknown']).optional(),
|
|
66
66
|
memory: z.enum(['passed', 'failed', 'warning', 'unknown']).optional(),
|
|
67
67
|
});
|
|
68
|
+
/**
|
|
69
|
+
* How the MCP server answering this read is being served.
|
|
70
|
+
*
|
|
71
|
+
* `shared` means ONE server for the workspace, reached by every agent session
|
|
72
|
+
* through a thin stdio shim — so `sessionId` below is the SHARED lens session
|
|
73
|
+
* and other sessions are reading the same state. `embedded` means this server
|
|
74
|
+
* belongs to one agent session and dies with it (and therefore keeps serving the
|
|
75
|
+
* bundle it started with until that session ends).
|
|
76
|
+
*/
|
|
77
|
+
export const AgentServerModeSchema = z.enum(['embedded', 'shared']);
|
|
78
|
+
export const AgentServerInfoSchema = z.object({
|
|
79
|
+
mode: AgentServerModeSchema,
|
|
80
|
+
/** The server process. Stable across agent sessions in `shared` mode. */
|
|
81
|
+
pid: z.number(),
|
|
82
|
+
/** ISO timestamp this server process started — how stale its bundle may be. */
|
|
83
|
+
startedAt: z.string(),
|
|
84
|
+
/** The loopback URL clients reach it on. Only in `shared` mode. */
|
|
85
|
+
url: z.string().optional(),
|
|
86
|
+
});
|
|
68
87
|
export const AgentCurrentStatusSchema = ResourceEnvelopeSchema.extend({
|
|
69
88
|
sessionId: z.string(),
|
|
70
89
|
status: AgentStatusKindSchema,
|
|
@@ -74,6 +93,11 @@ export const AgentCurrentStatusSchema = ResourceEnvelopeSchema.extend({
|
|
|
74
93
|
warnings: z.array(AgentBlockingItemSchema).default([]),
|
|
75
94
|
suggestedReads: z.array(z.string()),
|
|
76
95
|
checks: AgentChecksSchema.optional(),
|
|
96
|
+
/**
|
|
97
|
+
* Optional so a bare context (no server env) still validates — and so a
|
|
98
|
+
* pre-shim recorded status keeps parsing.
|
|
99
|
+
*/
|
|
100
|
+
server: AgentServerInfoSchema.optional(),
|
|
77
101
|
});
|
|
78
102
|
// -------- agent://session --------
|
|
79
103
|
/**
|