@veolab/discoverylab 1.2.2 → 1.3.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/.mcp.json +2 -2
- package/README.md +182 -0
- package/dist/{chunk-YEZ26ENO.js → chunk-3QRQEDWR.js} +313 -192
- package/dist/{chunk-E3N3P2AG.js → chunk-4L76GPRC.js} +1124 -51
- package/dist/{chunk-I6YD3QFM.js → chunk-FIL7IWEL.js} +5 -3
- package/dist/{chunk-G524UVBK.js → chunk-FNUN7EPB.js} +5 -5
- package/dist/chunk-GAKEFJ5T.js +481 -0
- package/dist/chunk-LB3RNE3O.js +109 -0
- package/dist/chunk-N6JJ2RGV.js +2680 -0
- package/dist/{chunk-7HZEDTS7.js → chunk-VRM42PML.js} +3471 -848
- package/dist/{chunk-TJ3H23LL.js → chunk-VVIOB362.js} +3 -1
- package/dist/{chunk-W3WJGYR6.js → chunk-XFVDP332.js} +8 -2
- package/dist/cli.js +397 -9
- package/dist/{db-ADBEBNH6.js → db-6WLEVKUV.js} +3 -1
- package/dist/esvp-GSISVXLC.js +52 -0
- package/dist/esvp-mobile-GC7MAGMI.js +20 -0
- package/dist/index.d.ts +123 -1
- package/dist/index.html +11689 -8690
- package/dist/index.js +67 -12
- package/dist/{ocr-UTWC7537.js → ocr-QDYNCSPE.js} +1 -1
- package/dist/{playwright-R7Y5HREH.js → playwright-VZ7PXDC5.js} +2 -2
- package/dist/runtime/esvp-host-runtime/darwin-arm64/esvp-host-runtime +0 -0
- package/dist/runtime/esvp-host-runtime/manifest.json +10 -0
- package/dist/server-FO3UVUZU.js +22 -0
- package/dist/{setup-B5YPNUE4.js → setup-2SQC5UHJ.js} +2 -2
- package/dist/{tools-YS4QHOTQ.js → tools-OCRMOQ4U.js} +61 -6
- package/package.json +36 -5
- package/dist/chunk-22OCFYHG.js +0 -6283
- package/dist/chunk-24VARQVO.js +0 -7818
- package/dist/chunk-2OGZX6C4.js +0 -588
- package/dist/chunk-2WCNIFRO.js +0 -6191
- package/dist/chunk-43U6UYV7.js +0 -590
- package/dist/chunk-4H2E3K2G.js +0 -7638
- package/dist/chunk-4KLG6DDE.js +0 -334
- package/dist/chunk-4MS6YW2B.js +0 -6490
- package/dist/chunk-4NNTRJOI.js +0 -7791
- package/dist/chunk-5F76VWME.js +0 -6397
- package/dist/chunk-5NEFN42O.js +0 -7791
- package/dist/chunk-63MEQ6UH.js +0 -7673
- package/dist/chunk-6H3NXFX3.js +0 -6861
- package/dist/chunk-7DOG2W4O.js +0 -6428
- package/dist/chunk-7IDQLLBW.js +0 -311
- package/dist/chunk-7NP64TGJ.js +0 -6822
- package/dist/chunk-AATLY4KT.js +0 -6505
- package/dist/chunk-C7QUR7XX.js +0 -6397
- package/dist/chunk-CGKCE6MC.js +0 -6279
- package/dist/chunk-D25V6IWE.js +0 -6487
- package/dist/chunk-EQOZSXAT.js +0 -6822
- package/dist/chunk-FPHD7HSQ.js +0 -6812
- package/dist/chunk-GGJJUCFK.js +0 -7160
- package/dist/chunk-GLHOY3NN.js +0 -7805
- package/dist/chunk-GML5MKQA.js +0 -6398
- package/dist/chunk-GOL6FUJL.js +0 -6045
- package/dist/chunk-GSWHWEYC.js +0 -1346
- package/dist/chunk-HDKEQOF5.js +0 -7788
- package/dist/chunk-HZGSWVVS.js +0 -7111
- package/dist/chunk-IGZ5TICZ.js +0 -334
- package/dist/chunk-IRKQG33A.js +0 -7054
- package/dist/chunk-JFTBF4JR.js +0 -6040
- package/dist/chunk-JVLVBPUJ.js +0 -6180
- package/dist/chunk-JY3KC67R.js +0 -6504
- package/dist/chunk-KUFBCBNJ.js +0 -6815
- package/dist/chunk-KV7KDJ43.js +0 -7639
- package/dist/chunk-L4SA5F5W.js +0 -6397
- package/dist/chunk-L5IJZV5F.js +0 -6822
- package/dist/chunk-MFFPQLU4.js +0 -7102
- package/dist/chunk-MJS2YKNR.js +0 -6397
- package/dist/chunk-MN6LCZHZ.js +0 -1320
- package/dist/chunk-NBAUZ7X2.js +0 -1336
- package/dist/chunk-NDBW6ELQ.js +0 -7638
- package/dist/chunk-O2HBSDI2.js +0 -6175
- package/dist/chunk-OFFIUYMG.js +0 -6341
- package/dist/chunk-OVCQGF2J.js +0 -1321
- package/dist/chunk-P4S7ZY6G.js +0 -7638
- package/dist/chunk-PBHUHSC3.js +0 -6002
- package/dist/chunk-PC4LR4ZI.js +0 -6359
- package/dist/chunk-PMTGGZ7R.js +0 -6397
- package/dist/chunk-PTXSB3UV.js +0 -497
- package/dist/chunk-PYUCY3U6.js +0 -1340
- package/dist/chunk-QJXXHOV7.js +0 -205
- package/dist/chunk-RDZDSOAL.js +0 -7750
- package/dist/chunk-RLW2OI2L.js +0 -6383
- package/dist/chunk-RUGHHO4K.js +0 -6395
- package/dist/chunk-SIOQVM2E.js +0 -6819
- package/dist/chunk-SR67SRIT.js +0 -1336
- package/dist/chunk-SSRXIO2V.js +0 -6822
- package/dist/chunk-SWSEKFON.js +0 -6487
- package/dist/chunk-TAODYZ52.js +0 -1393
- package/dist/chunk-TBG76CYG.js +0 -6395
- package/dist/chunk-V3CBINLD.js +0 -6812
- package/dist/chunk-VPYSLEGM.js +0 -6710
- package/dist/chunk-VY3BLXBW.js +0 -329
- package/dist/chunk-WTFOGVJQ.js +0 -6365
- package/dist/chunk-X64SFUT5.js +0 -6099
- package/dist/chunk-XIBF5LBD.js +0 -6395
- package/dist/chunk-XUKWS2CE.js +0 -7805
- package/dist/chunk-XZZKFF5V.js +0 -7787
- package/dist/chunk-Y5VDMSYC.js +0 -6701
- package/dist/chunk-YUBL36H4.js +0 -6605
- package/dist/chunk-YWVXFVSW.js +0 -6456
- package/dist/chunk-ZJFWMSZF.js +0 -7883
- package/dist/chunk-ZXZACOLD.js +0 -6822
- package/dist/db-IWIL65EX.js +0 -33
- package/dist/gridCompositor-ENKLFPWR.js +0 -409
- package/dist/playwright-A3OGSDRG.js +0 -38
- package/dist/playwright-ATDC4NYW.js +0 -38
- package/dist/playwright-E6EUFIJG.js +0 -38
- package/dist/server-2DXLKLFM.js +0 -13
- package/dist/server-2ICEWJVK.js +0 -13
- package/dist/server-2MQV3FNY.js +0 -13
- package/dist/server-2NGD7GE3.js +0 -13
- package/dist/server-2VKO76UK.js +0 -14
- package/dist/server-3BK2VFU7.js +0 -13
- package/dist/server-3FBHBA7L.js +0 -15
- package/dist/server-4LDOB3NX.js +0 -13
- package/dist/server-4YI44KDR.js +0 -13
- package/dist/server-64XMXA5P.js +0 -13
- package/dist/server-6IPHVUYT.js +0 -14
- package/dist/server-73ORHMJN.js +0 -13
- package/dist/server-73P7M3QB.js +0 -14
- package/dist/server-BPVRW5LJ.js +0 -14
- package/dist/server-BW4RKZIX.js +0 -13
- package/dist/server-CFS5SM5K.js +0 -13
- package/dist/server-DX7VYHHM.js +0 -13
- package/dist/server-F3YPX6ET.js +0 -13
- package/dist/server-FUXTR33I.js +0 -13
- package/dist/server-G2SY3DOS.js +0 -13
- package/dist/server-G32U7VOQ.js +0 -13
- package/dist/server-HKRIY7FP.js +0 -14
- package/dist/server-HON66OES.js +0 -15
- package/dist/server-IOOZK4NP.js +0 -14
- package/dist/server-IZEO7OJJ.js +0 -14
- package/dist/server-J52LMTBT.js +0 -13
- package/dist/server-JG7UKFGK.js +0 -14
- package/dist/server-JSCHEBOD.js +0 -13
- package/dist/server-K6KC4ZOM.js +0 -13
- package/dist/server-KJVRGWFE.js +0 -13
- package/dist/server-LCPB2L4U.js +0 -13
- package/dist/server-M7LDYKAJ.js +0 -13
- package/dist/server-MKVK6ZQQ.js +0 -13
- package/dist/server-MU52LCXT.js +0 -13
- package/dist/server-NM5CKDUU.js +0 -13
- package/dist/server-NPZN3FWO.js +0 -14
- package/dist/server-O5FIAHSY.js +0 -14
- package/dist/server-OESJUEYC.js +0 -13
- package/dist/server-ONSKQO4W.js +0 -13
- package/dist/server-P27BZXBL.js +0 -14
- package/dist/server-Q4FBWQUA.js +0 -13
- package/dist/server-RNQ7VUAL.js +0 -13
- package/dist/server-S6B5WUBT.js +0 -14
- package/dist/server-SRYNSGSP.js +0 -14
- package/dist/server-SUN3W2YK.js +0 -13
- package/dist/server-UA62LHZB.js +0 -13
- package/dist/server-UJB44EW5.js +0 -13
- package/dist/server-X3TLP6DX.js +0 -14
- package/dist/server-YT2UGEZK.js +0 -13
- package/dist/server-ZBPQ33V6.js +0 -14
- package/dist/setup-27CQAX6K.js +0 -17
- package/dist/setup-AQX4JQVR.js +0 -17
- package/dist/setup-EQTU7FI6.js +0 -17
- package/dist/tools-2KPB37GK.js +0 -178
- package/dist/tools-3H6IOWXV.js +0 -178
- package/dist/tools-3KYHPDCJ.js +0 -178
- package/dist/tools-75BAPCUM.js +0 -177
- package/dist/tools-BUVCUCRL.js +0 -178
- package/dist/tools-HDNODRS6.js +0 -178
- package/dist/tools-HP5MNY3D.js +0 -177
- package/dist/tools-L6PKKQPY.js +0 -179
- package/dist/tools-N5N2IO7V.js +0 -178
- package/dist/tools-NFJEZ2FF.js +0 -177
- package/dist/tools-OPULIER6.js +0 -178
- package/dist/tools-TLCKABUW.js +0 -178
package/dist/chunk-QJXXHOV7.js
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
// src/mcp/server.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
var MCPServer = class {
|
|
4
|
-
tools = /* @__PURE__ */ new Map();
|
|
5
|
-
serverInfo = {
|
|
6
|
-
name: "discoverylab",
|
|
7
|
-
version: "0.1.0"
|
|
8
|
-
};
|
|
9
|
-
registerTool(tool) {
|
|
10
|
-
this.tools.set(tool.name, tool);
|
|
11
|
-
}
|
|
12
|
-
registerTools(tools) {
|
|
13
|
-
for (const tool of tools) {
|
|
14
|
-
this.registerTool(tool);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
async handleRequest(request) {
|
|
18
|
-
const { id, method, params } = request;
|
|
19
|
-
try {
|
|
20
|
-
switch (method) {
|
|
21
|
-
case "initialize":
|
|
22
|
-
return this.handleInitialize(id, params);
|
|
23
|
-
case "tools/list":
|
|
24
|
-
return this.handleToolsList(id);
|
|
25
|
-
case "tools/call":
|
|
26
|
-
return this.handleToolCall(id, params);
|
|
27
|
-
case "ping":
|
|
28
|
-
return { jsonrpc: "2.0", id, result: { pong: true } };
|
|
29
|
-
default:
|
|
30
|
-
return {
|
|
31
|
-
jsonrpc: "2.0",
|
|
32
|
-
id,
|
|
33
|
-
error: { code: -32601, message: `Method not found: ${method}` }
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
} catch (error) {
|
|
37
|
-
const message = error instanceof Error ? error.message : "Unknown error";
|
|
38
|
-
return {
|
|
39
|
-
jsonrpc: "2.0",
|
|
40
|
-
id,
|
|
41
|
-
error: { code: -32603, message }
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
handleInitialize(id, params) {
|
|
46
|
-
return {
|
|
47
|
-
jsonrpc: "2.0",
|
|
48
|
-
id,
|
|
49
|
-
result: {
|
|
50
|
-
protocolVersion: "2024-11-05",
|
|
51
|
-
serverInfo: this.serverInfo,
|
|
52
|
-
capabilities: {
|
|
53
|
-
tools: {}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
handleToolsList(id) {
|
|
59
|
-
const tools = Array.from(this.tools.values()).map((tool) => ({
|
|
60
|
-
name: tool.name,
|
|
61
|
-
description: tool.description,
|
|
62
|
-
inputSchema: this.zodToJsonSchema(tool.inputSchema)
|
|
63
|
-
}));
|
|
64
|
-
return {
|
|
65
|
-
jsonrpc: "2.0",
|
|
66
|
-
id,
|
|
67
|
-
result: { tools }
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
async handleToolCall(id, params) {
|
|
71
|
-
const { name, arguments: args } = params;
|
|
72
|
-
const tool = this.tools.get(name);
|
|
73
|
-
if (!tool) {
|
|
74
|
-
return {
|
|
75
|
-
jsonrpc: "2.0",
|
|
76
|
-
id,
|
|
77
|
-
error: { code: -32602, message: `Tool not found: ${name}` }
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
try {
|
|
81
|
-
const validatedArgs = tool.inputSchema.parse(args || {});
|
|
82
|
-
const result = await tool.handler(validatedArgs);
|
|
83
|
-
return {
|
|
84
|
-
jsonrpc: "2.0",
|
|
85
|
-
id,
|
|
86
|
-
result
|
|
87
|
-
};
|
|
88
|
-
} catch (error) {
|
|
89
|
-
if (error instanceof z.ZodError) {
|
|
90
|
-
return {
|
|
91
|
-
jsonrpc: "2.0",
|
|
92
|
-
id,
|
|
93
|
-
error: {
|
|
94
|
-
code: -32602,
|
|
95
|
-
message: "Invalid parameters",
|
|
96
|
-
data: error.errors
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
const message = error instanceof Error ? error.message : "Tool execution failed";
|
|
101
|
-
return {
|
|
102
|
-
jsonrpc: "2.0",
|
|
103
|
-
id,
|
|
104
|
-
result: {
|
|
105
|
-
content: [{ type: "text", text: `Error: ${message}` }],
|
|
106
|
-
isError: true
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
zodToJsonSchema(schema) {
|
|
112
|
-
if (schema instanceof z.ZodObject) {
|
|
113
|
-
const shape = schema.shape;
|
|
114
|
-
const properties = {};
|
|
115
|
-
const required = [];
|
|
116
|
-
for (const [key, value] of Object.entries(shape)) {
|
|
117
|
-
properties[key] = this.zodToJsonSchema(value);
|
|
118
|
-
if (!value.isOptional()) {
|
|
119
|
-
required.push(key);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
type: "object",
|
|
124
|
-
properties,
|
|
125
|
-
required: required.length > 0 ? required : void 0
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
if (schema instanceof z.ZodString) {
|
|
129
|
-
return { type: "string" };
|
|
130
|
-
}
|
|
131
|
-
if (schema instanceof z.ZodNumber) {
|
|
132
|
-
return { type: "number" };
|
|
133
|
-
}
|
|
134
|
-
if (schema instanceof z.ZodBoolean) {
|
|
135
|
-
return { type: "boolean" };
|
|
136
|
-
}
|
|
137
|
-
if (schema instanceof z.ZodArray) {
|
|
138
|
-
return {
|
|
139
|
-
type: "array",
|
|
140
|
-
items: this.zodToJsonSchema(schema.element)
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
if (schema instanceof z.ZodOptional) {
|
|
144
|
-
return this.zodToJsonSchema(schema.unwrap());
|
|
145
|
-
}
|
|
146
|
-
if (schema instanceof z.ZodEnum) {
|
|
147
|
-
return {
|
|
148
|
-
type: "string",
|
|
149
|
-
enum: schema.options
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
return { type: "object" };
|
|
153
|
-
}
|
|
154
|
-
// STDIO transport
|
|
155
|
-
async runStdio() {
|
|
156
|
-
const readline = await import("readline");
|
|
157
|
-
const rl = readline.createInterface({
|
|
158
|
-
input: process.stdin,
|
|
159
|
-
output: process.stdout,
|
|
160
|
-
terminal: false
|
|
161
|
-
});
|
|
162
|
-
rl.on("line", async (line) => {
|
|
163
|
-
try {
|
|
164
|
-
const request = JSON.parse(line);
|
|
165
|
-
const response = await this.handleRequest(request);
|
|
166
|
-
console.log(JSON.stringify(response));
|
|
167
|
-
} catch (error) {
|
|
168
|
-
const errorResponse = {
|
|
169
|
-
jsonrpc: "2.0",
|
|
170
|
-
id: 0,
|
|
171
|
-
error: { code: -32700, message: "Parse error" }
|
|
172
|
-
};
|
|
173
|
-
console.log(JSON.stringify(errorResponse));
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
rl.on("close", () => {
|
|
177
|
-
process.exit(0);
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
function createTextResult(text) {
|
|
182
|
-
return {
|
|
183
|
-
content: [{ type: "text", text }]
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
function createErrorResult(message) {
|
|
187
|
-
return {
|
|
188
|
-
content: [{ type: "text", text: `Error: ${message}` }],
|
|
189
|
-
isError: true
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
function createJsonResult(data) {
|
|
193
|
-
return {
|
|
194
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
var mcpServer = new MCPServer();
|
|
198
|
-
|
|
199
|
-
export {
|
|
200
|
-
MCPServer,
|
|
201
|
-
createTextResult,
|
|
202
|
-
createErrorResult,
|
|
203
|
-
createJsonResult,
|
|
204
|
-
mcpServer
|
|
205
|
-
};
|