@opentiny/next-sdk 0.1.13 → 0.1.14-alpha.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.
Files changed (62) hide show
  1. package/agent/AgentModelProvider.ts +49 -20
  2. package/agent/type.ts +4 -4
  3. package/dist/McpSdk.d.ts +14 -0
  4. package/dist/WebAgent.d.ts +5 -0
  5. package/dist/WebMcp.d.ts +20 -0
  6. package/dist/WebMcpClient.d.ts +250 -1488
  7. package/dist/WebMcpServer.d.ts +190 -78
  8. package/dist/Zod.d.ts +1 -0
  9. package/dist/agent/AgentModelProvider.d.ts +6 -4
  10. package/dist/agent/type.d.ts +6 -2
  11. package/dist/agent/utils/getAISDKTools.d.ts +1 -0
  12. package/dist/index.d.ts +2 -1
  13. package/dist/index.es.dev.js +23743 -25868
  14. package/dist/index.es.js +24524 -24312
  15. package/dist/index.js +1789 -25
  16. package/dist/index.umd.dev.js +23845 -25970
  17. package/dist/index.umd.js +185 -129
  18. package/dist/{mcpsdk@1.20.1.dev.js → mcpsdk@1.23.0.dev.js} +13535 -14184
  19. package/dist/{mcpsdk@1.20.1.es.dev.js → mcpsdk@1.23.0.es.dev.js} +13563 -14212
  20. package/dist/mcpsdk@1.23.0.es.js +15584 -0
  21. package/dist/mcpsdk@1.23.0.js +43 -0
  22. package/dist/remoter/createRemoter.d.ts +9 -0
  23. package/dist/remoter/tooltips.d.ts +36 -0
  24. package/dist/script/utils.d.ts +1 -0
  25. package/dist/transport/ExtensionClientTransport.d.ts +3 -2
  26. package/dist/transport/ExtensionContentServerTransport.d.ts +3 -2
  27. package/dist/transport/ExtensionPageServerTransport.d.ts +3 -2
  28. package/dist/vite-build-tsc.d.ts +2 -0
  29. package/dist/vite.config.d.ts +2 -0
  30. package/dist/vite.config.mcpSdk.d.ts +2 -0
  31. package/dist/vite.config.webAgent.d.ts +2 -0
  32. package/dist/vite.config.webMcp.d.ts +2 -0
  33. package/dist/vite.config.webMcpFull.d.ts +2 -0
  34. package/dist/vite.config.zod.d.ts +2 -0
  35. package/dist/webagent.dev.js +18803 -18836
  36. package/dist/webagent.es.dev.js +17726 -17759
  37. package/dist/webagent.es.js +22571 -20829
  38. package/dist/webagent.js +172 -109
  39. package/dist/webmcp-full.dev.js +14463 -15009
  40. package/dist/webmcp-full.es.dev.js +14471 -15017
  41. package/dist/webmcp-full.es.js +13391 -12365
  42. package/dist/webmcp-full.js +43 -16
  43. package/package.json +3 -2
  44. package/remoter/createRemoter.ts +126 -71
  45. package/remoter/tooltips.ts +260 -0
  46. package/tsconfig.json +5 -3
  47. package/vite-build-tsc.ts +60 -0
  48. package/vite-env.d.ts +5 -0
  49. package/dist/WebMcpClient.js +0 -363
  50. package/dist/WebMcpServer.js +0 -283
  51. package/dist/agent/AgentModelProvider.js +0 -293
  52. package/dist/agent/type.js +0 -1
  53. package/dist/agent/utils/getAISDKTools.js +0 -36
  54. package/dist/mcpsdk@1.20.1.es.js +0 -14600
  55. package/dist/mcpsdk@1.20.1.js +0 -16
  56. package/dist/remoter/QrCode.js +0 -55
  57. package/dist/remoter/createRemoter.js +0 -743
  58. package/dist/transport/ExtensionClientTransport.js +0 -81
  59. package/dist/transport/ExtensionContentServerTransport.js +0 -128
  60. package/dist/transport/ExtensionPageServerTransport.js +0 -118
  61. package/dist/transport/messages.js +0 -51
  62. package/dist/utils/uuid.js +0 -10
@@ -1,55 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import QRCodePck from 'qrcode';
11
- /**
12
- * 二维码工具类,根据传入的value,生成相应的二维码,并输出到 <canvas> 或 <img>上。
13
- * @example
14
- * const qr= new QrCode('https://www.baidu.com', { size: 100 })
15
- *
16
- * qr.toCanvas(canvasDom)
17
- * qr.toImage(imgDom)
18
- */
19
- export class QrCode {
20
- constructor(value, { size = 200, margin = 4, color = '#000', bgColor = '#fff' }) {
21
- this.value = value;
22
- this.size = size;
23
- this.margin = margin;
24
- this.color = color;
25
- this.bgColor = bgColor;
26
- }
27
- get qrCodeOption() {
28
- return {
29
- width: this.size,
30
- margin: this.margin,
31
- color: {
32
- dark: this.color, // 前景色
33
- light: this.bgColor // 背景色
34
- }
35
- };
36
- }
37
- /** 生成二维码的 Data URL(base64 图片) */
38
- toDataURL() {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- return QRCodePck.toDataURL(this.value, this.qrCodeOption);
41
- });
42
- }
43
- /** 渲染二维码到指定的 canvas 元素 */
44
- toCanvas(canvas) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- return QRCodePck.toCanvas(canvas, this.value, this.qrCodeOption);
47
- });
48
- }
49
- /** 渲染二维码到指定的 img 元素 */
50
- toImage(img) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- img.src = yield this.toDataURL();
53
- });
54
- }
55
- }