@testin-official/xagent 0.3.7

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.
Files changed (212) hide show
  1. package/README.md +157 -0
  2. package/dist/action/client.d.ts +13 -0
  3. package/dist/action/client.d.ts.map +1 -0
  4. package/dist/action/client.js +28 -0
  5. package/dist/action/client.js.map +1 -0
  6. package/dist/action/mcp-content.d.ts +2 -0
  7. package/dist/action/mcp-content.d.ts.map +1 -0
  8. package/dist/action/mcp-content.js +116 -0
  9. package/dist/action/mcp-content.js.map +1 -0
  10. package/dist/action/protocol.d.ts +36 -0
  11. package/dist/action/protocol.d.ts.map +1 -0
  12. package/dist/action/protocol.js +29 -0
  13. package/dist/action/protocol.js.map +1 -0
  14. package/dist/assets/contracts/app-list.schema.json +31 -0
  15. package/dist/assets/contracts/app-upload.schema.json +45 -0
  16. package/dist/assets/contracts/app.schema.json +18 -0
  17. package/dist/assets/contracts/authoring-attempt-create.schema.json +12 -0
  18. package/dist/assets/contracts/authoring-attempt.schema.json +56 -0
  19. package/dist/assets/contracts/authoring-complete.schema.json +13 -0
  20. package/dist/assets/contracts/authoring-draft-attempt-create.schema.json +12 -0
  21. package/dist/assets/contracts/authoring-observation.schema.json +28 -0
  22. package/dist/assets/contracts/authoring-revision-create.schema.json +13 -0
  23. package/dist/assets/contracts/authoring-revision.schema.json +19 -0
  24. package/dist/assets/contracts/authoring-session-create.schema.json +11 -0
  25. package/dist/assets/contracts/authoring-session.schema.json +54 -0
  26. package/dist/assets/contracts/canonical-script.schema.json +219 -0
  27. package/dist/assets/contracts/compat-script.schema.json +380 -0
  28. package/dist/assets/contracts/device-list.schema.json +19 -0
  29. package/dist/assets/contracts/error.schema.json +47 -0
  30. package/dist/assets/contracts/execution-target.schema.json +55 -0
  31. package/dist/assets/contracts/fixtures/authoring-attempt-create.valid.json +4 -0
  32. package/dist/assets/contracts/fixtures/authoring-attempt.passed.json +16 -0
  33. package/dist/assets/contracts/fixtures/authoring-draft-attempt-create.valid.json +10 -0
  34. package/dist/assets/contracts/fixtures/authoring-observation.valid.json +7 -0
  35. package/dist/assets/contracts/fixtures/authoring-revision.valid.json +16 -0
  36. package/dist/assets/contracts/fixtures/authoring-session.active.json +12 -0
  37. package/dist/assets/contracts/fixtures/canonical-script.valid.json +17 -0
  38. package/dist/assets/contracts/fixtures/ci-exit-status-cases.json +44 -0
  39. package/dist/assets/contracts/fixtures/command-mutual-exclusion-cases.json +20 -0
  40. package/dist/assets/contracts/fixtures/compat-script.all-platform-actions.yaml +227 -0
  41. package/dist/assets/contracts/fixtures/execution-target.both.invalid.json +7 -0
  42. package/dist/assets/contracts/fixtures/execution-target.concurrency-two.invalid.json +4 -0
  43. package/dist/assets/contracts/fixtures/execution-target.count-two.invalid.json +6 -0
  44. package/dist/assets/contracts/fixtures/execution-target.dynamic.valid.json +12 -0
  45. package/dist/assets/contracts/fixtures/execution-target.fixed.valid.json +4 -0
  46. package/dist/assets/contracts/fixtures/execution-target.multiple-devices.invalid.json +4 -0
  47. package/dist/assets/contracts/fixtures/execution-target.multiple-filters.invalid.json +7 -0
  48. package/dist/assets/contracts/fixtures/execution-target.strategy-all.invalid.json +6 -0
  49. package/dist/assets/contracts/fixtures/idempotency.conflict.json +26 -0
  50. package/dist/assets/contracts/fixtures/idempotency.same-request.json +26 -0
  51. package/dist/assets/contracts/fixtures/principal.personal.json +23 -0
  52. package/dist/assets/contracts/fixtures/principal.project-ci.json +20 -0
  53. package/dist/assets/contracts/fixtures/project-config.no-default.valid.json +9 -0
  54. package/dist/assets/contracts/fixtures/project-config.secret.invalid.json +10 -0
  55. package/dist/assets/contracts/fixtures/project-config.target-name.invalid.json +10 -0
  56. package/dist/assets/contracts/fixtures/project-config.valid.json +22 -0
  57. package/dist/assets/contracts/fixtures/public-script.all-cli-actions.yaml +39 -0
  58. package/dist/assets/contracts/fixtures/public-script.invalid.json +8 -0
  59. package/dist/assets/contracts/fixtures/public-script.valid.json +17 -0
  60. package/dist/assets/contracts/fixtures/run-create-v2.device-id.invalid.json +16 -0
  61. package/dist/assets/contracts/fixtures/run-create.personal-upload.valid.json +20 -0
  62. package/dist/assets/contracts/fixtures/run-create.single-device.json +19 -0
  63. package/dist/assets/contracts/fixtures/run-create.target.valid.json +22 -0
  64. package/dist/assets/contracts/fixtures/run.queued.json +19 -0
  65. package/dist/assets/contracts/fixtures/run.target.queued.json +38 -0
  66. package/dist/assets/contracts/fixtures/skill-catalog.valid.json +19 -0
  67. package/dist/assets/contracts/fixtures/skill-reference.valid.json +9 -0
  68. package/dist/assets/contracts/fixtures/skill.valid.json +10 -0
  69. package/dist/assets/contracts/fixtures/target-hash-cases.json +30 -0
  70. package/dist/assets/contracts/fixtures/target-preview.hash-mismatch.error.json +8 -0
  71. package/dist/assets/contracts/fixtures/target-preview.no-match.error.json +9 -0
  72. package/dist/assets/contracts/fixtures/target-preview.request.valid.json +9 -0
  73. package/dist/assets/contracts/fixtures/target-preview.success.json +18 -0
  74. package/dist/assets/contracts/fixtures/target-preview.unavailable.json +18 -0
  75. package/dist/assets/contracts/principal.schema.json +72 -0
  76. package/dist/assets/contracts/project-config.schema.json +23 -0
  77. package/dist/assets/contracts/public-script.schema.json +397 -0
  78. package/dist/assets/contracts/run-create-v2.schema.json +78 -0
  79. package/dist/assets/contracts/run-create.schema.json +70 -0
  80. package/dist/assets/contracts/run.schema.json +137 -0
  81. package/dist/assets/contracts/skill-catalog.schema.json +15 -0
  82. package/dist/assets/contracts/skill-reference.schema.json +17 -0
  83. package/dist/assets/contracts/skill-summary.schema.json +28 -0
  84. package/dist/assets/contracts/skill.schema.json +30 -0
  85. package/dist/assets/contracts/target-preview.schema.json +75 -0
  86. package/dist/assets/integrations/manifest.json +17 -0
  87. package/dist/assets/integrations/xagent-skill/SKILL.md +28 -0
  88. package/dist/assets/integrations/xagent-skill/agents/openai.yaml +4 -0
  89. package/dist/assets/integrations/xagent-skill/references/cli-mcp-interop.md +10 -0
  90. package/dist/assets/integrations/xagent-skill/references/host-adapters.md +9 -0
  91. package/dist/assets/integrations/xagent-skill/references/installation.md +10 -0
  92. package/dist/assets/integrations/xagent-skill/references/privacy.md +3 -0
  93. package/dist/assets/integrations/xagent-skill/references/routing.md +32 -0
  94. package/dist/assets/integrations/xagent-skill/scripts/install-cli.ps1 +5 -0
  95. package/dist/assets/integrations/xagent-skill/scripts/install-cli.sh +6 -0
  96. package/dist/assets/skills/xagent-analyze-failure/SKILL.md +13 -0
  97. package/dist/assets/skills/xagent-analyze-failure/agents/openai.yaml +4 -0
  98. package/dist/assets/skills/xagent-analyze-failure/references/failure-classification.md +20 -0
  99. package/dist/assets/skills/xagent-author-test/SKILL.md +19 -0
  100. package/dist/assets/skills/xagent-author-test/agents/openai.yaml +4 -0
  101. package/dist/assets/skills/xagent-author-test/references/authoring-workflow.md +41 -0
  102. package/dist/assets/skills/xagent-author-test/references/host-interaction-adapters.md +81 -0
  103. package/dist/assets/skills/xagent-author-test/references/interaction-modes.md +97 -0
  104. package/dist/assets/skills/xagent-author-test/references/interactive-steering.md +57 -0
  105. package/dist/assets/skills/xagent-author-test/references/script-actions.md +34 -0
  106. package/dist/assets/skills/xagent-author-test/references/script-format.md +100 -0
  107. package/dist/assets/skills/xagent-cli/SKILL.md +31 -0
  108. package/dist/assets/skills/xagent-cli/agents/openai.yaml +4 -0
  109. package/dist/assets/skills/xagent-cli/references/capability-routing.md +36 -0
  110. package/dist/assets/skills/xagent-cli/references/cli-commands.md +23 -0
  111. package/dist/assets/skills/xagent-cli/references/failure-routing.md +18 -0
  112. package/dist/assets/skills/xagent-cli/references/host-modes.md +21 -0
  113. package/dist/assets/skills/xagent-cli/references/mcp-tools.md +26 -0
  114. package/dist/assets/skills/xagent-cli/references/permissions.md +17 -0
  115. package/dist/assets/skills/xagent-explore-device/SKILL.md +26 -0
  116. package/dist/assets/skills/xagent-explore-device/agents/openai.yaml +4 -0
  117. package/dist/assets/skills/xagent-explore-device/references/actions.md +24 -0
  118. package/dist/assets/skills/xagent-explore-device/references/single-action-protocol.md +59 -0
  119. package/dist/assets/skills/xagent-explore-device/references/tool-adapters.md +32 -0
  120. package/dist/assets/skills/xagent-repair-test/SKILL.md +16 -0
  121. package/dist/assets/skills/xagent-repair-test/agents/openai.yaml +4 -0
  122. package/dist/assets/skills/xagent-repair-test/references/repair-workflow.md +21 -0
  123. package/dist/assets/skills/xagent-run-test/SKILL.md +16 -0
  124. package/dist/assets/skills/xagent-run-test/agents/openai.yaml +4 -0
  125. package/dist/assets/skills/xagent-run-test/references/execution-modes.md +23 -0
  126. package/dist/assets/skills/xagent-run-test/references/result-status.md +13 -0
  127. package/dist/assets/skills/xagent-test-report/SKILL.md +20 -0
  128. package/dist/assets/skills/xagent-test-report/agents/openai.yaml +4 -0
  129. package/dist/assets/skills/xagent-test-report/references/evidence-policy.md +20 -0
  130. package/dist/assets/skills/xagent-test-report/references/report-template.md +41 -0
  131. package/dist/assets/skills/xagent-test-report/references/result-classification.md +13 -0
  132. package/dist/authoring/draft-store.d.ts +19 -0
  133. package/dist/authoring/draft-store.d.ts.map +1 -0
  134. package/dist/authoring/draft-store.js +104 -0
  135. package/dist/authoring/draft-store.js.map +1 -0
  136. package/dist/authoring/session-lease.d.ts +64 -0
  137. package/dist/authoring/session-lease.d.ts.map +1 -0
  138. package/dist/authoring/session-lease.js +190 -0
  139. package/dist/authoring/session-lease.js.map +1 -0
  140. package/dist/cli.d.ts +3 -0
  141. package/dist/cli.d.ts.map +1 -0
  142. package/dist/cli.js +529 -0
  143. package/dist/cli.js.map +1 -0
  144. package/dist/config/credentials.d.ts +16 -0
  145. package/dist/config/credentials.d.ts.map +1 -0
  146. package/dist/config/credentials.js +93 -0
  147. package/dist/config/credentials.js.map +1 -0
  148. package/dist/config/store.d.ts +37 -0
  149. package/dist/config/store.d.ts.map +1 -0
  150. package/dist/config/store.js +142 -0
  151. package/dist/config/store.js.map +1 -0
  152. package/dist/core/assets.d.ts +5 -0
  153. package/dist/core/assets.d.ts.map +1 -0
  154. package/dist/core/assets.js +46 -0
  155. package/dist/core/assets.js.map +1 -0
  156. package/dist/core/errors.d.ts +19 -0
  157. package/dist/core/errors.d.ts.map +1 -0
  158. package/dist/core/errors.js +36 -0
  159. package/dist/core/errors.js.map +1 -0
  160. package/dist/core/interrupt.d.ts +8 -0
  161. package/dist/core/interrupt.d.ts.map +1 -0
  162. package/dist/core/interrupt.js +54 -0
  163. package/dist/core/interrupt.js.map +1 -0
  164. package/dist/core/json.d.ts +5 -0
  165. package/dist/core/json.d.ts.map +1 -0
  166. package/dist/core/json.js +21 -0
  167. package/dist/core/json.js.map +1 -0
  168. package/dist/core/version.d.ts +8 -0
  169. package/dist/core/version.d.ts.map +1 -0
  170. package/dist/core/version.js +8 -0
  171. package/dist/core/version.js.map +1 -0
  172. package/dist/integrations/manager.d.ts +12 -0
  173. package/dist/integrations/manager.d.ts.map +1 -0
  174. package/dist/integrations/manager.js +218 -0
  175. package/dist/integrations/manager.js.map +1 -0
  176. package/dist/integrations/routing.d.ts +105 -0
  177. package/dist/integrations/routing.d.ts.map +1 -0
  178. package/dist/integrations/routing.js +85 -0
  179. package/dist/integrations/routing.js.map +1 -0
  180. package/dist/mcp/server.d.ts +4 -0
  181. package/dist/mcp/server.d.ts.map +1 -0
  182. package/dist/mcp/server.js +69 -0
  183. package/dist/mcp/server.js.map +1 -0
  184. package/dist/mcp/tools.d.ts +30 -0
  185. package/dist/mcp/tools.d.ts.map +1 -0
  186. package/dist/mcp/tools.js +345 -0
  187. package/dist/mcp/tools.js.map +1 -0
  188. package/dist/project/config.d.ts +15 -0
  189. package/dist/project/config.d.ts.map +1 -0
  190. package/dist/project/config.js +46 -0
  191. package/dist/project/config.js.map +1 -0
  192. package/dist/run/progress.d.ts +5 -0
  193. package/dist/run/progress.d.ts.map +1 -0
  194. package/dist/run/progress.js +29 -0
  195. package/dist/run/progress.js.map +1 -0
  196. package/dist/script/service.d.ts +42 -0
  197. package/dist/script/service.d.ts.map +1 -0
  198. package/dist/script/service.js +457 -0
  199. package/dist/script/service.js.map +1 -0
  200. package/dist/sdk/authoring.d.ts +19 -0
  201. package/dist/sdk/authoring.d.ts.map +1 -0
  202. package/dist/sdk/authoring.js +43 -0
  203. package/dist/sdk/authoring.js.map +1 -0
  204. package/dist/sdk/client.d.ts +49 -0
  205. package/dist/sdk/client.d.ts.map +1 -0
  206. package/dist/sdk/client.js +241 -0
  207. package/dist/sdk/client.js.map +1 -0
  208. package/dist/skills/catalog.d.ts +7 -0
  209. package/dist/skills/catalog.d.ts.map +1 -0
  210. package/dist/skills/catalog.js +59 -0
  211. package/dist/skills/catalog.js.map +1 -0
  212. package/package.json +45 -0
