@creatoria/miniapp-mcp 0.2.0 → 0.2.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/README.md +127 -73
- package/dist/capabilities/assert/handlers/assert-handlers.d.ts +98 -0
- package/dist/capabilities/assert/handlers/assert-handlers.d.ts.map +1 -0
- package/dist/capabilities/assert/handlers/assert-handlers.js +179 -0
- package/dist/capabilities/assert/handlers/assert-handlers.js.map +1 -0
- package/dist/capabilities/assert/handlers/index.d.ts +7 -0
- package/dist/capabilities/assert/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/assert/handlers/index.js +7 -0
- package/dist/capabilities/assert/handlers/index.js.map +1 -0
- package/dist/capabilities/assert/index.d.ts +12 -2
- package/dist/capabilities/assert/index.d.ts.map +1 -1
- package/dist/capabilities/assert/index.js +87 -2
- package/dist/capabilities/assert/index.js.map +1 -1
- package/dist/capabilities/assert/schemas/index.d.ts +101 -0
- package/dist/capabilities/assert/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/assert/schemas/index.js +62 -0
- package/dist/capabilities/assert/schemas/index.js.map +1 -0
- package/dist/capabilities/automator/handlers/close.d.ts +18 -0
- package/dist/capabilities/automator/handlers/close.d.ts.map +1 -0
- package/dist/capabilities/automator/handlers/close.js +45 -0
- package/dist/capabilities/automator/handlers/close.js.map +1 -0
- package/dist/capabilities/automator/handlers/connect.d.ts +24 -0
- package/dist/capabilities/automator/handlers/connect.d.ts.map +1 -0
- package/dist/capabilities/automator/handlers/connect.js +51 -0
- package/dist/capabilities/automator/handlers/connect.js.map +1 -0
- package/dist/capabilities/automator/handlers/disconnect.d.ts +16 -0
- package/dist/capabilities/automator/handlers/disconnect.d.ts.map +1 -0
- package/dist/capabilities/automator/handlers/disconnect.js +44 -0
- package/dist/capabilities/automator/handlers/disconnect.js.map +1 -0
- package/dist/capabilities/automator/handlers/index.d.ts +8 -0
- package/dist/capabilities/automator/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/automator/handlers/index.js +8 -0
- package/dist/capabilities/automator/handlers/index.js.map +1 -0
- package/dist/capabilities/automator/handlers/launch.d.ts +25 -0
- package/dist/capabilities/automator/handlers/launch.d.ts.map +1 -0
- package/dist/capabilities/automator/handlers/launch.js +61 -0
- package/dist/capabilities/automator/handlers/launch.js.map +1 -0
- package/dist/capabilities/automator/index.d.ts +11 -2
- package/dist/capabilities/automator/index.d.ts.map +1 -1
- package/dist/capabilities/automator/index.js +51 -2
- package/dist/capabilities/automator/index.js.map +1 -1
- package/dist/capabilities/automator/schemas/index.d.ts +5 -0
- package/dist/capabilities/automator/schemas/index.d.ts.map +1 -1
- package/dist/capabilities/automator/schemas/index.js +6 -4
- package/dist/capabilities/automator/schemas/index.js.map +1 -1
- package/dist/capabilities/element/handlers/element-handlers.d.ts +212 -0
- package/dist/capabilities/element/handlers/element-handlers.d.ts.map +1 -0
- package/dist/capabilities/element/handlers/element-handlers.js +383 -0
- package/dist/capabilities/element/handlers/element-handlers.js.map +1 -0
- package/dist/capabilities/element/handlers/index.d.ts +7 -0
- package/dist/capabilities/element/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/element/handlers/index.js +27 -0
- package/dist/capabilities/element/handlers/index.js.map +1 -0
- package/dist/capabilities/element/index.d.ts +17 -2
- package/dist/capabilities/element/index.d.ts.map +1 -1
- package/dist/capabilities/element/index.js +196 -2
- package/dist/capabilities/element/index.js.map +1 -1
- package/dist/capabilities/element/schemas/index.d.ts +325 -0
- package/dist/capabilities/element/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/element/schemas/index.js +168 -0
- package/dist/capabilities/element/schemas/index.js.map +1 -0
- package/dist/capabilities/index.d.ts +23 -4
- package/dist/capabilities/index.d.ts.map +1 -1
- package/dist/capabilities/index.js +29 -3
- package/dist/capabilities/index.js.map +1 -1
- package/dist/capabilities/loader.d.ts +61 -0
- package/dist/capabilities/loader.d.ts.map +1 -0
- package/dist/capabilities/loader.js +164 -0
- package/dist/capabilities/loader.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/call-wx.d.ts +24 -0
- package/dist/capabilities/miniprogram/handlers/call-wx.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/call-wx.js +37 -0
- package/dist/capabilities/miniprogram/handlers/call-wx.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/evaluate.d.ts +32 -0
- package/dist/capabilities/miniprogram/handlers/evaluate.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/evaluate.js +51 -0
- package/dist/capabilities/miniprogram/handlers/evaluate.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/index.d.ts +12 -0
- package/dist/capabilities/miniprogram/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/index.js +12 -0
- package/dist/capabilities/miniprogram/handlers/index.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/navigate.d.ts +26 -0
- package/dist/capabilities/miniprogram/handlers/navigate.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/navigate.js +56 -0
- package/dist/capabilities/miniprogram/handlers/navigate.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/page-stack.d.ts +20 -0
- package/dist/capabilities/miniprogram/handlers/page-stack.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/page-stack.js +37 -0
- package/dist/capabilities/miniprogram/handlers/page-stack.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/screenshot.d.ts +33 -0
- package/dist/capabilities/miniprogram/handlers/screenshot.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/screenshot.js +132 -0
- package/dist/capabilities/miniprogram/handlers/screenshot.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/system-info.d.ts +17 -0
- package/dist/capabilities/miniprogram/handlers/system-info.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/system-info.js +31 -0
- package/dist/capabilities/miniprogram/handlers/system-info.js.map +1 -0
- package/dist/capabilities/miniprogram/index.d.ts +12 -2
- package/dist/capabilities/miniprogram/index.d.ts.map +1 -1
- package/dist/capabilities/miniprogram/index.js +66 -2
- package/dist/capabilities/miniprogram/index.js.map +1 -1
- package/dist/capabilities/miniprogram/schemas/call-wx.d.ts +15 -0
- package/dist/capabilities/miniprogram/schemas/call-wx.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/call-wx.js +11 -0
- package/dist/capabilities/miniprogram/schemas/call-wx.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/evaluate.d.ts +15 -0
- package/dist/capabilities/miniprogram/schemas/evaluate.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/evaluate.js +11 -0
- package/dist/capabilities/miniprogram/schemas/evaluate.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/index.d.ts +10 -0
- package/dist/capabilities/miniprogram/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/index.js +10 -0
- package/dist/capabilities/miniprogram/schemas/index.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/navigate.d.ts +18 -0
- package/dist/capabilities/miniprogram/schemas/navigate.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/navigate.js +22 -0
- package/dist/capabilities/miniprogram/schemas/navigate.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/page-stack.d.ts +6 -0
- package/dist/capabilities/miniprogram/schemas/page-stack.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/page-stack.js +6 -0
- package/dist/capabilities/miniprogram/schemas/page-stack.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/screenshot.d.ts +18 -0
- package/dist/capabilities/miniprogram/schemas/screenshot.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/screenshot.js +21 -0
- package/dist/capabilities/miniprogram/schemas/screenshot.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/system-info.d.ts +6 -0
- package/dist/capabilities/miniprogram/schemas/system-info.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/system-info.js +6 -0
- package/dist/capabilities/miniprogram/schemas/system-info.js.map +1 -0
- package/dist/capabilities/network/handlers/index.d.ts +7 -0
- package/dist/capabilities/network/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/network/handlers/index.js +7 -0
- package/dist/capabilities/network/handlers/index.js.map +1 -0
- package/dist/capabilities/network/handlers/network-handlers.d.ts +53 -0
- package/dist/capabilities/network/handlers/network-handlers.d.ts.map +1 -0
- package/dist/capabilities/network/handlers/network-handlers.js +127 -0
- package/dist/capabilities/network/handlers/network-handlers.js.map +1 -0
- package/dist/capabilities/network/index.d.ts +12 -2
- package/dist/capabilities/network/index.d.ts.map +1 -1
- package/dist/capabilities/network/index.js +66 -2
- package/dist/capabilities/network/index.js.map +1 -1
- package/dist/capabilities/network/schemas/index.d.ts +53 -0
- package/dist/capabilities/network/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/network/schemas/index.js +33 -0
- package/dist/capabilities/network/schemas/index.js.map +1 -0
- package/dist/capabilities/page/handlers/index.d.ts +7 -0
- package/dist/capabilities/page/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/page/handlers/index.js +7 -0
- package/dist/capabilities/page/handlers/index.js.map +1 -0
- package/dist/capabilities/page/handlers/page-handlers.d.ts +165 -0
- package/dist/capabilities/page/handlers/page-handlers.d.ts.map +1 -0
- package/dist/capabilities/page/handlers/page-handlers.js +258 -0
- package/dist/capabilities/page/handlers/page-handlers.js.map +1 -0
- package/dist/capabilities/page/index.d.ts +12 -2
- package/dist/capabilities/page/index.d.ts.map +1 -1
- package/dist/capabilities/page/index.js +80 -2
- package/dist/capabilities/page/index.js.map +1 -1
- package/dist/capabilities/page/schemas/index.d.ts +91 -0
- package/dist/capabilities/page/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/page/schemas/index.js +55 -0
- package/dist/capabilities/page/schemas/index.js.map +1 -0
- package/dist/capabilities/record/handlers/index.d.ts +7 -0
- package/dist/capabilities/record/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/record/handlers/index.js +7 -0
- package/dist/capabilities/record/handlers/index.js.map +1 -0
- package/dist/capabilities/record/handlers/record-handlers.d.ts +76 -0
- package/dist/capabilities/record/handlers/record-handlers.d.ts.map +1 -0
- package/dist/capabilities/record/handlers/record-handlers.js +255 -0
- package/dist/capabilities/record/handlers/record-handlers.js.map +1 -0
- package/dist/capabilities/record/index.d.ts +12 -2
- package/dist/capabilities/record/index.d.ts.map +1 -1
- package/dist/capabilities/record/index.js +66 -2
- package/dist/capabilities/record/index.js.map +1 -1
- package/dist/capabilities/record/schemas/index.d.ts +47 -0
- package/dist/capabilities/record/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/record/schemas/index.js +33 -0
- package/dist/capabilities/record/schemas/index.js.map +1 -0
- package/dist/capabilities/registry.d.ts +138 -0
- package/dist/capabilities/registry.d.ts.map +1 -0
- package/dist/capabilities/registry.js +261 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/capabilities/snapshot/handlers/index.d.ts +7 -0
- package/dist/capabilities/snapshot/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/snapshot/handlers/index.js +7 -0
- package/dist/capabilities/snapshot/handlers/index.js.map +1 -0
- package/dist/capabilities/snapshot/handlers/snapshot-handlers.d.ts +75 -0
- package/dist/capabilities/snapshot/handlers/snapshot-handlers.d.ts.map +1 -0
- package/dist/capabilities/snapshot/handlers/snapshot-handlers.js +201 -0
- package/dist/capabilities/snapshot/handlers/snapshot-handlers.js.map +1 -0
- package/dist/capabilities/snapshot/index.d.ts +12 -2
- package/dist/capabilities/snapshot/index.d.ts.map +1 -1
- package/dist/capabilities/snapshot/index.js +45 -2
- package/dist/capabilities/snapshot/index.js.map +1 -1
- package/dist/capabilities/snapshot/schemas/index.d.ts +47 -0
- package/dist/capabilities/snapshot/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/snapshot/schemas/index.js +28 -0
- package/dist/capabilities/snapshot/schemas/index.js.map +1 -0
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +2 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/logging/tool-logger.js +2 -2
- package/dist/runtime/logging/tool-logger.js.map +1 -1
- package/dist/runtime/retry/index.d.ts +5 -0
- package/dist/runtime/retry/index.d.ts.map +1 -0
- package/dist/runtime/retry/index.js +5 -0
- package/dist/runtime/retry/index.js.map +1 -0
- package/dist/runtime/retry/retry.d.ts +61 -0
- package/dist/runtime/retry/retry.d.ts.map +1 -0
- package/dist/runtime/retry/retry.js +90 -0
- package/dist/runtime/retry/retry.js.map +1 -0
- package/dist/runtime/timeout/timeout.d.ts +10 -0
- package/dist/runtime/timeout/timeout.d.ts.map +1 -1
- package/dist/runtime/timeout/timeout.js +10 -0
- package/dist/runtime/timeout/timeout.js.map +1 -1
- package/dist/server.js +4 -4
- package/dist/server.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +7 -3
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/miniprogram.d.ts +11 -1
- package/dist/tools/miniprogram.d.ts.map +1 -1
- package/dist/tools/miniprogram.js +102 -20
- package/dist/tools/miniprogram.js.map +1 -1
- package/docs/current/01-architecture-migration.md +337 -0
- package/docs/current/02-screenshot-timeout-fix.md +589 -0
- package/docs/current/README.md +226 -0
- package/package.json +1 -1
|
@@ -1,5 +1,199 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Element
|
|
2
|
+
* Element Capability Module
|
|
3
|
+
*
|
|
4
|
+
* Provides tools for element-level interactions including:
|
|
5
|
+
* - Basic interactions (tap, longpress, input)
|
|
6
|
+
* - Properties and attributes
|
|
7
|
+
* - Events and gestures
|
|
8
|
+
* - ScrollView operations
|
|
9
|
+
* - Specialized component operations (Swiper, MovableView, Slider)
|
|
10
|
+
* - Custom element operations
|
|
3
11
|
*/
|
|
4
|
-
|
|
12
|
+
import { tapSchema, longpressSchema, inputSchema, getTextSchema, getAttributeSchema, getPropertySchema, getValueSchema, getSizeSchema, getOffsetSchema, triggerSchema, getStyleSchema, touchstartSchema, touchmoveSchema, touchendSchema, scrollToSchema, scrollWidthSchema, scrollHeightSchema, swipeToSchema, moveToSchema, slideToSchema, callContextMethodSchema, setDataSchema, callMethodSchema, } from './schemas/index.js';
|
|
13
|
+
import { tap, longpress, input, getText, getAttribute, getProperty, getValue, getSize, getOffset, trigger, getStyle, touchstart, touchmove, touchend, scrollTo, scrollWidth, scrollHeight, swipeTo, moveTo, slideTo, callContextMethod, setData, callMethod, } from './handlers/index.js';
|
|
14
|
+
// Re-export schemas for external use
|
|
15
|
+
export * from './schemas/index.js';
|
|
16
|
+
// Re-export handlers for external use
|
|
17
|
+
export * from './handlers/index.js';
|
|
18
|
+
/**
|
|
19
|
+
* Element tool definitions - 23 tools
|
|
20
|
+
*/
|
|
21
|
+
const tools = [
|
|
22
|
+
// Basic Interactions
|
|
23
|
+
{
|
|
24
|
+
name: 'element_tap',
|
|
25
|
+
description: 'Tap (click) an element',
|
|
26
|
+
capability: 'element',
|
|
27
|
+
inputSchema: tapSchema,
|
|
28
|
+
handler: tap,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'element_longpress',
|
|
32
|
+
description: 'Long press an element',
|
|
33
|
+
capability: 'element',
|
|
34
|
+
inputSchema: longpressSchema,
|
|
35
|
+
handler: longpress,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'element_input',
|
|
39
|
+
description: 'Input text into an element (input/textarea only)',
|
|
40
|
+
capability: 'element',
|
|
41
|
+
inputSchema: inputSchema,
|
|
42
|
+
handler: input,
|
|
43
|
+
},
|
|
44
|
+
// Properties and Attributes
|
|
45
|
+
{
|
|
46
|
+
name: 'element_get_text',
|
|
47
|
+
description: 'Get element text content',
|
|
48
|
+
capability: 'element',
|
|
49
|
+
inputSchema: getTextSchema,
|
|
50
|
+
handler: getText,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'element_get_attribute',
|
|
54
|
+
description: 'Get element attribute (特性)',
|
|
55
|
+
capability: 'element',
|
|
56
|
+
inputSchema: getAttributeSchema,
|
|
57
|
+
handler: getAttribute,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'element_get_property',
|
|
61
|
+
description: 'Get element property (属性)',
|
|
62
|
+
capability: 'element',
|
|
63
|
+
inputSchema: getPropertySchema,
|
|
64
|
+
handler: getProperty,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'element_get_value',
|
|
68
|
+
description: 'Get element value',
|
|
69
|
+
capability: 'element',
|
|
70
|
+
inputSchema: getValueSchema,
|
|
71
|
+
handler: getValue,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'element_get_size',
|
|
75
|
+
description: 'Get element size (width, height)',
|
|
76
|
+
capability: 'element',
|
|
77
|
+
inputSchema: getSizeSchema,
|
|
78
|
+
handler: getSize,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'element_get_offset',
|
|
82
|
+
description: 'Get element offset (position)',
|
|
83
|
+
capability: 'element',
|
|
84
|
+
inputSchema: getOffsetSchema,
|
|
85
|
+
handler: getOffset,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'element_get_style',
|
|
89
|
+
description: 'Get element style value',
|
|
90
|
+
capability: 'element',
|
|
91
|
+
inputSchema: getStyleSchema,
|
|
92
|
+
handler: getStyle,
|
|
93
|
+
},
|
|
94
|
+
// Events
|
|
95
|
+
{
|
|
96
|
+
name: 'element_trigger',
|
|
97
|
+
description: 'Trigger an event on the element',
|
|
98
|
+
capability: 'element',
|
|
99
|
+
inputSchema: triggerSchema,
|
|
100
|
+
handler: trigger,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'element_touchstart',
|
|
104
|
+
description: 'Touch start on element',
|
|
105
|
+
capability: 'element',
|
|
106
|
+
inputSchema: touchstartSchema,
|
|
107
|
+
handler: touchstart,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'element_touchmove',
|
|
111
|
+
description: 'Touch move on element',
|
|
112
|
+
capability: 'element',
|
|
113
|
+
inputSchema: touchmoveSchema,
|
|
114
|
+
handler: touchmove,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'element_touchend',
|
|
118
|
+
description: 'Touch end on element',
|
|
119
|
+
capability: 'element',
|
|
120
|
+
inputSchema: touchendSchema,
|
|
121
|
+
handler: touchend,
|
|
122
|
+
},
|
|
123
|
+
// ScrollView Operations
|
|
124
|
+
{
|
|
125
|
+
name: 'element_scroll_to',
|
|
126
|
+
description: 'Scroll to position (ScrollView only)',
|
|
127
|
+
capability: 'element',
|
|
128
|
+
inputSchema: scrollToSchema,
|
|
129
|
+
handler: scrollTo,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'element_scroll_width',
|
|
133
|
+
description: 'Get scroll width (ScrollView only)',
|
|
134
|
+
capability: 'element',
|
|
135
|
+
inputSchema: scrollWidthSchema,
|
|
136
|
+
handler: scrollWidth,
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'element_scroll_height',
|
|
140
|
+
description: 'Get scroll height (ScrollView only)',
|
|
141
|
+
capability: 'element',
|
|
142
|
+
inputSchema: scrollHeightSchema,
|
|
143
|
+
handler: scrollHeight,
|
|
144
|
+
},
|
|
145
|
+
// Specialized Component Operations
|
|
146
|
+
{
|
|
147
|
+
name: 'element_swipe_to',
|
|
148
|
+
description: 'Swipe to index (Swiper only)',
|
|
149
|
+
capability: 'element',
|
|
150
|
+
inputSchema: swipeToSchema,
|
|
151
|
+
handler: swipeTo,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'element_move_to',
|
|
155
|
+
description: 'Move to position (MovableView only)',
|
|
156
|
+
capability: 'element',
|
|
157
|
+
inputSchema: moveToSchema,
|
|
158
|
+
handler: moveTo,
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: 'element_slide_to',
|
|
162
|
+
description: 'Slide to value (Slider only)',
|
|
163
|
+
capability: 'element',
|
|
164
|
+
inputSchema: slideToSchema,
|
|
165
|
+
handler: slideTo,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: 'element_call_context_method',
|
|
169
|
+
description: 'Call context method (ContextElement only)',
|
|
170
|
+
capability: 'element',
|
|
171
|
+
inputSchema: callContextMethodSchema,
|
|
172
|
+
handler: callContextMethod,
|
|
173
|
+
},
|
|
174
|
+
// Custom Element Operations
|
|
175
|
+
{
|
|
176
|
+
name: 'element_set_data',
|
|
177
|
+
description: 'Set data on custom element (CustomElement only)',
|
|
178
|
+
capability: 'element',
|
|
179
|
+
inputSchema: setDataSchema,
|
|
180
|
+
handler: setData,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'element_call_method',
|
|
184
|
+
description: 'Call method on custom element (CustomElement only)',
|
|
185
|
+
capability: 'element',
|
|
186
|
+
inputSchema: callMethodSchema,
|
|
187
|
+
handler: callMethod,
|
|
188
|
+
},
|
|
189
|
+
];
|
|
190
|
+
/**
|
|
191
|
+
* Element capability module
|
|
192
|
+
*/
|
|
193
|
+
export const capability = {
|
|
194
|
+
name: 'element',
|
|
195
|
+
description: 'Element-level interactions and properties (23 tools)',
|
|
196
|
+
tools,
|
|
197
|
+
};
|
|
198
|
+
export default capability;
|
|
5
199
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/capabilities/element/index.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/capabilities/element/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,SAAS,EACT,eAAe,EACf,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,eAAe,EACf,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf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AqB;QAC3B,WAAW,EAAE,oDAAoD;QACjE,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,gBAAgB;QAC7B,OAAO,EAAE,UAAU;KACpB;CACF,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAqB;IAC1C,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,sDAAsD;IACnE,KAAK;CACN,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Element schemas exports - 23 element tool schemas
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export declare const tapSchema: z.ZodObject<{
|
|
6
|
+
refId: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
refId: string;
|
|
9
|
+
}, {
|
|
10
|
+
refId: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const longpressSchema: z.ZodObject<{
|
|
13
|
+
refId: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
refId: string;
|
|
16
|
+
}, {
|
|
17
|
+
refId: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const inputSchema: z.ZodObject<{
|
|
20
|
+
refId: z.ZodString;
|
|
21
|
+
value: z.ZodString;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
refId: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}, {
|
|
26
|
+
refId: string;
|
|
27
|
+
value: string;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const getTextSchema: z.ZodObject<{
|
|
30
|
+
refId: z.ZodString;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
refId: string;
|
|
33
|
+
}, {
|
|
34
|
+
refId: string;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const getAttributeSchema: z.ZodObject<{
|
|
37
|
+
refId: z.ZodString;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
refId: string;
|
|
41
|
+
name: string;
|
|
42
|
+
}, {
|
|
43
|
+
refId: string;
|
|
44
|
+
name: string;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const getPropertySchema: z.ZodObject<{
|
|
47
|
+
refId: z.ZodString;
|
|
48
|
+
name: z.ZodString;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
refId: string;
|
|
51
|
+
name: string;
|
|
52
|
+
}, {
|
|
53
|
+
refId: string;
|
|
54
|
+
name: string;
|
|
55
|
+
}>;
|
|
56
|
+
export declare const getValueSchema: z.ZodObject<{
|
|
57
|
+
refId: z.ZodString;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
refId: string;
|
|
60
|
+
}, {
|
|
61
|
+
refId: string;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const getSizeSchema: z.ZodObject<{
|
|
64
|
+
refId: z.ZodString;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
refId: string;
|
|
67
|
+
}, {
|
|
68
|
+
refId: string;
|
|
69
|
+
}>;
|
|
70
|
+
export declare const getOffsetSchema: z.ZodObject<{
|
|
71
|
+
refId: z.ZodString;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
refId: string;
|
|
74
|
+
}, {
|
|
75
|
+
refId: string;
|
|
76
|
+
}>;
|
|
77
|
+
export declare const getStyleSchema: z.ZodObject<{
|
|
78
|
+
refId: z.ZodString;
|
|
79
|
+
name: z.ZodString;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
refId: string;
|
|
82
|
+
name: string;
|
|
83
|
+
}, {
|
|
84
|
+
refId: string;
|
|
85
|
+
name: string;
|
|
86
|
+
}>;
|
|
87
|
+
export declare const triggerSchema: z.ZodObject<{
|
|
88
|
+
refId: z.ZodString;
|
|
89
|
+
type: z.ZodString;
|
|
90
|
+
detail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
refId: string;
|
|
93
|
+
type: string;
|
|
94
|
+
detail?: Record<string, any> | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
refId: string;
|
|
97
|
+
type: string;
|
|
98
|
+
detail?: Record<string, any> | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
export declare const touchstartSchema: z.ZodObject<{
|
|
101
|
+
refId: z.ZodString;
|
|
102
|
+
touches: z.ZodArray<z.ZodObject<{
|
|
103
|
+
x: z.ZodNumber;
|
|
104
|
+
y: z.ZodNumber;
|
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
|
106
|
+
x: number;
|
|
107
|
+
y: number;
|
|
108
|
+
}, {
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
}>, "many">;
|
|
112
|
+
changedTouches: z.ZodArray<z.ZodObject<{
|
|
113
|
+
x: z.ZodNumber;
|
|
114
|
+
y: z.ZodNumber;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
x: number;
|
|
117
|
+
y: number;
|
|
118
|
+
}, {
|
|
119
|
+
x: number;
|
|
120
|
+
y: number;
|
|
121
|
+
}>, "many">;
|
|
122
|
+
}, "strip", z.ZodTypeAny, {
|
|
123
|
+
refId: string;
|
|
124
|
+
touches: {
|
|
125
|
+
x: number;
|
|
126
|
+
y: number;
|
|
127
|
+
}[];
|
|
128
|
+
changedTouches: {
|
|
129
|
+
x: number;
|
|
130
|
+
y: number;
|
|
131
|
+
}[];
|
|
132
|
+
}, {
|
|
133
|
+
refId: string;
|
|
134
|
+
touches: {
|
|
135
|
+
x: number;
|
|
136
|
+
y: number;
|
|
137
|
+
}[];
|
|
138
|
+
changedTouches: {
|
|
139
|
+
x: number;
|
|
140
|
+
y: number;
|
|
141
|
+
}[];
|
|
142
|
+
}>;
|
|
143
|
+
export declare const touchmoveSchema: z.ZodObject<{
|
|
144
|
+
refId: z.ZodString;
|
|
145
|
+
touches: z.ZodArray<z.ZodObject<{
|
|
146
|
+
x: z.ZodNumber;
|
|
147
|
+
y: z.ZodNumber;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
x: number;
|
|
150
|
+
y: number;
|
|
151
|
+
}, {
|
|
152
|
+
x: number;
|
|
153
|
+
y: number;
|
|
154
|
+
}>, "many">;
|
|
155
|
+
changedTouches: z.ZodArray<z.ZodObject<{
|
|
156
|
+
x: z.ZodNumber;
|
|
157
|
+
y: z.ZodNumber;
|
|
158
|
+
}, "strip", z.ZodTypeAny, {
|
|
159
|
+
x: number;
|
|
160
|
+
y: number;
|
|
161
|
+
}, {
|
|
162
|
+
x: number;
|
|
163
|
+
y: number;
|
|
164
|
+
}>, "many">;
|
|
165
|
+
}, "strip", z.ZodTypeAny, {
|
|
166
|
+
refId: string;
|
|
167
|
+
touches: {
|
|
168
|
+
x: number;
|
|
169
|
+
y: number;
|
|
170
|
+
}[];
|
|
171
|
+
changedTouches: {
|
|
172
|
+
x: number;
|
|
173
|
+
y: number;
|
|
174
|
+
}[];
|
|
175
|
+
}, {
|
|
176
|
+
refId: string;
|
|
177
|
+
touches: {
|
|
178
|
+
x: number;
|
|
179
|
+
y: number;
|
|
180
|
+
}[];
|
|
181
|
+
changedTouches: {
|
|
182
|
+
x: number;
|
|
183
|
+
y: number;
|
|
184
|
+
}[];
|
|
185
|
+
}>;
|
|
186
|
+
export declare const touchendSchema: z.ZodObject<{
|
|
187
|
+
refId: z.ZodString;
|
|
188
|
+
touches: z.ZodArray<z.ZodObject<{
|
|
189
|
+
x: z.ZodNumber;
|
|
190
|
+
y: z.ZodNumber;
|
|
191
|
+
}, "strip", z.ZodTypeAny, {
|
|
192
|
+
x: number;
|
|
193
|
+
y: number;
|
|
194
|
+
}, {
|
|
195
|
+
x: number;
|
|
196
|
+
y: number;
|
|
197
|
+
}>, "many">;
|
|
198
|
+
changedTouches: z.ZodArray<z.ZodObject<{
|
|
199
|
+
x: z.ZodNumber;
|
|
200
|
+
y: z.ZodNumber;
|
|
201
|
+
}, "strip", z.ZodTypeAny, {
|
|
202
|
+
x: number;
|
|
203
|
+
y: number;
|
|
204
|
+
}, {
|
|
205
|
+
x: number;
|
|
206
|
+
y: number;
|
|
207
|
+
}>, "many">;
|
|
208
|
+
}, "strip", z.ZodTypeAny, {
|
|
209
|
+
refId: string;
|
|
210
|
+
touches: {
|
|
211
|
+
x: number;
|
|
212
|
+
y: number;
|
|
213
|
+
}[];
|
|
214
|
+
changedTouches: {
|
|
215
|
+
x: number;
|
|
216
|
+
y: number;
|
|
217
|
+
}[];
|
|
218
|
+
}, {
|
|
219
|
+
refId: string;
|
|
220
|
+
touches: {
|
|
221
|
+
x: number;
|
|
222
|
+
y: number;
|
|
223
|
+
}[];
|
|
224
|
+
changedTouches: {
|
|
225
|
+
x: number;
|
|
226
|
+
y: number;
|
|
227
|
+
}[];
|
|
228
|
+
}>;
|
|
229
|
+
export declare const scrollToSchema: z.ZodObject<{
|
|
230
|
+
refId: z.ZodString;
|
|
231
|
+
x: z.ZodNumber;
|
|
232
|
+
y: z.ZodNumber;
|
|
233
|
+
}, "strip", z.ZodTypeAny, {
|
|
234
|
+
refId: string;
|
|
235
|
+
x: number;
|
|
236
|
+
y: number;
|
|
237
|
+
}, {
|
|
238
|
+
refId: string;
|
|
239
|
+
x: number;
|
|
240
|
+
y: number;
|
|
241
|
+
}>;
|
|
242
|
+
export declare const scrollWidthSchema: z.ZodObject<{
|
|
243
|
+
refId: z.ZodString;
|
|
244
|
+
}, "strip", z.ZodTypeAny, {
|
|
245
|
+
refId: string;
|
|
246
|
+
}, {
|
|
247
|
+
refId: string;
|
|
248
|
+
}>;
|
|
249
|
+
export declare const scrollHeightSchema: z.ZodObject<{
|
|
250
|
+
refId: z.ZodString;
|
|
251
|
+
}, "strip", z.ZodTypeAny, {
|
|
252
|
+
refId: string;
|
|
253
|
+
}, {
|
|
254
|
+
refId: string;
|
|
255
|
+
}>;
|
|
256
|
+
export declare const swipeToSchema: z.ZodObject<{
|
|
257
|
+
refId: z.ZodString;
|
|
258
|
+
index: z.ZodNumber;
|
|
259
|
+
}, "strip", z.ZodTypeAny, {
|
|
260
|
+
refId: string;
|
|
261
|
+
index: number;
|
|
262
|
+
}, {
|
|
263
|
+
refId: string;
|
|
264
|
+
index: number;
|
|
265
|
+
}>;
|
|
266
|
+
export declare const moveToSchema: z.ZodObject<{
|
|
267
|
+
refId: z.ZodString;
|
|
268
|
+
x: z.ZodNumber;
|
|
269
|
+
y: z.ZodNumber;
|
|
270
|
+
}, "strip", z.ZodTypeAny, {
|
|
271
|
+
refId: string;
|
|
272
|
+
x: number;
|
|
273
|
+
y: number;
|
|
274
|
+
}, {
|
|
275
|
+
refId: string;
|
|
276
|
+
x: number;
|
|
277
|
+
y: number;
|
|
278
|
+
}>;
|
|
279
|
+
export declare const slideToSchema: z.ZodObject<{
|
|
280
|
+
refId: z.ZodString;
|
|
281
|
+
value: z.ZodNumber;
|
|
282
|
+
}, "strip", z.ZodTypeAny, {
|
|
283
|
+
refId: string;
|
|
284
|
+
value: number;
|
|
285
|
+
}, {
|
|
286
|
+
refId: string;
|
|
287
|
+
value: number;
|
|
288
|
+
}>;
|
|
289
|
+
export declare const callContextMethodSchema: z.ZodObject<{
|
|
290
|
+
refId: z.ZodString;
|
|
291
|
+
method: z.ZodString;
|
|
292
|
+
args: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
293
|
+
}, "strip", z.ZodTypeAny, {
|
|
294
|
+
method: string;
|
|
295
|
+
refId: string;
|
|
296
|
+
args?: any[] | undefined;
|
|
297
|
+
}, {
|
|
298
|
+
method: string;
|
|
299
|
+
refId: string;
|
|
300
|
+
args?: any[] | undefined;
|
|
301
|
+
}>;
|
|
302
|
+
export declare const setDataSchema: z.ZodObject<{
|
|
303
|
+
refId: z.ZodString;
|
|
304
|
+
data: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
305
|
+
}, "strip", z.ZodTypeAny, {
|
|
306
|
+
refId: string;
|
|
307
|
+
data: Record<string, any>;
|
|
308
|
+
}, {
|
|
309
|
+
refId: string;
|
|
310
|
+
data: Record<string, any>;
|
|
311
|
+
}>;
|
|
312
|
+
export declare const callMethodSchema: z.ZodObject<{
|
|
313
|
+
refId: z.ZodString;
|
|
314
|
+
method: z.ZodString;
|
|
315
|
+
args: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
316
|
+
}, "strip", z.ZodTypeAny, {
|
|
317
|
+
method: string;
|
|
318
|
+
refId: string;
|
|
319
|
+
args?: any[] | undefined;
|
|
320
|
+
}, {
|
|
321
|
+
method: string;
|
|
322
|
+
refId: string;
|
|
323
|
+
args?: any[] | undefined;
|
|
324
|
+
}>;
|
|
325
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/element/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAevB,eAAO,MAAM,SAAS;;;;;;EAIe,CAAA;AAErC,eAAO,MAAM,eAAe;;;;;;EAIQ,CAAA;AAEpC,eAAO,MAAM,WAAW;;;;;;;;;EAKuC,CAAA;AAM/D,eAAO,MAAM,aAAa;;;;;;EAIa,CAAA;AAEvC,eAAO,MAAM,kBAAkB;;;;;;;;;EAKU,CAAA;AAEzC,eAAO,MAAM,iBAAiB;;;;;;;;;EAKU,CAAA;AAExC,eAAO,MAAM,cAAc;;;;;;EAIK,CAAA;AAEhC,eAAO,MAAM,aAAa;;;;;;EAIqB,CAAA;AAE/C,eAAO,MAAM,eAAe;;;;;;EAIgB,CAAA;AAE5C,eAAO,MAAM,cAAc;;;;;;;;;EAKW,CAAA;AAMtC,eAAO,MAAM,aAAa;;;;;;;;;;;;EAMoB,CAAA;AAE9C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMQ,CAAA;AAErC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMQ,CAAA;AAEpC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMQ,CAAA;AAMnC,eAAO,MAAM,cAAc;;;;;;;;;;;;EAMwB,CAAA;AAEnD,eAAO,MAAM,iBAAiB;;;;;;EAImB,CAAA;AAEjD,eAAO,MAAM,kBAAkB;;;;;;EAImB,CAAA;AAMlD,eAAO,MAAM,aAAa;;;;;;;;;EAKiB,CAAA;AAE3C,eAAO,MAAM,YAAY;;;;;;;;;;;;EAMyB,CAAA;AAElD,eAAO,MAAM,aAAa;;;;;;;;;EAKiB,CAAA;AAE3C,eAAO,MAAM,uBAAuB;;;;;;;;;;;;EAMoB,CAAA;AAMxD,eAAO,MAAM,aAAa;;;;;;;;;EAKoC,CAAA;AAE9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAMoC,CAAA"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Element schemas exports - 23 element tool schemas
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
// Common refId schema
|
|
6
|
+
const refIdSchema = z.string().min(1).describe('Element reference ID from page_query');
|
|
7
|
+
// Touch point schema
|
|
8
|
+
const touchPointSchema = z.object({
|
|
9
|
+
x: z.number().describe('X coordinate'),
|
|
10
|
+
y: z.number().describe('Y coordinate'),
|
|
11
|
+
});
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// Basic Interactions
|
|
14
|
+
// ============================================================================
|
|
15
|
+
export const tapSchema = z
|
|
16
|
+
.object({
|
|
17
|
+
refId: refIdSchema,
|
|
18
|
+
})
|
|
19
|
+
.describe('Tap (click) an element');
|
|
20
|
+
export const longpressSchema = z
|
|
21
|
+
.object({
|
|
22
|
+
refId: refIdSchema,
|
|
23
|
+
})
|
|
24
|
+
.describe('Long press an element');
|
|
25
|
+
export const inputSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
refId: refIdSchema,
|
|
28
|
+
value: z.string().describe('Text value to input'),
|
|
29
|
+
})
|
|
30
|
+
.describe('Input text into an element (input/textarea only)');
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// Properties and Attributes
|
|
33
|
+
// ============================================================================
|
|
34
|
+
export const getTextSchema = z
|
|
35
|
+
.object({
|
|
36
|
+
refId: refIdSchema,
|
|
37
|
+
})
|
|
38
|
+
.describe('Get element text content');
|
|
39
|
+
export const getAttributeSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
refId: refIdSchema,
|
|
42
|
+
name: z.string().min(1).describe('Attribute name to retrieve'),
|
|
43
|
+
})
|
|
44
|
+
.describe('Get element attribute (特性)');
|
|
45
|
+
export const getPropertySchema = z
|
|
46
|
+
.object({
|
|
47
|
+
refId: refIdSchema,
|
|
48
|
+
name: z.string().min(1).describe('Property name to retrieve'),
|
|
49
|
+
})
|
|
50
|
+
.describe('Get element property (属性)');
|
|
51
|
+
export const getValueSchema = z
|
|
52
|
+
.object({
|
|
53
|
+
refId: refIdSchema,
|
|
54
|
+
})
|
|
55
|
+
.describe('Get element value');
|
|
56
|
+
export const getSizeSchema = z
|
|
57
|
+
.object({
|
|
58
|
+
refId: refIdSchema,
|
|
59
|
+
})
|
|
60
|
+
.describe('Get element size (width, height)');
|
|
61
|
+
export const getOffsetSchema = z
|
|
62
|
+
.object({
|
|
63
|
+
refId: refIdSchema,
|
|
64
|
+
})
|
|
65
|
+
.describe('Get element offset (position)');
|
|
66
|
+
export const getStyleSchema = z
|
|
67
|
+
.object({
|
|
68
|
+
refId: refIdSchema,
|
|
69
|
+
name: z.string().min(1).describe('Style property name to retrieve'),
|
|
70
|
+
})
|
|
71
|
+
.describe('Get element style value');
|
|
72
|
+
// ============================================================================
|
|
73
|
+
// Events
|
|
74
|
+
// ============================================================================
|
|
75
|
+
export const triggerSchema = z
|
|
76
|
+
.object({
|
|
77
|
+
refId: refIdSchema,
|
|
78
|
+
type: z.string().min(1).describe('Event type to trigger'),
|
|
79
|
+
detail: z.record(z.any()).optional().describe('Event detail data (optional)'),
|
|
80
|
+
})
|
|
81
|
+
.describe('Trigger an event on the element');
|
|
82
|
+
export const touchstartSchema = z
|
|
83
|
+
.object({
|
|
84
|
+
refId: refIdSchema,
|
|
85
|
+
touches: z.array(touchPointSchema).describe('Touch points currently on screen'),
|
|
86
|
+
changedTouches: z.array(touchPointSchema).describe('Changed touch points'),
|
|
87
|
+
})
|
|
88
|
+
.describe('Touch start on element');
|
|
89
|
+
export const touchmoveSchema = z
|
|
90
|
+
.object({
|
|
91
|
+
refId: refIdSchema,
|
|
92
|
+
touches: z.array(touchPointSchema).describe('Touch points currently on screen'),
|
|
93
|
+
changedTouches: z.array(touchPointSchema).describe('Changed touch points'),
|
|
94
|
+
})
|
|
95
|
+
.describe('Touch move on element');
|
|
96
|
+
export const touchendSchema = z
|
|
97
|
+
.object({
|
|
98
|
+
refId: refIdSchema,
|
|
99
|
+
touches: z.array(touchPointSchema).describe('Touch points currently on screen'),
|
|
100
|
+
changedTouches: z.array(touchPointSchema).describe('Changed touch points'),
|
|
101
|
+
})
|
|
102
|
+
.describe('Touch end on element');
|
|
103
|
+
// ============================================================================
|
|
104
|
+
// ScrollView Operations
|
|
105
|
+
// ============================================================================
|
|
106
|
+
export const scrollToSchema = z
|
|
107
|
+
.object({
|
|
108
|
+
refId: refIdSchema,
|
|
109
|
+
x: z.number().describe('X coordinate'),
|
|
110
|
+
y: z.number().describe('Y coordinate'),
|
|
111
|
+
})
|
|
112
|
+
.describe('Scroll to position (ScrollView only)');
|
|
113
|
+
export const scrollWidthSchema = z
|
|
114
|
+
.object({
|
|
115
|
+
refId: refIdSchema,
|
|
116
|
+
})
|
|
117
|
+
.describe('Get scroll width (ScrollView only)');
|
|
118
|
+
export const scrollHeightSchema = z
|
|
119
|
+
.object({
|
|
120
|
+
refId: refIdSchema,
|
|
121
|
+
})
|
|
122
|
+
.describe('Get scroll height (ScrollView only)');
|
|
123
|
+
// ============================================================================
|
|
124
|
+
// Specialized Component Operations
|
|
125
|
+
// ============================================================================
|
|
126
|
+
export const swipeToSchema = z
|
|
127
|
+
.object({
|
|
128
|
+
refId: refIdSchema,
|
|
129
|
+
index: z.number().int().min(0).describe('Target swiper index'),
|
|
130
|
+
})
|
|
131
|
+
.describe('Swipe to index (Swiper only)');
|
|
132
|
+
export const moveToSchema = z
|
|
133
|
+
.object({
|
|
134
|
+
refId: refIdSchema,
|
|
135
|
+
x: z.number().describe('X coordinate'),
|
|
136
|
+
y: z.number().describe('Y coordinate'),
|
|
137
|
+
})
|
|
138
|
+
.describe('Move to position (MovableView only)');
|
|
139
|
+
export const slideToSchema = z
|
|
140
|
+
.object({
|
|
141
|
+
refId: refIdSchema,
|
|
142
|
+
value: z.number().describe('Target slider value'),
|
|
143
|
+
})
|
|
144
|
+
.describe('Slide to value (Slider only)');
|
|
145
|
+
export const callContextMethodSchema = z
|
|
146
|
+
.object({
|
|
147
|
+
refId: refIdSchema,
|
|
148
|
+
method: z.string().min(1).describe('Context method name'),
|
|
149
|
+
args: z.array(z.any()).optional().describe('Arguments to pass to the method'),
|
|
150
|
+
})
|
|
151
|
+
.describe('Call context method (ContextElement only)');
|
|
152
|
+
// ============================================================================
|
|
153
|
+
// Custom Element Operations
|
|
154
|
+
// ============================================================================
|
|
155
|
+
export const setDataSchema = z
|
|
156
|
+
.object({
|
|
157
|
+
refId: refIdSchema,
|
|
158
|
+
data: z.record(z.any()).describe('Data object to set'),
|
|
159
|
+
})
|
|
160
|
+
.describe('Set data on custom element (CustomElement only)');
|
|
161
|
+
export const callMethodSchema = z
|
|
162
|
+
.object({
|
|
163
|
+
refId: refIdSchema,
|
|
164
|
+
method: z.string().min(1).describe('Method name'),
|
|
165
|
+
args: z.array(z.any()).optional().describe('Arguments to pass to the method'),
|
|
166
|
+
})
|
|
167
|
+
.describe('Call method on custom element (CustomElement only)');
|
|
168
|
+
//# sourceMappingURL=index.js.map
|