@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.
- package/agent/AgentModelProvider.ts +49 -20
- package/agent/type.ts +4 -4
- package/dist/McpSdk.d.ts +14 -0
- package/dist/WebAgent.d.ts +5 -0
- package/dist/WebMcp.d.ts +20 -0
- package/dist/WebMcpClient.d.ts +250 -1488
- package/dist/WebMcpServer.d.ts +190 -78
- package/dist/Zod.d.ts +1 -0
- package/dist/agent/AgentModelProvider.d.ts +6 -4
- package/dist/agent/type.d.ts +6 -2
- package/dist/agent/utils/getAISDKTools.d.ts +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.es.dev.js +23743 -25868
- package/dist/index.es.js +24524 -24312
- package/dist/index.js +1789 -25
- package/dist/index.umd.dev.js +23845 -25970
- package/dist/index.umd.js +185 -129
- package/dist/{mcpsdk@1.20.1.dev.js → mcpsdk@1.23.0.dev.js} +13535 -14184
- package/dist/{mcpsdk@1.20.1.es.dev.js → mcpsdk@1.23.0.es.dev.js} +13563 -14212
- package/dist/mcpsdk@1.23.0.es.js +15584 -0
- package/dist/mcpsdk@1.23.0.js +43 -0
- package/dist/remoter/createRemoter.d.ts +9 -0
- package/dist/remoter/tooltips.d.ts +36 -0
- package/dist/script/utils.d.ts +1 -0
- package/dist/transport/ExtensionClientTransport.d.ts +3 -2
- package/dist/transport/ExtensionContentServerTransport.d.ts +3 -2
- package/dist/transport/ExtensionPageServerTransport.d.ts +3 -2
- package/dist/vite-build-tsc.d.ts +2 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/vite.config.mcpSdk.d.ts +2 -0
- package/dist/vite.config.webAgent.d.ts +2 -0
- package/dist/vite.config.webMcp.d.ts +2 -0
- package/dist/vite.config.webMcpFull.d.ts +2 -0
- package/dist/vite.config.zod.d.ts +2 -0
- package/dist/webagent.dev.js +18803 -18836
- package/dist/webagent.es.dev.js +17726 -17759
- package/dist/webagent.es.js +22571 -20829
- package/dist/webagent.js +172 -109
- package/dist/webmcp-full.dev.js +14463 -15009
- package/dist/webmcp-full.es.dev.js +14471 -15017
- package/dist/webmcp-full.es.js +13391 -12365
- package/dist/webmcp-full.js +43 -16
- package/package.json +3 -2
- package/remoter/createRemoter.ts +126 -71
- package/remoter/tooltips.ts +260 -0
- package/tsconfig.json +5 -3
- package/vite-build-tsc.ts +60 -0
- package/vite-env.d.ts +5 -0
- package/dist/WebMcpClient.js +0 -363
- package/dist/WebMcpServer.js +0 -283
- package/dist/agent/AgentModelProvider.js +0 -293
- package/dist/agent/type.js +0 -1
- package/dist/agent/utils/getAISDKTools.js +0 -36
- package/dist/mcpsdk@1.20.1.es.js +0 -14600
- package/dist/mcpsdk@1.20.1.js +0 -16
- package/dist/remoter/QrCode.js +0 -55
- package/dist/remoter/createRemoter.js +0 -743
- package/dist/transport/ExtensionClientTransport.js +0 -81
- package/dist/transport/ExtensionContentServerTransport.js +0 -128
- package/dist/transport/ExtensionPageServerTransport.js +0 -118
- package/dist/transport/messages.js +0 -51
- package/dist/utils/uuid.js +0 -10
package/dist/remoter/QrCode.js
DELETED
|
@@ -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
|
-
}
|