@yourgpt/copilot-sdk 2.0.2-beta.2 → 2.1.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/README.md +0 -42
- package/dist/{chunk-UOWLKFXK.cjs → chunk-33JSFVGH.cjs} +23 -23
- package/dist/{chunk-UOWLKFXK.cjs.map → chunk-33JSFVGH.cjs.map} +1 -1
- package/dist/{chunk-IXFV6AW6.js → chunk-3SP6V22Y.js} +246 -219
- package/dist/chunk-3SP6V22Y.js.map +1 -0
- package/dist/{chunk-7XFFRV7D.js → chunk-7PJ4GAJR.js} +4 -4
- package/dist/{chunk-7XFFRV7D.js.map → chunk-7PJ4GAJR.js.map} +1 -1
- package/dist/{chunk-ZPYQDMUX.js → chunk-7YZVSG62.js} +3 -3
- package/dist/{chunk-ZPYQDMUX.js.map → chunk-7YZVSG62.js.map} +1 -1
- package/dist/{chunk-BKO7DSPU.js → chunk-BRUDSHCV.js} +2 -2
- package/dist/chunk-BRUDSHCV.js.map +1 -0
- package/dist/{chunk-BH7MNDWW.js → chunk-EWVQWTNV.js} +13 -3
- package/dist/chunk-EWVQWTNV.js.map +1 -0
- package/dist/{chunk-CEKAYA2Q.cjs → chunk-HNRFRNMY.cjs} +2 -2
- package/dist/chunk-HNRFRNMY.cjs.map +1 -0
- package/dist/{chunk-7K7HZMP4.cjs → chunk-JGPDQDY4.cjs} +13 -3
- package/dist/chunk-JGPDQDY4.cjs.map +1 -0
- package/dist/{chunk-H5XMKBBA.cjs → chunk-MUZ2RYS2.cjs} +268 -241
- package/dist/chunk-MUZ2RYS2.cjs.map +1 -0
- package/dist/{chunk-UIWFYMAO.cjs → chunk-O33I4HBL.cjs} +5 -5
- package/dist/{chunk-UIWFYMAO.cjs.map → chunk-O33I4HBL.cjs.map} +1 -1
- package/dist/core/index.cjs +80 -80
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +3 -3
- package/dist/{index-pWEH7pUE.d.ts → index-25qIYJ21.d.ts} +1 -1
- package/dist/{index-2VtgKM8S.d.cts → index-C261xY-B.d.cts} +1 -1
- package/dist/mcp/index.cjs +47 -47
- package/dist/mcp/index.d.cts +13 -3
- package/dist/mcp/index.d.ts +13 -3
- package/dist/mcp/index.js +2 -2
- package/dist/react/index.cjs +50 -50
- package/dist/react/index.d.cts +18 -5
- package/dist/react/index.d.ts +18 -5
- package/dist/react/index.js +5 -5
- package/dist/tools/anthropic/index.d.cts +1 -1
- package/dist/tools/anthropic/index.d.ts +1 -1
- package/dist/tools/brave/index.cjs +2 -2
- package/dist/tools/brave/index.d.cts +1 -1
- package/dist/tools/brave/index.d.ts +1 -1
- package/dist/tools/brave/index.js +1 -1
- package/dist/tools/exa/index.cjs +2 -2
- package/dist/tools/exa/index.d.cts +1 -1
- package/dist/tools/exa/index.d.ts +1 -1
- package/dist/tools/exa/index.js +1 -1
- package/dist/tools/google/index.cjs +2 -2
- package/dist/tools/google/index.d.cts +1 -1
- package/dist/tools/google/index.d.ts +1 -1
- package/dist/tools/google/index.js +1 -1
- package/dist/tools/openai/index.cjs +2 -2
- package/dist/tools/openai/index.d.cts +1 -1
- package/dist/tools/openai/index.d.ts +1 -1
- package/dist/tools/openai/index.js +1 -1
- package/dist/tools/searxng/index.cjs +2 -2
- package/dist/tools/searxng/index.d.cts +1 -1
- package/dist/tools/searxng/index.d.ts +1 -1
- package/dist/tools/searxng/index.js +1 -1
- package/dist/tools/serper/index.cjs +2 -2
- package/dist/tools/serper/index.d.cts +1 -1
- package/dist/tools/serper/index.d.ts +1 -1
- package/dist/tools/serper/index.js +1 -1
- package/dist/tools/tavily/index.cjs +2 -2
- package/dist/tools/tavily/index.d.cts +1 -1
- package/dist/tools/tavily/index.d.ts +1 -1
- package/dist/tools/tavily/index.js +1 -1
- package/dist/tools/web-search/index.cjs +3 -3
- package/dist/tools/web-search/index.d.cts +2 -2
- package/dist/tools/web-search/index.d.ts +2 -2
- package/dist/tools/web-search/index.js +2 -2
- package/dist/{tools-DDWrco4h.d.cts → tools-Clyufshc.d.cts} +14 -1
- package/dist/{tools-DDWrco4h.d.ts → tools-Clyufshc.d.ts} +14 -1
- package/dist/{types-DjSfYNKj.d.cts → types-DM6M_pv_.d.cts} +43 -2
- package/dist/{types-Cizh9K_f.d.ts → types-wudOhedT.d.ts} +43 -2
- package/dist/ui/index.cjs +56 -26
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.cts +37 -3
- package/dist/ui/index.d.ts +37 -3
- package/dist/ui/index.js +52 -22
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-7K7HZMP4.cjs.map +0 -1
- package/dist/chunk-BH7MNDWW.js.map +0 -1
- package/dist/chunk-BKO7DSPU.js.map +0 -1
- package/dist/chunk-CEKAYA2Q.cjs.map +0 -1
- package/dist/chunk-H5XMKBBA.cjs.map +0 -1
- package/dist/chunk-IXFV6AW6.js.map +0 -1
package/dist/mcp/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkJO4BHPAD_cjs = require('../chunk-JO4BHPAD.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkJGPDQDY4_cjs = require('../chunk-JGPDQDY4.cjs');
|
|
5
5
|
var chunkJEQ2X3Z6_cjs = require('../chunk-JEQ2X3Z6.cjs');
|
|
6
6
|
|
|
7
7
|
// src/mcp/client/MCPClientManager.ts
|
|
@@ -203,7 +203,7 @@ var MCPClientManager = class {
|
|
|
203
203
|
this.events.onError?.(config.name, error);
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
return
|
|
206
|
+
return chunkJGPDQDY4_cjs.createMCPClient(config, clientEvents);
|
|
207
207
|
}
|
|
208
208
|
};
|
|
209
209
|
function createMCPClientManager(configs, events) {
|
|
@@ -211,7 +211,7 @@ function createMCPClientManager(configs, events) {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
// src/mcp/transports/SSETransport.ts
|
|
214
|
-
var SSETransport = class extends
|
|
214
|
+
var SSETransport = class extends chunkJGPDQDY4_cjs.BaseTransport {
|
|
215
215
|
constructor(options) {
|
|
216
216
|
super();
|
|
217
217
|
this.url = options.url;
|
|
@@ -256,20 +256,20 @@ var SSETransport = class extends chunk7K7HZMP4_cjs.BaseTransport {
|
|
|
256
256
|
});
|
|
257
257
|
this.eventSource.onerror = (error) => {
|
|
258
258
|
if (!this.connected) {
|
|
259
|
-
reject(new
|
|
259
|
+
reject(new chunkJGPDQDY4_cjs.MCPError("SSE connection failed"));
|
|
260
260
|
} else {
|
|
261
|
-
this.emitError(new
|
|
261
|
+
this.emitError(new chunkJGPDQDY4_cjs.MCPError("SSE connection error"));
|
|
262
262
|
}
|
|
263
263
|
};
|
|
264
264
|
setTimeout(() => {
|
|
265
265
|
if (!this.connected) {
|
|
266
266
|
this.eventSource?.close();
|
|
267
|
-
reject(new
|
|
267
|
+
reject(new chunkJGPDQDY4_cjs.MCPError("SSE connection timeout"));
|
|
268
268
|
}
|
|
269
269
|
}, this.timeout);
|
|
270
270
|
} catch (error) {
|
|
271
271
|
reject(
|
|
272
|
-
error instanceof Error ? error : new
|
|
272
|
+
error instanceof Error ? error : new chunkJGPDQDY4_cjs.MCPError("Failed to create SSE connection")
|
|
273
273
|
);
|
|
274
274
|
}
|
|
275
275
|
});
|
|
@@ -292,9 +292,9 @@ var SSETransport = class extends chunk7K7HZMP4_cjs.BaseTransport {
|
|
|
292
292
|
*/
|
|
293
293
|
async send(message) {
|
|
294
294
|
if (!this.connected) {
|
|
295
|
-
throw new
|
|
295
|
+
throw new chunkJGPDQDY4_cjs.MCPError(
|
|
296
296
|
"Transport not connected",
|
|
297
|
-
|
|
297
|
+
chunkJGPDQDY4_cjs.JSON_RPC_ERROR_CODES.INTERNAL_ERROR
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
300
|
const endpoint = this.messageEndpoint || this.url;
|
|
@@ -317,9 +317,9 @@ var SSETransport = class extends chunk7K7HZMP4_cjs.BaseTransport {
|
|
|
317
317
|
});
|
|
318
318
|
clearTimeout(timeoutId);
|
|
319
319
|
if (!response.ok) {
|
|
320
|
-
throw new
|
|
320
|
+
throw new chunkJGPDQDY4_cjs.MCPError(
|
|
321
321
|
`HTTP error: ${response.status} ${response.statusText}`,
|
|
322
|
-
|
|
322
|
+
chunkJGPDQDY4_cjs.JSON_RPC_ERROR_CODES.INTERNAL_ERROR
|
|
323
323
|
);
|
|
324
324
|
}
|
|
325
325
|
const contentType = response.headers.get("content-type");
|
|
@@ -334,18 +334,18 @@ var SSETransport = class extends chunk7K7HZMP4_cjs.BaseTransport {
|
|
|
334
334
|
}
|
|
335
335
|
} catch (error) {
|
|
336
336
|
clearTimeout(timeoutId);
|
|
337
|
-
if (error instanceof
|
|
337
|
+
if (error instanceof chunkJGPDQDY4_cjs.MCPError) {
|
|
338
338
|
throw error;
|
|
339
339
|
}
|
|
340
340
|
if (error instanceof Error && error.name === "AbortError") {
|
|
341
|
-
throw new
|
|
341
|
+
throw new chunkJGPDQDY4_cjs.MCPError(
|
|
342
342
|
"Request timed out",
|
|
343
|
-
|
|
343
|
+
chunkJGPDQDY4_cjs.JSON_RPC_ERROR_CODES.INTERNAL_ERROR
|
|
344
344
|
);
|
|
345
345
|
}
|
|
346
|
-
throw new
|
|
346
|
+
throw new chunkJGPDQDY4_cjs.MCPError(
|
|
347
347
|
`Send failed: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
348
|
-
|
|
348
|
+
chunkJGPDQDY4_cjs.JSON_RPC_ERROR_CODES.INTERNAL_ERROR
|
|
349
349
|
);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
@@ -409,7 +409,7 @@ var SSETransport = class extends chunk7K7HZMP4_cjs.BaseTransport {
|
|
|
409
409
|
};
|
|
410
410
|
|
|
411
411
|
// src/mcp/transports/StdioTransport.ts
|
|
412
|
-
var StdioTransport = class extends
|
|
412
|
+
var StdioTransport = class extends chunkJGPDQDY4_cjs.BaseTransport {
|
|
413
413
|
constructor(options) {
|
|
414
414
|
super();
|
|
415
415
|
this.buffer = "";
|
|
@@ -426,9 +426,9 @@ var StdioTransport = class extends chunk7K7HZMP4_cjs.BaseTransport {
|
|
|
426
426
|
return;
|
|
427
427
|
}
|
|
428
428
|
if (typeof process === "undefined" || typeof chunkJEQ2X3Z6_cjs.__require === "undefined") {
|
|
429
|
-
throw new
|
|
429
|
+
throw new chunkJGPDQDY4_cjs.MCPError(
|
|
430
430
|
"Stdio transport is only available in Node.js environments",
|
|
431
|
-
|
|
431
|
+
chunkJGPDQDY4_cjs.JSON_RPC_ERROR_CODES.INTERNAL_ERROR
|
|
432
432
|
);
|
|
433
433
|
}
|
|
434
434
|
try {
|
|
@@ -449,9 +449,9 @@ var StdioTransport = class extends chunk7K7HZMP4_cjs.BaseTransport {
|
|
|
449
449
|
stdio: ["pipe", "pipe", "pipe"]
|
|
450
450
|
});
|
|
451
451
|
if (!this.process.stdin || !this.process.stdout) {
|
|
452
|
-
throw new
|
|
452
|
+
throw new chunkJGPDQDY4_cjs.MCPError(
|
|
453
453
|
"Failed to create stdio pipes",
|
|
454
|
-
|
|
454
|
+
chunkJGPDQDY4_cjs.JSON_RPC_ERROR_CODES.INTERNAL_ERROR
|
|
455
455
|
);
|
|
456
456
|
}
|
|
457
457
|
this.process.stdout.on("data", (data) => {
|
|
@@ -462,21 +462,21 @@ var StdioTransport = class extends chunk7K7HZMP4_cjs.BaseTransport {
|
|
|
462
462
|
});
|
|
463
463
|
this.process.on("error", (err) => {
|
|
464
464
|
const error = err;
|
|
465
|
-
this.emitError(new
|
|
465
|
+
this.emitError(new chunkJGPDQDY4_cjs.MCPError(`Process error: ${error.message}`));
|
|
466
466
|
});
|
|
467
467
|
this.process.on("exit", (...args) => {
|
|
468
468
|
const code = args[0];
|
|
469
469
|
if (this.connected) {
|
|
470
470
|
this.connected = false;
|
|
471
471
|
if (code !== 0 && code !== null) {
|
|
472
|
-
this.emitError(new
|
|
472
|
+
this.emitError(new chunkJGPDQDY4_cjs.MCPError(`Process exited with code ${code}`));
|
|
473
473
|
}
|
|
474
474
|
this.emitClose();
|
|
475
475
|
}
|
|
476
476
|
});
|
|
477
477
|
await new Promise((resolve, reject) => {
|
|
478
478
|
const timeout = setTimeout(() => {
|
|
479
|
-
reject(new
|
|
479
|
+
reject(new chunkJGPDQDY4_cjs.MCPError("Process startup timeout"));
|
|
480
480
|
}, 1e4);
|
|
481
481
|
setTimeout(() => {
|
|
482
482
|
clearTimeout(timeout);
|
|
@@ -485,9 +485,9 @@ var StdioTransport = class extends chunk7K7HZMP4_cjs.BaseTransport {
|
|
|
485
485
|
}, 100);
|
|
486
486
|
});
|
|
487
487
|
} catch (error) {
|
|
488
|
-
throw error instanceof
|
|
488
|
+
throw error instanceof chunkJGPDQDY4_cjs.MCPError ? error : new chunkJGPDQDY4_cjs.MCPError(
|
|
489
489
|
`Failed to spawn process: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
490
|
-
|
|
490
|
+
chunkJGPDQDY4_cjs.JSON_RPC_ERROR_CODES.INTERNAL_ERROR
|
|
491
491
|
);
|
|
492
492
|
}
|
|
493
493
|
}
|
|
@@ -508,9 +508,9 @@ var StdioTransport = class extends chunk7K7HZMP4_cjs.BaseTransport {
|
|
|
508
508
|
*/
|
|
509
509
|
async send(message) {
|
|
510
510
|
if (!this.connected || !this.process?.stdin) {
|
|
511
|
-
throw new
|
|
511
|
+
throw new chunkJGPDQDY4_cjs.MCPError(
|
|
512
512
|
"Transport not connected",
|
|
513
|
-
|
|
513
|
+
chunkJGPDQDY4_cjs.JSON_RPC_ERROR_CODES.INTERNAL_ERROR
|
|
514
514
|
);
|
|
515
515
|
}
|
|
516
516
|
const data = JSON.stringify(message) + "\n";
|
|
@@ -519,9 +519,9 @@ var StdioTransport = class extends chunk7K7HZMP4_cjs.BaseTransport {
|
|
|
519
519
|
stdin.write(data, (error) => {
|
|
520
520
|
if (error) {
|
|
521
521
|
reject(
|
|
522
|
-
new
|
|
522
|
+
new chunkJGPDQDY4_cjs.MCPError(
|
|
523
523
|
`Write error: ${error.message}`,
|
|
524
|
-
|
|
524
|
+
chunkJGPDQDY4_cjs.JSON_RPC_ERROR_CODES.INTERNAL_ERROR
|
|
525
525
|
)
|
|
526
526
|
);
|
|
527
527
|
} else {
|
|
@@ -596,71 +596,71 @@ Object.defineProperty(exports, "parseMCPUIMessage", {
|
|
|
596
596
|
});
|
|
597
597
|
Object.defineProperty(exports, "BaseTransport", {
|
|
598
598
|
enumerable: true,
|
|
599
|
-
get: function () { return
|
|
599
|
+
get: function () { return chunkJGPDQDY4_cjs.BaseTransport; }
|
|
600
600
|
});
|
|
601
601
|
Object.defineProperty(exports, "DEFAULT_CLIENT_CAPABILITIES", {
|
|
602
602
|
enumerable: true,
|
|
603
|
-
get: function () { return
|
|
603
|
+
get: function () { return chunkJGPDQDY4_cjs.DEFAULT_CLIENT_CAPABILITIES; }
|
|
604
604
|
});
|
|
605
605
|
Object.defineProperty(exports, "DEFAULT_CLIENT_INFO", {
|
|
606
606
|
enumerable: true,
|
|
607
|
-
get: function () { return
|
|
607
|
+
get: function () { return chunkJGPDQDY4_cjs.DEFAULT_CLIENT_INFO; }
|
|
608
608
|
});
|
|
609
609
|
Object.defineProperty(exports, "HttpTransport", {
|
|
610
610
|
enumerable: true,
|
|
611
|
-
get: function () { return
|
|
611
|
+
get: function () { return chunkJGPDQDY4_cjs.HttpTransport; }
|
|
612
612
|
});
|
|
613
613
|
Object.defineProperty(exports, "JSON_RPC_ERROR_CODES", {
|
|
614
614
|
enumerable: true,
|
|
615
|
-
get: function () { return
|
|
615
|
+
get: function () { return chunkJGPDQDY4_cjs.JSON_RPC_ERROR_CODES; }
|
|
616
616
|
});
|
|
617
617
|
Object.defineProperty(exports, "JsonRpcHandler", {
|
|
618
618
|
enumerable: true,
|
|
619
|
-
get: function () { return
|
|
619
|
+
get: function () { return chunkJGPDQDY4_cjs.JsonRpcHandler; }
|
|
620
620
|
});
|
|
621
621
|
Object.defineProperty(exports, "MCPClient", {
|
|
622
622
|
enumerable: true,
|
|
623
|
-
get: function () { return
|
|
623
|
+
get: function () { return chunkJGPDQDY4_cjs.MCPClient; }
|
|
624
624
|
});
|
|
625
625
|
Object.defineProperty(exports, "MCPError", {
|
|
626
626
|
enumerable: true,
|
|
627
|
-
get: function () { return
|
|
627
|
+
get: function () { return chunkJGPDQDY4_cjs.MCPError; }
|
|
628
628
|
});
|
|
629
629
|
Object.defineProperty(exports, "MCPToolAdapter", {
|
|
630
630
|
enumerable: true,
|
|
631
|
-
get: function () { return
|
|
631
|
+
get: function () { return chunkJGPDQDY4_cjs.MCPToolAdapter; }
|
|
632
632
|
});
|
|
633
633
|
Object.defineProperty(exports, "MCP_METHODS", {
|
|
634
634
|
enumerable: true,
|
|
635
|
-
get: function () { return
|
|
635
|
+
get: function () { return chunkJGPDQDY4_cjs.MCP_METHODS; }
|
|
636
636
|
});
|
|
637
637
|
Object.defineProperty(exports, "MCP_PROTOCOL_VERSION", {
|
|
638
638
|
enumerable: true,
|
|
639
|
-
get: function () { return
|
|
639
|
+
get: function () { return chunkJGPDQDY4_cjs.MCP_PROTOCOL_VERSION; }
|
|
640
640
|
});
|
|
641
641
|
Object.defineProperty(exports, "createInitializeParams", {
|
|
642
642
|
enumerable: true,
|
|
643
|
-
get: function () { return
|
|
643
|
+
get: function () { return chunkJGPDQDY4_cjs.createInitializeParams; }
|
|
644
644
|
});
|
|
645
645
|
Object.defineProperty(exports, "createMCPClient", {
|
|
646
646
|
enumerable: true,
|
|
647
|
-
get: function () { return
|
|
647
|
+
get: function () { return chunkJGPDQDY4_cjs.createMCPClient; }
|
|
648
648
|
});
|
|
649
649
|
Object.defineProperty(exports, "createToolCallParams", {
|
|
650
650
|
enumerable: true,
|
|
651
|
-
get: function () { return
|
|
651
|
+
get: function () { return chunkJGPDQDY4_cjs.createToolCallParams; }
|
|
652
652
|
});
|
|
653
653
|
Object.defineProperty(exports, "createToolsListParams", {
|
|
654
654
|
enumerable: true,
|
|
655
|
-
get: function () { return
|
|
655
|
+
get: function () { return chunkJGPDQDY4_cjs.createToolsListParams; }
|
|
656
656
|
});
|
|
657
657
|
Object.defineProperty(exports, "mcpToolToDefinition", {
|
|
658
658
|
enumerable: true,
|
|
659
|
-
get: function () { return
|
|
659
|
+
get: function () { return chunkJGPDQDY4_cjs.mcpToolToDefinition; }
|
|
660
660
|
});
|
|
661
661
|
Object.defineProperty(exports, "mcpToolsToDefinitions", {
|
|
662
662
|
enumerable: true,
|
|
663
|
-
get: function () { return
|
|
663
|
+
get: function () { return chunkJGPDQDY4_cjs.mcpToolsToDefinitions; }
|
|
664
664
|
});
|
|
665
665
|
exports.MCPClientManager = MCPClientManager;
|
|
666
666
|
exports.SSETransport = SSETransport;
|
package/dist/mcp/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MCPClientConfig, a as MCPClientEvents, b as MCPClientState, c as MCPToolCallResult, d as MCPToolDefinition, e as MCPServerInfo, f as MCPServerCapabilities, g as MCPConnectionState, J as JsonRpcRequest, h as JsonRpcNotification, i as JsonRpcMessage, j as JsonRpcResponse, k as MCPClientInfo, l as MCPClientCapabilities, m as MCPInitializeParams, n as MCPToolCallParams } from '../types-
|
|
2
|
-
export {
|
|
3
|
-
import { T as ToolDefinition } from '../tools-
|
|
1
|
+
import { M as MCPClientConfig, a as MCPClientEvents, b as MCPClientState, c as MCPToolCallResult, d as MCPToolDefinition, e as MCPServerInfo, f as MCPServerCapabilities, g as MCPConnectionState, J as JsonRpcRequest, h as JsonRpcNotification, i as JsonRpcMessage, j as JsonRpcResponse, k as MCPClientInfo, l as MCPClientCapabilities, m as MCPInitializeParams, n as MCPToolCallParams } from '../types-DM6M_pv_.cjs';
|
|
2
|
+
export { K as JSON_RPC_ERROR_CODES, t as JsonRpcError, C as MCPElicitationOption, A as MCPElicitationRequest, B as MCPElicitationResponse, H as MCPError, q as MCPHttpTransportConfig, x as MCPImageContent, y as MCPResourceContent, r as MCPSSETransportConfig, G as MCPServerConfig, s as MCPStdioTransportConfig, w as MCPTextContent, u as MCPToolInputSchema, v as MCPToolResultContent, p as MCPTransportConfig, o as MCPTransportType, z as MCPUIContent, I as MCP_PROTOCOL_VERSION, U as UseMCPClientConfig, D as UseMCPClientReturn, E as UseMCPToolsConfig, F as UseMCPToolsReturn } from '../types-DM6M_pv_.cjs';
|
|
3
|
+
import { T as ToolDefinition } from '../tools-Clyufshc.cjs';
|
|
4
4
|
export { D as DEFAULT_MCP_UI_SANDBOX, f as MCPUIActionIntent, n as MCPUIFrameProps, d as MCPUIIntent, l as MCPUIIntentContext, k as MCPUIIntentHandler, i as MCPUILinkIntent, j as MCPUIMessage, h as MCPUINotifyIntent, g as MCPUIPromptIntent, M as MCPUIResource, a as MCPUIResourceContent, c as MCPUIResourceMetadata, b as MCPUIResourceMimeType, e as MCPUIToolIntent, R as RESTRICTED_MCP_UI_SANDBOX, U as UseMCPUIIntentsConfig, m as UseMCPUIIntentsReturn, p as isMCPUIIntent, q as isMCPUIMessage, o as isMCPUIResourceContent, r as parseMCPUIMessage } from '../types-B20VCJXL.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -729,6 +729,16 @@ interface MCPToolAdapterOptions {
|
|
|
729
729
|
asServerTool?: boolean;
|
|
730
730
|
/** Function to call the MCP tool */
|
|
731
731
|
callTool: (name: string, args?: Record<string, unknown>) => Promise<MCPToolCallResult>;
|
|
732
|
+
/**
|
|
733
|
+
* Hide all tools from this MCP server in the chat UI.
|
|
734
|
+
* @default false
|
|
735
|
+
*/
|
|
736
|
+
hidden?: boolean;
|
|
737
|
+
/**
|
|
738
|
+
* Source label for tools from this MCP server.
|
|
739
|
+
* @default "mcp"
|
|
740
|
+
*/
|
|
741
|
+
source?: "mcp" | "native" | "custom";
|
|
732
742
|
}
|
|
733
743
|
/**
|
|
734
744
|
* MCP Tool Adapter
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MCPClientConfig, a as MCPClientEvents, b as MCPClientState, c as MCPToolCallResult, d as MCPToolDefinition, e as MCPServerInfo, f as MCPServerCapabilities, g as MCPConnectionState, J as JsonRpcRequest, h as JsonRpcNotification, i as JsonRpcMessage, j as JsonRpcResponse, k as MCPClientInfo, l as MCPClientCapabilities, m as MCPInitializeParams, n as MCPToolCallParams } from '../types-
|
|
2
|
-
export {
|
|
3
|
-
import { T as ToolDefinition } from '../tools-
|
|
1
|
+
import { M as MCPClientConfig, a as MCPClientEvents, b as MCPClientState, c as MCPToolCallResult, d as MCPToolDefinition, e as MCPServerInfo, f as MCPServerCapabilities, g as MCPConnectionState, J as JsonRpcRequest, h as JsonRpcNotification, i as JsonRpcMessage, j as JsonRpcResponse, k as MCPClientInfo, l as MCPClientCapabilities, m as MCPInitializeParams, n as MCPToolCallParams } from '../types-wudOhedT.js';
|
|
2
|
+
export { K as JSON_RPC_ERROR_CODES, t as JsonRpcError, C as MCPElicitationOption, A as MCPElicitationRequest, B as MCPElicitationResponse, H as MCPError, q as MCPHttpTransportConfig, x as MCPImageContent, y as MCPResourceContent, r as MCPSSETransportConfig, G as MCPServerConfig, s as MCPStdioTransportConfig, w as MCPTextContent, u as MCPToolInputSchema, v as MCPToolResultContent, p as MCPTransportConfig, o as MCPTransportType, z as MCPUIContent, I as MCP_PROTOCOL_VERSION, U as UseMCPClientConfig, D as UseMCPClientReturn, E as UseMCPToolsConfig, F as UseMCPToolsReturn } from '../types-wudOhedT.js';
|
|
3
|
+
import { T as ToolDefinition } from '../tools-Clyufshc.js';
|
|
4
4
|
export { D as DEFAULT_MCP_UI_SANDBOX, f as MCPUIActionIntent, n as MCPUIFrameProps, d as MCPUIIntent, l as MCPUIIntentContext, k as MCPUIIntentHandler, i as MCPUILinkIntent, j as MCPUIMessage, h as MCPUINotifyIntent, g as MCPUIPromptIntent, M as MCPUIResource, a as MCPUIResourceContent, c as MCPUIResourceMetadata, b as MCPUIResourceMimeType, e as MCPUIToolIntent, R as RESTRICTED_MCP_UI_SANDBOX, U as UseMCPUIIntentsConfig, m as UseMCPUIIntentsReturn, p as isMCPUIIntent, q as isMCPUIMessage, o as isMCPUIResourceContent, r as parseMCPUIMessage } from '../types-B20VCJXL.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -729,6 +729,16 @@ interface MCPToolAdapterOptions {
|
|
|
729
729
|
asServerTool?: boolean;
|
|
730
730
|
/** Function to call the MCP tool */
|
|
731
731
|
callTool: (name: string, args?: Record<string, unknown>) => Promise<MCPToolCallResult>;
|
|
732
|
+
/**
|
|
733
|
+
* Hide all tools from this MCP server in the chat UI.
|
|
734
|
+
* @default false
|
|
735
|
+
*/
|
|
736
|
+
hidden?: boolean;
|
|
737
|
+
/**
|
|
738
|
+
* Source label for tools from this MCP server.
|
|
739
|
+
* @default "mcp"
|
|
740
|
+
*/
|
|
741
|
+
source?: "mcp" | "native" | "custom";
|
|
732
742
|
}
|
|
733
743
|
/**
|
|
734
744
|
* MCP Tool Adapter
|
package/dist/mcp/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DEFAULT_MCP_UI_SANDBOX, RESTRICTED_MCP_UI_SANDBOX, isMCPUIIntent, isMCPUIMessage, isMCPUIResourceContent, parseMCPUIMessage } from '../chunk-G4SF2PNQ.js';
|
|
2
|
-
import { createMCPClient, BaseTransport, MCPError, JSON_RPC_ERROR_CODES } from '../chunk-
|
|
3
|
-
export { BaseTransport, DEFAULT_CLIENT_CAPABILITIES, DEFAULT_CLIENT_INFO, HttpTransport, JSON_RPC_ERROR_CODES, JsonRpcHandler, MCPClient, MCPError, MCPToolAdapter, MCP_METHODS, MCP_PROTOCOL_VERSION, createInitializeParams, createMCPClient, createToolCallParams, createToolsListParams, mcpToolToDefinition, mcpToolsToDefinitions } from '../chunk-
|
|
2
|
+
import { createMCPClient, BaseTransport, MCPError, JSON_RPC_ERROR_CODES } from '../chunk-EWVQWTNV.js';
|
|
3
|
+
export { BaseTransport, DEFAULT_CLIENT_CAPABILITIES, DEFAULT_CLIENT_INFO, HttpTransport, JSON_RPC_ERROR_CODES, JsonRpcHandler, MCPClient, MCPError, MCPToolAdapter, MCP_METHODS, MCP_PROTOCOL_VERSION, createInitializeParams, createMCPClient, createToolCallParams, createToolsListParams, mcpToolToDefinition, mcpToolsToDefinitions } from '../chunk-EWVQWTNV.js';
|
|
4
4
|
import { __require } from '../chunk-DGUM43GV.js';
|
|
5
5
|
|
|
6
6
|
// src/mcp/client/MCPClientManager.ts
|
package/dist/react/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-
|
|
3
|
+
var chunkMUZ2RYS2_cjs = require('../chunk-MUZ2RYS2.cjs');
|
|
4
|
+
var chunk33JSFVGH_cjs = require('../chunk-33JSFVGH.cjs');
|
|
5
|
+
require('../chunk-JGPDQDY4.cjs');
|
|
6
|
+
require('../chunk-O33I4HBL.cjs');
|
|
7
|
+
require('../chunk-HNRFRNMY.cjs');
|
|
8
8
|
require('../chunk-ASV6JLYG.cjs');
|
|
9
9
|
require('../chunk-CBAHCI4R.cjs');
|
|
10
10
|
require('../chunk-MEBXW75C.cjs');
|
|
@@ -20,183 +20,183 @@ require('../chunk-JEQ2X3Z6.cjs');
|
|
|
20
20
|
|
|
21
21
|
Object.defineProperty(exports, "AbstractAgentLoop", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkMUZ2RYS2_cjs.AbstractAgentLoop; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "AbstractChat", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkMUZ2RYS2_cjs.AbstractChat; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "CopilotProvider", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkMUZ2RYS2_cjs.CopilotProvider; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "ReactChat", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkMUZ2RYS2_cjs.ReactChat; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "ReactChatState", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkMUZ2RYS2_cjs.ReactChatState; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "ReactThreadManager", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkMUZ2RYS2_cjs.ReactThreadManager; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "ReactThreadManagerState", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkMUZ2RYS2_cjs.ReactThreadManagerState; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "createMessageIntentHandler", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkMUZ2RYS2_cjs.createMessageIntentHandler; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "createPermissionStorage", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkMUZ2RYS2_cjs.createPermissionStorage; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "createReactChat", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkMUZ2RYS2_cjs.createReactChat; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "createReactChatState", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkMUZ2RYS2_cjs.createReactChatState; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "createReactThreadManager", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkMUZ2RYS2_cjs.createReactThreadManager; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "createReactThreadManagerState", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkMUZ2RYS2_cjs.createReactThreadManagerState; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "createSessionPermissionCache", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunkMUZ2RYS2_cjs.createSessionPermissionCache; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "createToolIntentHandler", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunkMUZ2RYS2_cjs.createToolIntentHandler; }
|
|
80
80
|
});
|
|
81
81
|
Object.defineProperty(exports, "formatKnowledgeResultsForAI", {
|
|
82
82
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunkMUZ2RYS2_cjs.formatKnowledgeResultsForAI; }
|
|
84
84
|
});
|
|
85
85
|
Object.defineProperty(exports, "initialAgentLoopState", {
|
|
86
86
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
87
|
+
get: function () { return chunkMUZ2RYS2_cjs.initialAgentLoopState; }
|
|
88
88
|
});
|
|
89
89
|
Object.defineProperty(exports, "searchKnowledgeBase", {
|
|
90
90
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
91
|
+
get: function () { return chunkMUZ2RYS2_cjs.searchKnowledgeBase; }
|
|
92
92
|
});
|
|
93
93
|
Object.defineProperty(exports, "useAIAction", {
|
|
94
94
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
95
|
+
get: function () { return chunkMUZ2RYS2_cjs.useAIAction; }
|
|
96
96
|
});
|
|
97
97
|
Object.defineProperty(exports, "useAIActions", {
|
|
98
98
|
enumerable: true,
|
|
99
|
-
get: function () { return
|
|
99
|
+
get: function () { return chunkMUZ2RYS2_cjs.useAIActions; }
|
|
100
100
|
});
|
|
101
101
|
Object.defineProperty(exports, "useAIContext", {
|
|
102
102
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
103
|
+
get: function () { return chunkMUZ2RYS2_cjs.useAIContext; }
|
|
104
104
|
});
|
|
105
105
|
Object.defineProperty(exports, "useAIContexts", {
|
|
106
106
|
enumerable: true,
|
|
107
|
-
get: function () { return
|
|
107
|
+
get: function () { return chunkMUZ2RYS2_cjs.useAIContexts; }
|
|
108
108
|
});
|
|
109
109
|
Object.defineProperty(exports, "useAITools", {
|
|
110
110
|
enumerable: true,
|
|
111
|
-
get: function () { return
|
|
111
|
+
get: function () { return chunkMUZ2RYS2_cjs.useAITools; }
|
|
112
112
|
});
|
|
113
113
|
Object.defineProperty(exports, "useAgent", {
|
|
114
114
|
enumerable: true,
|
|
115
|
-
get: function () { return
|
|
115
|
+
get: function () { return chunkMUZ2RYS2_cjs.useAgent; }
|
|
116
116
|
});
|
|
117
117
|
Object.defineProperty(exports, "useCapabilities", {
|
|
118
118
|
enumerable: true,
|
|
119
|
-
get: function () { return
|
|
119
|
+
get: function () { return chunkMUZ2RYS2_cjs.useCapabilities; }
|
|
120
120
|
});
|
|
121
121
|
Object.defineProperty(exports, "useChat", {
|
|
122
122
|
enumerable: true,
|
|
123
|
-
get: function () { return
|
|
123
|
+
get: function () { return chunkMUZ2RYS2_cjs.useChat; }
|
|
124
124
|
});
|
|
125
125
|
Object.defineProperty(exports, "useCopilot", {
|
|
126
126
|
enumerable: true,
|
|
127
|
-
get: function () { return
|
|
127
|
+
get: function () { return chunkMUZ2RYS2_cjs.useCopilot; }
|
|
128
128
|
});
|
|
129
129
|
Object.defineProperty(exports, "useDevLogger", {
|
|
130
130
|
enumerable: true,
|
|
131
|
-
get: function () { return
|
|
131
|
+
get: function () { return chunkMUZ2RYS2_cjs.useDevLogger; }
|
|
132
132
|
});
|
|
133
133
|
Object.defineProperty(exports, "useFeatureSupport", {
|
|
134
134
|
enumerable: true,
|
|
135
|
-
get: function () { return
|
|
135
|
+
get: function () { return chunkMUZ2RYS2_cjs.useFeatureSupport; }
|
|
136
136
|
});
|
|
137
137
|
Object.defineProperty(exports, "useKnowledgeBase", {
|
|
138
138
|
enumerable: true,
|
|
139
|
-
get: function () { return
|
|
139
|
+
get: function () { return chunkMUZ2RYS2_cjs.useKnowledgeBase; }
|
|
140
140
|
});
|
|
141
141
|
Object.defineProperty(exports, "useMCPClient", {
|
|
142
142
|
enumerable: true,
|
|
143
|
-
get: function () { return
|
|
143
|
+
get: function () { return chunkMUZ2RYS2_cjs.useMCPClient; }
|
|
144
144
|
});
|
|
145
145
|
Object.defineProperty(exports, "useMCPTools", {
|
|
146
146
|
enumerable: true,
|
|
147
|
-
get: function () { return
|
|
147
|
+
get: function () { return chunkMUZ2RYS2_cjs.useMCPTools; }
|
|
148
148
|
});
|
|
149
149
|
Object.defineProperty(exports, "useMCPUIIntents", {
|
|
150
150
|
enumerable: true,
|
|
151
|
-
get: function () { return
|
|
151
|
+
get: function () { return chunkMUZ2RYS2_cjs.useMCPUIIntents; }
|
|
152
152
|
});
|
|
153
153
|
Object.defineProperty(exports, "useSuggestions", {
|
|
154
154
|
enumerable: true,
|
|
155
|
-
get: function () { return
|
|
155
|
+
get: function () { return chunkMUZ2RYS2_cjs.useSuggestions; }
|
|
156
156
|
});
|
|
157
157
|
Object.defineProperty(exports, "useSupportedMediaTypes", {
|
|
158
158
|
enumerable: true,
|
|
159
|
-
get: function () { return
|
|
159
|
+
get: function () { return chunkMUZ2RYS2_cjs.useSupportedMediaTypes; }
|
|
160
160
|
});
|
|
161
161
|
Object.defineProperty(exports, "useThreadManager", {
|
|
162
162
|
enumerable: true,
|
|
163
|
-
get: function () { return
|
|
163
|
+
get: function () { return chunkMUZ2RYS2_cjs.useThreadManager; }
|
|
164
164
|
});
|
|
165
165
|
Object.defineProperty(exports, "useTool", {
|
|
166
166
|
enumerable: true,
|
|
167
|
-
get: function () { return
|
|
167
|
+
get: function () { return chunkMUZ2RYS2_cjs.useTool; }
|
|
168
168
|
});
|
|
169
169
|
Object.defineProperty(exports, "useToolExecutor", {
|
|
170
170
|
enumerable: true,
|
|
171
|
-
get: function () { return
|
|
171
|
+
get: function () { return chunkMUZ2RYS2_cjs.useToolExecutor; }
|
|
172
172
|
});
|
|
173
173
|
Object.defineProperty(exports, "useToolWithSchema", {
|
|
174
174
|
enumerable: true,
|
|
175
|
-
get: function () { return
|
|
175
|
+
get: function () { return chunkMUZ2RYS2_cjs.useToolWithSchema; }
|
|
176
176
|
});
|
|
177
177
|
Object.defineProperty(exports, "useTools", {
|
|
178
178
|
enumerable: true,
|
|
179
|
-
get: function () { return
|
|
179
|
+
get: function () { return chunkMUZ2RYS2_cjs.useTools; }
|
|
180
180
|
});
|
|
181
181
|
Object.defineProperty(exports, "useToolsWithSchema", {
|
|
182
182
|
enumerable: true,
|
|
183
|
-
get: function () { return
|
|
183
|
+
get: function () { return chunkMUZ2RYS2_cjs.useToolsWithSchema; }
|
|
184
184
|
});
|
|
185
185
|
Object.defineProperty(exports, "createLocalStorageAdapter", {
|
|
186
186
|
enumerable: true,
|
|
187
|
-
get: function () { return
|
|
187
|
+
get: function () { return chunk33JSFVGH_cjs.createLocalStorageAdapter; }
|
|
188
188
|
});
|
|
189
189
|
Object.defineProperty(exports, "createMemoryAdapter", {
|
|
190
190
|
enumerable: true,
|
|
191
|
-
get: function () { return
|
|
191
|
+
get: function () { return chunk33JSFVGH_cjs.createMemoryAdapter; }
|
|
192
192
|
});
|
|
193
193
|
Object.defineProperty(exports, "createServerAdapter", {
|
|
194
194
|
enumerable: true,
|
|
195
|
-
get: function () { return
|
|
195
|
+
get: function () { return chunk33JSFVGH_cjs.createServerAdapter; }
|
|
196
196
|
});
|
|
197
197
|
Object.defineProperty(exports, "generateSuggestionReason", {
|
|
198
198
|
enumerable: true,
|
|
199
|
-
get: function () { return
|
|
199
|
+
get: function () { return chunk33JSFVGH_cjs.generateSuggestionReason; }
|
|
200
200
|
});
|
|
201
201
|
//# sourceMappingURL=index.cjs.map
|
|
202
202
|
//# sourceMappingURL=index.cjs.map
|
package/dist/react/index.d.cts
CHANGED
|
@@ -2,12 +2,12 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { L as LLMConfig, l as ToolsConfig, s as ActionDefinition, o as CapturedContext, m as ToolConsentRequest, T as ToolType, n as ToolConsentResponse, S as ScreenshotOptions, C as ConsoleLogOptions, N as NetworkRequestOptions, I as IntentDetectionResult, y as InternalKnowledgeBaseConfig, B as InternalKnowledgeBaseSearchResponse, z as InternalKnowledgeBaseResult, Y as ThreadManagerState, Z as LoadStatus, U as ThreadManagerConfig, F as ThreadManager, V as ThreadManagerCallbacks, W as CreateThreadOptions, X as UpdateThreadOptions } from '../ThreadManager-LfFRhr4e.cjs';
|
|
4
4
|
export { A as ActionParameter, q as CloudConfig, r as CopilotConfig, _ as LocalStorageAdapterConfig, J as createLocalStorageAdapter, O as createMemoryAdapter, i as generateSuggestionReason } from '../ThreadManager-LfFRhr4e.cjs';
|
|
5
|
-
import { T as ToolDefinition, P as PermissionLevel, c as ToolInputSchema,
|
|
6
|
-
export {
|
|
5
|
+
import { T as ToolDefinition, f as ToolSource, P as PermissionLevel, c as ToolInputSchema, l as ToolExecution$1, e as ToolContext, b as ToolResponse$1, g as ToolRenderProps, i as ToolSet, U as UnifiedToolCall, r as PermissionStorageConfig, s as PermissionStorageAdapter } from '../tools-Clyufshc.cjs';
|
|
6
|
+
export { m as AgentLoopConfig, a as ToolExecutionStatus, q as ToolPermission } from '../tools-Clyufshc.cjs';
|
|
7
7
|
import { A as AsyncThreadStorageAdapter, c as MessageAttachment, f as ToolCall, S as Source, M as Message, T as Thread, a as ThreadData, b as ThreadStorageAdapter } from '../types-DG2ya08y.cjs';
|
|
8
8
|
export { P as PersistenceConfig, h as ThreadStorageAdapter } from '../types-DG2ya08y.cjs';
|
|
9
|
-
import { U as UseMCPClientConfig, D as UseMCPClientReturn, E as UseMCPToolsConfig, F as UseMCPToolsReturn } from '../types-
|
|
10
|
-
export { b as MCPClientState } from '../types-
|
|
9
|
+
import { G as MCPServerConfig, U as UseMCPClientConfig, D as UseMCPClientReturn, E as UseMCPToolsConfig, F as UseMCPToolsReturn } from '../types-DM6M_pv_.cjs';
|
|
10
|
+
export { b as MCPClientState } from '../types-DM6M_pv_.cjs';
|
|
11
11
|
import { U as UseMCPUIIntentsConfig, m as UseMCPUIIntentsReturn } from '../types-B20VCJXL.cjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -447,6 +447,11 @@ interface ToolExecution {
|
|
|
447
447
|
args: Record<string, unknown>;
|
|
448
448
|
status: ToolExecutionStatus;
|
|
449
449
|
approvalStatus: ToolApprovalStatus;
|
|
450
|
+
/**
|
|
451
|
+
* Source/origin of the tool.
|
|
452
|
+
* Used to distinguish MCP tools from native/custom tools for UI rendering.
|
|
453
|
+
*/
|
|
454
|
+
source?: ToolSource;
|
|
450
455
|
result?: unknown;
|
|
451
456
|
error?: string;
|
|
452
457
|
startedAt?: Date;
|
|
@@ -889,6 +894,8 @@ interface CopilotProviderProps {
|
|
|
889
894
|
maxIterations?: number;
|
|
890
895
|
/** Custom message when max iterations reached (sent to AI as tool result) */
|
|
891
896
|
maxIterationsMessage?: string;
|
|
897
|
+
/** MCP servers to connect to automatically */
|
|
898
|
+
mcpServers?: MCPServerConfig[];
|
|
892
899
|
}
|
|
893
900
|
interface CopilotContextValue {
|
|
894
901
|
messages: UIMessage[];
|
|
@@ -918,7 +925,7 @@ interface CopilotContextValue {
|
|
|
918
925
|
toolsConfig?: ToolsConfig;
|
|
919
926
|
}
|
|
920
927
|
declare function useCopilot(): CopilotContextValue;
|
|
921
|
-
declare function CopilotProvider({ children, runtimeUrl, systemPrompt, tools: toolsConfig, threadId, initialMessages, onMessagesChange, onError, streaming, headers, debug, maxIterations, maxIterationsMessage, }: CopilotProviderProps): react_jsx_runtime.JSX.Element;
|
|
928
|
+
declare function CopilotProvider({ children, runtimeUrl, systemPrompt, tools: toolsConfig, threadId, initialMessages, onMessagesChange, onError, streaming, headers, debug, maxIterations, maxIterationsMessage, mcpServers, }: CopilotProviderProps): react_jsx_runtime.JSX.Element;
|
|
922
929
|
|
|
923
930
|
/**
|
|
924
931
|
* Chat UI state interface (UI-only state, not message data)
|
|
@@ -1241,6 +1248,12 @@ interface UseToolConfig<TParams = Record<string, unknown>> {
|
|
|
1241
1248
|
needsApproval?: boolean;
|
|
1242
1249
|
/** Custom approval message (can be string or function that receives params) */
|
|
1243
1250
|
approvalMessage?: string | ((params: TParams) => string);
|
|
1251
|
+
/**
|
|
1252
|
+
* Hide this tool from the chat UI.
|
|
1253
|
+
* Tool will still execute, but won't show in tool execution display.
|
|
1254
|
+
* @default false
|
|
1255
|
+
*/
|
|
1256
|
+
hidden?: boolean;
|
|
1244
1257
|
}
|
|
1245
1258
|
/**
|
|
1246
1259
|
* Register a client-side tool
|