@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/index.d.ts
CHANGED
|
@@ -28,3 +28,14 @@ export { getSkillOverviews, formatSkillsForSystemPrompt, getSkillMdContent, getM
|
|
|
28
28
|
export * from '@mcp-b/webmcp-polyfill';
|
|
29
29
|
export { initializeBuiltinWebMCP } from './page-tools/initialize-builtin-WebMCP';
|
|
30
30
|
export { registerPageAgentTool } from './page-tools/page-agent-tool';
|
|
31
|
+
export { PAGE_AGENT_TOOL_CALL_EVENT, PAGE_AGENT_TOOL_RESULT_EVENT } from './page-tools/page-agent-tool-event';
|
|
32
|
+
export type { PageAgentToolCallEventDetail, PageAgentToolResultEventDetail } from './page-tools/page-agent-tool-event';
|
|
33
|
+
export type { PageAgentToolOptions } from './page-tools/tool-config';
|
|
34
|
+
export { DEFAULT_PAGE_AGENT_TOOL_CONFIG, getPageAgentToolConfig, setPageAgentToolConfig } from './page-tools/tool-config';
|
|
35
|
+
export type { PageAgentToolConfig, PageAgentToolConfigPatch } from './page-tools/tool-config';
|
|
36
|
+
export { consoleCloudPageAgentToolOptions, isConsoleCloudHost, } from './page-tools/configs/console-cloud';
|
|
37
|
+
export { DEFAULT_A11Y_CONFIG, defineA11yConfig, resolveA11yInfo, resolveA11yRole, resolveA11yStates, mergeA11yConfig, mergeA11yConfigs, ensureResolvedA11yConfig, isResolvedA11yConfig, extractSelectors, } from './page-tools/a11y/config';
|
|
38
|
+
export type { A11yConfig, ResolvedA11yConfig, A11yRoleRule, A11yMatcher, A11yStateName, A11yInfo } from './page-tools/a11y/config';
|
|
39
|
+
export { buildA11yTree } from './page-tools/a11y/build';
|
|
40
|
+
export { searchA11yTree } from './page-tools/a11y/search';
|
|
41
|
+
export type { A11yTreeOptions, A11yTreeResult, SearchA11yTreeOptions, SearchA11yTreeResult, VNode, RefMap } from './page-tools/a11y/types';
|
package/dist/index.js
CHANGED
|
@@ -1,59 +1,78 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as s } from "ajv";
|
|
2
2
|
import { z as t } from "zod";
|
|
3
3
|
import { AuthClientProvider as l } from "@opentiny/next";
|
|
4
4
|
import { ResourceTemplate as n } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
|
-
import { UriTemplate as
|
|
6
|
-
import { completable as
|
|
7
|
-
import { getDisplayName as
|
|
8
|
-
import { InMemoryTransport as
|
|
9
|
-
import { A as
|
|
10
|
-
import {
|
|
5
|
+
import { UriTemplate as g } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
|
|
6
|
+
import { completable as C } from "@modelcontextprotocol/sdk/server/completable.js";
|
|
7
|
+
import { getDisplayName as S } from "@modelcontextprotocol/sdk/shared/metadataUtils.js";
|
|
8
|
+
import { InMemoryTransport as f } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
9
|
+
import { A as P, p as E, M as c, o as v, e as _, W as y, u as d, j as O, a as x, c as h, f as b, h as G, g as R, i as u, v as N, v as L, n as k, d as D, m as W, b as I, x as F, k as z, l as U, r as j, q as w, s as B, t as H, y as q, w as Q } from "./initialize-builtin-WebMCP-JaoKwVlm.js";
|
|
10
|
+
import { k as Y, D as K, P as J, e as X, Q as Z, x as $, i as ee, z as ae, d as se, l as re, u as te, w as oe, f as le, c as ie, b as ne, h as Te, a as ge, g as pe, j as Ce, v as Ae, q as Se, t as me, p as fe, r as Me, m as Pe, n as Ee, o as ce, y as ve, s as _e } from "./index-R_HIbfUX.js";
|
|
11
11
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
P as AgentModelProvider,
|
|
13
|
+
s as Ajv,
|
|
14
14
|
l as AuthClientProvider,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
Y as DEFAULT_A11Y_CONFIG,
|
|
16
|
+
K as DEFAULT_PAGE_AGENT_TOOL_CONFIG,
|
|
17
|
+
f as InMemoryTransport,
|
|
18
|
+
E as MSG_REMOTER_READY,
|
|
19
|
+
c as MSG_TOOL_REGISTERED,
|
|
20
|
+
v as MSG_TOOL_UNREGISTERED,
|
|
21
|
+
J as PAGE_AGENT_TOOL_CALL_EVENT,
|
|
22
|
+
X as PAGE_AGENT_TOOL_RESULT_EVENT,
|
|
23
|
+
Z as QrCode,
|
|
20
24
|
n as ResourceTemplate,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
25
|
+
g as UriTemplate,
|
|
26
|
+
_ as WebMcpClient,
|
|
27
|
+
y as WebMcpServer,
|
|
28
|
+
$ as buildA11yTree,
|
|
29
|
+
d as cleanupWebMCPPolyfill,
|
|
30
|
+
C as completable,
|
|
31
|
+
ee as consoleCloudPageAgentToolOptions,
|
|
32
|
+
O as createMessageChannelClientTransport,
|
|
33
|
+
x as createMessageChannelPairTransport,
|
|
34
|
+
h as createMessageChannelServerTransport,
|
|
35
|
+
ae as createRemoter,
|
|
36
|
+
b as createSSEClientTransport,
|
|
37
|
+
se as createSkillTools,
|
|
38
|
+
G as createStreamableHTTPClientTransport,
|
|
39
|
+
re as defineA11yConfig,
|
|
40
|
+
te as ensureResolvedA11yConfig,
|
|
41
|
+
oe as extractSelectors,
|
|
42
|
+
le as formatSkillsForSystemPrompt,
|
|
43
|
+
R as getAISDKTools,
|
|
44
|
+
S as getDisplayName,
|
|
45
|
+
ie as getMainSkillPathByName,
|
|
46
|
+
ne as getMainSkillPaths,
|
|
47
|
+
Te as getPageAgentToolConfig,
|
|
48
|
+
ge as getSkillMdContent,
|
|
49
|
+
pe as getSkillOverviews,
|
|
50
|
+
u as initializeBuiltinWebMCP,
|
|
51
|
+
N as initializeWebMCPPolyfill,
|
|
52
|
+
L as initializeWebModelContextPolyfill,
|
|
53
|
+
Ce as isConsoleCloudHost,
|
|
54
|
+
k as isMcpClient,
|
|
55
|
+
D as isMcpServer,
|
|
56
|
+
W as isMessageChannelClientTransport,
|
|
46
57
|
I as isMessageChannelServerTransport,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
F as isPlainObject,
|
|
59
|
+
Ae as isResolvedA11yConfig,
|
|
60
|
+
z as isSSEClientTransport,
|
|
61
|
+
U as isStreamableHTTPClientTransport,
|
|
62
|
+
Se as mergeA11yConfig,
|
|
63
|
+
me as mergeA11yConfigs,
|
|
64
|
+
fe as parseSkillFrontMatter,
|
|
65
|
+
j as registerNavigateTool,
|
|
66
|
+
Me as registerPageAgentTool,
|
|
67
|
+
w as registerPageTool,
|
|
68
|
+
Pe as resolveA11yInfo,
|
|
69
|
+
Ee as resolveA11yRole,
|
|
70
|
+
ce as resolveA11yStates,
|
|
71
|
+
ve as searchA11yTree,
|
|
72
|
+
B as setNavigator,
|
|
73
|
+
_e as setPageAgentToolConfig,
|
|
74
|
+
H as setupModelContextBridge,
|
|
75
|
+
q as validateArgsWithSchema,
|
|
76
|
+
Q as withPageTools,
|
|
58
77
|
t as z
|
|
59
78
|
};
|