@opentiny/next-sdk 0.2.2 → 0.2.4

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/dist/index.js CHANGED
@@ -1,51 +1,53 @@
1
- import { default as O0 } from "ajv";
2
- import { z as q0 } from "zod";
3
- import { MessageChannelServerTransport as i2, createTransportPair as Y2, MessageChannelClientTransport as n2, sseOptions as K2, streamOptions as Q2, createSseProxy as X2, createSocketProxy as ee, createStreamProxy as te, MessageChannelTransport as re } from "@opentiny/next";
4
- import { AuthClientProvider as H0 } from "@opentiny/next";
5
- import { McpServer as E2 } from "@modelcontextprotocol/sdk/server/mcp.js";
6
- import { ResourceTemplate as z0 } from "@modelcontextprotocol/sdk/server/mcp.js";
7
- import { UriTemplate as D0 } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
8
- import { completable as B0 } from "@modelcontextprotocol/sdk/server/completable.js";
9
- import { getDisplayName as J0 } from "@modelcontextprotocol/sdk/shared/metadataUtils.js";
10
- import { InMemoryTransport as se } from "@modelcontextprotocol/sdk/inMemory.js";
11
- import { InMemoryTransport as G0 } from "@modelcontextprotocol/sdk/inMemory.js";
12
- import { SetLevelRequestSchema as m2, SubscribeRequestSchema as oe, UnsubscribeRequestSchema as ie, ListResourcesRequestSchema as ne, RootsListChangedNotificationSchema as ae, CallToolResultSchema as ce, ElicitRequestSchema as le, CreateMessageRequestSchema as he, ListRootsRequestSchema as de, ToolListChangedNotificationSchema as pe, PromptListChangedNotificationSchema as ue, ResourceListChangedNotificationSchema as me, ResourceUpdatedNotificationSchema as ge, LoggingMessageNotificationSchema as fe, JSONRPCMessageSchema as a2 } from "@modelcontextprotocol/sdk/types.js";
13
- import { Client as P2 } from "@modelcontextprotocol/sdk/client/index.js";
14
- import { SSEClientTransport as c2 } from "@modelcontextprotocol/sdk/client/sse.js";
15
- import { StreamableHTTPClientTransport as G } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
16
- import { WebSocketClientTransport as Ce } from "@modelcontextprotocol/sdk/client/websocket.js";
17
- import g2 from "qrcode";
18
- import { dynamicTool as we, jsonSchema as ye, generateText as f2, streamText as X, stepCountIs as ve } from "ai";
19
- import { InvalidArgumentError as _e, AISDKError as Z } from "@ai-sdk/provider";
1
+ import { default as ms } from "ajv";
2
+ import { z as ae } from "zod";
3
+ import { z as gs } from "zod";
4
+ import { MessageChannelServerTransport as we, createTransportPair as xt, MessageChannelClientTransport as ve, sseOptions as Lt, streamOptions as St, createSseProxy as Pt, createSocketProxy as kt, createStreamProxy as Tt, MessageChannelTransport as Mt } from "@opentiny/next";
5
+ import { AuthClientProvider as Cs } from "@opentiny/next";
6
+ import { McpServer as Ge } from "@modelcontextprotocol/sdk/server/mcp.js";
7
+ import { ResourceTemplate as vs } from "@modelcontextprotocol/sdk/server/mcp.js";
8
+ import { UriTemplate as bs } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
9
+ import { completable as Ls } from "@modelcontextprotocol/sdk/server/completable.js";
10
+ import { getDisplayName as Ps } from "@modelcontextprotocol/sdk/shared/metadataUtils.js";
11
+ import { InMemoryTransport as Rt } from "@modelcontextprotocol/sdk/inMemory.js";
12
+ import { InMemoryTransport as Ts } from "@modelcontextprotocol/sdk/inMemory.js";
13
+ import { SetLevelRequestSchema as Te, SubscribeRequestSchema as Et, UnsubscribeRequestSchema as It, ListResourcesRequestSchema as At, RootsListChangedNotificationSchema as Ot, CallToolResultSchema as $t, ElicitRequestSchema as Ut, CreateMessageRequestSchema as jt, ListRootsRequestSchema as Zt, ToolListChangedNotificationSchema as Nt, PromptListChangedNotificationSchema as qt, ResourceListChangedNotificationSchema as zt, ResourceUpdatedNotificationSchema as Dt, LoggingMessageNotificationSchema as Ht, JSONRPCMessageSchema as _e } from "@modelcontextprotocol/sdk/types.js";
14
+ import { Client as Ye } from "@modelcontextprotocol/sdk/client/index.js";
15
+ import { SSEClientTransport as be } from "@modelcontextprotocol/sdk/client/sse.js";
16
+ import { StreamableHTTPClientTransport as ne } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
17
+ import { WebSocketClientTransport as Ft } from "@modelcontextprotocol/sdk/client/websocket.js";
18
+ import Me from "qrcode";
19
+ import { dynamicTool as Bt, jsonSchema as Vt, generateText as Re, streamText as ce, stepCountIs as Jt, tool as Wt } from "ai";
20
+ import { TypeValidationError as pe, JSONParseError as Ee, InvalidArgumentError as Kt, AISDKError as Y } from "@ai-sdk/provider";
21
+ import * as Ie from "zod/v4";
20
22
  import { z as o } from "zod/v4";
21
- import "zod/v3";
22
- import { createOpenAI as be } from "@ai-sdk/openai";
23
- import { createDeepSeek as xe } from "@ai-sdk/deepseek";
24
- class w0 {
23
+ import { ZodFirstPartyTypeKind as f } from "zod/v3";
24
+ import { createOpenAI as Gt } from "@ai-sdk/openai";
25
+ import { createDeepSeek as Yt } from "@ai-sdk/deepseek";
26
+ class Jr {
25
27
  constructor(e, t) {
26
28
  const s = {
27
29
  name: "web-mcp-server",
28
30
  version: "1.0.0"
29
- }, i = {
31
+ }, n = {
30
32
  prompts: { listChanged: !0 },
31
33
  resources: { subscribe: !0, listChanged: !0 },
32
34
  tools: { listChanged: !0 },
33
35
  completions: {},
34
36
  logging: {}
35
37
  };
36
- this.server = new E2(e || s, t || { capabilities: i }), this.server.server.oninitialized = () => {
38
+ this.server = new Ge(e || s, t || { capabilities: n }), this.server.server.oninitialized = () => {
37
39
  this.oninitialized?.();
38
40
  }, this.server.server.onclose = () => {
39
41
  this.onclose?.();
40
- }, this.server.server.onerror = (n) => {
41
- this.onerror?.(n);
42
- }, this.server.server.setRequestHandler(m2, async () => ({}));
42
+ }, this.server.server.onerror = (i) => {
43
+ this.onerror?.(i);
44
+ }, this.server.server.setRequestHandler(Te, async () => ({}));
43
45
  }
44
46
  /**
45
47
  * Connects the server to a transport via the specified option.
46
48
  */
47
49
  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 i2(e), await this.transport.listen()), await this.server.connect(this.transport), this.transport;
50
+ 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 we(e), await this.transport.listen()), await this.server.connect(this.transport), this.transport;
49
51
  }
50
52
  /**
51
53
  * Closes the connection.
@@ -65,8 +67,8 @@ class w0 {
65
67
  registerPrompt(e, t, s) {
66
68
  return this.server.registerPrompt(e, t, s);
67
69
  }
68
- registerResource(e, t, s, i) {
69
- return typeof t == "string" ? this.server.registerResource(e, t, s, i) : this.server.registerResource(e, t, s, i);
70
+ registerResource(e, t, s, n) {
71
+ return typeof t == "string" ? this.server.registerResource(e, t, s, n) : this.server.registerResource(e, t, s, n);
70
72
  }
71
73
  /**
72
74
  * Checks if the server is connected to a transport.
@@ -187,31 +189,31 @@ class w0 {
187
189
  * Registers a handler for the subscribe request.
188
190
  */
189
191
  onSubscribe(e) {
190
- this.server.server.setRequestHandler(oe, e);
192
+ this.server.server.setRequestHandler(Et, e);
191
193
  }
192
194
  /**
193
195
  * Registers a handler for the unsubscribe request.
194
196
  */
195
197
  onUnsubscribe(e) {
196
- this.server.server.setRequestHandler(ie, e);
198
+ this.server.server.setRequestHandler(It, e);
197
199
  }
198
200
  /**
199
201
  * Registers a handler for the set log level request.
200
202
  */
201
203
  onSetLogLevel(e) {
202
- this.server.server.setRequestHandler(m2, e);
204
+ this.server.server.setRequestHandler(Te, e);
203
205
  }
204
206
  /**
205
207
  * Registers a handler for the list tools request.
206
208
  */
207
209
  onListResources(e) {
208
- this.server.server.setRequestHandler(ne, e);
210
+ this.server.server.setRequestHandler(At, e);
209
211
  }
210
212
  /**
211
213
  * Registers a handler for the roots list changed notification.
212
214
  */
213
215
  onRootsListChanged(e) {
214
- this.server.server.setNotificationHandler(ae, e);
216
+ this.server.server.setNotificationHandler(Ot, e);
215
217
  }
216
218
  /**
217
219
  * Close the transport for window.addEventListener('pagehide')
@@ -220,21 +222,21 @@ class w0 {
220
222
  e.persisted || this.transport && typeof this.transport.close == "function" && await this.transport.close();
221
223
  }
222
224
  }
223
- const y0 = (r, e) => new i2(r, e), v0 = () => Y2(), _0 = (r) => r instanceof i2, b0 = (r) => r instanceof E2;
224
- class Le {
225
+ const Wr = (r, e) => new we(r, e), Kr = () => xt(), Gr = (r) => r instanceof we, Yr = (r) => r instanceof Ge;
226
+ class Qt {
225
227
  constructor(e, t) {
226
228
  const s = {
227
229
  name: "web-mcp-client",
228
230
  version: "1.0.0"
229
- }, i = {
231
+ }, n = {
230
232
  roots: { listChanged: !0 },
231
233
  sampling: {},
232
234
  elicitation: {}
233
235
  };
234
- this.client = new P2(e || s, t || { capabilities: i }), this.client.onclose = () => {
236
+ this.client = new Ye(e || s, t || { capabilities: n }), this.client.onclose = () => {
235
237
  this.onclose?.();
236
- }, this.client.onerror = (n) => {
237
- this.onerror?.(n);
238
+ }, this.client.onerror = (i) => {
239
+ this.onerror?.(i);
238
240
  };
239
241
  }
240
242
  /**
@@ -243,26 +245,26 @@ 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: s, sessionId: i, type: n, agent: a, onError: l } = e;
248
+ const { url: t, token: s, sessionId: n, type: i, agent: a, onError: l } = e;
247
249
  if (a === !0) {
248
- const d = { client: this.client, url: t, token: s, sessionId: i };
250
+ const d = { client: this.client, url: t, token: s, sessionId: n };
249
251
  let g;
250
252
  return await (async () => {
251
- const { transport: C, sessionId: f } = n === "sse" ? await X2(d) : n === "socket" ? await ee(d) : await te(d);
252
- C.onerror = async (u) => {
253
- l?.(u);
254
- }, g = { transport: C, sessionId: f };
253
+ const { transport: m, sessionId: C } = i === "sse" ? await Pt(d) : i === "socket" ? await kt(d) : await Tt(d);
254
+ m.onerror = async (p) => {
255
+ l?.(p);
256
+ }, g = { transport: m, sessionId: C };
255
257
  })(), g;
256
258
  }
257
- const h = new URL(t);
259
+ const u = new URL(t);
258
260
  let c;
259
- if (n === "channel" && (c = new n2(t), await this.client.connect(c)), n === "sse") {
260
- const d = K2(s, i);
261
- c = new c2(h, d), await this.client.connect(c);
261
+ if (i === "channel" && (c = new ve(t), await this.client.connect(c)), i === "sse") {
262
+ const d = Lt(s, n);
263
+ c = new be(u, d), await this.client.connect(c);
262
264
  }
263
- if (n === "socket" && (c = new Ce(new URL(`${t}?sessionId=${i}&token=${s}`)), c.sessionId = i, await this.client.connect(c)), typeof c > "u") {
264
- const d = Q2(s, i);
265
- c = new G(h, d), await this.client.connect(c);
265
+ if (i === "socket" && (c = new Ft(new URL(`${t}?sessionId=${n}&token=${s}`)), c.sessionId = n, await this.client.connect(c)), typeof c > "u") {
266
+ const d = St(s, n);
267
+ c = new ne(u, d), await this.client.connect(c);
266
268
  }
267
269
  return this.transport = c, { transport: this.transport, sessionId: this.transport.sessionId };
268
270
  }
@@ -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, ce, t);
359
+ return await this.client.callTool(e, $t, t);
358
360
  }
359
361
  /**
360
362
  * Lists all tools available on the server.
@@ -414,90 +416,90 @@ class Le {
414
416
  * Registers a handler for the elicitation request.
415
417
  */
