@opentiny/next-sdk 0.3.1 → 0.3.3-alpha.1
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/WebMcp.ts +6 -0
- package/WebMcpClient.ts +16 -21
- package/agent/type.ts +93 -69
- package/core.ts +1 -0
- package/dist/SimulatorMask-BHVXyogh-BFEGpD5S.js +1048 -0
- package/dist/SimulatorMask-BHVXyogh-CCYbrb84.js +801 -0
- package/dist/WebMcp.d.ts +3 -0
- package/dist/WebMcpClient.d.ts +7 -13
- package/dist/agent/type.d.ts +10 -0
- package/dist/core.d.ts +1 -0
- package/dist/core.js +16 -15
- package/dist/index.d.ts +3 -2
- package/dist/index.es.dev.js +8384 -2700
- package/dist/index.es.js +21608 -16893
- package/dist/index.js +4033 -1850
- package/dist/index.umd.dev.js +9739 -3110
- package/dist/index.umd.js +500 -66
- package/dist/initialize-builtin-WebMCP-HgObT902.js +6279 -0
- package/dist/mcpsdk@1.25.3.dev.js +253 -94
- package/dist/mcpsdk@1.25.3.es.dev.js +253 -94
- package/dist/mcpsdk@1.25.3.es.js +5689 -5531
- package/dist/mcpsdk@1.25.3.js +32 -27
- package/dist/page-tools/a11y-tree.d.ts +103 -0
- package/dist/page-tools/bridge.d.ts +0 -6
- package/dist/page-tools/initialize-builtin-WebMCP.d.ts +1 -0
- package/dist/page-tools/page-agent-tool.d.ts +9 -0
- package/dist/page-tools/page-state-cache.d.ts +36 -0
- package/dist/skills/index.d.ts +7 -12
- package/dist/webagent.dev.js +3772 -1919
- package/dist/webagent.es.dev.js +3528 -1571
- package/dist/webagent.es.js +16380 -14585
- package/dist/webagent.js +74 -66
- package/dist/webmcp-full.dev.js +7670 -747
- package/dist/webmcp-full.es.dev.js +6482 -608
- package/dist/webmcp-full.es.js +12180 -7618
- package/dist/webmcp-full.js +631 -29
- package/dist/webmcp.dev.js +8047 -53
- package/dist/webmcp.es.dev.js +6977 -31
- package/dist/webmcp.es.js +6187 -860
- package/dist/webmcp.js +602 -1
- package/index.ts +2 -15
- package/package.json +11 -4
- package/page-tools/a11y-tree.ts +532 -0
- package/page-tools/bridge.ts +48 -14
- package/page-tools/initialize-builtin-WebMCP.ts +20 -0
- package/page-tools/page-agent-prompt.md +123 -0
- package/page-tools/page-agent-tool.ts +223 -0
- package/page-tools/page-state-cache.ts +78 -0
- package/remoter/createRemoter.ts +2 -1
- package/remoter/svgs/logo.svg +45 -0
- package/skills/index.ts +50 -31
- package/utils/builtinProxy.ts +42 -20
- package/vite-env.d.ts +5 -0
- package/dist/AgentModelProvider-BnMj6YSC.js +0 -4182
package/dist/WebMcp.d.ts
CHANGED
|
@@ -18,3 +18,6 @@ export type * from '@modelcontextprotocol/sdk/client/sse.js';
|
|
|
18
18
|
export type * from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
19
19
|
export type * from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
20
20
|
export * from './transport/ExtensionPageServerTransport';
|
|
21
|
+
export { initializeBuiltinWebMCP } from './page-tools/initialize-builtin-WebMCP';
|
|
22
|
+
export { setupModelContextBridge } from './page-tools/bridge';
|
|
23
|
+
export { registerPageAgentTool } from './page-tools/page-agent-tool';
|
package/dist/WebMcpClient.d.ts
CHANGED
|
@@ -168,11 +168,7 @@ export declare class WebMcpClient {
|
|
|
168
168
|
name: string;
|
|
169
169
|
type: "resource_link";
|
|
170
170
|
description?: string | undefined;
|
|
171
|
-
mimeType
|
|
172
|
-
* Registers a handler to invoke when this protocol object receives a notification with the given method.
|
|
173
|
-
*
|
|
174
|
-
* Note that this will replace any previous notification handler for the same method.
|
|
175
|
-
*/: string | undefined;
|
|
171
|
+
mimeType?: string | undefined;
|
|
176
172
|
annotations?: {
|
|
177
173
|
audience?: ("user" | "assistant")[] | undefined;
|
|
178
174
|
priority?: number | undefined;
|
|
@@ -193,7 +189,11 @@ export declare class WebMcpClient {
|
|
|
193
189
|
_meta?: {
|
|
194
190
|
[x: string]: unknown;
|
|
195
191
|
progressToken?: string | number | undefined;
|
|
196
|
-
"io.modelcontextprotocol/related-task"
|
|
192
|
+
"io.modelcontextprotocol/related-task"
|
|
193
|
+
/**
|
|
194
|
+
* Registers a handler for the create LLM message request.
|
|
195
|
+
*/
|
|
196
|
+
?: {
|
|
197
197
|
taskId: string;
|
|
198
198
|
} | undefined;
|
|
199
199
|
} | undefined;
|
|
@@ -226,13 +226,7 @@ export declare class WebMcpClient {
|
|
|
226
226
|
_meta?: {
|
|
227
227
|
[x: string]: unknown;
|
|
228
228
|
progressToken?: string | number | undefined;
|
|
229
|
-
"io.modelcontextprotocol/related-task"
|
|
230
|
-
/**
|
|
231
|
-
* Registers a handler for the prompt list changed notification.
|
|
232
|
-
*/
|
|
233
|
-
? /**
|
|
234
|
-
* Registers a handler for the prompt list changed notification.
|
|
235
|
-
*/: {
|
|
229
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
236
230
|
taskId: string;
|
|
237
231
|
} | undefined;
|
|
238
232
|
} | undefined;
|
package/dist/agent/type.d.ts
CHANGED
|
@@ -47,21 +47,29 @@ export type McpServerConfig = {
|
|
|
47
47
|
url: string;
|
|
48
48
|
useAISdkClient?: boolean;
|
|
49
49
|
headers?: Record<string, string>;
|
|
50
|
+
name?: string;
|
|
51
|
+
description?: string;
|
|
50
52
|
} | {
|
|
51
53
|
type: 'sse';
|
|
52
54
|
url: string;
|
|
53
55
|
useAISdkClient?: boolean;
|
|
54
56
|
headers?: Record<string, string>;
|
|
57
|
+
name?: string;
|
|
58
|
+
description?: string;
|
|
55
59
|
} | {
|
|
56
60
|
type: 'extension';
|
|
57
61
|
url: string;
|
|
58
62
|
sessionId: string;
|
|
59
63
|
useAISdkClient?: boolean;
|
|
60
64
|
headers?: Record<string, string>;
|
|
65
|
+
name?: string;
|
|
66
|
+
description?: string;
|
|
61
67
|
} | {
|
|
62
68
|
type: 'local';
|
|
63
69
|
transport: MCPTransport;
|
|
64
70
|
useAISdkClient?: boolean;
|
|
71
|
+
name?: string;
|
|
72
|
+
description?: string;
|
|
65
73
|
} | {
|
|
66
74
|
/**
|
|
67
75
|
* 浏览器内置 WebMCP 类型。
|
|
@@ -71,6 +79,8 @@ export type McpServerConfig = {
|
|
|
71
79
|
type: 'builtin';
|
|
72
80
|
/** 传入 `navigator.modelContextTesting` 对象 */
|
|
73
81
|
client: BuiltinMcpClient;
|
|
82
|
+
name?: string;
|
|
83
|
+
description?: string;
|
|
74
84
|
};
|
|
75
85
|
/** */
|
|
76
86
|
export interface IAgentModelProviderOption {
|
package/dist/core.d.ts
CHANGED
|
@@ -22,3 +22,4 @@ export * from './transport/ExtensionClientTransport';
|
|
|
22
22
|
export { AgentModelProvider } from './agent/AgentModelProvider';
|
|
23
23
|
export { getAISDKTools } from './agent/utils/getAISDKTools';
|
|
24
24
|
export type * from './agent/type';
|
|
25
|
+
export { initializeBuiltinWebMCP } from './page-tools/initialize-builtin-WebMCP';
|
package/dist/core.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { default as a } from "ajv";
|
|
2
2
|
import { z as t } from "zod";
|
|
3
|
-
import { AuthClientProvider as
|
|
3
|
+
import { AuthClientProvider as o } from "@opentiny/next";
|
|
4
4
|
import { ResourceTemplate as l } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
5
|
import { UriTemplate as T } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
|
|
6
6
|
import { completable as C } from "@modelcontextprotocol/sdk/server/completable.js";
|
|
7
|
-
import { getDisplayName as
|
|
7
|
+
import { getDisplayName as M } from "@modelcontextprotocol/sdk/shared/metadataUtils.js";
|
|
8
8
|
import { InMemoryTransport as S } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
9
|
-
import { A as g, E as
|
|
9
|
+
import { A as g, E as b, e as h, W as v, j as P, a as d, c as A, f as u, h as E, g as W, i as j, n as y, d as z, m as D, b as H, k as I, l as k } from "./initialize-builtin-WebMCP-HgObT902.js";
|
|
10
10
|
export {
|
|
11
11
|
g as AgentModelProvider,
|
|
12
12
|
a as Ajv,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
o as AuthClientProvider,
|
|
14
|
+
b as ExtensionClientTransport,
|
|
15
15
|
S as InMemoryTransport,
|
|
16
16
|
l as ResourceTemplate,
|
|
17
17
|
T as UriTemplate,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
h as WebMcpClient,
|
|
19
|
+
v as WebMcpServer,
|
|
20
20
|
C as completable,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
P as createMessageChannelClientTransport,
|
|
22
|
+
d as createMessageChannelPairTransport,
|
|
23
|
+
A as createMessageChannelServerTransport,
|
|
24
|
+
u as createSSEClientTransport,
|
|
25
|
+
E as createStreamableHTTPClientTransport,
|
|
26
26
|
W as getAISDKTools,
|
|
27
|
-
|
|
28
|
-
j as
|
|
29
|
-
y as
|
|
27
|
+
M as getDisplayName,
|
|
28
|
+
j as initializeBuiltinWebMCP,
|
|
29
|
+
y as isMcpClient,
|
|
30
|
+
z as isMcpServer,
|
|
30
31
|
D as isMessageChannelClientTransport,
|
|
31
32
|
H as isMessageChannelServerTransport,
|
|
32
33
|
I as isSSEClientTransport,
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { getAISDKTools } from './agent/utils/getAISDKTools';
|
|
|
27
27
|
export { QrCode, type QrCodeOption } from './remoter/QrCode';
|
|
28
28
|
export type * from './agent/type';
|
|
29
29
|
export * from './page-tools/bridge';
|
|
30
|
-
export { getSkillOverviews, formatSkillsForSystemPrompt,
|
|
30
|
+
export { getSkillOverviews, formatSkillsForSystemPrompt, getSkillMdContent, getMainSkillPaths, getMainSkillPathByName, parseSkillFrontMatter, createSkillTools, type SkillMeta, type SkillToolsSet } from './skills/index';
|
|
31
31
|
export * from '@mcp-b/webmcp-polyfill';
|
|
32
|
-
export
|
|
32
|
+
export { initializeBuiltinWebMCP } from './page-tools/initialize-builtin-WebMCP';
|
|
33
|
+
export { registerPageAgentTool } from './page-tools/page-agent-tool';
|