@opentiny/next-sdk 0.1.15-beta.1 → 0.1.15
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 +1 -490
- package/agent/type.ts +2 -8
- package/dist/WebMcpClient.d.ts +26 -165
- package/dist/WebMcpServer.d.ts +147 -36
- package/dist/agent/AgentModelProvider.d.ts +1 -35
- package/dist/agent/type.d.ts +2 -8
- package/dist/index.es.dev.js +11175 -14893
- package/dist/index.es.js +18206 -20985
- package/dist/index.js +320 -2411
- package/dist/index.umd.dev.js +11200 -14918
- package/dist/index.umd.js +71 -111
- package/dist/{mcpsdk@1.24.3.dev.js → mcpsdk@1.23.0.dev.js} +6652 -8271
- package/dist/{mcpsdk@1.24.3.es.dev.js → mcpsdk@1.23.0.es.dev.js} +6641 -8260
- package/dist/mcpsdk@1.23.0.es.js +15584 -0
- package/dist/mcpsdk@1.23.0.js +43 -0
- package/dist/transport/ExtensionPageServerTransport.d.ts +2 -1
- package/dist/webagent.dev.js +19914 -23355
- package/dist/webagent.es.dev.js +19889 -23330
- package/dist/webagent.es.js +15583 -18140
- package/dist/webagent.js +65 -105
- package/dist/webmcp-full.dev.js +7263 -8880
- package/dist/webmcp-full.es.dev.js +7261 -8878
- package/dist/webmcp-full.es.js +9267 -10421
- package/dist/webmcp-full.js +32 -32
- package/dist/webmcp.dev.js +22 -14
- package/dist/webmcp.es.dev.js +20 -12
- package/dist/webmcp.es.js +179 -172
- package/dist/webmcp.js +1 -1
- package/dist/zod@3.25.76.dev.js +32 -30
- package/dist/zod@3.25.76.es.dev.js +30 -28
- package/dist/zod@3.25.76.es.js +145 -143
- package/dist/zod@3.25.76.js +1 -1
- package/package.json +8 -9
- package/transport/ExtensionPageServerTransport.ts +4 -2
- package/agent/utils/generateReActPrompt.ts +0 -55
- package/agent/utils/parseReActAction.ts +0 -34
- package/dist/agent/utils/generateReActPrompt.d.ts +0 -9
- package/dist/agent/utils/parseReActAction.d.ts +0 -14
- package/dist/mcpsdk@1.24.3.es.js +0 -16781
- package/dist/mcpsdk@1.24.3.js +0 -43
package/dist/index.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { z as
|
|
3
|
-
import { MessageChannelServerTransport as
|
|
4
|
-
import { AuthClientProvider as
|
|
5
|
-
import { McpServer as
|
|
6
|
-
import { ResourceTemplate as
|
|
7
|
-
import { UriTemplate as
|
|
8
|
-
import { completable as
|
|
9
|
-
import { getDisplayName as
|
|
10
|
-
import { InMemoryTransport as
|
|
11
|
-
import { InMemoryTransport as
|
|
12
|
-
import { SetLevelRequestSchema as
|
|
13
|
-
import { Client as
|
|
14
|
-
import { SSEClientTransport as
|
|
15
|
-
import { StreamableHTTPClientTransport as
|
|
16
|
-
import { WebSocketClientTransport as
|
|
17
|
-
import
|
|
18
|
-
import { dynamicTool as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
import { createOpenAI as be } from "@ai-sdk/openai";
|
|
23
|
-
import { createDeepSeek as xe } from "@ai-sdk/deepseek";
|
|
24
|
-
class w0 {
|
|
1
|
+
import { default as G2 } from "ajv";
|
|
2
|
+
import { z as t0 } from "zod";
|
|
3
|
+
import { MessageChannelServerTransport as g, createTransportPair as I, MessageChannelClientTransport as u, sseOptions as q, streamOptions as Z, createSseProxy as U, createSocketProxy as z, createStreamProxy as H, MessageChannelTransport as $ } from "@opentiny/next";
|
|
4
|
+
import { AuthClientProvider as s0 } from "@opentiny/next";
|
|
5
|
+
import { McpServer as T } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
|
+
import { ResourceTemplate as r0 } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
7
|
+
import { UriTemplate as a0 } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
|
|
8
|
+
import { completable as l0 } from "@modelcontextprotocol/sdk/server/completable.js";
|
|
9
|
+
import { getDisplayName as d0 } from "@modelcontextprotocol/sdk/shared/metadataUtils.js";
|
|
10
|
+
import { InMemoryTransport as N } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
11
|
+
import { InMemoryTransport as C0 } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
12
|
+
import { SetLevelRequestSchema as v, SubscribeRequestSchema as F, UnsubscribeRequestSchema as O, ListResourcesRequestSchema as j, RootsListChangedNotificationSchema as B, CallToolResultSchema as D, ElicitRequestSchema as A, CreateMessageRequestSchema as W, ListRootsRequestSchema as Y, ToolListChangedNotificationSchema as V, PromptListChangedNotificationSchema as Q, ResourceListChangedNotificationSchema as K, ResourceUpdatedNotificationSchema as X, LoggingMessageNotificationSchema as J, JSONRPCMessageSchema as f } from "@modelcontextprotocol/sdk/types.js";
|
|
13
|
+
import { Client as S } from "@modelcontextprotocol/sdk/client/index.js";
|
|
14
|
+
import { SSEClientTransport as w } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
15
|
+
import { StreamableHTTPClientTransport as p } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
16
|
+
import { WebSocketClientTransport as G } from "@modelcontextprotocol/sdk/client/websocket.js";
|
|
17
|
+
import x from "qrcode";
|
|
18
|
+
import { dynamicTool as e2, jsonSchema as t2, experimental_createMCPClient as i2, stepCountIs as s2, generateText as o2, streamText as r2 } from "ai";
|
|
19
|
+
import { createOpenAI as n2 } from "@ai-sdk/openai";
|
|
20
|
+
import { createDeepSeek as a2 } from "@ai-sdk/deepseek";
|
|
21
|
+
class z2 {
|
|
25
22
|
constructor(e, t) {
|
|
26
|
-
const
|
|
23
|
+
const i = {
|
|
27
24
|
name: "web-mcp-server",
|
|
28
25
|
version: "1.0.0"
|
|
29
|
-
},
|
|
26
|
+
}, s = {
|
|
30
27
|
prompts: { listChanged: !0 },
|
|
31
28
|
resources: { subscribe: !0, listChanged: !0 },
|
|
32
29
|
tools: { listChanged: !0 },
|
|
33
30
|
completions: {},
|
|
34
31
|
logging: {}
|
|
35
32
|
};
|
|
36
|
-
this.server = new
|
|
37
|
-
|
|
33
|
+
this.server = new T(e || i, t || { capabilities: s }), this.server.server.oninitialized = () => {
|
|
34
|
+
var o;
|
|
35
|
+
(o = this.oninitialized) == null || o.call(this);
|
|
38
36
|
}, this.server.server.onclose = () => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
var o;
|
|
38
|
+
(o = this.onclose) == null || o.call(this);
|
|
39
|
+
}, this.server.server.onerror = (o) => {
|
|
40
|
+
var n;
|
|
41
|
+
(n = this.onerror) == null || n.call(this, o);
|
|
42
|
+
}, this.server.server.setRequestHandler(v, async () => ({}));
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Connects the server to a transport via the specified option.
|
|
46
46
|
*/
|
|
47
47
|
async connect(e) {
|
|
48
|
-
return typeof e.start == "function" ? (this.transport = e, this.transport.onclose = void 0, this.transport.onerror = void 0, this.transport.onmessage = void 0) : (this.transport = new
|
|
48
|
+
return typeof e.start == "function" ? (this.transport = e, this.transport.onclose = void 0, this.transport.onerror = void 0, this.transport.onmessage = void 0) : (this.transport = new g(e), await this.transport.listen()), await this.server.connect(this.transport), this.transport;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Closes the connection.
|
|
@@ -56,17 +56,17 @@ class w0 {
|
|
|
56
56
|
/**
|
|
57
57
|
* Registers a tool with a config object and callback.
|
|
58
58
|
*/
|
|
59
|
-
registerTool(e, t,
|
|
60
|
-
return this.server.registerTool(e, t,
|
|
59
|
+
registerTool(e, t, i) {
|
|
60
|
+
return this.server.registerTool(e, t, i);
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Registers a prompt with a config object and callback.
|
|
64
64
|
*/
|
|
65
|
-
registerPrompt(e, t,
|
|
66
|
-
return this.server.registerPrompt(e, t,
|
|
65
|
+
registerPrompt(e, t, i) {
|
|
66
|
+
return this.server.registerPrompt(e, t, i);
|
|
67
67
|
}
|
|
68
|
-
registerResource(e, t,
|
|
69
|
-
return typeof t == "string" ? this.server.registerResource(e, t,
|
|
68
|
+
registerResource(e, t, i, s) {
|
|
69
|
+
return typeof t == "string" ? this.server.registerResource(e, t, i, s) : this.server.registerResource(e, t, i, s);
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Checks if the server is connected to a transport.
|
|
@@ -146,8 +146,8 @@ class w0 {
|
|
|
146
146
|
*
|
|
147
147
|
* Do not use this method to emit notifications! Use notification() instead.
|
|
148
148
|
*/
|
|
149
|
-
request(e, t,
|
|
150
|
-
return this.server.server.request(e, t,
|
|
149
|
+
request(e, t, i) {
|
|
150
|
+
return this.server.server.request(e, t, i);
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
153
|
* Emits a notification, which is a one-way message that does not expect a response.
|
|
@@ -187,31 +187,31 @@ class w0 {
|
|
|
187
187
|
* Registers a handler for the subscribe request.
|
|
188
188
|
*/
|
|
189
189
|
onSubscribe(e) {
|
|
190
|
-
this.server.server.setRequestHandler(
|
|
190
|
+
this.server.server.setRequestHandler(F, e);
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
193
|
* Registers a handler for the unsubscribe request.
|
|
194
194
|
*/
|
|
195
195
|
onUnsubscribe(e) {
|
|
196
|
-
this.server.server.setRequestHandler(
|
|
196
|
+
this.server.server.setRequestHandler(O, e);
|
|
197
197
|
}
|
|
198
198
|
/**
|
|
199
199
|
* Registers a handler for the set log level request.
|
|
200
200
|
*/
|
|
201
201
|
onSetLogLevel(e) {
|
|
202
|
-
this.server.server.setRequestHandler(
|
|
202
|
+
this.server.server.setRequestHandler(v, e);
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
205
|
* Registers a handler for the list tools request.
|
|
206
206
|
*/
|
|
207
207
|
onListResources(e) {
|
|
208
|
-
this.server.server.setRequestHandler(
|
|
208
|
+
this.server.server.setRequestHandler(j, e);
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
211
|
* Registers a handler for the roots list changed notification.
|
|
212
212
|
*/
|
|
213
213
|
onRootsListChanged(e) {
|
|
214
|
-
this.server.server.setNotificationHandler(
|
|
214
|
+
this.server.server.setNotificationHandler(B, e);
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
217
217
|
* Close the transport for window.addEventListener('pagehide')
|
|
@@ -220,21 +220,23 @@ class w0 {
|
|
|
220
220
|
e.persisted || this.transport && typeof this.transport.close == "function" && await this.transport.close();
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
const
|
|
224
|
-
class
|
|
223
|
+
const H2 = (r, e) => new g(r, e), $2 = () => I(), N2 = (r) => r instanceof g, F2 = (r) => r instanceof T;
|
|
224
|
+
class c2 {
|
|
225
225
|
constructor(e, t) {
|
|
226
|
-
const
|
|
226
|
+
const i = {
|
|
227
227
|
name: "web-mcp-client",
|
|
228
228
|
version: "1.0.0"
|
|
229
|
-
},
|
|
229
|
+
}, s = {
|
|
230
230
|
roots: { listChanged: !0 },
|
|
231
231
|
sampling: {},
|
|
232
232
|
elicitation: {}
|
|
233
233
|
};
|
|
234
|
-
this.client = new
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
234
|
+
this.client = new S(e || i, t || { capabilities: s }), this.client.onclose = () => {
|
|
235
|
+
var o;
|
|
236
|
+
(o = this.onclose) == null || o.call(this);
|
|
237
|
+
}, this.client.onerror = (o) => {
|
|
238
|
+
var n;
|
|
239
|
+
(n = this.onerror) == null || n.call(this, o);
|
|
238
240
|
};
|
|
239
241
|
}
|
|
240
242
|
/**
|
|
@@ -243,28 +245,28 @@ class Le {
|
|
|
243
245
|
async connect(e) {
|
|
244
246
|
if (typeof e.start == "function")
|
|
245
247
|
return this.transport = e, this.transport.onclose = void 0, this.transport.onerror = void 0, this.transport.onmessage = void 0, await this.client.connect(this.transport), { transport: this.transport, sessionId: this.transport.sessionId };
|
|
246
|
-
const { url: t, token:
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
let
|
|
248
|
+
const { url: t, token: i, sessionId: s, type: o, agent: n, onError: a } = e;
|
|
249
|
+
if (n === !0) {
|
|
250
|
+
const h = { client: this.client, url: t, token: i, sessionId: s };
|
|
251
|
+
let y;
|
|
250
252
|
return await (async () => {
|
|
251
|
-
const { transport:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
},
|
|
255
|
-
})(),
|
|
253
|
+
const { transport: L, sessionId: E } = o === "sse" ? await U(h) : o === "socket" ? await z(h) : await H(h);
|
|
254
|
+
L.onerror = async (R) => {
|
|
255
|
+
a == null || a(R);
|
|
256
|
+
}, y = { transport: L, sessionId: E };
|
|
257
|
+
})(), y;
|
|
256
258
|
}
|
|
257
|
-
const
|
|
258
|
-
let
|
|
259
|
-
if (
|
|
260
|
-
const
|
|
261
|
-
|
|
259
|
+
const c = new URL(t);
|
|
260
|
+
let l;
|
|
261
|
+
if (o === "channel" && (l = new u(t), await this.client.connect(l)), o === "sse") {
|
|
262
|
+
const h = q(i, s);
|
|
263
|
+
l = new w(c, h), await this.client.connect(l);
|
|
262
264
|
}
|
|
263
|
-
if (
|
|
264
|
-
const
|
|
265
|
-
|
|
265
|
+
if (o === "socket" && (l = new G(new URL(`${t}?sessionId=${s}&token=${i}`)), l.sessionId = s, await this.client.connect(l)), typeof l > "u") {
|
|
266
|
+
const h = Z(i, s);
|
|
267
|
+
l = new p(c, h), await this.client.connect(l);
|
|
266
268
|
}
|
|
267
|
-
return this.transport =
|
|
269
|
+
return this.transport = l, { transport: this.transport, sessionId: this.transport.sessionId };
|
|
268
270
|
}
|
|
269
271
|
/**
|
|
270
272
|
* Closes the connection.
|
|
@@ -354,7 +356,7 @@ class Le {
|
|
|
354
356
|
* Calls a tool on the server with the given parameters.
|
|
355
357
|
*/
|
|
356
358
|
async callTool(e, t) {
|
|
357
|
-
return await this.client.callTool(e,
|
|
359
|
+
return await this.client.callTool(e, D, t);
|
|
358
360
|
}
|
|
359
361
|
/**
|
|
360
362
|
* Lists all tools available on the server.
|
|
@@ -373,8 +375,8 @@ class Le {
|
|
|
373
375
|
*
|
|
374
376
|
* Do not use this method to emit notifications! Use notification() instead.
|
|
375
377
|
*/
|
|
376
|
-
request(e, t,
|
|
377
|
-
return this.client.request(e, t,
|
|
378
|
+
request(e, t, i) {
|
|
379
|
+
return this.client.request(e, t, i);
|
|
378
380
|
}
|
|
379
381
|
/**
|
|
380
382
|
* Emits a notification, which is a one-way message that does not expect a response.
|
|
@@ -414,91 +416,92 @@ class Le {
|
|
|
414
416
|
* Registers a handler for the elicitation request.
|
|
415
417
|
*/
|
|
416
418
|
onElicit(e) {
|
|
417
|
-
this.client.setRequestHandler(
|
|
419
|
+
this.client.setRequestHandler(A, e);
|
|
418
420
|
}
|
|
419
421
|
/**
|
|
420
422
|
* Registers a handler for the create LLM message request.
|
|
421
423
|
*/
|
|
422
424
|
onCreateMessage(e) {
|
|
423
|
-
this.client.setRequestHandler(
|
|
425
|
+
this.client.setRequestHandler(W, e);
|
|
424
426
|
}
|
|
425
427
|
/**
|
|
426
428
|
* Registers a handler for the list roots request.
|
|
427
429
|
*/
|
|
428
430
|
onListRoots(e) {
|
|
429
|
-
this.client.setRequestHandler(
|
|
431
|
+
this.client.setRequestHandler(Y, e);
|
|
430
432
|
}
|
|
431
433
|
/**
|
|
432
434
|
* Registers a handler for the tool list changed notification.
|
|
433
435
|
*/
|
|
434
436
|
onToolListChanged(e) {
|
|
435
|
-
this.client.setNotificationHandler(
|
|
437
|
+
this.client.setNotificationHandler(V, e);
|
|
436
438
|
}
|
|
437
439
|
/**
|
|
438
440
|
* Registers a handler for the prompt list changed notification.
|
|
439
441
|
*/
|
|
440
442
|
onPromptListChanged(e) {
|
|
441
|
-
this.client.setNotificationHandler(
|
|
443
|
+
this.client.setNotificationHandler(Q, e);
|
|
442
444
|
}
|
|
443
445
|
/**
|
|
444
446
|
* Registers a handler for the resource list changed notification.
|
|
445
447
|
*/
|
|
446
448
|
onResourceListChanged(e) {
|
|
447
|
-
this.client.setNotificationHandler(
|
|
449
|
+
this.client.setNotificationHandler(K, e);
|
|
448
450
|
}
|
|
449
451
|
/**
|
|
450
452
|
* Registers a handler for the resource updated notification.
|
|
451
453
|
*/
|
|
452
454
|
onResourceUpdated(e) {
|
|
453
|
-
this.client.setNotificationHandler(
|
|
455
|
+
this.client.setNotificationHandler(X, e);
|
|
454
456
|
}
|
|
455
457
|
/**
|
|
456
458
|
* Registers a handler for the logging message notification.
|
|
457
459
|
*/
|
|
458
460
|
onLoggingMessage(e) {
|
|
459
|
-
this.client.setNotificationHandler(
|
|
461
|
+
this.client.setNotificationHandler(J, e);
|
|
460
462
|
}
|
|
461
463
|
/**
|
|
462
464
|
* Close the transport for window.addEventListener('pagehide')
|
|
463
465
|
*/
|
|
464
466
|
async onPagehide(e) {
|
|
465
|
-
e.persisted || (
|
|
467
|
+
e.persisted || (l2(this.transport) ? await this.transport.terminateSession() : this.transport && typeof this.transport.close == "function" && await this.transport.close());
|
|
466
468
|
}
|
|
467
469
|
}
|
|
468
|
-
const
|
|
470
|
+
const O2 = (r, e) => new w(r, e), j2 = (r, e) => new p(r, e), B2 = (r, e) => new u(r, e), D2 = (r) => r instanceof w, l2 = (r) => r instanceof p, A2 = (r) => r instanceof u, W2 = (r) => r instanceof S, d = (r, e, t) => {
|
|
469
471
|
window.postMessage({ type: r, direction: t, data: e }, "*");
|
|
470
|
-
},
|
|
471
|
-
const
|
|
472
|
-
|
|
472
|
+
}, b = (r, e, t) => {
|
|
473
|
+
const i = async function(s) {
|
|
474
|
+
s.source === window && s.data.type === r && s.data.direction === t && await e(s.data.data);
|
|
473
475
|
};
|
|
474
|
-
return window.addEventListener("message",
|
|
475
|
-
},
|
|
476
|
+
return window.addEventListener("message", i), () => window.removeEventListener("message", i);
|
|
477
|
+
}, C = (r, e, t) => {
|
|
476
478
|
if (t.endsWith("content"))
|
|
477
|
-
chrome.tabs.query({}, (
|
|
478
|
-
|
|
479
|
-
chrome.tabs.sendMessage(
|
|
479
|
+
chrome.tabs.query({}, (i) => {
|
|
480
|
+
i.forEach((s) => {
|
|
481
|
+
chrome.tabs.sendMessage(s.id, { type: r, data: e, direction: t, tabId: s.id });
|
|
480
482
|
});
|
|
481
483
|
});
|
|
482
484
|
else
|
|
483
485
|
return chrome.runtime.sendMessage({ direction: t, type: r, data: e });
|
|
484
|
-
},
|
|
485
|
-
const
|
|
486
|
-
if (
|
|
487
|
-
const { data:
|
|
488
|
-
e(
|
|
486
|
+
}, m = (r, e, t, i) => {
|
|
487
|
+
const s = (o, n, a) => {
|
|
488
|
+
if (o.type === r && o.direction === t && (!i || i && o.tabId === i)) {
|
|
489
|
+
const { data: c } = o;
|
|
490
|
+
e(c, n, a), a(n);
|
|
489
491
|
}
|
|
490
492
|
};
|
|
491
|
-
return chrome.runtime.onMessage.addListener(
|
|
493
|
+
return chrome.runtime.onMessage.addListener(s), () => chrome.runtime.onMessage.removeListener(s);
|
|
492
494
|
};
|
|
493
|
-
class
|
|
495
|
+
class h2 {
|
|
494
496
|
constructor(e) {
|
|
495
|
-
this._isStarted = !1, this._isClosed = !1, this.targetSessionId = e, this._messageListener =
|
|
497
|
+
this._isStarted = !1, this._isClosed = !1, this.targetSessionId = e, this._messageListener = m(
|
|
496
498
|
"mcp-server-to-client",
|
|
497
499
|
(t) => {
|
|
500
|
+
var i;
|
|
498
501
|
try {
|
|
499
502
|
if (t.sessionId !== this.targetSessionId) return;
|
|
500
|
-
const s =
|
|
501
|
-
this.onmessage
|
|
503
|
+
const s = f.parse(t.mcpMessage);
|
|
504
|
+
(i = this.onmessage) == null || i.call(this, s);
|
|
502
505
|
} catch (s) {
|
|
503
506
|
console.log("【Client Transport】处理server消息错误:", s);
|
|
504
507
|
}
|
|
@@ -509,8 +512,8 @@ class Re {
|
|
|
509
512
|
// 是否已关闭
|
|
510
513
|
_throwError(e, t) {
|
|
511
514
|
if (e()) {
|
|
512
|
-
const
|
|
513
|
-
throw console.log(t,
|
|
515
|
+
const i = new Error(t);
|
|
516
|
+
throw console.log(t, i), this.onerror && this.onerror(i), i;
|
|
514
517
|
}
|
|
515
518
|
}
|
|
516
519
|
/** 启动 transport,开始监听消息 */
|
|
@@ -520,12 +523,12 @@ class Re {
|
|
|
520
523
|
/** 发送消息到 MCP Server */
|
|
521
524
|
async send(e, t) {
|
|
522
525
|
this._throwError(() => !this._isStarted, "【Client Transport】 未启动,无法发送消息"), this._throwError(() => this._isClosed, "【Client Transport】 已关闭,无法发送消息");
|
|
523
|
-
const
|
|
524
|
-
this._throwError(() => !
|
|
525
|
-
const
|
|
526
|
-
|
|
526
|
+
const i = chrome.sessionRegistry.get(this.targetSessionId);
|
|
527
|
+
this._throwError(() => !i, `【Client Transport】sessionRegistry中未找到${this.targetSessionId}`);
|
|
528
|
+
const s = i.tabIds[i.tabIds.length - 1];
|
|
529
|
+
C(
|
|
527
530
|
"mcp-client-to-server",
|
|
528
|
-
{ sessionId: this.targetSessionId, tabId:
|
|
531
|
+
{ sessionId: this.targetSessionId, tabId: s, mcpMessage: e },
|
|
529
532
|
"side->content"
|
|
530
533
|
);
|
|
531
534
|
}
|
|
@@ -539,29 +542,30 @@ class Re {
|
|
|
539
542
|
}
|
|
540
543
|
}
|
|
541
544
|
}
|
|
542
|
-
const
|
|
545
|
+
const P = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r) => {
|
|
543
546
|
const e = Math.random() * 16 | 0;
|
|
544
547
|
return (r === "x" ? e : e & 3 | 8).toString(16);
|
|
545
548
|
});
|
|
546
|
-
class
|
|
547
|
-
constructor(e = null) {
|
|
548
|
-
this._isStarted = !1, this._isClosed = !1, this._lastRegistration = null, this.sessionId = e ||
|
|
549
|
+
class Y2 {
|
|
550
|
+
constructor(e = null, t) {
|
|
551
|
+
this._isStarted = !1, this._isClosed = !1, this._lastRegistration = null, this.sessionId = e || P(), this.tabId = t, this._messageListener1 = b(
|
|
549
552
|
"sidepanel-ready-to-page",
|
|
550
553
|
() => {
|
|
551
|
-
this._lastRegistration && this._isStarted && this.notifyRegistration(this._lastRegistration).catch((
|
|
552
|
-
console.error("【Page Svr Transport】 notifyRegistration失败:",
|
|
554
|
+
this._lastRegistration && this._isStarted && this.notifyRegistration(this._lastRegistration).catch((i) => {
|
|
555
|
+
console.error("【Page Svr Transport】 notifyRegistration失败:", i);
|
|
553
556
|
});
|
|
554
557
|
},
|
|
555
558
|
"content->page"
|
|
556
|
-
), this._messageListener2 =
|
|
559
|
+
), this._messageListener2 = b(
|
|
557
560
|
"mcp-client-to-server-to-page",
|
|
558
|
-
(
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
561
|
+
(i) => {
|
|
562
|
+
var n, a, c;
|
|
563
|
+
if (i.sessionId !== this.sessionId || i.tabId !== this.tabId) return;
|
|
564
|
+
console.log("【Page Svr Transport】 即将处理 mcpMessage", i.mcpMessage);
|
|
565
|
+
const s = f.parse(i.mcpMessage);
|
|
566
|
+
(n = this.onmessage) == null || n.call(this, s), ((a = i.mcpMessage.params) == null ? void 0 : a.name) && d(
|
|
563
567
|
"update-page-app-message",
|
|
564
|
-
{ status: "run", message:
|
|
568
|
+
{ status: "run", message: (c = i.mcpMessage.params) == null ? void 0 : c.name },
|
|
565
569
|
"page->content"
|
|
566
570
|
);
|
|
567
571
|
},
|
|
@@ -571,8 +575,8 @@ class E0 {
|
|
|
571
575
|
// 最后一次注册信息(用于 Sidepanel 刷新后重新注册)
|
|
572
576
|
_throwError(e, t) {
|
|
573
577
|
if (e()) {
|
|
574
|
-
const
|
|
575
|
-
throw console.log(t,
|
|
578
|
+
const i = new Error(t);
|
|
579
|
+
throw console.log(t, i), this.onerror && this.onerror(i), i;
|
|
576
580
|
}
|
|
577
581
|
}
|
|
578
582
|
/** 启动 transport,开始监听消息 */
|
|
@@ -584,14 +588,15 @@ class E0 {
|
|
|
584
588
|
}
|
|
585
589
|
/** 发送消息到 MCP Client */
|
|
586
590
|
async send(e, t) {
|
|
587
|
-
|
|
591
|
+
var i;
|
|
592
|
+
this._throwError(() => !this._isStarted, "【Page Svr Transport】 未启动,无法发送消息"), this._throwError(() => this._isClosed, "【Page Svr Transport】 已关闭,无法发送消息"), d(
|
|
588
593
|
"mcp-server-to-client-from-page",
|
|
589
594
|
{
|
|
590
595
|
sessionId: this.sessionId,
|
|
591
596
|
mcpMessage: e
|
|
592
597
|
},
|
|
593
598
|
"page->content"
|
|
594
|
-
), "result" in e && e.result
|
|
599
|
+
), "result" in e && ((i = e.result) != null && i.content) && d(
|
|
595
600
|
"update-page-app-message",
|
|
596
601
|
{ status: "ready", message: "" },
|
|
597
602
|
"page->content"
|
|
@@ -602,7 +607,7 @@ class E0 {
|
|
|
602
607
|
async notifyRegistration(e) {
|
|
603
608
|
this._throwError(() => !this._isStarted, "【Page Svr Transport】 未启动,无法注册消息"), this._lastRegistration = e;
|
|
604
609
|
try {
|
|
605
|
-
|
|
610
|
+
d(
|
|
606
611
|
"mcp-server-register-from-page",
|
|
607
612
|
{
|
|
608
613
|
sessionId: this.sessionId,
|
|
@@ -628,13 +633,13 @@ class E0 {
|
|
|
628
633
|
}
|
|
629
634
|
}
|
|
630
635
|
}
|
|
631
|
-
class
|
|
636
|
+
class V2 {
|
|
632
637
|
constructor(e = null, t) {
|
|
633
|
-
this._isStarted = !1, this._isClosed = !1, this._lastRegistration = null, this.sessionId = e ||
|
|
638
|
+
this._isStarted = !1, this._isClosed = !1, this._lastRegistration = null, this.sessionId = e || P(), this.tabId = t, m(
|
|
634
639
|
"sidepanel-ready",
|
|
635
640
|
() => {
|
|
636
|
-
this._lastRegistration && this._isStarted && this.notifyRegistration(this._lastRegistration).catch((
|
|
637
|
-
console.log("【Content Svr Transport】 notifyRegistration 失败",
|
|
641
|
+
this._lastRegistration && this._isStarted && this.notifyRegistration(this._lastRegistration).catch((i) => {
|
|
642
|
+
console.log("【Content Svr Transport】 notifyRegistration 失败", i);
|
|
638
643
|
});
|
|
639
644
|
},
|
|
640
645
|
"side->content",
|
|
@@ -644,29 +649,30 @@ class P0 {
|
|
|
644
649
|
// 最后一次注册信息(用于 Sidepanel 刷新后重新注册)
|
|
645
650
|
_throwError(e, t) {
|
|
646
651
|
if (e()) {
|
|
647
|
-
const
|
|
648
|
-
throw console.log(t,
|
|
652
|
+
const i = new Error(t);
|
|
653
|
+
throw console.log(t, i), this.onerror && this.onerror(i), i;
|
|
649
654
|
}
|
|
650
655
|
}
|
|
651
656
|
/** 启动 transport,开始监听MCP client 消息 */
|
|
652
657
|
async start() {
|
|
653
658
|
if (console.log("【Content Svr Transport】 启动 start", this.sessionId), !this._isStarted) {
|
|
654
659
|
if (this._isClosed) throw new Error("【Content Svr Transport】 已关闭,无法重新启动");
|
|
655
|
-
|
|
660
|
+
m(
|
|
656
661
|
"mcp-client-to-server",
|
|
657
662
|
(e) => {
|
|
663
|
+
var t, i, s;
|
|
658
664
|
if (!(e.sessionId !== this.sessionId || e.tabId !== this.tabId))
|
|
659
665
|
try {
|
|
660
666
|
console.log("【Content Svr Transport】 即将处理 mcpMessage", e.mcpMessage);
|
|
661
|
-
const
|
|
662
|
-
this.onmessage
|
|
667
|
+
const o = f.parse(e.mcpMessage);
|
|
668
|
+
(t = this.onmessage) == null || t.call(this, o), ((i = e.mcpMessage.params) == null ? void 0 : i.name) && d(
|
|
663
669
|
"update-page-app-message",
|
|
664
|
-
{ status: "run", message: e.mcpMessage.params
|
|
670
|
+
{ status: "run", message: (s = e.mcpMessage.params) == null ? void 0 : s.name },
|
|
665
671
|
"page->content"
|
|
666
672
|
// 此处应该是 content->content, 但为了和pageServerTransport统一。
|
|
667
673
|
);
|
|
668
|
-
} catch (
|
|
669
|
-
console.log("【Content Svr Transport】 处理消息时发生错误:",
|
|
674
|
+
} catch (o) {
|
|
675
|
+
console.log("【Content Svr Transport】 处理消息时发生错误:", o);
|
|
670
676
|
}
|
|
671
677
|
},
|
|
672
678
|
"side->content",
|
|
@@ -676,16 +682,17 @@ class P0 {
|
|
|
676
682
|
}
|
|
677
683
|
/** 发送消息到 MCP Client */
|
|
678
684
|
async send(e, t) {
|
|
685
|
+
var i;
|
|
679
686
|
this._throwError(() => !this._isStarted, "【Content Svr Transport】 未启动,无法发送消息"), this._throwError(() => this._isClosed, "【Content Svr Transport】 已关闭,无法发送消息");
|
|
680
687
|
try {
|
|
681
|
-
console.log("【Content Svr Transport】 发送消息到 MCP Client", e),
|
|
688
|
+
console.log("【Content Svr Transport】 发送消息到 MCP Client", e), C(
|
|
682
689
|
"mcp-server-to-client",
|
|
683
690
|
{
|
|
684
691
|
sessionId: this.sessionId,
|
|
685
692
|
mcpMessage: e
|
|
686
693
|
},
|
|
687
694
|
"content->side"
|
|
688
|
-
), "result" in e && e.result
|
|
695
|
+
), "result" in e && ((i = e.result) != null && i.content) && d(
|
|
689
696
|
"update-page-app-message",
|
|
690
697
|
{ status: "ready", message: "" },
|
|
691
698
|
"page->content"
|
|
@@ -697,7 +704,7 @@ class P0 {
|
|
|
697
704
|
}
|
|
698
705
|
/** 通知 Sidepanel 此 Server 已启动并准备接受连接 */
|
|
699
706
|
async notifyRegistration(e) {
|
|
700
|
-
this._isStarted && (this._lastRegistration = e,
|
|
707
|
+
this._isStarted && (this._lastRegistration = e, C(
|
|
701
708
|
"mcp-server-register",
|
|
702
709
|
{
|
|
703
710
|
sessionId: this.sessionId,
|
|
@@ -719,9 +726,9 @@ class P0 {
|
|
|
719
726
|
}
|
|
720
727
|
}
|
|
721
728
|
}
|
|
722
|
-
class
|
|
723
|
-
constructor(e, { size: t = 200, margin:
|
|
724
|
-
this.value = e, this.size = t, this.margin =
|
|
729
|
+
class d2 {
|
|
730
|
+
constructor(e, { size: t = 200, margin: i = 4, color: s = "#000", bgColor: o = "#fff" }) {
|
|
731
|
+
this.value = e, this.size = t, this.margin = i, this.color = s, this.bgColor = o;
|
|
725
732
|
}
|
|
726
733
|
get qrCodeOption() {
|
|
727
734
|
return {
|
|
@@ -737,18 +744,18 @@ class Te {
|
|
|
737
744
|
}
|
|
738
745
|
/** 生成二维码的 Data URL(base64 图片) */
|
|
739
746
|
async toDataURL() {
|
|
740
|
-
return
|
|
747
|
+
return x.toDataURL(this.value, this.qrCodeOption);
|
|
741
748
|
}
|
|
742
749
|
/** 渲染二维码到指定的 canvas 元素 */
|
|
743
750
|
async toCanvas(e) {
|
|
744
|
-
return
|
|
751
|
+
return x.toCanvas(e, this.value, this.qrCodeOption);
|
|
745
752
|
}
|
|
746
753
|
/** 渲染二维码到指定的 img 元素 */
|
|
747
754
|
async toImage(e) {
|
|
748
755
|
e.src = await this.toDataURL();
|
|
749
756
|
}
|
|
750
757
|
}
|
|
751
|
-
const
|
|
758
|
+
const p2 = {
|
|
752
759
|
content: "",
|
|
753
760
|
placement: "top",
|
|
754
761
|
trigger: "hover",
|
|
@@ -757,10 +764,10 @@ const Me = {
|
|
|
757
764
|
container: document.body,
|
|
758
765
|
className: "tiny-remoter-native-tooltip"
|
|
759
766
|
};
|
|
760
|
-
class
|
|
767
|
+
class C2 {
|
|
761
768
|
constructor(e, t = {}) {
|
|
762
769
|
if (this.tip = null, this.showTimer = 0, this.hideTimer = 0, this.clickOutside = null, this.el = typeof e == "string" ? document.querySelector(e) : e, !this.el) throw new Error("Tooltip: invalid element");
|
|
763
|
-
this.opts = { ...
|
|
770
|
+
this.opts = { ...p2, ...t }, this.bindEvents();
|
|
764
771
|
}
|
|
765
772
|
/* 公开 API */
|
|
766
773
|
open() {
|
|
@@ -770,7 +777,8 @@ class Ee {
|
|
|
770
777
|
}
|
|
771
778
|
close() {
|
|
772
779
|
this.clearTimer(), this.hideTimer = window.setTimeout(() => {
|
|
773
|
-
|
|
780
|
+
var e;
|
|
781
|
+
(e = this.tip) == null || e.remove(), this.detachExtraEvents();
|
|
774
782
|
}, this.opts.hideDelay);
|
|
775
783
|
}
|
|
776
784
|
toggle() {
|
|
@@ -797,18 +805,18 @@ class Ee {
|
|
|
797
805
|
reposition() {
|
|
798
806
|
const e = this.placementList(this.opts.placement);
|
|
799
807
|
for (const t of e) {
|
|
800
|
-
const
|
|
801
|
-
if (this.checkViewport(
|
|
802
|
-
this.applyStyle(
|
|
808
|
+
const i = this.calcStyle(t);
|
|
809
|
+
if (this.checkViewport(i)) {
|
|
810
|
+
this.applyStyle(i), this.tip.className = `${this.opts.className} ${this.opts.className}--${t}`;
|
|
803
811
|
return;
|
|
804
812
|
}
|
|
805
813
|
}
|
|
806
814
|
this.applyStyle(this.calcStyle("top"));
|
|
807
815
|
}
|
|
808
816
|
calcStyle(e) {
|
|
809
|
-
const t = this.el.getBoundingClientRect(),
|
|
810
|
-
let
|
|
811
|
-
return
|
|
817
|
+
const t = this.el.getBoundingClientRect(), i = this.tip.getBoundingClientRect(), s = window.pageYOffset || document.documentElement.scrollTop, o = window.pageXOffset || document.documentElement.scrollLeft, n = 6, [a, c = "center"] = e.split("-");
|
|
818
|
+
let l = 0, h = 0;
|
|
819
|
+
return a === "top" ? l = t.top + s - i.height - n : a === "bottom" ? l = t.bottom + s + n : a === "left" ? h = t.left + o - i.width - n : a === "right" && (h = t.right + o + n), (a === "top" || a === "bottom") && (c === "start" ? h = t.left + o : c === "end" ? h = t.right + o - i.width : h = (t.left + t.right) / 2 + o - i.width / 2), (a === "left" || a === "right") && (c === "start" ? l = t.top + s : c === "end" ? l = t.bottom + s - i.height : l = (t.top + t.bottom) / 2 + s - i.height / 2), { top: Math.round(l), left: Math.round(h) };
|
|
812
820
|
}
|
|
813
821
|
applyStyle({ top: e, left: t }) {
|
|
814
822
|
Object.assign(this.tip.style, {
|
|
@@ -818,8 +826,8 @@ class Ee {
|
|
|
818
826
|
});
|
|
819
827
|
}
|
|
820
828
|
checkViewport({ top: e, left: t }) {
|
|
821
|
-
const
|
|
822
|
-
return t >= 5 && e >= 5 && t +
|
|
829
|
+
const s = window.innerWidth, o = window.innerHeight, n = this.tip.getBoundingClientRect();
|
|
830
|
+
return t >= 5 && e >= 5 && t + n.width <= s - 5 && e + n.height <= o - 5;
|
|
823
831
|
}
|
|
824
832
|
placementList(e) {
|
|
825
833
|
const t = {
|
|
@@ -843,14 +851,15 @@ class Ee {
|
|
|
843
851
|
clearTimeout(this.showTimer), clearTimeout(this.hideTimer);
|
|
844
852
|
}
|
|
845
853
|
isShown() {
|
|
846
|
-
|
|
854
|
+
var e;
|
|
855
|
+
return !!((e = this.tip) != null && e.parentNode);
|
|
847
856
|
}
|
|
848
857
|
}
|
|
849
|
-
const
|
|
858
|
+
const _ = "tiny-remoter-native-tooltip-style";
|
|
850
859
|
(() => {
|
|
851
|
-
if (document.getElementById(
|
|
860
|
+
if (document.getElementById(_)) return;
|
|
852
861
|
const r = document.createElement("style");
|
|
853
|
-
r.id =
|
|
862
|
+
r.id = _, r.textContent = `
|
|
854
863
|
.tiny-remoter-native-tooltip {
|
|
855
864
|
position: absolute;
|
|
856
865
|
z-index: 9999;
|
|
@@ -899,20 +908,20 @@ const w2 = "tiny-remoter-native-tooltip-style";
|
|
|
899
908
|
}
|
|
900
909
|
`, document.head.appendChild(r);
|
|
901
910
|
})();
|
|
902
|
-
const Pe = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2039.9692'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40.000000'%20height='39.969238'%20fill='none'%20customFrame='url(%23clipPath_3)'%3e%3cdefs%3e%3cclipPath%20id='clipPath_3'%3e%3crect%20width='40.000000'%20height='39.969238'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_4'%3e%3crect%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='7.984619'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_5'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='9.984619'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_6'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='9.984619'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_7'%3e%3crect%20width='21.666666'%20height='13.333333'%20x='20.000000'%20y='9.984619'%20rx='6.666667'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_8'%3e%3crect%20width='6.666667'%20height='6.666667'%20x='23.333496'%20y='9.984619'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3c/defs%3e%3crect%20id='2'%20width='40.000000'%20height='39.969238'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(239,246,255)'%20/%3e%3cg%20id='物业'%20clip-path='url(%23clipPath_4)'%20customFrame='url(%23clipPath_4)'%3e%3crect%20id='物业'%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='7.984619'%20/%3e%3cg%20id='物业服务'%3e%3cg%20id='00公共/红点/图标+红点'%20customFrame='url(%23clipPath_5)'%3e%3crect%20id='00公共/红点/图标+红点'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='9.984619'%20/%3e%3cg%20id='common_chats_line'%20customFrame='url(%23clipPath_6)'%3e%3crect%20id='common_chats_line'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='9.984619'%20/%3e%3cpath%20id='形状'%20d='M28.3332%2019.9847C28.3332%2015.3823%2024.6022%2011.6514%2019.9998%2011.6514C15.3975%2011.6514%2011.6665%2015.3823%2011.6665%2019.9847C11.6665%2024.5871%2015.3975%2028.318%2019.9998%2028.318C21.0018%2028.318%2021.9624%2028.1412%2022.8522%2027.8171L26.581%2028.1578C26.7205%2028.1706%2026.8611%2028.1598%2026.9971%2028.1259C27.6669%2027.959%2028.0746%2027.2806%2027.9077%2026.6108L27.2716%2024.0578C27.9477%2022.8535%2028.3332%2021.4641%2028.3332%2019.9847ZM19.9998%2013.1514C16.2259%2013.1514%2013.1665%2016.2108%2013.1665%2019.9847C13.1665%2023.7586%2016.2259%2026.818%2019.9998%2026.818C20.8089%2026.818%2021.5967%2026.678%2022.3388%2026.4077C22.505%2026.3471%2022.6803%2026.3166%2022.8565%2026.3171L22.9887%2026.3233L26.3665%2026.6322L25.8161%2024.4205C25.7352%2024.0958%2025.7655%2023.7548%2025.8997%2023.4512L25.9636%2023.3236C26.5311%2022.3126%2026.8332%2021.1723%2026.8332%2019.9847C26.8332%2016.2108%2023.7738%2013.1514%2019.9998%2013.1514ZM23.1152%2021.2468C23.352%2020.9069%2023.2684%2020.4394%2022.9286%2020.2026C22.5887%2019.9659%2022.1212%2020.0494%2021.8845%2020.3893C21.2894%2021.2433%2020.4268%2021.7347%2019.5102%2021.7347C18.9513%2021.7347%2018.4132%2021.554%2017.9375%2021.2122C17.6011%2020.9705%2017.1325%2021.0472%2016.8908%2021.3836C16.6491%2021.7199%2016.7258%2022.1886%2017.0622%2022.4303C17.7879%2022.9518%2018.6305%2023.2347%2019.5102%2023.2347C20.9394%2023.2347%2022.2505%2022.4878%2023.1152%2021.2468Z'%20fill='rgb(65,142,255)'%20fill-rule='evenodd'%20/%3e%3c/g%3e%3cg%20id='00公共/3位数红点'%20opacity='0'%20customFrame='url(%23clipPath_7)'%3e%3crect%20id='00公共/3位数红点'%20width='21.666666'%20height='13.333333'%20x='20.000000'%20y='9.984619'%20rx='6.666667'%20opacity='0'%20fill='rgb(243,111,100)'%20/%3e%3cpath%20id='文本'%20d='M26.0421%2013.4421C26.4259%2013.4421%2026.7677%2013.5255%2027.0675%2013.6923C27.3672%2013.8591%2027.6005%2014.0931%2027.7673%2014.3942C27.9342%2014.694%2028.0176%2015.0351%2028.0176%2015.4176C28.0176%2015.7173%2027.9633%2015.994%2027.8548%2016.2476C27.7463%2016.4999%2027.5673%2016.8315%2027.3177%2017.2425L25.859%2019.6432L25.0167%2019.6432L26.276%2017.5924C26.3534%2017.4704%2026.4307%2017.3564%2026.508%2017.2507C26.3357%2017.3063%2026.1445%2017.3341%2025.9342%2017.3341C25.5721%2017.3341%2025.2493%2017.2479%2024.9658%2017.0757C24.6837%2016.9034%2024.4633%2016.6701%2024.3046%2016.3758C24.1459%2016.0815%2024.0666%2015.7566%2024.0666%2015.4013C24.0666%2015.0351%2024.1513%2014.7021%2024.3209%2014.4023C24.4904%2014.1012%2024.7264%2013.8659%2025.0289%2013.6964C25.3314%2013.5268%2025.6691%2013.4421%2026.0421%2013.4421ZM26.0421%2016.6505C26.4029%2016.6505%2026.6904%2016.5325%2026.9047%2016.2965C27.119%2016.0605%2027.2262%2015.7539%2027.2262%2015.3769C27.2262%2014.9985%2027.119%2014.694%2026.9047%2014.4634C26.6904%2014.2328%2026.4029%2014.1175%2026.0421%2014.1175C25.6867%2014.1175%2025.4019%2014.2342%2025.1876%2014.4674C24.9733%2014.7007%2024.8661%2015.0039%2024.8661%2015.3769C24.8661%2015.7539%2024.9719%2016.0605%2025.1835%2016.2965C25.3951%2016.5325%2025.6813%2016.6505%2026.0421%2016.6505ZM30.7921%2013.4421C31.1759%2013.4421%2031.5177%2013.5255%2031.8175%2013.6923C32.1172%2013.8591%2032.3505%2014.0931%2032.5173%2014.3942C32.6842%2014.694%2032.7676%2015.0351%2032.7676%2015.4176C32.7676%2015.7173%2032.7133%2015.994%2032.6048%2016.2476C32.4963%2016.4999%2032.3173%2016.8315%2032.0677%2017.2425L30.609%2019.6432L29.7667%2019.6432L31.026%2017.5924C31.1034%2017.4704%2031.1807%2017.3564%2031.258%2017.2507C31.0857%2017.3063%2030.8945%2017.3341%2030.6842%2017.3341C30.3221%2017.3341%2029.9993%2017.2479%2029.7158%2017.0757C29.4337%2016.9034%2029.2133%2016.6701%2029.0546%2016.3758C28.8959%2016.0815%2028.8166%2015.7566%2028.8166%2015.4013C28.8166%2015.0351%2028.9013%2014.7021%2029.0709%2014.4023C29.2404%2014.1012%2029.4764%2013.8659%2029.7789%2013.6964C30.0814%2013.5268%2030.4191%2013.4421%2030.7921%2013.4421ZM30.7921%2016.6505C31.1529%2016.6505%2031.4404%2016.5325%2031.6547%2016.2965C31.869%2016.0605%2031.9762%2015.7539%2031.9762%2015.3769C31.9762%2014.9985%2031.869%2014.694%2031.6547%2014.4634C31.4404%2014.2328%2031.1529%2014.1175%2030.7921%2014.1175C30.4367%2014.1175%2030.1519%2014.2342%2029.9376%2014.4674C29.7233%2014.7007%2029.6161%2015.0039%2029.6161%2015.3769C29.6161%2015.7539%2029.7219%2016.0605%2029.9335%2016.2965C30.1451%2016.5325%2030.4313%2016.6505%2030.7921%2016.6505ZM35.2674%2014.6851L35.9001%2014.6851L35.9001%2016.3188L37.5339%2016.3188L37.5339%2016.9516L35.9001%2016.9516L35.9001%2018.5853L35.2674%2018.5853L35.2674%2016.9516L33.6337%2016.9516L33.6337%2016.3188L35.2674%2016.3188L35.2674%2014.6851Z'%20fill='rgb(255,255,255)'%20fill-rule='nonzero'%20/%3e%3c/g%3e%3cg%20id='00公共/单红点'%20opacity='0'%20customFrame='url(%23clipPath_8)'%3e%3crect%20id='00公共/单红点'%20width='6.666667'%20height='6.666667'%20x='23.333496'%20y='9.984619'%20opacity='0'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3ccircle%20id='红点'%20cx='26.6668301'%20cy='13.3179522'%20r='3.33333325'%20fill='rgb(243,111,100)'%20/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", ke = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2040'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40.000000'%20height='40.000000'%20fill='none'%20customFrame='url(%23clipPath_12)'%3e%3cdefs%3e%3cclipPath%20id='clipPath_12'%3e%3crect%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_13'%3e%3crect%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_14'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3c/defs%3e%3crect%20id='4'%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(234,255,244)'%20/%3e%3cg%20id='我的信息'%20clip-path='url(%23clipPath_13)'%20customFrame='url(%23clipPath_13)'%3e%3crect%20id='我的信息'%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20/%3e%3cg%20id='组合%208'%20customFrame='url(%23clipPath_14)'%3e%3crect%20id='组合%208'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20/%3e%3cpath%20id='合并'%20d='M28.4994%2012.3142C28.4994%2012.2578%2028.4937%2012.2018%2028.4825%2012.1465C28.4713%2012.0911%2028.4547%2012.0373%2028.4327%2011.9851C28.4107%2011.933%2028.3836%2011.8835%2028.3516%2011.8365C28.3197%2011.7896%2028.2834%2011.7461%2028.2427%2011.7062C28.202%2011.6663%2028.1579%2011.6307%2028.1101%2011.5993C28.0622%2011.568%2028.0117%2011.5415%2027.9585%2011.5199C27.9054%2011.4983%2027.8506%2011.4819%2027.7942%2011.4709C27.7378%2011.4599%2027.6806%2011.4544%2027.6231%2011.4544L24.1832%2011.5199L24.1832%2010L29.0796%2010C29.1472%2010%2029.2143%2010.0065%2029.2806%2010.0194C29.347%2010.0324%2029.4114%2010.0516%2029.4739%2010.077C29.5364%2010.1024%2029.5961%2010.1336%2029.6523%2010.1705C29.7086%2010.2074%2029.7605%2010.2493%2029.8084%2010.2963C29.8562%2010.3433%2029.8991%2010.3944%2029.9367%2010.4496C29.9743%2010.5048%2030.006%2010.5631%2030.0319%2010.6244C30.0578%2010.6858%2030.0773%2010.7491%2030.0905%2010.8142C30.1037%2010.8794%2030.1104%2010.9451%2030.1104%2011.0115L30.1832%2014.4522L28.4992%2014.5L28.4994%2012.3142ZM11.6995%2012.3143C11.6995%2012.2579%2011.7051%2012.2019%2011.7163%2012.1466C11.7275%2012.0912%2011.7441%2012.0374%2011.7661%2011.9852C11.7882%2011.9331%2011.8152%2011.8836%2011.8472%2011.8366C11.8791%2011.7897%2011.9155%2011.7462%2011.9562%2011.7063C11.9968%2011.6664%2012.0409%2011.6308%2012.0888%2011.5994C12.1366%2011.5681%2012.1871%2011.5416%2012.2403%2011.52C12.2934%2011.4984%2012.3482%2011.482%2012.4046%2011.471C12.4611%2011.46%2012.5182%2011.4545%2012.5758%2011.4545L16.0157%2011.52L16.0157%2010.0001L11.1193%2010.0001C11.0516%2010.0001%2010.9846%2010.0066%2010.9182%2010.0196C10.8518%2010.0325%2010.7874%2010.0517%2010.7249%2010.0771C10.6624%2010.1025%2010.6028%2010.1337%2010.5465%2010.1706C10.4902%2010.2075%2010.4383%2010.2494%2010.3904%2010.2964C10.3426%2010.3434%2010.2997%2010.3945%2010.2621%2010.4497C10.2245%2010.5049%2010.1929%2010.5632%2010.167%2010.6245C10.1411%2010.6859%2010.1215%2010.7492%2010.1083%2010.8143C10.0951%2010.8795%2010.0885%2010.9452%2010.0884%2011.0116L10.0157%2014.4523L11.6997%2014.5L11.6995%2012.3143ZM25.3135%2021.8051L25.3135%2022.8167C25.7656%2022.8929%2026.2209%2022.9249%2026.6792%2022.9127C28.3381%2022.9127%2029.1675%2022.326%2029.1675%2021.1527C29.1733%2020.9869%2029.151%2020.825%2029.1006%2020.667C29.0503%2020.509%2028.9747%2020.3641%2028.8742%2020.2322C28.767%2020.1025%2028.6403%2019.9963%2028.4938%2019.9134C28.3474%2019.8306%2028.191%2019.7767%2028.0246%2019.7517L28.0246%2019.7011C28.0971%2019.6839%2028.1676%2019.6606%2028.236%2019.6311C28.3044%2019.6016%2028.3698%2019.5665%2028.4321%2019.5257C28.4944%2019.4848%2028.5526%2019.4389%2028.6069%2019.3879C28.6613%2019.3369%2028.7109%2019.2816%2028.7556%2019.222C28.8003%2019.1624%2028.8394%2019.0994%2028.8732%2019.033C28.9069%2018.9665%2028.9346%2018.8977%2028.9564%2018.8265C28.9782%2018.7552%2028.9937%2018.6826%2029.0028%2018.6086C29.0119%2018.5347%2029.0145%2018.4605%2029.0107%2018.3861C29.0217%2018.2675%2029.0176%2018.1495%2028.9984%2018.0319C28.9791%2017.9144%2028.9454%2017.8012%2028.8971%2017.6923C28.8489%2017.5834%2028.7875%2017.4823%2028.7134%2017.3891C28.6393%2017.2959%2028.5547%2017.2135%2028.4595%2017.1419C28.219%2017.0003%2027.963%2016.8972%2027.6915%2016.8326C27.4199%2016.7679%2027.1449%2016.7446%2026.8664%2016.7626C26.6258%2016.7621%2026.3864%2016.7791%2026.1482%2016.8132C25.9479%2016.8386%2025.7504%2016.8791%2025.5563%2016.9346L25.5563%2017.8854C25.743%2017.8264%2025.9337%2017.7842%2026.128%2017.759C26.3276%2017.73%2026.5282%2017.7148%2026.7298%2017.7134C27.0252%2017.6949%2027.3049%2017.7523%2027.5692%2017.8854C27.6168%2017.9161%2027.6595%2017.9525%2027.6972%2017.9947C27.7348%2018.037%2027.766%2018.0835%2027.791%2018.1343C27.816%2018.1851%2027.8337%2018.2383%2027.8441%2018.294C27.8545%2018.3496%2027.8573%2018.4056%2027.8525%2018.462C27.8566%2018.5278%2027.8514%2018.5927%2027.8367%2018.657C27.822%2018.7212%2027.7986%2018.7821%2027.7663%2018.8395C27.734%2018.897%2027.694%2018.9487%2027.6468%2018.9946C27.5995%2019.0405%2027.5468%2019.0787%2027.4885%2019.1093C27.1544%2019.2631%2026.8037%2019.3306%2026.4364%2019.3117L25.9862%2019.3117L25.9862%2020.1917L26.4466%2020.1917C26.8409%2020.1669%2027.2202%2020.2309%2027.5845%2020.3839C27.6459%2020.4167%2027.7011%2020.4576%2027.7505%2020.5066C27.7999%2020.5556%2027.8412%2020.6107%2027.8745%2020.6718C27.9077%2020.733%2027.9315%2020.7976%2027.9458%2020.8656C27.9602%2020.9337%2027.9644%2021.0024%2027.9587%2021.0717C27.9648%2021.1402%2027.9612%2021.2083%2027.9478%2021.2757C27.9344%2021.3432%2027.912%2021.4074%2027.8801%2021.4683C27.8483%2021.5293%2027.8086%2021.5846%2027.7609%2021.6341C27.7132%2021.6837%2027.6593%2021.7254%2027.5996%2021.7596C27.2884%2021.9045%2026.9613%2021.9685%2026.6184%2021.9518C26.1786%2021.9465%2025.7436%2021.8977%2025.3135%2021.8051ZM21.3382%2018.6238C21.3445%2018.5593%2021.343%2018.495%2021.3335%2018.4308C21.3241%2018.3667%2021.3069%2018.3046%2021.2822%2018.2447C21.2575%2018.1847%2021.226%2018.1287%2021.1876%2018.0765C21.1492%2018.0242%2021.1049%2017.9774%2021.055%2017.936C20.9359%2017.8608%2020.808%2017.806%2020.6714%2017.7714C20.5349%2017.7368%2020.3964%2017.7242%2020.2558%2017.7337C19.8009%2017.7395%2019.356%2017.8087%2018.9208%2017.9411L18.9208%2016.9598C19.4252%2016.8181%2019.9393%2016.7524%2020.4633%2016.7626C20.7322%2016.7484%2020.9964%2016.7773%2021.256%2016.8491C21.5156%2016.9209%2021.7571%2017.032%2021.9806%2017.1824C22.0729%2017.2601%2022.1548%2017.3474%2022.2263%2017.4446C22.2978%2017.5418%2022.3567%2017.646%2022.4034%2017.7573C22.45%2017.8686%2022.483%2017.9838%2022.5021%2018.1029C22.5213%2018.222%2022.5261%2018.3417%2022.5167%2018.462C22.5245%2018.7882%2022.4655%2019.1017%2022.3396%2019.4027C22.1879%2019.7384%2021.984%2020.0384%2021.7277%2020.3029C21.3021%2020.7337%2020.8502%2021.135%2020.3721%2021.5067L19.9928%2021.8051L19.9928%2021.8759L22.6938%2021.8759L22.6938%2022.8419L18.5464%2022.8419L18.5464%2021.7697C19.2882%2021.1796%2019.8579%2020.6975%2020.2558%2020.3232C20.574%2020.0432%2020.8523%2019.728%2021.0905%2019.3774C21.1675%2019.2665%2021.2269%2019.1469%2021.2691%2019.0187C21.3113%2018.8904%2021.3344%2018.7588%2021.3382%2018.6238ZM12.3102%2017.2127L12.3102%2018.1939L13.7769%2017.9107L13.7769%2022.8419L14.9605%2022.8419L14.9605%2016.8486L14.0957%2016.8486L12.3102%2017.2127ZM28.5524%2028.0475C28.5524%2028.104%2028.5467%2028.1599%2028.5353%2028.2152C28.5239%2028.2706%2028.5071%2028.3244%2028.4849%2028.3766C28.4626%2028.4287%2028.4352%2028.4782%2028.4028%2028.5252C28.3705%2028.5721%2028.3337%2028.6156%2028.2925%2028.6555C28.2513%2028.6954%2028.2067%2028.731%2028.1583%2028.7624C28.1098%2028.7937%2028.0587%2028.8202%2028.0049%2028.8418C27.9511%2028.8634%2027.8957%2028.8798%2027.8385%2028.8908C27.7814%2028.9018%2027.7235%2028.9073%2027.6653%2028.9073L24.1832%2028.8418L24.1832%2030.3617L29.1397%2030.3617C29.2082%2030.3617%2029.276%2030.3552%2029.3432%2030.3423C29.4104%2030.3293%2029.4756%2030.3101%2029.5389%2030.2847C29.6022%2030.2593%2029.6625%2030.2281%2029.7195%2030.1912C29.7765%2030.1543%2029.829%2030.1124%2029.8774%2030.0654C29.9259%2030.0184%2029.9693%2029.9673%2030.0074%2029.9121C30.0454%2029.8569%2030.0774%2029.7986%2030.1037%2029.7373C30.1299%2029.6759%2030.1497%2029.6126%2030.163%2029.5475C30.1764%2029.4823%2030.1831%2029.4166%2030.1832%2029.3502L30.1832%2026.0478L28.4785%2026L28.5524%2028.0475ZM11.6308%2028.0099C11.6308%2028.0664%2011.6365%2028.1223%2011.6479%2028.1777C11.6592%2028.233%2011.676%2028.2868%2011.6983%2028.339C11.7206%2028.3911%2011.748%2028.4406%2011.7803%2028.4876C11.8127%2028.5345%2011.8495%2028.578%2011.8906%2028.6179C11.9318%2028.6578%2011.9765%2028.6934%2012.0249%2028.7248C12.0733%2028.7562%2012.1244%2028.7826%2012.1783%2028.8042C12.2321%2028.8259%2012.2875%2028.8422%2012.3446%2028.8532C12.4017%2028.8642%2012.4596%2028.8697%2012.5178%2028.8698L16%2028.8042L16%2030.3241L11.0435%2030.3241C10.975%2030.3241%2010.9071%2030.3176%2010.8399%2030.3047C10.7727%2030.2917%2010.7076%2030.2725%2010.6443%2030.2471C10.581%2030.2217%2010.5206%2030.1906%2010.4637%2030.1537C10.4067%2030.1168%2010.3542%2030.0748%2010.3057%2030.0278C10.2573%2029.9809%2010.2138%2029.9298%2010.1758%2029.8745C10.1377%2029.8193%2010.1057%2029.7611%2010.0795%2029.6997C10.0533%2029.6383%2010.0335%2029.575%2010.0201%2029.5099C10.0068%2029.4448%2010%2029.379%2010%2029.3126L10%2026.0478L11.7047%2026L11.6308%2028.0099Z'%20fill='rgb(14,191,241)'%20fill-rule='evenodd'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Ie = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2040'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40.000000'%20height='40.000000'%20fill='none'%20customFrame='url(%23clipPath_9)'%3e%3cdefs%3e%3cclipPath%20id='clipPath_9'%3e%3crect%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_10'%3e%3crect%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_11'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3c/defs%3e%3crect%20id='3'%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(236,250,254)'%20/%3e%3cg%20id='画板%202310'%20customFrame='url(%23clipPath_10)'%3e%3crect%20id='画板%202310'%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cg%20id='人事服务'%3e%3cg%20id='ic_public_link'%20clip-path='url(%23clipPath_11)'%20customFrame='url(%23clipPath_11)'%3e%3crect%20id='ic_public_link'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20/%3e%3cpath%20id='path1'%20d='M9.9999%2019.9917C9.9999%2018.4292%209.99573%2016.8667%209.9999%2015.3042C9.99573%2014.5459%2010.0916%2013.7917%2010.2749%2013.0626C10.6874%2011.5126%2011.6957%2010.5917%2013.2457%2010.2334C14.0207%2010.0667%2014.8166%209.98756%2015.6082%2010.0001C18.6041%2010.0001%2021.5999%2010.0001%2024.5999%2010.0001C25.3541%209.99589%2026.1082%2010.0792%2026.8457%2010.2584C28.4416%2010.6459%2029.3999%2011.6584%2029.7624%2013.2501C29.9291%2014.0001%2030.0041%2014.7667%2029.9957%2015.5376C29.9957%2018.5667%2029.9957%2021.5959%2029.9957%2024.6209C29.9999%2025.3709%2029.9166%2026.1209%2029.7416%2026.8459C29.3499%2028.4459%2028.3332%2029.3959%2026.7457%2029.7626C25.9666%2029.9292%2025.1749%2030.0084%2024.3791%2029.9959C21.3957%2029.9959%2018.4124%2029.9959%2015.4291%2029.9959C14.6666%2030.0042%2013.9082%2029.9167%2013.1666%2029.7417C11.5624%2029.3542%2010.5999%2028.3376%2010.2374%2026.7376C10.0499%2025.9251%209.9999%2025.1126%209.9999%2024.2917C9.9999%2022.8584%209.9999%2021.4251%209.9999%2019.9917Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3ccircle%20id='path2'%20cx='20'%20cy='20'%20r='10'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cpath%20id='path3'%20d='M25.0333%2021.8666L26.9%2020C28.8083%2018.0916%2028.8083%2015%2026.9%2013.0958C24.9958%2011.1875%2021.9041%2011.1875%2020%2013.0958L18.1291%2014.9625M21.8666%2025.0333L20%2026.9C18.0916%2028.8083%2015%2028.8083%2013.0958%2026.9C11.1875%2024.9958%2011.1875%2021.9041%2013.0958%2020L14.9625%2018.1291'%20fill-rule='nonzero'%20stroke='rgb(14,191,241)'%20stroke-linecap='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='pah4'%20d='M18.125%2021.875L21.875%2018.125'%20stroke='rgb(14,191,241)'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='path5'%20d='M25.8207%2019.2626L24.0457%2021.0376C23.7998%2021.2834%2023.6748%2021.5292%2023.6748%2021.7751C23.6748%2022.0209%2023.7998%2022.2667%2024.0457%2022.5126C24.1498%2022.6167%2024.2665%2022.6959%2024.3915%2022.7459C24.5123%2022.7917%2024.6415%2022.8167%2024.779%2022.8167C24.9207%2022.8167%2025.0498%2022.7917%2025.1665%2022.7459C25.2957%2022.6959%2025.4123%2022.6167%2025.5165%2022.5126L27.2915%2020.7334C27.8165%2020.2126%2028.2165%2019.6334%2028.4957%2019.0001C28.5082%2018.9667%2028.5248%2018.9334%2028.5373%2018.8959C28.554%2018.8626%2028.5665%2018.8292%2028.579%2018.7917C28.8332%2018.1501%2028.9582%2017.4584%2028.9582%2016.7209C28.9582%2015.9792%2028.8332%2015.2876%2028.579%2014.6459C28.5665%2014.6084%2028.554%2014.5751%2028.5373%2014.5417C28.5248%2014.5042%2028.5082%2014.4709%2028.4957%2014.4376C28.2165%2013.8042%2027.8165%2013.2292%2027.2915%2012.7042C26.7707%2012.1792%2026.1915%2011.7792%2025.5582%2011.5001C25.5248%2011.4876%2025.4915%2011.4709%2025.454%2011.4584C25.4207%2011.4417%2025.3873%2011.4292%2025.354%2011.4167C24.7082%2011.1667%2024.0165%2011.0417%2023.279%2011.0417C22.5373%2011.0417%2021.8457%2011.1667%2021.204%2011.4167C21.1665%2011.4292%2021.1332%2011.4417%2021.0998%2011.4584C21.0623%2011.4709%2021.029%2011.4876%2020.9957%2011.5001C20.3623%2011.7792%2019.7832%2012.1792%2019.2623%2012.7042L17.4832%2014.4792C17.379%2014.5834%2017.2998%2014.7001%2017.2498%2014.8292C17.204%2014.9501%2017.179%2015.0751%2017.179%2015.2167C17.179%2015.3542%2017.204%2015.4834%2017.2498%2015.6042C17.2998%2015.7292%2017.379%2015.8459%2017.4832%2015.9542C17.5915%2016.0584%2017.7082%2016.1376%2017.8332%2016.1876C17.954%2016.2334%2018.0832%2016.2584%2018.2207%2016.2584C18.3623%2016.2584%2018.4915%2016.2334%2018.6082%2016.1876C18.7373%2016.1376%2018.854%2016.0584%2018.9582%2015.9542L20.7332%2014.1751C21.0873%2013.8209%2021.4748%2013.5584%2021.8957%2013.3834C22.3165%2013.2084%2022.779%2013.1251%2023.279%2013.1251C23.7748%2013.1251%2024.2373%2013.2084%2024.6582%2013.3834C25.079%2013.5584%2025.4665%2013.8209%2025.8207%2014.1751C26.1748%2014.5292%2026.4373%2014.9167%2026.6123%2015.3376C26.7873%2015.7584%2026.8748%2016.2167%2026.8748%2016.7209C26.8748%2017.2209%2026.7873%2017.6792%2026.6123%2018.1001C26.4373%2018.5209%2026.1748%2018.9084%2025.8207%2019.2626ZM13.3832%2021.8959C13.5582%2021.4751%2013.8207%2021.0876%2014.1748%2020.7334L15.954%2018.9584C16.0582%2018.8542%2016.1373%2018.7376%2016.1873%2018.6084C16.2332%2018.4876%2016.2582%2018.3626%2016.2582%2018.2209C16.2582%2018.0834%2016.2332%2017.9542%2016.1873%2017.8334C16.1373%2017.7084%2016.0582%2017.5917%2015.954%2017.4834C15.7082%2017.2417%2015.4623%2017.1167%2015.2165%2017.1167C14.9707%2017.1167%2014.7248%2017.2417%2014.479%2017.4834L12.704%2019.2626C12.179%2019.7876%2011.779%2020.3626%2011.4998%2020.9959C11.4873%2021.0292%2011.4707%2021.0626%2011.4582%2021.1001C11.4415%2021.1334%2011.429%2021.1667%2011.4165%2021.2042C11.1665%2021.8459%2011.0415%2022.5376%2011.0415%2023.2792C11.0415%2024.0167%2011.1665%2024.7084%2011.4165%2025.3542C11.429%2025.3876%2011.4415%2025.4209%2011.4582%2025.4584C11.4707%2025.4917%2011.4873%2025.5251%2011.4998%2025.5584C11.779%2026.1917%2012.179%2026.7709%2012.704%2027.2917C13.2248%2027.8167%2013.804%2028.2167%2014.4373%2028.4959C14.4707%2028.5084%2014.504%2028.5251%2014.5415%2028.5376C14.5748%2028.5542%2014.6082%2028.5667%2014.6457%2028.5792C15.2873%2028.8292%2015.979%2028.9584%2016.7207%2028.9584C17.4582%2028.9584%2018.1498%2028.8292%2018.7915%2028.5792C18.829%2028.5667%2018.8623%2028.5542%2018.8957%2028.5376C18.9332%2028.5251%2018.9665%2028.5084%2018.9998%2028.4959C19.6332%2028.2167%2020.2123%2027.8167%2020.7332%2027.2917L22.5123%2025.5167C22.6165%2025.4126%2022.6957%2025.2959%2022.7457%2025.1667C22.7915%2025.0459%2022.8165%2024.9209%2022.8165%2024.7792C22.8165%2024.6417%2022.7915%2024.5126%2022.7457%2024.3917C22.6957%2024.2667%2022.6165%2024.1501%2022.5123%2024.0417C22.2665%2023.8001%2022.0207%2023.6751%2021.7748%2023.6751C21.529%2023.6751%2021.2832%2023.8001%2021.0373%2024.0417L19.2623%2025.8209C18.9082%2026.1751%2018.5207%2026.4376%2018.0998%2026.6126C17.679%2026.7876%2017.2165%2026.8751%2016.7207%2026.8751C16.2207%2026.8751%2015.7582%2026.7876%2015.3373%2026.6126C14.9165%2026.4376%2014.529%2026.1751%2014.1748%2025.8209C13.8207%2025.4667%2013.5582%2025.0792%2013.3832%2024.6584C13.2082%2024.2376%2013.1248%2023.7792%2013.1248%2023.2792C13.1248%2022.7751%2013.2082%2022.3167%2013.3832%2021.8959Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3cpath%20id='path6'%20d='M21.8127%2016.7458C21.746%2016.7874%2021.6877%2016.8374%2021.6293%2016.8916L16.8918%2021.6291C16.8377%2021.6874%2016.7877%2021.7499%2016.746%2021.8124C16.7127%2021.8624%2016.6877%2021.9166%2016.6627%2021.9749C16.6377%2022.0374%2016.6168%2022.1041%2016.6043%2022.1708C16.5918%2022.2333%2016.5835%2022.2999%2016.5835%2022.3666C16.5835%2022.4333%2016.5918%2022.4999%2016.6043%2022.5666C16.6168%2022.6333%2016.6377%2022.6999%2016.6627%2022.7624C16.6877%2022.8166%2016.7127%2022.8708%2016.746%2022.9208C16.7877%2022.9874%2016.8377%2023.0499%2016.8918%2023.1041C16.946%2023.1583%2017.0085%2023.2083%2017.0752%2023.2499C17.1252%2023.2833%2017.1793%2023.3083%2017.2335%2023.3333C17.3002%2023.3583%2017.3627%2023.3791%2017.4293%2023.3916C17.496%2023.4041%2017.5627%2023.4124%2017.6293%2023.4124C17.696%2023.4124%2017.7627%2023.4041%2017.8252%2023.3916C17.8918%2023.3791%2017.9585%2023.3583%2018.021%2023.3333C18.0793%2023.3083%2018.1335%2023.2833%2018.1835%2023.2499C18.246%2023.2083%2018.3085%2023.1583%2018.3668%2023.1041L23.1043%2018.3666C23.1585%2018.3083%2023.2085%2018.2499%2023.2502%2018.1833C23.2835%2018.1333%2023.3085%2018.0791%2023.3335%2018.0208C23.3585%2017.9583%2023.3793%2017.8916%2023.3918%2017.8249C23.4043%2017.7624%2023.4127%2017.6958%2023.4127%2017.6291C23.4127%2017.5624%2023.4043%2017.4958%2023.3918%2017.4291C23.3793%2017.3624%2023.3585%2017.2999%2023.3335%2017.2333C23.3085%2017.1791%2023.2835%2017.1249%2023.2502%2017.0749C23.2085%2017.0083%2023.1585%2016.9458%2023.1043%2016.8916C23.046%2016.8374%2022.9877%2016.7874%2022.921%2016.7458C22.871%2016.7124%2022.8168%2016.6874%2022.7627%2016.6624C22.696%2016.6374%2022.6335%2016.6166%2022.5668%2016.6041C22.5002%2016.5916%2022.4335%2016.5833%2022.3668%2016.5833C22.3002%2016.5833%2022.2335%2016.5916%2022.171%2016.6041C22.1043%2016.6166%2022.0377%2016.6374%2021.9752%2016.6624C21.9168%2016.6874%2021.8627%2016.7124%2021.8127%2016.7458Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Ue = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2040'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40.000000'%20height='40.000000'%20fill='none'%20customFrame='url(%23clipPath_0)'%3e%3cdefs%3e%3cclipPath%20id='clipPath_0'%3e%3crect%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_1'%3e%3crect%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_2'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3c/defs%3e%3crect%20id='1'%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(236,250,254)'%20/%3e%3cg%20id='车辆'%20clip-path='url(%23clipPath_1)'%20customFrame='url(%23clipPath_1)'%3e%3crect%20id='车辆'%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20/%3e%3cg%20id='编组'%3e%3cg%20id='ic_public_qrcode'%20clip-path='url(%23clipPath_2)'%20customFrame='url(%23clipPath_2)'%3e%3crect%20id='ic_public_qrcode'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20/%3e%3cg%20id='ic_public_qrcode_1_1'%3e%3cpath%20id='ic_public_qrcode_2_0'%20d='M10.6273%2019.9924C10.6273%2018.5277%2010.6222%2017.0631%2010.6273%2015.5985C10.6243%2014.8898%2010.7114%2014.1836%2010.8865%2013.4968C11.2702%2012.0432%2012.2171%2011.1805%2013.6693%2010.8458C14.3974%2010.6885%2015.1411%2010.6148%2015.886%2010.6261C18.6946%2010.6261%2021.5035%2010.6261%2024.3127%2010.6261C25.0221%2010.6217%2025.7295%2010.7029%2026.4195%2010.8678C27.9156%2011.2339%2028.8134%2012.1816%2029.1554%2013.6725C29.3092%2014.3772%2029.3826%2015.097%2029.3744%2015.8182C29.3744%2018.6571%2029.3744%2021.4963%2029.3744%2024.3357C29.3782%2025.0383%2029.2973%2025.7388%2029.1334%2026.422C28.7673%2027.9189%2027.8153%2028.8123%2026.3243%2029.1543C25.5961%2029.311%2024.8524%2029.3847%2024.1076%2029.374C21.3107%2029.374%2018.514%2029.374%2015.7176%2029.374C15.0027%2029.3798%2014.2897%2029.2999%2013.5939%2029.136C12.0912%2028.7698%2011.189%2027.8178%2010.8477%2026.3195C10.6734%2025.5579%2010.6273%2024.7941%2010.6273%2024.0237C10.6273%2022.6802%2010.6273%2021.3364%2010.6273%2019.9924Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='nonzero'%20/%3e%3cpath%20id='ic_public_qrcode_2_0'%20d='M10.6273%2015.5985C10.6243%2014.8898%2010.7114%2014.1836%2010.8865%2013.4968C11.2702%2012.0432%2012.2171%2011.1805%2013.6693%2010.8458C14.3974%2010.6885%2015.1411%2010.6148%2015.886%2010.6261C18.6946%2010.6261%2021.5035%2010.6261%2024.3127%2010.6261C25.0221%2010.6217%2025.7295%2010.7029%2026.4195%2010.8678C27.9156%2011.2339%2028.8134%2012.1816%2029.1554%2013.6725C29.3092%2014.3772%2029.3826%2015.097%2029.3744%2015.8182C29.3744%2018.6571%2029.3744%2021.4963%2029.3744%2024.3357C29.3782%2025.0383%2029.2973%2025.7388%2029.1334%2026.422C28.7673%2027.9189%2027.8153%2028.8123%2026.3243%2029.1543C25.5961%2029.311%2024.8524%2029.3847%2024.1076%2029.374C21.3107%2029.374%2018.514%2029.374%2015.7176%2029.374C15.0027%2029.3798%2014.2897%2029.2999%2013.5939%2029.136C12.0912%2028.7698%2011.189%2027.8178%2010.8477%2026.3195C10.6734%2025.5579%2010.6273%2024.7941%2010.6273%2024.0237C10.6273%2022.6802%2010.6273%2021.3364%2010.6273%2019.9924C10.6273%2018.5277%2010.6222%2017.0631%2010.6273%2015.5985Z'%20fill-rule='nonzero'%20stroke='rgb(255,255,255)'%20stroke-opacity='0'%20stroke-width='1.25'%20/%3e%3cpath%20id='ic_public_qrcode_2_1'%20d='M10.6273%2015.5985C10.6243%2014.8898%2010.7114%2014.1836%2010.8865%2013.4968C11.2702%2012.0432%2012.2171%2011.1805%2013.6693%2010.8458C14.3974%2010.6885%2015.1411%2010.6148%2015.886%2010.6261C18.6946%2010.6261%2021.5035%2010.6261%2024.3127%2010.6261C25.0221%2010.6217%2025.7295%2010.7029%2026.4195%2010.8678C27.9156%2011.2339%2028.8134%2012.1816%2029.1554%2013.6725C29.3092%2014.3772%2029.3826%2015.097%2029.3744%2015.8182C29.3744%2018.6571%2029.3744%2021.4963%2029.3744%2024.3357C29.3782%2025.0383%2029.2973%2025.7388%2029.1334%2026.422C28.7673%2027.9189%2027.8153%2028.8123%2026.3243%2029.1543C25.5961%2029.311%2024.8524%2029.3847%2024.1076%2029.374C21.3107%2029.374%2018.514%2029.374%2015.7176%2029.374C15.0027%2029.3798%2014.2897%2029.2999%2013.5939%2029.136C12.0912%2028.7698%2011.189%2027.8178%2010.8477%2026.3195C10.6734%2025.5579%2010.6273%2024.7941%2010.6273%2024.0237C10.6273%2022.6802%2010.6273%2021.3364%2010.6273%2019.9924C10.6273%2018.5277%2010.6222%2017.0631%2010.6273%2015.5985Z'%20opacity='0.200000003'%20fill-rule='nonzero'%20stroke='rgb(255,255,255)'%20stroke-opacity='0'%20stroke-width='1.25'%20/%3e%3ccircle%20id='ic_public_qrcode_2_2'%20cx='20'%20cy='20'%20r='10'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cpath%20id='ic_public_qrcode_2_3'%20d='M17.5%2011.25C17.9602%2011.25%2018.3333%2011.6231%2018.3333%2012.0833L18.3333%2017.5C18.3333%2017.9602%2017.9602%2018.3333%2017.5%2018.3333L12.0833%2018.3333C11.6231%2018.3333%2011.25%2017.9602%2011.25%2017.5L11.25%2012.0833C11.25%2011.6231%2011.6231%2011.25%2012.0833%2011.25L17.5%2011.25ZM17.5%2021.6667C17.9602%2021.6667%2018.3333%2022.0398%2018.3333%2022.5L18.3333%2027.9167C18.3333%2028.3769%2017.9602%2028.75%2017.5%2028.75L12.0833%2028.75C11.6231%2028.75%2011.25%2028.3769%2011.25%2027.9167L11.25%2022.5C11.25%2022.0398%2011.6231%2021.6667%2012.0833%2021.6667L17.5%2021.6667ZM27.9167%2011.25C28.3769%2011.25%2028.75%2011.6231%2028.75%2012.0833L28.75%2017.5C28.75%2017.9602%2028.3769%2018.3333%2027.9167%2018.3333L22.5%2018.3333C22.0398%2018.3333%2021.6667%2017.9602%2021.6667%2017.5L21.6667%2012.0833C21.6667%2011.6231%2022.0398%2011.25%2022.5%2011.25L27.9167%2011.25Z'%20fill-rule='evenodd'%20stroke='rgb(14,191,241)'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='ic_public_qrcode_2_4'%20d='M17.5002%2010.8333C18.1905%2010.8333%2018.7502%2011.3929%2018.7502%2012.0833L18.7502%2017.4999C18.7502%2018.1903%2018.1905%2018.7499%2017.5002%2018.7499L12.0835%2018.7499C11.3931%2018.7499%2010.8335%2018.1903%2010.8335%2017.4999L10.8335%2012.0833C10.8335%2011.3929%2011.3931%2010.8333%2012.0835%2010.8333L17.5002%2010.8333ZM17.5002%2011.6666L12.0835%2011.6666C11.8534%2011.6666%2011.6668%2011.8531%2011.6668%2012.0833L11.6668%2017.4999C11.6668%2017.73%2011.8534%2017.9166%2012.0835%2017.9166L17.5002%2017.9166C17.7303%2017.9166%2017.9168%2017.73%2017.9168%2017.4999L17.9168%2012.0833C17.9168%2011.8531%2017.7303%2011.6666%2017.5002%2011.6666ZM17.5002%2021.2499C18.1905%2021.2499%2018.7502%2021.8096%2018.7502%2022.4999L18.7502%2027.9166C18.7502%2028.6069%2018.1905%2029.1666%2017.5002%2029.1666L12.0835%2029.1666C11.3931%2029.1666%2010.8335%2028.6069%2010.8335%2027.9166L10.8335%2022.4999C10.8335%2021.8096%2011.3931%2021.2499%2012.0835%2021.2499L17.5002%2021.2499ZM17.5002%2022.0833L12.0835%2022.0833C11.8534%2022.0833%2011.6668%2022.2698%2011.6668%2022.4999L11.6668%2027.9166C11.6668%2028.1467%2011.8534%2028.3333%2012.0835%2028.3333L17.5002%2028.3333C17.7303%2028.3333%2017.9168%2028.1467%2017.9168%2027.9166L17.9168%2022.4999C17.9168%2022.2698%2017.7303%2022.0833%2017.5002%2022.0833ZM27.9168%2010.8333C28.6072%2010.8333%2029.1668%2011.3929%2029.1668%2012.0833L29.1668%2017.4999C29.1668%2018.1903%2028.6072%2018.7499%2027.9168%2018.7499L22.5002%2018.7499C21.8098%2018.7499%2021.2502%2018.1903%2021.2502%2017.4999L21.2502%2012.0833C21.2502%2011.3929%2021.8098%2010.8333%2022.5002%2010.8333L27.9168%2010.8333ZM27.9168%2011.6666L22.5002%2011.6666C22.27%2011.6666%2022.0835%2011.8531%2022.0835%2012.0833L22.0835%2017.4999C22.0835%2017.73%2022.27%2017.9166%2022.5002%2017.9166L27.9168%2017.9166C28.1469%2017.9166%2028.3335%2017.73%2028.3335%2017.4999L28.3335%2012.0833C28.3335%2011.8531%2028.1469%2011.6666%2027.9168%2011.6666Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='nonzero'%20/%3e%3cpath%20id='ic_public_qrcode_2_4'%20d='M18.7502%2012.0833L18.7502%2017.4999C18.7502%2018.1903%2018.1905%2018.7499%2017.5002%2018.7499L12.0835%2018.7499C11.3931%2018.7499%2010.8335%2018.1903%2010.8335%2017.4999L10.8335%2012.0833C10.8335%2011.3929%2011.3931%2010.8333%2012.0835%2010.8333L17.5002%2010.8333C18.1905%2010.8333%2018.7502%2011.3929%2018.7502%2012.0833ZM12.0835%2011.6666C11.8534%2011.6666%2011.6668%2011.8531%2011.6668%2012.0833L11.6668%2017.4999C11.6668%2017.73%2011.8534%2017.9166%2012.0835%2017.9166L17.5002%2017.9166C17.7303%2017.9166%2017.9168%2017.73%2017.9168%2017.4999L17.9168%2012.0833C17.9168%2011.8531%2017.7303%2011.6666%2017.5002%2011.6666L12.0835%2011.6666ZM18.7502%2022.4999L18.7502%2027.9166C18.7502%2028.6069%2018.1905%2029.1666%2017.5002%2029.1666L12.0835%2029.1666C11.3931%2029.1666%2010.8335%2028.6069%2010.8335%2027.9166L10.8335%2022.4999C10.8335%2021.8096%2011.3931%2021.2499%2012.0835%2021.2499L17.5002%2021.2499C18.1905%2021.2499%2018.7502%2021.8096%2018.7502%2022.4999ZM12.0835%2022.0833C11.8534%2022.0833%2011.6668%2022.2698%2011.6668%2022.4999L11.6668%2027.9166C11.6668%2028.1467%2011.8534%2028.3333%2012.0835%2028.3333L17.5002%2028.3333C17.7303%2028.3333%2017.9168%2028.1467%2017.9168%2027.9166L17.9168%2022.4999C17.9168%2022.2698%2017.7303%2022.0833%2017.5002%2022.0833L12.0835%2022.0833ZM29.1668%2012.0833L29.1668%2017.4999C29.1668%2018.1903%2028.6072%2018.7499%2027.9168%2018.7499L22.5002%2018.7499C21.8098%2018.7499%2021.2502%2018.1903%2021.2502%2017.4999L21.2502%2012.0833C21.2502%2011.3929%2021.8098%2010.8333%2022.5002%2010.8333L27.9168%2010.8333C28.6072%2010.8333%2029.1668%2011.3929%2029.1668%2012.0833ZM22.5002%2011.6666C22.27%2011.6666%2022.0835%2011.8531%2022.0835%2012.0833L22.0835%2017.4999C22.0835%2017.73%2022.27%2017.9166%2022.5002%2017.9166L27.9168%2017.9166C28.1469%2017.9166%2028.3335%2017.73%2028.3335%2017.4999L28.3335%2012.0833C28.3335%2011.8531%2028.1469%2011.6666%2027.9168%2011.6666L22.5002%2011.6666Z'%20fill-rule='nonzero'%20stroke='rgb(255,255,255)'%20stroke-opacity='0'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='ic_public_qrcode_2_5'%20d='M27.9165%2021.6667L27.9165%2024.5834L28.7498%2024.5834L28.7498%2021.6667L27.9165%2021.6667ZM24.5832%2021.6667L24.5832%2022.639L24.5828%2022.6388L24.5832%2024.5834L23.6109%2024.5834L23.6107%2022.6388L21.6665%2022.639L21.6665%2021.6667L24.5832%2021.6667ZM21.6665%2025.8334L21.6665%2028.7501L22.4998%2028.7501L22.4998%2025.8334L21.6665%2025.8334ZM27.9165%2027.9167L27.9165%2028.7501L28.7498%2028.7501L28.7498%2027.9167L27.9165%2027.9167ZM25.8332%2025.8334L25.8332%2026.6667L26.6665%2026.6667L26.6665%2025.8334L25.8332%2025.8334Z'%20fill='rgb(14,191,241)'%20fill-rule='nonzero'%20/%3e%3cpath%20id='ic_public_qrcode_2_5'%20d='M27.9165%2024.5834L28.7498%2024.5834L28.7498%2021.6667L27.9165%2021.6667L27.9165%2024.5834ZM24.5832%2022.639L24.5828%2022.6388L24.5832%2024.5834L23.6109%2024.5834L23.6107%2022.6388L21.6665%2022.639L21.6665%2021.6667L24.5832%2021.6667L24.5832%2022.639ZM21.6665%2028.7501L22.4998%2028.7501L22.4998%2025.8334L21.6665%2025.8334L21.6665%2028.7501ZM27.9165%2028.7501L28.7498%2028.7501L28.7498%2027.9167L27.9165%2027.9167L27.9165%2028.7501ZM25.8332%2026.6667L26.6665%2026.6667L26.6665%2025.8334L25.8332%2025.8334L25.8332%2026.6667Z'%20fill-rule='nonzero'%20stroke='rgb(14,191,241)'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='ic_public_qrcode_2_6'%20d='M14.375%2014.375L14.375%2015.2083L15.2083%2015.2083L15.2083%2014.375L14.375%2014.375ZM14.375%2024.7917L14.375%2025.625L15.2083%2025.625L15.2083%2024.7917L14.375%2024.7917ZM24.7917%2014.375L24.7917%2015.2083L25.625%2015.2083L25.625%2014.375L24.7917%2014.375Z'%20fill='rgb(14,191,241)'%20fill-rule='nonzero'%20/%3e%3cpath%20id='ic_public_qrcode_2_6'%20d='M14.375%2015.2083L15.2083%2015.2083L15.2083%2014.375L14.375%2014.375L14.375%2015.2083ZM14.375%2025.625L15.2083%2025.625L15.2083%2024.7917L14.375%2024.7917L14.375%2025.625ZM24.7917%2015.2083L25.625%2015.2083L25.625%2014.375L24.7917%2014.375L24.7917%2015.2083Z'%20fill-rule='nonzero'%20stroke='rgb(14,191,241)'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Ae = "data:image/svg+xml,%3csvg%20viewBox='0%200%2012%2012'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='12.000000'%20height='12.000000'%20fill='none'%3e%3cdefs%3e%3cfilter%20id='pixso_custom_mask_type_luminance'%3e%3cfeColorMatrix%20type='matrix'%20values='1%200%200%200%200%200%201%200%200%200%200%200%201%200%200%200%200%200%201%200%20'%20/%3e%3c/filter%3e%3c/defs%3e%3cmask%20id='mask_0'%20width='11.999876'%20height='11.999876'%20x='0.000000'%20y='0.000000'%20maskUnits='userSpaceOnUse'%3e%3cg%20filter='url(%23pixso_custom_mask_type_luminance)'%3e%3cg%20id='mask401_19830'%3e%3cpath%20id='蒙版'%20d='M0%200L11.9999%200L11.9999%2011.9999L0%2011.9999L0%200ZM2.69992%201.34999L8.09977%201.34999C9.5082%201.34999%2010.6498%202.49167%2010.6498%203.89998L10.6498%209.2999C10.6498%2010.7082%209.5082%2011.8499%208.09977%2011.8499L2.69992%2011.8499C1.29149%2011.8499%200.149901%2010.7082%200.149901%209.2999L0.149901%203.89998C0.149901%202.49167%201.29149%201.34999%202.69992%201.34999Z'%20fill='rgb(196,196,196)'%20fill-rule='evenodd'%20/%3e%3c/g%3e%3c/g%3e%3c/mask%3e%3crect%20id='ic_public_copy'%20width='12.000000'%20height='12.000000'%20x='0.000000'%20y='0.000000'%20/%3e%3crect%20id='ic_public_copy-复制/base/ic_public_copy'%20width='11.999876'%20height='11.999876'%20x='0.000000'%20y='0.000000'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cpath%20id='path1'%20d='M0.000134537%205.99497C0.000134537%205.05748%20-0.00236544%204.11999%200.000134537%203.1825C-0.00236544%202.72751%200.055134%202.27501%200.165133%201.83752C0.41263%200.907526%201.01762%200.355032%201.94761%200.140034C2.41261%200.040035%202.8901%20-0.00746449%203.3651%203.54269e-05C5.16258%203.54269e-05%206.96006%203.54269e-05%208.76004%203.54269e-05C9.21254%20-0.00246455%209.66503%200.0475349%2010.1075%200.155034C11.065%200.387531%2011.64%200.995025%2011.8575%201.95002C11.9575%202.40001%2012.005%202.86001%2011.9975%203.3225C11.9975%205.13998%2011.9975%206.95746%2011.9975%208.77244C12%209.22244%2011.95%209.67243%2011.845%2010.1099C11.61%2011.0674%2011%2011.6374%2010.0475%2011.8574C9.58003%2011.9574%209.10504%2012.0049%208.62754%2011.9974C6.83756%2011.9974%205.04758%2011.9974%203.2576%2011.9974C2.80011%2012.0024%202.34511%2011.9499%201.90011%2011.8449C0.937625%2011.6124%200.360131%2011.0024%200.142633%2010.0424C0.0301342%209.55494%200.000134537%209.06744%200.000134537%208.57495C0.000134537%207.71495%200.000134537%206.85496%200.000134537%205.99497Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3ccircle%20id='path2'%20cx='5.99993801'%20cy='5.99993801'%20r='5.99993801'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cg%20id='mask'%20mask='url(%23mask_0)'%3e%3cg%20id='组合%208'%3e%3cpath%20id='path'%20d='M11.1%203.89993L11.1%206.8999C11.1%208.55488%209.75502%209.89737%208.10004%209.89737L5.10007%209.89737C3.44258%209.89737%202.1001%208.55488%202.1001%206.8999L2.1001%203.89993C2.1001%202.24245%203.44258%200.897461%205.10007%200.897461L8.10004%200.897461C9.75502%200.897461%2011.1%202.24245%2011.1%203.89993Z'%20fill-rule='nonzero'%20stroke='rgb(25,25,25)'%20stroke-linejoin='round'%20stroke-width='0.749992251'%20/%3e%3c/g%3e%3c/g%3e%3cpath%20id='path4'%20d='M2.10008%202.39746L8.10002%202.39746C8.92751%202.39746%209.6%203.06995%209.6%203.89995L9.6%209.89738C9.6%2010.7274%208.92751%2011.3999%208.10002%2011.3999L2.10008%2011.3999C1.27009%2011.3999%200.600098%2010.7274%200.600098%209.89738L0.600098%203.89995C0.600098%203.06995%201.27009%202.39746%202.10008%202.39746Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3cpath%20id='path4'%20d='M9.6%203.89995L9.6%209.89738C9.6%2010.7274%208.92751%2011.3999%208.10002%2011.3999L2.10008%2011.3999C1.27009%2011.3999%200.600098%2010.7274%200.600098%209.89738L0.600098%203.89995C0.600098%203.06995%201.27009%202.39746%202.10008%202.39746L8.10002%202.39746C8.92751%202.39746%209.6%203.06995%209.6%203.89995Z'%20fill-rule='nonzero'%20stroke='rgb(25,25,25)'%20stroke-linejoin='round'%20stroke-width='0.749992251'%20/%3e%3c/svg%3e", Oe = "https://agent.opentiny.design/tiny-robot", y2 = "https://ai.opentiny.design/next-remoter", v2 = (r) => [
|
|
911
|
+
const m2 = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2039.9692'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40.000000'%20height='39.969238'%20fill='none'%20customFrame='url(%23clipPath_3)'%3e%3cdefs%3e%3cclipPath%20id='clipPath_3'%3e%3crect%20width='40.000000'%20height='39.969238'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_4'%3e%3crect%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='7.984619'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_5'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='9.984619'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_6'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='9.984619'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_7'%3e%3crect%20width='21.666666'%20height='13.333333'%20x='20.000000'%20y='9.984619'%20rx='6.666667'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_8'%3e%3crect%20width='6.666667'%20height='6.666667'%20x='23.333496'%20y='9.984619'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3c/defs%3e%3crect%20id='2'%20width='40.000000'%20height='39.969238'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(239,246,255)'%20/%3e%3cg%20id='物业'%20clip-path='url(%23clipPath_4)'%20customFrame='url(%23clipPath_4)'%3e%3crect%20id='物业'%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='7.984619'%20/%3e%3cg%20id='物业服务'%3e%3cg%20id='00公共/红点/图标+红点'%20customFrame='url(%23clipPath_5)'%3e%3crect%20id='00公共/红点/图标+红点'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='9.984619'%20/%3e%3cg%20id='common_chats_line'%20customFrame='url(%23clipPath_6)'%3e%3crect%20id='common_chats_line'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='9.984619'%20/%3e%3cpath%20id='形状'%20d='M28.3332%2019.9847C28.3332%2015.3823%2024.6022%2011.6514%2019.9998%2011.6514C15.3975%2011.6514%2011.6665%2015.3823%2011.6665%2019.9847C11.6665%2024.5871%2015.3975%2028.318%2019.9998%2028.318C21.0018%2028.318%2021.9624%2028.1412%2022.8522%2027.8171L26.581%2028.1578C26.7205%2028.1706%2026.8611%2028.1598%2026.9971%2028.1259C27.6669%2027.959%2028.0746%2027.2806%2027.9077%2026.6108L27.2716%2024.0578C27.9477%2022.8535%2028.3332%2021.4641%2028.3332%2019.9847ZM19.9998%2013.1514C16.2259%2013.1514%2013.1665%2016.2108%2013.1665%2019.9847C13.1665%2023.7586%2016.2259%2026.818%2019.9998%2026.818C20.8089%2026.818%2021.5967%2026.678%2022.3388%2026.4077C22.505%2026.3471%2022.6803%2026.3166%2022.8565%2026.3171L22.9887%2026.3233L26.3665%2026.6322L25.8161%2024.4205C25.7352%2024.0958%2025.7655%2023.7548%2025.8997%2023.4512L25.9636%2023.3236C26.5311%2022.3126%2026.8332%2021.1723%2026.8332%2019.9847C26.8332%2016.2108%2023.7738%2013.1514%2019.9998%2013.1514ZM23.1152%2021.2468C23.352%2020.9069%2023.2684%2020.4394%2022.9286%2020.2026C22.5887%2019.9659%2022.1212%2020.0494%2021.8845%2020.3893C21.2894%2021.2433%2020.4268%2021.7347%2019.5102%2021.7347C18.9513%2021.7347%2018.4132%2021.554%2017.9375%2021.2122C17.6011%2020.9705%2017.1325%2021.0472%2016.8908%2021.3836C16.6491%2021.7199%2016.7258%2022.1886%2017.0622%2022.4303C17.7879%2022.9518%2018.6305%2023.2347%2019.5102%2023.2347C20.9394%2023.2347%2022.2505%2022.4878%2023.1152%2021.2468Z'%20fill='rgb(65,142,255)'%20fill-rule='evenodd'%20/%3e%3c/g%3e%3cg%20id='00公共/3位数红点'%20opacity='0'%20customFrame='url(%23clipPath_7)'%3e%3crect%20id='00公共/3位数红点'%20width='21.666666'%20height='13.333333'%20x='20.000000'%20y='9.984619'%20rx='6.666667'%20opacity='0'%20fill='rgb(243,111,100)'%20/%3e%3cpath%20id='文本'%20d='M26.0421%2013.4421C26.4259%2013.4421%2026.7677%2013.5255%2027.0675%2013.6923C27.3672%2013.8591%2027.6005%2014.0931%2027.7673%2014.3942C27.9342%2014.694%2028.0176%2015.0351%2028.0176%2015.4176C28.0176%2015.7173%2027.9633%2015.994%2027.8548%2016.2476C27.7463%2016.4999%2027.5673%2016.8315%2027.3177%2017.2425L25.859%2019.6432L25.0167%2019.6432L26.276%2017.5924C26.3534%2017.4704%2026.4307%2017.3564%2026.508%2017.2507C26.3357%2017.3063%2026.1445%2017.3341%2025.9342%2017.3341C25.5721%2017.3341%2025.2493%2017.2479%2024.9658%2017.0757C24.6837%2016.9034%2024.4633%2016.6701%2024.3046%2016.3758C24.1459%2016.0815%2024.0666%2015.7566%2024.0666%2015.4013C24.0666%2015.0351%2024.1513%2014.7021%2024.3209%2014.4023C24.4904%2014.1012%2024.7264%2013.8659%2025.0289%2013.6964C25.3314%2013.5268%2025.6691%2013.4421%2026.0421%2013.4421ZM26.0421%2016.6505C26.4029%2016.6505%2026.6904%2016.5325%2026.9047%2016.2965C27.119%2016.0605%2027.2262%2015.7539%2027.2262%2015.3769C27.2262%2014.9985%2027.119%2014.694%2026.9047%2014.4634C26.6904%2014.2328%2026.4029%2014.1175%2026.0421%2014.1175C25.6867%2014.1175%2025.4019%2014.2342%2025.1876%2014.4674C24.9733%2014.7007%2024.8661%2015.0039%2024.8661%2015.3769C24.8661%2015.7539%2024.9719%2016.0605%2025.1835%2016.2965C25.3951%2016.5325%2025.6813%2016.6505%2026.0421%2016.6505ZM30.7921%2013.4421C31.1759%2013.4421%2031.5177%2013.5255%2031.8175%2013.6923C32.1172%2013.8591%2032.3505%2014.0931%2032.5173%2014.3942C32.6842%2014.694%2032.7676%2015.0351%2032.7676%2015.4176C32.7676%2015.7173%2032.7133%2015.994%2032.6048%2016.2476C32.4963%2016.4999%2032.3173%2016.8315%2032.0677%2017.2425L30.609%2019.6432L29.7667%2019.6432L31.026%2017.5924C31.1034%2017.4704%2031.1807%2017.3564%2031.258%2017.2507C31.0857%2017.3063%2030.8945%2017.3341%2030.6842%2017.3341C30.3221%2017.3341%2029.9993%2017.2479%2029.7158%2017.0757C29.4337%2016.9034%2029.2133%2016.6701%2029.0546%2016.3758C28.8959%2016.0815%2028.8166%2015.7566%2028.8166%2015.4013C28.8166%2015.0351%2028.9013%2014.7021%2029.0709%2014.4023C29.2404%2014.1012%2029.4764%2013.8659%2029.7789%2013.6964C30.0814%2013.5268%2030.4191%2013.4421%2030.7921%2013.4421ZM30.7921%2016.6505C31.1529%2016.6505%2031.4404%2016.5325%2031.6547%2016.2965C31.869%2016.0605%2031.9762%2015.7539%2031.9762%2015.3769C31.9762%2014.9985%2031.869%2014.694%2031.6547%2014.4634C31.4404%2014.2328%2031.1529%2014.1175%2030.7921%2014.1175C30.4367%2014.1175%2030.1519%2014.2342%2029.9376%2014.4674C29.7233%2014.7007%2029.6161%2015.0039%2029.6161%2015.3769C29.6161%2015.7539%2029.7219%2016.0605%2029.9335%2016.2965C30.1451%2016.5325%2030.4313%2016.6505%2030.7921%2016.6505ZM35.2674%2014.6851L35.9001%2014.6851L35.9001%2016.3188L37.5339%2016.3188L37.5339%2016.9516L35.9001%2016.9516L35.9001%2018.5853L35.2674%2018.5853L35.2674%2016.9516L33.6337%2016.9516L33.6337%2016.3188L35.2674%2016.3188L35.2674%2014.6851Z'%20fill='rgb(255,255,255)'%20fill-rule='nonzero'%20/%3e%3c/g%3e%3cg%20id='00公共/单红点'%20opacity='0'%20customFrame='url(%23clipPath_8)'%3e%3crect%20id='00公共/单红点'%20width='6.666667'%20height='6.666667'%20x='23.333496'%20y='9.984619'%20opacity='0'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3ccircle%20id='红点'%20cx='26.6668301'%20cy='13.3179522'%20r='3.33333325'%20fill='rgb(243,111,100)'%20/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", g2 = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2040'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40.000000'%20height='40.000000'%20fill='none'%20customFrame='url(%23clipPath_12)'%3e%3cdefs%3e%3cclipPath%20id='clipPath_12'%3e%3crect%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_13'%3e%3crect%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_14'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3c/defs%3e%3crect%20id='4'%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(234,255,244)'%20/%3e%3cg%20id='我的信息'%20clip-path='url(%23clipPath_13)'%20customFrame='url(%23clipPath_13)'%3e%3crect%20id='我的信息'%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20/%3e%3cg%20id='组合%208'%20customFrame='url(%23clipPath_14)'%3e%3crect%20id='组合%208'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20/%3e%3cpath%20id='合并'%20d='M28.4994%2012.3142C28.4994%2012.2578%2028.4937%2012.2018%2028.4825%2012.1465C28.4713%2012.0911%2028.4547%2012.0373%2028.4327%2011.9851C28.4107%2011.933%2028.3836%2011.8835%2028.3516%2011.8365C28.3197%2011.7896%2028.2834%2011.7461%2028.2427%2011.7062C28.202%2011.6663%2028.1579%2011.6307%2028.1101%2011.5993C28.0622%2011.568%2028.0117%2011.5415%2027.9585%2011.5199C27.9054%2011.4983%2027.8506%2011.4819%2027.7942%2011.4709C27.7378%2011.4599%2027.6806%2011.4544%2027.6231%2011.4544L24.1832%2011.5199L24.1832%2010L29.0796%2010C29.1472%2010%2029.2143%2010.0065%2029.2806%2010.0194C29.347%2010.0324%2029.4114%2010.0516%2029.4739%2010.077C29.5364%2010.1024%2029.5961%2010.1336%2029.6523%2010.1705C29.7086%2010.2074%2029.7605%2010.2493%2029.8084%2010.2963C29.8562%2010.3433%2029.8991%2010.3944%2029.9367%2010.4496C29.9743%2010.5048%2030.006%2010.5631%2030.0319%2010.6244C30.0578%2010.6858%2030.0773%2010.7491%2030.0905%2010.8142C30.1037%2010.8794%2030.1104%2010.9451%2030.1104%2011.0115L30.1832%2014.4522L28.4992%2014.5L28.4994%2012.3142ZM11.6995%2012.3143C11.6995%2012.2579%2011.7051%2012.2019%2011.7163%2012.1466C11.7275%2012.0912%2011.7441%2012.0374%2011.7661%2011.9852C11.7882%2011.9331%2011.8152%2011.8836%2011.8472%2011.8366C11.8791%2011.7897%2011.9155%2011.7462%2011.9562%2011.7063C11.9968%2011.6664%2012.0409%2011.6308%2012.0888%2011.5994C12.1366%2011.5681%2012.1871%2011.5416%2012.2403%2011.52C12.2934%2011.4984%2012.3482%2011.482%2012.4046%2011.471C12.4611%2011.46%2012.5182%2011.4545%2012.5758%2011.4545L16.0157%2011.52L16.0157%2010.0001L11.1193%2010.0001C11.0516%2010.0001%2010.9846%2010.0066%2010.9182%2010.0196C10.8518%2010.0325%2010.7874%2010.0517%2010.7249%2010.0771C10.6624%2010.1025%2010.6028%2010.1337%2010.5465%2010.1706C10.4902%2010.2075%2010.4383%2010.2494%2010.3904%2010.2964C10.3426%2010.3434%2010.2997%2010.3945%2010.2621%2010.4497C10.2245%2010.5049%2010.1929%2010.5632%2010.167%2010.6245C10.1411%2010.6859%2010.1215%2010.7492%2010.1083%2010.8143C10.0951%2010.8795%2010.0885%2010.9452%2010.0884%2011.0116L10.0157%2014.4523L11.6997%2014.5L11.6995%2012.3143ZM25.3135%2021.8051L25.3135%2022.8167C25.7656%2022.8929%2026.2209%2022.9249%2026.6792%2022.9127C28.3381%2022.9127%2029.1675%2022.326%2029.1675%2021.1527C29.1733%2020.9869%2029.151%2020.825%2029.1006%2020.667C29.0503%2020.509%2028.9747%2020.3641%2028.8742%2020.2322C28.767%2020.1025%2028.6403%2019.9963%2028.4938%2019.9134C28.3474%2019.8306%2028.191%2019.7767%2028.0246%2019.7517L28.0246%2019.7011C28.0971%2019.6839%2028.1676%2019.6606%2028.236%2019.6311C28.3044%2019.6016%2028.3698%2019.5665%2028.4321%2019.5257C28.4944%2019.4848%2028.5526%2019.4389%2028.6069%2019.3879C28.6613%2019.3369%2028.7109%2019.2816%2028.7556%2019.222C28.8003%2019.1624%2028.8394%2019.0994%2028.8732%2019.033C28.9069%2018.9665%2028.9346%2018.8977%2028.9564%2018.8265C28.9782%2018.7552%2028.9937%2018.6826%2029.0028%2018.6086C29.0119%2018.5347%2029.0145%2018.4605%2029.0107%2018.3861C29.0217%2018.2675%2029.0176%2018.1495%2028.9984%2018.0319C28.9791%2017.9144%2028.9454%2017.8012%2028.8971%2017.6923C28.8489%2017.5834%2028.7875%2017.4823%2028.7134%2017.3891C28.6393%2017.2959%2028.5547%2017.2135%2028.4595%2017.1419C28.219%2017.0003%2027.963%2016.8972%2027.6915%2016.8326C27.4199%2016.7679%2027.1449%2016.7446%2026.8664%2016.7626C26.6258%2016.7621%2026.3864%2016.7791%2026.1482%2016.8132C25.9479%2016.8386%2025.7504%2016.8791%2025.5563%2016.9346L25.5563%2017.8854C25.743%2017.8264%2025.9337%2017.7842%2026.128%2017.759C26.3276%2017.73%2026.5282%2017.7148%2026.7298%2017.7134C27.0252%2017.6949%2027.3049%2017.7523%2027.5692%2017.8854C27.6168%2017.9161%2027.6595%2017.9525%2027.6972%2017.9947C27.7348%2018.037%2027.766%2018.0835%2027.791%2018.1343C27.816%2018.1851%2027.8337%2018.2383%2027.8441%2018.294C27.8545%2018.3496%2027.8573%2018.4056%2027.8525%2018.462C27.8566%2018.5278%2027.8514%2018.5927%2027.8367%2018.657C27.822%2018.7212%2027.7986%2018.7821%2027.7663%2018.8395C27.734%2018.897%2027.694%2018.9487%2027.6468%2018.9946C27.5995%2019.0405%2027.5468%2019.0787%2027.4885%2019.1093C27.1544%2019.2631%2026.8037%2019.3306%2026.4364%2019.3117L25.9862%2019.3117L25.9862%2020.1917L26.4466%2020.1917C26.8409%2020.1669%2027.2202%2020.2309%2027.5845%2020.3839C27.6459%2020.4167%2027.7011%2020.4576%2027.7505%2020.5066C27.7999%2020.5556%2027.8412%2020.6107%2027.8745%2020.6718C27.9077%2020.733%2027.9315%2020.7976%2027.9458%2020.8656C27.9602%2020.9337%2027.9644%2021.0024%2027.9587%2021.0717C27.9648%2021.1402%2027.9612%2021.2083%2027.9478%2021.2757C27.9344%2021.3432%2027.912%2021.4074%2027.8801%2021.4683C27.8483%2021.5293%2027.8086%2021.5846%2027.7609%2021.6341C27.7132%2021.6837%2027.6593%2021.7254%2027.5996%2021.7596C27.2884%2021.9045%2026.9613%2021.9685%2026.6184%2021.9518C26.1786%2021.9465%2025.7436%2021.8977%2025.3135%2021.8051ZM21.3382%2018.6238C21.3445%2018.5593%2021.343%2018.495%2021.3335%2018.4308C21.3241%2018.3667%2021.3069%2018.3046%2021.2822%2018.2447C21.2575%2018.1847%2021.226%2018.1287%2021.1876%2018.0765C21.1492%2018.0242%2021.1049%2017.9774%2021.055%2017.936C20.9359%2017.8608%2020.808%2017.806%2020.6714%2017.7714C20.5349%2017.7368%2020.3964%2017.7242%2020.2558%2017.7337C19.8009%2017.7395%2019.356%2017.8087%2018.9208%2017.9411L18.9208%2016.9598C19.4252%2016.8181%2019.9393%2016.7524%2020.4633%2016.7626C20.7322%2016.7484%2020.9964%2016.7773%2021.256%2016.8491C21.5156%2016.9209%2021.7571%2017.032%2021.9806%2017.1824C22.0729%2017.2601%2022.1548%2017.3474%2022.2263%2017.4446C22.2978%2017.5418%2022.3567%2017.646%2022.4034%2017.7573C22.45%2017.8686%2022.483%2017.9838%2022.5021%2018.1029C22.5213%2018.222%2022.5261%2018.3417%2022.5167%2018.462C22.5245%2018.7882%2022.4655%2019.1017%2022.3396%2019.4027C22.1879%2019.7384%2021.984%2020.0384%2021.7277%2020.3029C21.3021%2020.7337%2020.8502%2021.135%2020.3721%2021.5067L19.9928%2021.8051L19.9928%2021.8759L22.6938%2021.8759L22.6938%2022.8419L18.5464%2022.8419L18.5464%2021.7697C19.2882%2021.1796%2019.8579%2020.6975%2020.2558%2020.3232C20.574%2020.0432%2020.8523%2019.728%2021.0905%2019.3774C21.1675%2019.2665%2021.2269%2019.1469%2021.2691%2019.0187C21.3113%2018.8904%2021.3344%2018.7588%2021.3382%2018.6238ZM12.3102%2017.2127L12.3102%2018.1939L13.7769%2017.9107L13.7769%2022.8419L14.9605%2022.8419L14.9605%2016.8486L14.0957%2016.8486L12.3102%2017.2127ZM28.5524%2028.0475C28.5524%2028.104%2028.5467%2028.1599%2028.5353%2028.2152C28.5239%2028.2706%2028.5071%2028.3244%2028.4849%2028.3766C28.4626%2028.4287%2028.4352%2028.4782%2028.4028%2028.5252C28.3705%2028.5721%2028.3337%2028.6156%2028.2925%2028.6555C28.2513%2028.6954%2028.2067%2028.731%2028.1583%2028.7624C28.1098%2028.7937%2028.0587%2028.8202%2028.0049%2028.8418C27.9511%2028.8634%2027.8957%2028.8798%2027.8385%2028.8908C27.7814%2028.9018%2027.7235%2028.9073%2027.6653%2028.9073L24.1832%2028.8418L24.1832%2030.3617L29.1397%2030.3617C29.2082%2030.3617%2029.276%2030.3552%2029.3432%2030.3423C29.4104%2030.3293%2029.4756%2030.3101%2029.5389%2030.2847C29.6022%2030.2593%2029.6625%2030.2281%2029.7195%2030.1912C29.7765%2030.1543%2029.829%2030.1124%2029.8774%2030.0654C29.9259%2030.0184%2029.9693%2029.9673%2030.0074%2029.9121C30.0454%2029.8569%2030.0774%2029.7986%2030.1037%2029.7373C30.1299%2029.6759%2030.1497%2029.6126%2030.163%2029.5475C30.1764%2029.4823%2030.1831%2029.4166%2030.1832%2029.3502L30.1832%2026.0478L28.4785%2026L28.5524%2028.0475ZM11.6308%2028.0099C11.6308%2028.0664%2011.6365%2028.1223%2011.6479%2028.1777C11.6592%2028.233%2011.676%2028.2868%2011.6983%2028.339C11.7206%2028.3911%2011.748%2028.4406%2011.7803%2028.4876C11.8127%2028.5345%2011.8495%2028.578%2011.8906%2028.6179C11.9318%2028.6578%2011.9765%2028.6934%2012.0249%2028.7248C12.0733%2028.7562%2012.1244%2028.7826%2012.1783%2028.8042C12.2321%2028.8259%2012.2875%2028.8422%2012.3446%2028.8532C12.4017%2028.8642%2012.4596%2028.8697%2012.5178%2028.8698L16%2028.8042L16%2030.3241L11.0435%2030.3241C10.975%2030.3241%2010.9071%2030.3176%2010.8399%2030.3047C10.7727%2030.2917%2010.7076%2030.2725%2010.6443%2030.2471C10.581%2030.2217%2010.5206%2030.1906%2010.4637%2030.1537C10.4067%2030.1168%2010.3542%2030.0748%2010.3057%2030.0278C10.2573%2029.9809%2010.2138%2029.9298%2010.1758%2029.8745C10.1377%2029.8193%2010.1057%2029.7611%2010.0795%2029.6997C10.0533%2029.6383%2010.0335%2029.575%2010.0201%2029.5099C10.0068%2029.4448%2010%2029.379%2010%2029.3126L10%2026.0478L11.7047%2026L11.6308%2028.0099Z'%20fill='rgb(14,191,241)'%20fill-rule='evenodd'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", u2 = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2040'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40.000000'%20height='40.000000'%20fill='none'%20customFrame='url(%23clipPath_9)'%3e%3cdefs%3e%3cclipPath%20id='clipPath_9'%3e%3crect%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_10'%3e%3crect%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_11'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3c/defs%3e%3crect%20id='3'%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(236,250,254)'%20/%3e%3cg%20id='画板%202310'%20customFrame='url(%23clipPath_10)'%3e%3crect%20id='画板%202310'%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cg%20id='人事服务'%3e%3cg%20id='ic_public_link'%20clip-path='url(%23clipPath_11)'%20customFrame='url(%23clipPath_11)'%3e%3crect%20id='ic_public_link'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20/%3e%3cpath%20id='path1'%20d='M9.9999%2019.9917C9.9999%2018.4292%209.99573%2016.8667%209.9999%2015.3042C9.99573%2014.5459%2010.0916%2013.7917%2010.2749%2013.0626C10.6874%2011.5126%2011.6957%2010.5917%2013.2457%2010.2334C14.0207%2010.0667%2014.8166%209.98756%2015.6082%2010.0001C18.6041%2010.0001%2021.5999%2010.0001%2024.5999%2010.0001C25.3541%209.99589%2026.1082%2010.0792%2026.8457%2010.2584C28.4416%2010.6459%2029.3999%2011.6584%2029.7624%2013.2501C29.9291%2014.0001%2030.0041%2014.7667%2029.9957%2015.5376C29.9957%2018.5667%2029.9957%2021.5959%2029.9957%2024.6209C29.9999%2025.3709%2029.9166%2026.1209%2029.7416%2026.8459C29.3499%2028.4459%2028.3332%2029.3959%2026.7457%2029.7626C25.9666%2029.9292%2025.1749%2030.0084%2024.3791%2029.9959C21.3957%2029.9959%2018.4124%2029.9959%2015.4291%2029.9959C14.6666%2030.0042%2013.9082%2029.9167%2013.1666%2029.7417C11.5624%2029.3542%2010.5999%2028.3376%2010.2374%2026.7376C10.0499%2025.9251%209.9999%2025.1126%209.9999%2024.2917C9.9999%2022.8584%209.9999%2021.4251%209.9999%2019.9917Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3ccircle%20id='path2'%20cx='20'%20cy='20'%20r='10'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cpath%20id='path3'%20d='M25.0333%2021.8666L26.9%2020C28.8083%2018.0916%2028.8083%2015%2026.9%2013.0958C24.9958%2011.1875%2021.9041%2011.1875%2020%2013.0958L18.1291%2014.9625M21.8666%2025.0333L20%2026.9C18.0916%2028.8083%2015%2028.8083%2013.0958%2026.9C11.1875%2024.9958%2011.1875%2021.9041%2013.0958%2020L14.9625%2018.1291'%20fill-rule='nonzero'%20stroke='rgb(14,191,241)'%20stroke-linecap='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='pah4'%20d='M18.125%2021.875L21.875%2018.125'%20stroke='rgb(14,191,241)'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='path5'%20d='M25.8207%2019.2626L24.0457%2021.0376C23.7998%2021.2834%2023.6748%2021.5292%2023.6748%2021.7751C23.6748%2022.0209%2023.7998%2022.2667%2024.0457%2022.5126C24.1498%2022.6167%2024.2665%2022.6959%2024.3915%2022.7459C24.5123%2022.7917%2024.6415%2022.8167%2024.779%2022.8167C24.9207%2022.8167%2025.0498%2022.7917%2025.1665%2022.7459C25.2957%2022.6959%2025.4123%2022.6167%2025.5165%2022.5126L27.2915%2020.7334C27.8165%2020.2126%2028.2165%2019.6334%2028.4957%2019.0001C28.5082%2018.9667%2028.5248%2018.9334%2028.5373%2018.8959C28.554%2018.8626%2028.5665%2018.8292%2028.579%2018.7917C28.8332%2018.1501%2028.9582%2017.4584%2028.9582%2016.7209C28.9582%2015.9792%2028.8332%2015.2876%2028.579%2014.6459C28.5665%2014.6084%2028.554%2014.5751%2028.5373%2014.5417C28.5248%2014.5042%2028.5082%2014.4709%2028.4957%2014.4376C28.2165%2013.8042%2027.8165%2013.2292%2027.2915%2012.7042C26.7707%2012.1792%2026.1915%2011.7792%2025.5582%2011.5001C25.5248%2011.4876%2025.4915%2011.4709%2025.454%2011.4584C25.4207%2011.4417%2025.3873%2011.4292%2025.354%2011.4167C24.7082%2011.1667%2024.0165%2011.0417%2023.279%2011.0417C22.5373%2011.0417%2021.8457%2011.1667%2021.204%2011.4167C21.1665%2011.4292%2021.1332%2011.4417%2021.0998%2011.4584C21.0623%2011.4709%2021.029%2011.4876%2020.9957%2011.5001C20.3623%2011.7792%2019.7832%2012.1792%2019.2623%2012.7042L17.4832%2014.4792C17.379%2014.5834%2017.2998%2014.7001%2017.2498%2014.8292C17.204%2014.9501%2017.179%2015.0751%2017.179%2015.2167C17.179%2015.3542%2017.204%2015.4834%2017.2498%2015.6042C17.2998%2015.7292%2017.379%2015.8459%2017.4832%2015.9542C17.5915%2016.0584%2017.7082%2016.1376%2017.8332%2016.1876C17.954%2016.2334%2018.0832%2016.2584%2018.2207%2016.2584C18.3623%2016.2584%2018.4915%2016.2334%2018.6082%2016.1876C18.7373%2016.1376%2018.854%2016.0584%2018.9582%2015.9542L20.7332%2014.1751C21.0873%2013.8209%2021.4748%2013.5584%2021.8957%2013.3834C22.3165%2013.2084%2022.779%2013.1251%2023.279%2013.1251C23.7748%2013.1251%2024.2373%2013.2084%2024.6582%2013.3834C25.079%2013.5584%2025.4665%2013.8209%2025.8207%2014.1751C26.1748%2014.5292%2026.4373%2014.9167%2026.6123%2015.3376C26.7873%2015.7584%2026.8748%2016.2167%2026.8748%2016.7209C26.8748%2017.2209%2026.7873%2017.6792%2026.6123%2018.1001C26.4373%2018.5209%2026.1748%2018.9084%2025.8207%2019.2626ZM13.3832%2021.8959C13.5582%2021.4751%2013.8207%2021.0876%2014.1748%2020.7334L15.954%2018.9584C16.0582%2018.8542%2016.1373%2018.7376%2016.1873%2018.6084C16.2332%2018.4876%2016.2582%2018.3626%2016.2582%2018.2209C16.2582%2018.0834%2016.2332%2017.9542%2016.1873%2017.8334C16.1373%2017.7084%2016.0582%2017.5917%2015.954%2017.4834C15.7082%2017.2417%2015.4623%2017.1167%2015.2165%2017.1167C14.9707%2017.1167%2014.7248%2017.2417%2014.479%2017.4834L12.704%2019.2626C12.179%2019.7876%2011.779%2020.3626%2011.4998%2020.9959C11.4873%2021.0292%2011.4707%2021.0626%2011.4582%2021.1001C11.4415%2021.1334%2011.429%2021.1667%2011.4165%2021.2042C11.1665%2021.8459%2011.0415%2022.5376%2011.0415%2023.2792C11.0415%2024.0167%2011.1665%2024.7084%2011.4165%2025.3542C11.429%2025.3876%2011.4415%2025.4209%2011.4582%2025.4584C11.4707%2025.4917%2011.4873%2025.5251%2011.4998%2025.5584C11.779%2026.1917%2012.179%2026.7709%2012.704%2027.2917C13.2248%2027.8167%2013.804%2028.2167%2014.4373%2028.4959C14.4707%2028.5084%2014.504%2028.5251%2014.5415%2028.5376C14.5748%2028.5542%2014.6082%2028.5667%2014.6457%2028.5792C15.2873%2028.8292%2015.979%2028.9584%2016.7207%2028.9584C17.4582%2028.9584%2018.1498%2028.8292%2018.7915%2028.5792C18.829%2028.5667%2018.8623%2028.5542%2018.8957%2028.5376C18.9332%2028.5251%2018.9665%2028.5084%2018.9998%2028.4959C19.6332%2028.2167%2020.2123%2027.8167%2020.7332%2027.2917L22.5123%2025.5167C22.6165%2025.4126%2022.6957%2025.2959%2022.7457%2025.1667C22.7915%2025.0459%2022.8165%2024.9209%2022.8165%2024.7792C22.8165%2024.6417%2022.7915%2024.5126%2022.7457%2024.3917C22.6957%2024.2667%2022.6165%2024.1501%2022.5123%2024.0417C22.2665%2023.8001%2022.0207%2023.6751%2021.7748%2023.6751C21.529%2023.6751%2021.2832%2023.8001%2021.0373%2024.0417L19.2623%2025.8209C18.9082%2026.1751%2018.5207%2026.4376%2018.0998%2026.6126C17.679%2026.7876%2017.2165%2026.8751%2016.7207%2026.8751C16.2207%2026.8751%2015.7582%2026.7876%2015.3373%2026.6126C14.9165%2026.4376%2014.529%2026.1751%2014.1748%2025.8209C13.8207%2025.4667%2013.5582%2025.0792%2013.3832%2024.6584C13.2082%2024.2376%2013.1248%2023.7792%2013.1248%2023.2792C13.1248%2022.7751%2013.2082%2022.3167%2013.3832%2021.8959Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3cpath%20id='path6'%20d='M21.8127%2016.7458C21.746%2016.7874%2021.6877%2016.8374%2021.6293%2016.8916L16.8918%2021.6291C16.8377%2021.6874%2016.7877%2021.7499%2016.746%2021.8124C16.7127%2021.8624%2016.6877%2021.9166%2016.6627%2021.9749C16.6377%2022.0374%2016.6168%2022.1041%2016.6043%2022.1708C16.5918%2022.2333%2016.5835%2022.2999%2016.5835%2022.3666C16.5835%2022.4333%2016.5918%2022.4999%2016.6043%2022.5666C16.6168%2022.6333%2016.6377%2022.6999%2016.6627%2022.7624C16.6877%2022.8166%2016.7127%2022.8708%2016.746%2022.9208C16.7877%2022.9874%2016.8377%2023.0499%2016.8918%2023.1041C16.946%2023.1583%2017.0085%2023.2083%2017.0752%2023.2499C17.1252%2023.2833%2017.1793%2023.3083%2017.2335%2023.3333C17.3002%2023.3583%2017.3627%2023.3791%2017.4293%2023.3916C17.496%2023.4041%2017.5627%2023.4124%2017.6293%2023.4124C17.696%2023.4124%2017.7627%2023.4041%2017.8252%2023.3916C17.8918%2023.3791%2017.9585%2023.3583%2018.021%2023.3333C18.0793%2023.3083%2018.1335%2023.2833%2018.1835%2023.2499C18.246%2023.2083%2018.3085%2023.1583%2018.3668%2023.1041L23.1043%2018.3666C23.1585%2018.3083%2023.2085%2018.2499%2023.2502%2018.1833C23.2835%2018.1333%2023.3085%2018.0791%2023.3335%2018.0208C23.3585%2017.9583%2023.3793%2017.8916%2023.3918%2017.8249C23.4043%2017.7624%2023.4127%2017.6958%2023.4127%2017.6291C23.4127%2017.5624%2023.4043%2017.4958%2023.3918%2017.4291C23.3793%2017.3624%2023.3585%2017.2999%2023.3335%2017.2333C23.3085%2017.1791%2023.2835%2017.1249%2023.2502%2017.0749C23.2085%2017.0083%2023.1585%2016.9458%2023.1043%2016.8916C23.046%2016.8374%2022.9877%2016.7874%2022.921%2016.7458C22.871%2016.7124%2022.8168%2016.6874%2022.7627%2016.6624C22.696%2016.6374%2022.6335%2016.6166%2022.5668%2016.6041C22.5002%2016.5916%2022.4335%2016.5833%2022.3668%2016.5833C22.3002%2016.5833%2022.2335%2016.5916%2022.171%2016.6041C22.1043%2016.6166%2022.0377%2016.6374%2021.9752%2016.6624C21.9168%2016.6874%2021.8627%2016.7124%2021.8127%2016.7458Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", f2 = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2040'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40.000000'%20height='40.000000'%20fill='none'%20customFrame='url(%23clipPath_0)'%3e%3cdefs%3e%3cclipPath%20id='clipPath_0'%3e%3crect%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_1'%3e%3crect%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_2'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3c/defs%3e%3crect%20id='1'%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(236,250,254)'%20/%3e%3cg%20id='车辆'%20clip-path='url(%23clipPath_1)'%20customFrame='url(%23clipPath_1)'%3e%3crect%20id='车辆'%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20/%3e%3cg%20id='编组'%3e%3cg%20id='ic_public_qrcode'%20clip-path='url(%23clipPath_2)'%20customFrame='url(%23clipPath_2)'%3e%3crect%20id='ic_public_qrcode'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20/%3e%3cg%20id='ic_public_qrcode_1_1'%3e%3cpath%20id='ic_public_qrcode_2_0'%20d='M10.6273%2019.9924C10.6273%2018.5277%2010.6222%2017.0631%2010.6273%2015.5985C10.6243%2014.8898%2010.7114%2014.1836%2010.8865%2013.4968C11.2702%2012.0432%2012.2171%2011.1805%2013.6693%2010.8458C14.3974%2010.6885%2015.1411%2010.6148%2015.886%2010.6261C18.6946%2010.6261%2021.5035%2010.6261%2024.3127%2010.6261C25.0221%2010.6217%2025.7295%2010.7029%2026.4195%2010.8678C27.9156%2011.2339%2028.8134%2012.1816%2029.1554%2013.6725C29.3092%2014.3772%2029.3826%2015.097%2029.3744%2015.8182C29.3744%2018.6571%2029.3744%2021.4963%2029.3744%2024.3357C29.3782%2025.0383%2029.2973%2025.7388%2029.1334%2026.422C28.7673%2027.9189%2027.8153%2028.8123%2026.3243%2029.1543C25.5961%2029.311%2024.8524%2029.3847%2024.1076%2029.374C21.3107%2029.374%2018.514%2029.374%2015.7176%2029.374C15.0027%2029.3798%2014.2897%2029.2999%2013.5939%2029.136C12.0912%2028.7698%2011.189%2027.8178%2010.8477%2026.3195C10.6734%2025.5579%2010.6273%2024.7941%2010.6273%2024.0237C10.6273%2022.6802%2010.6273%2021.3364%2010.6273%2019.9924Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='nonzero'%20/%3e%3cpath%20id='ic_public_qrcode_2_0'%20d='M10.6273%2015.5985C10.6243%2014.8898%2010.7114%2014.1836%2010.8865%2013.4968C11.2702%2012.0432%2012.2171%2011.1805%2013.6693%2010.8458C14.3974%2010.6885%2015.1411%2010.6148%2015.886%2010.6261C18.6946%2010.6261%2021.5035%2010.6261%2024.3127%2010.6261C25.0221%2010.6217%2025.7295%2010.7029%2026.4195%2010.8678C27.9156%2011.2339%2028.8134%2012.1816%2029.1554%2013.6725C29.3092%2014.3772%2029.3826%2015.097%2029.3744%2015.8182C29.3744%2018.6571%2029.3744%2021.4963%2029.3744%2024.3357C29.3782%2025.0383%2029.2973%2025.7388%2029.1334%2026.422C28.7673%2027.9189%2027.8153%2028.8123%2026.3243%2029.1543C25.5961%2029.311%2024.8524%2029.3847%2024.1076%2029.374C21.3107%2029.374%2018.514%2029.374%2015.7176%2029.374C15.0027%2029.3798%2014.2897%2029.2999%2013.5939%2029.136C12.0912%2028.7698%2011.189%2027.8178%2010.8477%2026.3195C10.6734%2025.5579%2010.6273%2024.7941%2010.6273%2024.0237C10.6273%2022.6802%2010.6273%2021.3364%2010.6273%2019.9924C10.6273%2018.5277%2010.6222%2017.0631%2010.6273%2015.5985Z'%20fill-rule='nonzero'%20stroke='rgb(255,255,255)'%20stroke-opacity='0'%20stroke-width='1.25'%20/%3e%3cpath%20id='ic_public_qrcode_2_1'%20d='M10.6273%2015.5985C10.6243%2014.8898%2010.7114%2014.1836%2010.8865%2013.4968C11.2702%2012.0432%2012.2171%2011.1805%2013.6693%2010.8458C14.3974%2010.6885%2015.1411%2010.6148%2015.886%2010.6261C18.6946%2010.6261%2021.5035%2010.6261%2024.3127%2010.6261C25.0221%2010.6217%2025.7295%2010.7029%2026.4195%2010.8678C27.9156%2011.2339%2028.8134%2012.1816%2029.1554%2013.6725C29.3092%2014.3772%2029.3826%2015.097%2029.3744%2015.8182C29.3744%2018.6571%2029.3744%2021.4963%2029.3744%2024.3357C29.3782%2025.0383%2029.2973%2025.7388%2029.1334%2026.422C28.7673%2027.9189%2027.8153%2028.8123%2026.3243%2029.1543C25.5961%2029.311%2024.8524%2029.3847%2024.1076%2029.374C21.3107%2029.374%2018.514%2029.374%2015.7176%2029.374C15.0027%2029.3798%2014.2897%2029.2999%2013.5939%2029.136C12.0912%2028.7698%2011.189%2027.8178%2010.8477%2026.3195C10.6734%2025.5579%2010.6273%2024.7941%2010.6273%2024.0237C10.6273%2022.6802%2010.6273%2021.3364%2010.6273%2019.9924C10.6273%2018.5277%2010.6222%2017.0631%2010.6273%2015.5985Z'%20opacity='0.200000003'%20fill-rule='nonzero'%20stroke='rgb(255,255,255)'%20stroke-opacity='0'%20stroke-width='1.25'%20/%3e%3ccircle%20id='ic_public_qrcode_2_2'%20cx='20'%20cy='20'%20r='10'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cpath%20id='ic_public_qrcode_2_3'%20d='M17.5%2011.25C17.9602%2011.25%2018.3333%2011.6231%2018.3333%2012.0833L18.3333%2017.5C18.3333%2017.9602%2017.9602%2018.3333%2017.5%2018.3333L12.0833%2018.3333C11.6231%2018.3333%2011.25%2017.9602%2011.25%2017.5L11.25%2012.0833C11.25%2011.6231%2011.6231%2011.25%2012.0833%2011.25L17.5%2011.25ZM17.5%2021.6667C17.9602%2021.6667%2018.3333%2022.0398%2018.3333%2022.5L18.3333%2027.9167C18.3333%2028.3769%2017.9602%2028.75%2017.5%2028.75L12.0833%2028.75C11.6231%2028.75%2011.25%2028.3769%2011.25%2027.9167L11.25%2022.5C11.25%2022.0398%2011.6231%2021.6667%2012.0833%2021.6667L17.5%2021.6667ZM27.9167%2011.25C28.3769%2011.25%2028.75%2011.6231%2028.75%2012.0833L28.75%2017.5C28.75%2017.9602%2028.3769%2018.3333%2027.9167%2018.3333L22.5%2018.3333C22.0398%2018.3333%2021.6667%2017.9602%2021.6667%2017.5L21.6667%2012.0833C21.6667%2011.6231%2022.0398%2011.25%2022.5%2011.25L27.9167%2011.25Z'%20fill-rule='evenodd'%20stroke='rgb(14,191,241)'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='ic_public_qrcode_2_4'%20d='M17.5002%2010.8333C18.1905%2010.8333%2018.7502%2011.3929%2018.7502%2012.0833L18.7502%2017.4999C18.7502%2018.1903%2018.1905%2018.7499%2017.5002%2018.7499L12.0835%2018.7499C11.3931%2018.7499%2010.8335%2018.1903%2010.8335%2017.4999L10.8335%2012.0833C10.8335%2011.3929%2011.3931%2010.8333%2012.0835%2010.8333L17.5002%2010.8333ZM17.5002%2011.6666L12.0835%2011.6666C11.8534%2011.6666%2011.6668%2011.8531%2011.6668%2012.0833L11.6668%2017.4999C11.6668%2017.73%2011.8534%2017.9166%2012.0835%2017.9166L17.5002%2017.9166C17.7303%2017.9166%2017.9168%2017.73%2017.9168%2017.4999L17.9168%2012.0833C17.9168%2011.8531%2017.7303%2011.6666%2017.5002%2011.6666ZM17.5002%2021.2499C18.1905%2021.2499%2018.7502%2021.8096%2018.7502%2022.4999L18.7502%2027.9166C18.7502%2028.6069%2018.1905%2029.1666%2017.5002%2029.1666L12.0835%2029.1666C11.3931%2029.1666%2010.8335%2028.6069%2010.8335%2027.9166L10.8335%2022.4999C10.8335%2021.8096%2011.3931%2021.2499%2012.0835%2021.2499L17.5002%2021.2499ZM17.5002%2022.0833L12.0835%2022.0833C11.8534%2022.0833%2011.6668%2022.2698%2011.6668%2022.4999L11.6668%2027.9166C11.6668%2028.1467%2011.8534%2028.3333%2012.0835%2028.3333L17.5002%2028.3333C17.7303%2028.3333%2017.9168%2028.1467%2017.9168%2027.9166L17.9168%2022.4999C17.9168%2022.2698%2017.7303%2022.0833%2017.5002%2022.0833ZM27.9168%2010.8333C28.6072%2010.8333%2029.1668%2011.3929%2029.1668%2012.0833L29.1668%2017.4999C29.1668%2018.1903%2028.6072%2018.7499%2027.9168%2018.7499L22.5002%2018.7499C21.8098%2018.7499%2021.2502%2018.1903%2021.2502%2017.4999L21.2502%2012.0833C21.2502%2011.3929%2021.8098%2010.8333%2022.5002%2010.8333L27.9168%2010.8333ZM27.9168%2011.6666L22.5002%2011.6666C22.27%2011.6666%2022.0835%2011.8531%2022.0835%2012.0833L22.0835%2017.4999C22.0835%2017.73%2022.27%2017.9166%2022.5002%2017.9166L27.9168%2017.9166C28.1469%2017.9166%2028.3335%2017.73%2028.3335%2017.4999L28.3335%2012.0833C28.3335%2011.8531%2028.1469%2011.6666%2027.9168%2011.6666Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='nonzero'%20/%3e%3cpath%20id='ic_public_qrcode_2_4'%20d='M18.7502%2012.0833L18.7502%2017.4999C18.7502%2018.1903%2018.1905%2018.7499%2017.5002%2018.7499L12.0835%2018.7499C11.3931%2018.7499%2010.8335%2018.1903%2010.8335%2017.4999L10.8335%2012.0833C10.8335%2011.3929%2011.3931%2010.8333%2012.0835%2010.8333L17.5002%2010.8333C18.1905%2010.8333%2018.7502%2011.3929%2018.7502%2012.0833ZM12.0835%2011.6666C11.8534%2011.6666%2011.6668%2011.8531%2011.6668%2012.0833L11.6668%2017.4999C11.6668%2017.73%2011.8534%2017.9166%2012.0835%2017.9166L17.5002%2017.9166C17.7303%2017.9166%2017.9168%2017.73%2017.9168%2017.4999L17.9168%2012.0833C17.9168%2011.8531%2017.7303%2011.6666%2017.5002%2011.6666L12.0835%2011.6666ZM18.7502%2022.4999L18.7502%2027.9166C18.7502%2028.6069%2018.1905%2029.1666%2017.5002%2029.1666L12.0835%2029.1666C11.3931%2029.1666%2010.8335%2028.6069%2010.8335%2027.9166L10.8335%2022.4999C10.8335%2021.8096%2011.3931%2021.2499%2012.0835%2021.2499L17.5002%2021.2499C18.1905%2021.2499%2018.7502%2021.8096%2018.7502%2022.4999ZM12.0835%2022.0833C11.8534%2022.0833%2011.6668%2022.2698%2011.6668%2022.4999L11.6668%2027.9166C11.6668%2028.1467%2011.8534%2028.3333%2012.0835%2028.3333L17.5002%2028.3333C17.7303%2028.3333%2017.9168%2028.1467%2017.9168%2027.9166L17.9168%2022.4999C17.9168%2022.2698%2017.7303%2022.0833%2017.5002%2022.0833L12.0835%2022.0833ZM29.1668%2012.0833L29.1668%2017.4999C29.1668%2018.1903%2028.6072%2018.7499%2027.9168%2018.7499L22.5002%2018.7499C21.8098%2018.7499%2021.2502%2018.1903%2021.2502%2017.4999L21.2502%2012.0833C21.2502%2011.3929%2021.8098%2010.8333%2022.5002%2010.8333L27.9168%2010.8333C28.6072%2010.8333%2029.1668%2011.3929%2029.1668%2012.0833ZM22.5002%2011.6666C22.27%2011.6666%2022.0835%2011.8531%2022.0835%2012.0833L22.0835%2017.4999C22.0835%2017.73%2022.27%2017.9166%2022.5002%2017.9166L27.9168%2017.9166C28.1469%2017.9166%2028.3335%2017.73%2028.3335%2017.4999L28.3335%2012.0833C28.3335%2011.8531%2028.1469%2011.6666%2027.9168%2011.6666L22.5002%2011.6666Z'%20fill-rule='nonzero'%20stroke='rgb(255,255,255)'%20stroke-opacity='0'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='ic_public_qrcode_2_5'%20d='M27.9165%2021.6667L27.9165%2024.5834L28.7498%2024.5834L28.7498%2021.6667L27.9165%2021.6667ZM24.5832%2021.6667L24.5832%2022.639L24.5828%2022.6388L24.5832%2024.5834L23.6109%2024.5834L23.6107%2022.6388L21.6665%2022.639L21.6665%2021.6667L24.5832%2021.6667ZM21.6665%2025.8334L21.6665%2028.7501L22.4998%2028.7501L22.4998%2025.8334L21.6665%2025.8334ZM27.9165%2027.9167L27.9165%2028.7501L28.7498%2028.7501L28.7498%2027.9167L27.9165%2027.9167ZM25.8332%2025.8334L25.8332%2026.6667L26.6665%2026.6667L26.6665%2025.8334L25.8332%2025.8334Z'%20fill='rgb(14,191,241)'%20fill-rule='nonzero'%20/%3e%3cpath%20id='ic_public_qrcode_2_5'%20d='M27.9165%2024.5834L28.7498%2024.5834L28.7498%2021.6667L27.9165%2021.6667L27.9165%2024.5834ZM24.5832%2022.639L24.5828%2022.6388L24.5832%2024.5834L23.6109%2024.5834L23.6107%2022.6388L21.6665%2022.639L21.6665%2021.6667L24.5832%2021.6667L24.5832%2022.639ZM21.6665%2028.7501L22.4998%2028.7501L22.4998%2025.8334L21.6665%2025.8334L21.6665%2028.7501ZM27.9165%2028.7501L28.7498%2028.7501L28.7498%2027.9167L27.9165%2027.9167L27.9165%2028.7501ZM25.8332%2026.6667L26.6665%2026.6667L26.6665%2025.8334L25.8332%2025.8334L25.8332%2026.6667Z'%20fill-rule='nonzero'%20stroke='rgb(14,191,241)'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='ic_public_qrcode_2_6'%20d='M14.375%2014.375L14.375%2015.2083L15.2083%2015.2083L15.2083%2014.375L14.375%2014.375ZM14.375%2024.7917L14.375%2025.625L15.2083%2025.625L15.2083%2024.7917L14.375%2024.7917ZM24.7917%2014.375L24.7917%2015.2083L25.625%2015.2083L25.625%2014.375L24.7917%2014.375Z'%20fill='rgb(14,191,241)'%20fill-rule='nonzero'%20/%3e%3cpath%20id='ic_public_qrcode_2_6'%20d='M14.375%2015.2083L15.2083%2015.2083L15.2083%2014.375L14.375%2014.375L14.375%2015.2083ZM14.375%2025.625L15.2083%2025.625L15.2083%2024.7917L14.375%2024.7917L14.375%2025.625ZM24.7917%2015.2083L25.625%2015.2083L25.625%2014.375L24.7917%2014.375L24.7917%2015.2083Z'%20fill-rule='nonzero'%20stroke='rgb(14,191,241)'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", w2 = "data:image/svg+xml,%3csvg%20viewBox='0%200%2012%2012'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='12.000000'%20height='12.000000'%20fill='none'%3e%3cdefs%3e%3cfilter%20id='pixso_custom_mask_type_luminance'%3e%3cfeColorMatrix%20type='matrix'%20values='1%200%200%200%200%200%201%200%200%200%200%200%201%200%200%200%200%200%201%200%20'%20/%3e%3c/filter%3e%3c/defs%3e%3cmask%20id='mask_0'%20width='11.999876'%20height='11.999876'%20x='0.000000'%20y='0.000000'%20maskUnits='userSpaceOnUse'%3e%3cg%20filter='url(%23pixso_custom_mask_type_luminance)'%3e%3cg%20id='mask401_19830'%3e%3cpath%20id='蒙版'%20d='M0%200L11.9999%200L11.9999%2011.9999L0%2011.9999L0%200ZM2.69992%201.34999L8.09977%201.34999C9.5082%201.34999%2010.6498%202.49167%2010.6498%203.89998L10.6498%209.2999C10.6498%2010.7082%209.5082%2011.8499%208.09977%2011.8499L2.69992%2011.8499C1.29149%2011.8499%200.149901%2010.7082%200.149901%209.2999L0.149901%203.89998C0.149901%202.49167%201.29149%201.34999%202.69992%201.34999Z'%20fill='rgb(196,196,196)'%20fill-rule='evenodd'%20/%3e%3c/g%3e%3c/g%3e%3c/mask%3e%3crect%20id='ic_public_copy'%20width='12.000000'%20height='12.000000'%20x='0.000000'%20y='0.000000'%20/%3e%3crect%20id='ic_public_copy-复制/base/ic_public_copy'%20width='11.999876'%20height='11.999876'%20x='0.000000'%20y='0.000000'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cpath%20id='path1'%20d='M0.000134537%205.99497C0.000134537%205.05748%20-0.00236544%204.11999%200.000134537%203.1825C-0.00236544%202.72751%200.055134%202.27501%200.165133%201.83752C0.41263%200.907526%201.01762%200.355032%201.94761%200.140034C2.41261%200.040035%202.8901%20-0.00746449%203.3651%203.54269e-05C5.16258%203.54269e-05%206.96006%203.54269e-05%208.76004%203.54269e-05C9.21254%20-0.00246455%209.66503%200.0475349%2010.1075%200.155034C11.065%200.387531%2011.64%200.995025%2011.8575%201.95002C11.9575%202.40001%2012.005%202.86001%2011.9975%203.3225C11.9975%205.13998%2011.9975%206.95746%2011.9975%208.77244C12%209.22244%2011.95%209.67243%2011.845%2010.1099C11.61%2011.0674%2011%2011.6374%2010.0475%2011.8574C9.58003%2011.9574%209.10504%2012.0049%208.62754%2011.9974C6.83756%2011.9974%205.04758%2011.9974%203.2576%2011.9974C2.80011%2012.0024%202.34511%2011.9499%201.90011%2011.8449C0.937625%2011.6124%200.360131%2011.0024%200.142633%2010.0424C0.0301342%209.55494%200.000134537%209.06744%200.000134537%208.57495C0.000134537%207.71495%200.000134537%206.85496%200.000134537%205.99497Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3ccircle%20id='path2'%20cx='5.99993801'%20cy='5.99993801'%20r='5.99993801'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cg%20id='mask'%20mask='url(%23mask_0)'%3e%3cg%20id='组合%208'%3e%3cpath%20id='path'%20d='M11.1%203.89993L11.1%206.8999C11.1%208.55488%209.75502%209.89737%208.10004%209.89737L5.10007%209.89737C3.44258%209.89737%202.1001%208.55488%202.1001%206.8999L2.1001%203.89993C2.1001%202.24245%203.44258%200.897461%205.10007%200.897461L8.10004%200.897461C9.75502%200.897461%2011.1%202.24245%2011.1%203.89993Z'%20fill-rule='nonzero'%20stroke='rgb(25,25,25)'%20stroke-linejoin='round'%20stroke-width='0.749992251'%20/%3e%3c/g%3e%3c/g%3e%3cpath%20id='path4'%20d='M2.10008%202.39746L8.10002%202.39746C8.92751%202.39746%209.6%203.06995%209.6%203.89995L9.6%209.89738C9.6%2010.7274%208.92751%2011.3999%208.10002%2011.3999L2.10008%2011.3999C1.27009%2011.3999%200.600098%2010.7274%200.600098%209.89738L0.600098%203.89995C0.600098%203.06995%201.27009%202.39746%202.10008%202.39746Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3cpath%20id='path4'%20d='M9.6%203.89995L9.6%209.89738C9.6%2010.7274%208.92751%2011.3999%208.10002%2011.3999L2.10008%2011.3999C1.27009%2011.3999%200.600098%2010.7274%200.600098%209.89738L0.600098%203.89995C0.600098%203.06995%201.27009%202.39746%202.10008%202.39746L8.10002%202.39746C8.92751%202.39746%209.6%203.06995%209.6%203.89995Z'%20fill-rule='nonzero'%20stroke='rgb(25,25,25)'%20stroke-linejoin='round'%20stroke-width='0.749992251'%20/%3e%3c/svg%3e", y2 = "https://agent.opentiny.design/tiny-robot", M = "https://ai.opentiny.design/next-remoter", k = (r) => [
|
|
903
912
|
{
|
|
904
913
|
action: "qr-code",
|
|
905
914
|
show: !0,
|
|
906
915
|
text: "扫码登录",
|
|
907
916
|
desc: "使用手机遥控页面",
|
|
908
|
-
icon:
|
|
917
|
+
icon: f2
|
|
909
918
|
},
|
|
910
919
|
{
|
|
911
920
|
action: "ai-chat",
|
|
912
921
|
show: !0,
|
|
913
922
|
text: "打开对话框",
|
|
914
923
|
desc: "支持在网页端操作AI",
|
|
915
|
-
icon:
|
|
924
|
+
icon: m2
|
|
916
925
|
},
|
|
917
926
|
{
|
|
918
927
|
action: "remote-url",
|
|
@@ -922,7 +931,7 @@ const Pe = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2039.9692'%20xmlns='
|
|
|
922
931
|
active: !0,
|
|
923
932
|
tip: r.remoteUrl,
|
|
924
933
|
showCopyIcon: !0,
|
|
925
|
-
icon:
|
|
934
|
+
icon: u2
|
|
926
935
|
},
|
|
927
936
|
{
|
|
928
937
|
action: "remote-control",
|
|
@@ -931,28 +940,28 @@ const Pe = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2039.9692'%20xmlns='
|
|
|
931
940
|
desc: `${r.sessionId.slice(-6)}`,
|
|
932
941
|
know: !0,
|
|
933
942
|
showCopyIcon: !0,
|
|
934
|
-
icon:
|
|
943
|
+
icon: g2
|
|
935
944
|
}
|
|
936
945
|
];
|
|
937
|
-
class
|
|
946
|
+
class L2 {
|
|
938
947
|
constructor(e) {
|
|
939
948
|
if (this.isExpanded = !1, this.getImageUrl = (t) => {
|
|
940
949
|
if (!t) return;
|
|
941
|
-
const
|
|
942
|
-
return
|
|
950
|
+
const i = new Image();
|
|
951
|
+
return i.src = t, i;
|
|
943
952
|
}, this.renderItem = () => {
|
|
944
953
|
this.menuItems.filter((t) => t.show !== !1).map(
|
|
945
954
|
(t) => {
|
|
946
|
-
const
|
|
947
|
-
if (!
|
|
948
|
-
|
|
949
|
-
const
|
|
950
|
-
|
|
955
|
+
const i = document.getElementById(`tiny-remoter-icon-item-${t.action}`);
|
|
956
|
+
if (!i) return;
|
|
957
|
+
i.innerHTML = "";
|
|
958
|
+
const s = this.getImageUrl(t.icon);
|
|
959
|
+
s && i.appendChild(s);
|
|
951
960
|
}
|
|
952
961
|
);
|
|
953
962
|
}, this.readyTips = (t) => {
|
|
954
|
-
const
|
|
955
|
-
|
|
963
|
+
const i = document.getElementById(t);
|
|
964
|
+
i && new C2(i, {
|
|
956
965
|
content: "复制",
|
|
957
966
|
placement: "top",
|
|
958
967
|
trigger: "hover"
|
|
@@ -961,13 +970,14 @@ class $e {
|
|
|
961
970
|
throw new Error("sessionId is required");
|
|
962
971
|
this.options = {
|
|
963
972
|
...e,
|
|
964
|
-
qrCodeUrl: e.qrCodeUrl ||
|
|
965
|
-
remoteUrl: e.remoteUrl ||
|
|
973
|
+
qrCodeUrl: e.qrCodeUrl || M,
|
|
974
|
+
remoteUrl: e.remoteUrl || y2
|
|
966
975
|
}, this.menuItems = this.mergeMenuItems(e.menuItems), this.init();
|
|
967
976
|
}
|
|
968
977
|
// 计算 sessionPrefix 属性
|
|
969
978
|
get sessionPrefix() {
|
|
970
|
-
|
|
979
|
+
var e;
|
|
980
|
+
return (e = this.options.qrCodeUrl) != null && e.includes("?") ? "&sessionId=" : "?sessionId=";
|
|
971
981
|
}
|
|
972
982
|
/**
|
|
973
983
|
* 合并菜单项配置
|
|
@@ -975,15 +985,15 @@ class $e {
|
|
|
975
985
|
* @returns 合并后的菜单项配置
|
|
976
986
|
*/
|
|
977
987
|
mergeMenuItems(e) {
|
|
978
|
-
return e ?
|
|
979
|
-
const
|
|
980
|
-
return
|
|
988
|
+
return e ? k(this.options).map((t) => {
|
|
989
|
+
const i = e.find((s) => s.action === t.action);
|
|
990
|
+
return i ? {
|
|
981
991
|
...t,
|
|
982
|
-
...
|
|
992
|
+
...i,
|
|
983
993
|
// 确保show属性存在,默认为true
|
|
984
|
-
show:
|
|
994
|
+
show: i.show !== void 0 ? i.show : t.show
|
|
985
995
|
} : t;
|
|
986
|
-
}) :
|
|
996
|
+
}) : k(this.options);
|
|
987
997
|
}
|
|
988
998
|
init() {
|
|
989
999
|
this.createFloatingBlock(), this.createDropdownMenu(), this.bindEvents(), this.addStyles();
|
|
@@ -992,7 +1002,7 @@ class $e {
|
|
|
992
1002
|
createFloatingBlock() {
|
|
993
1003
|
this.floatingBlock = document.createElement("div"), this.floatingBlock.className = "tiny-remoter-floating-block", this.floatingBlock.innerHTML = `
|
|
994
1004
|
<div class="tiny-remoter-floating-block__icon">
|
|
995
|
-
<img style="display: block; width: 56px;" src="${
|
|
1005
|
+
<img style="display: block; width: 56px;" src="${M}/svgs/logo-next-no-bg-left.svg" alt="icon" />
|
|
996
1006
|
</div>
|
|
997
1007
|
`, document.body.appendChild(this.floatingBlock);
|
|
998
1008
|
}
|
|
@@ -1011,7 +1021,7 @@ class $e {
|
|
|
1011
1021
|
<div>
|
|
1012
1022
|
${t.showCopyIcon ? `
|
|
1013
1023
|
<div class="tiny-remoter-copy-icon" id="${t.action}" data-action="${t.action}">
|
|
1014
|
-
<img src="${
|
|
1024
|
+
<img src="${w2}"/>
|
|
1015
1025
|
</div>
|
|
1016
1026
|
` : ""}
|
|
1017
1027
|
</div>
|
|
@@ -1026,15 +1036,15 @@ class $e {
|
|
|
1026
1036
|
this.floatingBlock.addEventListener("click", () => {
|
|
1027
1037
|
this.toggleDropdown();
|
|
1028
1038
|
}), this.dropdownMenu.addEventListener("click", (e) => {
|
|
1029
|
-
const t = e.target,
|
|
1030
|
-
if (
|
|
1039
|
+
const t = e.target, i = t.closest(".tiny-remoter-copy-icon");
|
|
1040
|
+
if (i) {
|
|
1031
1041
|
e.stopPropagation();
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1042
|
+
const n = i.dataset.action;
|
|
1043
|
+
n && this.handleAction(n);
|
|
1034
1044
|
return;
|
|
1035
1045
|
}
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1046
|
+
const s = t.closest(".tiny-remoter-dropdown-item"), o = s == null ? void 0 : s.dataset.action;
|
|
1047
|
+
o && this.handleAction(o);
|
|
1038
1048
|
}), document.addEventListener("click", (e) => {
|
|
1039
1049
|
const t = e.target;
|
|
1040
1050
|
!this.floatingBlock.contains(t) && !this.dropdownMenu.contains(t) && this.closeDropdown();
|
|
@@ -1082,8 +1092,8 @@ class $e {
|
|
|
1082
1092
|
else {
|
|
1083
1093
|
const t = document.createElement("textarea");
|
|
1084
1094
|
t.value = e, t.style.position = "fixed", t.style.left = "-999999px", t.style.top = "-999999px", document.body.appendChild(t), t.focus(), t.select();
|
|
1085
|
-
const
|
|
1086
|
-
document.body.removeChild(t),
|
|
1095
|
+
const i = document.execCommand("copy");
|
|
1096
|
+
document.body.removeChild(t), i ? this.showCopyFeedback(!0) : this.showCopyFeedback(!1);
|
|
1087
1097
|
}
|
|
1088
1098
|
} catch (t) {
|
|
1089
1099
|
console.error("复制失败:", t), this.showCopyFeedback(!1);
|
|
@@ -1091,16 +1101,16 @@ class $e {
|
|
|
1091
1101
|
}
|
|
1092
1102
|
// 显示复制反馈提示
|
|
1093
1103
|
showCopyFeedback(e) {
|
|
1094
|
-
const t = e ? "复制成功!" : "复制失败,请手动复制",
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1104
|
+
const t = e ? "复制成功!" : "复制失败,请手动复制", i = document.createElement("div");
|
|
1105
|
+
i.className = `tiny-remoter-copy-feedback ${e ? "success" : "error"}`, i.textContent = t, document.body.appendChild(i), setTimeout(() => i.classList.add("show"), 10), setTimeout(() => {
|
|
1106
|
+
i.classList.remove("show"), setTimeout(() => {
|
|
1107
|
+
i.parentNode && i.parentNode.removeChild(i);
|
|
1098
1108
|
}, 300);
|
|
1099
1109
|
}, 1500);
|
|
1100
1110
|
}
|
|
1101
1111
|
// 创建二维码弹窗
|
|
1102
1112
|
async showQRCode() {
|
|
1103
|
-
const t = await new
|
|
1113
|
+
const t = await new d2((this.options.qrCodeUrl || "") + this.sessionPrefix + this.options.sessionId, {}).toDataURL(), i = this.createModal(
|
|
1104
1114
|
"扫码前往智能遥控器",
|
|
1105
1115
|
`
|
|
1106
1116
|
<div style="text-align: center; padding: 32px;">
|
|
@@ -1185,15 +1195,16 @@ class $e {
|
|
|
1185
1195
|
</div>
|
|
1186
1196
|
`
|
|
1187
1197
|
);
|
|
1188
|
-
this.showModal(
|
|
1198
|
+
this.showModal(i);
|
|
1189
1199
|
}
|
|
1190
1200
|
// 创建AI对话弹窗--- 暂时调 “用户函数”
|
|
1191
1201
|
showAIChat() {
|
|
1192
|
-
|
|
1202
|
+
var e, t;
|
|
1203
|
+
(t = (e = this.options).onShowAIChat) == null || t.call(e);
|
|
1193
1204
|
}
|
|
1194
1205
|
createModal(e, t) {
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1206
|
+
const i = document.createElement("div");
|
|
1207
|
+
i.className = "tiny-remoter-floating-modal", i.innerHTML = `
|
|
1197
1208
|
<div class="tiny-remoter-modal-overlay"></div>
|
|
1198
1209
|
<div class="tiny-remoter-modal-content">
|
|
1199
1210
|
<div class="tiny-remoter-modal-header">
|
|
@@ -1205,8 +1216,8 @@ class $e {
|
|
|
1205
1216
|
</div>
|
|
1206
1217
|
</div>
|
|
1207
1218
|
`;
|
|
1208
|
-
const
|
|
1209
|
-
return
|
|
1219
|
+
const s = i.querySelector(".tiny-remoter-modal-close"), o = i.querySelector(".tiny-remoter-modal-overlay");
|
|
1220
|
+
return s.addEventListener("click", () => this.hideModal(i)), o.addEventListener("click", () => this.hideModal(i)), i;
|
|
1210
1221
|
}
|
|
1211
1222
|
showModal(e) {
|
|
1212
1223
|
document.body.appendChild(e), setTimeout(() => e.classList.add("show"), 10);
|
|
@@ -1560,1979 +1571,85 @@ class $e {
|
|
|
1560
1571
|
this.floatingBlock.parentNode && this.floatingBlock.parentNode.removeChild(this.floatingBlock), this.dropdownMenu.parentNode && this.dropdownMenu.parentNode.removeChild(this.dropdownMenu);
|
|
1561
1572
|
}
|
|
1562
1573
|
}
|
|
1563
|
-
const
|
|
1564
|
-
class _2 extends Error {
|
|
1565
|
-
constructor(e, t) {
|
|
1566
|
-
super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
function e2(r) {
|
|
1570
|
-
}
|
|
1571
|
-
function qe(r) {
|
|
1572
|
-
if (typeof r == "function")
|
|
1573
|
-
throw new TypeError(
|
|
1574
|
-
"`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"
|
|
1575
|
-
);
|
|
1576
|
-
const { onEvent: e = e2, onError: t = e2, onRetry: s = e2, onComment: i } = r;
|
|
1577
|
-
let n = "", a = !0, l, h = "", c = "";
|
|
1578
|
-
function d(u) {
|
|
1579
|
-
const m = a ? u.replace(/^\xEF\xBB\xBF/, "") : u, [w, v] = je(`${n}${m}`);
|
|
1580
|
-
for (const _ of w)
|
|
1581
|
-
g(_);
|
|
1582
|
-
n = v, a = !1;
|
|
1583
|
-
}
|
|
1584
|
-
function g(u) {
|
|
1585
|
-
if (u === "") {
|
|
1586
|
-
C();
|
|
1587
|
-
return;
|
|
1588
|
-
}
|
|
1589
|
-
if (u.startsWith(":")) {
|
|
1590
|
-
i && i(u.slice(u.startsWith(": ") ? 2 : 1));
|
|
1591
|
-
return;
|
|
1592
|
-
}
|
|
1593
|
-
const m = u.indexOf(":");
|
|
1594
|
-
if (m !== -1) {
|
|
1595
|
-
const w = u.slice(0, m), v = u[m + 1] === " " ? 2 : 1, _ = u.slice(m + v);
|
|
1596
|
-
p(w, _, u);
|
|
1597
|
-
return;
|
|
1598
|
-
}
|
|
1599
|
-
p(u, "", u);
|
|
1600
|
-
}
|
|
1601
|
-
function p(u, m, w) {
|
|
1602
|
-
switch (u) {
|
|
1603
|
-
case "event":
|
|
1604
|
-
c = m;
|
|
1605
|
-
break;
|
|
1606
|
-
case "data":
|
|
1607
|
-
h = `${h}${m}
|
|
1608
|
-
`;
|
|
1609
|
-
break;
|
|
1610
|
-
case "id":
|
|
1611
|
-
l = m.includes("\0") ? void 0 : m;
|
|
1612
|
-
break;
|
|
1613
|
-
case "retry":
|
|
1614
|
-
/^\d+$/.test(m) ? s(parseInt(m, 10)) : t(
|
|
1615
|
-
new _2(`Invalid \`retry\` value: "${m}"`, {
|
|
1616
|
-
type: "invalid-retry",
|
|
1617
|
-
value: m,
|
|
1618
|
-
line: w
|
|
1619
|
-
})
|
|
1620
|
-
);
|
|
1621
|
-
break;
|
|
1622
|
-
default:
|
|
1623
|
-
t(
|
|
1624
|
-
new _2(
|
|
1625
|
-
`Unknown field "${u.length > 20 ? `${u.slice(0, 20)}…` : u}"`,
|
|
1626
|
-
{ type: "unknown-field", field: u, value: m, line: w }
|
|
1627
|
-
)
|
|
1628
|
-
);
|
|
1629
|
-
break;
|
|
1630
|
-
}
|
|
1631
|
-
}
|
|
1632
|
-
function C() {
|
|
1633
|
-
h.length > 0 && e({
|
|
1634
|
-
id: l,
|
|
1635
|
-
event: c || void 0,
|
|
1636
|
-
// If the data buffer's last character is a U+000A LINE FEED (LF) character,
|
|
1637
|
-
// then remove the last character from the data buffer.
|
|
1638
|
-
data: h.endsWith(`
|
|
1639
|
-
`) ? h.slice(0, -1) : h
|
|
1640
|
-
}), l = void 0, h = "", c = "";
|
|
1641
|
-
}
|
|
1642
|
-
function f(u = {}) {
|
|
1643
|
-
n && u.consume && g(n), a = !0, l = void 0, h = "", c = "", n = "";
|
|
1644
|
-
}
|
|
1645
|
-
return { feed: d, reset: f };
|
|
1646
|
-
}
|
|
1647
|
-
function je(r) {
|
|
1648
|
-
const e = [];
|
|
1649
|
-
let t = "", s = 0;
|
|
1650
|
-
for (; s < r.length; ) {
|
|
1651
|
-
const i = r.indexOf("\r", s), n = r.indexOf(`
|
|
1652
|
-
`, s);
|
|
1653
|
-
let a = -1;
|
|
1654
|
-
if (i !== -1 && n !== -1 ? a = Math.min(i, n) : i !== -1 ? i === r.length - 1 ? a = -1 : a = i : n !== -1 && (a = n), a === -1) {
|
|
1655
|
-
t = r.slice(s);
|
|
1656
|
-
break;
|
|
1657
|
-
} else {
|
|
1658
|
-
const l = r.slice(s, a);
|
|
1659
|
-
e.push(l), s = a + 1, r[s - 1] === "\r" && r[s] === `
|
|
1660
|
-
` && s++;
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
return [e, t];
|
|
1664
|
-
}
|
|
1665
|
-
class o2 extends TransformStream {
|
|
1666
|
-
constructor({ onError: e, onRetry: t, onComment: s } = {}) {
|
|
1667
|
-
let i;
|
|
1668
|
-
super({
|
|
1669
|
-
start(n) {
|
|
1670
|
-
i = qe({
|
|
1671
|
-
onEvent: (a) => {
|
|
1672
|
-
n.enqueue(a);
|
|
1673
|
-
},
|
|
1674
|
-
onError(a) {
|
|
1675
|
-
e === "terminate" ? n.error(a) : typeof e == "function" && e(a);
|
|
1676
|
-
},
|
|
1677
|
-
onRetry: t,
|
|
1678
|
-
onComment: s
|
|
1679
|
-
});
|
|
1680
|
-
},
|
|
1681
|
-
transform(n) {
|
|
1682
|
-
i.feed(n);
|
|
1683
|
-
}
|
|
1684
|
-
});
|
|
1685
|
-
}
|
|
1686
|
-
}
|
|
1687
|
-
var He = ({
|
|
1688
|
-
prefix: r,
|
|
1689
|
-
size: e = 16,
|
|
1690
|
-
alphabet: t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
1691
|
-
separator: s = "-"
|
|
1692
|
-
} = {}) => {
|
|
1693
|
-
const i = () => {
|
|
1694
|
-
const n = t.length, a = new Array(e);
|
|
1695
|
-
for (let l = 0; l < e; l++)
|
|
1696
|
-
a[l] = t[Math.random() * n | 0];
|
|
1697
|
-
return a.join("");
|
|
1698
|
-
};
|
|
1699
|
-
if (r == null)
|
|
1700
|
-
return i;
|
|
1701
|
-
if (t.includes(s))
|
|
1702
|
-
throw new _e({
|
|
1703
|
-
argument: "separator",
|
|
1704
|
-
message: `The separator "${s}" must not be part of the alphabet "${t}".`
|
|
1705
|
-
});
|
|
1706
|
-
return () => `${r}${s}${i()}`;
|
|
1707
|
-
};
|
|
1708
|
-
He();
|
|
1709
|
-
function I2(r = globalThis) {
|
|
1710
|
-
var e, t, s;
|
|
1711
|
-
return r.window ? "runtime/browser" : (e = r.navigator) != null && e.userAgent ? `runtime/${r.navigator.userAgent.toLowerCase()}` : (s = (t = r.process) == null ? void 0 : t.versions) != null && s.node ? `runtime/node.js/${r.process.version.substring(0)}` : r.EdgeRuntime ? "runtime/vercel-edge" : "runtime/unknown";
|
|
1712
|
-
}
|
|
1713
|
-
function Ne(r) {
|
|
1714
|
-
if (r == null)
|
|
1715
|
-
return {};
|
|
1716
|
-
const e = {};
|
|
1717
|
-
if (r instanceof Headers)
|
|
1718
|
-
r.forEach((t, s) => {
|
|
1719
|
-
e[s.toLowerCase()] = t;
|
|
1720
|
-
});
|
|
1721
|
-
else {
|
|
1722
|
-
Array.isArray(r) || (r = Object.entries(r));
|
|
1723
|
-
for (const [t, s] of r)
|
|
1724
|
-
s != null && (e[t.toLowerCase()] = s);
|
|
1725
|
-
}
|
|
1726
|
-
return e;
|
|
1727
|
-
}
|
|
1728
|
-
function U2(r, ...e) {
|
|
1729
|
-
const t = new Headers(Ne(r)), s = t.get("user-agent") || "";
|
|
1730
|
-
return t.set(
|
|
1731
|
-
"user-agent",
|
|
1732
|
-
[s, ...e].filter(Boolean).join(" ")
|
|
1733
|
-
), Object.fromEntries(t.entries());
|
|
1734
|
-
}
|
|
1735
|
-
var ze = Symbol.for("vercel.ai.validator");
|
|
1736
|
-
function Ze(r) {
|
|
1737
|
-
return { ...r, type: "dynamic" };
|
|
1738
|
-
}
|
|
1739
|
-
new Set(
|
|
1740
|
-
"ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789"
|
|
1741
|
-
);
|
|
1742
|
-
var De = Symbol.for("vercel.ai.schema");
|
|
1743
|
-
function Fe(r, {
|
|
1744
|
-
validate: e
|
|
1745
|
-
} = {}) {
|
|
1746
|
-
return {
|
|
1747
|
-
[De]: !0,
|
|
1748
|
-
_type: void 0,
|
|
1749
|
-
// should never be used directly
|
|
1750
|
-
[ze]: !0,
|
|
1751
|
-
get jsonSchema() {
|
|
1752
|
-
return typeof r == "function" && (r = r()), r;
|
|
1753
|
-
},
|
|
1754
|
-
validate: e
|
|
1755
|
-
};
|
|
1756
|
-
}
|
|
1757
|
-
let l2;
|
|
1758
|
-
l2 = globalThis.crypto;
|
|
1759
|
-
async function Be(r) {
|
|
1760
|
-
return (await l2).getRandomValues(new Uint8Array(r));
|
|
1761
|
-
}
|
|
1762
|
-
async function Ve(r) {
|
|
1763
|
-
const e = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~", t = Math.pow(2, 8) - Math.pow(2, 8) % e.length;
|
|
1764
|
-
let s = "";
|
|
1765
|
-
for (; s.length < r; ) {
|
|
1766
|
-
const i = await Be(r - s.length);
|
|
1767
|
-
for (const n of i)
|
|
1768
|
-
n < t && (s += e[n % e.length]);
|
|
1769
|
-
}
|
|
1770
|
-
return s;
|
|
1771
|
-
}
|
|
1772
|
-
async function Je(r) {
|
|
1773
|
-
return await Ve(r);
|
|
1774
|
-
}
|
|
1775
|
-
async function We(r) {
|
|
1776
|
-
const e = await (await l2).subtle.digest("SHA-256", new TextEncoder().encode(r));
|
|
1777
|
-
return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g, "_").replace(/\+/g, "-").replace(/=/g, "");
|
|
1778
|
-
}
|
|
1779
|
-
async function Ge(r) {
|
|
1780
|
-
if (r || (r = 43), r < 43 || r > 128)
|
|
1781
|
-
throw `Expected a length between 43 and 128. Received ${r}.`;
|
|
1782
|
-
const e = await Je(r), t = await We(e);
|
|
1783
|
-
return {
|
|
1784
|
-
code_verifier: e,
|
|
1785
|
-
code_challenge: t
|
|
1786
|
-
};
|
|
1787
|
-
}
|
|
1788
|
-
var Ye = "AI_MCPClientError", A2 = `vercel.ai.error.${Ye}`, Ke = Symbol.for(A2), b2, x2, y = class extends (x2 = Z, b2 = Ke, x2) {
|
|
1789
|
-
constructor({
|
|
1790
|
-
name: r = "MCPClientError",
|
|
1791
|
-
message: e,
|
|
1792
|
-
cause: t,
|
|
1793
|
-
data: s,
|
|
1794
|
-
code: i
|
|
1795
|
-
}) {
|
|
1796
|
-
super({ name: r, message: e, cause: t }), this[b2] = !0, this.data = s, this.code = i;
|
|
1797
|
-
}
|
|
1798
|
-
static isInstance(r) {
|
|
1799
|
-
return Z.hasMarker(r, A2);
|
|
1800
|
-
}
|
|
1801
|
-
}, $ = "2025-06-18", Qe = [
|
|
1802
|
-
$,
|
|
1803
|
-
"2025-03-26",
|
|
1804
|
-
"2024-11-05"
|
|
1805
|
-
], Xe = o.looseObject({
|
|
1806
|
-
name: o.string(),
|
|
1807
|
-
version: o.string()
|
|
1808
|
-
}), Y = o.looseObject({
|
|
1809
|
-
_meta: o.optional(o.object({}).loose())
|
|
1810
|
-
}), M = Y, O2 = o.object({
|
|
1811
|
-
method: o.string(),
|
|
1812
|
-
params: o.optional(Y)
|
|
1813
|
-
}), $2 = o.object({
|
|
1814
|
-
applyDefaults: o.optional(o.boolean())
|
|
1815
|
-
}).loose(), et = o.looseObject({
|
|
1816
|
-
experimental: o.optional(o.object({}).loose()),
|
|
1817
|
-
logging: o.optional(o.object({}).loose()),
|
|
1818
|
-
prompts: o.optional(
|
|
1819
|
-
o.looseObject({
|
|
1820
|
-
listChanged: o.optional(o.boolean())
|
|
1821
|
-
})
|
|
1822
|
-
),
|
|
1823
|
-
resources: o.optional(
|
|
1824
|
-
o.looseObject({
|
|
1825
|
-
subscribe: o.optional(o.boolean()),
|
|
1826
|
-
listChanged: o.optional(o.boolean())
|
|
1827
|
-
})
|
|
1828
|
-
),
|
|
1829
|
-
tools: o.optional(
|
|
1830
|
-
o.looseObject({
|
|
1831
|
-
listChanged: o.optional(o.boolean())
|
|
1832
|
-
})
|
|
1833
|
-
),
|
|
1834
|
-
elicitation: o.optional($2)
|
|
1835
|
-
});
|
|
1836
|
-
o.object({
|
|
1837
|
-
elicitation: o.optional($2)
|
|
1838
|
-
}).loose();
|
|
1839
|
-
var tt = M.extend({
|
|
1840
|
-
protocolVersion: o.string(),
|
|
1841
|
-
capabilities: et,
|
|
1842
|
-
serverInfo: Xe,
|
|
1843
|
-
instructions: o.optional(o.string())
|
|
1844
|
-
}), h2 = M.extend({
|
|
1845
|
-
nextCursor: o.optional(o.string())
|
|
1846
|
-
}), rt = o.object({
|
|
1847
|
-
name: o.string(),
|
|
1848
|
-
description: o.optional(o.string()),
|
|
1849
|
-
inputSchema: o.object({
|
|
1850
|
-
type: o.literal("object"),
|
|
1851
|
-
properties: o.optional(o.object({}).loose())
|
|
1852
|
-
}).loose()
|
|
1853
|
-
}).loose(), st = h2.extend({
|
|
1854
|
-
tools: o.array(rt)
|
|
1855
|
-
}), q2 = o.object({
|
|
1856
|
-
type: o.literal("text"),
|
|
1857
|
-
text: o.string()
|
|
1858
|
-
}).loose(), j2 = o.object({
|
|
1859
|
-
type: o.literal("image"),
|
|
1860
|
-
data: o.base64(),
|
|
1861
|
-
mimeType: o.string()
|
|
1862
|
-
}).loose(), ot = o.object({
|
|
1863
|
-
uri: o.string(),
|
|
1864
|
-
name: o.string(),
|
|
1865
|
-
title: o.optional(o.string()),
|
|
1866
|
-
description: o.optional(o.string()),
|
|
1867
|
-
mimeType: o.optional(o.string()),
|
|
1868
|
-
size: o.optional(o.number())
|
|
1869
|
-
}).loose(), it = h2.extend({
|
|
1870
|
-
resources: o.array(ot)
|
|
1871
|
-
}), H2 = o.object({
|
|
1872
|
-
/**
|
|
1873
|
-
* The URI of this resource.
|
|
1874
|
-
*/
|
|
1875
|
-
uri: o.string(),
|
|
1876
|
-
/**
|
|
1877
|
-
* Optional display name of the resource content.
|
|
1878
|
-
*/
|
|
1879
|
-
name: o.optional(o.string()),
|
|
1880
|
-
/**
|
|
1881
|
-
* Optional human readable title.
|
|
1882
|
-
*/
|
|
1883
|
-
title: o.optional(o.string()),
|
|
1884
|
-
/**
|
|
1885
|
-
* The MIME type of this resource, if known.
|
|
1886
|
-
*/
|
|
1887
|
-
mimeType: o.optional(o.string())
|
|
1888
|
-
}).loose(), N2 = H2.extend({
|
|
1889
|
-
text: o.string()
|
|
1890
|
-
}), z2 = H2.extend({
|
|
1891
|
-
blob: o.base64()
|
|
1892
|
-
}), Z2 = o.object({
|
|
1893
|
-
type: o.literal("resource"),
|
|
1894
|
-
resource: o.union([N2, z2])
|
|
1895
|
-
}).loose(), nt = M.extend({
|
|
1896
|
-
content: o.array(
|
|
1897
|
-
o.union([q2, j2, Z2])
|
|
1898
|
-
),
|
|
1899
|
-
isError: o.boolean().default(!1).optional()
|
|
1900
|
-
}).or(
|
|
1901
|
-
M.extend({
|
|
1902
|
-
toolResult: o.unknown()
|
|
1903
|
-
})
|
|
1904
|
-
), at = o.object({
|
|
1905
|
-
uriTemplate: o.string(),
|
|
1906
|
-
name: o.string(),
|
|
1907
|
-
title: o.optional(o.string()),
|
|
1908
|
-
description: o.optional(o.string()),
|
|
1909
|
-
mimeType: o.optional(o.string())
|
|
1910
|
-
}).loose(), ct = M.extend({
|
|
1911
|
-
resourceTemplates: o.array(at)
|
|
1912
|
-
}), lt = M.extend({
|
|
1913
|
-
contents: o.array(
|
|
1914
|
-
o.union([N2, z2])
|
|
1915
|
-
)
|
|
1916
|
-
}), ht = o.object({
|
|
1917
|
-
name: o.string(),
|
|
1918
|
-
description: o.optional(o.string()),
|
|
1919
|
-
required: o.optional(o.boolean())
|
|
1920
|
-
}).loose(), dt = o.object({
|
|
1921
|
-
name: o.string(),
|
|
1922
|
-
title: o.optional(o.string()),
|
|
1923
|
-
description: o.optional(o.string()),
|
|
1924
|
-
arguments: o.optional(o.array(ht))
|
|
1925
|
-
}).loose(), pt = h2.extend({
|
|
1926
|
-
prompts: o.array(dt)
|
|
1927
|
-
}), ut = o.object({
|
|
1928
|
-
role: o.union([o.literal("user"), o.literal("assistant")]),
|
|
1929
|
-
content: o.union([
|
|
1930
|
-
q2,
|
|
1931
|
-
j2,
|
|
1932
|
-
Z2
|
|
1933
|
-
])
|
|
1934
|
-
}).loose(), mt = M.extend({
|
|
1935
|
-
description: o.optional(o.string()),
|
|
1936
|
-
messages: o.array(ut)
|
|
1937
|
-
}), gt = Y.extend({
|
|
1938
|
-
message: o.string(),
|
|
1939
|
-
requestedSchema: o.unknown()
|
|
1940
|
-
}), L2 = O2.extend({
|
|
1941
|
-
method: o.literal("elicitation/create"),
|
|
1942
|
-
params: gt
|
|
1943
|
-
}), ft = M.extend({
|
|
1944
|
-
action: o.union([
|
|
1945
|
-
o.literal("accept"),
|
|
1946
|
-
o.literal("decline"),
|
|
1947
|
-
o.literal("cancel")
|
|
1948
|
-
]),
|
|
1949
|
-
content: o.optional(o.record(o.string(), o.unknown()))
|
|
1950
|
-
}), K = "2.0", Ct = o.object({
|
|
1951
|
-
jsonrpc: o.literal(K),
|
|
1952
|
-
id: o.union([o.string(), o.number().int()])
|
|
1953
|
-
}).merge(O2).strict(), wt = o.object({
|
|
1954
|
-
jsonrpc: o.literal(K),
|
|
1955
|
-
id: o.union([o.string(), o.number().int()]),
|
|
1956
|
-
result: M
|
|
1957
|
-
}).strict(), yt = o.object({
|
|
1958
|
-
jsonrpc: o.literal(K),
|
|
1959
|
-
id: o.union([o.string(), o.number().int()]),
|
|
1960
|
-
error: o.object({
|
|
1961
|
-
code: o.number().int(),
|
|
1962
|
-
message: o.string(),
|
|
1963
|
-
data: o.optional(o.unknown())
|
|
1964
|
-
})
|
|
1965
|
-
}).strict(), vt = o.object({
|
|
1966
|
-
jsonrpc: o.literal(K)
|
|
1967
|
-
}).merge(
|
|
1968
|
-
o.object({
|
|
1969
|
-
method: o.string(),
|
|
1970
|
-
params: o.optional(Y)
|
|
1971
|
-
})
|
|
1972
|
-
).strict(), q = o.union([
|
|
1973
|
-
Ct,
|
|
1974
|
-
vt,
|
|
1975
|
-
wt,
|
|
1976
|
-
yt
|
|
1977
|
-
]), D2 = typeof __PACKAGE_VERSION__ < "u" ? __PACKAGE_VERSION__ : "0.0.0-test", F2 = o.object({
|
|
1978
|
-
access_token: o.string(),
|
|
1979
|
-
id_token: o.string().optional(),
|
|
1980
|
-
// Optional for OAuth 2.1, but necessary in OpenID Connect
|
|
1981
|
-
token_type: o.string(),
|
|
1982
|
-
expires_in: o.number().optional(),
|
|
1983
|
-
scope: o.string().optional(),
|
|
1984
|
-
refresh_token: o.string().optional()
|
|
1985
|
-
}).strip(), x = o.string().url().superRefine((r, e) => {
|
|
1986
|
-
if (!URL.canParse(r))
|
|
1987
|
-
return e.addIssue({
|
|
1988
|
-
code: o.ZodIssueCode.custom,
|
|
1989
|
-
message: "URL must be parseable",
|
|
1990
|
-
fatal: !0
|
|
1991
|
-
}), o.NEVER;
|
|
1992
|
-
}).refine(
|
|
1993
|
-
(r) => {
|
|
1994
|
-
const e = new URL(r);
|
|
1995
|
-
return e.protocol !== "javascript:" && e.protocol !== "data:" && e.protocol !== "vbscript:";
|
|
1996
|
-
},
|
|
1997
|
-
{ message: "URL cannot use javascript:, data:, or vbscript: scheme" }
|
|
1998
|
-
), _t = o.object({
|
|
1999
|
-
resource: o.string().url(),
|
|
2000
|
-
authorization_servers: o.array(x).optional(),
|
|
2001
|
-
jwks_uri: o.string().url().optional(),
|
|
2002
|
-
scopes_supported: o.array(o.string()).optional(),
|
|
2003
|
-
bearer_methods_supported: o.array(o.string()).optional(),
|
|
2004
|
-
resource_signing_alg_values_supported: o.array(o.string()).optional(),
|
|
2005
|
-
resource_name: o.string().optional(),
|
|
2006
|
-
resource_documentation: o.string().optional(),
|
|
2007
|
-
resource_policy_uri: o.string().url().optional(),
|
|
2008
|
-
resource_tos_uri: o.string().url().optional(),
|
|
2009
|
-
tls_client_certificate_bound_access_tokens: o.boolean().optional(),
|
|
2010
|
-
authorization_details_types_supported: o.array(o.string()).optional(),
|
|
2011
|
-
dpop_signing_alg_values_supported: o.array(o.string()).optional(),
|
|
2012
|
-
dpop_bound_access_tokens_required: o.boolean().optional()
|
|
2013
|
-
}).passthrough(), B2 = o.object({
|
|
2014
|
-
issuer: o.string(),
|
|
2015
|
-
authorization_endpoint: x,
|
|
2016
|
-
token_endpoint: x,
|
|
2017
|
-
registration_endpoint: x.optional(),
|
|
2018
|
-
scopes_supported: o.array(o.string()).optional(),
|
|
2019
|
-
response_types_supported: o.array(o.string()),
|
|
2020
|
-
grant_types_supported: o.array(o.string()).optional(),
|
|
2021
|
-
code_challenge_methods_supported: o.array(o.string()),
|
|
2022
|
-
token_endpoint_auth_methods_supported: o.array(o.string()).optional(),
|
|
2023
|
-
token_endpoint_auth_signing_alg_values_supported: o.array(o.string()).optional()
|
|
2024
|
-
}).passthrough(), bt = o.object({
|
|
2025
|
-
issuer: o.string(),
|
|
2026
|
-
authorization_endpoint: x,
|
|
2027
|
-
token_endpoint: x,
|
|
2028
|
-
userinfo_endpoint: x.optional(),
|
|
2029
|
-
jwks_uri: x,
|
|
2030
|
-
registration_endpoint: x.optional(),
|
|
2031
|
-
scopes_supported: o.array(o.string()).optional(),
|
|
2032
|
-
response_types_supported: o.array(o.string()),
|
|
2033
|
-
grant_types_supported: o.array(o.string()).optional(),
|
|
2034
|
-
subject_types_supported: o.array(o.string()),
|
|
2035
|
-
id_token_signing_alg_values_supported: o.array(o.string()),
|
|
2036
|
-
claims_supported: o.array(o.string()).optional(),
|
|
2037
|
-
token_endpoint_auth_methods_supported: o.array(o.string()).optional()
|
|
2038
|
-
}).passthrough(), xt = bt.merge(
|
|
2039
|
-
B2.pick({
|
|
2040
|
-
code_challenge_methods_supported: !0
|
|
2041
|
-
})
|
|
2042
|
-
), Lt = o.object({
|
|
2043
|
-
client_id: o.string(),
|
|
2044
|
-
client_secret: o.string().optional(),
|
|
2045
|
-
client_id_issued_at: o.number().optional(),
|
|
2046
|
-
client_secret_expires_at: o.number().optional()
|
|
2047
|
-
}).strip(), St = o.object({
|
|
2048
|
-
redirect_uris: o.array(x),
|
|
2049
|
-
token_endpoint_auth_method: o.string().optional(),
|
|
2050
|
-
grant_types: o.array(o.string()).optional(),
|
|
2051
|
-
response_types: o.array(o.string()).optional(),
|
|
2052
|
-
client_name: o.string().optional(),
|
|
2053
|
-
client_uri: x.optional(),
|
|
2054
|
-
logo_uri: x.optional(),
|
|
2055
|
-
scope: o.string().optional(),
|
|
2056
|
-
contacts: o.array(o.string()).optional(),
|
|
2057
|
-
tos_uri: x.optional(),
|
|
2058
|
-
policy_uri: o.string().optional(),
|
|
2059
|
-
jwks_uri: x.optional(),
|
|
2060
|
-
jwks: o.any().optional(),
|
|
2061
|
-
software_id: o.string().optional(),
|
|
2062
|
-
software_version: o.string().optional(),
|
|
2063
|
-
software_statement: o.string().optional()
|
|
2064
|
-
}).strip(), Rt = o.object({
|
|
2065
|
-
error: o.string(),
|
|
2066
|
-
error_description: o.string().optional(),
|
|
2067
|
-
error_uri: o.string().optional()
|
|
2068
|
-
}), Tt = St.merge(
|
|
2069
|
-
Lt
|
|
2070
|
-
), Mt = "AI_MCPClientOAuthError", V2 = `vercel.ai.error.${Mt}`, Et = Symbol.for(V2), S2, R2, j = class extends (R2 = Z, S2 = Et, R2) {
|
|
2071
|
-
constructor({
|
|
2072
|
-
name: r = "MCPClientOAuthError",
|
|
2073
|
-
message: e,
|
|
2074
|
-
cause: t
|
|
2075
|
-
}) {
|
|
2076
|
-
super({ name: r, message: e, cause: t }), this[S2] = !0;
|
|
2077
|
-
}
|
|
2078
|
-
static isInstance(r) {
|
|
2079
|
-
return Z.hasMarker(r, V2);
|
|
2080
|
-
}
|
|
2081
|
-
}, O = class extends j {
|
|
2082
|
-
};
|
|
2083
|
-
O.errorCode = "server_error";
|
|
2084
|
-
var D = class extends j {
|
|
2085
|
-
};
|
|
2086
|
-
D.errorCode = "invalid_client";
|
|
2087
|
-
var F = class extends j {
|
|
2088
|
-
};
|
|
2089
|
-
F.errorCode = "invalid_grant";
|
|
2090
|
-
var B = class extends j {
|
|
2091
|
-
};
|
|
2092
|
-
B.errorCode = "unauthorized_client";
|
|
2093
|
-
var Pt = {
|
|
2094
|
-
[O.errorCode]: O,
|
|
2095
|
-
[D.errorCode]: D,
|
|
2096
|
-
[F.errorCode]: F,
|
|
2097
|
-
[B.errorCode]: B
|
|
2098
|
-
};
|
|
2099
|
-
function kt(r) {
|
|
2100
|
-
const e = typeof r == "string" ? new URL(r) : new URL(r.href);
|
|
2101
|
-
return e.hash = "", e;
|
|
2102
|
-
}
|
|
2103
|
-
function It({
|
|
2104
|
-
requestedResource: r,
|
|
2105
|
-
configuredResource: e
|
|
2106
|
-
}) {
|
|
2107
|
-
const t = typeof r == "string" ? new URL(r) : new URL(r.href), s = typeof e == "string" ? new URL(e) : new URL(e.href);
|
|
2108
|
-
if (t.origin !== s.origin || t.pathname.length < s.pathname.length)
|
|
2109
|
-
return !1;
|
|
2110
|
-
const i = t.pathname.endsWith("/") ? t.pathname : t.pathname + "/", n = s.pathname.endsWith("/") ? s.pathname : s.pathname + "/";
|
|
2111
|
-
return i.startsWith(n);
|
|
2112
|
-
}
|
|
2113
|
-
var V = class extends Error {
|
|
2114
|
-
constructor(r = "Unauthorized") {
|
|
2115
|
-
super(r), this.name = "UnauthorizedError";
|
|
2116
|
-
}
|
|
2117
|
-
};
|
|
2118
|
-
function J(r) {
|
|
2119
|
-
var e;
|
|
2120
|
-
const t = (e = r.headers.get("www-authenticate")) != null ? e : r.headers.get("WWW-Authenticate");
|
|
2121
|
-
if (!t)
|
|
2122
|
-
return;
|
|
2123
|
-
const [s, i] = t.split(" ");
|
|
2124
|
-
if (s.toLowerCase() !== "bearer" || !i)
|
|
2125
|
-
return;
|
|
2126
|
-
const n = /resource_metadata="([^"]*)"/, a = t.match(n);
|
|
2127
|
-
if (a)
|
|
2128
|
-
try {
|
|
2129
|
-
return new URL(a[1]);
|
|
2130
|
-
} catch {
|
|
2131
|
-
return;
|
|
2132
|
-
}
|
|
2133
|
-
}
|
|
2134
|
-
function Ut(r, e = "", t = {}) {
|
|
2135
|
-
return e.endsWith("/") && (e = e.slice(0, -1)), t.prependPathname ? `${e}/.well-known/${r}` : `/.well-known/${r}${e}`;
|
|
2136
|
-
}
|
|
2137
|
-
async function d2(r, e, t = fetch) {
|
|
2138
|
-
try {
|
|
2139
|
-
return await t(r, { headers: e });
|
|
2140
|
-
} catch (s) {
|
|
2141
|
-
if (s instanceof TypeError)
|
|
2142
|
-
return e ? d2(r, void 0, t) : void 0;
|
|
2143
|
-
throw s;
|
|
2144
|
-
}
|
|
2145
|
-
}
|
|
2146
|
-
async function T2(r, e, t = fetch) {
|
|
2147
|
-
return await d2(r, {
|
|
2148
|
-
"MCP-Protocol-Version": e
|
|
2149
|
-
}, t);
|
|
2150
|
-
}
|
|
2151
|
-
function At(r, e) {
|
|
2152
|
-
return !r || r.status >= 400 && r.status < 500 && e !== "/";
|
|
2153
|
-
}
|
|
2154
|
-
async function Ot(r, e, t, s) {
|
|
2155
|
-
var i, n;
|
|
2156
|
-
const a = new URL(r), l = (i = s?.protocolVersion) != null ? i : $;
|
|
2157
|
-
let h;
|
|
2158
|
-
if (s?.metadataUrl)
|
|
2159
|
-
h = new URL(s.metadataUrl);
|
|
2160
|
-
else {
|
|
2161
|
-
const d = Ut(e, a.pathname);
|
|
2162
|
-
h = new URL(d, (n = s?.metadataServerUrl) != null ? n : a), h.search = a.search;
|
|
2163
|
-
}
|
|
2164
|
-
let c = await T2(h, l, t);
|
|
2165
|
-
if (!s?.metadataUrl && At(c, a.pathname)) {
|
|
2166
|
-
const d = new URL(`/.well-known/${e}`, a);
|
|
2167
|
-
c = await T2(d, l, t);
|
|
2168
|
-
}
|
|
2169
|
-
return c;
|
|
2170
|
-
}
|
|
2171
|
-
async function $t(r, e, t = fetch) {
|
|
2172
|
-
const s = await Ot(
|
|
2173
|
-
r,
|
|
2174
|
-
"oauth-protected-resource",
|
|
2175
|
-
t,
|
|
2176
|
-
{
|
|
2177
|
-
protocolVersion: e?.protocolVersion,
|
|
2178
|
-
metadataUrl: e?.resourceMetadataUrl
|
|
2179
|
-
}
|
|
2180
|
-
);
|
|
2181
|
-
if (!s || s.status === 404)
|
|
2182
|
-
throw new Error(
|
|
2183
|
-
"Resource server does not implement OAuth 2.0 Protected Resource Metadata."
|
|
2184
|
-
);
|
|
2185
|
-
if (!s.ok)
|
|
2186
|
-
throw new Error(
|
|
2187
|
-
`HTTP ${s.status} trying to load well-known OAuth protected resource metadata.`
|
|
2188
|
-
);
|
|
2189
|
-
return _t.parse(await s.json());
|
|
2190
|
-
}
|
|
2191
|
-
function qt(r) {
|
|
2192
|
-
const e = typeof r == "string" ? new URL(r) : r, t = e.pathname !== "/", s = [];
|
|
2193
|
-
if (!t)
|
|
2194
|
-
return s.push({
|
|
2195
|
-
url: new URL("/.well-known/oauth-authorization-server", e.origin),
|
|
2196
|
-
type: "oauth"
|
|
2197
|
-
}), s.push({
|
|
2198
|
-
url: new URL("/.well-known/openid-configuration", e.origin),
|
|
2199
|
-
type: "oidc"
|
|
2200
|
-
}), s;
|
|
2201
|
-
let i = e.pathname;
|
|
2202
|
-
return i.endsWith("/") && (i = i.slice(0, -1)), s.push({
|
|
2203
|
-
url: new URL(
|
|
2204
|
-
`/.well-known/oauth-authorization-server${i}`,
|
|
2205
|
-
e.origin
|
|
2206
|
-
),
|
|
2207
|
-
type: "oauth"
|
|
2208
|
-
}), s.push({
|
|
2209
|
-
url: new URL("/.well-known/oauth-authorization-server", e.origin),
|
|
2210
|
-
type: "oauth"
|
|
2211
|
-
}), s.push({
|
|
2212
|
-
url: new URL(`/.well-known/openid-configuration${i}`, e.origin),
|
|
2213
|
-
type: "oidc"
|
|
2214
|
-
}), s.push({
|
|
2215
|
-
url: new URL(`${i}/.well-known/openid-configuration`, e.origin),
|
|
2216
|
-
type: "oidc"
|
|
2217
|
-
}), s;
|
|
2218
|
-
}
|
|
2219
|
-
async function jt(r, {
|
|
2220
|
-
fetchFn: e = fetch,
|
|
2221
|
-
protocolVersion: t = $
|
|
2222
|
-
} = {}) {
|
|
2223
|
-
var s;
|
|
2224
|
-
const i = { "MCP-Protocol-Version": t }, n = qt(r);
|
|
2225
|
-
for (const { url: a, type: l } of n) {
|
|
2226
|
-
const h = await d2(a, i, e);
|
|
2227
|
-
if (h) {
|
|
2228
|
-
if (!h.ok) {
|
|
2229
|
-
if (h.status >= 400 && h.status < 500)
|
|
2230
|
-
continue;
|
|
2231
|
-
throw new Error(
|
|
2232
|
-
`HTTP ${h.status} trying to load ${l === "oauth" ? "OAuth" : "OpenID provider"} metadata from ${a}`
|
|
2233
|
-
);
|
|
2234
|
-
}
|
|
2235
|
-
if (l === "oauth")
|
|
2236
|
-
return B2.parse(await h.json());
|
|
2237
|
-
{
|
|
2238
|
-
const c = xt.parse(
|
|
2239
|
-
await h.json()
|
|
2240
|
-
);
|
|
2241
|
-
if (!((s = c.code_challenge_methods_supported) != null && s.includes("S256")))
|
|
2242
|
-
throw new Error(
|
|
2243
|
-
`Incompatible OIDC provider at ${a}: does not support S256 code challenge method required by MCP specification`
|
|
2244
|
-
);
|
|
2245
|
-
return c;
|
|
2246
|
-
}
|
|
2247
|
-
}
|
|
2248
|
-
}
|
|
2249
|
-
}
|
|
2250
|
-
async function Ht(r, {
|
|
2251
|
-
metadata: e,
|
|
2252
|
-
clientInformation: t,
|
|
2253
|
-
redirectUrl: s,
|
|
2254
|
-
scope: i,
|
|
2255
|
-
state: n,
|
|
2256
|
-
resource: a
|
|
2257
|
-
}) {
|
|
2258
|
-
const l = "code", h = "S256";
|
|
2259
|
-
let c;
|
|
2260
|
-
if (e) {
|
|
2261
|
-
if (c = new URL(e.authorization_endpoint), !e.response_types_supported.includes(l))
|
|
2262
|
-
throw new Error(
|
|
2263
|
-
`Incompatible auth server: does not support response type ${l}`
|
|
2264
|
-
);
|
|
2265
|
-
if (!e.code_challenge_methods_supported || !e.code_challenge_methods_supported.includes(h))
|
|
2266
|
-
throw new Error(
|
|
2267
|
-
`Incompatible auth server: does not support code challenge method ${h}`
|
|
2268
|
-
);
|
|
2269
|
-
} else
|
|
2270
|
-
c = new URL("/authorize", r);
|
|
2271
|
-
const d = await Ge(), g = d.code_verifier, p = d.code_challenge;
|
|
2272
|
-
return c.searchParams.set("response_type", l), c.searchParams.set("client_id", t.client_id), c.searchParams.set("code_challenge", p), c.searchParams.set(
|
|
2273
|
-
"code_challenge_method",
|
|
2274
|
-
h
|
|
2275
|
-
), c.searchParams.set("redirect_uri", String(s)), n && c.searchParams.set("state", n), i && c.searchParams.set("scope", i), i?.includes("offline_access") && c.searchParams.append("prompt", "consent"), a && c.searchParams.set("resource", a.href), { authorizationUrl: c, codeVerifier: g };
|
|
2276
|
-
}
|
|
2277
|
-
function J2(r, e) {
|
|
2278
|
-
const t = r.client_secret !== void 0;
|
|
2279
|
-
return e.length === 0 ? t ? "client_secret_post" : "none" : t && e.includes("client_secret_basic") ? "client_secret_basic" : t && e.includes("client_secret_post") ? "client_secret_post" : e.includes("none") ? "none" : t ? "client_secret_post" : "none";
|
|
2280
|
-
}
|
|
2281
|
-
function W2(r, e, t, s) {
|
|
2282
|
-
const { client_id: i, client_secret: n } = e;
|
|
2283
|
-
switch (r) {
|
|
2284
|
-
case "client_secret_basic":
|
|
2285
|
-
Nt(i, n, t);
|
|
2286
|
-
return;
|
|
2287
|
-
case "client_secret_post":
|
|
2288
|
-
zt(i, n, s);
|
|
2289
|
-
return;
|
|
2290
|
-
case "none":
|
|
2291
|
-
Zt(i, s);
|
|
2292
|
-
return;
|
|
2293
|
-
default:
|
|
2294
|
-
throw new Error(`Unsupported client authentication method: ${r}`);
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2297
|
-
function Nt(r, e, t) {
|
|
2298
|
-
if (!e)
|
|
2299
|
-
throw new Error(
|
|
2300
|
-
"client_secret_basic authentication requires a client_secret"
|
|
2301
|
-
);
|
|
2302
|
-
const s = btoa(`${r}:${e}`);
|
|
2303
|
-
t.set("Authorization", `Basic ${s}`);
|
|
2304
|
-
}
|
|
2305
|
-
function zt(r, e, t) {
|
|
2306
|
-
t.set("client_id", r), e && t.set("client_secret", e);
|
|
2307
|
-
}
|
|
2308
|
-
function Zt(r, e) {
|
|
2309
|
-
e.set("client_id", r);
|
|
2310
|
-
}
|
|
2311
|
-
async function p2(r) {
|
|
2312
|
-
const e = r instanceof Response ? r.status : void 0, t = r instanceof Response ? await r.text() : r;
|
|
2313
|
-
try {
|
|
2314
|
-
const s = Rt.parse(JSON.parse(t)), { error: i, error_description: n, error_uri: a } = s, l = Pt[i] || O;
|
|
2315
|
-
return new l({
|
|
2316
|
-
message: n || "",
|
|
2317
|
-
cause: a
|
|
2318
|
-
});
|
|
2319
|
-
} catch (s) {
|
|
2320
|
-
const i = `${e ? `HTTP ${e}: ` : ""}Invalid OAuth error response: ${s}. Raw body: ${t}`;
|
|
2321
|
-
return new O({ message: i });
|
|
2322
|
-
}
|
|
2323
|
-
}
|
|
2324
|
-
async function Dt(r, {
|
|
2325
|
-
metadata: e,
|
|
2326
|
-
clientInformation: t,
|
|
2327
|
-
authorizationCode: s,
|
|
2328
|
-
codeVerifier: i,
|
|
2329
|
-
redirectUri: n,
|
|
2330
|
-
resource: a,
|
|
2331
|
-
addClientAuthentication: l,
|
|
2332
|
-
fetchFn: h
|
|
2333
|
-
}) {
|
|
2334
|
-
var c;
|
|
2335
|
-
const d = "authorization_code", g = e?.token_endpoint ? new URL(e.token_endpoint) : new URL("/token", r);
|
|
2336
|
-
if (e?.grant_types_supported && !e.grant_types_supported.includes(d))
|
|
2337
|
-
throw new Error(
|
|
2338
|
-
`Incompatible auth server: does not support grant type ${d}`
|
|
2339
|
-
);
|
|
2340
|
-
const p = new Headers({
|
|
2341
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
2342
|
-
Accept: "application/json"
|
|
2343
|
-
}), C = new URLSearchParams({
|
|
2344
|
-
grant_type: d,
|
|
2345
|
-
code: s,
|
|
2346
|
-
code_verifier: i,
|
|
2347
|
-
redirect_uri: String(n)
|
|
2348
|
-
});
|
|
2349
|
-
if (l)
|
|
2350
|
-
l(p, C, r, e);
|
|
2351
|
-
else {
|
|
2352
|
-
const u = (c = e?.token_endpoint_auth_methods_supported) != null ? c : [], m = J2(
|
|
2353
|
-
t,
|
|
2354
|
-
u
|
|
2355
|
-
);
|
|
2356
|
-
W2(m, t, p, C);
|
|
2357
|
-
}
|
|
2358
|
-
a && C.set("resource", a.href);
|
|
2359
|
-
const f = await (h ?? fetch)(g, {
|
|
2360
|
-
method: "POST",
|
|
2361
|
-
headers: p,
|
|
2362
|
-
body: C
|
|
2363
|
-
});
|
|
2364
|
-
if (!f.ok)
|
|
2365
|
-
throw await p2(f);
|
|
2366
|
-
return F2.parse(await f.json());
|
|
2367
|
-
}
|
|
2368
|
-
async function Ft(r, {
|
|
2369
|
-
metadata: e,
|
|
2370
|
-
clientInformation: t,
|
|
2371
|
-
refreshToken: s,
|
|
2372
|
-
resource: i,
|
|
2373
|
-
addClientAuthentication: n,
|
|
2374
|
-
fetchFn: a
|
|
2375
|
-
}) {
|
|
2376
|
-
var l;
|
|
2377
|
-
const h = "refresh_token";
|
|
2378
|
-
let c;
|
|
2379
|
-
if (e) {
|
|
2380
|
-
if (c = new URL(e.token_endpoint), e.grant_types_supported && !e.grant_types_supported.includes(h))
|
|
2381
|
-
throw new Error(
|
|
2382
|
-
`Incompatible auth server: does not support grant type ${h}`
|
|
2383
|
-
);
|
|
2384
|
-
} else
|
|
2385
|
-
c = new URL("/token", r);
|
|
2386
|
-
const d = new Headers({
|
|
2387
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
2388
|
-
}), g = new URLSearchParams({
|
|
2389
|
-
grant_type: h,
|
|
2390
|
-
refresh_token: s
|
|
2391
|
-
});
|
|
2392
|
-
if (n)
|
|
2393
|
-
n(d, g, r, e);
|
|
2394
|
-
else {
|
|
2395
|
-
const C = (l = e?.token_endpoint_auth_methods_supported) != null ? l : [], f = J2(
|
|
2396
|
-
t,
|
|
2397
|
-
C
|
|
2398
|
-
);
|
|
2399
|
-
W2(f, t, d, g);
|
|
2400
|
-
}
|
|
2401
|
-
i && g.set("resource", i.href);
|
|
2402
|
-
const p = await (a ?? fetch)(c, {
|
|
2403
|
-
method: "POST",
|
|
2404
|
-
headers: d,
|
|
2405
|
-
body: g
|
|
2406
|
-
});
|
|
2407
|
-
if (!p.ok)
|
|
2408
|
-
throw await p2(p);
|
|
2409
|
-
return F2.parse({
|
|
2410
|
-
refresh_token: s,
|
|
2411
|
-
...await p.json()
|
|
2412
|
-
});
|
|
2413
|
-
}
|
|
2414
|
-
async function Bt(r, {
|
|
2415
|
-
metadata: e,
|
|
2416
|
-
clientMetadata: t,
|
|
2417
|
-
fetchFn: s
|
|
2418
|
-
}) {
|
|
2419
|
-
let i;
|
|
2420
|
-
if (e) {
|
|
2421
|
-
if (!e.registration_endpoint)
|
|
2422
|
-
throw new Error(
|
|
2423
|
-
"Incompatible auth server: does not support dynamic client registration"
|
|
2424
|
-
);
|
|
2425
|
-
i = new URL(e.registration_endpoint);
|
|
2426
|
-
} else
|
|
2427
|
-
i = new URL("/register", r);
|
|
2428
|
-
const n = await (s ?? fetch)(i, {
|
|
2429
|
-
method: "POST",
|
|
2430
|
-
headers: {
|
|
2431
|
-
"Content-Type": "application/json"
|
|
2432
|
-
},
|
|
2433
|
-
body: JSON.stringify(t)
|
|
2434
|
-
});
|
|
2435
|
-
if (!n.ok)
|
|
2436
|
-
throw await p2(n);
|
|
2437
|
-
return Tt.parse(await n.json());
|
|
2438
|
-
}
|
|
2439
|
-
async function W(r, e) {
|
|
2440
|
-
var t, s;
|
|
2441
|
-
try {
|
|
2442
|
-
return await t2(r, e);
|
|
2443
|
-
} catch (i) {
|
|
2444
|
-
if (i instanceof D || i instanceof B)
|
|
2445
|
-
return await ((t = r.invalidateCredentials) == null ? void 0 : t.call(r, "all")), await t2(r, e);
|
|
2446
|
-
if (i instanceof F)
|
|
2447
|
-
return await ((s = r.invalidateCredentials) == null ? void 0 : s.call(r, "tokens")), await t2(r, e);
|
|
2448
|
-
throw i;
|
|
2449
|
-
}
|
|
2450
|
-
}
|
|
2451
|
-
async function Vt(r, e, t) {
|
|
2452
|
-
const s = kt(r);
|
|
2453
|
-
if (e.validateResourceURL)
|
|
2454
|
-
return await e.validateResourceURL(
|
|
2455
|
-
s,
|
|
2456
|
-
t?.resource
|
|
2457
|
-
);
|
|
2458
|
-
if (t) {
|
|
2459
|
-
if (!It({
|
|
2460
|
-
requestedResource: s,
|
|
2461
|
-
configuredResource: t.resource
|
|
2462
|
-
}))
|
|
2463
|
-
throw new Error(
|
|
2464
|
-
`Protected resource ${t.resource} does not match expected ${s} (or origin)`
|
|
2465
|
-
);
|
|
2466
|
-
return new URL(t.resource);
|
|
2467
|
-
}
|
|
2468
|
-
}
|
|
2469
|
-
async function t2(r, {
|
|
2470
|
-
serverUrl: e,
|
|
2471
|
-
authorizationCode: t,
|
|
2472
|
-
scope: s,
|
|
2473
|
-
resourceMetadataUrl: i,
|
|
2474
|
-
fetchFn: n
|
|
2475
|
-
}) {
|
|
2476
|
-
let a, l;
|
|
2477
|
-
try {
|
|
2478
|
-
a = await $t(
|
|
2479
|
-
e,
|
|
2480
|
-
{ resourceMetadataUrl: i },
|
|
2481
|
-
n
|
|
2482
|
-
), a.authorization_servers && a.authorization_servers.length > 0 && (l = a.authorization_servers[0]);
|
|
2483
|
-
} catch {
|
|
2484
|
-
}
|
|
2485
|
-
l || (l = e);
|
|
2486
|
-
const h = await Vt(
|
|
2487
|
-
e,
|
|
2488
|
-
r,
|
|
2489
|
-
a
|
|
2490
|
-
), c = await jt(
|
|
2491
|
-
l,
|
|
2492
|
-
{
|
|
2493
|
-
fetchFn: n
|
|
2494
|
-
}
|
|
2495
|
-
);
|
|
2496
|
-
let d = await Promise.resolve(r.clientInformation());
|
|
2497
|
-
if (!d) {
|
|
2498
|
-
if (t !== void 0)
|
|
2499
|
-
throw new Error(
|
|
2500
|
-
"Existing OAuth client information is required when exchanging an authorization code"
|
|
2501
|
-
);
|
|
2502
|
-
if (!r.saveClientInformation)
|
|
2503
|
-
throw new Error(
|
|
2504
|
-
"OAuth client information must be saveable for dynamic registration"
|
|
2505
|
-
);
|
|
2506
|
-
const u = await Bt(l, {
|
|
2507
|
-
metadata: c,
|
|
2508
|
-
clientMetadata: r.clientMetadata,
|
|
2509
|
-
fetchFn: n
|
|
2510
|
-
});
|
|
2511
|
-
await r.saveClientInformation(u), d = u;
|
|
2512
|
-
}
|
|
2513
|
-
if (t !== void 0) {
|
|
2514
|
-
const u = await r.codeVerifier(), m = await Dt(l, {
|
|
2515
|
-
metadata: c,
|
|
2516
|
-
clientInformation: d,
|
|
2517
|
-
authorizationCode: t,
|
|
2518
|
-
codeVerifier: u,
|
|
2519
|
-
redirectUri: r.redirectUrl,
|
|
2520
|
-
resource: h,
|
|
2521
|
-
addClientAuthentication: r.addClientAuthentication,
|
|
2522
|
-
fetchFn: n
|
|
2523
|
-
});
|
|
2524
|
-
return await r.saveTokens(m), "AUTHORIZED";
|
|
2525
|
-
}
|
|
2526
|
-
const g = await r.tokens();
|
|
2527
|
-
if (g?.refresh_token)
|
|
2528
|
-
try {
|
|
2529
|
-
const u = await Ft(l, {
|
|
2530
|
-
metadata: c,
|
|
2531
|
-
clientInformation: d,
|
|
2532
|
-
refreshToken: g.refresh_token,
|
|
2533
|
-
resource: h,
|
|
2534
|
-
addClientAuthentication: r.addClientAuthentication,
|
|
2535
|
-
fetchFn: n
|
|
2536
|
-
});
|
|
2537
|
-
return await r.saveTokens(u), "AUTHORIZED";
|
|
2538
|
-
} catch (u) {
|
|
2539
|
-
if (
|
|
2540
|
-
// If this is a ServerError, or an unknown type, log it out and try to continue. Otherwise, escalate so we can fix things and retry.
|
|
2541
|
-
!(!(u instanceof j) || u instanceof O)
|
|
2542
|
-
) throw u;
|
|
2543
|
-
}
|
|
2544
|
-
const p = r.state ? await r.state() : void 0, { authorizationUrl: C, codeVerifier: f } = await Ht(
|
|
2545
|
-
l,
|
|
2546
|
-
{
|
|
2547
|
-
metadata: c,
|
|
2548
|
-
clientInformation: d,
|
|
2549
|
-
state: p,
|
|
2550
|
-
redirectUrl: r.redirectUrl,
|
|
2551
|
-
scope: s || r.clientMetadata.scope,
|
|
2552
|
-
resource: h
|
|
2553
|
-
}
|
|
2554
|
-
);
|
|
2555
|
-
return await r.saveCodeVerifier(f), await r.redirectToAuthorization(C), "REDIRECT";
|
|
2556
|
-
}
|
|
2557
|
-
var Jt = class {
|
|
2558
|
-
constructor({
|
|
2559
|
-
url: r,
|
|
2560
|
-
headers: e,
|
|
2561
|
-
authProvider: t
|
|
2562
|
-
}) {
|
|
2563
|
-
this.connected = !1, this.url = new URL(r), this.headers = e, this.authProvider = t;
|
|
2564
|
-
}
|
|
2565
|
-
async commonHeaders(r) {
|
|
2566
|
-
const e = {
|
|
2567
|
-
...this.headers,
|
|
2568
|
-
...r,
|
|
2569
|
-
"mcp-protocol-version": $
|
|
2570
|
-
};
|
|
2571
|
-
if (this.authProvider) {
|
|
2572
|
-
const t = await this.authProvider.tokens();
|
|
2573
|
-
t?.access_token && (e.Authorization = `Bearer ${t.access_token}`);
|
|
2574
|
-
}
|
|
2575
|
-
return U2(
|
|
2576
|
-
e,
|
|
2577
|
-
`ai-sdk/${D2}`,
|
|
2578
|
-
I2()
|
|
2579
|
-
);
|
|
2580
|
-
}
|
|
2581
|
-
async start() {
|
|
2582
|
-
return new Promise((r, e) => {
|
|
2583
|
-
if (this.connected)
|
|
2584
|
-
return r();
|
|
2585
|
-
this.abortController = new AbortController();
|
|
2586
|
-
const t = async (s = !1) => {
|
|
2587
|
-
var i, n, a, l, h;
|
|
2588
|
-
try {
|
|
2589
|
-
const c = await this.commonHeaders({
|
|
2590
|
-
Accept: "text/event-stream"
|
|
2591
|
-
}), d = await fetch(this.url.href, {
|
|
2592
|
-
headers: c,
|
|
2593
|
-
signal: (i = this.abortController) == null ? void 0 : i.signal
|
|
2594
|
-
});
|
|
2595
|
-
if (d.status === 401 && this.authProvider && !s) {
|
|
2596
|
-
this.resourceMetadataUrl = J(d);
|
|
2597
|
-
try {
|
|
2598
|
-
if (await W(this.authProvider, {
|
|
2599
|
-
serverUrl: this.url,
|
|
2600
|
-
resourceMetadataUrl: this.resourceMetadataUrl
|
|
2601
|
-
}) !== "AUTHORIZED") {
|
|
2602
|
-
const u = new V();
|
|
2603
|
-
return (n = this.onerror) == null || n.call(this, u), e(u);
|
|
2604
|
-
}
|
|
2605
|
-
} catch (f) {
|
|
2606
|
-
return (a = this.onerror) == null || a.call(this, f), e(f);
|
|
2607
|
-
}
|
|
2608
|
-
return t(!0);
|
|
2609
|
-
}
|
|
2610
|
-
if (!d.ok || !d.body) {
|
|
2611
|
-
let f = `MCP SSE Transport Error: ${d.status} ${d.statusText}`;
|
|
2612
|
-
d.status === 405 && (f += ". This server does not support SSE transport. Try using `http` transport instead");
|
|
2613
|
-
const u = new y({
|
|
2614
|
-
message: f
|
|
2615
|
-
});
|
|
2616
|
-
return (l = this.onerror) == null || l.call(this, u), e(u);
|
|
2617
|
-
}
|
|
2618
|
-
const p = d.body.pipeThrough(new TextDecoderStream()).pipeThrough(new o2()).getReader(), C = async () => {
|
|
2619
|
-
var f, u, m;
|
|
2620
|
-
try {
|
|
2621
|
-
for (; ; ) {
|
|
2622
|
-
const { done: w, value: v } = await p.read();
|
|
2623
|
-
if (w) {
|
|
2624
|
-
if (this.connected)
|
|
2625
|
-
throw this.connected = !1, new y({
|
|
2626
|
-
message: "MCP SSE Transport Error: Connection closed unexpectedly"
|
|
2627
|
-
});
|
|
2628
|
-
return;
|
|
2629
|
-
}
|
|
2630
|
-
const { event: _, data: S } = v;
|
|
2631
|
-
if (_ === "endpoint") {
|
|
2632
|
-
if (this.endpoint = new URL(S, this.url), this.endpoint.origin !== this.url.origin)
|
|
2633
|
-
throw new y({
|
|
2634
|
-
message: `MCP SSE Transport Error: Endpoint origin does not match connection origin: ${this.endpoint.origin}`
|
|
2635
|
-
});
|
|
2636
|
-
this.connected = !0, r();
|
|
2637
|
-
} else if (_ === "message")
|
|
2638
|
-
try {
|
|
2639
|
-
const L = q.parse(
|
|
2640
|
-
JSON.parse(S)
|
|
2641
|
-
);
|
|
2642
|
-
(f = this.onmessage) == null || f.call(this, L);
|
|
2643
|
-
} catch (L) {
|
|
2644
|
-
const b = new y({
|
|
2645
|
-
message: "MCP SSE Transport Error: Failed to parse message",
|
|
2646
|
-
cause: L
|
|
2647
|
-
});
|
|
2648
|
-
(u = this.onerror) == null || u.call(this, b);
|
|
2649
|
-
}
|
|
2650
|
-
}
|
|
2651
|
-
} catch (w) {
|
|
2652
|
-
if (w instanceof Error && w.name === "AbortError")
|
|
2653
|
-
return;
|
|
2654
|
-
(m = this.onerror) == null || m.call(this, w), e(w);
|
|
2655
|
-
}
|
|
2656
|
-
};
|
|
2657
|
-
this.sseConnection = {
|
|
2658
|
-
close: () => p.cancel()
|
|
2659
|
-
}, C();
|
|
2660
|
-
} catch (c) {
|
|
2661
|
-
if (c instanceof Error && c.name === "AbortError")
|
|
2662
|
-
return;
|
|
2663
|
-
(h = this.onerror) == null || h.call(this, c), e(c);
|
|
2664
|
-
}
|
|
2665
|
-
};
|
|
2666
|
-
t();
|
|
2667
|
-
});
|
|
2668
|
-
}
|
|
2669
|
-
async close() {
|
|
2670
|
-
var r, e, t;
|
|
2671
|
-
this.connected = !1, (r = this.sseConnection) == null || r.close(), (e = this.abortController) == null || e.abort(), (t = this.onclose) == null || t.call(this);
|
|
2672
|
-
}
|
|
2673
|
-
async send(r) {
|
|
2674
|
-
if (!this.endpoint || !this.connected)
|
|
2675
|
-
throw new y({
|
|
2676
|
-
message: "MCP SSE Transport Error: Not connected"
|
|
2677
|
-
});
|
|
2678
|
-
const e = this.endpoint, t = async (s = !1) => {
|
|
2679
|
-
var i, n, a, l, h;
|
|
2680
|
-
try {
|
|
2681
|
-
const d = {
|
|
2682
|
-
method: "POST",
|
|
2683
|
-
headers: await this.commonHeaders({
|
|
2684
|
-
"Content-Type": "application/json"
|
|
2685
|
-
}),
|
|
2686
|
-
body: JSON.stringify(r),
|
|
2687
|
-
signal: (i = this.abortController) == null ? void 0 : i.signal
|
|
2688
|
-
}, g = await fetch(e, d);
|
|
2689
|
-
if (g.status === 401 && this.authProvider && !s) {
|
|
2690
|
-
this.resourceMetadataUrl = J(g);
|
|
2691
|
-
try {
|
|
2692
|
-
if (await W(this.authProvider, {
|
|
2693
|
-
serverUrl: this.url,
|
|
2694
|
-
resourceMetadataUrl: this.resourceMetadataUrl
|
|
2695
|
-
}) !== "AUTHORIZED") {
|
|
2696
|
-
const C = new V();
|
|
2697
|
-
(n = this.onerror) == null || n.call(this, C);
|
|
2698
|
-
return;
|
|
2699
|
-
}
|
|
2700
|
-
} catch (p) {
|
|
2701
|
-
(a = this.onerror) == null || a.call(this, p);
|
|
2702
|
-
return;
|
|
2703
|
-
}
|
|
2704
|
-
return t(!0);
|
|
2705
|
-
}
|
|
2706
|
-
if (!g.ok) {
|
|
2707
|
-
const p = await g.text().catch(() => null), C = new y({
|
|
2708
|
-
message: `MCP SSE Transport Error: POSTing to endpoint (HTTP ${g.status}): ${p}`
|
|
2709
|
-
});
|
|
2710
|
-
(l = this.onerror) == null || l.call(this, C);
|
|
2711
|
-
return;
|
|
2712
|
-
}
|
|
2713
|
-
} catch (c) {
|
|
2714
|
-
(h = this.onerror) == null || h.call(this, c);
|
|
2715
|
-
return;
|
|
2716
|
-
}
|
|
2717
|
-
};
|
|
2718
|
-
await t();
|
|
2719
|
-
}
|
|
2720
|
-
}, Wt = class {
|
|
2721
|
-
constructor({
|
|
2722
|
-
url: r,
|
|
2723
|
-
headers: e,
|
|
2724
|
-
authProvider: t
|
|
2725
|
-
}) {
|
|
2726
|
-
this.inboundReconnectAttempts = 0, this.reconnectionOptions = {
|
|
2727
|
-
initialReconnectionDelay: 1e3,
|
|
2728
|
-
maxReconnectionDelay: 3e4,
|
|
2729
|
-
reconnectionDelayGrowFactor: 1.5,
|
|
2730
|
-
maxRetries: 2
|
|
2731
|
-
}, this.url = new URL(r), this.headers = e, this.authProvider = t;
|
|
2732
|
-
}
|
|
2733
|
-
async commonHeaders(r) {
|
|
2734
|
-
const e = {
|
|
2735
|
-
...this.headers,
|
|
2736
|
-
...r,
|
|
2737
|
-
"mcp-protocol-version": $
|
|
2738
|
-
};
|
|
2739
|
-
if (this.sessionId && (e["mcp-session-id"] = this.sessionId), this.authProvider) {
|
|
2740
|
-
const t = await this.authProvider.tokens();
|
|
2741
|
-
t?.access_token && (e.Authorization = `Bearer ${t.access_token}`);
|
|
2742
|
-
}
|
|
2743
|
-
return U2(
|
|
2744
|
-
e,
|
|
2745
|
-
`ai-sdk/${D2}`,
|
|
2746
|
-
I2()
|
|
2747
|
-
);
|
|
2748
|
-
}
|
|
2749
|
-
async start() {
|
|
2750
|
-
if (this.abortController)
|
|
2751
|
-
throw new y({
|
|
2752
|
-
message: "MCP HTTP Transport Error: Transport already started. Note: client.connect() calls start() automatically."
|
|
2753
|
-
});
|
|
2754
|
-
this.abortController = new AbortController(), this.openInboundSse();
|
|
2755
|
-
}
|
|
2756
|
-
async close() {
|
|
2757
|
-
var r, e, t;
|
|
2758
|
-
(r = this.inboundSseConnection) == null || r.close();
|
|
2759
|
-
try {
|
|
2760
|
-
if (this.sessionId && this.abortController && !this.abortController.signal.aborted) {
|
|
2761
|
-
const s = await this.commonHeaders({});
|
|
2762
|
-
await fetch(this.url, {
|
|
2763
|
-
method: "DELETE",
|
|
2764
|
-
headers: s,
|
|
2765
|
-
signal: this.abortController.signal
|
|
2766
|
-
}).catch(() => {
|
|
2767
|
-
});
|
|
2768
|
-
}
|
|
2769
|
-
} catch {
|
|
2770
|
-
}
|
|
2771
|
-
(e = this.abortController) == null || e.abort(), (t = this.onclose) == null || t.call(this);
|
|
2772
|
-
}
|
|
2773
|
-
async send(r) {
|
|
2774
|
-
const e = async (t = !1) => {
|
|
2775
|
-
var s, i, n, a, l, h, c;
|
|
2776
|
-
try {
|
|
2777
|
-
const g = {
|
|
2778
|
-
method: "POST",
|
|
2779
|
-
headers: await this.commonHeaders({
|
|
2780
|
-
"Content-Type": "application/json",
|
|
2781
|
-
Accept: "application/json, text/event-stream"
|
|
2782
|
-
}),
|
|
2783
|
-
body: JSON.stringify(r),
|
|
2784
|
-
signal: (s = this.abortController) == null ? void 0 : s.signal
|
|
2785
|
-
}, p = await fetch(this.url, g), C = p.headers.get("mcp-session-id");
|
|
2786
|
-
if (C && (this.sessionId = C), p.status === 401 && this.authProvider && !t) {
|
|
2787
|
-
this.resourceMetadataUrl = J(p);
|
|
2788
|
-
try {
|
|
2789
|
-
if (await W(this.authProvider, {
|
|
2790
|
-
serverUrl: this.url,
|
|
2791
|
-
resourceMetadataUrl: this.resourceMetadataUrl
|
|
2792
|
-
}) !== "AUTHORIZED")
|
|
2793
|
-
throw new V();
|
|
2794
|
-
} catch (m) {
|
|
2795
|
-
throw (i = this.onerror) == null || i.call(this, m), m;
|
|
2796
|
-
}
|
|
2797
|
-
return e(!0);
|
|
2798
|
-
}
|
|
2799
|
-
if (p.status === 202) {
|
|
2800
|
-
this.inboundSseConnection || this.openInboundSse();
|
|
2801
|
-
return;
|
|
2802
|
-
}
|
|
2803
|
-
if (!p.ok) {
|
|
2804
|
-
const m = await p.text().catch(() => null);
|
|
2805
|
-
let w = `MCP HTTP Transport Error: POSTing to endpoint (HTTP ${p.status}): ${m}`;
|
|
2806
|
-
p.status === 404 && (w += ". This server does not support HTTP transport. Try using `sse` transport instead");
|
|
2807
|
-
const v = new y({
|
|
2808
|
-
message: w
|
|
2809
|
-
});
|
|
2810
|
-
throw (n = this.onerror) == null || n.call(this, v), v;
|
|
2811
|
-
}
|
|
2812
|
-
const f = p.headers.get("content-type") || "";
|
|
2813
|
-
if (f.includes("application/json")) {
|
|
2814
|
-
const m = await p.json(), w = Array.isArray(m) ? m.map((v) => q.parse(v)) : [q.parse(m)];
|
|
2815
|
-
for (const v of w) (a = this.onmessage) == null || a.call(this, v);
|
|
2816
|
-
return;
|
|
2817
|
-
}
|
|
2818
|
-
if (f.includes("text/event-stream")) {
|
|
2819
|
-
if (!p.body) {
|
|
2820
|
-
const _ = new y({
|
|
2821
|
-
message: "MCP HTTP Transport Error: text/event-stream response without body"
|
|
2822
|
-
});
|
|
2823
|
-
throw (l = this.onerror) == null || l.call(this, _), _;
|
|
2824
|
-
}
|
|
2825
|
-
const w = p.body.pipeThrough(new TextDecoderStream()).pipeThrough(new o2()).getReader();
|
|
2826
|
-
(async () => {
|
|
2827
|
-
var _, S, L;
|
|
2828
|
-
try {
|
|
2829
|
-
for (; ; ) {
|
|
2830
|
-
const { done: b, value: E } = await w.read();
|
|
2831
|
-
if (b) return;
|
|
2832
|
-
const { event: U, data: R } = E;
|
|
2833
|
-
if (U === "message")
|
|
2834
|
-
try {
|
|
2835
|
-
const P = q.parse(JSON.parse(R));
|
|
2836
|
-
(_ = this.onmessage) == null || _.call(this, P);
|
|
2837
|
-
} catch (P) {
|
|
2838
|
-
const Q = new y({
|
|
2839
|
-
message: "MCP HTTP Transport Error: Failed to parse message",
|
|
2840
|
-
cause: P
|
|
2841
|
-
});
|
|
2842
|
-
(S = this.onerror) == null || S.call(this, Q);
|
|
2843
|
-
}
|
|
2844
|
-
}
|
|
2845
|
-
} catch (b) {
|
|
2846
|
-
if (b instanceof Error && b.name === "AbortError")
|
|
2847
|
-
return;
|
|
2848
|
-
(L = this.onerror) == null || L.call(this, b);
|
|
2849
|
-
}
|
|
2850
|
-
})();
|
|
2851
|
-
return;
|
|
2852
|
-
}
|
|
2853
|
-
const u = new y({
|
|
2854
|
-
message: `MCP HTTP Transport Error: Unexpected content type: ${f}`
|
|
2855
|
-
});
|
|
2856
|
-
throw (h = this.onerror) == null || h.call(this, u), u;
|
|
2857
|
-
} catch (d) {
|
|
2858
|
-
throw (c = this.onerror) == null || c.call(this, d), d;
|
|
2859
|
-
}
|
|
2860
|
-
};
|
|
2861
|
-
await e();
|
|
2862
|
-
}
|
|
2863
|
-
getNextReconnectionDelay(r) {
|
|
2864
|
-
const {
|
|
2865
|
-
initialReconnectionDelay: e,
|
|
2866
|
-
reconnectionDelayGrowFactor: t,
|
|
2867
|
-
maxReconnectionDelay: s
|
|
2868
|
-
} = this.reconnectionOptions;
|
|
2869
|
-
return Math.min(
|
|
2870
|
-
e * Math.pow(t, r),
|
|
2871
|
-
s
|
|
2872
|
-
);
|
|
2873
|
-
}
|
|
2874
|
-
scheduleInboundSseReconnection() {
|
|
2875
|
-
var r;
|
|
2876
|
-
const { maxRetries: e } = this.reconnectionOptions;
|
|
2877
|
-
if (e > 0 && this.inboundReconnectAttempts >= e) {
|
|
2878
|
-
(r = this.onerror) == null || r.call(
|
|
2879
|
-
this,
|
|
2880
|
-
new y({
|
|
2881
|
-
message: `MCP HTTP Transport Error: Maximum reconnection attempts (${e}) exceeded.`
|
|
2882
|
-
})
|
|
2883
|
-
);
|
|
2884
|
-
return;
|
|
2885
|
-
}
|
|
2886
|
-
const t = this.getNextReconnectionDelay(this.inboundReconnectAttempts);
|
|
2887
|
-
this.inboundReconnectAttempts += 1, setTimeout(async () => {
|
|
2888
|
-
var s;
|
|
2889
|
-
(s = this.abortController) != null && s.signal.aborted || await this.openInboundSse(!1, this.lastInboundEventId);
|
|
2890
|
-
}, t);
|
|
2891
|
-
}
|
|
2892
|
-
// Open optional inbound SSE stream; best-effort and resumable
|
|
2893
|
-
async openInboundSse(r = !1, e) {
|
|
2894
|
-
var t, s, i, n, a, l;
|
|
2895
|
-
try {
|
|
2896
|
-
const h = await this.commonHeaders({
|
|
2897
|
-
Accept: "text/event-stream"
|
|
2898
|
-
});
|
|
2899
|
-
e && (h["last-event-id"] = e);
|
|
2900
|
-
const c = await fetch(this.url.href, {
|
|
2901
|
-
method: "GET",
|
|
2902
|
-
headers: h,
|
|
2903
|
-
signal: (t = this.abortController) == null ? void 0 : t.signal
|
|
2904
|
-
}), d = c.headers.get("mcp-session-id");
|
|
2905
|
-
if (d && (this.sessionId = d), c.status === 401 && this.authProvider && !r) {
|
|
2906
|
-
this.resourceMetadataUrl = J(c);
|
|
2907
|
-
try {
|
|
2908
|
-
if (await W(this.authProvider, {
|
|
2909
|
-
serverUrl: this.url,
|
|
2910
|
-
resourceMetadataUrl: this.resourceMetadataUrl
|
|
2911
|
-
}) !== "AUTHORIZED") {
|
|
2912
|
-
const u = new V();
|
|
2913
|
-
(s = this.onerror) == null || s.call(this, u);
|
|
2914
|
-
return;
|
|
2915
|
-
}
|
|
2916
|
-
} catch (f) {
|
|
2917
|
-
(i = this.onerror) == null || i.call(this, f);
|
|
2918
|
-
return;
|
|
2919
|
-
}
|
|
2920
|
-
return this.openInboundSse(!0, e);
|
|
2921
|
-
}
|
|
2922
|
-
if (c.status === 405)
|
|
2923
|
-
return;
|
|
2924
|
-
if (!c.ok || !c.body) {
|
|
2925
|
-
const f = new y({
|
|
2926
|
-
message: `MCP HTTP Transport Error: GET SSE failed: ${c.status} ${c.statusText}`
|
|
2927
|
-
});
|
|
2928
|
-
(n = this.onerror) == null || n.call(this, f);
|
|
2929
|
-
return;
|
|
2930
|
-
}
|
|
2931
|
-
const p = c.body.pipeThrough(new TextDecoderStream()).pipeThrough(new o2()).getReader(), C = async () => {
|
|
2932
|
-
var f, u, m, w;
|
|
2933
|
-
try {
|
|
2934
|
-
for (; ; ) {
|
|
2935
|
-
const { done: v, value: _ } = await p.read();
|
|
2936
|
-
if (v) return;
|
|
2937
|
-
const { event: S, data: L, id: b } = _;
|
|
2938
|
-
if (b && (this.lastInboundEventId = b), S === "message")
|
|
2939
|
-
try {
|
|
2940
|
-
const E = q.parse(JSON.parse(L));
|
|
2941
|
-
(f = this.onmessage) == null || f.call(this, E);
|
|
2942
|
-
} catch (E) {
|
|
2943
|
-
const U = new y({
|
|
2944
|
-
message: "MCP HTTP Transport Error: Failed to parse message",
|
|
2945
|
-
cause: E
|
|
2946
|
-
});
|
|
2947
|
-
(u = this.onerror) == null || u.call(this, U);
|
|
2948
|
-
}
|
|
2949
|
-
}
|
|
2950
|
-
} catch (v) {
|
|
2951
|
-
if (v instanceof Error && v.name === "AbortError")
|
|
2952
|
-
return;
|
|
2953
|
-
(m = this.onerror) == null || m.call(this, v), (w = this.abortController) != null && w.signal.aborted || this.scheduleInboundSseReconnection();
|
|
2954
|
-
}
|
|
2955
|
-
};
|
|
2956
|
-
this.inboundSseConnection = {
|
|
2957
|
-
close: () => p.cancel()
|
|
2958
|
-
}, this.inboundReconnectAttempts = 0, C();
|
|
2959
|
-
} catch (h) {
|
|
2960
|
-
if (h instanceof Error && h.name === "AbortError")
|
|
2961
|
-
return;
|
|
2962
|
-
(a = this.onerror) == null || a.call(this, h), (l = this.abortController) != null && l.signal.aborted || this.scheduleInboundSseReconnection();
|
|
2963
|
-
}
|
|
2964
|
-
}
|
|
2965
|
-
};
|
|
2966
|
-
function Gt(r) {
|
|
2967
|
-
switch (r.type) {
|
|
2968
|
-
case "sse":
|
|
2969
|
-
return new Jt(r);
|
|
2970
|
-
case "http":
|
|
2971
|
-
return new Wt(r);
|
|
2972
|
-
default:
|
|
2973
|
-
throw new y({
|
|
2974
|
-
message: "Unsupported or invalid transport configuration. If you are using a custom transport, make sure it implements the MCPTransport interface."
|
|
2975
|
-
});
|
|
2976
|
-
}
|
|
2977
|
-
}
|
|
2978
|
-
function Yt(r) {
|
|
2979
|
-
return "start" in r && typeof r.start == "function" && "send" in r && typeof r.send == "function" && "close" in r && typeof r.close == "function";
|
|
2980
|
-
}
|
|
2981
|
-
var Kt = "1.0.0";
|
|
2982
|
-
async function Qt(r) {
|
|
2983
|
-
const e = new Xt(r);
|
|
2984
|
-
return await e.init(), e;
|
|
2985
|
-
}
|
|
2986
|
-
var Xt = class {
|
|
2987
|
-
constructor({
|
|
2988
|
-
transport: r,
|
|
2989
|
-
name: e = "ai-sdk-mcp-client",
|
|
2990
|
-
version: t = Kt,
|
|
2991
|
-
onUncaughtError: s,
|
|
2992
|
-
capabilities: i
|
|
2993
|
-
}) {
|
|
2994
|
-
this.requestMessageId = 0, this.responseHandlers = /* @__PURE__ */ new Map(), this.serverCapabilities = {}, this.isClosed = !0, this.onUncaughtError = s, this.clientCapabilities = i ?? {}, Yt(r) ? this.transport = r : this.transport = Gt(r), this.transport.onclose = () => this.onClose(), this.transport.onerror = (n) => this.onError(n), this.transport.onmessage = (n) => {
|
|
2995
|
-
if ("method" in n) {
|
|
2996
|
-
"id" in n ? this.onRequestMessage(n) : this.onError(
|
|
2997
|
-
new y({
|
|
2998
|
-
message: "Unsupported message type"
|
|
2999
|
-
})
|
|
3000
|
-
);
|
|
3001
|
-
return;
|
|
3002
|
-
}
|
|
3003
|
-
this.onResponse(n);
|
|
3004
|
-
}, this.clientInfo = {
|
|
3005
|
-
name: e,
|
|
3006
|
-
version: t
|
|
3007
|
-
};
|
|
3008
|
-
}
|
|
3009
|
-
async init() {
|
|
3010
|
-
try {
|
|
3011
|
-
await this.transport.start(), this.isClosed = !1;
|
|
3012
|
-
const r = await this.request({
|
|
3013
|
-
request: {
|
|
3014
|
-
method: "initialize",
|
|
3015
|
-
params: {
|
|
3016
|
-
protocolVersion: $,
|
|
3017
|
-
capabilities: this.clientCapabilities,
|
|
3018
|
-
clientInfo: this.clientInfo
|
|
3019
|
-
}
|
|
3020
|
-
},
|
|
3021
|
-
resultSchema: tt
|
|
3022
|
-
});
|
|
3023
|
-
if (r === void 0)
|
|
3024
|
-
throw new y({
|
|
3025
|
-
message: "Server sent invalid initialize result"
|
|
3026
|
-
});
|
|
3027
|
-
if (!Qe.includes(r.protocolVersion))
|
|
3028
|
-
throw new y({
|
|
3029
|
-
message: `Server's protocol version is not supported: ${r.protocolVersion}`
|
|
3030
|
-
});
|
|
3031
|
-
return this.serverCapabilities = r.capabilities, await this.notification({
|
|
3032
|
-
method: "notifications/initialized"
|
|
3033
|
-
}), this;
|
|
3034
|
-
} catch (r) {
|
|
3035
|
-
throw await this.close(), r;
|
|
3036
|
-
}
|
|
3037
|
-
}
|
|
3038
|
-
async close() {
|
|
3039
|
-
var r;
|
|
3040
|
-
this.isClosed || (await ((r = this.transport) == null ? void 0 : r.close()), this.onClose());
|
|
3041
|
-
}
|
|
3042
|
-
assertCapability(r) {
|
|
3043
|
-
switch (r) {
|
|
3044
|
-
case "initialize":
|
|
3045
|
-
break;
|
|
3046
|
-
case "tools/list":
|
|
3047
|
-
case "tools/call":
|
|
3048
|
-
if (!this.serverCapabilities.tools)
|
|
3049
|
-
throw new y({
|
|
3050
|
-
message: "Server does not support tools"
|
|
3051
|
-
});
|
|
3052
|
-
break;
|
|
3053
|
-
case "resources/list":
|
|
3054
|
-
case "resources/read":
|
|
3055
|
-
case "resources/templates/list":
|
|
3056
|
-
if (!this.serverCapabilities.resources)
|
|
3057
|
-
throw new y({
|
|
3058
|
-
message: "Server does not support resources"
|
|
3059
|
-
});
|
|
3060
|
-
break;
|
|
3061
|
-
case "prompts/list":
|
|
3062
|
-
case "prompts/get":
|
|
3063
|
-
if (!this.serverCapabilities.prompts)
|
|
3064
|
-
throw new y({
|
|
3065
|
-
message: "Server does not support prompts"
|
|
3066
|
-
});
|
|
3067
|
-
break;
|
|
3068
|
-
default:
|
|
3069
|
-
throw new y({
|
|
3070
|
-
message: `Unsupported method: ${r}`
|
|
3071
|
-
});
|
|
3072
|
-
}
|
|
3073
|
-
}
|
|
3074
|
-
async request({
|
|
3075
|
-
request: r,
|
|
3076
|
-
resultSchema: e,
|
|
3077
|
-
options: t
|
|
3078
|
-
}) {
|
|
3079
|
-
return new Promise((s, i) => {
|
|
3080
|
-
if (this.isClosed)
|
|
3081
|
-
return i(
|
|
3082
|
-
new y({
|
|
3083
|
-
message: "Attempted to send a request from a closed client"
|
|
3084
|
-
})
|
|
3085
|
-
);
|
|
3086
|
-
this.assertCapability(r.method);
|
|
3087
|
-
const n = t?.signal;
|
|
3088
|
-
n?.throwIfAborted();
|
|
3089
|
-
const a = this.requestMessageId++, l = {
|
|
3090
|
-
...r,
|
|
3091
|
-
jsonrpc: "2.0",
|
|
3092
|
-
id: a
|
|
3093
|
-
}, h = () => {
|
|
3094
|
-
this.responseHandlers.delete(a);
|
|
3095
|
-
};
|
|
3096
|
-
this.responseHandlers.set(a, (c) => {
|
|
3097
|
-
if (n?.aborted)
|
|
3098
|
-
return i(
|
|
3099
|
-
new y({
|
|
3100
|
-
message: "Request was aborted",
|
|
3101
|
-
cause: n.reason
|
|
3102
|
-
})
|
|
3103
|
-
);
|
|
3104
|
-
if (c instanceof Error)
|
|
3105
|
-
return i(c);
|
|
3106
|
-
try {
|
|
3107
|
-
const d = e.parse(c.result);
|
|
3108
|
-
s(d);
|
|
3109
|
-
} catch (d) {
|
|
3110
|
-
const g = new y({
|
|
3111
|
-
message: "Failed to parse server response",
|
|
3112
|
-
cause: d
|
|
3113
|
-
});
|
|
3114
|
-
i(g);
|
|
3115
|
-
}
|
|
3116
|
-
}), this.transport.send(l).catch((c) => {
|
|
3117
|
-
h(), i(c);
|
|
3118
|
-
});
|
|
3119
|
-
});
|
|
3120
|
-
}
|
|
3121
|
-
async listTools({
|
|
3122
|
-
params: r,
|
|
3123
|
-
options: e
|
|
3124
|
-
} = {}) {
|
|
3125
|
-
try {
|
|
3126
|
-
return this.request({
|
|
3127
|
-
request: { method: "tools/list", params: r },
|
|
3128
|
-
resultSchema: st,
|
|
3129
|
-
options: e
|
|
3130
|
-
});
|
|
3131
|
-
} catch (t) {
|
|
3132
|
-
throw t;
|
|
3133
|
-
}
|
|
3134
|
-
}
|
|
3135
|
-
async callTool({
|
|
3136
|
-
name: r,
|
|
3137
|
-
args: e,
|
|
3138
|
-
options: t
|
|
3139
|
-
}) {
|
|
3140
|
-
try {
|
|
3141
|
-
return this.request({
|
|
3142
|
-
request: { method: "tools/call", params: { name: r, arguments: e } },
|
|
3143
|
-
resultSchema: nt,
|
|
3144
|
-
options: {
|
|
3145
|
-
signal: t?.abortSignal
|
|
3146
|
-
}
|
|
3147
|
-
});
|
|
3148
|
-
} catch (s) {
|
|
3149
|
-
throw s;
|
|
3150
|
-
}
|
|
3151
|
-
}
|
|
3152
|
-
async listResourcesInternal({
|
|
3153
|
-
params: r,
|
|
3154
|
-
options: e
|
|
3155
|
-
} = {}) {
|
|
3156
|
-
try {
|
|
3157
|
-
return this.request({
|
|
3158
|
-
request: { method: "resources/list", params: r },
|
|
3159
|
-
resultSchema: it,
|
|
3160
|
-
options: e
|
|
3161
|
-
});
|
|
3162
|
-
} catch (t) {
|
|
3163
|
-
throw t;
|
|
3164
|
-
}
|
|
3165
|
-
}
|
|
3166
|
-
async readResourceInternal({
|
|
3167
|
-
uri: r,
|
|
3168
|
-
options: e
|
|
3169
|
-
}) {
|
|
3170
|
-
try {
|
|
3171
|
-
return this.request({
|
|
3172
|
-
request: { method: "resources/read", params: { uri: r } },
|
|
3173
|
-
resultSchema: lt,
|
|
3174
|
-
options: e
|
|
3175
|
-
});
|
|
3176
|
-
} catch (t) {
|
|
3177
|
-
throw t;
|
|
3178
|
-
}
|
|
3179
|
-
}
|
|
3180
|
-
async listResourceTemplatesInternal({
|
|
3181
|
-
options: r
|
|
3182
|
-
} = {}) {
|
|
3183
|
-
try {
|
|
3184
|
-
return this.request({
|
|
3185
|
-
request: { method: "resources/templates/list" },
|
|
3186
|
-
resultSchema: ct,
|
|
3187
|
-
options: r
|
|
3188
|
-
});
|
|
3189
|
-
} catch (e) {
|
|
3190
|
-
throw e;
|
|
3191
|
-
}
|
|
3192
|
-
}
|
|
3193
|
-
async listPromptsInternal({
|
|
3194
|
-
params: r,
|
|
3195
|
-
options: e
|
|
3196
|
-
} = {}) {
|
|
3197
|
-
try {
|
|
3198
|
-
return this.request({
|
|
3199
|
-
request: { method: "prompts/list", params: r },
|
|
3200
|
-
resultSchema: pt,
|
|
3201
|
-
options: e
|
|
3202
|
-
});
|
|
3203
|
-
} catch (t) {
|
|
3204
|
-
throw t;
|
|
3205
|
-
}
|
|
3206
|
-
}
|
|
3207
|
-
async getPromptInternal({
|
|
3208
|
-
name: r,
|
|
3209
|
-
args: e,
|
|
3210
|
-
options: t
|
|
3211
|
-
}) {
|
|
3212
|
-
try {
|
|
3213
|
-
return this.request({
|
|
3214
|
-
request: { method: "prompts/get", params: { name: r, arguments: e } },
|
|
3215
|
-
resultSchema: mt,
|
|
3216
|
-
options: t
|
|
3217
|
-
});
|
|
3218
|
-
} catch (s) {
|
|
3219
|
-
throw s;
|
|
3220
|
-
}
|
|
3221
|
-
}
|
|
3222
|
-
async notification(r) {
|
|
3223
|
-
const e = {
|
|
3224
|
-
...r,
|
|
3225
|
-
jsonrpc: "2.0"
|
|
3226
|
-
};
|
|
3227
|
-
await this.transport.send(e);
|
|
3228
|
-
}
|
|
3229
|
-
/**
|
|
3230
|
-
* Returns a set of AI SDK tools from the MCP server
|
|
3231
|
-
* @returns A record of tool names to their implementations
|
|
3232
|
-
*/
|
|
3233
|
-
async tools({
|
|
3234
|
-
schemas: r = "automatic"
|
|
3235
|
-
} = {}) {
|
|
3236
|
-
var e;
|
|
3237
|
-
const t = {};
|
|
3238
|
-
try {
|
|
3239
|
-
const s = await this.listTools();
|
|
3240
|
-
for (const { name: i, description: n, inputSchema: a } of s.tools) {
|
|
3241
|
-
if (r !== "automatic" && !(i in r))
|
|
3242
|
-
continue;
|
|
3243
|
-
const l = this, h = async (d, g) => {
|
|
3244
|
-
var p;
|
|
3245
|
-
return (p = g?.abortSignal) == null || p.throwIfAborted(), l.callTool({ name: i, args: d, options: g });
|
|
3246
|
-
}, c = r === "automatic" ? Ze({
|
|
3247
|
-
description: n,
|
|
3248
|
-
inputSchema: Fe({
|
|
3249
|
-
...a,
|
|
3250
|
-
properties: (e = a.properties) != null ? e : {},
|
|
3251
|
-
additionalProperties: !1
|
|
3252
|
-
}),
|
|
3253
|
-
execute: h
|
|
3254
|
-
}) : {
|
|
3255
|
-
description: n,
|
|
3256
|
-
inputSchema: r[i].inputSchema,
|
|
3257
|
-
execute: h
|
|
3258
|
-
};
|
|
3259
|
-
t[i] = c;
|
|
3260
|
-
}
|
|
3261
|
-
return t;
|
|
3262
|
-
} catch (s) {
|
|
3263
|
-
throw s;
|
|
3264
|
-
}
|
|
3265
|
-
}
|
|
3266
|
-
listResources({
|
|
3267
|
-
params: r,
|
|
3268
|
-
options: e
|
|
3269
|
-
} = {}) {
|
|
3270
|
-
return this.listResourcesInternal({ params: r, options: e });
|
|
3271
|
-
}
|
|
3272
|
-
readResource({
|
|
3273
|
-
uri: r,
|
|
3274
|
-
options: e
|
|
3275
|
-
}) {
|
|
3276
|
-
return this.readResourceInternal({ uri: r, options: e });
|
|
3277
|
-
}
|
|
3278
|
-
listResourceTemplates({
|
|
3279
|
-
options: r
|
|
3280
|
-
} = {}) {
|
|
3281
|
-
return this.listResourceTemplatesInternal({ options: r });
|
|
3282
|
-
}
|
|
3283
|
-
listPrompts({
|
|
3284
|
-
params: r,
|
|
3285
|
-
options: e
|
|
3286
|
-
} = {}) {
|
|
3287
|
-
return this.listPromptsInternal({ params: r, options: e });
|
|
3288
|
-
}
|
|
3289
|
-
getPrompt({
|
|
3290
|
-
name: r,
|
|
3291
|
-
arguments: e,
|
|
3292
|
-
options: t
|
|
3293
|
-
}) {
|
|
3294
|
-
return this.getPromptInternal({ name: r, args: e, options: t });
|
|
3295
|
-
}
|
|
3296
|
-
onElicitationRequest(r, e) {
|
|
3297
|
-
if (r !== L2)
|
|
3298
|
-
throw new y({
|
|
3299
|
-
message: "Unsupported request schema. Only ElicitationRequestSchema is supported."
|
|
3300
|
-
});
|
|
3301
|
-
this.elicitationRequestHandler = e;
|
|
3302
|
-
}
|
|
3303
|
-
async onRequestMessage(r) {
|
|
3304
|
-
try {
|
|
3305
|
-
if (r.method !== "elicitation/create") {
|
|
3306
|
-
await this.transport.send({
|
|
3307
|
-
jsonrpc: "2.0",
|
|
3308
|
-
id: r.id,
|
|
3309
|
-
error: {
|
|
3310
|
-
code: -32601,
|
|
3311
|
-
message: `Unsupported request method: ${r.method}`
|
|
3312
|
-
}
|
|
3313
|
-
});
|
|
3314
|
-
return;
|
|
3315
|
-
}
|
|
3316
|
-
if (!this.elicitationRequestHandler) {
|
|
3317
|
-
await this.transport.send({
|
|
3318
|
-
jsonrpc: "2.0",
|
|
3319
|
-
id: r.id,
|
|
3320
|
-
error: {
|
|
3321
|
-
code: -32601,
|
|
3322
|
-
message: "No elicitation handler registered on client"
|
|
3323
|
-
}
|
|
3324
|
-
});
|
|
3325
|
-
return;
|
|
3326
|
-
}
|
|
3327
|
-
const e = L2.safeParse({
|
|
3328
|
-
method: r.method,
|
|
3329
|
-
params: r.params
|
|
3330
|
-
});
|
|
3331
|
-
if (!e.success) {
|
|
3332
|
-
await this.transport.send({
|
|
3333
|
-
jsonrpc: "2.0",
|
|
3334
|
-
id: r.id,
|
|
3335
|
-
error: {
|
|
3336
|
-
code: -32602,
|
|
3337
|
-
message: `Invalid elicitation request: ${e.error.message}`,
|
|
3338
|
-
data: e.error.issues
|
|
3339
|
-
}
|
|
3340
|
-
});
|
|
3341
|
-
return;
|
|
3342
|
-
}
|
|
3343
|
-
try {
|
|
3344
|
-
const t = await this.elicitationRequestHandler(e.data), s = ft.parse(t);
|
|
3345
|
-
await this.transport.send({
|
|
3346
|
-
jsonrpc: "2.0",
|
|
3347
|
-
id: r.id,
|
|
3348
|
-
result: s
|
|
3349
|
-
});
|
|
3350
|
-
} catch (t) {
|
|
3351
|
-
await this.transport.send({
|
|
3352
|
-
jsonrpc: "2.0",
|
|
3353
|
-
id: r.id,
|
|
3354
|
-
error: {
|
|
3355
|
-
code: -32603,
|
|
3356
|
-
message: t instanceof Error ? t.message : "Failed to handle elicitation request"
|
|
3357
|
-
}
|
|
3358
|
-
}), this.onError(t);
|
|
3359
|
-
}
|
|
3360
|
-
} catch (e) {
|
|
3361
|
-
this.onError(e);
|
|
3362
|
-
}
|
|
3363
|
-
}
|
|
3364
|
-
onClose() {
|
|
3365
|
-
if (this.isClosed) return;
|
|
3366
|
-
this.isClosed = !0;
|
|
3367
|
-
const r = new y({
|
|
3368
|
-
message: "Connection closed"
|
|
3369
|
-
});
|
|
3370
|
-
for (const e of this.responseHandlers.values())
|
|
3371
|
-
e(r);
|
|
3372
|
-
this.responseHandlers.clear();
|
|
3373
|
-
}
|
|
3374
|
-
onError(r) {
|
|
3375
|
-
this.onUncaughtError && this.onUncaughtError(r);
|
|
3376
|
-
}
|
|
3377
|
-
onResponse(r) {
|
|
3378
|
-
const e = Number(r.id), t = this.responseHandlers.get(e);
|
|
3379
|
-
if (t === void 0)
|
|
3380
|
-
throw new y({
|
|
3381
|
-
message: `Protocol error: Received a response for an unknown message ID: ${JSON.stringify(
|
|
3382
|
-
r
|
|
3383
|
-
)}`
|
|
3384
|
-
});
|
|
3385
|
-
this.responseHandlers.delete(e), t(
|
|
3386
|
-
"result" in r ? r : new y({
|
|
3387
|
-
message: r.error.message,
|
|
3388
|
-
code: r.error.code,
|
|
3389
|
-
data: r.error.data,
|
|
3390
|
-
cause: r.error
|
|
3391
|
-
})
|
|
3392
|
-
);
|
|
3393
|
-
}
|
|
3394
|
-
};
|
|
3395
|
-
const e0 = async (r) => {
|
|
1574
|
+
const Q2 = (r = {}) => new L2(r), v2 = async (r) => {
|
|
3396
1575
|
const e = {};
|
|
3397
1576
|
try {
|
|
3398
1577
|
const t = await r.listTools();
|
|
3399
|
-
for (const { name:
|
|
3400
|
-
const
|
|
3401
|
-
e[
|
|
3402
|
-
description:
|
|
3403
|
-
inputSchema:
|
|
3404
|
-
...
|
|
3405
|
-
properties:
|
|
1578
|
+
for (const { name: i, description: s, inputSchema: o } of t.tools) {
|
|
1579
|
+
const n = async (a, c) => r.callTool({ name: i, arguments: a }, { signal: c == null ? void 0 : c.abortSignal });
|
|
1580
|
+
e[i] = e2({
|
|
1581
|
+
description: s,
|
|
1582
|
+
inputSchema: t2({
|
|
1583
|
+
...o,
|
|
1584
|
+
properties: o.properties ?? {},
|
|
3406
1585
|
additionalProperties: !1
|
|
3407
1586
|
}),
|
|
3408
|
-
execute:
|
|
1587
|
+
execute: n
|
|
3409
1588
|
});
|
|
3410
1589
|
}
|
|
3411
1590
|
return e;
|
|
3412
1591
|
} catch (t) {
|
|
3413
1592
|
throw t;
|
|
3414
1593
|
}
|
|
1594
|
+
}, x2 = {
|
|
1595
|
+
openai: n2,
|
|
1596
|
+
deepseek: a2
|
|
3415
1597
|
};
|
|
3416
|
-
|
|
3417
|
-
const e = Object.entries(r);
|
|
3418
|
-
if (e.length === 0)
|
|
3419
|
-
return "";
|
|
3420
|
-
let t = `
|
|
3421
|
-
|
|
3422
|
-
# 工具调用
|
|
3423
|
-
|
|
3424
|
-
`;
|
|
3425
|
-
return t += `你可以根据需要调用以下工具:
|
|
3426
|
-
|
|
3427
|
-
`, t += `<tools>
|
|
3428
|
-
`, e.forEach(([s, i]) => {
|
|
3429
|
-
const n = i, a = n.description || "无描述", l = n.parameters || n.inputSchema || {};
|
|
3430
|
-
t += `${JSON.stringify({
|
|
3431
|
-
name: s,
|
|
3432
|
-
description: a,
|
|
3433
|
-
parameters: l
|
|
3434
|
-
}, null, 2)}
|
|
3435
|
-
`;
|
|
3436
|
-
}), t += `</tools>
|
|
3437
|
-
|
|
3438
|
-
`, t += `## 工具调用格式
|
|
3439
|
-
|
|
3440
|
-
`, t += `要调用工具,请使用以下 XML 格式:
|
|
3441
|
-
`, t += `Thought: [你的思考过程]
|
|
3442
|
-
`, t += `<tool_call>{"name": "toolName", "arguments": {"arg1": "value1"}}</tool_call>
|
|
3443
|
-
|
|
3444
|
-
`, t += `工具执行后,你将收到 <tool_response> 格式的结果。你可以继续思考或调用其他工具。
|
|
3445
|
-
|
|
3446
|
-
`, t += `## 使用示例
|
|
3447
|
-
|
|
3448
|
-
`, t += `如果用户要求"获取今天的日期",你可以这样调用工具:
|
|
3449
|
-
`, t += `Thought: 用户想要获取今天的日期,我需要调用日期相关的工具。
|
|
3450
|
-
`, t += `<tool_call>{"name": "get-today", "arguments": {}}</tool_call>
|
|
3451
|
-
|
|
3452
|
-
`, t += `然后等待工具返回结果(Observation),再根据结果给出最终答案。
|
|
3453
|
-
|
|
3454
|
-
`, t += `## 任务完成
|
|
3455
|
-
|
|
3456
|
-
`, t += `当任务完成或无法继续时,直接给出最终答案即可。
|
|
3457
|
-
|
|
3458
|
-
`, t += `**重要提示**:
|
|
3459
|
-
`, t += `- 必须严格按照 XML 格式调用工具
|
|
3460
|
-
`, t += `- arguments 必须是有效的 JSON 格式
|
|
3461
|
-
`, t += `- 如果不需要调用工具,直接给出最终答案即可
|
|
3462
|
-
`, t;
|
|
3463
|
-
}
|
|
3464
|
-
function M2(r, e) {
|
|
3465
|
-
if (!r || typeof r != "string")
|
|
3466
|
-
return null;
|
|
3467
|
-
const t = r.match(/<tool_call>([\s\S]*?)<\/tool_call>/i);
|
|
3468
|
-
if (t)
|
|
3469
|
-
try {
|
|
3470
|
-
const s = t[1].trim(), i = JSON.parse(s), n = i.name || i.action || i.tool, a = i.arguments || i.args || i.input || {};
|
|
3471
|
-
if (n && e[n])
|
|
3472
|
-
return { toolName: n, arguments: a };
|
|
3473
|
-
} catch {
|
|
3474
|
-
}
|
|
3475
|
-
return null;
|
|
3476
|
-
}
|
|
3477
|
-
const r0 = {
|
|
3478
|
-
openai: be,
|
|
3479
|
-
deepseek: xe
|
|
3480
|
-
};
|
|
3481
|
-
class I0 {
|
|
1598
|
+
class K2 {
|
|
3482
1599
|
constructor({ llmConfig: e, mcpServers: t }) {
|
|
3483
|
-
if (this.mcpServers = {}, this.mcpClients = {}, this.mcpTools = {}, this.ignoreToolnames = [], this.messages = [],
|
|
1600
|
+
if (this.mcpServers = {}, this.mcpClients = {}, this.mcpTools = {}, this.ignoreToolnames = [], this.messages = [], !e)
|
|
3484
1601
|
throw new Error("llmConfig is required to initialize AgentModelProvider");
|
|
3485
1602
|
if (this.mcpServers = t || {}, this.mcpClients = {}, this.mcpTools = {}, e.llm)
|
|
3486
1603
|
this.llm = e.llm;
|
|
3487
1604
|
else if (e.providerType) {
|
|
3488
|
-
const
|
|
3489
|
-
let
|
|
3490
|
-
typeof
|
|
1605
|
+
const i = e.providerType;
|
|
1606
|
+
let s;
|
|
1607
|
+
typeof i == "string" ? s = x2[i] : s = i, this.llm = s({
|
|
3491
1608
|
apiKey: e.apiKey,
|
|
3492
1609
|
baseURL: e.baseURL
|
|
3493
1610
|
});
|
|
3494
1611
|
} else
|
|
3495
1612
|
throw new Error("Either llmConfig.llm or llmConfig.providerType must be provided");
|
|
3496
|
-
this.useReActMode = e.useReActMode ?? !1;
|
|
3497
1613
|
}
|
|
3498
1614
|
/** 创建一个 ai-sdk的 mcpClient, 创建失败则返回 null */
|
|
3499
1615
|
async _createOneClient(e) {
|
|
3500
1616
|
try {
|
|
3501
1617
|
let t;
|
|
3502
|
-
if ("type" in e && e.type.toLocaleLowerCase() === "streamablehttp" ? t = new
|
|
3503
|
-
const
|
|
3504
|
-
return
|
|
1618
|
+
if ("type" in e && e.type.toLocaleLowerCase() === "streamablehttp" ? t = new p(new URL(e.url)) : "type" in e && e.type === "extension" ? t = new h2(e.sessionId) : t = e, e.useAISdkClient ?? !1) {
|
|
1619
|
+
const s = await i2({ transport: t });
|
|
1620
|
+
return s.__transport__ = t, s;
|
|
3505
1621
|
} else {
|
|
3506
|
-
const
|
|
1622
|
+
const s = new c2(
|
|
3507
1623
|
{ name: "mcp-web-client", version: "1.0.0" },
|
|
3508
1624
|
{ capabilities: { roots: { listChanged: !0 }, sampling: {}, elicitation: {} } }
|
|
3509
1625
|
);
|
|
3510
|
-
return await
|
|
1626
|
+
return await s.connect(t), s.__transport__ = t, s;
|
|
3511
1627
|
}
|
|
3512
1628
|
} catch (t) {
|
|
3513
|
-
return this.onError && this.onError(t
|
|
1629
|
+
return this.onError && this.onError((t == null ? void 0 : t.message) || "Failed to create MCP client", t), console.error("Failed to create MCP client", e, t), null;
|
|
3514
1630
|
}
|
|
3515
1631
|
}
|
|
3516
1632
|
/** 关闭一个 mcpClient */
|
|
3517
1633
|
async _closeOneClient(e) {
|
|
1634
|
+
var t, i, s;
|
|
3518
1635
|
try {
|
|
3519
|
-
const
|
|
3520
|
-
if (
|
|
1636
|
+
const o = e.__transport__;
|
|
1637
|
+
if (o && o instanceof N || o && o instanceof $)
|
|
3521
1638
|
return;
|
|
3522
|
-
await t
|
|
1639
|
+
await ((t = o == null ? void 0 : o.terminateSession) == null ? void 0 : t.call(o)), await ((i = o == null ? void 0 : o.close) == null ? void 0 : i.call(o)), await ((s = e == null ? void 0 : e.close) == null ? void 0 : s.call(e));
|
|
3523
1640
|
} catch {
|
|
3524
1641
|
}
|
|
3525
1642
|
}
|
|
3526
1643
|
/** 创建所有 mcpClients */
|
|
3527
1644
|
async _createMpcClients() {
|
|
3528
1645
|
const e = Object.entries(this.mcpServers), t = await Promise.all(
|
|
3529
|
-
e.map(async ([
|
|
3530
|
-
const
|
|
3531
|
-
return { serverName:
|
|
1646
|
+
e.map(async ([i, s]) => {
|
|
1647
|
+
const o = await this._createOneClient(s);
|
|
1648
|
+
return { serverName: i, client: o };
|
|
3532
1649
|
})
|
|
3533
1650
|
);
|
|
3534
|
-
this.mcpClients = {}, t.forEach(({ serverName:
|
|
3535
|
-
this.mcpClients[
|
|
1651
|
+
this.mcpClients = {}, t.forEach(({ serverName: i, client: s }) => {
|
|
1652
|
+
this.mcpClients[i] = s;
|
|
3536
1653
|
});
|
|
3537
1654
|
}
|
|
3538
1655
|
/** 兼容两种 client 类型的 tools 获取方法 */
|
|
@@ -3540,22 +1657,22 @@ class I0 {
|
|
|
3540
1657
|
if (!e)
|
|
3541
1658
|
return null;
|
|
3542
1659
|
try {
|
|
3543
|
-
return typeof e.tools == "function" ? await e.tools() : await
|
|
3544
|
-
} catch (
|
|
3545
|
-
return this.onError && this.onError(
|
|
1660
|
+
return typeof e.tools == "function" ? await e.tools() : await v2(e);
|
|
1661
|
+
} catch (i) {
|
|
1662
|
+
return this.onError && this.onError((i == null ? void 0 : i.message) || `Failed to query tools for ${t}`, i), console.error(`Failed to query tools for ${t}`, i), null;
|
|
3546
1663
|
}
|
|
3547
1664
|
}
|
|
3548
1665
|
/** 查询所有 mcpClients 的 tools, 失败则保存为null */
|
|
3549
1666
|
async _createMpcTools() {
|
|
3550
1667
|
const e = Object.entries(this.mcpClients), t = await Promise.all(
|
|
3551
|
-
e.map(async ([
|
|
3552
|
-
const
|
|
3553
|
-
return { serverName:
|
|
1668
|
+
e.map(async ([i, s]) => {
|
|
1669
|
+
const o = await this._getClientTools(s, i);
|
|
1670
|
+
return { serverName: i, tools: o };
|
|
3554
1671
|
})
|
|
3555
1672
|
);
|
|
3556
|
-
this.mcpTools = {}, t.forEach(({ serverName:
|
|
3557
|
-
const
|
|
3558
|
-
this.mcpTools[
|
|
1673
|
+
this.mcpTools = {}, t.forEach(({ serverName: i, tools: s }) => {
|
|
1674
|
+
const o = s && typeof s == "object" ? s : {};
|
|
1675
|
+
this.mcpTools[i] = o;
|
|
3559
1676
|
});
|
|
3560
1677
|
}
|
|
3561
1678
|
/** 关闭所有的 clients */
|
|
@@ -3565,14 +1682,15 @@ class I0 {
|
|
|
3565
1682
|
try {
|
|
3566
1683
|
await this._closeOneClient(e);
|
|
3567
1684
|
} catch (t) {
|
|
3568
|
-
this.onError && this.onError(t
|
|
1685
|
+
this.onError && this.onError((t == null ? void 0 : t.message) || "Failed to close client", t), console.error("Failed to close client", t);
|
|
3569
1686
|
}
|
|
3570
1687
|
})
|
|
3571
1688
|
);
|
|
3572
1689
|
}
|
|
3573
1690
|
/** 创建所有的 mcpClients,并更新它们的tools */
|
|
3574
1691
|
async initClientsAndTools() {
|
|
3575
|
-
|
|
1692
|
+
var e;
|
|
1693
|
+
await this._createMpcClients(), await this._createMpcTools(), (e = this.onUpdatedTools) == null || e.call(this);
|
|
3576
1694
|
}
|
|
3577
1695
|
/** 全量更新所有的 mcpServers */
|
|
3578
1696
|
async updateMcpServers(e) {
|
|
@@ -3580,17 +1698,19 @@ class I0 {
|
|
|
3580
1698
|
}
|
|
3581
1699
|
/** 插入一个新的mcpServer,如果已经存在则返回false */
|
|
3582
1700
|
async insertMcpServer(e, t) {
|
|
1701
|
+
var o, n;
|
|
3583
1702
|
if (this.mcpServers[e])
|
|
3584
1703
|
return !1;
|
|
3585
|
-
const
|
|
3586
|
-
if (!
|
|
3587
|
-
return this.onError
|
|
3588
|
-
this.mcpClients[e] =
|
|
3589
|
-
const
|
|
3590
|
-
return this.mcpTools[e] =
|
|
1704
|
+
const i = await this._createOneClient(t);
|
|
1705
|
+
if (!i)
|
|
1706
|
+
return (o = this.onError) == null || o.call(this, `Failed to create MCP client: ${e}`), null;
|
|
1707
|
+
this.mcpClients[e] = i;
|
|
1708
|
+
const s = await this._getClientTools(i, e);
|
|
1709
|
+
return this.mcpTools[e] = s && typeof s == "object" ? s : {}, this.mcpServers[e] = t, (n = this.onUpdatedTools) == null || n.call(this), i;
|
|
3591
1710
|
}
|
|
3592
1711
|
/** 通过服务器名称删除mcpServer: mcpServers mcpClients mcpTools ignoreToolnames */
|
|
3593
1712
|
async removeMcpServer(e) {
|
|
1713
|
+
var s;
|
|
3594
1714
|
if (!this.mcpServers[e])
|
|
3595
1715
|
return;
|
|
3596
1716
|
delete this.mcpServers[e];
|
|
@@ -3600,281 +1720,70 @@ class I0 {
|
|
|
3600
1720
|
await this._closeOneClient(t);
|
|
3601
1721
|
} catch {
|
|
3602
1722
|
}
|
|
3603
|
-
const
|
|
3604
|
-
delete this.mcpTools[e],
|
|
3605
|
-
this.ignoreToolnames = this.ignoreToolnames.filter((n) => n !==
|
|
3606
|
-
}), this.onUpdatedTools
|
|
1723
|
+
const i = this.mcpTools[e];
|
|
1724
|
+
delete this.mcpTools[e], i && Object.keys(i).forEach((o) => {
|
|
1725
|
+
this.ignoreToolnames = this.ignoreToolnames.filter((n) => n !== o);
|
|
1726
|
+
}), (s = this.onUpdatedTools) == null || s.call(this);
|
|
3607
1727
|
}
|
|
3608
1728
|
/** 创建临时允许调用的tools集合 */
|
|
3609
1729
|
_tempMergeTools(e = {}) {
|
|
3610
|
-
const t = Object.values(this.mcpTools).reduce((
|
|
3611
|
-
return Object.assign(t, e), this.ignoreToolnames.forEach((
|
|
3612
|
-
delete t[
|
|
1730
|
+
const t = Object.values(this.mcpTools).reduce((i, s) => ({ ...i, ...s }), {});
|
|
1731
|
+
return Object.assign(t, e), this.ignoreToolnames.forEach((i) => {
|
|
1732
|
+
delete t[i];
|
|
3613
1733
|
}), t;
|
|
3614
1734
|
}
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
const i = t0(e);
|
|
3618
|
-
return s ? `${s}${i}` : `你是一个智能助手,可以通过调用工具来完成任务。
|
|
3619
|
-
${i}`;
|
|
3620
|
-
}
|
|
3621
|
-
/** 执行 ReAct 模式下的工具调用 */
|
|
3622
|
-
async _executeReActToolCall(e, t, s) {
|
|
3623
|
-
const i = s[e];
|
|
3624
|
-
if (!i)
|
|
3625
|
-
return { success: !1, error: `工具 ${e} 不存在` };
|
|
3626
|
-
try {
|
|
3627
|
-
const n = i, a = n.execute || n.call;
|
|
3628
|
-
return typeof a != "function" ? { success: !1, error: `工具 ${e} 没有可执行的函数` } : { success: !0, result: await a(t, {}) };
|
|
3629
|
-
} catch (n) {
|
|
3630
|
-
return { success: !1, error: n?.message || String(n) || "工具执行失败" };
|
|
3631
|
-
}
|
|
3632
|
-
}
|
|
3633
|
-
/** ReAct 模式的对话实现 */
|
|
3634
|
-
async _chatReAct(e, { model: t, maxSteps: s = 5, ...i }) {
|
|
3635
|
-
if (!this.llm)
|
|
3636
|
-
throw new Error("LLM is not initialized");
|
|
3637
|
-
await this.initClientsAndTools();
|
|
3638
|
-
const n = this._tempMergeTools(i.tools);
|
|
3639
|
-
if (Object.keys(n).length === 0)
|
|
3640
|
-
return this._chat(e, { model: t, maxSteps: s, ...i });
|
|
3641
|
-
let l = [];
|
|
3642
|
-
i.message && !i.messages ? l.push({ role: "user", content: i.message }) : i.messages ? l = [...i.messages] : l = [...this.messages];
|
|
3643
|
-
const h = typeof t == "string" ? t : t?.modelId || "default-model", d = { role: "system", content: this._generateReActSystemPrompt(n, h, i.system) }, g = l[0]?.role === "system" ? l : [d, ...l];
|
|
3644
|
-
return e === X ? this._chatReActStream(g, n, h, s, i) : this._chatReActNonStream(g, n, h, s, i);
|
|
3645
|
-
}
|
|
3646
|
-
/**
|
|
3647
|
-
* 检查消息内容是否包含图片
|
|
3648
|
-
* @param content 消息内容
|
|
3649
|
-
* @returns 是否包含图片
|
|
3650
|
-
*/
|
|
3651
|
-
_messageHasImage(e) {
|
|
3652
|
-
return e && Array.isArray(e) ? e.some((t) => t && t.type === "image") : !1;
|
|
3653
|
-
}
|
|
3654
|
-
/**
|
|
3655
|
-
* 从消息中移除图片,但保留文本内容
|
|
3656
|
-
* @param message 原始消息
|
|
3657
|
-
* @returns 移除图片后的消息(如果只有图片没有文本,返回 null)
|
|
3658
|
-
*/
|
|
3659
|
-
_removeImageFromMessage(e) {
|
|
3660
|
-
if (!e || !e.content)
|
|
3661
|
-
return null;
|
|
3662
|
-
if (!Array.isArray(e.content))
|
|
3663
|
-
return e;
|
|
3664
|
-
const t = e.content.filter((s) => s && s.type !== "image");
|
|
3665
|
-
return t.length === 0 ? null : {
|
|
3666
|
-
...e,
|
|
3667
|
-
content: t
|
|
3668
|
-
};
|
|
3669
|
-
}
|
|
3670
|
-
/**
|
|
3671
|
-
* 构建用于模型调用的消息列表(magentic-ui 风格)
|
|
3672
|
-
* 策略:保留所有文本消息,仅限制图片数量(类似 magentic-ui 的 maybe_remove_old_screenshots)
|
|
3673
|
-
*
|
|
3674
|
-
* @param systemMessage 系统提示词
|
|
3675
|
-
* @param allMessages 所有消息历史(包括初始消息和后续对话)
|
|
3676
|
-
* @param maxImages 最多保留的图片数量(默认3张)
|
|
3677
|
-
* @returns 构建好的消息列表
|
|
3678
|
-
*/
|
|
3679
|
-
_buildMessagesForModel(e, t, s = 3) {
|
|
3680
|
-
const i = [];
|
|
3681
|
-
e && i.push(e);
|
|
3682
|
-
let n = 0;
|
|
3683
|
-
const a = [];
|
|
3684
|
-
for (let l = t.length - 1; l >= 0; l--) {
|
|
3685
|
-
const h = t[l];
|
|
3686
|
-
if (this._messageHasImage(h.content))
|
|
3687
|
-
if (n < s)
|
|
3688
|
-
a.unshift(h), n++;
|
|
3689
|
-
else {
|
|
3690
|
-
const d = this._removeImageFromMessage(h);
|
|
3691
|
-
d && a.unshift(d);
|
|
3692
|
-
}
|
|
3693
|
-
else
|
|
3694
|
-
a.unshift(h);
|
|
3695
|
-
}
|
|
3696
|
-
return i.push(...a), i;
|
|
3697
|
-
}
|
|
3698
|
-
/** ReAct 模式非流式对话 */
|
|
3699
|
-
async _chatReActNonStream(e, t, s, i, n) {
|
|
3700
|
-
let a = [...e];
|
|
3701
|
-
const l = e[0]?.role === "system" ? e[0] : null, h = l ? e.slice(1) : e;
|
|
3702
|
-
let c = 0;
|
|
3703
|
-
const d = n.maxImages ?? 3;
|
|
3704
|
-
for (; c < i; ) {
|
|
3705
|
-
c++;
|
|
3706
|
-
const p = this._buildMessagesForModel(l, h, d), { tools: C, ...f } = n, m = (await f2({
|
|
3707
|
-
// @ts-ignore ProviderV2 是所有llm的父类,在每一个具体的llm类都有一个选择model的函数用法
|
|
3708
|
-
model: this.llm(s),
|
|
3709
|
-
messages: p,
|
|
3710
|
-
...f
|
|
3711
|
-
})).text, w = { role: "assistant", content: m };
|
|
3712
|
-
h.push(w), a.push(w);
|
|
3713
|
-
const v = M2(m, t);
|
|
3714
|
-
if (!v)
|
|
3715
|
-
return this.messages = a, {
|
|
3716
|
-
text: m,
|
|
3717
|
-
response: { messages: a }
|
|
3718
|
-
};
|
|
3719
|
-
const _ = await this._executeReActToolCall(v.toolName, v.arguments, t), b = {
|
|
3720
|
-
role: "user",
|
|
3721
|
-
content: `<tool_response>
|
|
3722
|
-
${_.success ? JSON.stringify(_.result) : `工具执行失败 - ${_.error}`}
|
|
3723
|
-
</tool_response>`
|
|
3724
|
-
};
|
|
3725
|
-
h.push(b), a.push(b);
|
|
3726
|
-
}
|
|
3727
|
-
return this.messages = a, {
|
|
3728
|
-
text: a[a.length - 2]?.content || "",
|
|
3729
|
-
response: { messages: a }
|
|
3730
|
-
};
|
|
3731
|
-
}
|
|
3732
|
-
/** ReAct 模式流式对话 */
|
|
3733
|
-
_chatReActStream(e, t, s, i, n) {
|
|
3734
|
-
const a = this, l = this.llm(s);
|
|
3735
|
-
let h, c;
|
|
3736
|
-
const d = new Promise((p, C) => {
|
|
3737
|
-
h = p, c = C;
|
|
3738
|
-
});
|
|
3739
|
-
return {
|
|
3740
|
-
fullStream: new ReadableStream({
|
|
3741
|
-
async start(p) {
|
|
3742
|
-
let C = [...e];
|
|
3743
|
-
const f = e[0]?.role === "system" ? e[0] : null, u = f ? e.slice(1) : [...e];
|
|
3744
|
-
let m = 0, w = "";
|
|
3745
|
-
const v = n.maxImages ?? 3;
|
|
3746
|
-
try {
|
|
3747
|
-
for (; m < i; ) {
|
|
3748
|
-
m++;
|
|
3749
|
-
const _ = a._buildMessagesForModel(f, u, v), { tools: S, ...L } = n;
|
|
3750
|
-
delete L.system;
|
|
3751
|
-
const b = await X({
|
|
3752
|
-
...L,
|
|
3753
|
-
model: l,
|
|
3754
|
-
messages: _
|
|
3755
|
-
});
|
|
3756
|
-
let E = "";
|
|
3757
|
-
for await (const I of b.fullStream)
|
|
3758
|
-
I.type === "text-delta" ? (E += I.text || "", p.enqueue({
|
|
3759
|
-
type: "text-delta",
|
|
3760
|
-
text: I.text
|
|
3761
|
-
})) : I.type === "text-start" ? p.enqueue({ type: "text-start" }) : I.type === "text-end" || p.enqueue(I);
|
|
3762
|
-
w += E;
|
|
3763
|
-
const U = { role: "assistant", content: w };
|
|
3764
|
-
u.push(U), C.push(U);
|
|
3765
|
-
const R = M2(w, t);
|
|
3766
|
-
if (!R) {
|
|
3767
|
-
p.enqueue({ type: "text-end" }), p.close(), a.messages = C, h({ messages: C });
|
|
3768
|
-
return;
|
|
3769
|
-
}
|
|
3770
|
-
if (R.toolName === "computer" && R.arguments?.action === "terminate") {
|
|
3771
|
-
p.enqueue({ type: "text-end" }), p.close(), a.messages = C, h({ messages: C });
|
|
3772
|
-
return;
|
|
3773
|
-
}
|
|
3774
|
-
const P = `react-${Date.now()}`;
|
|
3775
|
-
p.enqueue({
|
|
3776
|
-
type: "tool-input-start",
|
|
3777
|
-
id: P,
|
|
3778
|
-
toolName: R.toolName
|
|
3779
|
-
});
|
|
3780
|
-
const Q = JSON.stringify(R.arguments, null, 2);
|
|
3781
|
-
p.enqueue({
|
|
3782
|
-
type: "tool-input-delta",
|
|
3783
|
-
id: P,
|
|
3784
|
-
delta: Q
|
|
3785
|
-
});
|
|
3786
|
-
const T = await a._executeReActToolCall(R.toolName, R.arguments, t);
|
|
3787
|
-
let H, k = T.result;
|
|
3788
|
-
if (T.success && T.result && typeof T.result == "object" && T.result.screenshot) {
|
|
3789
|
-
H = T.result.screenshot;
|
|
3790
|
-
const { screenshot: I, ...G2 } = T.result;
|
|
3791
|
-
k = G2;
|
|
3792
|
-
}
|
|
3793
|
-
let N = "";
|
|
3794
|
-
T.success ? k && Array.isArray(k.content) && k.content.length > 0 && k.content[0].text ? N = k.content[0].text : N = JSON.stringify(k) : N = `工具执行失败 - ${T.error}`;
|
|
3795
|
-
let z = `<tool_response>
|
|
3796
|
-
${N}
|
|
3797
|
-
</tool_response>`;
|
|
3798
|
-
H && (z += `
|
|
3799
|
-
请检查截图以确认操作是否成功。如果成功,请继续下一步;如果失败,请重试。`), p.enqueue({
|
|
3800
|
-
type: "tool-result",
|
|
3801
|
-
toolCallId: P,
|
|
3802
|
-
result: z
|
|
3803
|
-
});
|
|
3804
|
-
const u2 = H ? {
|
|
3805
|
-
role: "user",
|
|
3806
|
-
content: [
|
|
3807
|
-
{ type: "text", text: z },
|
|
3808
|
-
{ type: "image", image: H }
|
|
3809
|
-
]
|
|
3810
|
-
} : {
|
|
3811
|
-
role: "user",
|
|
3812
|
-
content: z
|
|
3813
|
-
};
|
|
3814
|
-
u.push(u2), C.push(u2), w = "";
|
|
3815
|
-
}
|
|
3816
|
-
p.enqueue({ type: "text-end" }), p.close(), a.messages = C, h({ messages: C });
|
|
3817
|
-
} catch (_) {
|
|
3818
|
-
p.error(_), c(_);
|
|
3819
|
-
}
|
|
3820
|
-
}
|
|
3821
|
-
}),
|
|
3822
|
-
response: d
|
|
3823
|
-
};
|
|
3824
|
-
}
|
|
3825
|
-
async _chat(e, { model: t, maxSteps: s = 5, ...i }) {
|
|
3826
|
-
if (this.useReActMode)
|
|
3827
|
-
return this._chatReAct(e, { model: t, maxSteps: s, ...i });
|
|
1735
|
+
async _chat(e, { model: t, maxSteps: i = 5, ...s }) {
|
|
1736
|
+
var a;
|
|
3828
1737
|
if (!this.llm)
|
|
3829
1738
|
throw new Error("LLM is not initialized");
|
|
3830
1739
|
await this.initClientsAndTools();
|
|
3831
|
-
const
|
|
1740
|
+
const o = {
|
|
3832
1741
|
// @ts-ignore ProviderV2 是所有llm的父类, 在每一个具体的llm 类都有一个选择model的函数用法
|
|
3833
1742
|
model: this.llm(t),
|
|
3834
|
-
stopWhen:
|
|
3835
|
-
...
|
|
3836
|
-
tools: this._tempMergeTools(
|
|
1743
|
+
stopWhen: s2(i),
|
|
1744
|
+
...s,
|
|
1745
|
+
tools: this._tempMergeTools(s.tools)
|
|
3837
1746
|
};
|
|
3838
|
-
|
|
3839
|
-
const
|
|
3840
|
-
return a
|
|
3841
|
-
this.messages.push(...
|
|
3842
|
-
}),
|
|
1747
|
+
s.message && !s.messages && (this.messages.push({ role: "user", content: s.message }), o.messages = [...this.messages]);
|
|
1748
|
+
const n = e(o);
|
|
1749
|
+
return (a = n == null ? void 0 : n.response) == null || a.then((c) => {
|
|
1750
|
+
this.messages.push(...c.messages);
|
|
1751
|
+
}), n;
|
|
3843
1752
|
}
|
|
3844
1753
|
async chat(e) {
|
|
3845
|
-
return this._chat(
|
|
1754
|
+
return this._chat(o2, e);
|
|
3846
1755
|
}
|
|
3847
1756
|
async chatStream(e) {
|
|
3848
|
-
return this._chat(
|
|
1757
|
+
return this._chat(r2, e);
|
|
3849
1758
|
}
|
|
3850
1759
|
}
|
|
3851
1760
|
export {
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
1761
|
+
K2 as AgentModelProvider,
|
|
1762
|
+
G2 as Ajv,
|
|
1763
|
+
s0 as AuthClientProvider,
|
|
1764
|
+
V2 as ContentScriptServerTransport,
|
|
1765
|
+
h2 as ExtensionClientTransport,
|
|
1766
|
+
Y2 as ExtensionPageServerTransport,
|
|
1767
|
+
C0 as InMemoryTransport,
|
|
1768
|
+
d2 as QrCode,
|
|
1769
|
+
r0 as ResourceTemplate,
|
|
1770
|
+
a0 as UriTemplate,
|
|
1771
|
+
c2 as WebMcpClient,
|
|
1772
|
+
z2 as WebMcpServer,
|
|
1773
|
+
l0 as completable,
|
|
1774
|
+
B2 as createMessageChannelClientTransport,
|
|
1775
|
+
$2 as createMessageChannelPairTransport,
|
|
1776
|
+
H2 as createMessageChannelServerTransport,
|
|
1777
|
+
Q2 as createRemoter,
|
|
1778
|
+
O2 as createSSEClientTransport,
|
|
1779
|
+
j2 as createStreamableHTTPClientTransport,
|
|
1780
|
+
v2 as getAISDKTools,
|
|
1781
|
+
d0 as getDisplayName,
|
|
1782
|
+
W2 as isMcpClient,
|
|
1783
|
+
F2 as isMcpServer,
|
|
1784
|
+
A2 as isMessageChannelClientTransport,
|
|
1785
|
+
N2 as isMessageChannelServerTransport,
|
|
1786
|
+
D2 as isSSEClientTransport,
|
|
1787
|
+
l2 as isStreamableHTTPClientTransport,
|
|
1788
|
+
t0 as z
|
|
3880
1789
|
};
|