416
418
  onElicit(e) {
417
- this.client.setRequestHandler(le, e);
419
+ this.client.setRequestHandler(Ut, 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(he, e);
425
+ this.client.setRequestHandler(jt, 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(de, e);
431
+ this.client.setRequestHandler(Zt, 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(pe, e);
437
+ this.client.setNotificationHandler(Nt, 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(ue, e);
443
+ this.client.setNotificationHandler(qt, 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(me, e);
449
+ this.client.setNotificationHandler(zt, 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(ge, e);
455
+ this.client.setNotificationHandler(Dt, 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(fe, e);
461
+ this.client.setNotificationHandler(Ht, e);
460
462
  }
461
463
  /**
462
464
  * Close the transport for window.addEventListener('pagehide')
463
465
  */
464
466
  async onPagehide(e) {
465
- e.persisted || (Se(this.transport) ? await this.transport.terminateSession() : this.transport && typeof this.transport.close == "function" && await this.transport.close());
467
+ e.persisted || (Xt(this.transport) ? await this.transport.terminateSession() : this.transport && typeof this.transport.close == "function" && await this.transport.close());
466
468
  }
467
469
  }
468
- const x0 = (r, e) => new c2(r, e), L0 = (r, e) => new G(r, e), S0 = (r, e) => new n2(r, e), R0 = (r) => r instanceof c2, Se = (r) => r instanceof G, T0 = (r) => r instanceof n2, M0 = (r) => r instanceof P2, A = (r, e, t) => {
470
+ const Qr = (r, e) => new be(r, e), Xr = (r, e) => new ne(r, e), es = (r, e) => new ve(r, e), ts = (r) => r instanceof be, Xt = (r) => r instanceof ne, rs = (r) => r instanceof ve, ss = (r) => r instanceof Ye, z = (r, e, t) => {
469
471
  window.postMessage({ type: r, direction: t, data: e }, "*");
470
- }, C2 = (r, e, t) => {
471
- const s = async function(i) {
472
- i.source === window && i.data.type === r && i.data.direction === t && await e(i.data.data);
472
+ }, Ae = (r, e, t) => {
473
+ const s = async function(n) {
474
+ n.source === window && n.data.type === r && n.data.direction === t && await e(n.data.data);
473
475
  };
474
476
  return window.addEventListener("message", s), () => window.removeEventListener("message", s);
475
- }, r2 = (r, e, t) => {
477
+ }, me = (r, e, t) => {
476
478
  if (t.endsWith("content"))
477
479
  chrome.tabs.query({}, (s) => {
478
- s.forEach((i) => {
479
- chrome.tabs.sendMessage(i.id, { type: r, data: e, direction: t, tabId: i.id });
480
+ s.forEach((n) => {
481
+ chrome.tabs.sendMessage(n.id, { type: r, data: e, direction: t, tabId: n.id });
480
482
  });
481
483
  });
482
484
  else
483
485
  return chrome.runtime.sendMessage({ direction: t, type: r, data: e });
484
- }, s2 = (r, e, t, s) => {
485
- const i = (n, a, l) => {
486
- if (n.type === r && n.direction === t && (!s || s && n.tabId === s)) {
487
- const { data: h } = n;
488
- e(h, a, l), l(a);
486
+ }, fe = (r, e, t, s) => {
487
+ const n = (i, a, l) => {
488
+ if (i.type === r && i.direction === t && (!s || s && i.tabId === s)) {
489
+ const { data: u } = i;
490
+ e(u, a, l), l(a);
489
491
  }
490
492
  };
491
- return chrome.runtime.onMessage.addListener(i), () => chrome.runtime.onMessage.removeListener(i);
493
+ return chrome.runtime.onMessage.addListener(n), () => chrome.runtime.onMessage.removeListener(n);
492
494
  };
493
- class Re {
495
+ class e2 {
494
496
  constructor(e) {
495
- this._isStarted = !1, this._isClosed = !1, this.targetSessionId = e, this._messageListener = s2(
497
+ this._isStarted = !1, this._isClosed = !1, this.targetSessionId = e, this._messageListener = fe(
496
498
  "mcp-server-to-client",
497
499
  (t) => {
498
500
  try {
499
501
  if (t.sessionId !== this.targetSessionId) return;
500
- const s = a2.parse(t.mcpMessage);
502
+ const s = _e.parse(t.mcpMessage);
501
503
  this.onmessage?.(s);
502
504
  } catch (s) {
503
505
  console.log("【Client Transport】处理server消息错误:", s);
@@ -522,10 +524,10 @@ class Re {
522
524
  this._throwError(() => !this._isStarted, "【Client Transport】 未启动,无法发送消息"), this._throwError(() => this._isClosed, "【Client Transport】 已关闭,无法发送消息");
523
525
  const s = chrome.sessionRegistry.get(this.targetSessionId);
524
526
  this._throwError(() => !s, `【Client Transport】sessionRegistry中未找到${this.targetSessionId}`);
525
- const i = s.tabIds[s.tabIds.length - 1];
526
- r2(
527
+ const n = s.tabIds[s.tabIds.length - 1];
528
+ me(
527
529
  "mcp-client-to-server",
528
- { sessionId: this.targetSessionId, tabId: i, mcpMessage: e },
530
+ { sessionId: this.targetSessionId, tabId: n, mcpMessage: e },
529
531
  "side->content"
530
532
  );
531
533
  }
@@ -539,13 +541,13 @@ class Re {
539
541
  }
540
542
  }
541
543
  }
542
- const k2 = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r) => {
544
+ const Qe = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r) => {
543
545
  const e = Math.random() * 16 | 0;
544
546
  return (r === "x" ? e : e & 3 | 8).toString(16);
545
547
  });
546
- class E0 {
548
+ class ns {
547
549
  constructor(e = null) {
548
- this._isStarted = !1, this._isClosed = !1, this._lastRegistration = null, this.sessionId = e || k2(), this._messageListener1 = C2(
550
+ this._isStarted = !1, this._isClosed = !1, this._lastRegistration = null, this.sessionId = e || Qe(), this._messageListener1 = Ae(
549
551
  "sidepanel-ready-to-page",
550
552
  () => {
551
553
  this._lastRegistration && this._isStarted && this.notifyRegistration(this._lastRegistration).catch((t) => {
@@ -553,13 +555,13 @@ class E0 {
553
555
  });
554
556
  },
555
557
  "content->page"
556
- ), this._messageListener2 = C2(
558
+ ), this._messageListener2 = Ae(
557
559
  "mcp-client-to-server-to-page",
558
560
  (t) => {
559
561
  if (t.sessionId !== this.sessionId) return;
560
562
  console.log("【Page Svr Transport】 即将处理 mcpMessage", t.mcpMessage);
561
- const s = a2.parse(t.mcpMessage);
562
- this.onmessage?.(s), t.mcpMessage.params?.name && A(
563
+ const s = _e.parse(t.mcpMessage);
564
+ this.onmessage?.(s), t.mcpMessage.params?.name && z(
563
565
  "update-page-app-message",
564
566
  { status: "run", message: t.mcpMessage.params?.name },
565
567
  "page->content"
@@ -584,14 +586,14 @@ class E0 {
584
586
  }
585
587
  /** 发送消息到 MCP Client */
586
588
  async send(e, t) {
587
- this._throwError(() => !this._isStarted, "【Page Svr Transport】 未启动,无法发送消息"), this._throwError(() => this._isClosed, "【Page Svr Transport】 已关闭,无法发送消息"), A(
589
+ this._throwError(() => !this._isStarted, "【Page Svr Transport】 未启动,无法发送消息"), this._throwError(() => this._isClosed, "【Page Svr Transport】 已关闭,无法发送消息"), z(
588
590
  "mcp-server-to-client-from-page",
589
591
  {
590
592
  sessionId: this.sessionId,
591
593
  mcpMessage: e
592
594
  },
593
595
  "page->content"
594
- ), "result" in e && e.result?.content && A(
596
+ ), "result" in e && e.result?.content && z(
595
597
  "update-page-app-message",
596
598
  { status: "ready", message: "" },
597
599
  "page->content"
@@ -602,7 +604,7 @@ class E0 {
602
604
  async notifyRegistration(e) {
603
605
  this._throwError(() => !this._isStarted, "【Page Svr Transport】 未启动,无法注册消息"), this._lastRegistration = e;
604
606
  try {
605
- A(
607
+ z(
606
608
  "mcp-server-register-from-page",
607
609
  {
608
610
  sessionId: this.sessionId,
@@ -628,9 +630,9 @@ class E0 {
628
630
  }
629
631
  }
630
632
  }
631
- class P0 {
633
+ class os {
632
634
  constructor(e = null, t) {
633
- this._isStarted = !1, this._isClosed = !1, this._lastRegistration = null, this.sessionId = e || k2(), this.tabId = t, s2(
635
+ this._isStarted = !1, this._isClosed = !1, this._lastRegistration = null, this.sessionId = e || Qe(), this.tabId = t, fe(
634
636
  "sidepanel-ready",
635
637
  () => {
636
638
  this._lastRegistration && this._isStarted && this.notifyRegistration(this._lastRegistration).catch((s) => {
@@ -652,14 +654,14 @@ class P0 {
652
654
  async start() {
653
655
  if (console.log("【Content Svr Transport】 启动 start", this.sessionId), !this._isStarted) {
654
656
  if (this._isClosed) throw new Error("【Content Svr Transport】 已关闭,无法重新启动");
655
- s2(
657
+ fe(
656
658
  "mcp-client-to-server",
657
659
  (e) => {
658
660
  if (!(e.sessionId !== this.sessionId || e.tabId !== this.tabId))
659
661
  try {
660
662
  console.log("【Content Svr Transport】 即将处理 mcpMessage", e.mcpMessage);
661
- const t = a2.parse(e.mcpMessage);
662
- this.onmessage?.(t), e.mcpMessage.params?.name && A(
663
+ const t = _e.parse(e.mcpMessage);
664
+ this.onmessage?.(t), e.mcpMessage.params?.name && z(
663
665
  "update-page-app-message",
664
666
  { status: "run", message: e.mcpMessage.params?.name },
665
667
  "page->content"
@@ -678,14 +680,14 @@ class P0 {
678
680
  async send(e, t) {
679
681
  this._throwError(() => !this._isStarted, "【Content Svr Transport】 未启动,无法发送消息"), this._throwError(() => this._isClosed, "【Content Svr Transport】 已关闭,无法发送消息");
680
682
  try {
681
- console.log("【Content Svr Transport】 发送消息到 MCP Client", e), r2(
683
+ console.log("【Content Svr Transport】 发送消息到 MCP Client", e), me(
682
684
  "mcp-server-to-client",
683
685
  {
684
686
  sessionId: this.sessionId,
685
687
  mcpMessage: e
686
688
  },
687
689
  "content->side"
688
- ), "result" in e && e.result?.content && A(
690
+ ), "result" in e && e.result?.content && z(
689
691
  "update-page-app-message",
690
692
  { status: "ready", message: "" },
691
693
  "page->content"
@@ -697,7 +699,7 @@ class P0 {
697
699
  }
698
700
  /** 通知 Sidepanel 此 Server 已启动并准备接受连接 */
699
701
  async notifyRegistration(e) {
700
- this._isStarted && (this._lastRegistration = e, r2(
702
+ this._isStarted && (this._lastRegistration = e, me(
701
703
  "mcp-server-register",
702
704
  {
703
705
  sessionId: this.sessionId,
@@ -719,9 +721,9 @@ class P0 {
719
721
  }
720
722
  }
721
723
  }
722
- class Te {
723
- constructor(e, { size: t = 200, margin: s = 4, color: i = "#000", bgColor: n = "#fff" }) {
724
- this.value = e, this.size = t, this.margin = s, this.color = i, this.bgColor = n;
724
+ class t2 {
725
+ constructor(e, { size: t = 200, margin: s = 4, color: n = "#000", bgColor: i = "#fff" }) {
726
+ this.value = e, this.size = t, this.margin = s, this.color = n, this.bgColor = i;
725
727
  }
726
728
  get qrCodeOption() {
727
729
  return {
@@ -737,18 +739,18 @@ class Te {
737
739
  }
738
740
  /** 生成二维码的 Data URL(base64 图片) */
739
741
  async toDataURL() {
740
- return g2.toDataURL(this.value, this.qrCodeOption);
742
+ return Me.toDataURL(this.value, this.qrCodeOption);
741
743
  }
742
744
  /** 渲染二维码到指定的 canvas 元素 */
743
745
  async toCanvas(e) {
744
- return g2.toCanvas(e, this.value, this.qrCodeOption);
746
+ return Me.toCanvas(e, this.value, this.qrCodeOption);
745
747
  }
746
748
  /** 渲染二维码到指定的 img 元素 */
747
749
  async toImage(e) {
748
750
  e.src = await this.toDataURL();
749
751
  }
750
752
  }
751
- const Me = {
753
+ const r2 = {
752
754
  content: "",
753
755
  placement: "top",
754
756
  trigger: "hover",
@@ -757,10 +759,10 @@ const Me = {
757
759
  container: document.body,
758
760
  className: "tiny-remoter-native-tooltip"
759
761
  };
760
- class Ee {
762
+ class s2 {
761
763
  constructor(e, t = {}) {
762
764
  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 = { ...Me, ...t }, this.bindEvents();
765
+ this.opts = { ...r2, ...t }, this.bindEvents();
764
766
  }
765
767
  /* 公开 API */
766
768
  open() {
@@ -806,9 +808,9 @@ class Ee {
806
808
  this.applyStyle(this.calcStyle("top"));
807
809
  }
808
810
  calcStyle(e) {
809
- const t = this.el.getBoundingClientRect(), s = this.tip.getBoundingClientRect(), i = window.pageYOffset || document.documentElement.scrollTop, n = window.pageXOffset || document.documentElement.scrollLeft, a = 6, [l, h = "center"] = e.split("-");
811
+ const t = this.el.getBoundingClientRect(), s = this.tip.getBoundingClientRect(), n = window.pageYOffset || document.documentElement.scrollTop, i = window.pageXOffset || document.documentElement.scrollLeft, a = 6, [l, u = "center"] = e.split("-");
810
812
  let c = 0, d = 0;
811
- return l === "top" ? c = t.top + i - s.height - a : l === "bottom" ? c = t.bottom + i + a : l === "left" ? d = t.left + n - s.width - a : l === "right" && (d = t.right + n + a), (l === "top" || l === "bottom") && (h === "start" ? d = t.left + n : h === "end" ? d = t.right + n - s.width : d = (t.left + t.right) / 2 + n - s.width / 2), (l === "left" || l === "right") && (h === "start" ? c = t.top + i : h === "end" ? c = t.bottom + i - s.height : c = (t.top + t.bottom) / 2 + i - s.height / 2), { top: Math.round(c), left: Math.round(d) };
813
+ return l === "top" ? c = t.top + n - s.height - a : l === "bottom" ? c = t.bottom + n + a : l === "left" ? d = t.left + i - s.width - a : l === "right" && (d = t.right + i + a), (l === "top" || l === "bottom") && (u === "start" ? d = t.left + i : u === "end" ? d = t.right + i - s.width : d = (t.left + t.right) / 2 + i - s.width / 2), (l === "left" || l === "right") && (u === "start" ? c = t.top + n : u === "end" ? c = t.bottom + n - s.height : c = (t.top + t.bottom) / 2 + n - s.height / 2), { top: Math.round(c), left: Math.round(d) };
812
814
  }
813
815
  applyStyle({ top: e, left: t }) {
814
816
  Object.assign(this.tip.style, {
@@ -818,8 +820,8 @@ class Ee {
818
820
  });
819
821
  }
820
822
  checkViewport({ top: e, left: t }) {
821
- const i = window.innerWidth, n = window.innerHeight, a = this.tip.getBoundingClientRect();
822
- return t >= 5 && e >= 5 && t + a.width <= i - 5 && e + a.height <= n - 5;
823
+ const n = window.innerWidth, i = window.innerHeight, a = this.tip.getBoundingClientRect();
824
+ return t >= 5 && e >= 5 && t + a.width <= n - 5 && e + a.height <= i - 5;
823
825
  }
824
826
  placementList(e) {
825
827
  const t = {
@@ -846,11 +848,11 @@ class Ee {
846
848
  return !!this.tip?.parentNode;
847
849
  }
848
850
  }
849
- const w2 = "tiny-remoter-native-tooltip-style";
851
+ const Oe = "tiny-remoter-native-tooltip-style";
850
852
  (() => {
851
- if (document.getElementById(w2)) return;
853
+ if (document.getElementById(Oe)) return;
852
854
  const r = document.createElement("style");
853
- r.id = w2, r.textContent = `
855
+ r.id = Oe, r.textContent = `
854
856
  .tiny-remoter-native-tooltip {
855
857
  position: absolute;
856
858
  z-index: 9999;
@@ -899,20 +901,20 @@ const w2 = "tiny-remoter-native-tooltip-style";
899
901
  }
900
902
  `, document.head.appendChild(r);
901
903
  })();
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) => [
904
+ const n2 = "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", o2 = "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", i2 = "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", a2 = "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", c2 = "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", l2 = "https://chat.opentiny.design", u2 = "https://ai.opentiny.design/next-remoter", d2 = "https://ai.opentiny.design/next-remoter/svgs/logo-next-no-bg-left.svg", $e = (r) => [
903
905
  {
904
906
  action: "qr-code",
905
907
  show: !0,
906
908
  text: "扫码登录",
907
909
  desc: "使用手机遥控页面",
908
- icon: Ue
910
+ icon: a2
909
911
  },
910
912
  {
911
913
  action: "ai-chat",
912
914
  show: !0,
913
915
  text: "打开对话框",
914
916
  desc: "支持在网页端操作AI",
915
- icon: Pe
917
+ icon: n2
916
918
  },
917
919
  {
918
920
  action: "remote-url",
@@ -922,7 +924,7 @@ const Pe = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2039.9692'%20xmlns='
922
924
  active: !0,
923
925
  tip: r.remoteUrl,
924
926
  showCopyIcon: !0,
925
- icon: Ie
927
+ icon: i2
926
928
  },
927
929
  {
928
930
  action: "remote-control",
@@ -931,28 +933,26 @@ const Pe = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2039.9692'%20xmlns='
931
933
  desc: `${r.sessionId.slice(-6)}`,
932
934
  know: !0,
933
935
  showCopyIcon: !0,
934
- icon: ke
936
+ icon: o2
935
937
  }
936
938
  ];
937
- class $e {
939
+ class h2 {
938
940
  constructor(e) {
939
- if (this.isExpanded = !1, this.getImageUrl = (t) => {
941
+ if (this.isExpanded = !1, this.closingTimer = 0, this.getImageUrl = (t) => {
940
942
  if (!t) return;
941
943
  const s = new Image();
942
944
  return s.src = t, s;
943
945
  }, this.renderItem = () => {
944
- this.menuItems.filter((t) => t.show !== !1).map(
945
- (t) => {
946
- const s = document.getElementById(`tiny-remoter-icon-item-${t.action}`);
947
- if (!s) return;
948
- s.innerHTML = "";
949
- const i = this.getImageUrl(t.icon);
950
- i && s.appendChild(i);
951
- }
952
- );
946
+ this.menuItems.filter((t) => t.show !== !1).map((t) => {
947
+ const s = document.getElementById(`tiny-remoter-icon-item-${t.action}`);
948
+ if (!s) return;
949
+ s.innerHTML = "";
950
+ const n = this.getImageUrl(t.icon);
951
+ n && s.appendChild(n);
952
+ });
953
953
  }, this.readyTips = (t) => {
954
954
  const s = document.getElementById(t);
955
- s && new Ee(s, {
955
+ s && new s2(s, {
956
956
  content: "复制",
957
957
  placement: "top",
958
958
  trigger: "hover"
@@ -961,9 +961,10 @@ class $e {
961
961
  throw new Error("sessionId is required");
962
962
  this.options = {
963
963
  ...e,
964
- qrCodeUrl: e.qrCodeUrl || y2,
965
- remoteUrl: e.remoteUrl || Oe
966
- }, this.menuItems = this.mergeMenuItems(e.menuItems), this.init();
964
+ qrCodeUrl: e.qrCodeUrl || u2,
965
+ remoteUrl: e.remoteUrl || l2,
966
+ logoUrl: e.logoUrl || d2
967
+ }, e.menuItems && e.menuItems.length === 0 ? this.menuItems = [] : this.menuItems = this.mergeMenuItems(e.menuItems), this.init();
967
968
  }
968
969
  // 计算 sessionPrefix 属性
969
970
  get sessionPrefix() {
@@ -975,15 +976,15 @@ class $e {
975
976
  * @returns 合并后的菜单项配置
976
977
  */
977
978
  mergeMenuItems(e) {
978
- return e ? v2(this.options).map((t) => {
979
- const s = e.find((i) => i.action === t.action);
979
+ return e ? $e(this.options).map((t) => {
980
+ const s = e.find((n) => n.action === t.action);
980
981
  return s ? {
981
982
  ...t,
982
983
  ...s,
983
984
  // 确保show属性存在,默认为true
984
985
  show: s.show !== void 0 ? s.show : t.show
985
986
  } : t;
986
- }) : v2(this.options);
987
+ }) : $e(this.options);
987
988
  }
988
989
  init() {
989
990
  this.createFloatingBlock(), this.createDropdownMenu(), this.bindEvents(), this.addStyles();
@@ -992,7 +993,7 @@ class $e {
992
993
  createFloatingBlock() {
993
994
  this.floatingBlock = document.createElement("div"), this.floatingBlock.className = "tiny-remoter-floating-block", this.floatingBlock.innerHTML = `
994
995
  <div class="tiny-remoter-floating-block__icon">
995
- <img style="display: block; width: 56px;" src="${y2}/svgs/logo-next-no-bg-left.svg" alt="icon" />
996
+ <img style="display: block; width: 56px;" src="${this.options.logoUrl}" alt="icon" />
996
997
  </div>
997
998
  `, document.body.appendChild(this.floatingBlock);
998
999
  }
@@ -1011,7 +1012,7 @@ class $e {
1011
1012
  <div>
1012
1013
  ${t.showCopyIcon ? `
1013
1014
  <div class="tiny-remoter-copy-icon" id="${t.action}" data-action="${t.action}">
1014
- <img src="${Ae}"/>
1015
+ <img src="${c2}"/>
1015
1016
  </div>
1016
1017
  ` : ""}
1017
1018
  </div>
@@ -1024,7 +1025,15 @@ class $e {
1024
1025
  }
1025
1026
  bindEvents() {
1026
1027
  this.floatingBlock.addEventListener("click", () => {
1027
- this.toggleDropdown();
1028
+ this.showAIChat();
1029
+ }), this.floatingBlock.addEventListener("mouseenter", () => {
1030
+ this.openDropdown(), this.closingTimer && (window.clearTimeout(this.closingTimer), this.closingTimer = 0);
1031
+ }), this.floatingBlock.addEventListener("mouseleave", () => {
1032
+ this.shouldCloseDropdown();
1033
+ }), this.dropdownMenu.addEventListener("mouseenter", (e) => {
1034
+ this.closingTimer && (window.clearTimeout(this.closingTimer), this.closingTimer = 0);
1035
+ }), this.dropdownMenu.addEventListener("mouseleave", (e) => {
1036
+ this.shouldCloseDropdown();
1028
1037
  }), this.dropdownMenu.addEventListener("click", (e) => {
1029
1038
  const t = e.target, s = t.closest(".tiny-remoter-copy-icon");
1030
1039
  if (s) {
@@ -1033,8 +1042,8 @@ class $e {
1033
1042
  a && this.handleAction(a);
1034
1043
  return;
1035
1044
  }
1036
- const n = t.closest(".tiny-remoter-dropdown-item")?.dataset.action;
1037
- n && this.handleAction(n);
1045
+ const i = t.closest(".tiny-remoter-dropdown-item")?.dataset.action;
1046
+ i && this.handleAction(i);
1038
1047
  }), document.addEventListener("click", (e) => {
1039
1048
  const t = e.target;
1040
1049
  !this.floatingBlock.contains(t) && !this.dropdownMenu.contains(t) && this.closeDropdown();
@@ -1042,12 +1051,15 @@ class $e {
1042
1051
  e.key === "Escape" && this.closeDropdown();
1043
1052
  });
1044
1053
  }
1045
- toggleDropdown() {
1046
- this.isExpanded ? this.closeDropdown() : this.openDropdown();
1047
- }
1048
1054
  openDropdown() {
1049
- this.isExpanded = !0, this.floatingBlock.classList.add("expanded"), this.dropdownMenu.classList.add("show");
1055
+ !this.menuItems || this.menuItems && this.menuItems.length === 0 || (this.isExpanded = !0, this.floatingBlock.classList.add("expanded"), this.dropdownMenu.classList.add("show"));
1056
+ }
1057
+ shouldCloseDropdown() {
1058
+ this.closingTimer = window.setTimeout(() => {
1059
+ this.closeDropdown();
1060
+ }, 300);
1050
1061
  }
1062
+ /** 真正的立即关闭 */
1051
1063
  closeDropdown() {
1052
1064
  this.isExpanded = !1, this.floatingBlock.classList.remove("expanded"), this.dropdownMenu.classList.remove("show");
1053
1065
  }
@@ -1100,7 +1112,7 @@ class $e {
1100
1112
  }
1101
1113
  // 创建二维码弹窗
1102
1114
  async showQRCode() {
1103
- const t = await new Te((this.options.qrCodeUrl || "") + this.sessionPrefix + this.options.sessionId, {}).toDataURL(), s = this.createModal(
1115
+ const t = await new t2((this.options.qrCodeUrl || "") + this.sessionPrefix + this.options.sessionId, {}).toDataURL(), s = this.createModal(
1104
1116
  "扫码前往智能遥控器",
1105
1117
  `
1106
1118
  <div style="text-align: center; padding: 32px;">
@@ -1205,8 +1217,8 @@ class $e {
1205
1217
  </div>
1206
1218
  </div>
1207
1219
  `;
1208
- const i = s.querySelector(".tiny-remoter-modal-close"), n = s.querySelector(".tiny-remoter-modal-overlay");
1209
- return i.addEventListener("click", () => this.hideModal(s)), n.addEventListener("click", () => this.hideModal(s)), s;
1220
+ const n = s.querySelector(".tiny-remoter-modal-close"), i = s.querySelector(".tiny-remoter-modal-overlay");
1221
+ return n.addEventListener("click", () => this.hideModal(s)), i.addEventListener("click", () => this.hideModal(s)), s;
1210
1222
  }
1211
1223
  showModal(e) {
1212
1224
  document.body.appendChild(e), setTimeout(() => e.classList.add("show"), 10);
@@ -1560,98 +1572,98 @@ class $e {
1560
1572
  this.floatingBlock.parentNode && this.floatingBlock.parentNode.removeChild(this.floatingBlock), this.dropdownMenu.parentNode && this.dropdownMenu.parentNode.removeChild(this.dropdownMenu);
1561
1573
  }
1562
1574
  }
1563
- const k0 = (r = {}) => new $e(r);
1564
- class _2 extends Error {
1575
+ const is = (r = {}) => new h2(r);
1576
+ class Ue extends Error {
1565
1577
  constructor(e, t) {
1566
1578
  super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
1567
1579
  }
1568
1580
  }
1569
- function e2(r) {
1581
+ function le(r) {
1570
1582
  }
1571
- function qe(r) {
1583
+ function p2(r) {
1572
1584
  if (typeof r == "function")
1573
1585
  throw new TypeError(
1574
1586
  "`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"
1575
1587
  );
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();
1588
+ const { onEvent: e = le, onError: t = le, onRetry: s = le, onComment: n } = r;
1589
+ let i = "", a = !0, l, u = "", c = "";
1590
+ function d(p) {
1591
+ const w = a ? p.replace(/^\xEF\xBB\xBF/, "") : p, [y, b] = m2(`${i}${w}`);
1592
+ for (const x of y)
1593
+ g(x);
1594
+ i = b, a = !1;
1595
+ }
1596
+ function g(p) {
1597
+ if (p === "") {
1598
+ m();
1587
1599
  return;
1588
1600
  }
1589
- if (u.startsWith(":")) {
1590
- i && i(u.slice(u.startsWith(": ") ? 2 : 1));
1601
+ if (p.startsWith(":")) {
1602
+ n && n(p.slice(p.startsWith(": ") ? 2 : 1));
1591
1603
  return;
1592
1604
  }
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);
1605
+ const w = p.indexOf(":");
1606
+ if (w !== -1) {
1607
+ const y = p.slice(0, w), b = p[w + 1] === " " ? 2 : 1, x = p.slice(w + b);
1608
+ h(y, x, p);
1597
1609
  return;
1598
1610
  }
1599
- p(u, "", u);
1611
+ h(p, "", p);
1600
1612
  }
1601
- function p(u, m, w) {
1602
- switch (u) {
1613
+ function h(p, w, y) {
1614
+ switch (p) {
1603
1615
  case "event":
1604
- c = m;
1616
+ c = w;
1605
1617
  break;
1606
1618
  case "data":
1607
- h = `${h}${m}
1619
+ u = `${u}${w}
1608
1620
  `;
1609
1621
  break;
1610
1622
  case "id":
1611
- l = m.includes("\0") ? void 0 : m;
1623
+ l = w.includes("\0") ? void 0 : w;
1612
1624
  break;
1613
1625
  case "retry":
1614
- /^\d+$/.test(m) ? s(parseInt(m, 10)) : t(
1615
- new _2(`Invalid \`retry\` value: "${m}"`, {
1626
+ /^\d+$/.test(w) ? s(parseInt(w, 10)) : t(
1627
+ new Ue(`Invalid \`retry\` value: "${w}"`, {
1616
1628
  type: "invalid-retry",
1617
- value: m,
1618
- line: w
1629
+ value: w,
1630
+ line: y
1619
1631
  })
1620
1632
  );
1621
1633
  break;
1622
1634
  default:
1623
1635
  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 }
1636
+ new Ue(
1637
+ `Unknown field "${p.length > 20 ? `${p.slice(0, 20)}…` : p}"`,
1638
+ { type: "unknown-field", field: p, value: w, line: y }
1627
1639
  )
1628
1640
  );
1629
1641
  break;
1630
1642
  }
1631
1643
  }
1632
- function C() {
1633
- h.length > 0 && e({
1644
+ function m() {
1645
+ u.length > 0 && e({
1634
1646
  id: l,
1635
1647
  event: c || void 0,
1636
1648
  // If the data buffer's last character is a U+000A LINE FEED (LF) character,
1637
1649
  // 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 = "";
1650
+ data: u.endsWith(`
1651
+ `) ? u.slice(0, -1) : u
1652
+ }), l = void 0, u = "", c = "";
1641
1653
  }
1642
- function f(u = {}) {
1643
- n && u.consume && g(n), a = !0, l = void 0, h = "", c = "", n = "";
1654
+ function C(p = {}) {
1655
+ i && p.consume && g(i), a = !0, l = void 0, u = "", c = "", i = "";
1644
1656
  }
1645
- return { feed: d, reset: f };
1657
+ return { feed: d, reset: C };
1646
1658
  }
1647
- function je(r) {
1659
+ function m2(r) {
1648
1660
  const e = [];
1649
1661
  let t = "", s = 0;
1650
1662
  for (; s < r.length; ) {
1651
- const i = r.indexOf("\r", s), n = r.indexOf(`
1663
+ const n = r.indexOf("\r", s), i = r.indexOf(`
1652
1664
  `, s);
1653
1665
  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) {
1666
+ if (n !== -1 && i !== -1 ? a = Math.min(n, i) : n !== -1 ? n === r.length - 1 ? a = -1 : a = n : i !== -1 && (a = i), a === -1) {
1655
1667
  t = r.slice(s);
1656
1668
  break;
1657
1669
  } else {
@@ -1662,55 +1674,55 @@ function je(r) {
1662
1674
  }
1663
1675
  return [e, t];
1664
1676
  }
1665
- class o2 extends TransformStream {
1677
+ class ge extends TransformStream {
1666
1678
  constructor({ onError: e, onRetry: t, onComment: s } = {}) {
1667
- let i;
1679
+ let n;
1668
1680
  super({
1669
- start(n) {
1670
- i = qe({
1681
+ start(i) {
1682
+ n = p2({
1671
1683
  onEvent: (a) => {
1672
- n.enqueue(a);
1684
+ i.enqueue(a);
1673
1685
  },
1674
1686
  onError(a) {
1675
- e === "terminate" ? n.error(a) : typeof e == "function" && e(a);
1687
+ e === "terminate" ? i.error(a) : typeof e == "function" && e(a);
1676
1688
  },
1677
1689
  onRetry: t,
1678
1690
  onComment: s
1679
1691
  });
1680
1692
  },
1681
- transform(n) {
1682
- i.feed(n);
1693
+ transform(i) {
1694
+ n.feed(i);
1683
1695
  }
1684
1696
  });
1685
1697
  }
1686
1698
  }
1687
- var He = ({
1699
+ var f2 = ({
1688
1700
  prefix: r,
1689
1701
  size: e = 16,
1690
1702
  alphabet: t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
1691
1703
  separator: s = "-"
1692
1704
  } = {}) => {
1693
- const i = () => {
1694
- const n = t.length, a = new Array(e);
1705
+ const n = () => {
1706
+ const i = t.length, a = new Array(e);
1695
1707
  for (let l = 0; l < e; l++)
1696
- a[l] = t[Math.random() * n | 0];
1708
+ a[l] = t[Math.random() * i | 0];
1697
1709
  return a.join("");
1698
1710
  };
1699
1711
  if (r == null)
1700
- return i;
1712
+ return n;
1701
1713
  if (t.includes(s))
1702
- throw new _e({
1714
+ throw new Kt({
1703
1715
  argument: "separator",
1704
1716
  message: `The separator "${s}" must not be part of the alphabet "${t}".`
1705
1717
  });
1706
- return () => `${r}${s}${i()}`;
1718
+ return () => `${r}${s}${n()}`;
1707
1719
  };
1708
- He();
1709
- function I2(r = globalThis) {
1720
+ f2();
1721
+ function Xe(r = globalThis) {
1710
1722
  var e, t, s;
1711
1723
  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
1724
  }
1713
- function Ne(r) {
1725
+ function g2(r) {
1714
1726
  if (r == null)
1715
1727
  return {};
1716
1728
  const e = {};
@@ -1725,94 +1737,1156 @@ function Ne(r) {
1725
1737
  }
1726
1738
  return e;
1727
1739
  }
1728
- function U2(r, ...e) {
1729
- const t = new Headers(Ne(r)), s = t.get("user-agent") || "";
1740
+ function et(r, ...e) {
1741
+ const t = new Headers(g2(r)), s = t.get("user-agent") || "";
1730
1742
  return t.set(
1731
1743
  "user-agent",
1732
1744
  [s, ...e].filter(Boolean).join(" ")
1733
1745
  ), Object.fromEntries(t.entries());
1734
1746
  }
1735
- var ze = Symbol.for("vercel.ai.validator");
1736
- function Ze(r) {
1737
- return { ...r, type: "dynamic" };
1747
+ var y2 = /"__proto__"\s*:/, C2 = /"constructor"\s*:/;
1748
+ function je(r) {
1749
+ const e = JSON.parse(r);
1750
+ return e === null || typeof e != "object" || y2.test(r) === !1 && C2.test(r) === !1 ? e : w2(e);
1751
+ }
1752
+ function w2(r) {
1753
+ let e = [r];
1754
+ for (; e.length; ) {
1755
+ const t = e;
1756
+ e = [];
1757
+ for (const s of t) {
1758
+ if (Object.prototype.hasOwnProperty.call(s, "__proto__"))
1759
+ throw new SyntaxError("Object contains forbidden prototype property");
1760
+ if (Object.prototype.hasOwnProperty.call(s, "constructor") && Object.prototype.hasOwnProperty.call(s.constructor, "prototype"))
1761
+ throw new SyntaxError("Object contains forbidden prototype property");
1762
+ for (const n in s) {
1763
+ const i = s[n];
1764
+ i && typeof i == "object" && e.push(i);
1765
+ }
1766
+ }
1767
+ }
1768
+ return r;
1769
+ }
1770
+ function v2(r) {
1771
+ const { stackTraceLimit: e } = Error;
1772
+ try {
1773
+ Error.stackTraceLimit = 0;
1774
+ } catch {
1775
+ return je(r);
1776
+ }
1777
+ try {
1778
+ return je(r);
1779
+ } finally {
1780
+ Error.stackTraceLimit = e;
1781
+ }
1782
+ }
1783
+ function xe(r) {
1784
+ if (r.type === "object" || Array.isArray(r.type) && r.type.includes("object")) {
1785
+ r.additionalProperties = !1;
1786
+ const { properties: t } = r;
1787
+ if (t != null)
1788
+ for (const s of Object.keys(t))
1789
+ t[s] = N(t[s]);
1790
+ }
1791
+ r.items != null && (r.items = Array.isArray(r.items) ? r.items.map(N) : N(r.items)), r.anyOf != null && (r.anyOf = r.anyOf.map(N)), r.allOf != null && (r.allOf = r.allOf.map(N)), r.oneOf != null && (r.oneOf = r.oneOf.map(N));
1792
+ const { definitions: e } = r;
1793
+ if (e != null)
1794
+ for (const t of Object.keys(e))
1795
+ e[t] = N(e[t]);
1796
+ return r;
1797
+ }
1798
+ function N(r) {
1799
+ return typeof r == "boolean" ? r : xe(r);
1800
+ }
1801
+ var _2 = Symbol(
1802
+ "Let zodToJsonSchema decide on which parser to use"
1803
+ ), Ze = {
1804
+ name: void 0,
1805
+ $refStrategy: "root",
1806
+ basePath: ["#"],
1807
+ effectStrategy: "input",
1808
+ pipeStrategy: "all",
1809
+ dateStrategy: "format:date-time",
1810
+ mapStrategy: "entries",
1811
+ removeAdditionalStrategy: "passthrough",
1812
+ allowedAdditionalProperties: !0,
1813
+ rejectedAdditionalProperties: !1,
1814
+ definitionPath: "definitions",
1815
+ strictUnions: !1,
1816
+ definitions: {},
1817
+ errorMessages: !1,
1818
+ patternStrategy: "escape",
1819
+ applyRegexFlags: !1,
1820
+ emailStrategy: "format:email",
1821
+ base64Strategy: "contentEncoding:base64",
1822
+ nameStrategy: "ref"
1823
+ }, b2 = (r) => typeof r == "string" ? {
1824
+ ...Ze,
1825
+ name: r
1826
+ } : {
1827
+ ...Ze,
1828
+ ...r
1829
+ };
1830
+ function T() {
1831
+ return {};
1832
+ }
1833
+ function x2(r, e) {
1834
+ var t, s, n;
1835
+ const i = {
1836
+ type: "array"
1837
+ };
1838
+ return (t = r.type) != null && t._def && ((n = (s = r.type) == null ? void 0 : s._def) == null ? void 0 : n.typeName) !== f.ZodAny && (i.items = _(r.type._def, {
1839
+ ...e,
1840
+ currentPath: [...e.currentPath, "items"]
1841
+ })), r.minLength && (i.minItems = r.minLength.value), r.maxLength && (i.maxItems = r.maxLength.value), r.exactLength && (i.minItems = r.exactLength.value, i.maxItems = r.exactLength.value), i;
1842
+ }
1843
+ function L2(r) {
1844
+ const e = {
1845
+ type: "integer",
1846
+ format: "int64"
1847
+ };
1848
+ if (!r.checks) return e;
1849
+ for (const t of r.checks)
1850
+ switch (t.kind) {
1851
+ case "min":
1852
+ t.inclusive ? e.minimum = t.value : e.exclusiveMinimum = t.value;
1853
+ break;
1854
+ case "max":
1855
+ t.inclusive ? e.maximum = t.value : e.exclusiveMaximum = t.value;
1856
+ break;
1857
+ case "multipleOf":
1858
+ e.multipleOf = t.value;
1859
+ break;
1860
+ }
1861
+ return e;
1862
+ }
1863
+ function S2() {
1864
+ return { type: "boolean" };
1865
+ }
1866
+ function tt(r, e) {
1867
+ return _(r.type._def, e);
1868
+ }
1869
+ var P2 = (r, e) => _(r.innerType._def, e);
1870
+ function rt(r, e, t) {
1871
+ const s = t ?? e.dateStrategy;
1872
+ if (Array.isArray(s))
1873
+ return {
1874
+ anyOf: s.map((n, i) => rt(r, e, n))
1875
+ };
1876
+ switch (s) {
1877
+ case "string":
1878
+ case "format:date-time":
1879
+ return {
1880
+ type: "string",
1881
+ format: "date-time"
1882
+ };
1883
+ case "format:date":
1884
+ return {
1885
+ type: "string",
1886
+ format: "date"
1887
+ };
1888
+ case "integer":
1889
+ return k2(r);
1890
+ }
1891
+ }
1892
+ var k2 = (r) => {
1893
+ const e = {
1894
+ type: "integer",
1895
+ format: "unix-time"
1896
+ };
1897
+ for (const t of r.checks)
1898
+ switch (t.kind) {
1899
+ case "min":
1900
+ e.minimum = t.value;
1901
+ break;
1902
+ case "max":
1903
+ e.maximum = t.value;
1904
+ break;
1905
+ }
1906
+ return e;
1907
+ };
1908
+ function T2(r, e) {
1909
+ return {
1910
+ ..._(r.innerType._def, e),
1911
+ default: r.defaultValue()
1912
+ };
1913
+ }
1914
+ function M2(r, e) {
1915
+ return e.effectStrategy === "input" ? _(r.schema._def, e) : T();
1916
+ }
1917
+ function R2(r) {
1918
+ return {
1919
+ type: "string",
1920
+ enum: Array.from(r.values)
1921
+ };
1922
+ }
1923
+ var E2 = (r) => "type" in r && r.type === "string" ? !1 : "allOf" in r;
1924
+ function I2(r, e) {
1925
+ const t = [
1926
+ _(r.left._def, {
1927
+ ...e,
1928
+ currentPath: [...e.currentPath, "allOf", "0"]
1929
+ }),
1930
+ _(r.right._def, {
1931
+ ...e,
1932
+ currentPath: [...e.currentPath, "allOf", "1"]
1933
+ })
1934
+ ].filter((n) => !!n), s = [];
1935
+ return t.forEach((n) => {
1936
+ if (E2(n))
1937
+ s.push(...n.allOf);
1938
+ else {
1939
+ let i = n;
1940
+ if ("additionalProperties" in n && n.additionalProperties === !1) {
1941
+ const { additionalProperties: a, ...l } = n;
1942
+ i = l;
1943
+ }
1944
+ s.push(i);
1945
+ }
1946
+ }), s.length ? { allOf: s } : void 0;
1947
+ }
1948
+ function A2(r) {
1949
+ const e = typeof r.value;
1950
+ return e !== "bigint" && e !== "number" && e !== "boolean" && e !== "string" ? {
1951
+ type: Array.isArray(r.value) ? "array" : "object"
1952
+ } : {
1953
+ type: e === "bigint" ? "integer" : e,
1954
+ const: r.value
1955
+ };
1956
+ }
1957
+ var ue = void 0, O = {
1958
+ /**
1959
+ * `c` was changed to `[cC]` to replicate /i flag
1960
+ */
1961
+ cuid: /^[cC][^\s-]{8,}$/,
1962
+ cuid2: /^[0-9a-z]+$/,
1963
+ ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
1964
+ /**
1965
+ * `a-z` was added to replicate /i flag
1966
+ */
1967
+ email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
1968
+ /**
1969
+ * Constructed a valid Unicode RegExp
1970
+ *
1971
+ * Lazily instantiate since this type of regex isn't supported
1972
+ * in all envs (e.g. React Native).
1973
+ *
1974
+ * See:
1975
+ * https://github.com/colinhacks/zod/issues/2433
1976
+ * Fix in Zod:
1977
+ * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
1978
+ */
1979
+ emoji: () => (ue === void 0 && (ue = RegExp(
1980
+ "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",
1981
+ "u"
1982
+ )), ue),
1983
+ /**
1984
+ * Unused
1985
+ */
1986
+ uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
1987
+ /**
1988
+ * Unused
1989
+ */
1990
+ ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
1991
+ ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
1992
+ /**
1993
+ * Unused
1994
+ */
1995
+ ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
1996
+ ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
1997
+ base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
1998
+ base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
1999
+ nanoid: /^[a-zA-Z0-9_-]{21}$/,
2000
+ jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
2001
+ };
2002
+ function st(r, e) {
2003
+ const t = {
2004
+ type: "string"
2005
+ };
2006
+ if (r.checks)
2007
+ for (const s of r.checks)
2008
+ switch (s.kind) {
2009
+ case "min":
2010
+ t.minLength = typeof t.minLength == "number" ? Math.max(t.minLength, s.value) : s.value;
2011
+ break;
2012
+ case "max":
2013
+ t.maxLength = typeof t.maxLength == "number" ? Math.min(t.maxLength, s.value) : s.value;
2014
+ break;
2015
+ case "email":
2016
+ switch (e.emailStrategy) {
2017
+ case "format:email":
2018
+ $(t, "email", s.message, e);
2019
+ break;
2020
+ case "format:idn-email":
2021
+ $(t, "idn-email", s.message, e);
2022
+ break;
2023
+ case "pattern:zod":
2024
+ S(t, O.email, s.message, e);
2025
+ break;
2026
+ }
2027
+ break;
2028
+ case "url":
2029
+ $(t, "uri", s.message, e);
2030
+ break;
2031
+ case "uuid":
2032
+ $(t, "uuid", s.message, e);
2033
+ break;
2034
+ case "regex":
2035
+ S(t, s.regex, s.message, e);
2036
+ break;
2037
+ case "cuid":
2038
+ S(t, O.cuid, s.message, e);
2039
+ break;
2040
+ case "cuid2":
2041
+ S(t, O.cuid2, s.message, e);
2042
+ break;
2043
+ case "startsWith":
2044
+ S(
2045
+ t,
2046
+ RegExp(`^${de(s.value, e)}`),
2047
+ s.message,
2048
+ e
2049
+ );
2050
+ break;
2051
+ case "endsWith":
2052
+ S(
2053
+ t,
2054
+ RegExp(`${de(s.value, e)}$`),
2055
+ s.message,
2056
+ e
2057
+ );
2058
+ break;
2059
+ case "datetime":
2060
+ $(t, "date-time", s.message, e);
2061
+ break;
2062
+ case "date":
2063
+ $(t, "date", s.message, e);
2064
+ break;
2065
+ case "time":
2066
+ $(t, "time", s.message, e);
2067
+ break;
2068
+ case "duration":
2069
+ $(t, "duration", s.message, e);
2070
+ break;
2071
+ case "length":
2072
+ t.minLength = typeof t.minLength == "number" ? Math.max(t.minLength, s.value) : s.value, t.maxLength = typeof t.maxLength == "number" ? Math.min(t.maxLength, s.value) : s.value;
2073
+ break;
2074
+ case "includes": {
2075
+ S(
2076
+ t,
2077
+ RegExp(de(s.value, e)),
2078
+ s.message,
2079
+ e
2080
+ );
2081
+ break;
2082
+ }
2083
+ case "ip": {
2084
+ s.version !== "v6" && $(t, "ipv4", s.message, e), s.version !== "v4" && $(t, "ipv6", s.message, e);
2085
+ break;
2086
+ }
2087
+ case "base64url":
2088
+ S(t, O.base64url, s.message, e);
2089
+ break;
2090
+ case "jwt":
2091
+ S(t, O.jwt, s.message, e);
2092
+ break;
2093
+ case "cidr": {
2094
+ s.version !== "v6" && S(t, O.ipv4Cidr, s.message, e), s.version !== "v4" && S(t, O.ipv6Cidr, s.message, e);
2095
+ break;
2096
+ }
2097
+ case "emoji":
2098
+ S(t, O.emoji(), s.message, e);
2099
+ break;
2100
+ case "ulid": {
2101
+ S(t, O.ulid, s.message, e);
2102
+ break;
2103
+ }
2104
+ case "base64": {
2105
+ switch (e.base64Strategy) {
2106
+ case "format:binary": {
2107
+ $(t, "binary", s.message, e);
2108
+ break;
2109
+ }
2110
+ case "contentEncoding:base64": {
2111
+ t.contentEncoding = "base64";
2112
+ break;
2113
+ }
2114
+ case "pattern:zod": {
2115
+ S(t, O.base64, s.message, e);
2116
+ break;
2117
+ }
2118
+ }
2119
+ break;
2120
+ }
2121
+ case "nanoid":
2122
+ S(t, O.nanoid, s.message, e);
2123
+ }
2124
+ return t;
2125
+ }
2126
+ function de(r, e) {
2127
+ return e.patternStrategy === "escape" ? $2(r) : r;
1738
2128
  }
1739
- new Set(
2129
+ var O2 = new Set(
1740
2130
  "ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789"
1741
2131
  );
1742
- var De = Symbol.for("vercel.ai.schema");
1743
- function Fe(r, {
2132
+ function $2(r) {
2133
+ let e = "";
2134
+ for (let t = 0; t < r.length; t++)
2135
+ O2.has(r[t]) || (e += "\\"), e += r[t];
2136
+ return e;
2137
+ }
2138
+ function $(r, e, t, s) {
2139
+ var n;
2140
+ r.format || (n = r.anyOf) != null && n.some((i) => i.format) ? (r.anyOf || (r.anyOf = []), r.format && (r.anyOf.push({
2141
+ format: r.format
2142
+ }), delete r.format), r.anyOf.push({
2143
+ format: e,
2144
+ ...t && s.errorMessages && { errorMessage: { format: t } }
2145
+ })) : r.format = e;
2146
+ }
2147
+ function S(r, e, t, s) {
2148
+ var n;
2149
+ r.pattern || (n = r.allOf) != null && n.some((i) => i.pattern) ? (r.allOf || (r.allOf = []), r.pattern && (r.allOf.push({
2150
+ pattern: r.pattern
2151
+ }), delete r.pattern), r.allOf.push({
2152
+ pattern: Ne(e, s),
2153
+ ...t && s.errorMessages && { errorMessage: { pattern: t } }
2154
+ })) : r.pattern = Ne(e, s);
2155
+ }
2156
+ function Ne(r, e) {
2157
+ var t;
2158
+ if (!e.applyRegexFlags || !r.flags)
2159
+ return r.source;
2160
+ const s = {
2161
+ i: r.flags.includes("i"),
2162
+ // Case-insensitive
2163
+ m: r.flags.includes("m"),
2164
+ // `^` and `$` matches adjacent to newline characters
2165
+ s: r.flags.includes("s")
2166
+ // `.` matches newlines
2167
+ }, n = s.i ? r.source.toLowerCase() : r.source;
2168
+ let i = "", a = !1, l = !1, u = !1;
2169
+ for (let c = 0; c < n.length; c++) {
2170
+ if (a) {
2171
+ i += n[c], a = !1;
2172
+ continue;
2173
+ }
2174
+ if (s.i) {
2175
+ if (l) {
2176
+ if (n[c].match(/[a-z]/)) {
2177
+ u ? (i += n[c], i += `${n[c - 2]}-${n[c]}`.toUpperCase(), u = !1) : n[c + 1] === "-" && ((t = n[c + 2]) != null && t.match(/[a-z]/)) ? (i += n[c], u = !0) : i += `${n[c]}${n[c].toUpperCase()}`;
2178
+ continue;
2179
+ }
2180
+ } else if (n[c].match(/[a-z]/)) {
2181
+ i += `[${n[c]}${n[c].toUpperCase()}]`;
2182
+ continue;
2183
+ }
2184
+ }
2185
+ if (s.m) {
2186
+ if (n[c] === "^") {
2187
+ i += `(^|(?<=[\r
2188
+ ]))`;
2189
+ continue;
2190
+ } else if (n[c] === "$") {
2191
+ i += `($|(?=[\r
2192
+ ]))`;
2193
+ continue;
2194
+ }
2195
+ }
2196
+ if (s.s && n[c] === ".") {
2197
+ i += l ? `${n[c]}\r
2198
+ ` : `[${n[c]}\r
2199
+ ]`;
2200
+ continue;
2201
+ }
2202
+ i += n[c], n[c] === "\\" ? a = !0 : l && n[c] === "]" ? l = !1 : !l && n[c] === "[" && (l = !0);
2203
+ }
2204
+ try {
2205
+ new RegExp(i);
2206
+ } catch {
2207
+ return console.warn(
2208
+ `Could not convert regex pattern at ${e.currentPath.join(
2209
+ "/"
2210
+ )} to a flag-independent form! Falling back to the flag-ignorant source`
2211
+ ), r.source;
2212
+ }
2213
+ return i;
2214
+ }
2215
+ function nt(r, e) {
2216
+ var t, s, n, i, a, l;
2217
+ const u = {
2218
+ type: "object",
2219
+ additionalProperties: (t = _(r.valueType._def, {
2220
+ ...e,
2221
+ currentPath: [...e.currentPath, "additionalProperties"]
2222
+ })) != null ? t : e.allowedAdditionalProperties
2223
+ };
2224
+ if (((s = r.keyType) == null ? void 0 : s._def.typeName) === f.ZodString && ((n = r.keyType._def.checks) != null && n.length)) {
2225
+ const { type: c, ...d } = st(r.keyType._def, e);
2226
+ return {
2227
+ ...u,
2228
+ propertyNames: d
2229
+ };
2230
+ } else {
2231
+ if (((i = r.keyType) == null ? void 0 : i._def.typeName) === f.ZodEnum)
2232
+ return {
2233
+ ...u,
2234
+ propertyNames: {
2235
+ enum: r.keyType._def.values
2236
+ }
2237
+ };
2238
+ if (((a = r.keyType) == null ? void 0 : a._def.typeName) === f.ZodBranded && r.keyType._def.type._def.typeName === f.ZodString && ((l = r.keyType._def.type._def.checks) != null && l.length)) {
2239
+ const { type: c, ...d } = tt(
2240
+ r.keyType._def,
2241
+ e
2242
+ );
2243
+ return {
2244
+ ...u,
2245
+ propertyNames: d
2246
+ };
2247
+ }
2248
+ }
2249
+ return u;
2250
+ }
2251
+ function U2(r, e) {
2252
+ if (e.mapStrategy === "record")
2253
+ return nt(r, e);
2254
+ const t = _(r.keyType._def, {
2255
+ ...e,
2256
+ currentPath: [...e.currentPath, "items", "items", "0"]
2257
+ }) || T(), s = _(r.valueType._def, {
2258
+ ...e,
2259
+ currentPath: [...e.currentPath, "items", "items", "1"]
2260
+ }) || T();
2261
+ return {
2262
+ type: "array",
2263
+ maxItems: 125,
2264
+ items: {
2265
+ type: "array",
2266
+ items: [t, s],
2267
+ minItems: 2,
2268
+ maxItems: 2
2269
+ }
2270
+ };
2271
+ }
2272
+ function j2(r) {
2273
+ const e = r.values, s = Object.keys(r.values).filter((i) => typeof e[e[i]] != "number").map((i) => e[i]), n = Array.from(
2274
+ new Set(s.map((i) => typeof i))
2275
+ );
2276
+ return {
2277
+ type: n.length === 1 ? n[0] === "string" ? "string" : "number" : ["string", "number"],
2278
+ enum: s
2279
+ };
2280
+ }
2281
+ function Z2() {
2282
+ return { not: T() };
2283
+ }
2284
+ function N2() {
2285
+ return {
2286
+ type: "null"
2287
+ };
2288
+ }
2289
+ var ye = {
2290
+ ZodString: "string",
2291
+ ZodNumber: "number",
2292
+ ZodBigInt: "integer",
2293
+ ZodBoolean: "boolean",
2294
+ ZodNull: "null"
2295
+ };
2296
+ function q2(r, e) {
2297
+ const t = r.options instanceof Map ? Array.from(r.options.values()) : r.options;
2298
+ if (t.every(
2299
+ (s) => s._def.typeName in ye && (!s._def.checks || !s._def.checks.length)
2300
+ )) {
2301
+ const s = t.reduce((n, i) => {
2302
+ const a = ye[i._def.typeName];
2303
+ return a && !n.includes(a) ? [...n, a] : n;
2304
+ }, []);
2305
+ return {
2306
+ type: s.length > 1 ? s : s[0]
2307
+ };
2308
+ } else if (t.every((s) => s._def.typeName === "ZodLiteral" && !s.description)) {
2309
+ const s = t.reduce(
2310
+ (n, i) => {
2311
+ const a = typeof i._def.value;
2312
+ switch (a) {
2313
+ case "string":
2314
+ case "number":
2315
+ case "boolean":
2316
+ return [...n, a];
2317
+ case "bigint":
2318
+ return [...n, "integer"];
2319
+ case "object":
2320
+ if (i._def.value === null) return [...n, "null"];
2321
+ case "symbol":
2322
+ case "undefined":
2323
+ case "function":
2324
+ default:
2325
+ return n;
2326
+ }
2327
+ },
2328
+ []
2329
+ );
2330
+ if (s.length === t.length) {
2331
+ const n = s.filter((i, a, l) => l.indexOf(i) === a);
2332
+ return {
2333
+ type: n.length > 1 ? n : n[0],
2334
+ enum: t.reduce(
2335
+ (i, a) => i.includes(a._def.value) ? i : [...i, a._def.value],
2336
+ []
2337
+ )
2338
+ };
2339
+ }
2340
+ } else if (t.every((s) => s._def.typeName === "ZodEnum"))
2341
+ return {
2342
+ type: "string",
2343
+ enum: t.reduce(
2344
+ (s, n) => [
2345
+ ...s,
2346
+ ...n._def.values.filter((i) => !s.includes(i))
2347
+ ],
2348
+ []
2349
+ )
2350
+ };
2351
+ return z2(r, e);
2352
+ }
2353
+ var z2 = (r, e) => {
2354
+ const t = (r.options instanceof Map ? Array.from(r.options.values()) : r.options).map(
2355
+ (s, n) => _(s._def, {
2356
+ ...e,
2357
+ currentPath: [...e.currentPath, "anyOf", `${n}`]
2358
+ })
2359
+ ).filter(
2360
+ (s) => !!s && (!e.strictUnions || typeof s == "object" && Object.keys(s).length > 0)
2361
+ );
2362
+ return t.length ? { anyOf: t } : void 0;
2363
+ };
2364
+ function D2(r, e) {
2365
+ if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(
2366
+ r.innerType._def.typeName
2367
+ ) && (!r.innerType._def.checks || !r.innerType._def.checks.length))
2368
+ return {
2369
+ type: [
2370
+ ye[r.innerType._def.typeName],
2371
+ "null"
2372
+ ]
2373
+ };
2374
+ const t = _(r.innerType._def, {
2375
+ ...e,
2376
+ currentPath: [...e.currentPath, "anyOf", "0"]
2377
+ });
2378
+ return t && { anyOf: [t, { type: "null" }] };
2379
+ }
2380
+ function H2(r) {
2381
+ const e = {
2382
+ type: "number"
2383
+ };
2384
+ if (!r.checks) return e;
2385
+ for (const t of r.checks)
2386
+ switch (t.kind) {
2387
+ case "int":
2388
+ e.type = "integer";
2389
+ break;
2390
+ case "min":
2391
+ t.inclusive ? e.minimum = t.value : e.exclusiveMinimum = t.value;
2392
+ break;
2393
+ case "max":
2394
+ t.inclusive ? e.maximum = t.value : e.exclusiveMaximum = t.value;
2395
+ break;
2396
+ case "multipleOf":
2397
+ e.multipleOf = t.value;
2398
+ break;
2399
+ }
2400
+ return e;
2401
+ }
2402
+ function F2(r, e) {
2403
+ const t = {
2404
+ type: "object",
2405
+ properties: {}
2406
+ }, s = [], n = r.shape();
2407
+ for (const a in n) {
2408
+ let l = n[a];
2409
+ if (l === void 0 || l._def === void 0)
2410
+ continue;
2411
+ const u = V2(l), c = _(l._def, {
2412
+ ...e,
2413
+ currentPath: [...e.currentPath, "properties", a],
2414
+ propertyPath: [...e.currentPath, "properties", a]
2415
+ });
2416
+ c !== void 0 && (t.properties[a] = c, u || s.push(a));
2417
+ }
2418
+ s.length && (t.required = s);
2419
+ const i = B2(r, e);
2420
+ return i !== void 0 && (t.additionalProperties = i), t;
2421
+ }
2422
+ function B2(r, e) {
2423
+ if (r.catchall._def.typeName !== "ZodNever")
2424
+ return _(r.catchall._def, {
2425
+ ...e,
2426
+ currentPath: [...e.currentPath, "additionalProperties"]
2427
+ });
2428
+ switch (r.unknownKeys) {
2429
+ case "passthrough":
2430
+ return e.allowedAdditionalProperties;
2431
+ case "strict":
2432
+ return e.rejectedAdditionalProperties;
2433
+ case "strip":
2434
+ return e.removeAdditionalStrategy === "strict" ? e.allowedAdditionalProperties : e.rejectedAdditionalProperties;
2435
+ }
2436
+ }
2437
+ function V2(r) {
2438
+ try {
2439
+ return r.isOptional();
2440
+ } catch {
2441
+ return !0;
2442
+ }
2443
+ }
2444
+ var J2 = (r, e) => {
2445
+ var t;
2446
+ if (e.currentPath.toString() === ((t = e.propertyPath) == null ? void 0 : t.toString()))
2447
+ return _(r.innerType._def, e);
2448
+ const s = _(r.innerType._def, {
2449
+ ...e,
2450
+ currentPath: [...e.currentPath, "anyOf", "1"]
2451
+ });
2452
+ return s ? { anyOf: [{ not: T() }, s] } : T();
2453
+ }, W2 = (r, e) => {
2454
+ if (e.pipeStrategy === "input")
2455
+ return _(r.in._def, e);
2456
+ if (e.pipeStrategy === "output")
2457
+ return _(r.out._def, e);
2458
+ const t = _(r.in._def, {
2459
+ ...e,
2460
+ currentPath: [...e.currentPath, "allOf", "0"]
2461
+ }), s = _(r.out._def, {
2462
+ ...e,
2463
+ currentPath: [...e.currentPath, "allOf", t ? "1" : "0"]
2464
+ });
2465
+ return {
2466
+ allOf: [t, s].filter((n) => n !== void 0)
2467
+ };
2468
+ };
2469
+ function K2(r, e) {
2470
+ return _(r.type._def, e);
2471
+ }
2472
+ function G2(r, e) {
2473
+ const s = {
2474
+ type: "array",
2475
+ uniqueItems: !0,
2476
+ items: _(r.valueType._def, {
2477
+ ...e,
2478
+ currentPath: [...e.currentPath, "items"]
2479
+ })
2480
+ };
2481
+ return r.minSize && (s.minItems = r.minSize.value), r.maxSize && (s.maxItems = r.maxSize.value), s;
2482
+ }
2483
+ function Y2(r, e) {
2484
+ return r.rest ? {
2485
+ type: "array",
2486
+ minItems: r.items.length,
2487
+ items: r.items.map(
2488
+ (t, s) => _(t._def, {
2489
+ ...e,
2490
+ currentPath: [...e.currentPath, "items", `${s}`]
2491
+ })
2492
+ ).reduce(
2493
+ (t, s) => s === void 0 ? t : [...t, s],
2494
+ []
2495
+ ),
2496
+ additionalItems: _(r.rest._def, {
2497
+ ...e,
2498
+ currentPath: [...e.currentPath, "additionalItems"]
2499
+ })
2500
+ } : {
2501
+ type: "array",
2502
+ minItems: r.items.length,
2503
+ maxItems: r.items.length,
2504
+ items: r.items.map(
2505
+ (t, s) => _(t._def, {
2506
+ ...e,
2507
+ currentPath: [...e.currentPath, "items", `${s}`]
2508
+ })
2509
+ ).reduce(
2510
+ (t, s) => s === void 0 ? t : [...t, s],
2511
+ []
2512
+ )
2513
+ };
2514
+ }
2515
+ function Q2() {
2516
+ return {
2517
+ not: T()
2518
+ };
2519
+ }
2520
+ function X2() {
2521
+ return T();
2522
+ }
2523
+ var e0 = (r, e) => _(r.innerType._def, e), t0 = (r, e, t) => {
2524
+ switch (e) {
2525
+ case f.ZodString:
2526
+ return st(r, t);
2527
+ case f.ZodNumber:
2528
+ return H2(r);
2529
+ case f.ZodObject:
2530
+ return F2(r, t);
2531
+ case f.ZodBigInt:
2532
+ return L2(r);
2533
+ case f.ZodBoolean:
2534
+ return S2();
2535
+ case f.ZodDate:
2536
+ return rt(r, t);
2537
+ case f.ZodUndefined:
2538
+ return Q2();
2539
+ case f.ZodNull:
2540
+ return N2();
2541
+ case f.ZodArray:
2542
+ return x2(r, t);
2543
+ case f.ZodUnion:
2544
+ case f.ZodDiscriminatedUnion:
2545
+ return q2(r, t);
2546
+ case f.ZodIntersection:
2547
+ return I2(r, t);
2548
+ case f.ZodTuple:
2549
+ return Y2(r, t);
2550
+ case f.ZodRecord:
2551
+ return nt(r, t);
2552
+ case f.ZodLiteral:
2553
+ return A2(r);
2554
+ case f.ZodEnum:
2555
+ return R2(r);
2556
+ case f.ZodNativeEnum:
2557
+ return j2(r);
2558
+ case f.ZodNullable:
2559
+ return D2(r, t);
2560
+ case f.ZodOptional:
2561
+ return J2(r, t);
2562
+ case f.ZodMap:
2563
+ return U2(r, t);
2564
+ case f.ZodSet:
2565
+ return G2(r, t);
2566
+ case f.ZodLazy:
2567
+ return () => r.getter()._def;
2568
+ case f.ZodPromise:
2569
+ return K2(r, t);
2570
+ case f.ZodNaN:
2571
+ case f.ZodNever:
2572
+ return Z2();
2573
+ case f.ZodEffects:
2574
+ return M2(r, t);
2575
+ case f.ZodAny:
2576
+ return T();
2577
+ case f.ZodUnknown:
2578
+ return X2();
2579
+ case f.ZodDefault:
2580
+ return T2(r, t);
2581
+ case f.ZodBranded:
2582
+ return tt(r, t);
2583
+ case f.ZodReadonly:
2584
+ return e0(r, t);
2585
+ case f.ZodCatch:
2586
+ return P2(r, t);
2587
+ case f.ZodPipeline:
2588
+ return W2(r, t);
2589
+ case f.ZodFunction:
2590
+ case f.ZodVoid:
2591
+ case f.ZodSymbol:
2592
+ return;
2593
+ default:
2594
+ return /* @__PURE__ */ ((s) => {
2595
+ })();
2596
+ }
2597
+ }, r0 = (r, e) => {
2598
+ let t = 0;
2599
+ for (; t < r.length && t < e.length && r[t] === e[t]; t++)
2600
+ ;
2601
+ return [(r.length - t).toString(), ...e.slice(t)].join("/");
2602
+ };
2603
+ function _(r, e, t = !1) {
2604
+ var s;
2605
+ const n = e.seen.get(r);
2606
+ if (e.override) {
2607
+ const u = (s = e.override) == null ? void 0 : s.call(
2608
+ e,
2609
+ r,
2610
+ e,
2611
+ n,
2612
+ t
2613
+ );
2614
+ if (u !== _2)
2615
+ return u;
2616
+ }
2617
+ if (n && !t) {
2618
+ const u = s0(n, e);
2619
+ if (u !== void 0)
2620
+ return u;
2621
+ }
2622
+ const i = { def: r, path: e.currentPath, jsonSchema: void 0 };
2623
+ e.seen.set(r, i);
2624
+ const a = t0(r, r.typeName, e), l = typeof a == "function" ? _(a(), e) : a;
2625
+ if (l && n0(r, e, l), e.postProcess) {
2626
+ const u = e.postProcess(l, r, e);
2627
+ return i.jsonSchema = l, u;
2628
+ }
2629
+ return i.jsonSchema = l, l;
2630
+ }
2631
+ var s0 = (r, e) => {
2632
+ switch (e.$refStrategy) {
2633
+ case "root":
2634
+ return { $ref: r.path.join("/") };
2635
+ case "relative":
2636
+ return { $ref: r0(e.currentPath, r.path) };
2637
+ case "none":
2638
+ case "seen":
2639
+ return r.path.length < e.currentPath.length && r.path.every((t, s) => e.currentPath[s] === t) ? (console.warn(
2640
+ `Recursive reference detected at ${e.currentPath.join(
2641
+ "/"
2642
+ )}! Defaulting to any`
2643
+ ), T()) : e.$refStrategy === "seen" ? T() : void 0;
2644
+ }
2645
+ }, n0 = (r, e, t) => (r.description && (t.description = r.description), t), o0 = (r) => {
2646
+ const e = b2(r), t = e.name !== void 0 ? [...e.basePath, e.definitionPath, e.name] : e.basePath;
2647
+ return {
2648
+ ...e,
2649
+ currentPath: t,
2650
+ propertyPath: void 0,
2651
+ seen: new Map(
2652
+ Object.entries(e.definitions).map(([s, n]) => [
2653
+ n._def,
2654
+ {
2655
+ def: n._def,
2656
+ path: [...e.basePath, e.definitionPath, s],
2657
+ // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
2658
+ jsonSchema: void 0
2659
+ }
2660
+ ])
2661
+ )
2662
+ };
2663
+ }, i0 = (r, e) => {
2664
+ var t;
2665
+ const s = o0(e);
2666
+ let n = typeof e == "object" && e.definitions ? Object.entries(e.definitions).reduce(
2667
+ (c, [d, g]) => {
2668
+ var h;
2669
+ return {
2670
+ ...c,
2671
+ [d]: (h = _(
2672
+ g._def,
2673
+ {
2674
+ ...s,
2675
+ currentPath: [...s.basePath, s.definitionPath, d]
2676
+ },
2677
+ !0
2678
+ )) != null ? h : T()
2679
+ };
2680
+ },
2681
+ {}
2682
+ ) : void 0;
2683
+ const i = typeof e == "string" ? e : e?.nameStrategy === "title" ? void 0 : e?.name, a = (t = _(
2684
+ r._def,
2685
+ i === void 0 ? s : {
2686
+ ...s,
2687
+ currentPath: [...s.basePath, s.definitionPath, i]
2688
+ },
2689
+ !1
2690
+ )) != null ? t : T(), l = typeof e == "object" && e.name !== void 0 && e.nameStrategy === "title" ? e.name : void 0;
2691
+ l !== void 0 && (a.title = l);
2692
+ const u = i === void 0 ? n ? {
2693
+ ...a,
2694
+ [s.definitionPath]: n
2695
+ } : a : {
2696
+ $ref: [
2697
+ ...s.$refStrategy === "relative" ? [] : s.basePath,
2698
+ s.definitionPath,
2699
+ i
2700
+ ].join("/"),
2701
+ [s.definitionPath]: {
2702
+ ...n,
2703
+ [i]: a
2704
+ }
2705
+ };
2706
+ return u.$schema = "http://json-schema.org/draft-07/schema#", u;
2707
+ }, Ce = Symbol.for("vercel.ai.schema");
2708
+ function J(r, {
1744
2709
  validate: e
1745
2710
  } = {}) {
1746
2711
  return {
1747
- [De]: !0,
2712
+ [Ce]: !0,
1748
2713
  _type: void 0,
1749
2714
  // should never be used directly
1750
- [ze]: !0,
1751
2715
  get jsonSchema() {
1752
2716
  return typeof r == "function" && (r = r()), r;
1753
2717
  },
1754
2718
  validate: e
1755
2719
  };
1756
2720
  }
1757
- let l2;
1758
- l2 = globalThis.crypto;
1759
- async function Be(r) {
1760
- return (await l2).getRandomValues(new Uint8Array(r));
2721
+ function a0(r) {
2722
+ return typeof r == "object" && r !== null && Ce in r && r[Ce] === !0 && "jsonSchema" in r && "validate" in r;
2723
+ }
2724
+ function ot(r) {
2725
+ return r == null ? J({ properties: {}, additionalProperties: !1 }) : a0(r) ? r : "~standard" in r ? r["~standard"].vendor === "zod" ? h0(r) : c0(r) : r();
2726
+ }
2727
+ function c0(r) {
2728
+ return J(
2729
+ () => xe(
2730
+ r["~standard"].jsonSchema.input({
2731
+ target: "draft-07"
2732
+ })
2733
+ ),
2734
+ {
2735
+ validate: async (e) => {
2736
+ const t = await r["~standard"].validate(e);
2737
+ return "value" in t ? { success: !0, value: t.value } : {
2738
+ success: !1,
2739
+ error: new pe({
2740
+ value: e,
2741
+ cause: t.issues
2742
+ })
2743
+ };
2744
+ }
2745
+ }
2746
+ );
2747
+ }
2748
+ function l0(r, e) {
2749
+ var t;
2750
+ const s = (t = void 0) != null ? t : !1;
2751
+ return J(
2752
+ // defer json schema creation to avoid unnecessary computation when only validation is needed
2753
+ () => i0(r, {
2754
+ $refStrategy: s ? "root" : "none"
2755
+ }),
2756
+ {
2757
+ validate: async (n) => {
2758
+ const i = await r.safeParseAsync(n);
2759
+ return i.success ? { success: !0, value: i.data } : { success: !1, error: i.error };
2760
+ }
2761
+ }
2762
+ );
2763
+ }
2764
+ function u0(r, e) {
2765
+ var t;
2766
+ const s = (t = void 0) != null ? t : !1;
2767
+ return J(
2768
+ // defer json schema creation to avoid unnecessary computation when only validation is needed
2769
+ () => xe(
2770
+ Ie.toJSONSchema(r, {
2771
+ target: "draft-7",
2772
+ io: "input",
2773
+ reused: s ? "ref" : "inline"
2774
+ })
2775
+ ),
2776
+ {
2777
+ validate: async (n) => {
2778
+ const i = await Ie.safeParseAsync(r, n);
2779
+ return i.success ? { success: !0, value: i.data } : { success: !1, error: i.error };
2780
+ }
2781
+ }
2782
+ );
2783
+ }
2784
+ function d0(r) {
2785
+ return "_zod" in r;
2786
+ }
2787
+ function h0(r, e) {
2788
+ return d0(r) ? u0(r) : l0(r);
2789
+ }
2790
+ async function it({
2791
+ value: r,
2792
+ schema: e,
2793
+ context: t
2794
+ }) {
2795
+ const s = ot(e);
2796
+ try {
2797
+ if (s.validate == null)
2798
+ return { success: !0, value: r, rawValue: r };
2799
+ const n = await s.validate(r);
2800
+ return n.success ? { success: !0, value: n.value, rawValue: r } : {
2801
+ success: !1,
2802
+ error: pe.wrap({ value: r, cause: n.error, context: t }),
2803
+ rawValue: r
2804
+ };
2805
+ } catch (n) {
2806
+ return {
2807
+ success: !1,
2808
+ error: pe.wrap({ value: r, cause: n, context: t }),
2809
+ rawValue: r
2810
+ };
2811
+ }
2812
+ }
2813
+ async function p0({
2814
+ text: r,
2815
+ schema: e
2816
+ }) {
2817
+ try {
2818
+ const t = v2(r);
2819
+ return e == null ? { success: !0, value: t, rawValue: t } : await it({ value: t, schema: e });
2820
+ } catch (t) {
2821
+ return {
2822
+ success: !1,
2823
+ error: Ee.isInstance(t) ? t : new Ee({ text: r, cause: t }),
2824
+ rawValue: void 0
2825
+ };
2826
+ }
2827
+ }
2828
+ function m0(r) {
2829
+ return { ...r, type: "dynamic" };
1761
2830
  }
1762
- async function Ve(r) {
2831
+ let Le;
2832
+ Le = globalThis.crypto;
2833
+ async function f0(r) {
2834
+ return (await Le).getRandomValues(new Uint8Array(r));
2835
+ }
2836
+ async function g0(r) {
1763
2837
  const e = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~", t = Math.pow(2, 8) - Math.pow(2, 8) % e.length;
1764
2838
  let s = "";
1765
2839
  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]);
2840
+ const n = await f0(r - s.length);
2841
+ for (const i of n)
2842
+ i < t && (s += e[i % e.length]);
1769
2843
  }
1770
2844
  return s;
1771
2845
  }
1772
- async function Je(r) {
1773
- return await Ve(r);
2846
+ async function y0(r) {
2847
+ return await g0(r);
1774
2848
  }
1775
- async function We(r) {
1776
- const e = await (await l2).subtle.digest("SHA-256", new TextEncoder().encode(r));
2849
+ async function C0(r) {
2850
+ const e = await (await Le).subtle.digest("SHA-256", new TextEncoder().encode(r));
1777
2851
  return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g, "_").replace(/\+/g, "-").replace(/=/g, "");
1778
2852
  }
1779
- async function Ge(r) {
2853
+ async function w0(r) {
1780
2854
  if (r || (r = 43), r < 43 || r > 128)
1781
2855
  throw `Expected a length between 43 and 128. Received ${r}.`;
1782
- const e = await Je(r), t = await We(e);
2856
+ const e = await y0(r), t = await C0(e);
1783
2857
  return {
1784
2858
  code_verifier: e,
1785
2859
  code_challenge: t
1786
2860
  };
1787
2861
  }
1788
- var Ye = "AI_MCPClientError", A2 = `vercel.ai.error.${Ye}`, Ke = Symbol.for(A2), b2, x2, y = class extends (x2 = Z, b2 = Ke, x2) {
2862
+ var v0 = "AI_MCPClientError", at = `vercel.ai.error.${v0}`, _0 = Symbol.for(at), qe, ze, v = class extends (ze = Y, qe = _0, ze) {
1789
2863
  constructor({
1790
2864
  name: r = "MCPClientError",
1791
2865
  message: e,
1792
2866
  cause: t,
1793
2867
  data: s,
1794
- code: i
2868
+ code: n
1795
2869
  }) {
1796
- super({ name: r, message: e, cause: t }), this[b2] = !0, this.data = s, this.code = i;
2870
+ super({ name: r, message: e, cause: t }), this[qe] = !0, this.data = s, this.code = n;
1797
2871
  }
1798
2872
  static isInstance(r) {
1799
- return Z.hasMarker(r, A2);
2873
+ return Y.hasMarker(r, at);
1800
2874
  }
1801
- }, $ = "2025-06-18", Qe = [
1802
- $,
2875
+ }, H = "2025-06-18", b0 = [
2876
+ H,
1803
2877
  "2025-03-26",
1804
2878
  "2024-11-05"
1805
- ], Xe = o.looseObject({
2879
+ ], x0 = o.optional(o.record(o.string(), o.unknown())), L0 = o.looseObject({
1806
2880
  name: o.string(),
1807
2881
  version: o.string()
1808
- }), Y = o.looseObject({
2882
+ }), oe = o.looseObject({
1809
2883
  _meta: o.optional(o.object({}).loose())
1810
- }), M = Y, O2 = o.object({
2884
+ }), U = oe, ct = o.object({
1811
2885
  method: o.string(),
1812
- params: o.optional(Y)
1813
- }), $2 = o.object({
2886
+ params: o.optional(oe)
2887
+ }), lt = o.object({
1814
2888
  applyDefaults: o.optional(o.boolean())
1815
- }).loose(), et = o.looseObject({
2889
+ }).loose(), S0 = o.looseObject({
1816
2890
  experimental: o.optional(o.object({}).loose()),
1817
2891
  logging: o.optional(o.object({}).loose()),
1818
2892
  prompts: o.optional(
@@ -1831,44 +2905,58 @@ var Ye = "AI_MCPClientError", A2 = `vercel.ai.error.${Ye}`, Ke = Symbol.for(A2),
1831
2905
  listChanged: o.optional(o.boolean())
1832
2906
  })
1833
2907
  ),
1834
- elicitation: o.optional($2)
2908
+ elicitation: o.optional(lt)
1835
2909
  });
1836
2910
  o.object({
1837
- elicitation: o.optional($2)
2911
+ elicitation: o.optional(lt)
1838
2912
  }).loose();
1839
- var tt = M.extend({
2913
+ var P0 = U.extend({
1840
2914
  protocolVersion: o.string(),
1841
- capabilities: et,
1842
- serverInfo: Xe,
2915
+ capabilities: S0,
2916
+ serverInfo: L0,
1843
2917
  instructions: o.optional(o.string())
1844
- }), h2 = M.extend({
2918
+ }), Se = U.extend({
1845
2919
  nextCursor: o.optional(o.string())
1846
- }), rt = o.object({
2920
+ }), k0 = o.object({
1847
2921
  name: o.string(),
2922
+ /**
2923
+ * @see https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool
2924
+ */
2925
+ title: o.optional(o.string()),
1848
2926
  description: o.optional(o.string()),
1849
2927
  inputSchema: o.object({
1850
2928
  type: o.literal("object"),
1851
2929
  properties: o.optional(o.object({}).loose())
1852
- }).loose()
1853
- }).loose(), st = h2.extend({
1854
- tools: o.array(rt)
1855
- }), q2 = o.object({
2930
+ }).loose(),
2931
+ /**
2932
+ * @see https://modelcontextprotocol.io/specification/2025-06-18/server/tools#output-schema
2933
+ */
2934
+ outputSchema: o.optional(o.object({}).loose()),
2935
+ annotations: o.optional(
2936
+ o.object({
2937
+ title: o.optional(o.string())
2938
+ }).loose()
2939
+ ),
2940
+ _meta: x0
2941
+ }).loose(), T0 = Se.extend({
2942
+ tools: o.array(k0)
2943
+ }), ut = o.object({
1856
2944
  type: o.literal("text"),
1857
2945
  text: o.string()
1858
- }).loose(), j2 = o.object({
2946
+ }).loose(), dt = o.object({
1859
2947
  type: o.literal("image"),
1860
2948
  data: o.base64(),
1861
2949
  mimeType: o.string()
1862
- }).loose(), ot = o.object({
2950
+ }).loose(), M0 = o.object({
1863
2951
  uri: o.string(),
1864
2952
  name: o.string(),
1865
2953
  title: o.optional(o.string()),
1866
2954
  description: o.optional(o.string()),
1867
2955
  mimeType: o.optional(o.string()),
1868
2956
  size: o.optional(o.number())
1869
- }).loose(), it = h2.extend({
1870
- resources: o.array(ot)
1871
- }), H2 = o.object({
2957
+ }).loose(), R0 = Se.extend({
2958
+ resources: o.array(M0)
2959
+ }), ht = o.object({
1872
2960
  /**
1873
2961
  * The URI of this resource.
1874
2962
  */
@@ -1885,96 +2973,100 @@ var tt = M.extend({
1885
2973
  * The MIME type of this resource, if known.
1886
2974
  */
1887
2975
  mimeType: o.optional(o.string())
1888
- }).loose(), N2 = H2.extend({
2976
+ }).loose(), pt = ht.extend({
1889
2977
  text: o.string()
1890
- }), z2 = H2.extend({
2978
+ }), mt = ht.extend({
1891
2979
  blob: o.base64()
1892
- }), Z2 = o.object({
2980
+ }), ft = o.object({
1893
2981
  type: o.literal("resource"),
1894
- resource: o.union([N2, z2])
1895
- }).loose(), nt = M.extend({
2982
+ resource: o.union([pt, mt])
2983
+ }).loose(), E0 = U.extend({
1896
2984
  content: o.array(
1897
- o.union([q2, j2, Z2])
2985
+ o.union([ut, dt, ft])
1898
2986
  ),
2987
+ /**
2988
+ * @see https://modelcontextprotocol.io/specification/2025-06-18/server/tools#structured-content
2989
+ */
2990
+ structuredContent: o.optional(o.unknown()),
1899
2991
  isError: o.boolean().default(!1).optional()
1900
2992
  }).or(
1901
- M.extend({
2993
+ U.extend({
1902
2994
  toolResult: o.unknown()
1903
2995
  })
1904
- ), at = o.object({
2996
+ ), I0 = o.object({
1905
2997
  uriTemplate: o.string(),
1906
2998
  name: o.string(),
1907
2999
  title: o.optional(o.string()),
1908
3000
  description: o.optional(o.string()),
1909
3001
  mimeType: o.optional(o.string())
1910
- }).loose(), ct = M.extend({
1911
- resourceTemplates: o.array(at)
1912
- }), lt = M.extend({
3002
+ }).loose(), A0 = U.extend({
3003
+ resourceTemplates: o.array(I0)
3004
+ }), O0 = U.extend({
1913
3005
  contents: o.array(
1914
- o.union([N2, z2])
3006
+ o.union([pt, mt])
1915
3007
  )
1916
- }), ht = o.object({
3008
+ }), $0 = o.object({
1917
3009
  name: o.string(),
1918
3010
  description: o.optional(o.string()),
1919
3011
  required: o.optional(o.boolean())
1920
- }).loose(), dt = o.object({
3012
+ }).loose(), U0 = o.object({
1921
3013
  name: o.string(),
1922
3014
  title: o.optional(o.string()),
1923
3015
  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({
3016
+ arguments: o.optional(o.array($0))
3017
+ }).loose(), j0 = Se.extend({
3018
+ prompts: o.array(U0)
3019
+ }), Z0 = o.object({
1928
3020
  role: o.union([o.literal("user"), o.literal("assistant")]),
1929
3021
  content: o.union([
1930
- q2,
1931
- j2,
1932
- Z2
3022
+ ut,
3023
+ dt,
3024
+ ft
1933
3025
  ])
1934
- }).loose(), mt = M.extend({
3026
+ }).loose(), N0 = U.extend({
1935
3027
  description: o.optional(o.string()),
1936
- messages: o.array(ut)
1937
- }), gt = Y.extend({
3028
+ messages: o.array(Z0)
3029
+ }), q0 = oe.extend({
1938
3030
  message: o.string(),
1939
3031
  requestedSchema: o.unknown()
1940
- }), L2 = O2.extend({
3032
+ }), De = ct.extend({
1941
3033
  method: o.literal("elicitation/create"),
1942
- params: gt
1943
- }), ft = M.extend({
3034
+ params: q0
3035
+ }), z0 = U.extend({
1944
3036
  action: o.union([
1945
3037
  o.literal("accept"),
1946
3038
  o.literal("decline"),
1947
3039
  o.literal("cancel")
1948
3040
  ]),
1949
3041
  content: o.optional(o.record(o.string(), o.unknown()))
1950
- }), K = "2.0", Ct = o.object({
1951
- jsonrpc: o.literal(K),
3042
+ }), ie = "2.0", D0 = o.object({
3043
+ jsonrpc: o.literal(ie),
1952
3044
  id: o.union([o.string(), o.number().int()])
1953
- }).merge(O2).strict(), wt = o.object({
1954
- jsonrpc: o.literal(K),
3045
+ }).merge(ct).strict(), H0 = o.object({
3046
+ jsonrpc: o.literal(ie),
1955
3047
  id: o.union([o.string(), o.number().int()]),
1956
- result: M
1957
- }).strict(), yt = o.object({
1958
- jsonrpc: o.literal(K),
3048
+ result: U
3049
+ }).strict(), F0 = o.object({
3050
+ jsonrpc: o.literal(ie),
1959
3051
  id: o.union([o.string(), o.number().int()]),
1960
3052
  error: o.object({
1961
3053
  code: o.number().int(),
1962
3054
  message: o.string(),
1963
3055
  data: o.optional(o.unknown())
1964
3056
  })
1965
- }).strict(), vt = o.object({
1966
- jsonrpc: o.literal(K)
3057
+ }).strict(), B0 = o.object({
3058
+ jsonrpc: o.literal(ie)
1967
3059
  }).merge(
1968
3060
  o.object({
1969
3061
  method: o.string(),
1970
- params: o.optional(Y)
3062
+ params: o.optional(oe)
1971
3063
  })
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({
3064
+ ).strict(), V = o.union([
3065
+ D0,
3066
+ B0,
3067
+ H0,
3068
+ F0
3069
+ ]), gt = typeof __PACKAGE_VERSION__ < "u" ? __PACKAGE_VERSION__ : "0.0.0-test", yt = o.object({
1978
3070
  access_token: o.string(),
1979
3071
  id_token: o.string().optional(),
1980
3072
  // Optional for OAuth 2.1, but necessary in OpenID Connect
@@ -1982,7 +3074,7 @@ var tt = M.extend({
1982
3074
  expires_in: o.number().optional(),
1983
3075
  scope: o.string().optional(),
1984
3076
  refresh_token: o.string().optional()
1985
- }).strip(), x = o.string().url().superRefine((r, e) => {
3077
+ }).strip(), P = o.string().url().superRefine((r, e) => {
1986
3078
  if (!URL.canParse(r))
1987
3079
  return e.addIssue({
1988
3080
  code: o.ZodIssueCode.custom,
@@ -1995,9 +3087,9 @@ var tt = M.extend({
1995
3087
  return e.protocol !== "javascript:" && e.protocol !== "data:" && e.protocol !== "vbscript:";
1996
3088
  },
1997
3089
  { message: "URL cannot use javascript:, data:, or vbscript: scheme" }
1998
- ), _t = o.object({
3090
+ ), V0 = o.object({
1999
3091
  resource: o.string().url(),
2000
- authorization_servers: o.array(x).optional(),
3092
+ authorization_servers: o.array(P).optional(),
2001
3093
  jwks_uri: o.string().url().optional(),
2002
3094
  scopes_supported: o.array(o.string()).optional(),
2003
3095
  bearer_methods_supported: o.array(o.string()).optional(),
@@ -2010,24 +3102,24 @@ var tt = M.extend({
2010
3102
  authorization_details_types_supported: o.array(o.string()).optional(),
2011
3103
  dpop_signing_alg_values_supported: o.array(o.string()).optional(),
2012
3104
  dpop_bound_access_tokens_required: o.boolean().optional()
2013
- }).passthrough(), B2 = o.object({
3105
+ }).passthrough(), Ct = o.object({
2014
3106
  issuer: o.string(),
2015
- authorization_endpoint: x,
2016
- token_endpoint: x,
2017
- registration_endpoint: x.optional(),
3107
+ authorization_endpoint: P,
3108
+ token_endpoint: P,
3109
+ registration_endpoint: P.optional(),
2018
3110
  scopes_supported: o.array(o.string()).optional(),
2019
3111
  response_types_supported: o.array(o.string()),
2020
3112
  grant_types_supported: o.array(o.string()).optional(),
2021
3113
  code_challenge_methods_supported: o.array(o.string()),
2022
3114
  token_endpoint_auth_methods_supported: o.array(o.string()).optional(),
2023
3115
  token_endpoint_auth_signing_alg_values_supported: o.array(o.string()).optional()
2024
- }).passthrough(), bt = o.object({
3116
+ }).passthrough(), J0 = o.object({
2025
3117
  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(),
3118
+ authorization_endpoint: P,
3119
+ token_endpoint: P,
3120
+ userinfo_endpoint: P.optional(),
3121
+ jwks_uri: P,
3122
+ registration_endpoint: P.optional(),
2031
3123
  scopes_supported: o.array(o.string()).optional(),
2032
3124
  response_types_supported: o.array(o.string()),
2033
3125
  grant_types_supported: o.array(o.string()).optional(),
@@ -2035,95 +3127,95 @@ var tt = M.extend({
2035
3127
  id_token_signing_alg_values_supported: o.array(o.string()),
2036
3128
  claims_supported: o.array(o.string()).optional(),
2037
3129
  token_endpoint_auth_methods_supported: o.array(o.string()).optional()
2038
- }).passthrough(), xt = bt.merge(
2039
- B2.pick({
3130
+ }).passthrough(), W0 = J0.merge(
3131
+ Ct.pick({
2040
3132
  code_challenge_methods_supported: !0
2041
3133
  })
2042
- ), Lt = o.object({
3134
+ ), K0 = o.object({
2043
3135
  client_id: o.string(),
2044
3136
  client_secret: o.string().optional(),
2045
3137
  client_id_issued_at: o.number().optional(),
2046
3138
  client_secret_expires_at: o.number().optional()
2047
- }).strip(), St = o.object({
2048
- redirect_uris: o.array(x),
3139
+ }).strip(), G0 = o.object({
3140
+ redirect_uris: o.array(P),
2049
3141
  token_endpoint_auth_method: o.string().optional(),
2050
3142
  grant_types: o.array(o.string()).optional(),
2051
3143
  response_types: o.array(o.string()).optional(),
2052
3144
  client_name: o.string().optional(),
2053
- client_uri: x.optional(),
2054
- logo_uri: x.optional(),
3145
+ client_uri: P.optional(),
3146
+ logo_uri: P.optional(),
2055
3147
  scope: o.string().optional(),
2056
3148
  contacts: o.array(o.string()).optional(),
2057
- tos_uri: x.optional(),
3149
+ tos_uri: P.optional(),
2058
3150
  policy_uri: o.string().optional(),
2059
- jwks_uri: x.optional(),
3151
+ jwks_uri: P.optional(),
2060
3152
  jwks: o.any().optional(),
2061
3153
  software_id: o.string().optional(),
2062
3154
  software_version: o.string().optional(),
2063
3155
  software_statement: o.string().optional()
2064
- }).strip(), Rt = o.object({
3156
+ }).strip(), Y0 = o.object({
2065
3157
  error: o.string(),
2066
3158
  error_description: o.string().optional(),
2067
3159
  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) {
3160
+ }), Q0 = G0.merge(
3161
+ K0
3162
+ ), X0 = "AI_MCPClientOAuthError", wt = `vercel.ai.error.${X0}`, er = Symbol.for(wt), He, Fe, W = class extends (Fe = Y, He = er, Fe) {
2071
3163
  constructor({
2072
3164
  name: r = "MCPClientOAuthError",
2073
3165
  message: e,
2074
3166
  cause: t
2075
3167
  }) {
2076
- super({ name: r, message: e, cause: t }), this[S2] = !0;
3168
+ super({ name: r, message: e, cause: t }), this[He] = !0;
2077
3169
  }
2078
3170
  static isInstance(r) {
2079
- return Z.hasMarker(r, V2);
3171
+ return Y.hasMarker(r, wt);
2080
3172
  }
2081
- }, O = class extends j {
3173
+ }, D = class extends W {
2082
3174
  };
2083
- O.errorCode = "server_error";
2084
- var D = class extends j {
3175
+ D.errorCode = "server_error";
3176
+ var Q = class extends W {
2085
3177
  };
2086
- D.errorCode = "invalid_client";
2087
- var F = class extends j {
3178
+ Q.errorCode = "invalid_client";
3179
+ var X = class extends W {
2088
3180
  };
2089
- F.errorCode = "invalid_grant";
2090
- var B = class extends j {
3181
+ X.errorCode = "invalid_grant";
3182
+ var ee = class extends W {
2091
3183
  };
2092
- B.errorCode = "unauthorized_client";
2093
- var Pt = {
2094
- [O.errorCode]: O,
3184
+ ee.errorCode = "unauthorized_client";
3185
+ var tr = {
2095
3186
  [D.errorCode]: D,
2096
- [F.errorCode]: F,
2097
- [B.errorCode]: B
3187
+ [Q.errorCode]: Q,
3188
+ [X.errorCode]: X,
3189
+ [ee.errorCode]: ee
2098
3190
  };
2099
- function kt(r) {
3191
+ function rr(r) {
2100
3192
  const e = typeof r == "string" ? new URL(r) : new URL(r.href);
2101
3193
  return e.hash = "", e;
2102
3194
  }
2103
- function It({
3195
+ function sr({
2104
3196
  requestedResource: r,
2105
3197
  configuredResource: e
2106
3198
  }) {
2107
3199
  const t = typeof r == "string" ? new URL(r) : new URL(r.href), s = typeof e == "string" ? new URL(e) : new URL(e.href);
2108
3200
  if (t.origin !== s.origin || t.pathname.length < s.pathname.length)
2109
3201
  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);
3202
+ const n = t.pathname.endsWith("/") ? t.pathname : t.pathname + "/", i = s.pathname.endsWith("/") ? s.pathname : s.pathname + "/";
3203
+ return n.startsWith(i);
2112
3204
  }
2113
- var V = class extends Error {
3205
+ var te = class extends Error {
2114
3206
  constructor(r = "Unauthorized") {
2115
3207
  super(r), this.name = "UnauthorizedError";
2116
3208
  }
2117
3209
  };
2118
- function J(r) {
3210
+ function re(r) {
2119
3211
  var e;
2120
3212
  const t = (e = r.headers.get("www-authenticate")) != null ? e : r.headers.get("WWW-Authenticate");
2121
3213
  if (!t)
2122
3214
  return;
2123
- const [s, i] = t.split(" ");
2124
- if (s.toLowerCase() !== "bearer" || !i)
3215
+ const [s, n] = t.split(" ");
3216
+ if (s.toLowerCase() !== "bearer" || !n)
2125
3217
  return;
2126
- const n = /resource_metadata="([^"]*)"/, a = t.match(n);
3218
+ const i = /resource_metadata="([^"]*)"/, a = t.match(i);
2127
3219
  if (a)
2128
3220
  try {
2129
3221
  return new URL(a[1]);
@@ -2131,45 +3223,45 @@ function J(r) {
2131
3223
  return;
2132
3224
  }
2133
3225
  }
2134
- function Ut(r, e = "", t = {}) {
3226
+ function nr(r, e = "", t = {}) {
2135
3227
  return e.endsWith("/") && (e = e.slice(0, -1)), t.prependPathname ? `${e}/.well-known/${r}` : `/.well-known/${r}${e}`;
2136
3228
  }
2137
- async function d2(r, e, t = fetch) {
3229
+ async function Pe(r, e, t = fetch) {
2138
3230
  try {
2139
3231
  return await t(r, { headers: e });
2140
3232
  } catch (s) {
2141
3233
  if (s instanceof TypeError)
2142
- return e ? d2(r, void 0, t) : void 0;
3234
+ return e ? Pe(r, void 0, t) : void 0;
2143
3235
  throw s;
2144
3236
  }
2145
3237
  }
2146
- async function T2(r, e, t = fetch) {
2147
- return await d2(r, {
3238
+ async function Be(r, e, t = fetch) {
3239
+ return await Pe(r, {
2148
3240
  "MCP-Protocol-Version": e
2149
3241
  }, t);
2150
3242
  }
2151
- function At(r, e) {
3243
+ function or(r, e) {
2152
3244
  return !r || r.status >= 400 && r.status < 500 && e !== "/";
2153
3245
  }
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;
3246
+ async function ir(r, e, t, s) {
3247
+ var n, i;
3248
+ const a = new URL(r), l = (n = s?.protocolVersion) != null ? n : H;
3249
+ let u;
2158
3250
  if (s?.metadataUrl)
2159
- h = new URL(s.metadataUrl);
3251
+ u = new URL(s.metadataUrl);
2160
3252
  else {
2161
- const d = Ut(e, a.pathname);
2162
- h = new URL(d, (n = s?.metadataServerUrl) != null ? n : a), h.search = a.search;
3253
+ const d = nr(e, a.pathname);
3254
+ u = new URL(d, (i = s?.metadataServerUrl) != null ? i : a), u.search = a.search;
2163
3255
  }
2164
- let c = await T2(h, l, t);
2165
- if (!s?.metadataUrl && At(c, a.pathname)) {
3256
+ let c = await Be(u, l, t);
3257
+ if (!s?.metadataUrl && or(c, a.pathname)) {
2166
3258
  const d = new URL(`/.well-known/${e}`, a);
2167
- c = await T2(d, l, t);
3259
+ c = await Be(d, l, t);
2168
3260
  }
2169
3261
  return c;
2170
3262
  }
2171
- async function $t(r, e, t = fetch) {
2172
- const s = await Ot(
3263
+ async function ar(r, e, t = fetch) {
3264
+ const s = await ir(
2173
3265
  r,
2174
3266
  "oauth-protected-resource",
2175
3267
  t,
@@ -2186,9 +3278,9 @@ async function $t(r, e, t = fetch) {
2186
3278
  throw new Error(
2187
3279
  `HTTP ${s.status} trying to load well-known OAuth protected resource metadata.`
2188
3280
  );
2189
- return _t.parse(await s.json());
3281
+ return V0.parse(await s.json());
2190
3282
  }
2191
- function qt(r) {
3283
+ function cr(r) {
2192
3284
  const e = typeof r == "string" ? new URL(r) : r, t = e.pathname !== "/", s = [];
2193
3285
  if (!t)
2194
3286
  return s.push({
@@ -2198,10 +3290,10 @@ function qt(r) {
2198
3290
  url: new URL("/.well-known/openid-configuration", e.origin),
2199
3291
  type: "oidc"
2200
3292
  }), s;
2201
- let i = e.pathname;
2202
- return i.endsWith("/") && (i = i.slice(0, -1)), s.push({
3293
+ let n = e.pathname;
3294
+ return n.endsWith("/") && (n = n.slice(0, -1)), s.push({
2203
3295
  url: new URL(
2204
- `/.well-known/oauth-authorization-server${i}`,
3296
+ `/.well-known/oauth-authorization-server${n}`,
2205
3297
  e.origin
2206
3298
  ),
2207
3299
  type: "oauth"
@@ -2209,34 +3301,34 @@ function qt(r) {
2209
3301
  url: new URL("/.well-known/oauth-authorization-server", e.origin),
2210
3302
  type: "oauth"
2211
3303
  }), s.push({
2212
- url: new URL(`/.well-known/openid-configuration${i}`, e.origin),
3304
+ url: new URL(`/.well-known/openid-configuration${n}`, e.origin),
2213
3305
  type: "oidc"
2214
3306
  }), s.push({
2215
- url: new URL(`${i}/.well-known/openid-configuration`, e.origin),
3307
+ url: new URL(`${n}/.well-known/openid-configuration`, e.origin),
2216
3308
  type: "oidc"
2217
3309
  }), s;
2218
3310
  }
2219
- async function jt(r, {
3311
+ async function lr(r, {
2220
3312
  fetchFn: e = fetch,
2221
- protocolVersion: t = $
3313
+ protocolVersion: t = H
2222
3314
  } = {}) {
2223
3315
  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)
3316
+ const n = { "MCP-Protocol-Version": t }, i = cr(r);
3317
+ for (const { url: a, type: l } of i) {
3318
+ const u = await Pe(a, n, e);
3319
+ if (u) {
3320
+ if (!u.ok) {
3321
+ if (u.status >= 400 && u.status < 500)
2230
3322
  continue;
2231
3323
  throw new Error(
2232
- `HTTP ${h.status} trying to load ${l === "oauth" ? "OAuth" : "OpenID provider"} metadata from ${a}`
3324
+ `HTTP ${u.status} trying to load ${l === "oauth" ? "OAuth" : "OpenID provider"} metadata from ${a}`
2233
3325
  );
2234
3326
  }
2235
3327
  if (l === "oauth")
2236
- return B2.parse(await h.json());
3328
+ return Ct.parse(await u.json());
2237
3329
  {
2238
- const c = xt.parse(
2239
- await h.json()
3330
+ const c = W0.parse(
3331
+ await u.json()
2240
3332
  );
2241
3333
  if (!((s = c.code_challenge_methods_supported) != null && s.includes("S256")))
2242
3334
  throw new Error(
@@ -2247,54 +3339,54 @@ async function jt(r, {
2247
3339
  }
2248
3340
  }
2249
3341
  }
2250
- async function Ht(r, {
3342
+ async function ur(r, {
2251
3343
  metadata: e,
2252
3344
  clientInformation: t,
2253
3345
  redirectUrl: s,
2254
- scope: i,
2255
- state: n,
3346
+ scope: n,
3347
+ state: i,
2256
3348
  resource: a
2257
3349
  }) {
2258
- const l = "code", h = "S256";
3350
+ const l = "code", u = "S256";
2259
3351
  let c;
2260
3352
  if (e) {
2261
3353
  if (c = new URL(e.authorization_endpoint), !e.response_types_supported.includes(l))
2262
3354
  throw new Error(
2263
3355
  `Incompatible auth server: does not support response type ${l}`
2264
3356
  );
2265
- if (!e.code_challenge_methods_supported || !e.code_challenge_methods_supported.includes(h))
3357
+ if (!e.code_challenge_methods_supported || !e.code_challenge_methods_supported.includes(u))
2266
3358
  throw new Error(
2267
- `Incompatible auth server: does not support code challenge method ${h}`
3359
+ `Incompatible auth server: does not support code challenge method ${u}`
2268
3360
  );
2269
3361
  } else
2270
3362
  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(
3363
+ const d = await w0(), g = d.code_verifier, h = d.code_challenge;
3364
+ return c.searchParams.set("response_type", l), c.searchParams.set("client_id", t.client_id), c.searchParams.set("code_challenge", h), c.searchParams.set(
2273
3365
  "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 };
3366
+ u
3367
+ ), c.searchParams.set("redirect_uri", String(s)), i && c.searchParams.set("state", i), n && c.searchParams.set("scope", n), n?.includes("offline_access") && c.searchParams.append("prompt", "consent"), a && c.searchParams.set("resource", a.href), { authorizationUrl: c, codeVerifier: g };
2276
3368
  }
2277
- function J2(r, e) {
3369
+ function vt(r, e) {
2278
3370
  const t = r.client_secret !== void 0;
2279
3371
  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
3372
  }
2281
- function W2(r, e, t, s) {
2282
- const { client_id: i, client_secret: n } = e;
3373
+ function _t(r, e, t, s) {
3374
+ const { client_id: n, client_secret: i } = e;
2283
3375
  switch (r) {
2284
3376
  case "client_secret_basic":
2285
- Nt(i, n, t);
3377
+ dr(n, i, t);
2286
3378
  return;
2287
3379
  case "client_secret_post":
2288
- zt(i, n, s);
3380
+ hr(n, i, s);
2289
3381
  return;
2290
3382
  case "none":
2291
- Zt(i, s);
3383
+ pr(n, s);
2292
3384
  return;
2293
3385
  default:
2294
3386
  throw new Error(`Unsupported client authentication method: ${r}`);
2295
3387
  }
2296
3388
  }
2297
- function Nt(r, e, t) {
3389
+ function dr(r, e, t) {
2298
3390
  if (!e)
2299
3391
  throw new Error(
2300
3392
  "client_secret_basic authentication requires a client_secret"
@@ -2302,34 +3394,34 @@ function Nt(r, e, t) {
2302
3394
  const s = btoa(`${r}:${e}`);
2303
3395
  t.set("Authorization", `Basic ${s}`);
2304
3396
  }
2305
- function zt(r, e, t) {
3397
+ function hr(r, e, t) {
2306
3398
  t.set("client_id", r), e && t.set("client_secret", e);
2307
3399
  }
2308
- function Zt(r, e) {
3400
+ function pr(r, e) {
2309
3401
  e.set("client_id", r);
2310
3402
  }
2311
- async function p2(r) {
3403
+ async function ke(r) {
2312
3404
  const e = r instanceof Response ? r.status : void 0, t = r instanceof Response ? await r.text() : r;
2313
3405
  try {
2314
- const s = Rt.parse(JSON.parse(t)), { error: i, error_description: n, error_uri: a } = s, l = Pt[i] || O;
3406
+ const s = Y0.parse(JSON.parse(t)), { error: n, error_description: i, error_uri: a } = s, l = tr[n] || D;
2315
3407
  return new l({
2316
- message: n || "",
3408
+ message: i || "",
2317
3409
  cause: a
2318
3410
  });
2319
3411
  } catch (s) {
2320
- const i = `${e ? `HTTP ${e}: ` : ""}Invalid OAuth error response: ${s}. Raw body: ${t}`;
2321
- return new O({ message: i });
3412
+ const n = `${e ? `HTTP ${e}: ` : ""}Invalid OAuth error response: ${s}. Raw body: ${t}`;
3413
+ return new D({ message: n });
2322
3414
  }
2323
3415
  }
2324
- async function Dt(r, {
3416
+ async function mr(r, {
2325
3417
  metadata: e,
2326
3418
  clientInformation: t,
2327
3419
  authorizationCode: s,
2328
- codeVerifier: i,
2329
- redirectUri: n,
3420
+ codeVerifier: n,
3421
+ redirectUri: i,
2330
3422
  resource: a,
2331
3423
  addClientAuthentication: l,
2332
- fetchFn: h
3424
+ fetchFn: u
2333
3425
  }) {
2334
3426
  var c;
2335
3427
  const d = "authorization_code", g = e?.token_endpoint ? new URL(e.token_endpoint) : new URL("/token", r);
@@ -2337,126 +3429,127 @@ async function Dt(r, {
2337
3429
  throw new Error(
2338
3430
  `Incompatible auth server: does not support grant type ${d}`
2339
3431
  );
2340
- const p = new Headers({
3432
+ const h = new Headers({
2341
3433
  "Content-Type": "application/x-www-form-urlencoded",
2342
3434
  Accept: "application/json"
2343
- }), C = new URLSearchParams({
3435
+ }), m = new URLSearchParams({
2344
3436
  grant_type: d,
2345
3437
  code: s,
2346
- code_verifier: i,
2347
- redirect_uri: String(n)
3438
+ code_verifier: n,
3439
+ redirect_uri: String(i)
2348
3440
  });
2349
3441
  if (l)
2350
- l(p, C, r, e);
3442
+ l(h, m, r, e);
2351
3443
  else {
2352
- const u = (c = e?.token_endpoint_auth_methods_supported) != null ? c : [], m = J2(
3444
+ const p = (c = e?.token_endpoint_auth_methods_supported) != null ? c : [], w = vt(
2353
3445
  t,
2354
- u
3446
+ p
2355
3447
  );
2356
- W2(m, t, p, C);
3448
+ _t(w, t, h, m);
2357
3449
  }
2358
- a && C.set("resource", a.href);
2359
- const f = await (h ?? fetch)(g, {
3450
+ a && m.set("resource", a.href);
3451
+ const C = await (u ?? fetch)(g, {
2360
3452
  method: "POST",
2361
- headers: p,
2362
- body: C
3453
+ headers: h,
3454
+ body: m
2363
3455
  });
2364
- if (!f.ok)
2365
- throw await p2(f);
2366
- return F2.parse(await f.json());
3456
+ if (!C.ok)
3457
+ throw await ke(C);
3458
+ return yt.parse(await C.json());
2367
3459
  }
2368
- async function Ft(r, {
3460
+ async function fr(r, {
2369
3461
  metadata: e,
2370
3462
  clientInformation: t,
2371
3463
  refreshToken: s,
2372
- resource: i,
2373
- addClientAuthentication: n,
3464
+ resource: n,
3465
+ addClientAuthentication: i,
2374
3466
  fetchFn: a
2375
3467
  }) {
2376
3468
  var l;
2377
- const h = "refresh_token";
3469
+ const u = "refresh_token";
2378
3470
  let c;
2379
3471
  if (e) {
2380
- if (c = new URL(e.token_endpoint), e.grant_types_supported && !e.grant_types_supported.includes(h))
3472
+ if (c = new URL(e.token_endpoint), e.grant_types_supported && !e.grant_types_supported.includes(u))
2381
3473
  throw new Error(
2382
- `Incompatible auth server: does not support grant type ${h}`
3474
+ `Incompatible auth server: does not support grant type ${u}`
2383
3475
  );
2384
3476
  } else
2385
3477
  c = new URL("/token", r);
2386
3478
  const d = new Headers({
2387
- "Content-Type": "application/x-www-form-urlencoded"
3479
+ "Content-Type": "application/x-www-form-urlencoded",
3480
+ Accept: "application/json"
2388
3481
  }), g = new URLSearchParams({
2389
- grant_type: h,
3482
+ grant_type: u,
2390
3483
  refresh_token: s
2391
3484
  });
2392
- if (n)
2393
- n(d, g, r, e);
3485
+ if (i)
3486
+ i(d, g, r, e);
2394
3487
  else {
2395
- const C = (l = e?.token_endpoint_auth_methods_supported) != null ? l : [], f = J2(
3488
+ const m = (l = e?.token_endpoint_auth_methods_supported) != null ? l : [], C = vt(
2396
3489
  t,
2397
- C
3490
+ m
2398
3491
  );
2399
- W2(f, t, d, g);
3492
+ _t(C, t, d, g);
2400
3493
  }
2401
- i && g.set("resource", i.href);
2402
- const p = await (a ?? fetch)(c, {
3494
+ n && g.set("resource", n.href);
3495
+ const h = await (a ?? fetch)(c, {
2403
3496
  method: "POST",
2404
3497
  headers: d,
2405
3498
  body: g
2406
3499
  });
2407
- if (!p.ok)
2408
- throw await p2(p);
2409
- return F2.parse({
3500
+ if (!h.ok)
3501
+ throw await ke(h);
3502
+ return yt.parse({
2410
3503
  refresh_token: s,
2411
- ...await p.json()
3504
+ ...await h.json()
2412
3505
  });
2413
3506
  }
2414
- async function Bt(r, {
3507
+ async function gr(r, {
2415
3508
  metadata: e,
2416
3509
  clientMetadata: t,
2417
3510
  fetchFn: s
2418
3511
  }) {
2419
- let i;
3512
+ let n;
2420
3513
  if (e) {
2421
3514
  if (!e.registration_endpoint)
2422
3515
  throw new Error(
2423
3516
  "Incompatible auth server: does not support dynamic client registration"
2424
3517
  );
2425
- i = new URL(e.registration_endpoint);
3518
+ n = new URL(e.registration_endpoint);
2426
3519
  } else
2427
- i = new URL("/register", r);
2428
- const n = await (s ?? fetch)(i, {
3520
+ n = new URL("/register", r);
3521
+ const i = await (s ?? fetch)(n, {
2429
3522
  method: "POST",
2430
3523
  headers: {
2431
3524
  "Content-Type": "application/json"
2432
3525
  },
2433
3526
  body: JSON.stringify(t)
2434
3527
  });
2435
- if (!n.ok)
2436
- throw await p2(n);
2437
- return Tt.parse(await n.json());
3528
+ if (!i.ok)
3529
+ throw await ke(i);
3530
+ return Q0.parse(await i.json());
2438
3531
  }
2439
- async function W(r, e) {
3532
+ async function se(r, e) {
2440
3533
  var t, s;
2441
3534
  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;
3535
+ return await he(r, e);
3536
+ } catch (n) {
3537
+ if (n instanceof Q || n instanceof ee)
3538
+ return await ((t = r.invalidateCredentials) == null ? void 0 : t.call(r, "all")), await he(r, e);
3539
+ if (n instanceof X)
3540
+ return await ((s = r.invalidateCredentials) == null ? void 0 : s.call(r, "tokens")), await he(r, e);
3541
+ throw n;
2449
3542
  }
2450
3543
  }
2451
- async function Vt(r, e, t) {
2452
- const s = kt(r);
3544
+ async function yr(r, e, t) {
3545
+ const s = rr(r);
2453
3546
  if (e.validateResourceURL)
2454
3547
  return await e.validateResourceURL(
2455
3548
  s,
2456
3549
  t?.resource
2457
3550
  );
2458
3551
  if (t) {
2459
- if (!It({
3552
+ if (!sr({
2460
3553
  requestedResource: s,
2461
3554
  configuredResource: t.resource
2462
3555
  }))
@@ -2466,31 +3559,31 @@ async function Vt(r, e, t) {
2466
3559
  return new URL(t.resource);
2467
3560
  }
2468
3561
  }
2469
- async function t2(r, {
3562
+ async function he(r, {
2470
3563
  serverUrl: e,
2471
3564
  authorizationCode: t,
2472
3565
  scope: s,
2473
- resourceMetadataUrl: i,
2474
- fetchFn: n
3566
+ resourceMetadataUrl: n,
3567
+ fetchFn: i
2475
3568
  }) {
2476
3569
  let a, l;
2477
3570
  try {
2478
- a = await $t(
3571
+ a = await ar(
2479
3572
  e,
2480
- { resourceMetadataUrl: i },
2481
- n
3573
+ { resourceMetadataUrl: n },
3574
+ i
2482
3575
  ), a.authorization_servers && a.authorization_servers.length > 0 && (l = a.authorization_servers[0]);
2483
3576
  } catch {
2484
3577
  }
2485
3578
  l || (l = e);
2486
- const h = await Vt(
3579
+ const u = await yr(
2487
3580
  e,
2488
3581
  r,
2489
3582
  a
2490
- ), c = await jt(
3583
+ ), c = await lr(
2491
3584
  l,
2492
3585
  {
2493
- fetchFn: n
3586
+ fetchFn: i
2494
3587
  }
2495
3588
  );
2496
3589
  let d = await Promise.resolve(r.clientInformation());
@@ -2503,58 +3596,58 @@ async function t2(r, {
2503
3596
  throw new Error(
2504
3597
  "OAuth client information must be saveable for dynamic registration"
2505
3598
  );
2506
- const u = await Bt(l, {
3599
+ const p = await gr(l, {
2507
3600
  metadata: c,
2508
3601
  clientMetadata: r.clientMetadata,
2509
- fetchFn: n
3602
+ fetchFn: i
2510
3603
  });
2511
- await r.saveClientInformation(u), d = u;
3604
+ await r.saveClientInformation(p), d = p;
2512
3605
  }
2513
3606
  if (t !== void 0) {
2514
- const u = await r.codeVerifier(), m = await Dt(l, {
3607
+ const p = await r.codeVerifier(), w = await mr(l, {
2515
3608
  metadata: c,
2516
3609
  clientInformation: d,
2517
3610
  authorizationCode: t,
2518
- codeVerifier: u,
3611
+ codeVerifier: p,
2519
3612
  redirectUri: r.redirectUrl,
2520
- resource: h,
3613
+ resource: u,
2521
3614
  addClientAuthentication: r.addClientAuthentication,
2522
- fetchFn: n
3615
+ fetchFn: i
2523
3616
  });
2524
- return await r.saveTokens(m), "AUTHORIZED";
3617
+ return await r.saveTokens(w), "AUTHORIZED";
2525
3618
  }
2526
3619
  const g = await r.tokens();
2527
3620
  if (g?.refresh_token)
2528
3621
  try {
2529
- const u = await Ft(l, {
3622
+ const p = await fr(l, {
2530
3623
  metadata: c,
2531
3624
  clientInformation: d,
2532
3625
  refreshToken: g.refresh_token,
2533
- resource: h,
3626
+ resource: u,
2534
3627
  addClientAuthentication: r.addClientAuthentication,
2535
- fetchFn: n
3628
+ fetchFn: i
2536
3629
  });
2537
- return await r.saveTokens(u), "AUTHORIZED";
2538
- } catch (u) {
3630
+ return await r.saveTokens(p), "AUTHORIZED";
3631
+ } catch (p) {
2539
3632
  if (
2540
3633
  // 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;
3634
+ !(!(p instanceof W) || p instanceof D)
3635
+ ) throw p;
2543
3636
  }
2544
- const p = r.state ? await r.state() : void 0, { authorizationUrl: C, codeVerifier: f } = await Ht(
3637
+ const h = r.state ? await r.state() : void 0, { authorizationUrl: m, codeVerifier: C } = await ur(
2545
3638
  l,
2546
3639
  {
2547
3640
  metadata: c,
2548
3641
  clientInformation: d,
2549
- state: p,
3642
+ state: h,
2550
3643
  redirectUrl: r.redirectUrl,
2551
3644
  scope: s || r.clientMetadata.scope,
2552
- resource: h
3645
+ resource: u
2553
3646
  }
2554
3647
  );
2555
- return await r.saveCodeVerifier(f), await r.redirectToAuthorization(C), "REDIRECT";
3648
+ return await r.saveCodeVerifier(C), await r.redirectToAuthorization(m), "REDIRECT";
2556
3649
  }
2557
- var Jt = class {
3650
+ var Cr = class {
2558
3651
  constructor({
2559
3652
  url: r,
2560
3653
  headers: e,
@@ -2566,16 +3659,16 @@ var Jt = class {
2566
3659
  const e = {
2567
3660
  ...this.headers,
2568
3661
  ...r,
2569
- "mcp-protocol-version": $
3662
+ "mcp-protocol-version": H
2570
3663
  };
2571
3664
  if (this.authProvider) {
2572
3665
  const t = await this.authProvider.tokens();
2573
3666
  t?.access_token && (e.Authorization = `Bearer ${t.access_token}`);
2574
3667
  }
2575
- return U2(
3668
+ return et(
2576
3669
  e,
2577
- `ai-sdk/${D2}`,
2578
- I2()
3670
+ `ai-sdk/${gt}`,
3671
+ Xe()
2579
3672
  );
2580
3673
  }
2581
3674
  async start() {
@@ -2584,83 +3677,83 @@ var Jt = class {
2584
3677
  return r();
2585
3678
  this.abortController = new AbortController();
2586
3679
  const t = async (s = !1) => {
2587
- var i, n, a, l, h;
3680
+ var n, i, a, l, u;
2588
3681
  try {
2589
3682
  const c = await this.commonHeaders({
2590
3683
  Accept: "text/event-stream"
2591
3684
  }), d = await fetch(this.url.href, {
2592
3685
  headers: c,
2593
- signal: (i = this.abortController) == null ? void 0 : i.signal
3686
+ signal: (n = this.abortController) == null ? void 0 : n.signal
2594
3687
  });
2595
3688
  if (d.status === 401 && this.authProvider && !s) {
2596
- this.resourceMetadataUrl = J(d);
3689
+ this.resourceMetadataUrl = re(d);
2597
3690
  try {
2598
- if (await W(this.authProvider, {
3691
+ if (await se(this.authProvider, {
2599
3692
  serverUrl: this.url,
2600
3693
  resourceMetadataUrl: this.resourceMetadataUrl
2601
3694
  }) !== "AUTHORIZED") {
2602
- const u = new V();
2603
- return (n = this.onerror) == null || n.call(this, u), e(u);
3695
+ const p = new te();
3696
+ return (i = this.onerror) == null || i.call(this, p), e(p);
2604
3697
  }
2605
- } catch (f) {
2606
- return (a = this.onerror) == null || a.call(this, f), e(f);
3698
+ } catch (C) {
3699
+ return (a = this.onerror) == null || a.call(this, C), e(C);
2607
3700
  }
2608
3701
  return t(!0);
2609
3702
  }
2610
3703
  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
3704
+ let C = `MCP SSE Transport Error: ${d.status} ${d.statusText}`;
3705
+ d.status === 405 && (C += ". This server does not support SSE transport. Try using `http` transport instead");
3706
+ const p = new v({
3707
+ message: C
2615
3708
  });
2616
- return (l = this.onerror) == null || l.call(this, u), e(u);
3709
+ return (l = this.onerror) == null || l.call(this, p), e(p);
2617
3710
  }
2618
- const p = d.body.pipeThrough(new TextDecoderStream()).pipeThrough(new o2()).getReader(), C = async () => {
2619
- var f, u, m;
3711
+ const h = d.body.pipeThrough(new TextDecoderStream()).pipeThrough(new ge()).getReader(), m = async () => {
3712
+ var C, p, w;
2620
3713
  try {
2621
3714
  for (; ; ) {
2622
- const { done: w, value: v } = await p.read();
2623
- if (w) {
3715
+ const { done: y, value: b } = await h.read();
3716
+ if (y) {
2624
3717
  if (this.connected)
2625
- throw this.connected = !1, new y({
3718
+ throw this.connected = !1, new v({
2626
3719
  message: "MCP SSE Transport Error: Connection closed unexpectedly"
2627
3720
  });
2628
3721
  return;
2629
3722
  }
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({
3723
+ const { event: x, data: M } = b;
3724
+ if (x === "endpoint") {
3725
+ if (this.endpoint = new URL(M, this.url), this.endpoint.origin !== this.url.origin)
3726
+ throw new v({
2634
3727
  message: `MCP SSE Transport Error: Endpoint origin does not match connection origin: ${this.endpoint.origin}`
2635
3728
  });
2636
3729
  this.connected = !0, r();
2637
- } else if (_ === "message")
3730
+ } else if (x === "message")
2638
3731
  try {
2639
- const L = q.parse(
2640
- JSON.parse(S)
3732
+ const k = V.parse(
3733
+ JSON.parse(M)
2641
3734
  );
2642
- (f = this.onmessage) == null || f.call(this, L);
2643
- } catch (L) {
2644
- const b = new y({
3735
+ (C = this.onmessage) == null || C.call(this, k);
3736
+ } catch (k) {
3737
+ const R = new v({
2645
3738
  message: "MCP SSE Transport Error: Failed to parse message",
2646
- cause: L
3739
+ cause: k
2647
3740
  });
2648
- (u = this.onerror) == null || u.call(this, b);
3741
+ (p = this.onerror) == null || p.call(this, R);
2649
3742
  }
2650
3743
  }
2651
- } catch (w) {
2652
- if (w instanceof Error && w.name === "AbortError")
3744
+ } catch (y) {
3745
+ if (y instanceof Error && y.name === "AbortError")
2653
3746
  return;
2654
- (m = this.onerror) == null || m.call(this, w), e(w);
3747
+ (w = this.onerror) == null || w.call(this, y), e(y);
2655
3748
  }
2656
3749
  };
2657
3750
  this.sseConnection = {
2658
- close: () => p.cancel()
2659
- }, C();
3751
+ close: () => h.cancel()
3752
+ }, m();
2660
3753
  } catch (c) {
2661
3754
  if (c instanceof Error && c.name === "AbortError")
2662
3755
  return;
2663
- (h = this.onerror) == null || h.call(this, c), e(c);
3756
+ (u = this.onerror) == null || u.call(this, c), e(c);
2664
3757
  }
2665
3758
  };
2666
3759
  t();
@@ -2672,11 +3765,11 @@ var Jt = class {
2672
3765
  }
2673
3766
  async send(r) {
2674
3767
  if (!this.endpoint || !this.connected)
2675
- throw new y({
3768
+ throw new v({
2676
3769
  message: "MCP SSE Transport Error: Not connected"
2677
3770
  });
2678
3771
  const e = this.endpoint, t = async (s = !1) => {
2679
- var i, n, a, l, h;
3772
+ var n, i, a, l, u;
2680
3773
  try {
2681
3774
  const d = {
2682
3775
  method: "POST",
@@ -2684,40 +3777,40 @@ var Jt = class {
2684
3777
  "Content-Type": "application/json"
2685
3778
  }),
2686
3779
  body: JSON.stringify(r),
2687
- signal: (i = this.abortController) == null ? void 0 : i.signal
3780
+ signal: (n = this.abortController) == null ? void 0 : n.signal
2688
3781
  }, g = await fetch(e, d);
2689
3782
  if (g.status === 401 && this.authProvider && !s) {
2690
- this.resourceMetadataUrl = J(g);
3783
+ this.resourceMetadataUrl = re(g);
2691
3784
  try {
2692
- if (await W(this.authProvider, {
3785
+ if (await se(this.authProvider, {
2693
3786
  serverUrl: this.url,
2694
3787
  resourceMetadataUrl: this.resourceMetadataUrl
2695
3788
  }) !== "AUTHORIZED") {
2696
- const C = new V();
2697
- (n = this.onerror) == null || n.call(this, C);
3789
+ const m = new te();
3790
+ (i = this.onerror) == null || i.call(this, m);
2698
3791
  return;
2699
3792
  }
2700
- } catch (p) {
2701
- (a = this.onerror) == null || a.call(this, p);
3793
+ } catch (h) {
3794
+ (a = this.onerror) == null || a.call(this, h);
2702
3795
  return;
2703
3796
  }
2704
3797
  return t(!0);
2705
3798
  }
2706
3799
  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}`
3800
+ const h = await g.text().catch(() => null), m = new v({
3801
+ message: `MCP SSE Transport Error: POSTing to endpoint (HTTP ${g.status}): ${h}`
2709
3802
  });
2710
- (l = this.onerror) == null || l.call(this, C);
3803
+ (l = this.onerror) == null || l.call(this, m);
2711
3804
  return;
2712
3805
  }
2713
3806
  } catch (c) {
2714
- (h = this.onerror) == null || h.call(this, c);
3807
+ (u = this.onerror) == null || u.call(this, c);
2715
3808
  return;
2716
3809
  }
2717
3810
  };
2718
3811
  await t();
2719
3812
  }
2720
- }, Wt = class {
3813
+ }, wr = class {
2721
3814
  constructor({
2722
3815
  url: r,
2723
3816
  headers: e,
@@ -2734,21 +3827,21 @@ var Jt = class {
2734
3827
  const e = {
2735
3828
  ...this.headers,
2736
3829
  ...r,
2737
- "mcp-protocol-version": $
3830
+ "mcp-protocol-version": H
2738
3831
  };
2739
3832
  if (this.sessionId && (e["mcp-session-id"] = this.sessionId), this.authProvider) {
2740
3833
  const t = await this.authProvider.tokens();
2741
3834
  t?.access_token && (e.Authorization = `Bearer ${t.access_token}`);
2742
3835
  }
2743
- return U2(
3836
+ return et(
2744
3837
  e,
2745
- `ai-sdk/${D2}`,
2746
- I2()
3838
+ `ai-sdk/${gt}`,
3839
+ Xe()
2747
3840
  );
2748
3841
  }
2749
3842
  async start() {
2750
3843
  if (this.abortController)
2751
- throw new y({
3844
+ throw new v({
2752
3845
  message: "MCP HTTP Transport Error: Transport already started. Note: client.connect() calls start() automatically."
2753
3846
  });
2754
3847
  this.abortController = new AbortController(), this.openInboundSse();
@@ -2772,7 +3865,7 @@ var Jt = class {
2772
3865
  }
2773
3866
  async send(r) {
2774
3867
  const e = async (t = !1) => {
2775
- var s, i, n, a, l, h, c;
3868
+ var s, n, i, a, l, u, c;
2776
3869
  try {
2777
3870
  const g = {
2778
3871
  method: "POST",
@@ -2782,78 +3875,80 @@ var Jt = class {
2782
3875
  }),
2783
3876
  body: JSON.stringify(r),
2784
3877
  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);
3878
+ }, h = await fetch(this.url, g), m = h.headers.get("mcp-session-id");
3879
+ if (m && (this.sessionId = m), h.status === 401 && this.authProvider && !t) {
3880
+ this.resourceMetadataUrl = re(h);
2788
3881
  try {
2789
- if (await W(this.authProvider, {
3882
+ if (await se(this.authProvider, {
2790
3883
  serverUrl: this.url,
2791
3884
  resourceMetadataUrl: this.resourceMetadataUrl
2792
3885
  }) !== "AUTHORIZED")
2793
- throw new V();
2794
- } catch (m) {
2795
- throw (i = this.onerror) == null || i.call(this, m), m;
3886
+ throw new te();
3887
+ } catch (y) {
3888
+ throw (n = this.onerror) == null || n.call(this, y), y;
2796
3889
  }
2797
3890
  return e(!0);
2798
3891
  }
2799
- if (p.status === 202) {
3892
+ if (h.status === 202) {
2800
3893
  this.inboundSseConnection || this.openInboundSse();
2801
3894
  return;
2802
3895
  }
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
3896
+ if (!h.ok) {
3897
+ const y = await h.text().catch(() => null);
3898
+ let b = `MCP HTTP Transport Error: POSTing to endpoint (HTTP ${h.status}): ${y}`;
3899
+ h.status === 404 && (b += ". This server does not support HTTP transport. Try using `sse` transport instead");
3900
+ const x = new v({
3901
+ message: b
2809
3902
  });
2810
- throw (n = this.onerror) == null || n.call(this, v), v;
3903
+ throw (i = this.onerror) == null || i.call(this, x), x;
2811
3904
  }
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);
3905
+ if (!("id" in r))
3906
+ return;
3907
+ const p = h.headers.get("content-type") || "";
3908
+ if (p.includes("application/json")) {
3909
+ const y = await h.json(), b = Array.isArray(y) ? y.map((x) => V.parse(x)) : [V.parse(y)];
3910
+ for (const x of b) (a = this.onmessage) == null || a.call(this, x);
2816
3911
  return;
2817
3912
  }
2818
- if (f.includes("text/event-stream")) {
2819
- if (!p.body) {
2820
- const _ = new y({
3913
+ if (p.includes("text/event-stream")) {
3914
+ if (!h.body) {
3915
+ const M = new v({
2821
3916
  message: "MCP HTTP Transport Error: text/event-stream response without body"
2822
3917
  });
2823
- throw (l = this.onerror) == null || l.call(this, _), _;
3918
+ throw (l = this.onerror) == null || l.call(this, M), M;
2824
3919
  }
2825
- const w = p.body.pipeThrough(new TextDecoderStream()).pipeThrough(new o2()).getReader();
3920
+ const b = h.body.pipeThrough(new TextDecoderStream()).pipeThrough(new ge()).getReader();
2826
3921
  (async () => {
2827
- var _, S, L;
3922
+ var M, k, R;
2828
3923
  try {
2829
3924
  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")
3925
+ const { done: E, value: q } = await b.read();
3926
+ if (E) return;
3927
+ const { event: I, data: j } = q;
3928
+ if (I === "message")
2834
3929
  try {
2835
- const P = q.parse(JSON.parse(R));
2836
- (_ = this.onmessage) == null || _.call(this, P);
2837
- } catch (P) {
2838
- const Q = new y({
3930
+ const F = V.parse(JSON.parse(j));
3931
+ (M = this.onmessage) == null || M.call(this, F);
3932
+ } catch (F) {
3933
+ const A = new v({
2839
3934
  message: "MCP HTTP Transport Error: Failed to parse message",
2840
- cause: P
3935
+ cause: F
2841
3936
  });
2842
- (S = this.onerror) == null || S.call(this, Q);
3937
+ (k = this.onerror) == null || k.call(this, A);
2843
3938
  }
2844
3939
  }
2845
- } catch (b) {
2846
- if (b instanceof Error && b.name === "AbortError")
3940
+ } catch (E) {
3941
+ if (E instanceof Error && E.name === "AbortError")
2847
3942
  return;
2848
- (L = this.onerror) == null || L.call(this, b);
3943
+ (R = this.onerror) == null || R.call(this, E);
2849
3944
  }
2850
3945
  })();
2851
3946
  return;
2852
3947
  }
2853
- const u = new y({
2854
- message: `MCP HTTP Transport Error: Unexpected content type: ${f}`
3948
+ const w = new v({
3949
+ message: `MCP HTTP Transport Error: Unexpected content type: ${p}`
2855
3950
  });
2856
- throw (h = this.onerror) == null || h.call(this, u), u;
3951
+ throw (u = this.onerror) == null || u.call(this, w), w;
2857
3952
  } catch (d) {
2858
3953
  throw (c = this.onerror) == null || c.call(this, d), d;
2859
3954
  }
@@ -2877,7 +3972,7 @@ var Jt = class {
2877
3972
  if (e > 0 && this.inboundReconnectAttempts >= e) {
2878
3973
  (r = this.onerror) == null || r.call(
2879
3974
  this,
2880
- new y({
3975
+ new v({
2881
3976
  message: `MCP HTTP Transport Error: Maximum reconnection attempts (${e}) exceeded.`
2882
3977
  })
2883
3978
  );
@@ -2891,30 +3986,30 @@ var Jt = class {
2891
3986
  }
2892
3987
  // Open optional inbound SSE stream; best-effort and resumable
2893
3988
  async openInboundSse(r = !1, e) {
2894
- var t, s, i, n, a, l;
3989
+ var t, s, n, i, a, l;
2895
3990
  try {
2896
- const h = await this.commonHeaders({
3991
+ const u = await this.commonHeaders({
2897
3992
  Accept: "text/event-stream"
2898
3993
  });
2899
- e && (h["last-event-id"] = e);
3994
+ e && (u["last-event-id"] = e);
2900
3995
  const c = await fetch(this.url.href, {
2901
3996
  method: "GET",
2902
- headers: h,
3997
+ headers: u,
2903
3998
  signal: (t = this.abortController) == null ? void 0 : t.signal
2904
3999
  }), d = c.headers.get("mcp-session-id");
2905
4000
  if (d && (this.sessionId = d), c.status === 401 && this.authProvider && !r) {
2906
- this.resourceMetadataUrl = J(c);
4001
+ this.resourceMetadataUrl = re(c);
2907
4002
  try {
2908
- if (await W(this.authProvider, {
4003
+ if (await se(this.authProvider, {
2909
4004
  serverUrl: this.url,
2910
4005
  resourceMetadataUrl: this.resourceMetadataUrl
2911
4006
  }) !== "AUTHORIZED") {
2912
- const u = new V();
2913
- (s = this.onerror) == null || s.call(this, u);
4007
+ const p = new te();
4008
+ (s = this.onerror) == null || s.call(this, p);
2914
4009
  return;
2915
4010
  }
2916
- } catch (f) {
2917
- (i = this.onerror) == null || i.call(this, f);
4011
+ } catch (C) {
4012
+ (n = this.onerror) == null || n.call(this, C);
2918
4013
  return;
2919
4014
  }
2920
4015
  return this.openInboundSse(!0, e);
@@ -2922,85 +4017,97 @@ var Jt = class {
2922
4017
  if (c.status === 405)
2923
4018
  return;
2924
4019
  if (!c.ok || !c.body) {
2925
- const f = new y({
4020
+ const C = new v({
2926
4021
  message: `MCP HTTP Transport Error: GET SSE failed: ${c.status} ${c.statusText}`
2927
4022
  });
2928
- (n = this.onerror) == null || n.call(this, f);
4023
+ (i = this.onerror) == null || i.call(this, C);
2929
4024
  return;
2930
4025
  }
2931
- const p = c.body.pipeThrough(new TextDecoderStream()).pipeThrough(new o2()).getReader(), C = async () => {
2932
- var f, u, m, w;
4026
+ const h = c.body.pipeThrough(new TextDecoderStream()).pipeThrough(new ge()).getReader(), m = async () => {
4027
+ var C, p, w, y;
2933
4028
  try {
2934
4029
  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")
4030
+ const { done: b, value: x } = await h.read();
4031
+ if (b) return;
4032
+ const { event: M, data: k, id: R } = x;
4033
+ if (R && (this.lastInboundEventId = R), M === "message")
2939
4034
  try {
2940
- const E = q.parse(JSON.parse(L));
2941
- (f = this.onmessage) == null || f.call(this, E);
4035
+ const E = V.parse(JSON.parse(k));
4036
+ (C = this.onmessage) == null || C.call(this, E);
2942
4037
  } catch (E) {
2943
- const U = new y({
4038
+ const q = new v({
2944
4039
  message: "MCP HTTP Transport Error: Failed to parse message",
2945
4040
  cause: E
2946
4041
  });
2947
- (u = this.onerror) == null || u.call(this, U);
4042
+ (p = this.onerror) == null || p.call(this, q);
2948
4043
  }
2949
4044
  }
2950
- } catch (v) {
2951
- if (v instanceof Error && v.name === "AbortError")
4045
+ } catch (b) {
4046
+ if (b instanceof Error && b.name === "AbortError")
2952
4047
  return;
2953
- (m = this.onerror) == null || m.call(this, v), (w = this.abortController) != null && w.signal.aborted || this.scheduleInboundSseReconnection();
4048
+ (w = this.onerror) == null || w.call(this, b), (y = this.abortController) != null && y.signal.aborted || this.scheduleInboundSseReconnection();
2954
4049
  }
2955
4050
  };
2956
4051
  this.inboundSseConnection = {
2957
- close: () => p.cancel()
2958
- }, this.inboundReconnectAttempts = 0, C();
2959
- } catch (h) {
2960
- if (h instanceof Error && h.name === "AbortError")
4052
+ close: () => h.cancel()
4053
+ }, this.inboundReconnectAttempts = 0, m();
4054
+ } catch (u) {
4055
+ if (u instanceof Error && u.name === "AbortError")
2961
4056
  return;
2962
- (a = this.onerror) == null || a.call(this, h), (l = this.abortController) != null && l.signal.aborted || this.scheduleInboundSseReconnection();
4057
+ (a = this.onerror) == null || a.call(this, u), (l = this.abortController) != null && l.signal.aborted || this.scheduleInboundSseReconnection();
2963
4058
  }
2964
4059
  }
2965
4060
  };
2966
- function Gt(r) {
4061
+ function vr(r) {
2967
4062
  switch (r.type) {
2968
4063
  case "sse":
2969
- return new Jt(r);
4064
+ return new Cr(r);
2970
4065
  case "http":
2971
- return new Wt(r);
4066
+ return new wr(r);
2972
4067
  default:
2973
- throw new y({
4068
+ throw new v({
2974
4069
  message: "Unsupported or invalid transport configuration. If you are using a custom transport, make sure it implements the MCPTransport interface."
2975
4070
  });
2976
4071
  }
2977
4072
  }
2978
- function Yt(r) {
4073
+ function _r(r) {
2979
4074
  return "start" in r && typeof r.start == "function" && "send" in r && typeof r.send == "function" && "close" in r && typeof r.close == "function";
2980
4075
  }
2981
- var Kt = "1.0.0";
2982
- async function Qt(r) {
2983
- const e = new Xt(r);
4076
+ var br = "1.0.0";
4077
+ function Ve({
4078
+ output: r
4079
+ }) {
4080
+ const e = r;
4081
+ return !("content" in e) || !Array.isArray(e.content) ? { type: "json", value: e } : { type: "content", value: e.content.map(
4082
+ (s) => s.type === "text" && "text" in s ? { type: "text", text: s.text } : s.type === "image" && "data" in s && "mimeType" in s ? {
4083
+ type: "image-data",
4084
+ data: s.data,
4085
+ mediaType: s.mimeType
4086
+ } : { type: "text", text: JSON.stringify(s) }
4087
+ ) };
4088
+ }
4089
+ async function xr(r) {
4090
+ const e = new Lr(r);
2984
4091
  return await e.init(), e;
2985
4092
  }
2986
- var Xt = class {
4093
+ var Lr = class {
2987
4094
  constructor({
2988
4095
  transport: r,
2989
4096
  name: e = "ai-sdk-mcp-client",
2990
- version: t = Kt,
4097
+ version: t = br,
2991
4098
  onUncaughtError: s,
2992
- capabilities: i
4099
+ capabilities: n
2993
4100
  }) {
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({
4101
+ this.requestMessageId = 0, this.responseHandlers = /* @__PURE__ */ new Map(), this.serverCapabilities = {}, this.isClosed = !0, this.onUncaughtError = s, this.clientCapabilities = n ?? {}, _r(r) ? this.transport = r : this.transport = vr(r), this.transport.onclose = () => this.onClose(), this.transport.onerror = (i) => this.onError(i), this.transport.onmessage = (i) => {
4102
+ if ("method" in i) {
4103
+ "id" in i ? this.onRequestMessage(i) : this.onError(
4104
+ new v({
2998
4105
  message: "Unsupported message type"
2999
4106
  })
3000
4107
  );
3001
4108
  return;
3002
4109
  }
3003
- this.onResponse(n);
4110
+ this.onResponse(i);
3004
4111
  }, this.clientInfo = {
3005
4112
  name: e,
3006
4113
  version: t
@@ -3013,19 +4120,19 @@ var Xt = class {
3013
4120
  request: {
3014
4121
  method: "initialize",
3015
4122
  params: {
3016
- protocolVersion: $,
4123
+ protocolVersion: H,
3017
4124
  capabilities: this.clientCapabilities,
3018
4125
  clientInfo: this.clientInfo
3019
4126
  }
3020
4127
  },
3021
- resultSchema: tt
4128
+ resultSchema: P0
3022
4129
  });
3023
4130
  if (r === void 0)
3024
- throw new y({
4131
+ throw new v({
3025
4132
  message: "Server sent invalid initialize result"
3026
4133
  });
3027
- if (!Qe.includes(r.protocolVersion))
3028
- throw new y({
4134
+ if (!b0.includes(r.protocolVersion))
4135
+ throw new v({
3029
4136
  message: `Server's protocol version is not supported: ${r.protocolVersion}`
3030
4137
  });
3031
4138
  return this.serverCapabilities = r.capabilities, await this.notification({
@@ -3046,7 +4153,7 @@ var Xt = class {
3046
4153
  case "tools/list":
3047
4154
  case "tools/call":
3048
4155
  if (!this.serverCapabilities.tools)
3049
- throw new y({
4156
+ throw new v({
3050
4157
  message: "Server does not support tools"
3051
4158
  });
3052
4159
  break;
@@ -3054,19 +4161,19 @@ var Xt = class {
3054
4161
  case "resources/read":
3055
4162
  case "resources/templates/list":
3056
4163
  if (!this.serverCapabilities.resources)
3057
- throw new y({
4164
+ throw new v({
3058
4165
  message: "Server does not support resources"
3059
4166
  });
3060
4167
  break;
3061
4168
  case "prompts/list":
3062
4169
  case "prompts/get":
3063
4170
  if (!this.serverCapabilities.prompts)
3064
- throw new y({
4171
+ throw new v({
3065
4172
  message: "Server does not support prompts"
3066
4173
  });
3067
4174
  break;
3068
4175
  default:
3069
- throw new y({
4176
+ throw new v({
3070
4177
  message: `Unsupported method: ${r}`
3071
4178
  });
3072
4179
  }
@@ -3076,45 +4183,45 @@ var Xt = class {
3076
4183
  resultSchema: e,
3077
4184
  options: t
3078
4185
  }) {
3079
- return new Promise((s, i) => {
4186
+ return new Promise((s, n) => {
3080
4187
  if (this.isClosed)
3081
- return i(
3082
- new y({
4188
+ return n(
4189
+ new v({
3083
4190
  message: "Attempted to send a request from a closed client"
3084
4191
  })
3085
4192
  );
3086
4193
  this.assertCapability(r.method);
3087
- const n = t?.signal;
3088
- n?.throwIfAborted();
4194
+ const i = t?.signal;
4195
+ i?.throwIfAborted();
3089
4196
  const a = this.requestMessageId++, l = {
3090
4197
  ...r,
3091
4198
  jsonrpc: "2.0",
3092
4199
  id: a
3093
- }, h = () => {
4200
+ }, u = () => {
3094
4201
  this.responseHandlers.delete(a);
3095
4202
  };
3096
4203
  this.responseHandlers.set(a, (c) => {
3097
- if (n?.aborted)
3098
- return i(
3099
- new y({
4204
+ if (i?.aborted)
4205
+ return n(
4206
+ new v({
3100
4207
  message: "Request was aborted",
3101
- cause: n.reason
4208
+ cause: i.reason
3102
4209
  })
3103
4210
  );
3104
4211
  if (c instanceof Error)
3105
- return i(c);
4212
+ return n(c);
3106
4213
  try {
3107
4214
  const d = e.parse(c.result);
3108
4215
  s(d);
3109
4216
  } catch (d) {
3110
- const g = new y({
4217
+ const g = new v({
3111
4218
  message: "Failed to parse server response",
3112
4219
  cause: d
3113
4220
  });
3114
- i(g);
4221
+ n(g);
3115
4222
  }
3116
4223
  }), this.transport.send(l).catch((c) => {
3117
- h(), i(c);
4224
+ u(), n(c);
3118
4225
  });
3119
4226
  });
3120
4227
  }
@@ -3122,15 +4229,11 @@ var Xt = class {
3122
4229
  params: r,
3123
4230
  options: e
3124
4231
  } = {}) {
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
- }
4232
+ return this.request({
4233
+ request: { method: "tools/list", params: r },
4234
+ resultSchema: T0,
4235
+ options: e
4236
+ });
3134
4237
  }
3135
4238
  async callTool({
3136
4239
  name: r,
@@ -3140,7 +4243,7 @@ var Xt = class {
3140
4243
  try {
3141
4244
  return this.request({
3142
4245
  request: { method: "tools/call", params: { name: r, arguments: e } },
3143
- resultSchema: nt,
4246
+ resultSchema: E0,
3144
4247
  options: {
3145
4248
  signal: t?.abortSignal
3146
4249
  }
@@ -3156,7 +4259,7 @@ var Xt = class {
3156
4259
  try {
3157
4260
  return this.request({
3158
4261
  request: { method: "resources/list", params: r },
3159
- resultSchema: it,
4262
+ resultSchema: R0,
3160
4263
  options: e
3161
4264
  });
3162
4265
  } catch (t) {
@@ -3170,7 +4273,7 @@ var Xt = class {
3170
4273
  try {
3171
4274
  return this.request({
3172
4275
  request: { method: "resources/read", params: { uri: r } },
3173
- resultSchema: lt,
4276
+ resultSchema: O0,
3174
4277
  options: e
3175
4278
  });
3176
4279
  } catch (t) {
@@ -3183,7 +4286,7 @@ var Xt = class {
3183
4286
  try {
3184
4287
  return this.request({
3185
4288
  request: { method: "resources/templates/list" },
3186
- resultSchema: ct,
4289
+ resultSchema: A0,
3187
4290
  options: r
3188
4291
  });
3189
4292
  } catch (e) {
@@ -3197,7 +4300,7 @@ var Xt = class {
3197
4300
  try {
3198
4301
  return this.request({
3199
4302
  request: { method: "prompts/list", params: r },
3200
- resultSchema: pt,
4303
+ resultSchema: j0,
3201
4304
  options: e
3202
4305
  });
3203
4306
  } catch (t) {
@@ -3212,7 +4315,7 @@ var Xt = class {
3212
4315
  try {
3213
4316
  return this.request({
3214
4317
  request: { method: "prompts/get", params: { name: r, arguments: e } },
3215
- resultSchema: mt,
4318
+ resultSchema: N0,
3216
4319
  options: t
3217
4320
  });
3218
4321
  } catch (s) {
@@ -3227,41 +4330,96 @@ var Xt = class {
3227
4330
  await this.transport.send(e);
3228
4331
  }
3229
4332
  /**
3230
- * Returns a set of AI SDK tools from the MCP server
4333
+ * Returns a set of AI SDK tools from the MCP server.
4334
+ * This fetches tool definitions and wraps them with execute functions.
3231
4335
  * @returns A record of tool names to their implementations
3232
4336
  */
3233
4337
  async tools({
3234
4338
  schemas: r = "automatic"
3235
4339
  } = {}) {
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;
4340
+ const e = await this.listTools();
4341
+ return this.toolsFromDefinitions(e, {
4342
+ schemas: r
4343
+ });
4344
+ }
4345
+ /**
4346
+ * Creates AI SDK tools from tool definitions without fetching from the server.
4347
+ */
4348
+ toolsFromDefinitions(r, { schemas: e = "automatic" } = {}) {
4349
+ var t, s;
4350
+ const n = {};
4351
+ for (const {
4352
+ name: i,
4353
+ title: a,
4354
+ description: l,
4355
+ inputSchema: u,
4356
+ annotations: c,
4357
+ _meta: d
4358
+ } of r.tools) {
4359
+ const g = a ?? c?.title;
4360
+ if (e !== "automatic" && !(i in e))
4361
+ continue;
4362
+ const h = this, m = e !== "automatic" ? (t = e[i]) == null ? void 0 : t.outputSchema : void 0, C = async (w, y) => {
4363
+ var b;
4364
+ (b = y?.abortSignal) == null || b.throwIfAborted();
4365
+ const x = await h.callTool({ name: i, args: w, options: y });
4366
+ return m != null ? h.extractStructuredContent(x, m, i) : x;
4367
+ }, p = e === "automatic" ? m0({
4368
+ description: l,
4369
+ title: g,
4370
+ inputSchema: J({
4371
+ ...u,
4372
+ properties: (s = u.properties) != null ? s : {},
4373
+ additionalProperties: !1
4374
+ }),
4375
+ execute: C,
4376
+ toModelOutput: Ve
4377
+ }) : {
4378
+ description: l,
4379
+ title: g,
4380
+ inputSchema: e[i].inputSchema,
4381
+ ...m != null ? { outputSchema: m } : {},
4382
+ execute: C,
4383
+ toModelOutput: Ve
4384
+ };
4385
+ n[i] = { ...p, _meta: d };
4386
+ }
4387
+ return n;
4388
+ }
4389
+ /**
4390
+ * Extracts and validates structuredContent from a tool result.
4391
+ */
4392
+ async extractStructuredContent(r, e, t) {
4393
+ if ("structuredContent" in r && r.structuredContent != null) {
4394
+ const s = await it({
4395
+ value: r.structuredContent,
4396
+ schema: ot(e)
4397
+ });
4398
+ if (!s.success)
4399
+ throw new v({
4400
+ message: `Tool "${t}" returned structuredContent that does not match the expected outputSchema`,
4401
+ cause: s.error
4402
+ });
4403
+ return s.value;
4404
+ }
4405
+ if ("content" in r && Array.isArray(r.content)) {
4406
+ const s = r.content.find((n) => n.type === "text");
4407
+ if (s && "text" in s) {
4408
+ const n = await p0({
4409
+ text: s.text,
4410
+ schema: e
4411
+ });
4412
+ if (!n.success)
4413
+ throw new v({
4414
+ message: `Tool "${t}" returned content that does not match the expected outputSchema`,
4415
+ cause: n.error
4416
+ });
4417
+ return n.value;
3260
4418
  }
3261
- return t;
3262
- } catch (s) {
3263
- throw s;
3264
4419
  }
4420
+ throw new v({
4421
+ message: `Tool "${t}" did not return structuredContent or parseable text content`
4422
+ });
3265
4423
  }
3266
4424
  listResources({
3267
4425
  params: r,
@@ -3280,13 +4438,13 @@ var Xt = class {
3280
4438
  } = {}) {
3281
4439
  return this.listResourceTemplatesInternal({ options: r });
3282
4440
  }
3283
- listPrompts({
4441
+ experimental_listPrompts({
3284
4442
  params: r,
3285
4443
  options: e
3286
4444
  } = {}) {
3287
4445
  return this.listPromptsInternal({ params: r, options: e });
3288
4446
  }
3289
- getPrompt({
4447
+ experimental_getPrompt({
3290
4448
  name: r,
3291
4449
  arguments: e,
3292
4450
  options: t
@@ -3294,8 +4452,8 @@ var Xt = class {
3294
4452
  return this.getPromptInternal({ name: r, args: e, options: t });
3295
4453
  }
3296
4454
  onElicitationRequest(r, e) {
3297
- if (r !== L2)
3298
- throw new y({
4455
+ if (r !== De)
4456
+ throw new v({
3299
4457
  message: "Unsupported request schema. Only ElicitationRequestSchema is supported."
3300
4458
  });
3301
4459
  this.elicitationRequestHandler = e;
@@ -3324,7 +4482,7 @@ var Xt = class {
3324
4482
  });
3325
4483
  return;
3326
4484
  }
3327
- const e = L2.safeParse({
4485
+ const e = De.safeParse({
3328
4486
  method: r.method,
3329
4487
  params: r.params
3330
4488
  });
@@ -3341,7 +4499,7 @@ var Xt = class {
3341
4499
  return;
3342
4500
  }
3343
4501
  try {
3344
- const t = await this.elicitationRequestHandler(e.data), s = ft.parse(t);
4502
+ const t = await this.elicitationRequestHandler(e.data), s = z0.parse(t);
3345
4503
  await this.transport.send({
3346
4504
  jsonrpc: "2.0",
3347
4505
  id: r.id,
@@ -3364,7 +4522,7 @@ var Xt = class {
3364
4522
  onClose() {
3365
4523
  if (this.isClosed) return;
3366
4524
  this.isClosed = !0;
3367
- const r = new y({
4525
+ const r = new v({
3368
4526
  message: "Connection closed"
3369
4527
  });
3370
4528
  for (const e of this.responseHandlers.values())
@@ -3377,13 +4535,13 @@ var Xt = class {
3377
4535
  onResponse(r) {
3378
4536
  const e = Number(r.id), t = this.responseHandlers.get(e);
3379
4537
  if (t === void 0)
3380
- throw new y({
4538
+ throw new v({
3381
4539
  message: `Protocol error: Received a response for an unknown message ID: ${JSON.stringify(
3382
4540
  r
3383
4541
  )}`
3384
4542
  });
3385
4543
  this.responseHandlers.delete(e), t(
3386
- "result" in r ? r : new y({
4544
+ "result" in r ? r : new v({
3387
4545
  message: r.error.message,
3388
4546
  code: r.error.code,
3389
4547
  data: r.error.data,
@@ -3392,17 +4550,17 @@ var Xt = class {
3392
4550
  );
3393
4551
  }
3394
4552
  };
3395
- const e0 = async (r) => {
4553
+ const Sr = async (r) => {
3396
4554
  const e = {};
3397
4555
  try {
3398
4556
  const t = await r.listTools();
3399
- for (const { name: s, description: i, inputSchema: n } of t.tools) {
3400
- const a = async (l, h) => r.callTool({ name: s, arguments: l }, { signal: h?.abortSignal });
3401
- e[s] = we({
3402
- description: i,
3403
- inputSchema: ye({
3404
- ...n,
3405
- properties: n.properties ?? {},
4557
+ for (const { name: s, description: n, inputSchema: i } of t.tools) {
4558
+ const a = async (l, u) => r.callTool({ name: s, arguments: l }, { signal: u?.abortSignal });
4559
+ e[s] = Bt({
4560
+ description: n,
4561
+ inputSchema: Vt({
4562
+ ...i,
4563
+ properties: i.properties ?? {},
3406
4564
  additionalProperties: !1
3407
4565
  }),
3408
4566
  execute: a
@@ -3413,7 +4571,7 @@ const e0 = async (r) => {
3413
4571
  throw t;
3414
4572
  }
3415
4573
  };
3416
- function t0(r) {
4574
+ function Pr(r) {
3417
4575
  const e = Object.entries(r);
3418
4576
  if (e.length === 0)
3419
4577
  return "";
@@ -3425,8 +4583,8 @@ function t0(r) {
3425
4583
  return t += `你可以根据需要调用以下工具:
3426
4584
 
3427
4585
  `, t += `<tools>
3428
- `, e.forEach(([s, i]) => {
3429
- const n = i, a = n.description || "无描述", l = n.parameters || n.inputSchema || {};
4586
+ `, e.forEach(([s, n]) => {
4587
+ const i = n, a = i.description || "无描述", l = i.parameters || i.inputSchema || {};
3430
4588
  t += `${JSON.stringify({
3431
4589
  name: s,
3432
4590
  description: a,
@@ -3461,33 +4619,33 @@ function t0(r) {
3461
4619
  `, t += `- 如果不需要调用工具,直接给出最终答案即可
3462
4620
  `, t;
3463
4621
  }
3464
- function M2(r, e) {
4622
+ function Je(r, e) {
3465
4623
  if (!r || typeof r != "string")
3466
4624
  return null;
3467
4625
  const t = r.match(/<tool_call>([\s\S]*?)<\/tool_call>/i);
3468
4626
  if (t)
3469
4627
  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 };
4628
+ const s = t[1].trim(), n = JSON.parse(s), i = n.name || n.action || n.tool, a = n.arguments || n.args || n.input || {};
4629
+ if (i && e[i])
4630
+ return { toolName: i, arguments: a };
3473
4631
  } catch {
3474
4632
  }
3475
4633
  return null;
3476
4634
  }
3477
- const r0 = {
3478
- openai: be,
3479
- deepseek: xe
4635
+ const kr = {
4636
+ openai: Gt,
4637
+ deepseek: Yt
3480
4638
  };
3481
- class I0 {
4639
+ class as {
3482
4640
  constructor({ llmConfig: e, mcpServers: t }) {
3483
- if (this.mcpServers = {}, this.mcpClients = {}, this.mcpTools = {}, this.ignoreToolnames = [], this.messages = [], this.useReActMode = !1, !e)
4641
+ if (this.mcpServers = {}, this.mcpClients = {}, this.mcpTools = {}, this.ignoreToolnames = [], this.responseMessages = [], this.useReActMode = !1, !e)
3484
4642
  throw new Error("llmConfig is required to initialize AgentModelProvider");
3485
4643
  if (this.mcpServers = t || {}, this.mcpClients = {}, this.mcpTools = {}, e.llm)
3486
4644
  this.llm = e.llm;
3487
4645
  else if (e.providerType) {
3488
4646
  const s = e.providerType;
3489
- let i;
3490
- typeof s == "string" ? i = r0[s] : i = s, this.llm = i({
4647
+ let n;
4648
+ typeof s == "string" ? n = kr[s] : n = s, this.llm = n({
3491
4649
  apiKey: e.apiKey,
3492
4650
  baseURL: e.baseURL
3493
4651
  });
@@ -3499,15 +4657,15 @@ class I0 {
3499
4657
  async _createOneClient(e) {
3500
4658
  try {
3501
4659
  let t;
3502
- if ("type" in e && e.type.toLocaleLowerCase() === "streamablehttp" ? t = new G(new URL(e.url)) : "type" in e && e.type === "extension" ? t = new Re(e.sessionId) : "transport" in e ? t = e.transport : t = e, e.useAISdkClient ?? !1) {
3503
- const i = await Qt({ transport: t });
3504
- return i.__transport__ = t, i;
4660
+ if ("type" in e && e.type.toLocaleLowerCase() === "streamablehttp" ? t = new ne(new URL(e.url)) : "type" in e && e.type === "extension" ? t = new e2(e.sessionId) : "transport" in e ? t = e.transport : t = e, e.useAISdkClient ?? !1) {
4661
+ const n = await xr({ transport: t });
4662
+ return n.__transport__ = t, n;
3505
4663
  } else {
3506
- const i = new Le(
4664
+ const n = new Qt(
3507
4665
  { name: "mcp-web-client", version: "1.0.0" },
3508
4666
  { capabilities: { roots: { listChanged: !0 }, sampling: {}, elicitation: {} } }
3509
4667
  );
3510
- return await i.connect(t), i.__transport__ = t, i;
4668
+ return await n.connect(t), n.__transport__ = t, n;
3511
4669
  }
3512
4670
  } catch (t) {
3513
4671
  return this.onError && this.onError(t?.message || "Failed to create MCP client", t), console.error("Failed to create MCP client", e, t), null;
@@ -3517,7 +4675,7 @@ class I0 {
3517
4675
  async _closeOneClient(e) {
3518
4676
  try {
3519
4677
  const t = e.__transport__;
3520
- if (t && t instanceof se || t && t instanceof re)
4678
+ if (t && t instanceof Rt || t && t instanceof Mt)
3521
4679
  return;
3522
4680
  await t?.terminateSession?.(), await t?.close?.(), await e?.close?.();
3523
4681
  } catch {
@@ -3526,13 +4684,13 @@ class I0 {
3526
4684
  /** 创建所有 mcpClients */
3527
4685
  async _createMpcClients() {
3528
4686
  const e = Object.entries(this.mcpServers), t = await Promise.all(
3529
- e.map(async ([s, i]) => {
3530
- const n = await this._createOneClient(i);
3531
- return { serverName: s, client: n };
4687
+ e.map(async ([s, n]) => {
4688
+ const i = await this._createOneClient(n);
4689
+ return { serverName: s, client: i };
3532
4690
  })
3533
4691
  );
3534
- this.mcpClients = {}, t.forEach(({ serverName: s, client: i }) => {
3535
- this.mcpClients[s] = i;
4692
+ this.mcpClients = {}, t.forEach(({ serverName: s, client: n }) => {
4693
+ this.mcpClients[s] = n;
3536
4694
  });
3537
4695
  }
3538
4696
  /** 兼容两种 client 类型的 tools 获取方法 */
@@ -3540,7 +4698,7 @@ class I0 {
3540
4698
  if (!e)
3541
4699
  return null;
3542
4700
  try {
3543
- return typeof e.tools == "function" ? await e.tools() : await e0(e);
4701
+ return typeof e.tools == "function" ? await e.tools() : await Sr(e);
3544
4702
  } catch (s) {
3545
4703
  return this.onError && this.onError(s?.message || `Failed to query tools for ${t}`, s), console.error(`Failed to query tools for ${t}`, s), null;
3546
4704
  }
@@ -3548,14 +4706,14 @@ class I0 {
3548
4706
  /** 查询所有 mcpClients 的 tools, 失败则保存为null */
3549
4707
  async _createMpcTools() {
3550
4708
  const e = Object.entries(this.mcpClients), t = await Promise.all(
3551
- e.map(async ([s, i]) => {
3552
- const n = await this._getClientTools(i, s);
3553
- return { serverName: s, tools: n };
4709
+ e.map(async ([s, n]) => {
4710
+ const i = await this._getClientTools(n, s);
4711
+ return { serverName: s, tools: i };
3554
4712
  })
3555
4713
  );
3556
- this.mcpTools = {}, t.forEach(({ serverName: s, tools: i }) => {
3557
- const n = i && typeof i == "object" ? i : {};
3558
- this.mcpTools[s] = n;
4714
+ this.mcpTools = {}, t.forEach(({ serverName: s, tools: n }) => {
4715
+ const i = n && typeof n == "object" ? n : {};
4716
+ this.mcpTools[s] = i;
3559
4717
  });
3560
4718
  }
3561
4719
  /** 关闭所有的 clients */
@@ -3586,8 +4744,8 @@ class I0 {
3586
4744
  if (!s)
3587
4745
  return this.onError?.(`Failed to create MCP client: ${e}`), null;
3588
4746
  this.mcpClients[e] = s;
3589
- const i = await this._getClientTools(s, e);
3590
- return this.mcpTools[e] = i && typeof i == "object" ? i : {}, this.mcpServers[e] = t, this.onUpdatedTools?.(), s;
4747
+ const n = await this._getClientTools(s, e);
4748
+ return this.mcpTools[e] = n && typeof n == "object" ? n : {}, this.mcpServers[e] = t, this.onUpdatedTools?.(), s;
3591
4749
  }
3592
4750
  /** 通过服务器名称删除mcpServer: mcpServers mcpClients mcpTools ignoreToolnames */
3593
4751
  async removeMcpServer(e) {
@@ -3601,47 +4759,47 @@ class I0 {
3601
4759
  } catch {
3602
4760
  }
3603
4761
  const s = this.mcpTools[e];
3604
- delete this.mcpTools[e], s && Object.keys(s).forEach((i) => {
3605
- this.ignoreToolnames = this.ignoreToolnames.filter((n) => n !== i);
4762
+ delete this.mcpTools[e], s && Object.keys(s).forEach((n) => {
4763
+ this.ignoreToolnames = this.ignoreToolnames.filter((i) => i !== n);
3606
4764
  }), this.onUpdatedTools?.();
3607
4765
  }
3608
4766
  /** 创建临时允许调用的tools集合 */
3609
4767
  _tempMergeTools(e = {}) {
3610
- const t = Object.values(this.mcpTools).reduce((s, i) => ({ ...s, ...i }), {});
4768
+ const t = Object.values(this.mcpTools).reduce((s, n) => ({ ...s, ...n }), {});
3611
4769
  return Object.assign(t, e), this.ignoreToolnames.forEach((s) => {
3612
4770
  delete t[s];
3613
4771
  }), t;
3614
4772
  }
3615
4773
  /** 生成 ReAct 模式的系统提示词(包含工具描述) */
3616
4774
  _generateReActSystemPrompt(e, t, s) {
3617
- const i = t0(e);
3618
- return s ? `${s}${i}` : `你是一个智能助手,可以通过调用工具来完成任务。
3619
- ${i}`;
4775
+ const n = Pr(e);
4776
+ return s ? `${s}${n}` : `你是一个智能助手,可以通过调用工具来完成任务。
4777
+ ${n}`;
3620
4778
  }
3621
4779
  /** 执行 ReAct 模式下的工具调用 */
3622
4780
  async _executeReActToolCall(e, t, s) {
3623
- const i = s[e];
3624
- if (!i)
4781
+ const n = s[e];
4782
+ if (!n)
3625
4783
  return { success: !1, error: `工具 ${e} 不存在` };
3626
4784
  try {
3627
- const n = i, a = n.execute || n.call;
4785
+ const i = n, a = i.execute || i.call;
3628
4786
  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) || "工具执行失败" };
4787
+ } catch (i) {
4788
+ return { success: !1, error: i?.message || String(i) || "工具执行失败" };
3631
4789
  }
3632
4790
  }
3633
4791
  /** ReAct 模式的对话实现 */
3634
- async _chatReAct(e, { model: t, maxSteps: s = 5, ...i }) {
4792
+ async _chatReAct(e, { model: t, maxSteps: s = 5, ...n }) {
3635
4793
  if (!this.llm)
3636
4794
  throw new Error("LLM is not initialized");
3637
4795
  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 });
4796
+ const i = this._tempMergeTools(n.tools);
4797
+ if (Object.keys(i).length === 0)
4798
+ return this._chat(e, { model: t, maxSteps: s, ...n });
3641
4799
  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);
4800
+ n.message && !n.messages ? l.push({ role: "user", content: n.message }) : n.messages ? l = [...n.messages] : l = [...this.responseMessages];
4801
+ const u = typeof t == "string" ? t : t?.modelId || "default-model", d = { role: "system", content: this._generateReActSystemPrompt(i, u, n.system) }, g = l[0]?.role === "system" ? l : [d, ...l];
4802
+ return e === ce ? this._chatReActStream(g, i, u, s, n) : this._chatReActNonStream(g, i, u, s, n);
3645
4803
  }
3646
4804
  /**
3647
4805
  * 检查消息内容是否包含图片
@@ -3668,7 +4826,7 @@ ${i}`;
3668
4826
  };
3669
4827
  }
3670
4828
  /**
3671
- * 构建用于模型调用的消息列表(magentic-ui 风格)
4829
+ * 构建用于模型调用的消息列表
3672
4830
  * 策略:保留所有文本消息,仅限制图片数量(类似 magentic-ui 的 maybe_remove_old_screenshots)
3673
4831
  *
3674
4832
  * @param systemMessage 系统提示词
@@ -3677,204 +4835,299 @@ ${i}`;
3677
4835
  * @returns 构建好的消息列表
3678
4836
  */
3679
4837
  _buildMessagesForModel(e, t, s = 3) {
3680
- const i = [];
3681
- e && i.push(e);
3682
- let n = 0;
4838
+ const n = [];
4839
+ e && n.push(e);
4840
+ let i = 0;
3683
4841
  const a = [];
3684
4842
  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++;
4843
+ const u = t[l];
4844
+ if (this._messageHasImage(u.content))
4845
+ if (i < s)
4846
+ a.unshift(u), i++;
3689
4847
  else {
3690
- const d = this._removeImageFromMessage(h);
4848
+ const d = this._removeImageFromMessage(u);
3691
4849
  d && a.unshift(d);
3692
4850
  }
3693
4851
  else
3694
- a.unshift(h);
4852
+ a.unshift(u);
3695
4853
  }
3696
- return i.push(...a), i;
4854
+ return n.push(...a), n;
3697
4855
  }
3698
4856
  /** ReAct 模式非流式对话 */
3699
- async _chatReActNonStream(e, t, s, i, n) {
4857
+ async _chatReActNonStream(e, t, s, n, i) {
3700
4858
  let a = [...e];
3701
- const l = e[0]?.role === "system" ? e[0] : null, h = l ? e.slice(1) : e;
4859
+ const l = e[0]?.role === "system" ? e[0] : null, u = l ? e.slice(1) : e;
3702
4860
  let c = 0;
3703
- const d = n.maxImages ?? 3;
3704
- for (; c < i; ) {
4861
+ const d = i.maxImages ?? 3;
4862
+ for (; c < n; ) {
3705
4863
  c++;
3706
- const p = this._buildMessagesForModel(l, h, d), { tools: C, ...f } = n, m = (await f2({
4864
+ const h = this._buildMessagesForModel(l, u, d), { tools: m, ...C } = i, w = (await Re({
3707
4865
  // @ts-ignore ProviderV2 是所有llm的父类,在每一个具体的llm类都有一个选择model的函数用法
3708
4866
  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,
4867
+ messages: h,
4868
+ ...C
4869
+ })).text, y = { role: "assistant", content: w };
4870
+ u.push(y), a.push(y);
4871
+ const b = Je(w, t);
4872
+ if (!b)
4873
+ return this.responseMessages = a, {
4874
+ text: w,
3717
4875
  response: { messages: a }
3718
4876
  };
3719
- const _ = await this._executeReActToolCall(v.toolName, v.arguments, t), b = {
4877
+ const x = await this._executeReActToolCall(b.toolName, b.arguments, t), R = {
3720
4878
  role: "user",
3721
4879
  content: `<tool_response>
3722
- ${_.success ? JSON.stringify(_.result) : `工具执行失败 - ${_.error}`}
4880
+ ${x.success ? JSON.stringify(x.result) : `工具执行失败 - ${x.error}`}
3723
4881
  </tool_response>`
3724
4882
  };
3725
- h.push(b), a.push(b);
4883
+ u.push(R), a.push(R);
3726
4884
  }
3727
- return this.messages = a, {
4885
+ return this.responseMessages = a, {
3728
4886
  text: a[a.length - 2]?.content || "",
3729
4887
  response: { messages: a }
3730
4888
  };
3731
4889
  }
3732
4890
  /** ReAct 模式流式对话 */
3733
- _chatReActStream(e, t, s, i, n) {
4891
+ _chatReActStream(e, t, s, n, i) {
3734
4892
  const a = this, l = this.llm(s);
3735
- let h, c;
3736
- const d = new Promise((p, C) => {
3737
- h = p, c = C;
4893
+ let u, c;
4894
+ const d = new Promise((h, m) => {
4895
+ u = h, c = m;
3738
4896
  });
3739
4897
  return {
3740
4898
  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;
4899
+ async start(h) {
4900
+ let m = [...e];
4901
+ const C = e[0]?.role === "system" ? e[0] : null, p = C ? e.slice(1) : [...e];
4902
+ let w = 0, y = "";
4903
+ const b = i.maxImages ?? 3;
4904
+ h.enqueue({ type: "start" }), h.enqueue({ type: "start-step" });
3746
4905
  try {
3747
- for (; m < i; ) {
3748
- m++;
3749
- const _ = a._buildMessagesForModel(f, u, v), { tools: S, ...L } = n;
3750
- delete L.system, delete L.onFinish;
3751
- const b = await X({
3752
- ...L,
4906
+ for (; w < n; ) {
4907
+ w++;
4908
+ const x = a._buildMessagesForModel(C, p, b), { tools: M, ...k } = i;
4909
+ delete k.system, delete k.onFinish;
4910
+ const R = await ce({
4911
+ ...k,
3753
4912
  model: l,
3754
- messages: _
4913
+ messages: x
3755
4914
  });
3756
4915
  let E = "";
3757
- for await (const I of b.fullStream)
3758
- I.type === "text-delta" ? (E += I.text || "", p.enqueue({
4916
+ for await (const L of R.fullStream)
4917
+ L.type === "text-delta" ? (E += L.text || "", h.enqueue({
3759
4918
  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 });
4919
+ text: L.text
4920
+ })) : L.type === "text-start" ? h.enqueue({ type: "text-start" }) : L.type === "text-end" || L.type === "finish-step" || L.type === "finish" || L.type === "start" || L.type === "start-step" || h.enqueue(L);
4921
+ y += E;
4922
+ const q = { role: "assistant", content: y };
4923
+ p.push(q), m.push(q);
4924
+ const I = Je(y, t);
4925
+ if (!I) {
4926
+ h.enqueue({ type: "text-end" }), h.enqueue({ type: "finish-step" }), h.enqueue({ type: "finish" }), h.close(), a.responseMessages = m, u({ messages: m });
3768
4927
  return;
3769
4928
  }
3770
- if (R.toolName === "computer" && R.arguments?.action === "terminate") {
3771
- p.enqueue({ type: "text-end" }), p.close(), a.messages = C, h({ messages: C });
4929
+ if (I.toolName === "computer" && I.arguments?.action === "terminate") {
4930
+ h.enqueue({ type: "text-end" }), h.enqueue({ type: "finish-step" }), h.enqueue({ type: "finish" }), h.close(), a.responseMessages = m, u({ messages: m });
3772
4931
  return;
3773
4932
  }
3774
- const P = `react-${Date.now()}`;
3775
- p.enqueue({
4933
+ const j = `react-${Date.now()}`;
4934
+ h.enqueue({
3776
4935
  type: "tool-input-start",
3777
- id: P,
3778
- toolName: R.toolName
4936
+ id: j,
4937
+ toolName: I.toolName
3779
4938
  });
3780
- const Q = JSON.stringify(R.arguments, null, 2);
3781
- p.enqueue({
4939
+ const F = JSON.stringify(I.arguments, null, 2);
4940
+ h.enqueue({
3782
4941
  type: "tool-input-delta",
3783
- id: P,
3784
- delta: Q
4942
+ id: j,
4943
+ delta: F
4944
+ }), h.enqueue({
4945
+ type: "tool-input-end",
4946
+ id: j
4947
+ }), h.enqueue({
4948
+ type: "tool-call",
4949
+ toolCallId: j,
4950
+ toolName: I.toolName,
4951
+ input: I.arguments
3785
4952
  });
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;
4953
+ const A = await a._executeReActToolCall(I.toolName, I.arguments, t);
4954
+ let K, Z = A.result;
4955
+ if (A.success && A.result && typeof A.result == "object" && A.result.screenshot) {
4956
+ K = A.result.screenshot;
4957
+ const { screenshot: L, ...G } = A.result;
4958
+ Z = G;
3792
4959
  }
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}
4960
+ let B = "";
4961
+ if (A.success) {
4962
+ Z && Array.isArray(Z.content) && Z.content.length > 0 && Z.content[0].text ? B = Z.content[0].text : B = JSON.stringify(Z);
4963
+ let L = `<tool_response>
4964
+ ${B}
3797
4965
  </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 = "";
4966
+ K && (L += `
4967
+ 请检查截图以确认操作是否成功。如果成功,请继续下一步;如果失败,请重试。`), h.enqueue({
4968
+ type: "tool-result",
4969
+ toolCallId: j,
4970
+ result: L
4971
+ });
4972
+ const G = K ? {
4973
+ role: "user",
4974
+ content: [
4975
+ { type: "text", text: L },
4976
+ { type: "image", image: K }
4977
+ ]
4978
+ } : {
4979
+ role: "user",
4980
+ content: L
4981
+ };
4982
+ p.push(G), m.push(G), y = "";
4983
+ } else
4984
+ B = `工具执行失败 - ${A.error}`, h.enqueue({
4985
+ type: "tool-error",
4986
+ toolCallId: j,
4987
+ input: I.arguments,
4988
+ error: { message: B }
4989
+ });
3815
4990
  }
3816
- p.enqueue({ type: "text-end" }), p.close(), a.messages = C, h({ messages: C });
3817
- } catch (_) {
3818
- p.error(_), c(_);
4991
+ h.enqueue({ type: "text-end" }), h.enqueue({ type: "finish-step" }), h.enqueue({ type: "finish" }), h.close(), a.responseMessages = m, u({ messages: m });
4992
+ } catch (x) {
4993
+ h.error(x), c(x);
3819
4994
  }
3820
4995
  }
3821
4996
  }),
3822
4997
  response: d
3823
4998
  };
3824
4999
  }
3825
- async _chat(e, { model: t, maxSteps: s = 5, ...i }) {
5000
+ async _chat(e, { model: t, maxSteps: s = 5, ...n }) {
3826
5001
  if (this.useReActMode)
3827
- return this._chatReAct(e, { model: t, maxSteps: s, ...i });
5002
+ return this._chatReAct(e, { model: t, maxSteps: s, ...n });
3828
5003
  if (!this.llm)
3829
5004
  throw new Error("LLM is not initialized");
3830
5005
  await this.initClientsAndTools();
3831
- const n = {
5006
+ const i = {
3832
5007
  // @ts-ignore ProviderV2 是所有llm的父类, 在每一个具体的llm 类都有一个选择model的函数用法
3833
5008
  model: this.llm(t),
3834
- stopWhen: ve(s),
3835
- ...i,
3836
- tools: this._tempMergeTools(i.tools)
5009
+ stopWhen: Jt(s),
5010
+ ...n,
5011
+ tools: this._tempMergeTools(n.tools)
3837
5012
  };
3838
- i.message && !i.messages && (this.messages.push({ role: "user", content: i.message }), n.messages = [...this.messages]);
3839
- const a = e(n);
3840
- return a?.response?.then((l) => {
3841
- this.messages.push(...l.messages);
3842
- }), a;
5013
+ let a = null;
5014
+ if (n.message && !n.messages)
5015
+ a = { role: "user", content: n.message }, this.responseMessages.push(a), i.messages = [...this.responseMessages];
5016
+ else if (n.messages && n.messages.length > 0) {
5017
+ const u = n.messages[n.messages.length - 1];
5018
+ u.role === "user" && (a = u);
5019
+ }
5020
+ const l = e(i);
5021
+ return l?.response?.then((u) => {
5022
+ const c = u.messages?.[0];
5023
+ a && c?.role !== "user" && this.responseMessages.push(a), this.responseMessages.push(...u.messages);
5024
+ }), l;
3843
5025
  }
3844
5026
  async chat(e) {
3845
- return this._chat(f2, e);
5027
+ return this._chat(Re, e);
3846
5028
  }
3847
5029
  async chatStream(e) {
3848
- return this._chat(X, e);
5030
+ return this._chat(ce, e);
5031
+ }
5032
+ }
5033
+ const Tr = /^\.\/[^/]+\/SKILL\.md$/, Mr = /^---\s*\n([\s\S]+?)\s*\n---/;
5034
+ function Rr(r) {
5035
+ const e = r.match(Mr);
5036
+ if (!e?.[1]) return null;
5037
+ const t = e[1], s = t.match(/^name:\s*(.+)$/m), n = t.match(/^description:\s*(.+)$/m), i = s?.[1]?.trim(), a = n?.[1]?.trim();
5038
+ return i && a ? { name: i, description: a } : null;
5039
+ }
5040
+ function bt(r) {
5041
+ return Object.keys(r).filter((e) => Tr.test(e));
5042
+ }
5043
+ function cs(r) {
5044
+ const e = bt(r), t = [];
5045
+ for (const s of e) {
5046
+ const n = r[s];
5047
+ if (!n) continue;
5048
+ const i = Rr(n);
5049
+ i && t.push({
5050
+ name: i.name,
5051
+ description: i.description,
5052
+ path: s
5053
+ });
3849
5054
  }
5055
+ return t;
5056
+ }
5057
+ function ls(r) {
5058
+ return r.length === 0 ? "" : `## 可用技能
5059
+
5060
+ ${r.map((t) => `- **${t.name}**: ${t.description}`).join(`
5061
+ `)}
5062
+
5063
+ 当需要用到某技能时,请使用 get_skill_content 工具获取该技能的完整文档内容。`;
5064
+ }
5065
+ function us(r) {
5066
+ return Object.keys(r);
5067
+ }
5068
+ function We(r, e) {
5069
+ return r[e];
5070
+ }
5071
+ function Ke(r, e) {
5072
+ return bt(r).find((t) => t.startsWith(`./${e}/SKILL.md`));
5073
+ }
5074
+ function ds(r) {
5075
+ return {
5076
+ get_skill_content: Wt({
5077
+ description: "根据技能名称或文档路径获取该技能的完整 Markdown 文档内容。传入 skillName(如 calculator)或 path(如 ./calculator/SKILL.md)",
5078
+ inputSchema: ae.object({
5079
+ skillName: ae.string().optional().describe("技能名称,与目录名一致,如 calculator"),
5080
+ path: ae.string().optional().describe("文档相对路径,如 ./calculator/SKILL.md 或 ./product-guide/reference/xxx.md")
5081
+ }),
5082
+ execute: (t) => {
5083
+ const { skillName: s, path: n } = t;
5084
+ let i;
5085
+ if (n)
5086
+ i = We(r, n);
5087
+ else if (s) {
5088
+ const a = Ke(r, s);
5089
+ i = a ? We(r, a) : void 0;
5090
+ }
5091
+ return i === void 0 ? { error: "未找到对应技能文档", skillName: s ?? n } : { content: i, path: n ?? Ke(r, s) };
5092
+ }
5093
+ })
5094
+ };
3850
5095
  }
3851
5096
  export {
3852
- I0 as AgentModelProvider,
3853
- O0 as Ajv,
3854
- H0 as AuthClientProvider,
3855
- P0 as ContentScriptServerTransport,
3856
- Re as ExtensionClientTransport,
3857
- E0 as ExtensionPageServerTransport,
3858
- G0 as InMemoryTransport,
3859
- Te as QrCode,
3860
- z0 as ResourceTemplate,
3861
- D0 as UriTemplate,
3862
- Le as WebMcpClient,
3863
- w0 as WebMcpServer,
3864
- B0 as completable,
3865
- S0 as createMessageChannelClientTransport,
3866
- v0 as createMessageChannelPairTransport,
3867
- y0 as createMessageChannelServerTransport,
3868
- k0 as createRemoter,
3869
- x0 as createSSEClientTransport,
3870
- L0 as createStreamableHTTPClientTransport,
3871
- e0 as getAISDKTools,
3872
- J0 as getDisplayName,
3873
- M0 as isMcpClient,
3874
- b0 as isMcpServer,
3875
- T0 as isMessageChannelClientTransport,
3876
- _0 as isMessageChannelServerTransport,
3877
- R0 as isSSEClientTransport,
3878
- Se as isStreamableHTTPClientTransport,
3879
- q0 as z
5097
+ as as AgentModelProvider,
5098
+ ms as Ajv,
5099
+ Cs as AuthClientProvider,
5100
+ os as ContentScriptServerTransport,
5101
+ e2 as ExtensionClientTransport,
5102
+ ns as ExtensionPageServerTransport,
5103
+ Ts as InMemoryTransport,
5104
+ t2 as QrCode,
5105
+ vs as ResourceTemplate,
5106
+ bs as UriTemplate,
5107
+ Qt as WebMcpClient,
5108
+ Jr as WebMcpServer,
5109
+ Ls as completable,
5110
+ es as createMessageChannelClientTransport,
5111
+ Kr as createMessageChannelPairTransport,
5112
+ Wr as createMessageChannelServerTransport,
5113
+ is as createRemoter,
5114
+ Qr as createSSEClientTransport,
5115
+ ds as createSkillTools,
5116
+ Xr as createStreamableHTTPClientTransport,
5117
+ ls as formatSkillsForSystemPrompt,
5118
+ Sr as getAISDKTools,
5119
+ Ps as getDisplayName,
5120
+ Ke as getMainSkillPathByName,
5121
+ bt as getMainSkillPaths,
5122
+ We as getSkillMdContent,
5123
+ us as getSkillMdPaths,
5124
+ cs as getSkillOverviews,
5125
+ ss as isMcpClient,
5126
+ Yr as isMcpServer,
5127
+ rs as isMessageChannelClientTransport,
5128
+ Gr as isMessageChannelServerTransport,
5129
+ ts as isSSEClientTransport,
5130
+ Xt as isStreamableHTTPClientTransport,
5131
+ Rr as parseSkillFrontMatter,
5132
+ gs as z
3880
5133
  };