@@ -0,0 +1,397 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://xagent.testin.cn/schemas/developer/v1/public-script.schema.json",
4
+ "title": "XAgent Public Script v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version", "steps"],
8
+ "properties": {
9
+ "schema_version": {"const": "xagent-script/v1"},
10
+ "name": {"type": "string", "minLength": 1, "maxLength": 255},
11
+ "package_id": {"type": "integer", "minimum": 1},
12
+ "variables": {
13
+ "type": "object",
14
+ "propertyNames": {"type": "string", "minLength": 1},
15
+ "additionalProperties": true
16
+ },
17
+ "steps": {
18
+ "type": "array",
19
+ "minItems": 1,
20
+ "maxItems": 1000,
21
+ "items": {"$ref": "#/$defs/step"}
22
+ }
23
+ },
24
+ "$defs": {
25
+ "common": {
26
+ "type": "object",
27
+ "properties": {
28
+ "description": {"type": "string", "maxLength": 1000}
29
+ }
30
+ },
31
+ "install": {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": ["action", "appPackage"],
35
+ "properties": {
36
+ "action": {"const": "install"},
37
+ "appPackage": {"type": "string", "minLength": 1},
38
+ "description": {"type": "string", "maxLength": 1000}
39
+ }
40
+ },
41
+ "appLaunch": {
42
+ "type": "object",
43
+ "additionalProperties": false,
44
+ "required": ["action"],
45
+ "properties": {
46
+ "action": {"const": "appLaunch"},
47
+ "appPackage": {"type": "string", "minLength": 1},
48
+ "appName": {"type": "string", "minLength": 1},
49
+ "launchPath": {"type": "string", "minLength": 1},
50
+ "description": {"type": "string", "maxLength": 1000}
51
+ },
52
+ "anyOf": [
53
+ {"required": ["appPackage"]},
54
+ {"required": ["appName"]}
55
+ ]
56
+ },
57
+ "uninstall": {
58
+ "type": "object",
59
+ "additionalProperties": false,
60
+ "required": ["action"],
61
+ "properties": {
62
+ "action": {"const": "uninstall"},
63
+ "appPackage": {"type": "string", "minLength": 1},
64
+ "appName": {"type": "string", "minLength": 1},
65
+ "description": {"type": "string", "maxLength": 1000}
66
+ },
67
+ "anyOf": [
68
+ {"required": ["appPackage"]},
69
+ {"required": ["appName"]}
70
+ ]
71
+ },
72
+ "click": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": ["action", "target"],
76
+ "properties": {
77
+ "action": {"const": "click"},
78
+ "target": {"type": "string", "minLength": 1},
79
+ "type": {"enum": ["click", "tap", "longPress", "doubleClick", "rightClick"]},
80
+ "duration": {"type": "integer", "minimum": 1, "maximum": 3600000},
81
+ "description": {"type": "string", "maxLength": 1000}
82
+ },
83
+ "allOf": [
84
+ {
85
+ "if": {"required": ["duration"]},
86
+ "then": {
87
+ "required": ["type"],
88
+ "properties": {"type": {"const": "longPress"}}
89
+ }
90
+ }
91
+ ]
92
+ },
93
+ "input": {
94
+ "type": "object",
95
+ "additionalProperties": false,
96
+ "required": ["action", "text"],
97
+ "not": {"required": ["target", "keyboardLayout"]},
98
+ "properties": {
99
+ "action": {"const": "input"},
100
+ "text": {"type": "string"},
101
+ "target": {"type": "string", "minLength": 1},
102
+ "clearFirst": {"type": "boolean"},
103
+ "inputMode": {"enum": ["normal", "smart", "secret"]},
104
+ "keyboardLayout": {"enum": ["numeric", "alphabetic"]},
105
+ "description": {"type": "string", "maxLength": 1000}
106
+ }
107
+ },
108
+ "scroll": {
109
+ "type": "object",
110
+ "additionalProperties": false,
111
+ "required": ["action", "direction"],
112
+ "properties": {
113
+ "action": {"const": "scroll"},
114
+ "direction": {"enum": ["UP", "DOWN", "LEFT", "RIGHT", "up", "down", "left", "right"]},
115
+ "distance": {"type": "number", "exclusiveMinimum": 0, "maximum": 1},
116
+ "target": {"type": "string", "minLength": 1},
117
+ "condition": {"type": "string", "minLength": 1},
118
+ "maxSwipes": {"type": "integer", "minimum": 1, "maximum": 1000},
119
+ "scope": {"enum": ["page", "container"]},
120
+ "containerRole": {"type": "string", "minLength": 1},
121
+ "containerAnchor": {"type": "string", "minLength": 1},
122
+ "containerHint": {"type": "string", "minLength": 1},
123
+ "scrollAreaTarget": {"type": "string", "minLength": 1},
124
+ "untilScope": {"type": "string", "minLength": 1},
125
+ "stopMode": {"type": "string", "minLength": 1},
126
+ "untilMatchMode": {"type": "string", "minLength": 1},
127
+ "spatialConstraints": {
128
+ "type": "array",
129
+ "minItems": 1,
130
+ "items": {
131
+ "type": "object",
132
+ "additionalProperties": false,
133
+ "required": ["relation"],
134
+ "properties": {
135
+ "anchor": {"type": "string", "minLength": 1},
136
+ "relation": {"type": "string", "minLength": 1}
137
+ }
138
+ }
139
+ },
140
+ "description": {"type": "string", "maxLength": 1000}
141
+ }
142
+ },
143
+ "scroll_between": {
144
+ "type": "object",
145
+ "additionalProperties": false,
146
+ "required": ["action", "from", "to"],
147
+ "properties": {
148
+ "action": {"const": "scroll_between"},
149
+ "from": {"type": "string", "minLength": 1},
150
+ "to": {"type": "string", "minLength": 1},
151
+ "duration": {"type": "integer", "minimum": 1, "maximum": 3600000},
152
+ "description": {"type": "string", "maxLength": 1000}
153
+ }
154
+ },
155
+ "drag": {
156
+ "type": "object",
157
+ "additionalProperties": false,
158
+ "required": ["action", "from", "to"],
159
+ "properties": {
160
+ "action": {"const": "drag"},
161
+ "from": {"type": "string", "minLength": 1},
162
+ "to": {"type": "string", "minLength": 1},
163
+ "speed": {"type": "string", "minLength": 1},
164
+ "description": {"type": "string", "maxLength": 1000}
165
+ }
166
+ },
167
+ "screenshot": {
168
+ "type": "object",
169
+ "additionalProperties": false,
170
+ "required": ["action"],
171
+ "properties": {
172
+ "action": {"const": "screenshot"},
173
+ "var": {"type": "string", "minLength": 1},
174
+ "description": {"type": "string", "maxLength": 1000}
175
+ }
176
+ },
177
+ "extract": {
178
+ "type": "object",
179
+ "additionalProperties": false,
180
+ "required": ["action", "target", "varName"],
181
+ "properties": {
182
+ "action": {"const": "extract"},
183
+ "target": {"type": "string", "minLength": 1},
184
+ "varName": {"type": "string", "minLength": 1},
185
+ "type": {"type": "string", "minLength": 1},
186
+ "description": {"type": "string", "maxLength": 1000}
187
+ }
188
+ },
189
+ "waitFor": {
190
+ "type": "object",
191
+ "additionalProperties": false,
192
+ "required": ["action"],
193
+ "properties": {
194
+ "action": {"const": "waitFor"},
195
+ "time": {"type": "integer", "minimum": 0, "maximum": 3600000},
196
+ "condition": {"type": "string", "minLength": 1},
197
+ "timeout": {"type": "integer", "minimum": 1, "maximum": 3600000},
198
+ "description": {"type": "string", "maxLength": 1000}
199
+ },
200
+ "anyOf": [
201
+ {"required": ["time"]},
202
+ {"required": ["condition"]}
203
+ ]
204
+ },
205
+ "assert": {
206
+ "type": "object",
207
+ "additionalProperties": false,
208
+ "required": ["action"],
209
+ "properties": {
210
+ "action": {"const": "assert"},
211
+ "condition": {"type": "string", "minLength": 1},
212
+ "conditionType": {"enum": ["textVisible", "expr"]},
213
+ "target": {"type": "string", "minLength": 1},
214
+ "text": {"type": "string"},
215
+ "message": {"type": "string", "maxLength": 1000},
216
+ "description": {"type": "string", "maxLength": 1000}
217
+ },
218
+ "anyOf": [
219
+ {"required": ["condition"]},
220
+ {"required": ["target"]}
221
+ ]
222
+ },
223
+ "if": {
224
+ "type": "object",
225
+ "additionalProperties": false,
226
+ "required": ["action", "condition", "then"],
227
+ "properties": {
228
+ "action": {"const": "if"},
229
+ "condition": {"type": "string", "minLength": 1},
230
+ "then": {
231
+ "type": "array",
232
+ "minItems": 1,
233
+ "maxItems": 1000,
234
+ "items": {"$ref": "#/$defs/step"}
235
+ },
236
+ "else": {
237
+ "type": "array",
238
+ "minItems": 1,
239
+ "maxItems": 1000,
240
+ "items": {"$ref": "#/$defs/step"}
241
+ },
242
+ "description": {"type": "string", "maxLength": 1000}
243
+ }
244
+ },
245
+ "appStop": {
246
+ "type": "object",
247
+ "additionalProperties": false,
248
+ "required": ["action"],
249
+ "properties": {
250
+ "action": {"const": "appStop"},
251
+ "appPackage": {"type": "string", "minLength": 1},
252
+ "appName": {"type": "string", "minLength": 1},
253
+ "description": {"type": "string", "maxLength": 1000}
254
+ },
255
+ "anyOf": [
256
+ {"required": ["appPackage"]},
257
+ {"required": ["appName"]}
258
+ ]
259
+ },
260
+ "appClean": {
261
+ "type": "object",
262
+ "additionalProperties": false,
263
+ "required": ["action"],
264
+ "properties": {
265
+ "action": {"const": "appClean"},
266
+ "appPackage": {"type": "string", "minLength": 1},
267
+ "appName": {"type": "string", "minLength": 1},
268
+ "description": {"type": "string", "maxLength": 1000}
269
+ },
270
+ "anyOf": [
271
+ {"required": ["appPackage"]},
272
+ {"required": ["appName"]}
273
+ ]
274
+ },
275
+ "set": {
276
+ "type": "object",
277
+ "additionalProperties": false,
278
+ "required": ["action", "varName"],
279
+ "properties": {
280
+ "action": {"const": "set"},
281
+ "varName": {"type": "string", "minLength": 1},
282
+ "value": true,
283
+ "description": {"type": "string", "maxLength": 1000}
284
+ }
285
+ },
286
+ "randomVar": {
287
+ "type": "object",
288
+ "additionalProperties": false,
289
+ "required": ["action", "varName", "type"],
290
+ "properties": {
291
+ "action": {"const": "randomVar"},
292
+ "varName": {"type": "string", "minLength": 1},
293
+ "type": {"enum": ["string", "number", "phone", "email"]},
294
+ "length": {"type": "integer", "minimum": 1, "maximum": 10000},
295
+ "min": {"type": "integer"},
296
+ "max": {"type": "integer"},
297
+ "description": {"type": "string", "maxLength": 1000}
298
+ }
299
+ },
300
+ "for": {
301
+ "type": "object",
302
+ "additionalProperties": false,
303
+ "required": ["action", "steps"],
304
+ "properties": {
305
+ "action": {"const": "for"},
306
+ "count": {
307
+ "oneOf": [
308
+ {"type": "integer", "minimum": 0},
309
+ {"type": "string", "minLength": 1}
310
+ ]
311
+ },
312
+ "condition": {"type": "string", "minLength": 1},
313
+ "dead_loop": {"type": "integer", "minimum": 1, "maximum": 10000},
314
+ "steps": {
315
+ "type": "array",
316
+ "minItems": 1,
317
+ "maxItems": 1000,
318
+ "items": {"$ref": "#/$defs/step"}
319
+ },
320
+ "description": {"type": "string", "maxLength": 1000}
321
+ },
322
+ "oneOf": [
323
+ {"required": ["count"]},
324
+ {"required": ["condition"]}
325
+ ]
326
+ },
327
+ "throw": {
328
+ "type": "object",
329
+ "additionalProperties": false,
330
+ "required": ["action", "message"],
331
+ "properties": {
332
+ "action": {"const": "throw"},
333
+ "message": {"type": "string", "minLength": 1},
334
+ "description": {"type": "string", "maxLength": 1000}
335
+ }
336
+ },
337
+ "break": {
338
+ "type": "object",
339
+ "additionalProperties": false,
340
+ "required": ["action"],
341
+ "properties": {
342
+ "action": {"const": "break"},
343
+ "description": {"type": "string", "maxLength": 1000}
344
+ }
345
+ },
346
+ "press_key": {
347
+ "type": "object",
348
+ "additionalProperties": false,
349
+ "required": ["action", "key"],
350
+ "properties": {
351
+ "action": {"const": "press_key"},
352
+ "key": {"type": "string", "minLength": 1},
353
+ "description": {"type": "string", "maxLength": 1000}
354
+ }
355
+ },
356
+ "press_home": {
357
+ "type": "object", "additionalProperties": false, "required": ["action"],
358
+ "properties": {"action": {"const": "press_home"}, "description": {"type": "string", "maxLength": 1000}}
359
+ },
360
+ "press_back": {
361
+ "type": "object", "additionalProperties": false, "required": ["action"],
362
+ "properties": {"action": {"const": "press_back"}, "description": {"type": "string", "maxLength": 1000}}
363
+ },
364
+ "press_enter": {
365
+ "type": "object", "additionalProperties": false, "required": ["action"],
366
+ "properties": {"action": {"const": "press_enter"}, "description": {"type": "string", "maxLength": 1000}}
367
+ },
368
+ "step": {
369
+ "oneOf": [
370
+ {"$ref": "#/$defs/install"},
371
+ {"$ref": "#/$defs/appLaunch"},
372
+ {"$ref": "#/$defs/uninstall"},
373
+ {"$ref": "#/$defs/click"},
374
+ {"$ref": "#/$defs/input"},
375
+ {"$ref": "#/$defs/scroll"},
376
+ {"$ref": "#/$defs/scroll_between"},
377
+ {"$ref": "#/$defs/drag"},
378
+ {"$ref": "#/$defs/screenshot"},
379
+ {"$ref": "#/$defs/extract"},
380
+ {"$ref": "#/$defs/waitFor"},
381
+ {"$ref": "#/$defs/assert"},
382
+ {"$ref": "#/$defs/if"},
383
+ {"$ref": "#/$defs/appStop"},
384
+ {"$ref": "#/$defs/appClean"},
385
+ {"$ref": "#/$defs/set"},
386
+ {"$ref": "#/$defs/randomVar"},
387
+ {"$ref": "#/$defs/for"},
388
+ {"$ref": "#/$defs/throw"},
389
+ {"$ref": "#/$defs/break"},
390
+ {"$ref": "#/$defs/press_key"},
391
+ {"$ref": "#/$defs/press_home"},
392
+ {"$ref": "#/$defs/press_back"},
393
+ {"$ref": "#/$defs/press_enter"}
394
+ ]
395
+ }
396
+ }
397
+ }
@@ -0,0 +1,78 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://xagent.testin.cn/schemas/developer/v1/run-create-v2.schema.json",
4
+ "title": "XAgent Run Create v2",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "script",
10
+ "target_name",
11
+ "target_hash",
12
+ "target"
13
+ ],
14
+ "properties": {
15
+ "schema_version": {"const": "xagent-run-create/v2"},
16
+ "script": {"$ref": "public-script.schema.json"},
17
+ "package_id": {"type": "integer", "minimum": 1},
18
+ "app_upload_id": {
19
+ "type": "string",
20
+ "pattern": "^appup_[a-f0-9]{32}$"
21
+ },
22
+ "variables": {"type": "object", "additionalProperties": true},
23
+ "timeout_ms": {"type": "integer", "minimum": 1000, "maximum": 28800000},
24
+ "source_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
25
+ "target_name": {
26
+ "type": "string",
27
+ "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
28
+ },
29
+ "target_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
30
+ "target": {"$ref": "execution-target.schema.json"}
31
+ },
32
+ "allOf": [
33
+ {
34
+ "not": {
35
+ "anyOf": [
36
+ {"required": ["package_id", "app_upload_id"]},
37
+ {
38
+ "required": ["app_upload_id"],
39
+ "properties": {
40
+ "script": {"required": ["package_id"]}
41
+ }
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ "if": {
48
+ "properties": {
49
+ "script": {
50
+ "properties": {
51
+ "steps": {
52
+ "contains": {
53
+ "type": "object",
54
+ "properties": {"action": {"const": "install"}},
55
+ "required": ["action"]
56
+ }
57
+ }
58
+ },
59
+ "required": ["steps"]
60
+ }
61
+ },
62
+ "required": ["script"]
63
+ },
64
+ "then": {
65
+ "anyOf": [
66
+ {"required": ["package_id"]},
67
+ {"required": ["app_upload_id"]},
68
+ {
69
+ "properties": {
70
+ "script": {"required": ["package_id"]}
71
+ },
72
+ "required": ["script"]
73
+ }
74
+ ]
75
+ }
76
+ }
77
+ ]
78
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://xagent.testin.cn/schemas/developer/v1/run-create.schema.json",
4
+ "title": "XAgent Run Create v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version", "script", "device_id"],
8
+ "properties": {
9
+ "schema_version": {"const": "xagent-run-create/v1"},
10
+ "script": {"$ref": "public-script.schema.json"},
11
+ "package_id": {"type": "integer", "minimum": 1},
12
+ "app_upload_id": {
13
+ "type": "string",
14
+ "pattern": "^appup_[a-f0-9]{32}$"
15
+ },
16
+ "device_id": {"type": "string", "minLength": 1, "maxLength": 128},
17
+ "variables": {"type": "object", "additionalProperties": true},
18
+ "timeout_ms": {"type": "integer", "minimum": 1000, "maximum": 28800000},
19
+ "source_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"}
20
+ },
21
+ "allOf": [
22
+ {
23
+ "not": {
24
+ "anyOf": [
25
+ {"required": ["package_id", "app_upload_id"]},
26
+ {
27
+ "required": ["app_upload_id"],
28
+ "properties": {
29
+ "script": {"required": ["package_id"]}
30
+ }
31
+ }
32
+ ]
33
+ }
34
+ },
35
+ {
36
+ "if": {
37
+ "properties": {
38
+ "script": {
39
+ "properties": {
40
+ "steps": {
41
+ "contains": {
42
+ "type": "object",
43
+ "properties": {"action": {"const": "install"}},
44
+ "required": ["action"]
45
+ }
46
+ }
47
+ },
48
+ "required": ["steps"]
49
+ }
50
+ },
51
+ "required": ["script"]
52
+ },
53
+ "then": {
54
+ "if": {
55
+ "not": {
56
+ "anyOf": [
57
+ {"required": ["package_id"]},
58
+ {"required": ["app_upload_id"]}
59
+ ]
60
+ }
61
+ },
62
+ "then": {
63
+ "properties": {
64
+ "script": {"required": ["package_id"]}
65
+ }
66
+ }
67
+ }
68
+ }
69
+ ]
70
+ }