@opentiny/next-sdk 0.4.1 → 0.4.2
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/{SimulatorMask-BHVXyogh-iNUb4dyF.js → SimulatorMask-BHVXyogh-CARX3Rff.js} +1 -1
- package/dist/core.js +1 -1
- package/dist/{index-CXK8CcKq.js → index-R_HIbfUX.js} +1698 -1170
- package/dist/index.d.ts +11 -0
- package/dist/index.js +69 -50
- package/dist/{initialize-builtin-WebMCP-rALfqS-o.js → initialize-builtin-WebMCP-JaoKwVlm.js} +355 -346
- package/dist/page-tools/a11y/build.d.ts +3 -4
- package/dist/page-tools/a11y/config.d.ts +96 -0
- package/dist/page-tools/a11y/constants.d.ts +2 -0
- package/dist/page-tools/a11y/search.d.ts +1 -1
- package/dist/page-tools/a11y/types.d.ts +13 -22
- package/dist/page-tools/a11y/utils.d.ts +32 -11
- package/dist/page-tools/a11y/vnode.d.ts +14 -11
- package/dist/page-tools/a11y-tree.d.ts +1 -0
- package/dist/page-tools/configs/console-cloud.d.ts +6 -0
- package/dist/page-tools/constants.d.ts +5 -17
- package/dist/page-tools/context.d.ts +12 -0
- package/dist/page-tools/handlers/searchTree.d.ts +2 -1
- package/dist/page-tools/page-agent-highlight/index.d.ts +12 -0
- package/dist/page-tools/page-agent-mask/SimulatorMask.d.ts +2 -0
- package/dist/page-tools/page-agent-tool-event.d.ts +26 -0
- package/dist/page-tools/schema.d.ts +1 -0
- package/dist/page-tools/tool-config.d.ts +50 -0
- package/dist/runtime.d.ts +4 -1
- package/dist/runtime.js +37 -49
- package/dist/vitest.config.d.ts +2 -0
- package/index.ts +35 -0
- package/package.json +21 -16
- package/page-tools/a11y/build.ts +38 -34
- package/page-tools/a11y/config.ts +465 -0
- package/page-tools/a11y/constants.ts +21 -0
- package/page-tools/a11y/search.ts +1 -3
- package/page-tools/a11y/types.ts +14 -17
- package/page-tools/a11y/utils.ts +129 -156
- package/page-tools/a11y/vnode.ts +277 -67
- package/page-tools/a11y-tree.ts +1 -0
- package/page-tools/bridge.ts +22 -2
- package/page-tools/configs/console-cloud.ts +172 -0
- package/page-tools/constants.ts +5 -65
- package/page-tools/context.ts +38 -1
- package/page-tools/handlers/click.ts +6 -2
- package/page-tools/handlers/fill.ts +10 -5
- package/page-tools/handlers/searchTree.ts +7 -10
- package/page-tools/handlers/select.ts +10 -5
- package/page-tools/page-agent-highlight/index.ts +66 -19
- package/page-tools/page-agent-mask/SimulatorMask.ts +42 -22
- package/page-tools/page-agent-mask/hauwei.svg +25 -0
- package/page-tools/page-agent-prompt.md +1 -1
- package/page-tools/page-agent-tool-event.ts +113 -0
- package/page-tools/page-agent-tool.ts +85 -53
- package/page-tools/schema.ts +1 -0
- package/page-tools/tool-config.ts +100 -0
- package/page-tools/utils/dom.ts +6 -3
- package/runtime.ts +37 -6
- package/test/page-tools/a11y/build.test.ts +638 -0
- package/test/page-tools/a11y/config.test.ts +370 -0
- package/test/page-tools/configs/console-cloud.test.ts +168 -0
- package/test/page-tools/page-agent-highlight.test.ts +110 -0
- package/test/page-tools/page-agent-tool-dispatch.test.ts +208 -0
- package/test/page-tools/page-agent-tool.test.ts +102 -0
- package/test/page-tools/tool-config.test.ts +112 -0
- package/test/page-tools/utils/dom.test.ts +122 -0
- package/vite.config.runtime.ts +1 -1
- package/vitest.config.ts +10 -0
package/dist/{initialize-builtin-WebMCP-rALfqS-o.js → initialize-builtin-WebMCP-JaoKwVlm.js}
RENAMED
|
@@ -13,7 +13,7 @@ import { createOpenAI as Pn } from "@ai-sdk/openai";
|
|
|
13
13
|
import { createDeepSeek as Rn } from "@ai-sdk/deepseek";
|
|
14
14
|
import { Client as yr } from "@modelcontextprotocol/sdk/client/index.js";
|
|
15
15
|
import { WebSocketClientTransport as kn } from "@modelcontextprotocol/sdk/client/websocket.js";
|
|
16
|
-
class
|
|
16
|
+
class Ba {
|
|
17
17
|
constructor(t, r) {
|
|
18
18
|
const n = {
|
|
19
19
|
name: "web-mcp-server",
|
|
@@ -212,7 +212,7 @@ class Wa {
|
|
|
212
212
|
t.persisted || this.transport && typeof this.transport.close == "function" && await this.transport.close();
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
const
|
|
215
|
+
const Ga = (e, t) => new xt(e, t), Ka = () => on(), Ya = (e) => e instanceof xt, Xa = (e) => e instanceof hr, On = (e) => {
|
|
216
216
|
const t = () => {
|
|
217
217
|
let r = null;
|
|
218
218
|
return typeof document < "u" && (r = r || document.modelContext), typeof navigator < "u" && (r = r || navigator.modelContext), r = r || globalThis.modelContext, r || null;
|
|
@@ -534,7 +534,7 @@ class An {
|
|
|
534
534
|
t.persisted || (In(this.transport) ? await this.transport.terminateSession() : this.transport && typeof this.transport.close == "function" && await this.transport.close());
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
const
|
|
537
|
+
const Qa = (e, t) => new Xe(e, t), el = (e, t) => new Ye(e, t), tl = (e, t) => new St(e, t), rl = (e) => e instanceof Xe, In = (e) => e instanceof Ye, nl = (e) => e instanceof St, ol = (e) => e instanceof yr;
|
|
538
538
|
class it extends Error {
|
|
539
539
|
constructor(t, r) {
|
|
540
540
|
super(t), this.name = "ParseError", this.type = r.type, this.field = r.field, this.value = r.value, this.line = r.line;
|
|
@@ -1789,15 +1789,21 @@ function Cr(e) {
|
|
|
1789
1789
|
type: "object",
|
|
1790
1790
|
properties: {},
|
|
1791
1791
|
additionalProperties: !1
|
|
1792
|
-
}) : Oo(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ?
|
|
1792
|
+
}) : Oo(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? zo(e) : Ao(e) : e();
|
|
1793
1793
|
}
|
|
1794
1794
|
function Ao(e) {
|
|
1795
1795
|
return Pe(
|
|
1796
|
-
() =>
|
|
1797
|
-
e
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1796
|
+
() => {
|
|
1797
|
+
if (!Io(e))
|
|
1798
|
+
throw new Error(
|
|
1799
|
+
`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`
|
|
1800
|
+
);
|
|
1801
|
+
return Tt(
|
|
1802
|
+
e["~standard"].jsonSchema.input({
|
|
1803
|
+
target: "draft-07"
|
|
1804
|
+
})
|
|
1805
|
+
);
|
|
1806
|
+
},
|
|
1801
1807
|
{
|
|
1802
1808
|
validate: async (t) => {
|
|
1803
1809
|
const r = await e["~standard"].validate(t);
|
|
@@ -1812,7 +1818,10 @@ function Ao(e) {
|
|
|
1812
1818
|
}
|
|
1813
1819
|
);
|
|
1814
1820
|
}
|
|
1815
|
-
function Io(e
|
|
1821
|
+
function Io(e) {
|
|
1822
|
+
return e["~standard"].jsonSchema != null;
|
|
1823
|
+
}
|
|
1824
|
+
function Mo(e, t) {
|
|
1816
1825
|
var r;
|
|
1817
1826
|
const n = (r = void 0) != null ? r : !1;
|
|
1818
1827
|
return Pe(
|
|
@@ -1828,7 +1837,7 @@ function Io(e, t) {
|
|
|
1828
1837
|
}
|
|
1829
1838
|
);
|
|
1830
1839
|
}
|
|
1831
|
-
function
|
|
1840
|
+
function jo(e, t) {
|
|
1832
1841
|
var r;
|
|
1833
1842
|
const n = (r = void 0) != null ? r : !1;
|
|
1834
1843
|
return Pe(
|
|
@@ -1848,13 +1857,13 @@ function Mo(e, t) {
|
|
|
1848
1857
|
}
|
|
1849
1858
|
);
|
|
1850
1859
|
}
|
|
1851
|
-
function
|
|
1860
|
+
function No(e) {
|
|
1852
1861
|
return "_zod" in e;
|
|
1853
1862
|
}
|
|
1854
|
-
function
|
|
1855
|
-
return
|
|
1863
|
+
function zo(e, t) {
|
|
1864
|
+
return No(e) ? jo(e) : Mo(e);
|
|
1856
1865
|
}
|
|
1857
|
-
async function
|
|
1866
|
+
async function Uo({
|
|
1858
1867
|
value: e,
|
|
1859
1868
|
schema: t,
|
|
1860
1869
|
context: r
|
|
@@ -1893,12 +1902,12 @@ async function $r({
|
|
|
1893
1902
|
}) {
|
|
1894
1903
|
try {
|
|
1895
1904
|
const r = br(e);
|
|
1896
|
-
return t == null ? r :
|
|
1905
|
+
return t == null ? r : Uo({ value: r, schema: t });
|
|
1897
1906
|
} catch (r) {
|
|
1898
1907
|
throw Le.isInstance(r) || Ce.isInstance(r) ? r : new Le({ text: e, cause: r });
|
|
1899
1908
|
}
|
|
1900
1909
|
}
|
|
1901
|
-
async function
|
|
1910
|
+
async function Do({
|
|
1902
1911
|
text: e,
|
|
1903
1912
|
schema: t
|
|
1904
1913
|
}) {
|
|
@@ -1913,10 +1922,10 @@ async function Uo({
|
|
|
1913
1922
|
};
|
|
1914
1923
|
}
|
|
1915
1924
|
}
|
|
1916
|
-
function
|
|
1925
|
+
function Lo(e) {
|
|
1917
1926
|
return { ...e, type: "dynamic" };
|
|
1918
1927
|
}
|
|
1919
|
-
var
|
|
1928
|
+
var qo = ({
|
|
1920
1929
|
maxRetries: e = 2,
|
|
1921
1930
|
initialDelayInMs: t = 2e3,
|
|
1922
1931
|
backoffFactor: r = 2,
|
|
@@ -1984,41 +1993,41 @@ async function Er(e, {
|
|
|
1984
1993
|
new TextDecoder();
|
|
1985
1994
|
let $t;
|
|
1986
1995
|
$t = globalThis.crypto;
|
|
1987
|
-
async function
|
|
1996
|
+
async function Ho(e) {
|
|
1988
1997
|
return (await $t).getRandomValues(new Uint8Array(e));
|
|
1989
1998
|
}
|
|
1990
|
-
async function
|
|
1999
|
+
async function Fo(e) {
|
|
1991
2000
|
const t = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~", r = Math.pow(2, 8) - Math.pow(2, 8) % t.length;
|
|
1992
2001
|
let n = "";
|
|
1993
2002
|
for (; n.length < e; ) {
|
|
1994
|
-
const o = await
|
|
2003
|
+
const o = await Ho(e - n.length);
|
|
1995
2004
|
for (const s of o)
|
|
1996
2005
|
s < r && (n += t[s % t.length]);
|
|
1997
2006
|
}
|
|
1998
2007
|
return n;
|
|
1999
2008
|
}
|
|
2000
|
-
async function Fo(e) {
|
|
2001
|
-
return await Ho(e);
|
|
2002
|
-
}
|
|
2003
2009
|
async function Zo(e) {
|
|
2010
|
+
return await Fo(e);
|
|
2011
|
+
}
|
|
2012
|
+
async function Vo(e) {
|
|
2004
2013
|
const t = await (await $t).subtle.digest("SHA-256", new TextEncoder().encode(e));
|
|
2005
2014
|
return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g, "_").replace(/\+/g, "-").replace(/=/g, "");
|
|
2006
2015
|
}
|
|
2007
|
-
async function
|
|
2016
|
+
async function Jo(e) {
|
|
2008
2017
|
if (e || (e = 43), e < 43 || e > 128)
|
|
2009
2018
|
throw `Expected a length between 43 and 128. Received ${e}.`;
|
|
2010
|
-
const t = await
|
|
2019
|
+
const t = await Zo(e), r = await Vo(t);
|
|
2011
2020
|
return {
|
|
2012
2021
|
code_verifier: t,
|
|
2013
2022
|
code_challenge: r
|
|
2014
2023
|
};
|
|
2015
2024
|
}
|
|
2016
|
-
var we = "2025-11-25",
|
|
2025
|
+
var we = "2025-11-25", Wo = [
|
|
2017
2026
|
we,
|
|
2018
2027
|
"2025-06-18",
|
|
2019
2028
|
"2025-03-26",
|
|
2020
2029
|
"2024-11-05"
|
|
2021
|
-
],
|
|
2030
|
+
], Bo = a.optional(a.record(a.string(), a.unknown())), Go = a.looseObject({
|
|
2022
2031
|
name: a.string(),
|
|
2023
2032
|
version: a.string(),
|
|
2024
2033
|
title: a.optional(a.string())
|
|
@@ -2029,7 +2038,7 @@ var we = "2025-11-25", Jo = [
|
|
|
2029
2038
|
params: a.optional(Re)
|
|
2030
2039
|
}), Rr = a.object({
|
|
2031
2040
|
applyDefaults: a.optional(a.boolean())
|
|
2032
|
-
}).loose(),
|
|
2041
|
+
}).loose(), Ko = a.looseObject({
|
|
2033
2042
|
experimental: a.optional(a.object({}).loose()),
|
|
2034
2043
|
logging: a.optional(a.object({}).loose()),
|
|
2035
2044
|
completions: a.optional(a.object({}).loose()),
|
|
@@ -2054,14 +2063,14 @@ var we = "2025-11-25", Jo = [
|
|
|
2054
2063
|
a.object({
|
|
2055
2064
|
elicitation: a.optional(Rr)
|
|
2056
2065
|
}).loose();
|
|
2057
|
-
var
|
|
2066
|
+
var Yo = ne.extend({
|
|
2058
2067
|
protocolVersion: a.string(),
|
|
2059
|
-
capabilities:
|
|
2060
|
-
serverInfo:
|
|
2068
|
+
capabilities: Ko,
|
|
2069
|
+
serverInfo: Go,
|
|
2061
2070
|
instructions: a.optional(a.string())
|
|
2062
2071
|
}), Et = ne.extend({
|
|
2063
2072
|
nextCursor: a.optional(a.string())
|
|
2064
|
-
}),
|
|
2073
|
+
}), Xo = a.object({
|
|
2065
2074
|
name: a.string(),
|
|
2066
2075
|
/**
|
|
2067
2076
|
* @see https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool
|
|
@@ -2081,9 +2090,9 @@ var Ko = ne.extend({
|
|
|
2081
2090
|
title: a.optional(a.string())
|
|
2082
2091
|
}).loose()
|
|
2083
2092
|
),
|
|
2084
|
-
_meta:
|
|
2085
|
-
}).loose(),
|
|
2086
|
-
tools: a.array(
|
|
2093
|
+
_meta: Bo
|
|
2094
|
+
}).loose(), Qo = Et.extend({
|
|
2095
|
+
tools: a.array(Xo)
|
|
2087
2096
|
}), kr = a.object({
|
|
2088
2097
|
type: a.literal("text"),
|
|
2089
2098
|
text: a.string()
|
|
@@ -2091,15 +2100,15 @@ var Ko = ne.extend({
|
|
|
2091
2100
|
type: a.literal("image"),
|
|
2092
2101
|
data: a.base64(),
|
|
2093
2102
|
mimeType: a.string()
|
|
2094
|
-
}).loose(),
|
|
2103
|
+
}).loose(), es = a.object({
|
|
2095
2104
|
uri: a.string(),
|
|
2096
2105
|
name: a.string(),
|
|
2097
2106
|
title: a.optional(a.string()),
|
|
2098
2107
|
description: a.optional(a.string()),
|
|
2099
2108
|
mimeType: a.optional(a.string()),
|
|
2100
2109
|
size: a.optional(a.number())
|
|
2101
|
-
}).loose(),
|
|
2102
|
-
resources: a.array(
|
|
2110
|
+
}).loose(), ts = Et.extend({
|
|
2111
|
+
resources: a.array(es)
|
|
2103
2112
|
}), Ar = a.object({
|
|
2104
2113
|
/**
|
|
2105
2114
|
* The URI of this resource.
|
|
@@ -2130,7 +2139,7 @@ var Ko = ne.extend({
|
|
|
2130
2139
|
name: a.string(),
|
|
2131
2140
|
description: a.optional(a.string()),
|
|
2132
2141
|
mimeType: a.optional(a.string())
|
|
2133
|
-
}).loose(),
|
|
2142
|
+
}).loose(), rs = ne.extend({
|
|
2134
2143
|
content: a.array(
|
|
2135
2144
|
a.union([
|
|
2136
2145
|
kr,
|
|
@@ -2148,55 +2157,55 @@ var Ko = ne.extend({
|
|
|
2148
2157
|
ne.extend({
|
|
2149
2158
|
toolResult: a.unknown()
|
|
2150
2159
|
})
|
|
2151
|
-
),
|
|
2160
|
+
), ns = a.object({
|
|
2152
2161
|
uriTemplate: a.string(),
|
|
2153
2162
|
name: a.string(),
|
|
2154
2163
|
title: a.optional(a.string()),
|
|
2155
2164
|
description: a.optional(a.string()),
|
|
2156
2165
|
mimeType: a.optional(a.string())
|
|
2157
|
-
}).loose(),
|
|
2158
|
-
resourceTemplates: a.array(
|
|
2159
|
-
}),
|
|
2166
|
+
}).loose(), os = ne.extend({
|
|
2167
|
+
resourceTemplates: a.array(ns)
|
|
2168
|
+
}), ss = ne.extend({
|
|
2160
2169
|
contents: a.array(
|
|
2161
2170
|
a.union([Ir, Mr])
|
|
2162
2171
|
)
|
|
2163
|
-
}),
|
|
2172
|
+
}), is = a.object({
|
|
2164
2173
|
type: a.literal("ref/prompt"),
|
|
2165
2174
|
name: a.string()
|
|
2166
|
-
}).loose(),
|
|
2175
|
+
}).loose(), as = a.object({
|
|
2167
2176
|
type: a.literal("ref/resource"),
|
|
2168
2177
|
uri: a.string()
|
|
2169
|
-
}).loose(),
|
|
2178
|
+
}).loose(), ls = a.object({
|
|
2170
2179
|
name: a.string(),
|
|
2171
2180
|
value: a.string()
|
|
2172
2181
|
}).loose();
|
|
2173
2182
|
Re.extend({
|
|
2174
|
-
ref: a.union([
|
|
2175
|
-
argument:
|
|
2183
|
+
ref: a.union([is, as]),
|
|
2184
|
+
argument: ls,
|
|
2176
2185
|
context: a.optional(
|
|
2177
2186
|
a.object({
|
|
2178
2187
|
arguments: a.record(a.string(), a.string())
|
|
2179
2188
|
}).loose()
|
|
2180
2189
|
)
|
|
2181
2190
|
});
|
|
2182
|
-
var
|
|
2191
|
+
var cs = ne.extend({
|
|
2183
2192
|
completion: a.object({
|
|
2184
2193
|
values: a.array(a.string()).max(100),
|
|
2185
2194
|
total: a.optional(a.number().int()),
|
|
2186
2195
|
hasMore: a.optional(a.boolean())
|
|
2187
2196
|
}).loose()
|
|
2188
|
-
}),
|
|
2197
|
+
}), us = a.object({
|
|
2189
2198
|
name: a.string(),
|
|
2190
2199
|
description: a.optional(a.string()),
|
|
2191
2200
|
required: a.optional(a.boolean())
|
|
2192
|
-
}).loose(),
|
|
2201
|
+
}).loose(), ds = a.object({
|
|
2193
2202
|
name: a.string(),
|
|
2194
2203
|
title: a.optional(a.string()),
|
|
2195
2204
|
description: a.optional(a.string()),
|
|
2196
|
-
arguments: a.optional(a.array(
|
|
2197
|
-
}).loose(),
|
|
2198
|
-
prompts: a.array(
|
|
2199
|
-
}),
|
|
2205
|
+
arguments: a.optional(a.array(us))
|
|
2206
|
+
}).loose(), fs = Et.extend({
|
|
2207
|
+
prompts: a.array(ds)
|
|
2208
|
+
}), ps = a.object({
|
|
2200
2209
|
role: a.union([a.literal("user"), a.literal("assistant")]),
|
|
2201
2210
|
content: a.union([
|
|
2202
2211
|
kr,
|
|
@@ -2204,30 +2213,30 @@ var ls = ne.extend({
|
|
|
2204
2213
|
jr,
|
|
2205
2214
|
Nr
|
|
2206
2215
|
])
|
|
2207
|
-
}).loose(),
|
|
2216
|
+
}).loose(), hs = ne.extend({
|
|
2208
2217
|
description: a.optional(a.string()),
|
|
2209
|
-
messages: a.array(
|
|
2210
|
-
}),
|
|
2218
|
+
messages: a.array(ps)
|
|
2219
|
+
}), ms = Re.extend({
|
|
2211
2220
|
message: a.string(),
|
|
2212
2221
|
requestedSchema: a.unknown()
|
|
2213
2222
|
}), Bt = Pr.extend({
|
|
2214
2223
|
method: a.literal("elicitation/create"),
|
|
2215
|
-
params:
|
|
2216
|
-
}),
|
|
2224
|
+
params: ms
|
|
2225
|
+
}), gs = ne.extend({
|
|
2217
2226
|
action: a.union([
|
|
2218
2227
|
a.literal("accept"),
|
|
2219
2228
|
a.literal("decline"),
|
|
2220
2229
|
a.literal("cancel")
|
|
2221
2230
|
]),
|
|
2222
2231
|
content: a.optional(a.record(a.string(), a.unknown()))
|
|
2223
|
-
}), Qe = "2.0",
|
|
2232
|
+
}), Qe = "2.0", ys = a.object({
|
|
2224
2233
|
jsonrpc: a.literal(Qe),
|
|
2225
2234
|
id: a.union([a.string(), a.number().int()])
|
|
2226
|
-
}).merge(Pr).strict(),
|
|
2235
|
+
}).merge(Pr).strict(), vs = a.object({
|
|
2227
2236
|
jsonrpc: a.literal(Qe),
|
|
2228
2237
|
id: a.union([a.string(), a.number().int()]),
|
|
2229
2238
|
result: ne
|
|
2230
|
-
}).strict(),
|
|
2239
|
+
}).strict(), ws = a.object({
|
|
2231
2240
|
jsonrpc: a.literal(Qe),
|
|
2232
2241
|
id: a.union([a.string(), a.number().int()]),
|
|
2233
2242
|
error: a.object({
|
|
@@ -2235,26 +2244,26 @@ var ls = ne.extend({
|
|
|
2235
2244
|
message: a.string(),
|
|
2236
2245
|
data: a.optional(a.unknown())
|
|
2237
2246
|
})
|
|
2238
|
-
}).strict(),
|
|
2247
|
+
}).strict(), bs = a.object({
|
|
2239
2248
|
jsonrpc: a.literal(Qe)
|
|
2240
2249
|
}).merge(
|
|
2241
2250
|
a.object({
|
|
2242
2251
|
method: a.string(),
|
|
2243
2252
|
params: a.optional(Re)
|
|
2244
2253
|
})
|
|
2245
|
-
).strict(),
|
|
2246
|
-
gs,
|
|
2247
|
-
ws,
|
|
2254
|
+
).strict(), _s = a.union([
|
|
2248
2255
|
ys,
|
|
2249
|
-
|
|
2256
|
+
bs,
|
|
2257
|
+
vs,
|
|
2258
|
+
ws
|
|
2250
2259
|
]);
|
|
2251
2260
|
function mt(e) {
|
|
2252
|
-
return
|
|
2261
|
+
return _s.parse(e);
|
|
2253
2262
|
}
|
|
2254
2263
|
async function gt(e) {
|
|
2255
2264
|
return mt(await $r({ text: e }));
|
|
2256
2265
|
}
|
|
2257
|
-
var
|
|
2266
|
+
var xs = "AI_MCPClientError", zr = `vercel.ai.error.${xs}`, Ss = Symbol.for(zr), Gt, Kt, A = class extends (Kt = qe, Gt = Ss, Kt) {
|
|
2258
2267
|
constructor({
|
|
2259
2268
|
name: e = "MCPClientError",
|
|
2260
2269
|
message: t,
|
|
@@ -2293,7 +2302,7 @@ var _s = "AI_MCPClientError", zr = `vercel.ai.error.${_s}`, xs = Symbol.for(zr),
|
|
|
2293
2302
|
refresh_token: a.string().optional(),
|
|
2294
2303
|
authorization_server: F.optional(),
|
|
2295
2304
|
token_endpoint: F.optional()
|
|
2296
|
-
}).strip(),
|
|
2305
|
+
}).strip(), Ts = a.object({
|
|
2297
2306
|
resource: a.string().url(),
|
|
2298
2307
|
authorization_servers: a.array(F).optional(),
|
|
2299
2308
|
jwks_uri: a.string().url().optional(),
|
|
@@ -2319,7 +2328,7 @@ var _s = "AI_MCPClientError", zr = `vercel.ai.error.${_s}`, xs = Symbol.for(zr),
|
|
|
2319
2328
|
code_challenge_methods_supported: a.array(a.string()),
|
|
2320
2329
|
token_endpoint_auth_methods_supported: a.array(a.string()).optional(),
|
|
2321
2330
|
token_endpoint_auth_signing_alg_values_supported: a.array(a.string()).optional()
|
|
2322
|
-
}).passthrough(),
|
|
2331
|
+
}).passthrough(), Cs = a.object({
|
|
2323
2332
|
issuer: a.string(),
|
|
2324
2333
|
authorization_endpoint: F,
|
|
2325
2334
|
token_endpoint: F,
|
|
@@ -2333,18 +2342,18 @@ var _s = "AI_MCPClientError", zr = `vercel.ai.error.${_s}`, xs = Symbol.for(zr),
|
|
|
2333
2342
|
id_token_signing_alg_values_supported: a.array(a.string()),
|
|
2334
2343
|
claims_supported: a.array(a.string()).optional(),
|
|
2335
2344
|
token_endpoint_auth_methods_supported: a.array(a.string()).optional()
|
|
2336
|
-
}).passthrough(),
|
|
2345
|
+
}).passthrough(), $s = Cs.merge(
|
|
2337
2346
|
Lr.pick({
|
|
2338
2347
|
code_challenge_methods_supported: !0
|
|
2339
2348
|
})
|
|
2340
|
-
),
|
|
2349
|
+
), Es = a.object({
|
|
2341
2350
|
client_id: a.string(),
|
|
2342
2351
|
client_secret: a.string().optional(),
|
|
2343
2352
|
client_id_issued_at: a.number().optional(),
|
|
2344
2353
|
client_secret_expires_at: a.number().optional(),
|
|
2345
2354
|
authorization_server: F.optional(),
|
|
2346
2355
|
token_endpoint: F.optional()
|
|
2347
|
-
}).strip(),
|
|
2356
|
+
}).strip(), Ps = a.object({
|
|
2348
2357
|
redirect_uris: a.array(F),
|
|
2349
2358
|
token_endpoint_auth_method: a.string().optional(),
|
|
2350
2359
|
grant_types: a.array(a.string()).optional(),
|
|
@@ -2361,13 +2370,13 @@ var _s = "AI_MCPClientError", zr = `vercel.ai.error.${_s}`, xs = Symbol.for(zr),
|
|
|
2361
2370
|
software_id: a.string().optional(),
|
|
2362
2371
|
software_version: a.string().optional(),
|
|
2363
2372
|
software_statement: a.string().optional()
|
|
2364
|
-
}).strip(),
|
|
2373
|
+
}).strip(), Rs = a.object({
|
|
2365
2374
|
error: a.string(),
|
|
2366
2375
|
error_description: a.string().optional(),
|
|
2367
2376
|
error_uri: a.string().optional()
|
|
2368
|
-
}),
|
|
2369
|
-
|
|
2370
|
-
),
|
|
2377
|
+
}), ks = Ps.merge(
|
|
2378
|
+
Es
|
|
2379
|
+
), Os = "AI_MCPClientOAuthError", qr = `vercel.ai.error.${Os}`, As = Symbol.for(qr), Yt, Xt, re = class extends (Xt = qe, Yt = As, Xt) {
|
|
2371
2380
|
constructor({
|
|
2372
2381
|
name: e = "MCPClientOAuthError",
|
|
2373
2382
|
message: t,
|
|
@@ -2390,13 +2399,13 @@ Fe.errorCode = "invalid_grant";
|
|
|
2390
2399
|
var Ze = class extends re {
|
|
2391
2400
|
};
|
|
2392
2401
|
Ze.errorCode = "unauthorized_client";
|
|
2393
|
-
var
|
|
2402
|
+
var Is = {
|
|
2394
2403
|
[ge.errorCode]: ge,
|
|
2395
2404
|
[He.errorCode]: He,
|
|
2396
2405
|
[Fe.errorCode]: Fe,
|
|
2397
2406
|
[Ze.errorCode]: Ze
|
|
2398
2407
|
};
|
|
2399
|
-
function
|
|
2408
|
+
function Ms(e) {
|
|
2400
2409
|
const t = typeof e == "string" ? new URL(e) : new URL(e.href);
|
|
2401
2410
|
return t.hash = "", t;
|
|
2402
2411
|
}
|
|
@@ -2404,7 +2413,7 @@ function Pt(e) {
|
|
|
2404
2413
|
const t = e.href;
|
|
2405
2414
|
return e.pathname === "/" && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
2406
2415
|
}
|
|
2407
|
-
function
|
|
2416
|
+
function js({
|
|
2408
2417
|
requestedResource: e,
|
|
2409
2418
|
configuredResource: t
|
|
2410
2419
|
}) {
|
|
@@ -2422,7 +2431,7 @@ var Ve = class extends Error {
|
|
|
2422
2431
|
function ye(e) {
|
|
2423
2432
|
return new URL(e).href;
|
|
2424
2433
|
}
|
|
2425
|
-
function
|
|
2434
|
+
function Ns(e, t) {
|
|
2426
2435
|
return {
|
|
2427
2436
|
authorizationServerUrl: ye(e),
|
|
2428
2437
|
tokenEndpoint: ye(
|
|
@@ -2470,7 +2479,7 @@ async function tr({
|
|
|
2470
2479
|
)
|
|
2471
2480
|
} : er(t);
|
|
2472
2481
|
}
|
|
2473
|
-
async function
|
|
2482
|
+
async function zs({
|
|
2474
2483
|
provider: e,
|
|
2475
2484
|
clientInformation: t,
|
|
2476
2485
|
authorizationServerInformation: r
|
|
@@ -2484,7 +2493,7 @@ async function Ns({
|
|
|
2484
2493
|
)
|
|
2485
2494
|
), !0) : !1;
|
|
2486
2495
|
}
|
|
2487
|
-
function
|
|
2496
|
+
function Us(e, t) {
|
|
2488
2497
|
if (!t)
|
|
2489
2498
|
return;
|
|
2490
2499
|
const r = new URL(e).origin;
|
|
@@ -2518,7 +2527,7 @@ function Je(e) {
|
|
|
2518
2527
|
return;
|
|
2519
2528
|
}
|
|
2520
2529
|
}
|
|
2521
|
-
function
|
|
2530
|
+
function Ds(e, t = "", r = {}) {
|
|
2522
2531
|
return t.endsWith("/") && (t = t.slice(0, -1)), r.prependPathname ? `${t}/.well-known/${e}` : `/.well-known/${e}${t}`;
|
|
2523
2532
|
}
|
|
2524
2533
|
async function Rt(e, t, r = fetch) {
|
|
@@ -2535,28 +2544,28 @@ async function nr(e, t, r = fetch) {
|
|
|
2535
2544
|
"MCP-Protocol-Version": t
|
|
2536
2545
|
}, r);
|
|
2537
2546
|
}
|
|
2538
|
-
function
|
|
2547
|
+
function Ls(e, t) {
|
|
2539
2548
|
return !e || e.status >= 400 && e.status < 500 && t !== "/";
|
|
2540
2549
|
}
|
|
2541
|
-
async function
|
|
2550
|
+
async function qs(e, t, r, n) {
|
|
2542
2551
|
var o, s;
|
|
2543
2552
|
const i = new URL(e), l = (o = n?.protocolVersion) != null ? o : we;
|
|
2544
2553
|
let u;
|
|
2545
2554
|
if (n?.metadataUrl)
|
|
2546
2555
|
u = new URL(n.metadataUrl);
|
|
2547
2556
|
else {
|
|
2548
|
-
const d =
|
|
2557
|
+
const d = Ds(t, i.pathname);
|
|
2549
2558
|
u = new URL(d, (s = n?.metadataServerUrl) != null ? s : i), u.search = i.search;
|
|
2550
2559
|
}
|
|
2551
2560
|
let c = await nr(u, l, r);
|
|
2552
|
-
if (!n?.metadataUrl &&
|
|
2561
|
+
if (!n?.metadataUrl && Ls(c, i.pathname)) {
|
|
2553
2562
|
const d = new URL(`/.well-known/${t}`, i);
|
|
2554
2563
|
c = await nr(d, l, r);
|
|
2555
2564
|
}
|
|
2556
2565
|
return c;
|
|
2557
2566
|
}
|
|
2558
|
-
async function
|
|
2559
|
-
const n = await
|
|
2567
|
+
async function Hs(e, t, r = fetch) {
|
|
2568
|
+
const n = await qs(
|
|
2560
2569
|
e,
|
|
2561
2570
|
"oauth-protected-resource",
|
|
2562
2571
|
r,
|
|
@@ -2573,9 +2582,9 @@ async function qs(e, t, r = fetch) {
|
|
|
2573
2582
|
throw new Error(
|
|
2574
2583
|
`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`
|
|
2575
2584
|
);
|
|
2576
|
-
return
|
|
2585
|
+
return Ts.parse(await n.json());
|
|
2577
2586
|
}
|
|
2578
|
-
function
|
|
2587
|
+
function Fs(e) {
|
|
2579
2588
|
const t = typeof e == "string" ? new URL(e) : e, r = t.pathname !== "/", n = t.origin, o = [];
|
|
2580
2589
|
if (!r)
|
|
2581
2590
|
return o.push({
|
|
@@ -2617,12 +2626,12 @@ function or(e, t) {
|
|
|
2617
2626
|
message: `OAuth authorization server metadata issuer ${e.issuer} does not match expected issuer ${t}`
|
|
2618
2627
|
});
|
|
2619
2628
|
}
|
|
2620
|
-
async function
|
|
2629
|
+
async function Zs(e, {
|
|
2621
2630
|
fetchFn: t = fetch,
|
|
2622
2631
|
protocolVersion: r = we
|
|
2623
2632
|
} = {}) {
|
|
2624
2633
|
var n;
|
|
2625
|
-
const o = { "MCP-Protocol-Version": r }, s =
|
|
2634
|
+
const o = { "MCP-Protocol-Version": r }, s = Fs(e);
|
|
2626
2635
|
for (const { url: i, type: l, expectedIssuer: u } of s) {
|
|
2627
2636
|
const c = await Rt(i, o, t);
|
|
2628
2637
|
if (c) {
|
|
@@ -2637,7 +2646,7 @@ async function Fs(e, {
|
|
|
2637
2646
|
const d = Lr.parse(await c.json());
|
|
2638
2647
|
return or(d, u), d;
|
|
2639
2648
|
} else {
|
|
2640
|
-
const d =
|
|
2649
|
+
const d = $s.parse(
|
|
2641
2650
|
await c.json()
|
|
2642
2651
|
);
|
|
2643
2652
|
if (or(d, u), !((n = d.code_challenge_methods_supported) != null && n.includes("S256")))
|
|
@@ -2649,7 +2658,7 @@ async function Fs(e, {
|
|
|
2649
2658
|
}
|
|
2650
2659
|
}
|
|
2651
2660
|
}
|
|
2652
|
-
async function
|
|
2661
|
+
async function Vs(e, {
|
|
2653
2662
|
metadata: t,
|
|
2654
2663
|
clientInformation: r,
|
|
2655
2664
|
redirectUrl: n,
|
|
@@ -2670,7 +2679,7 @@ async function Zs(e, {
|
|
|
2670
2679
|
);
|
|
2671
2680
|
} else
|
|
2672
2681
|
c = new URL("/authorize", e);
|
|
2673
|
-
const d = await
|
|
2682
|
+
const d = await Jo(), p = d.code_verifier, f = d.code_challenge;
|
|
2674
2683
|
return c.searchParams.set("response_type", l), c.searchParams.set("client_id", r.client_id), c.searchParams.set("code_challenge", f), c.searchParams.set(
|
|
2675
2684
|
"code_challenge_method",
|
|
2676
2685
|
u
|
|
@@ -2687,19 +2696,19 @@ function Zr(e, t, r, n) {
|
|
|
2687
2696
|
const { client_id: o, client_secret: s } = t;
|
|
2688
2697
|
switch (e) {
|
|
2689
2698
|
case "client_secret_basic":
|
|
2690
|
-
|
|
2699
|
+
Js(o, s, r);
|
|
2691
2700
|
return;
|
|
2692
2701
|
case "client_secret_post":
|
|
2693
|
-
|
|
2702
|
+
Ws(o, s, n);
|
|
2694
2703
|
return;
|
|
2695
2704
|
case "none":
|
|
2696
|
-
|
|
2705
|
+
Bs(o, n);
|
|
2697
2706
|
return;
|
|
2698
2707
|
default:
|
|
2699
2708
|
throw new Error(`Unsupported client authentication method: ${e}`);
|
|
2700
2709
|
}
|
|
2701
2710
|
}
|
|
2702
|
-
function
|
|
2711
|
+
function Js(e, t, r) {
|
|
2703
2712
|
if (!t)
|
|
2704
2713
|
throw new Error(
|
|
2705
2714
|
"client_secret_basic authentication requires a client_secret"
|
|
@@ -2707,18 +2716,18 @@ function Vs(e, t, r) {
|
|
|
2707
2716
|
const n = btoa(`${e}:${t}`);
|
|
2708
2717
|
r.set("Authorization", `Basic ${n}`);
|
|
2709
2718
|
}
|
|
2710
|
-
function
|
|
2719
|
+
function Ws(e, t, r) {
|
|
2711
2720
|
r.set("client_id", e), t && r.set("client_secret", t);
|
|
2712
2721
|
}
|
|
2713
|
-
function
|
|
2722
|
+
function Bs(e, t) {
|
|
2714
2723
|
t.set("client_id", e);
|
|
2715
2724
|
}
|
|
2716
2725
|
async function kt(e) {
|
|
2717
2726
|
const t = e instanceof Response ? e.status : void 0, r = e instanceof Response ? await e.text() : e;
|
|
2718
2727
|
try {
|
|
2719
|
-
const n =
|
|
2728
|
+
const n = Rs.parse(
|
|
2720
2729
|
await $r({ text: r })
|
|
2721
|
-
), { error: o, error_description: s, error_uri: i } = n, l =
|
|
2730
|
+
), { error: o, error_description: s, error_uri: i } = n, l = Is[o] || ge;
|
|
2722
2731
|
return new l({
|
|
2723
2732
|
message: s || "",
|
|
2724
2733
|
cause: i
|
|
@@ -2728,7 +2737,7 @@ async function kt(e) {
|
|
|
2728
2737
|
return new ge({ message: o });
|
|
2729
2738
|
}
|
|
2730
2739
|
}
|
|
2731
|
-
async function
|
|
2740
|
+
async function Gs(e, {
|
|
2732
2741
|
metadata: t,
|
|
2733
2742
|
clientInformation: r,
|
|
2734
2743
|
authorizationCode: n,
|
|
@@ -2777,7 +2786,7 @@ async function Bs(e, {
|
|
|
2777
2786
|
throw await kt(m);
|
|
2778
2787
|
return Dr.parse(await m.json());
|
|
2779
2788
|
}
|
|
2780
|
-
async function
|
|
2789
|
+
async function Ks(e, {
|
|
2781
2790
|
metadata: t,
|
|
2782
2791
|
clientInformation: r,
|
|
2783
2792
|
refreshToken: n,
|
|
@@ -2829,7 +2838,7 @@ async function Gs(e, {
|
|
|
2829
2838
|
...await f.json()
|
|
2830
2839
|
});
|
|
2831
2840
|
}
|
|
2832
|
-
async function
|
|
2841
|
+
async function Ys(e, {
|
|
2833
2842
|
metadata: t,
|
|
2834
2843
|
clientMetadata: r,
|
|
2835
2844
|
fetchFn: n
|
|
@@ -2852,7 +2861,7 @@ async function Ks(e, {
|
|
|
2852
2861
|
});
|
|
2853
2862
|
if (!s.ok)
|
|
2854
2863
|
throw await kt(s);
|
|
2855
|
-
return
|
|
2864
|
+
return ks.parse(await s.json());
|
|
2856
2865
|
}
|
|
2857
2866
|
async function yt(e, t) {
|
|
2858
2867
|
var r, n;
|
|
@@ -2866,15 +2875,15 @@ async function yt(e, t) {
|
|
|
2866
2875
|
throw o;
|
|
2867
2876
|
}
|
|
2868
2877
|
}
|
|
2869
|
-
async function
|
|
2870
|
-
const n =
|
|
2878
|
+
async function Xs(e, t, r) {
|
|
2879
|
+
const n = Ms(e);
|
|
2871
2880
|
if (t.validateResourceURL)
|
|
2872
2881
|
return await t.validateResourceURL(
|
|
2873
2882
|
n,
|
|
2874
2883
|
r?.resource
|
|
2875
2884
|
);
|
|
2876
2885
|
if (r) {
|
|
2877
|
-
if (!
|
|
2886
|
+
if (!js({
|
|
2878
2887
|
requestedResource: n,
|
|
2879
2888
|
configuredResource: r.resource
|
|
2880
2889
|
}))
|
|
@@ -2894,9 +2903,9 @@ async function ut(e, {
|
|
|
2894
2903
|
}) {
|
|
2895
2904
|
var l, u;
|
|
2896
2905
|
let c, d;
|
|
2897
|
-
|
|
2906
|
+
Us(t, s);
|
|
2898
2907
|
try {
|
|
2899
|
-
c = await
|
|
2908
|
+
c = await Hs(
|
|
2900
2909
|
t,
|
|
2901
2910
|
{ resourceMetadataUrl: s },
|
|
2902
2911
|
i
|
|
@@ -2904,7 +2913,7 @@ async function ut(e, {
|
|
|
2904
2913
|
} catch {
|
|
2905
2914
|
}
|
|
2906
2915
|
d || (d = t);
|
|
2907
|
-
const p = await
|
|
2916
|
+
const p = await Xs(
|
|
2908
2917
|
t,
|
|
2909
2918
|
e,
|
|
2910
2919
|
c
|
|
@@ -2914,12 +2923,12 @@ async function ut(e, {
|
|
|
2914
2923
|
t,
|
|
2915
2924
|
d
|
|
2916
2925
|
));
|
|
2917
|
-
const f = await
|
|
2926
|
+
const f = await Zs(
|
|
2918
2927
|
d,
|
|
2919
2928
|
{
|
|
2920
2929
|
fetchFn: i
|
|
2921
2930
|
}
|
|
2922
|
-
), v =
|
|
2931
|
+
), v = Ns(d, f);
|
|
2923
2932
|
let m = await Promise.resolve(e.clientInformation());
|
|
2924
2933
|
if (!m) {
|
|
2925
2934
|
if (r !== void 0)
|
|
@@ -2930,7 +2939,7 @@ async function ut(e, {
|
|
|
2930
2939
|
throw new Error(
|
|
2931
2940
|
"OAuth client information must be saveable for dynamic registration"
|
|
2932
2941
|
);
|
|
2933
|
-
const j = await
|
|
2942
|
+
const j = await Ys(d, {
|
|
2934
2943
|
metadata: f,
|
|
2935
2944
|
clientMetadata: e.clientMetadata,
|
|
2936
2945
|
fetchFn: i
|
|
@@ -2960,7 +2969,7 @@ async function ut(e, {
|
|
|
2960
2969
|
storedAuthorizationServerInformation: j,
|
|
2961
2970
|
currentAuthorizationServerInformation: v
|
|
2962
2971
|
});
|
|
2963
|
-
const h = await e.codeVerifier(), g = await
|
|
2972
|
+
const h = await e.codeVerifier(), g = await Gs(d, {
|
|
2964
2973
|
metadata: f,
|
|
2965
2974
|
clientInformation: m,
|
|
2966
2975
|
authorizationCode: r,
|
|
@@ -2990,7 +2999,7 @@ async function ut(e, {
|
|
|
2990
2999
|
}) : await ((u = e.invalidateCredentials) == null ? void 0 : u.call(e, "tokens"));
|
|
2991
3000
|
try {
|
|
2992
3001
|
if (j) {
|
|
2993
|
-
const h = await
|
|
3002
|
+
const h = await Ks(d, {
|
|
2994
3003
|
metadata: f,
|
|
2995
3004
|
clientInformation: m,
|
|
2996
3005
|
refreshToken: S.refresh_token,
|
|
@@ -3014,7 +3023,7 @@ async function ut(e, {
|
|
|
3014
3023
|
}
|
|
3015
3024
|
const x = e.state ? await e.state() : void 0;
|
|
3016
3025
|
x && e.saveState && await e.saveState(x);
|
|
3017
|
-
const { authorizationUrl: R, codeVerifier: M } = await
|
|
3026
|
+
const { authorizationUrl: R, codeVerifier: M } = await Vs(
|
|
3018
3027
|
d,
|
|
3019
3028
|
{
|
|
3020
3029
|
metadata: f,
|
|
@@ -3025,7 +3034,7 @@ async function ut(e, {
|
|
|
3025
3034
|
resource: p
|
|
3026
3035
|
}
|
|
3027
3036
|
);
|
|
3028
|
-
if (!await
|
|
3037
|
+
if (!await zs({
|
|
3029
3038
|
provider: e,
|
|
3030
3039
|
clientInformation: m,
|
|
3031
3040
|
authorizationServerInformation: v
|
|
@@ -3035,10 +3044,10 @@ async function ut(e, {
|
|
|
3035
3044
|
});
|
|
3036
3045
|
return await e.saveCodeVerifier(M), await e.redirectToAuthorization(R), "REDIRECT";
|
|
3037
3046
|
}
|
|
3038
|
-
function
|
|
3047
|
+
function Qs(e) {
|
|
3039
3048
|
return e === void 0 || e === "message";
|
|
3040
3049
|
}
|
|
3041
|
-
var
|
|
3050
|
+
var ei = class {
|
|
3042
3051
|
constructor({
|
|
3043
3052
|
url: e,
|
|
3044
3053
|
headers: t,
|
|
@@ -3129,7 +3138,7 @@ var Qs = class {
|
|
|
3129
3138
|
message: `MCP SSE Transport Error: Endpoint origin does not match connection origin: ${_.origin}`
|
|
3130
3139
|
});
|
|
3131
3140
|
this.endpoint = _, this.connected = !0, e();
|
|
3132
|
-
} else if (
|
|
3141
|
+
} else if (Qs(h))
|
|
3133
3142
|
try {
|
|
3134
3143
|
const _ = await gt(g);
|
|
3135
3144
|
(x = this.onmessage) == null || x.call(this, _);
|
|
@@ -3216,7 +3225,7 @@ var Qs = class {
|
|
|
3216
3225
|
function sr(e) {
|
|
3217
3226
|
return e === void 0 || e === "message";
|
|
3218
3227
|
}
|
|
3219
|
-
var
|
|
3228
|
+
var ti = class {
|
|
3220
3229
|
constructor({
|
|
3221
3230
|
url: e,
|
|
3222
3231
|
headers: t,
|
|
@@ -3506,22 +3515,22 @@ var ei = class {
|
|
|
3506
3515
|
}
|
|
3507
3516
|
}
|
|
3508
3517
|
};
|
|
3509
|
-
function
|
|
3518
|
+
function ri(e) {
|
|
3510
3519
|
switch (e.type) {
|
|
3511
3520
|
case "sse":
|
|
3512
|
-
return new Qs(e);
|
|
3513
|
-
case "http":
|
|
3514
3521
|
return new ei(e);
|
|
3522
|
+
case "http":
|
|
3523
|
+
return new ti(e);
|
|
3515
3524
|
default:
|
|
3516
3525
|
throw new A({
|
|
3517
3526
|
message: "Unsupported or invalid transport configuration. If you are using a custom transport, make sure it implements the MCPTransport interface."
|
|
3518
3527
|
});
|
|
3519
3528
|
}
|
|
3520
3529
|
}
|
|
3521
|
-
function
|
|
3530
|
+
function ni(e) {
|
|
3522
3531
|
return "start" in e && typeof e.start == "function" && "send" in e && typeof e.send == "function" && "close" in e && typeof e.close == "function";
|
|
3523
3532
|
}
|
|
3524
|
-
var
|
|
3533
|
+
var oi = "1.0.0", si = 0, ii = [
|
|
3525
3534
|
"ConnectionRefused",
|
|
3526
3535
|
"ConnectionClosed",
|
|
3527
3536
|
"FailedToOpenSocket",
|
|
@@ -3530,26 +3539,26 @@ var ni = "1.0.0", oi = 0, si = [
|
|
|
3530
3539
|
"ETIMEDOUT",
|
|
3531
3540
|
"EPIPE"
|
|
3532
3541
|
];
|
|
3533
|
-
function
|
|
3542
|
+
function ai(e) {
|
|
3534
3543
|
if (e != null && typeof e == "object" && "statusCode" in e && typeof e.statusCode == "number")
|
|
3535
3544
|
return e.statusCode;
|
|
3536
3545
|
}
|
|
3537
|
-
function
|
|
3546
|
+
function li(e) {
|
|
3538
3547
|
if (e != null && typeof e == "object" && "code" in e && typeof e.code == "string")
|
|
3539
3548
|
return e.code;
|
|
3540
3549
|
}
|
|
3541
|
-
function
|
|
3542
|
-
const t =
|
|
3550
|
+
function ci(e) {
|
|
3551
|
+
const t = ai(e);
|
|
3543
3552
|
if (t != null)
|
|
3544
3553
|
return t === 408 || t === 409 || t === 429 || t >= 500;
|
|
3545
3554
|
if (A.isInstance(e) && e.code != null)
|
|
3546
3555
|
return !1;
|
|
3547
|
-
const r =
|
|
3548
|
-
return r != null &&
|
|
3556
|
+
const r = li(e);
|
|
3557
|
+
return r != null && ii.includes(r);
|
|
3549
3558
|
}
|
|
3550
|
-
function
|
|
3559
|
+
function ui(e) {
|
|
3551
3560
|
if (e == null)
|
|
3552
|
-
return
|
|
3561
|
+
return si;
|
|
3553
3562
|
if (!Number.isInteger(e))
|
|
3554
3563
|
throw new A({
|
|
3555
3564
|
message: "maxRetries must be an integer"
|
|
@@ -3572,21 +3581,21 @@ function ir({
|
|
|
3572
3581
|
} : { type: "text", text: JSON.stringify(n) }
|
|
3573
3582
|
) };
|
|
3574
3583
|
}
|
|
3575
|
-
async function
|
|
3576
|
-
const t = new
|
|
3584
|
+
async function di(e) {
|
|
3585
|
+
const t = new fi(e);
|
|
3577
3586
|
return await t.init(), t;
|
|
3578
3587
|
}
|
|
3579
|
-
var
|
|
3588
|
+
var fi = class {
|
|
3580
3589
|
constructor({
|
|
3581
3590
|
transport: e,
|
|
3582
3591
|
name: t,
|
|
3583
3592
|
clientName: r = t ?? "ai-sdk-mcp-client",
|
|
3584
|
-
version: n =
|
|
3593
|
+
version: n = oi,
|
|
3585
3594
|
onUncaughtError: o,
|
|
3586
3595
|
maxRetries: s,
|
|
3587
3596
|
capabilities: i
|
|
3588
3597
|
}) {
|
|
3589
|
-
this.requestMessageId = 0, this.responseHandlers = /* @__PURE__ */ new Map(), this.serverCapabilities = {}, this._serverInfo = { name: "", version: "" }, this.isClosed = !0, this.onUncaughtError = o, this.maxRetries =
|
|
3598
|
+
this.requestMessageId = 0, this.responseHandlers = /* @__PURE__ */ new Map(), this.serverCapabilities = {}, this._serverInfo = { name: "", version: "" }, this.isClosed = !0, this.onUncaughtError = o, this.maxRetries = ui(s), this.clientCapabilities = i ?? {}, ni(e) ? this.transport = e : this.transport = ri(e), this.transport.onclose = () => this.onClose(), this.transport.onerror = (l) => this.onError(l), this.transport.onmessage = (l) => {
|
|
3590
3599
|
if ("method" in l) {
|
|
3591
3600
|
"id" in l ? this.onRequestMessage(l) : this.onError(
|
|
3592
3601
|
new A({
|
|
@@ -3619,13 +3628,13 @@ var di = class {
|
|
|
3619
3628
|
clientInfo: this.clientInfo
|
|
3620
3629
|
}
|
|
3621
3630
|
},
|
|
3622
|
-
resultSchema:
|
|
3631
|
+
resultSchema: Yo
|
|
3623
3632
|
});
|
|
3624
3633
|
if (e === void 0)
|
|
3625
3634
|
throw new A({
|
|
3626
3635
|
message: "Server sent invalid initialize result"
|
|
3627
3636
|
});
|
|
3628
|
-
if (!
|
|
3637
|
+
if (!Wo.includes(e.protocolVersion))
|
|
3629
3638
|
throw new A({
|
|
3630
3639
|
message: `Server's protocol version is not supported: ${e.protocolVersion}`
|
|
3631
3640
|
});
|
|
@@ -3737,7 +3746,7 @@ var di = class {
|
|
|
3737
3746
|
} = {}) {
|
|
3738
3747
|
return this.request({
|
|
3739
3748
|
request: { method: "tools/list", params: e },
|
|
3740
|
-
resultSchema:
|
|
3749
|
+
resultSchema: Qo,
|
|
3741
3750
|
options: t
|
|
3742
3751
|
});
|
|
3743
3752
|
}
|
|
@@ -3745,10 +3754,10 @@ var di = class {
|
|
|
3745
3754
|
options: e,
|
|
3746
3755
|
execute: t
|
|
3747
3756
|
}) {
|
|
3748
|
-
return this.maxRetries === 0 ? t() :
|
|
3757
|
+
return this.maxRetries === 0 ? t() : qo({
|
|
3749
3758
|
maxRetries: this.maxRetries,
|
|
3750
3759
|
abortSignal: e?.abortSignal,
|
|
3751
|
-
shouldRetry:
|
|
3760
|
+
shouldRetry: ci,
|
|
3752
3761
|
createRetryError: ({ message: r, errors: n }) => new A({
|
|
3753
3762
|
message: r,
|
|
3754
3763
|
cause: n[n.length - 1]
|
|
@@ -3768,7 +3777,7 @@ var di = class {
|
|
|
3768
3777
|
method: "tools/call",
|
|
3769
3778
|
params: { name: e, arguments: t }
|
|
3770
3779
|
},
|
|
3771
|
-
resultSchema:
|
|
3780
|
+
resultSchema: rs,
|
|
3772
3781
|
options: {
|
|
3773
3782
|
signal: r?.abortSignal
|
|
3774
3783
|
}
|
|
@@ -3785,7 +3794,7 @@ var di = class {
|
|
|
3785
3794
|
try {
|
|
3786
3795
|
return this.request({
|
|
3787
3796
|
request: { method: "resources/list", params: e },
|
|
3788
|
-
resultSchema:
|
|
3797
|
+
resultSchema: ts,
|
|
3789
3798
|
options: t
|
|
3790
3799
|
});
|
|
3791
3800
|
} catch (r) {
|
|
@@ -3799,7 +3808,7 @@ var di = class {
|
|
|
3799
3808
|
try {
|
|
3800
3809
|
return this.request({
|
|
3801
3810
|
request: { method: "resources/read", params: { uri: e } },
|
|
3802
|
-
resultSchema:
|
|
3811
|
+
resultSchema: ss,
|
|
3803
3812
|
options: t
|
|
3804
3813
|
});
|
|
3805
3814
|
} catch (r) {
|
|
@@ -3812,7 +3821,7 @@ var di = class {
|
|
|
3812
3821
|
try {
|
|
3813
3822
|
return this.request({
|
|
3814
3823
|
request: { method: "resources/templates/list" },
|
|
3815
|
-
resultSchema:
|
|
3824
|
+
resultSchema: os,
|
|
3816
3825
|
options: e
|
|
3817
3826
|
});
|
|
3818
3827
|
} catch (t) {
|
|
@@ -3826,7 +3835,7 @@ var di = class {
|
|
|
3826
3835
|
try {
|
|
3827
3836
|
return this.request({
|
|
3828
3837
|
request: { method: "prompts/list", params: e },
|
|
3829
|
-
resultSchema:
|
|
3838
|
+
resultSchema: fs,
|
|
3830
3839
|
options: t
|
|
3831
3840
|
});
|
|
3832
3841
|
} catch (r) {
|
|
@@ -3841,7 +3850,7 @@ var di = class {
|
|
|
3841
3850
|
try {
|
|
3842
3851
|
return this.request({
|
|
3843
3852
|
request: { method: "prompts/get", params: { name: e, arguments: t } },
|
|
3844
|
-
resultSchema:
|
|
3853
|
+
resultSchema: hs,
|
|
3845
3854
|
options: r
|
|
3846
3855
|
});
|
|
3847
3856
|
} catch (n) {
|
|
@@ -3854,7 +3863,7 @@ var di = class {
|
|
|
3854
3863
|
}) {
|
|
3855
3864
|
return this.request({
|
|
3856
3865
|
request: { method: "completion/complete", params: t },
|
|
3857
|
-
resultSchema:
|
|
3866
|
+
resultSchema: cs,
|
|
3858
3867
|
options: e
|
|
3859
3868
|
});
|
|
3860
3869
|
}
|
|
@@ -3900,7 +3909,7 @@ var di = class {
|
|
|
3900
3909
|
(M = R?.abortSignal) == null || M.throwIfAborted();
|
|
3901
3910
|
const O = await f.callTool({ name: s, args: x, options: R });
|
|
3902
3911
|
return O.isError ? O : v != null ? f.extractStructuredContent(O, v, s) : O;
|
|
3903
|
-
}, S = t === "automatic" ?
|
|
3912
|
+
}, S = t === "automatic" ? Lo({
|
|
3904
3913
|
description: l,
|
|
3905
3914
|
title: p,
|
|
3906
3915
|
metadata: {
|
|
@@ -3947,7 +3956,7 @@ var di = class {
|
|
|
3947
3956
|
if ("content" in e && Array.isArray(e.content)) {
|
|
3948
3957
|
const n = e.content.find((o) => o.type === "text");
|
|
3949
3958
|
if (n && "text" in n) {
|
|
3950
|
-
const o = await
|
|
3959
|
+
const o = await Do({
|
|
3951
3960
|
text: n.text,
|
|
3952
3961
|
schema: t
|
|
3953
3962
|
});
|
|
@@ -4052,7 +4061,7 @@ var di = class {
|
|
|
4052
4061
|
return;
|
|
4053
4062
|
}
|
|
4054
4063
|
try {
|
|
4055
|
-
const r = await this.elicitationRequestHandler(t.data), n =
|
|
4064
|
+
const r = await this.elicitationRequestHandler(t.data), n = gs.parse(r);
|
|
4056
4065
|
await this.transport.send({
|
|
4057
4066
|
jsonrpc: "2.0",
|
|
4058
4067
|
id: e.id,
|
|
@@ -4103,7 +4112,7 @@ var di = class {
|
|
|
4103
4112
|
);
|
|
4104
4113
|
}
|
|
4105
4114
|
};
|
|
4106
|
-
const
|
|
4115
|
+
const pi = async (e) => {
|
|
4107
4116
|
const t = {};
|
|
4108
4117
|
try {
|
|
4109
4118
|
const r = await e.listTools();
|
|
@@ -4123,7 +4132,7 @@ const fi = async (e) => {
|
|
|
4123
4132
|
} catch (r) {
|
|
4124
4133
|
throw r;
|
|
4125
4134
|
}
|
|
4126
|
-
},
|
|
4135
|
+
}, hi = async (e) => {
|
|
4127
4136
|
const t = {};
|
|
4128
4137
|
if (!e)
|
|
4129
4138
|
return t;
|
|
@@ -4160,7 +4169,7 @@ const fi = async (e) => {
|
|
|
4160
4169
|
}
|
|
4161
4170
|
return t;
|
|
4162
4171
|
};
|
|
4163
|
-
function
|
|
4172
|
+
function mi(e) {
|
|
4164
4173
|
const t = Object.entries(e);
|
|
4165
4174
|
if (t.length === 0)
|
|
4166
4175
|
return "";
|
|
@@ -4223,11 +4232,11 @@ function ar(e, t) {
|
|
|
4223
4232
|
}
|
|
4224
4233
|
return null;
|
|
4225
4234
|
}
|
|
4226
|
-
const
|
|
4235
|
+
const gi = {
|
|
4227
4236
|
openai: Pn,
|
|
4228
4237
|
deepseek: Rn
|
|
4229
4238
|
};
|
|
4230
|
-
class
|
|
4239
|
+
class sl {
|
|
4231
4240
|
constructor({ llmConfig: t, mcpServers: r }) {
|
|
4232
4241
|
if (this.mcpServers = {}, this.mcpClients = {}, this.mcpTools = {}, this.ignoreToolnames = [], this.responseMessages = [], this.useReActMode = !1, !t)
|
|
4233
4242
|
throw new Error("llmConfig is required to initialize AgentModelProvider");
|
|
@@ -4236,7 +4245,7 @@ class ol {
|
|
|
4236
4245
|
else if (t.providerType) {
|
|
4237
4246
|
const n = t.providerType;
|
|
4238
4247
|
let o;
|
|
4239
|
-
typeof n == "string" ? o =
|
|
4248
|
+
typeof n == "string" ? o = gi[n] : o = n, this.llm = o({
|
|
4240
4249
|
apiKey: t.apiKey,
|
|
4241
4250
|
baseURL: t.baseURL
|
|
4242
4251
|
});
|
|
@@ -4251,7 +4260,7 @@ class ol {
|
|
|
4251
4260
|
if ("type" in t && t.type === "builtin") {
|
|
4252
4261
|
const o = t.client;
|
|
4253
4262
|
return {
|
|
4254
|
-
tools: () =>
|
|
4263
|
+
tools: () => hi(o),
|
|
4255
4264
|
close: async () => {
|
|
4256
4265
|
}
|
|
4257
4266
|
};
|
|
@@ -4264,7 +4273,7 @@ class ol {
|
|
|
4264
4273
|
r = new Xe(new URL(o.url), { requestInit: s });
|
|
4265
4274
|
} else "transport" in t ? r = t.transport : r = t;
|
|
4266
4275
|
if (t.useAISdkClient ?? !1) {
|
|
4267
|
-
const o = await
|
|
4276
|
+
const o = await di({ transport: r });
|
|
4268
4277
|
return o.__transport__ = r, o;
|
|
4269
4278
|
} else {
|
|
4270
4279
|
const o = new An(
|
|
@@ -4304,7 +4313,7 @@ class ol {
|
|
|
4304
4313
|
if (!t)
|
|
4305
4314
|
return null;
|
|
4306
4315
|
try {
|
|
4307
|
-
return typeof t.tools == "function" ? await t.tools() : await
|
|
4316
|
+
return typeof t.tools == "function" ? await t.tools() : await pi(t);
|
|
4308
4317
|
} catch (n) {
|
|
4309
4318
|
return this.onError && this.onError(n?.message || `Failed to query tools for ${r}`, n), console.error(`Failed to query tools for ${r}`, n), null;
|
|
4310
4319
|
}
|
|
@@ -4389,7 +4398,7 @@ class ol {
|
|
|
4389
4398
|
}
|
|
4390
4399
|
/** 生成 ReAct 模式的系统提示词(包含工具描述) */
|
|
4391
4400
|
_generateReActSystemPrompt(t, r, n) {
|
|
4392
|
-
const o =
|
|
4401
|
+
const o = mi(t);
|
|
4393
4402
|
return n ? `${n}${o}` : `你是一个智能助手,可以通过调用工具来完成任务。
|
|
4394
4403
|
${o}`;
|
|
4395
4404
|
}
|
|
@@ -4663,20 +4672,20 @@ ${G}
|
|
|
4663
4672
|
return this._chat(st, t);
|
|
4664
4673
|
}
|
|
4665
4674
|
}
|
|
4666
|
-
const
|
|
4675
|
+
const yi = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
|
|
4667
4676
|
const t = Math.random() * 16 | 0;
|
|
4668
4677
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
4669
|
-
}), ae = () => typeof window < "u" && typeof navigator < "u",
|
|
4678
|
+
}), ae = () => typeof window < "u" && typeof navigator < "u", vi = () => ae() && typeof document < "u";
|
|
4670
4679
|
let ie = null, We = null, lr = null, De = 0;
|
|
4671
|
-
const
|
|
4680
|
+
const wi = "next-sdk-tool-body-glow";
|
|
4672
4681
|
function ke() {
|
|
4673
|
-
return
|
|
4682
|
+
return vi();
|
|
4674
4683
|
}
|
|
4675
|
-
function
|
|
4684
|
+
function bi() {
|
|
4676
4685
|
if (!ke() || lr) return;
|
|
4677
4686
|
const e = document.createElement("style");
|
|
4678
4687
|
e.textContent = `
|
|
4679
|
-
.${
|
|
4688
|
+
.${wi} {
|
|
4680
4689
|
position: relative;
|
|
4681
4690
|
}
|
|
4682
4691
|
|
|
@@ -4845,9 +4854,9 @@ function wi() {
|
|
|
4845
4854
|
}
|
|
4846
4855
|
`, document.head.appendChild(e), lr = e;
|
|
4847
4856
|
}
|
|
4848
|
-
function
|
|
4857
|
+
function _i() {
|
|
4849
4858
|
if (!ke() || ie) return;
|
|
4850
|
-
|
|
4859
|
+
bi();
|
|
4851
4860
|
const e = document.createElement("div");
|
|
4852
4861
|
e.className = "next-sdk-tool-overlay";
|
|
4853
4862
|
const t = document.createElement("div");
|
|
@@ -4869,10 +4878,10 @@ function bi() {
|
|
|
4869
4878
|
const c = document.createElement("div");
|
|
4870
4879
|
c.className = "next-sdk-tool-overlay__label", l.prepend(u), i.appendChild(l), i.appendChild(c), n.appendChild(o), n.appendChild(s), r.appendChild(n), r.appendChild(i), e.appendChild(t), e.appendChild(r), document.body.appendChild(e), ie = e, We = c;
|
|
4871
4880
|
}
|
|
4872
|
-
function
|
|
4873
|
-
ke() && (
|
|
4881
|
+
function xi(e) {
|
|
4882
|
+
ke() && (_i(), !(!ie || !We) && (ie.classList.remove("next-sdk-tool-overlay--exit"), We.textContent = e.label));
|
|
4874
4883
|
}
|
|
4875
|
-
function
|
|
4884
|
+
function Si() {
|
|
4876
4885
|
if (!ie) return;
|
|
4877
4886
|
ie.classList.add("next-sdk-tool-overlay--exit");
|
|
4878
4887
|
const e = ie;
|
|
@@ -4882,11 +4891,11 @@ function xi() {
|
|
|
4882
4891
|
};
|
|
4883
4892
|
e.addEventListener("animationend", n), r = setTimeout(n, 500);
|
|
4884
4893
|
}
|
|
4885
|
-
function
|
|
4886
|
-
ke() && (De += 1,
|
|
4894
|
+
function Ti(e) {
|
|
4895
|
+
ke() && (De += 1, xi(e));
|
|
4887
4896
|
}
|
|
4888
|
-
function
|
|
4889
|
-
!ke() || De <= 0 || (De -= 1, De === 0 &&
|
|
4897
|
+
function Ci() {
|
|
4898
|
+
!ke() || De <= 0 || (De -= 1, De === 0 && Si());
|
|
4890
4899
|
}
|
|
4891
4900
|
function Vr(e, t, r) {
|
|
4892
4901
|
if (!r) return;
|
|
@@ -4895,11 +4904,11 @@ function Vr(e, t, r) {
|
|
|
4895
4904
|
label: r.label || n
|
|
4896
4905
|
};
|
|
4897
4906
|
}
|
|
4898
|
-
const Jr = "next-sdk:tool-call", vt = "next-sdk:tool-response", ve = "next-sdk:tool-registered", Be = "next-sdk:tool-unregistered",
|
|
4899
|
-
function
|
|
4907
|
+
const Jr = "next-sdk:tool-call", vt = "next-sdk:tool-response", ve = "next-sdk:tool-registered", Be = "next-sdk:tool-unregistered", $i = "next-sdk:remoter-ready", wt = /* @__PURE__ */ new Map(), $e = (e) => e.replace(/\/+$/, "") || "/", Ot = /* @__PURE__ */ new Set();
|
|
4908
|
+
function Ei() {
|
|
4900
4909
|
ae() && Ot.add({ win: window, origin: window.location.origin || "*" });
|
|
4901
4910
|
}
|
|
4902
|
-
|
|
4911
|
+
Ei();
|
|
4903
4912
|
function ce(e) {
|
|
4904
4913
|
if (!ae()) return;
|
|
4905
4914
|
const t = { type: e };
|
|
@@ -4910,14 +4919,14 @@ function ce(e) {
|
|
|
4910
4919
|
}
|
|
4911
4920
|
});
|
|
4912
4921
|
}
|
|
4913
|
-
function
|
|
4922
|
+
function Pi() {
|
|
4914
4923
|
ae() && window.addEventListener("message", (e) => {
|
|
4915
|
-
if (e.data?.type !==
|
|
4924
|
+
if (e.data?.type !== $i || !e.source || e.origin !== window.location.origin) return;
|
|
4916
4925
|
const t = e.source;
|
|
4917
4926
|
Ot.add({ win: t, origin: e.origin || "*" });
|
|
4918
4927
|
});
|
|
4919
4928
|
}
|
|
4920
|
-
|
|
4929
|
+
Pi();
|
|
4921
4930
|
function dt(e) {
|
|
4922
4931
|
if (!e) return;
|
|
4923
4932
|
const t = e;
|
|
@@ -4931,15 +4940,15 @@ function cr(e, t) {
|
|
|
4931
4940
|
return !!r && r.has(t);
|
|
4932
4941
|
}
|
|
4933
4942
|
let Ee = null;
|
|
4934
|
-
function
|
|
4943
|
+
function il(e) {
|
|
4935
4944
|
Ee = e;
|
|
4936
4945
|
}
|
|
4937
|
-
function
|
|
4946
|
+
function Ri(e) {
|
|
4938
4947
|
if (!ae()) return !1;
|
|
4939
4948
|
const t = $e(e);
|
|
4940
4949
|
return $e(window.location.pathname) === t;
|
|
4941
4950
|
}
|
|
4942
|
-
function
|
|
4951
|
+
function ki(e) {
|
|
4943
4952
|
return ae() ? new Promise((t) => {
|
|
4944
4953
|
let r = !1;
|
|
4945
4954
|
const n = () => {
|
|
@@ -4950,7 +4959,7 @@ function Ri(e) {
|
|
|
4950
4959
|
window.addEventListener("message", o), setTimeout(n, e);
|
|
4951
4960
|
}) : Promise.resolve();
|
|
4952
4961
|
}
|
|
4953
|
-
function
|
|
4962
|
+
function al(e, t) {
|
|
4954
4963
|
const r = t?.name ?? "navigate_to_page", n = t?.title ?? "页面跳转", o = t?.description ?? '当需要的工具在当前页面不可用时,使用此工具跳转到特定页面。例如:要查询订单时跳转到 "/orders",要创建价保时跳转到 "/price-protection"。', s = t?.timeoutMs ?? 5e3, i = {
|
|
4955
4964
|
type: "object",
|
|
4956
4965
|
properties: {
|
|
@@ -4977,11 +4986,11 @@ function il(e, t) {
|
|
|
4977
4986
|
]
|
|
4978
4987
|
};
|
|
4979
4988
|
try {
|
|
4980
|
-
if (
|
|
4989
|
+
if (Ri(u))
|
|
4981
4990
|
return {
|
|
4982
4991
|
content: [{ type: "text", text: `当前已在页面:${u}。请继续你的下一步操作。` }]
|
|
4983
4992
|
};
|
|
4984
|
-
const c =
|
|
4993
|
+
const c = ki(s);
|
|
4985
4994
|
return await Ee(u) !== !0 && (await c, await new Promise((p) => setTimeout(p, 500))), {
|
|
4986
4995
|
content: [{ type: "text", text: `已成功跳转至页面:${u}。请继续你的下一步操作。` }]
|
|
4987
4996
|
};
|
|
@@ -5016,11 +5025,11 @@ function il(e, t) {
|
|
|
5016
5025
|
}
|
|
5017
5026
|
function Wr(e, t, r = 3e4, n) {
|
|
5018
5027
|
return (o) => {
|
|
5019
|
-
const s =
|
|
5028
|
+
const s = yi();
|
|
5020
5029
|
return new Promise((i, l) => {
|
|
5021
5030
|
let u, c;
|
|
5022
5031
|
const d = () => {
|
|
5023
|
-
clearTimeout(u), window.removeEventListener("message", p), c && window.removeEventListener("message", c), n &&
|
|
5032
|
+
clearTimeout(u), window.removeEventListener("message", p), c && window.removeEventListener("message", c), n && Ci();
|
|
5024
5033
|
};
|
|
5025
5034
|
u = setTimeout(() => {
|
|
5026
5035
|
d(), l(new Error(`工具 [${e}] 调用超时 (${r}ms),请检查目标页面是否正确调用了 registerPageTool`));
|
|
@@ -5038,7 +5047,7 @@ function Wr(e, t, r = 3e4, n) {
|
|
|
5038
5047
|
};
|
|
5039
5048
|
(async () => {
|
|
5040
5049
|
try {
|
|
5041
|
-
if (n &&
|
|
5050
|
+
if (n && Ti(n), cr(t, e)) {
|
|
5042
5051
|
m();
|
|
5043
5052
|
return;
|
|
5044
5053
|
}
|
|
@@ -5056,7 +5065,7 @@ function Wr(e, t, r = 3e4, n) {
|
|
|
5056
5065
|
});
|
|
5057
5066
|
};
|
|
5058
5067
|
}
|
|
5059
|
-
function
|
|
5068
|
+
function ll(e) {
|
|
5060
5069
|
const t = /* @__PURE__ */ new Map(), r = (n, o, s = !1) => {
|
|
5061
5070
|
const i = t.get(o), l = !!i;
|
|
5062
5071
|
if (t.delete(o), i)
|
|
@@ -5081,7 +5090,7 @@ function al(e) {
|
|
|
5081
5090
|
}
|
|
5082
5091
|
});
|
|
5083
5092
|
}
|
|
5084
|
-
function
|
|
5093
|
+
function cl(e) {
|
|
5085
5094
|
const { route: t, handlers: r } = e, n = $e(t ?? window.location.pathname), o = Object.keys(r), s = async (i) => {
|
|
5086
5095
|
if (i.source !== window || i.data?.type !== Jr || !(i.data.toolName in r))
|
|
5087
5096
|
return;
|
|
@@ -5107,41 +5116,41 @@ function ll(e) {
|
|
|
5107
5116
|
};
|
|
5108
5117
|
}
|
|
5109
5118
|
const Se = /* @__PURE__ */ new Map();
|
|
5110
|
-
function
|
|
5119
|
+
function Oi() {
|
|
5111
5120
|
if (typeof document > "u") return;
|
|
5112
|
-
const t =
|
|
5113
|
-
if (!
|
|
5114
|
-
ae() && (window.__nextSdkRegisteredTools = () => Array.from(Se.values()));
|
|
5115
|
-
const
|
|
5116
|
-
typeof
|
|
5117
|
-
const
|
|
5118
|
-
|
|
5119
|
-
Se.delete(
|
|
5121
|
+
const e = document, t = typeof navigator < "u" ? navigator : void 0, r = e.modelContext || t?.modelContext;
|
|
5122
|
+
if (!r || r.__isNextSdkBridgeSetup) return;
|
|
5123
|
+
!e.modelContext && t?.modelContext && (e.modelContext = t.modelContext), ae() && (window.__nextSdkRegisteredTools = () => Array.from(Se.values()));
|
|
5124
|
+
const n = r.registerTool?.bind(r), o = r.unregisterTool?.bind(r);
|
|
5125
|
+
typeof n == "function" && (r.registerTool = (s, i) => {
|
|
5126
|
+
const l = s.name, u = { ...s };
|
|
5127
|
+
i?.signal && i.signal.addEventListener("abort", () => {
|
|
5128
|
+
Se.delete(l), ce(Be);
|
|
5120
5129
|
});
|
|
5121
|
-
const
|
|
5122
|
-
if (
|
|
5123
|
-
const
|
|
5124
|
-
|
|
5130
|
+
const c = u.routeConfig && typeof u.routeConfig == "object" && "route" in u.routeConfig ? u.routeConfig : null;
|
|
5131
|
+
if (c) {
|
|
5132
|
+
const d = $e(c.route), p = Vr(l, u.title, c.invokeEffect), f = Wr(l, d, c.timeout, p);
|
|
5133
|
+
u.execute = f, delete u.routeConfig;
|
|
5125
5134
|
}
|
|
5126
|
-
Se.set(
|
|
5127
|
-
name:
|
|
5128
|
-
title:
|
|
5129
|
-
description:
|
|
5130
|
-
inputSchema:
|
|
5135
|
+
Se.set(l, {
|
|
5136
|
+
name: l,
|
|
5137
|
+
title: s.title,
|
|
5138
|
+
description: s.description,
|
|
5139
|
+
inputSchema: s.inputSchema
|
|
5131
5140
|
});
|
|
5132
5141
|
try {
|
|
5133
|
-
|
|
5142
|
+
n(u, i), ce(ve);
|
|
5134
5143
|
} catch {
|
|
5135
|
-
Se.delete(
|
|
5144
|
+
Se.delete(l);
|
|
5136
5145
|
}
|
|
5137
|
-
}),
|
|
5146
|
+
}), r.unregisterTool = (s) => {
|
|
5138
5147
|
try {
|
|
5139
|
-
typeof
|
|
5148
|
+
typeof o == "function" && o(s);
|
|
5140
5149
|
} catch {
|
|
5141
5150
|
} finally {
|
|
5142
|
-
Se.delete(
|
|
5151
|
+
Se.delete(s), ce(Be);
|
|
5143
5152
|
}
|
|
5144
|
-
},
|
|
5153
|
+
}, r.__isNextSdkBridgeSetup = !0;
|
|
5145
5154
|
}
|
|
5146
5155
|
function Te(e, t) {
|
|
5147
5156
|
const r = typeof e;
|
|
@@ -5172,24 +5181,24 @@ function Te(e, t) {
|
|
|
5172
5181
|
return e === t;
|
|
5173
5182
|
}
|
|
5174
5183
|
function Q(e) {
|
|
5175
|
-
return encodeURI(
|
|
5184
|
+
return encodeURI(Ai(e));
|
|
5176
5185
|
}
|
|
5177
|
-
function
|
|
5186
|
+
function Ai(e) {
|
|
5178
5187
|
return e.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
5179
5188
|
}
|
|
5180
|
-
const
|
|
5189
|
+
const Ii = {
|
|
5181
5190
|
prefixItems: !0,
|
|
5182
5191
|
items: !0,
|
|
5183
5192
|
allOf: !0,
|
|
5184
5193
|
anyOf: !0,
|
|
5185
5194
|
oneOf: !0
|
|
5186
|
-
},
|
|
5195
|
+
}, Mi = {
|
|
5187
5196
|
$defs: !0,
|
|
5188
5197
|
definitions: !0,
|
|
5189
5198
|
properties: !0,
|
|
5190
5199
|
patternProperties: !0,
|
|
5191
5200
|
dependentSchemas: !0
|
|
5192
|
-
},
|
|
5201
|
+
}, ji = {
|
|
5193
5202
|
id: !0,
|
|
5194
5203
|
$id: !0,
|
|
5195
5204
|
$ref: !0,
|
|
@@ -5217,8 +5226,8 @@ const Ai = {
|
|
|
5217
5226
|
maxProperties: !0,
|
|
5218
5227
|
minProperties: !0
|
|
5219
5228
|
};
|
|
5220
|
-
let
|
|
5221
|
-
function he(e, t = /* @__PURE__ */ Object.create(null), r =
|
|
5229
|
+
let Ni = typeof self < "u" && self.location && self.location.origin !== "null" ? new URL(self.location.origin + self.location.pathname + location.search) : new URL("https://github.com/cfworker");
|
|
5230
|
+
function he(e, t = /* @__PURE__ */ Object.create(null), r = Ni, n = "") {
|
|
5222
5231
|
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
5223
5232
|
const s = e.$id || e.id;
|
|
5224
5233
|
if (s) {
|
|
@@ -5254,16 +5263,16 @@ function he(e, t = /* @__PURE__ */ Object.create(null), r = ji, n = "") {
|
|
|
5254
5263
|
t[s.href] = e;
|
|
5255
5264
|
}
|
|
5256
5265
|
for (let s in e) {
|
|
5257
|
-
if (
|
|
5266
|
+
if (ji[s])
|
|
5258
5267
|
continue;
|
|
5259
5268
|
const i = `${n}/${Q(s)}`, l = e[s];
|
|
5260
5269
|
if (Array.isArray(l)) {
|
|
5261
|
-
if (
|
|
5270
|
+
if (Ii[s]) {
|
|
5262
5271
|
const u = l.length;
|
|
5263
5272
|
for (let c = 0; c < u; c++)
|
|
5264
5273
|
he(l[c], t, r, `${i}/${c}`);
|
|
5265
5274
|
}
|
|
5266
|
-
} else if (
|
|
5275
|
+
} else if (Mi[s])
|
|
5267
5276
|
for (let u in l)
|
|
5268
5277
|
he(l[u], t, r, `${i}/${Q(u)}`);
|
|
5269
5278
|
else
|
|
@@ -5271,63 +5280,63 @@ function he(e, t = /* @__PURE__ */ Object.create(null), r = ji, n = "") {
|
|
|
5271
5280
|
}
|
|
5272
5281
|
return t;
|
|
5273
5282
|
}
|
|
5274
|
-
const
|
|
5283
|
+
const zi = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, Ui = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Di = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i, Li = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i, qi = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, Hi = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, Fi = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu, Zi = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, Vi = /^(?:\/(?:[^~/]|~0|~1)*)*$/, Ji = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, Wi = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/, Bi = (e) => {
|
|
5275
5284
|
if (e[0] === '"')
|
|
5276
5285
|
return !1;
|
|
5277
5286
|
const [t, r, ...n] = e.split("@");
|
|
5278
5287
|
return !t || !r || n.length !== 0 || t.length > 64 || r.length > 253 || t[0] === "." || t.endsWith(".") || t.includes("..") || !/^[a-z0-9.-]+$/i.test(r) || !/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t) ? !1 : r.split(".").every((o) => /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(o));
|
|
5279
|
-
},
|
|
5288
|
+
}, Gi = /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, Ki = /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i, Yi = (e) => e.length > 1 && e.length < 80 && (/^P\d+([.,]\d+)?W$/.test(e) || /^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e) && /^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));
|
|
5280
5289
|
function ee(e) {
|
|
5281
5290
|
return e.test.bind(e);
|
|
5282
5291
|
}
|
|
5283
5292
|
const ur = {
|
|
5284
5293
|
date: Br,
|
|
5285
5294
|
time: Gr.bind(void 0, !1),
|
|
5286
|
-
"date-time":
|
|
5287
|
-
duration:
|
|
5288
|
-
uri:
|
|
5289
|
-
"uri-reference": ee(
|
|
5290
|
-
"uri-template": ee(
|
|
5291
|
-
url: ee(
|
|
5292
|
-
email:
|
|
5293
|
-
hostname: ee(
|
|
5294
|
-
ipv4: ee(
|
|
5295
|
-
ipv6: ee(
|
|
5296
|
-
regex:
|
|
5297
|
-
uuid: ee(
|
|
5298
|
-
"json-pointer": ee(
|
|
5299
|
-
"json-pointer-uri-fragment": ee(
|
|
5300
|
-
"relative-json-pointer": ee(
|
|
5295
|
+
"date-time": ea,
|
|
5296
|
+
duration: Yi,
|
|
5297
|
+
uri: na,
|
|
5298
|
+
"uri-reference": ee(qi),
|
|
5299
|
+
"uri-template": ee(Hi),
|
|
5300
|
+
url: ee(Fi),
|
|
5301
|
+
email: Bi,
|
|
5302
|
+
hostname: ee(Li),
|
|
5303
|
+
ipv4: ee(Gi),
|
|
5304
|
+
ipv6: ee(Ki),
|
|
5305
|
+
regex: sa,
|
|
5306
|
+
uuid: ee(Zi),
|
|
5307
|
+
"json-pointer": ee(Vi),
|
|
5308
|
+
"json-pointer-uri-fragment": ee(Ji),
|
|
5309
|
+
"relative-json-pointer": ee(Wi)
|
|
5301
5310
|
};
|
|
5302
|
-
function
|
|
5311
|
+
function Xi(e) {
|
|
5303
5312
|
return e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0);
|
|
5304
5313
|
}
|
|
5305
5314
|
function Br(e) {
|
|
5306
|
-
const t = e.match(
|
|
5315
|
+
const t = e.match(zi);
|
|
5307
5316
|
if (!t)
|
|
5308
5317
|
return !1;
|
|
5309
5318
|
const r = +t[1], n = +t[2], o = +t[3];
|
|
5310
|
-
return n >= 1 && n <= 12 && o >= 1 && o <= (n == 2 &&
|
|
5319
|
+
return n >= 1 && n <= 12 && o >= 1 && o <= (n == 2 && Xi(r) ? 29 : Ui[n]);
|
|
5311
5320
|
}
|
|
5312
5321
|
function Gr(e, t) {
|
|
5313
|
-
const r = t.match(
|
|
5322
|
+
const r = t.match(Di);
|
|
5314
5323
|
if (!r)
|
|
5315
5324
|
return !1;
|
|
5316
5325
|
const n = +r[1], o = +r[2], s = +r[3], i = !!r[5];
|
|
5317
5326
|
return (n <= 23 && o <= 59 && s <= 59 || n == 23 && o == 59 && s == 60) && (!e || i);
|
|
5318
5327
|
}
|
|
5319
|
-
const
|
|
5320
|
-
function
|
|
5321
|
-
const t = e.split(
|
|
5328
|
+
const Qi = /t|\s/i;
|
|
5329
|
+
function ea(e) {
|
|
5330
|
+
const t = e.split(Qi);
|
|
5322
5331
|
return t.length == 2 && Br(t[0]) && Gr(!0, t[1]);
|
|
5323
5332
|
}
|
|
5324
|
-
const
|
|
5325
|
-
function
|
|
5326
|
-
return
|
|
5333
|
+
const ta = /\/|:/, ra = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
5334
|
+
function na(e) {
|
|
5335
|
+
return ta.test(e) && ra.test(e);
|
|
5327
5336
|
}
|
|
5328
|
-
const
|
|
5329
|
-
function
|
|
5330
|
-
if (
|
|
5337
|
+
const oa = /[^\\]\\Z/;
|
|
5338
|
+
function sa(e) {
|
|
5339
|
+
if (oa.test(e))
|
|
5331
5340
|
return !1;
|
|
5332
5341
|
try {
|
|
5333
5342
|
return new RegExp(e, "u"), !0;
|
|
@@ -5335,7 +5344,7 @@ function oa(e) {
|
|
|
5335
5344
|
return !1;
|
|
5336
5345
|
}
|
|
5337
5346
|
}
|
|
5338
|
-
function
|
|
5347
|
+
function ia(e) {
|
|
5339
5348
|
let t = 0, r = e.length, n = 0, o;
|
|
5340
5349
|
for (; n < r; )
|
|
5341
5350
|
t++, o = e.charCodeAt(n++), o >= 55296 && o <= 56319 && n < r && (o = e.charCodeAt(n), (o & 64512) == 56320 && n++);
|
|
@@ -5833,7 +5842,7 @@ Known schemas:
|
|
|
5833
5842
|
});
|
|
5834
5843
|
}
|
|
5835
5844
|
} else if (d === "string") {
|
|
5836
|
-
const C = Ie === void 0 && Me === void 0 ? 0 :
|
|
5845
|
+
const C = Ie === void 0 && Me === void 0 ? 0 : ia(e);
|
|
5837
5846
|
Ie !== void 0 && C < Ie && w.push({
|
|
5838
5847
|
instanceLocation: i,
|
|
5839
5848
|
keyword: "minLength",
|
|
@@ -5858,7 +5867,7 @@ Known schemas:
|
|
|
5858
5867
|
}
|
|
5859
5868
|
return { valid: w.length === 0, errors: w };
|
|
5860
5869
|
}
|
|
5861
|
-
class
|
|
5870
|
+
class aa {
|
|
5862
5871
|
schema;
|
|
5863
5872
|
draft;
|
|
5864
5873
|
shortCircuit;
|
|
@@ -5876,7 +5885,7 @@ class ia {
|
|
|
5876
5885
|
const dr = "Failed to parse input arguments", Ge = "Tool was executed but the invocation failed. For example, the script function threw an error", bt = "Tool was cancelled", ze = {
|
|
5877
5886
|
type: "object",
|
|
5878
5887
|
properties: {}
|
|
5879
|
-
},
|
|
5888
|
+
}, la = ["draft-2020-12", "draft-07"], ca = "__isWebMCPPolyfill", Kr = Symbol("standardValidator"), U = {
|
|
5880
5889
|
installed: !1,
|
|
5881
5890
|
previousNavigatorModelContextDescriptor: void 0,
|
|
5882
5891
|
previousNavigatorModelContextTestingDescriptor: void 0,
|
|
@@ -5885,7 +5894,7 @@ const dr = "Failed to parse input arguments", Ge = "Tool was executed but the in
|
|
|
5885
5894
|
installedNavigatorModelContextTesting: !1,
|
|
5886
5895
|
installedDocumentModelContext: !1
|
|
5887
5896
|
};
|
|
5888
|
-
var
|
|
5897
|
+
var ua = class extends EventTarget {
|
|
5889
5898
|
tools = /* @__PURE__ */ new Map();
|
|
5890
5899
|
testingShim = null;
|
|
5891
5900
|
_ontoolchange = null;
|
|
@@ -5902,14 +5911,14 @@ var ca = class extends EventTarget {
|
|
|
5902
5911
|
console.warn(`[WebMCPPolyfill] registerTool("${e?.name ?? "<unknown>"}") skipped: options.signal was already aborted.`);
|
|
5903
5912
|
return;
|
|
5904
5913
|
}
|
|
5905
|
-
const n =
|
|
5914
|
+
const n = va(e, this.tools);
|
|
5906
5915
|
this.tools.set(n.name, n), this.notifyToolsChanged(), r && r.addEventListener("abort", () => {
|
|
5907
5916
|
this.tools.delete(n.name) && this.notifyToolsChanged();
|
|
5908
5917
|
}, { once: !0 });
|
|
5909
5918
|
}
|
|
5910
5919
|
unregisterTool(e) {
|
|
5911
5920
|
this.warnUnregisterToolDeprecationOnce();
|
|
5912
|
-
const t =
|
|
5921
|
+
const t = pa(e);
|
|
5913
5922
|
this.tools.delete(t) && this.notifyToolsChanged();
|
|
5914
5923
|
}
|
|
5915
5924
|
getTools() {
|
|
@@ -5919,7 +5928,7 @@ var ca = class extends EventTarget {
|
|
|
5919
5928
|
return this.executeToolByName(e.name, t, r, !1);
|
|
5920
5929
|
}
|
|
5921
5930
|
getTestingShim() {
|
|
5922
|
-
return this.testingShim || (this.testingShim = new
|
|
5931
|
+
return this.testingShim || (this.testingShim = new da(this)), this.testingShim;
|
|
5923
5932
|
}
|
|
5924
5933
|
/** @internal Used by PolyfillTestingShim */
|
|
5925
5934
|
getToolInfos() {
|
|
@@ -5957,7 +5966,7 @@ var ca = class extends EventTarget {
|
|
|
5957
5966
|
if (r?.signal?.aborted) throw te(bt);
|
|
5958
5967
|
const o = this.tools.get(e);
|
|
5959
5968
|
if (!o) throw te(`Tool not found: ${e}`);
|
|
5960
|
-
const s =
|
|
5969
|
+
const s = fa(t), i = await xa(s, o);
|
|
5961
5970
|
if (i) throw te(i);
|
|
5962
5971
|
let l = !0;
|
|
5963
5972
|
const u = { requestUserInteraction: async (c) => {
|
|
@@ -5966,8 +5975,8 @@ var ca = class extends EventTarget {
|
|
|
5966
5975
|
return c();
|
|
5967
5976
|
} };
|
|
5968
5977
|
try {
|
|
5969
|
-
const c = o.execute(s, u), d = await
|
|
5970
|
-
if (n) return
|
|
5978
|
+
const c = o.execute(s, u), d = await ka(Promise.resolve(c), r?.signal);
|
|
5979
|
+
if (n) return Ra(Ea(d));
|
|
5971
5980
|
const p = JSON.stringify(d);
|
|
5972
5981
|
return p === void 0 ? null : p;
|
|
5973
5982
|
} catch (c) {
|
|
@@ -5990,7 +5999,7 @@ var ca = class extends EventTarget {
|
|
|
5990
5999
|
warnUnregisterToolDeprecationOnce() {
|
|
5991
6000
|
this.unregisterToolDeprecationWarned || (this.unregisterToolDeprecationWarned = !0, console.warn("[WebMCPPolyfill] navigator.modelContext.unregisterTool() is deprecated. The April 23, 2026 WebMCP draft removed it in favor of registerTool(tool, { signal }) — pass an AbortSignal and abort it to unregister."));
|
|
5992
6001
|
}
|
|
5993
|
-
},
|
|
6002
|
+
}, da = class extends EventTarget {
|
|
5994
6003
|
context;
|
|
5995
6004
|
_ontoolchange = null;
|
|
5996
6005
|
constructor(e) {
|
|
@@ -6038,7 +6047,7 @@ function te(e) {
|
|
|
6038
6047
|
return t.name = "UnknownError", t;
|
|
6039
6048
|
}
|
|
6040
6049
|
}
|
|
6041
|
-
function
|
|
6050
|
+
function fa(e) {
|
|
6042
6051
|
let t;
|
|
6043
6052
|
try {
|
|
6044
6053
|
t = JSON.parse(e);
|
|
@@ -6048,7 +6057,7 @@ function da(e) {
|
|
|
6048
6057
|
if (!t || typeof t != "object" || Array.isArray(t)) throw te(dr);
|
|
6049
6058
|
return t;
|
|
6050
6059
|
}
|
|
6051
|
-
function
|
|
6060
|
+
function pa(e) {
|
|
6052
6061
|
if (typeof e == "string") return e;
|
|
6053
6062
|
if (V(e) && typeof e.name == "string") return e.name;
|
|
6054
6063
|
throw new TypeError("Failed to execute 'unregisterTool' on 'ModelContext': parameter 1 must be a string or an object with a string name.");
|
|
@@ -6061,11 +6070,11 @@ function Yr(e) {
|
|
|
6061
6070
|
const t = e["~standard"];
|
|
6062
6071
|
return V(t) ? t : null;
|
|
6063
6072
|
}
|
|
6064
|
-
function
|
|
6073
|
+
function ha(e) {
|
|
6065
6074
|
const t = Yr(e);
|
|
6066
6075
|
return !!(t && t.version === 1 && typeof t.validate == "function");
|
|
6067
6076
|
}
|
|
6068
|
-
function
|
|
6077
|
+
function ma(e) {
|
|
6069
6078
|
const t = Yr(e);
|
|
6070
6079
|
return !t || t.version !== 1 || !V(t.jsonSchema) ? !1 : typeof t.jsonSchema.input == "function";
|
|
6071
6080
|
}
|
|
@@ -6075,13 +6084,13 @@ function Ue(e) {
|
|
|
6075
6084
|
vendor: "@mcp-b/webmcp-polyfill-json-schema",
|
|
6076
6085
|
validate(t) {
|
|
6077
6086
|
if (!V(t)) return { issues: [{ message: "expected object arguments" }] };
|
|
6078
|
-
const r =
|
|
6087
|
+
const r = wa(t, e);
|
|
6079
6088
|
return r ? { issues: [r] } : { value: t };
|
|
6080
6089
|
}
|
|
6081
6090
|
} };
|
|
6082
6091
|
}
|
|
6083
|
-
function
|
|
6084
|
-
for (const t of
|
|
6092
|
+
function ga(e) {
|
|
6093
|
+
for (const t of la) try {
|
|
6085
6094
|
const r = e["~standard"].jsonSchema.input({ target: t });
|
|
6086
6095
|
return Xr(r), r;
|
|
6087
6096
|
} catch (r) {
|
|
@@ -6089,7 +6098,7 @@ function ma(e) {
|
|
|
6089
6098
|
}
|
|
6090
6099
|
throw new Error("Failed to convert Standard JSON Schema inputSchema to a JSON Schema object");
|
|
6091
6100
|
}
|
|
6092
|
-
function
|
|
6101
|
+
function ya(e) {
|
|
6093
6102
|
if (e === void 0) {
|
|
6094
6103
|
const r = ze;
|
|
6095
6104
|
return {
|
|
@@ -6097,14 +6106,14 @@ function ga(e) {
|
|
|
6097
6106
|
standardValidator: Ue(r)
|
|
6098
6107
|
};
|
|
6099
6108
|
}
|
|
6100
|
-
if (
|
|
6101
|
-
const r =
|
|
6109
|
+
if (ma(e)) {
|
|
6110
|
+
const r = ga(e);
|
|
6102
6111
|
return {
|
|
6103
6112
|
inputSchema: r,
|
|
6104
6113
|
standardValidator: Ue(r)
|
|
6105
6114
|
};
|
|
6106
6115
|
}
|
|
6107
|
-
if (
|
|
6116
|
+
if (ha(e)) return {
|
|
6108
6117
|
inputSchema: ze,
|
|
6109
6118
|
standardValidator: e
|
|
6110
6119
|
};
|
|
@@ -6170,13 +6179,13 @@ function me(e, t) {
|
|
|
6170
6179
|
throw new Error(`Invalid JSON Schema at ${t}: schema must be JSON-serializable`);
|
|
6171
6180
|
}
|
|
6172
6181
|
}
|
|
6173
|
-
function
|
|
6182
|
+
function va(e, t) {
|
|
6174
6183
|
if (!e || typeof e != "object") throw new TypeError("registerTool(tool) requires a tool object");
|
|
6175
6184
|
if (typeof e.name != "string" || e.name.length === 0) throw new TypeError('Tool "name" must be a non-empty string');
|
|
6176
6185
|
if (typeof e.description != "string" || e.description.length === 0) throw new TypeError('Tool "description" must be a non-empty string');
|
|
6177
6186
|
if (typeof e.execute != "function") throw new TypeError('Tool "execute" must be a function');
|
|
6178
6187
|
if (t.has(e.name)) throw new Error(`Tool already registered: ${e.name}`);
|
|
6179
|
-
const r =
|
|
6188
|
+
const r = ya(e.inputSchema), n = e.annotations, o = n ? {
|
|
6180
6189
|
...n,
|
|
6181
6190
|
...n.readOnlyHint === "true" ? { readOnlyHint: !0 } : n.readOnlyHint === "false" ? { readOnlyHint: !1 } : {},
|
|
6182
6191
|
...n.destructiveHint === "true" ? { destructiveHint: !0 } : n.destructiveHint === "false" ? { destructiveHint: !1 } : {},
|
|
@@ -6190,18 +6199,18 @@ function ya(e, t) {
|
|
|
6190
6199
|
[Kr]: r.standardValidator
|
|
6191
6200
|
};
|
|
6192
6201
|
}
|
|
6193
|
-
function
|
|
6194
|
-
const r = new
|
|
6202
|
+
function wa(e, t) {
|
|
6203
|
+
const r = new aa(t, "2020-12", !0).validate(e);
|
|
6195
6204
|
if (r.valid) return null;
|
|
6196
6205
|
const n = r.errors[r.errors.length - 1];
|
|
6197
6206
|
return n ? { message: n.error } : { message: "Input validation failed" };
|
|
6198
6207
|
}
|
|
6199
|
-
function
|
|
6208
|
+
function ba(e) {
|
|
6200
6209
|
if (!e || e.length === 0) return null;
|
|
6201
6210
|
const t = e.map((r) => V(r) && "key" in r ? r.key : r).map((r) => String(r)).filter((r) => r.length > 0);
|
|
6202
6211
|
return t.length === 0 ? null : t.join(".");
|
|
6203
6212
|
}
|
|
6204
|
-
async function
|
|
6213
|
+
async function _a(e, t) {
|
|
6205
6214
|
let r;
|
|
6206
6215
|
try {
|
|
6207
6216
|
r = await Promise.resolve(t["~standard"].validate(e));
|
|
@@ -6212,26 +6221,26 @@ async function ba(e, t) {
|
|
|
6212
6221
|
if (!r.issues || r.issues.length === 0) return null;
|
|
6213
6222
|
const n = r.issues[0];
|
|
6214
6223
|
if (!n) return "Input validation error";
|
|
6215
|
-
const o =
|
|
6224
|
+
const o = ba(n?.path);
|
|
6216
6225
|
return o ? `Input validation error: ${n.message} at ${o}` : `Input validation error: ${n.message}`;
|
|
6217
6226
|
}
|
|
6218
|
-
async function
|
|
6219
|
-
return
|
|
6227
|
+
async function xa(e, t) {
|
|
6228
|
+
return _a(e, t[Kr]);
|
|
6220
6229
|
}
|
|
6221
|
-
function
|
|
6230
|
+
function Sa(e) {
|
|
6222
6231
|
return V(e) && Array.isArray(e.content);
|
|
6223
6232
|
}
|
|
6224
|
-
function
|
|
6233
|
+
function Ta(e) {
|
|
6225
6234
|
return e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean";
|
|
6226
6235
|
}
|
|
6227
6236
|
function _t(e) {
|
|
6228
|
-
return
|
|
6237
|
+
return Ta(e) ? Number.isFinite(e) || typeof e != "number" : Array.isArray(e) ? e.every((t) => _t(t)) : V(e) ? Object.values(e).every((t) => _t(t)) : !1;
|
|
6229
6238
|
}
|
|
6230
|
-
function
|
|
6239
|
+
function Ca(e) {
|
|
6231
6240
|
if (!(!V(e) || !_t(e)))
|
|
6232
6241
|
return e;
|
|
6233
6242
|
}
|
|
6234
|
-
function
|
|
6243
|
+
function $a(e) {
|
|
6235
6244
|
if (typeof e == "string") return e;
|
|
6236
6245
|
try {
|
|
6237
6246
|
return JSON.stringify(e) ?? String(e);
|
|
@@ -6239,24 +6248,24 @@ function Ca(e) {
|
|
|
6239
6248
|
return String(e);
|
|
6240
6249
|
}
|
|
6241
6250
|
}
|
|
6242
|
-
function
|
|
6243
|
-
if (
|
|
6244
|
-
const t =
|
|
6251
|
+
function Ea(e) {
|
|
6252
|
+
if (Sa(e)) return e;
|
|
6253
|
+
const t = Ca(e);
|
|
6245
6254
|
return {
|
|
6246
6255
|
content: [{
|
|
6247
6256
|
type: "text",
|
|
6248
|
-
text:
|
|
6257
|
+
text: $a(e)
|
|
6249
6258
|
}],
|
|
6250
6259
|
...t ? { structuredContent: t } : {},
|
|
6251
6260
|
isError: !1
|
|
6252
6261
|
};
|
|
6253
6262
|
}
|
|
6254
|
-
function
|
|
6263
|
+
function Pa(e) {
|
|
6255
6264
|
for (const t of e.content ?? []) if (t.type === "text" && "text" in t && typeof t.text == "string") return t.text;
|
|
6256
6265
|
return null;
|
|
6257
6266
|
}
|
|
6258
|
-
function
|
|
6259
|
-
if (e.isError) throw te(
|
|
6267
|
+
function Ra(e) {
|
|
6268
|
+
if (e.isError) throw te(Pa(e)?.replace(/^Error:\s*/i, "").trim() || Ge);
|
|
6260
6269
|
const t = e.metadata;
|
|
6261
6270
|
if (t && typeof t == "object" && t.willNavigate) return null;
|
|
6262
6271
|
try {
|
|
@@ -6265,7 +6274,7 @@ function Pa(e) {
|
|
|
6265
6274
|
throw te(Ge);
|
|
6266
6275
|
}
|
|
6267
6276
|
}
|
|
6268
|
-
function
|
|
6277
|
+
function ka(e, t) {
|
|
6269
6278
|
return t ? t.aborted ? Promise.reject(te(bt)) : new Promise((r, n) => {
|
|
6270
6279
|
const o = () => {
|
|
6271
6280
|
s(), n(te(bt));
|
|
@@ -6285,7 +6294,7 @@ function Qr() {
|
|
|
6285
6294
|
function en() {
|
|
6286
6295
|
return typeof document < "u" ? document : null;
|
|
6287
6296
|
}
|
|
6288
|
-
function
|
|
6297
|
+
function Oa(e, t, r) {
|
|
6289
6298
|
Object.defineProperty(e, t, {
|
|
6290
6299
|
configurable: !0,
|
|
6291
6300
|
enumerable: !0,
|
|
@@ -6302,7 +6311,7 @@ function fr(e, t) {
|
|
|
6302
6311
|
});
|
|
6303
6312
|
}
|
|
6304
6313
|
let Ke = !1;
|
|
6305
|
-
function
|
|
6314
|
+
function Aa(e, t) {
|
|
6306
6315
|
Object.defineProperty(e, "modelContext", {
|
|
6307
6316
|
configurable: !0,
|
|
6308
6317
|
enumerable: !0,
|
|
@@ -6315,20 +6324,20 @@ function tn(e) {
|
|
|
6315
6324
|
const t = Qr(), r = en();
|
|
6316
6325
|
if (!t && !r || r?.modelContext) return;
|
|
6317
6326
|
const o = t?.modelContext, s = !!o;
|
|
6318
|
-
if (U.installed &&
|
|
6327
|
+
if (U.installed && Ia(), r && o) {
|
|
6319
6328
|
U.previousDocumentModelContextDescriptor = Object.getOwnPropertyDescriptor(r, "modelContext"), fr(r, o), U.installedDocumentModelContext = !0, U.installed = !0;
|
|
6320
6329
|
return;
|
|
6321
6330
|
}
|
|
6322
6331
|
if (s) return;
|
|
6323
|
-
const i = new
|
|
6324
|
-
if (l[
|
|
6325
|
-
U.previousNavigatorModelContextDescriptor = Object.getOwnPropertyDescriptor(t, "modelContext"), U.previousNavigatorModelContextTestingDescriptor = Object.getOwnPropertyDescriptor(t, "modelContextTesting"), Ke = !1,
|
|
6332
|
+
const i = new ua(), l = i;
|
|
6333
|
+
if (l[ca] = !0, r && (U.previousDocumentModelContextDescriptor = Object.getOwnPropertyDescriptor(r, "modelContext"), fr(r, l), U.installedDocumentModelContext = !0), t) {
|
|
6334
|
+
U.previousNavigatorModelContextDescriptor = Object.getOwnPropertyDescriptor(t, "modelContext"), U.previousNavigatorModelContextTestingDescriptor = Object.getOwnPropertyDescriptor(t, "modelContextTesting"), Ke = !1, Aa(t, l), U.installedNavigatorModelContext = !0;
|
|
6326
6335
|
const u = e?.installTestingShim ?? "if-missing", c = !!t.modelContextTesting;
|
|
6327
|
-
(u === "always" || (u === !0 || u === "if-missing") && !c) && (
|
|
6336
|
+
(u === "always" || (u === !0 || u === "if-missing") && !c) && (Oa(t, "modelContextTesting", i.getTestingShim()), U.installedNavigatorModelContextTesting = !0);
|
|
6328
6337
|
}
|
|
6329
6338
|
U.installed = !0;
|
|
6330
6339
|
}
|
|
6331
|
-
function
|
|
6340
|
+
function Ia() {
|
|
6332
6341
|
if (!U.installed) return;
|
|
6333
6342
|
const e = (n, o, s) => {
|
|
6334
6343
|
if (s) {
|
|
@@ -6348,42 +6357,42 @@ if (typeof window < "u" && typeof document < "u") {
|
|
|
6348
6357
|
}
|
|
6349
6358
|
}
|
|
6350
6359
|
let pr = !1;
|
|
6351
|
-
const
|
|
6360
|
+
const ul = () => {
|
|
6352
6361
|
if (ae())
|
|
6353
6362
|
try {
|
|
6354
6363
|
if (pr) return;
|
|
6355
|
-
tn(),
|
|
6364
|
+
tn(), Oi(), pr = !0;
|
|
6356
6365
|
} catch (e) {
|
|
6357
6366
|
console.warn("[next-sdk] 自动注入 modelContext polyfill 和桥接同步失败:", e);
|
|
6358
6367
|
}
|
|
6359
6368
|
};
|
|
6360
6369
|
export {
|
|
6361
|
-
|
|
6370
|
+
sl as A,
|
|
6362
6371
|
ve as M,
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6372
|
+
Ba as W,
|
|
6373
|
+
Ka as a,
|
|
6374
|
+
Ya as b,
|
|
6375
|
+
Ga as c,
|
|
6376
|
+
Xa as d,
|
|
6368
6377
|
An as e,
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6378
|
+
Qa as f,
|
|
6379
|
+
pi as g,
|
|
6380
|
+
el as h,
|
|
6381
|
+
ul as i,
|
|
6382
|
+
tl as j,
|
|
6383
|
+
rl as k,
|
|
6375
6384
|
In as l,
|
|
6376
|
-
|
|
6377
|
-
|
|
6385
|
+
nl as m,
|
|
6386
|
+
ol as n,
|
|
6378
6387
|
Be as o,
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6388
|
+
$i as p,
|
|
6389
|
+
cl as q,
|
|
6390
|
+
al as r,
|
|
6391
|
+
il as s,
|
|
6392
|
+
Oi as t,
|
|
6393
|
+
Ia as u,
|
|
6385
6394
|
tn as v,
|
|
6386
|
-
|
|
6395
|
+
ll as w,
|
|
6387
6396
|
V as x,
|
|
6388
|
-
|
|
6397
|
+
wa as y
|
|
6389
6398
|
};
|