@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,28 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://xagent.testin.cn/schemas/developer/v1/authoring-observation.schema.json",
4
+ "title": "XAgent Authoring Observation v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version", "session_id", "device_id", "screenshot_url", "captured_at"],
8
+ "properties": {
9
+ "schema_version": {"const": "xagent-authoring-observation/v1"},
10
+ "session_id": {"type": "string", "pattern": "^auth_[a-f0-9]{32}$"},
11
+ "device_id": {"type": "string", "minLength": 1, "maxLength": 255},
12
+ "screenshot_url": {"type": "string", "format": "uri", "pattern": "^https://"},
13
+ "captured_at": {"type": "string", "format": "date-time"},
14
+ "billing": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": ["status", "billable_minutes", "cost", "discount_rate", "started_at", "ended_at"],
18
+ "properties": {
19
+ "status": {"enum": ["pending", "submitting", "succeeded", "failed", "unknown"]},
20
+ "billable_minutes": {"type": "integer", "minimum": 0},
21
+ "cost": {"type": "integer", "minimum": 0},
22
+ "discount_rate": {"type": "number", "minimum": 0},
23
+ "started_at": {"type": ["string", "null"], "format": "date-time"},
24
+ "ended_at": {"type": ["string", "null"], "format": "date-time"}
25
+ }
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://xagent.testin.cn/schemas/developer/v1/authoring-revision-create.schema.json",
4
+ "title": "XAgent Authoring Revision Create v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["script", "source", "base_revision_id"],
8
+ "properties": {
9
+ "script": {"$ref": "public-script.schema.json"},
10
+ "source": {"enum": ["user", "agent"]},
11
+ "base_revision_id": {"type": ["string", "null"], "pattern": "^rev_[a-f0-9]{32}$"}
12
+ }
13
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://xagent.testin.cn/schemas/developer/v1/authoring-revision.schema.json",
4
+ "title": "XAgent Authoring Revision v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["id", "schema_version", "session_id", "number", "source", "script", "source_hash", "canonical_hash", "created_at"],
8
+ "properties": {
9
+ "id": {"type": "string", "pattern": "^rev_[a-f0-9]{32}$"},
10
+ "schema_version": {"const": "xagent-authoring-revision/v1"},
11
+ "session_id": {"type": "string", "pattern": "^auth_[a-f0-9]{32}$"},
12
+ "number": {"type": "integer", "minimum": 1},
13
+ "source": {"enum": ["user", "agent"]},
14
+ "script": {"$ref": "public-script.schema.json"},
15
+ "source_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
16
+ "canonical_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
17
+ "created_at": {"type": "string", "format": "date-time"}
18
+ }
19
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://xagent.testin.cn/schemas/developer/v1/authoring-session-create.schema.json",
4
+ "title": "XAgent Authoring Session Create v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["device_id"],
8
+ "properties": {
9
+ "device_id": {"type": "string", "minLength": 1, "maxLength": 255}
10
+ }
11
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://xagent.testin.cn/schemas/developer/v1/authoring-session.schema.json",
4
+ "title": "XAgent Authoring Session v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["id", "schema_version", "device_id", "status", "current_revision_id", "final_revision_id", "created_at", "updated_at", "expires_at"],
8
+ "properties": {
9
+ "id": {"type": "string", "pattern": "^auth_[a-f0-9]{32}$"},
10
+ "schema_version": {"const": "xagent-authoring-session/v1"},
11
+ "device_id": {"type": "string", "minLength": 1, "maxLength": 255},
12
+ "status": {"enum": ["CREATED", "WAITING_RESOURCE", "ACTIVE", "COMPLETING", "COMPLETED", "CANCELLING", "CANCELLED", "FAILED", "EXPIRED"]},
13
+ "current_revision_id": {"type": ["string", "null"], "pattern": "^rev_[a-f0-9]{32}$"},
14
+ "final_revision_id": {"type": ["string", "null"], "pattern": "^rev_[a-f0-9]{32}$"},
15
+ "failure": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["code", "message"],
19
+ "properties": {
20
+ "code": {"type": "string", "minLength": 1, "maxLength": 64},
21
+ "message": {"type": "string", "minLength": 1, "maxLength": 1000}
22
+ }
23
+ },
24
+ "console_url": {"type": "string", "format": "uri", "maxLength": 1000},
25
+ "billing": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": ["status", "billable_minutes", "cost", "discount_rate", "started_at", "ended_at"],
29
+ "properties": {
30
+ "status": {"enum": ["pending", "submitting", "succeeded", "failed", "unknown"]},
31
+ "billable_minutes": {"type": "integer", "minimum": 0},
32
+ "cost": {"type": "integer", "minimum": 0},
33
+ "discount_rate": {"type": "number", "minimum": 0},
34
+ "started_at": {"type": ["string", "null"], "format": "date-time"},
35
+ "ended_at": {"type": ["string", "null"], "format": "date-time"}
36
+ }
37
+ },
38
+ "created_at": {"type": "string", "format": "date-time"},
39
+ "updated_at": {"type": "string", "format": "date-time"},
40
+ "expires_at": {"type": "string", "format": "date-time"}
41
+ },
42
+ "allOf": [
43
+ {
44
+ "if": {"properties": {"status": {"const": "FAILED"}}, "required": ["status"]},
45
+ "then": {"required": ["failure"]},
46
+ "else": {"not": {"required": ["failure"]}}
47
+ },
48
+ {
49
+ "if": {"properties": {"status": {"const": "ACTIVE"}}, "required": ["status"]},
50
+ "then": {"required": ["console_url"]},
51
+ "else": {"not": {"required": ["console_url"]}}
52
+ }
53
+ ]
54
+ }
@@ -0,0 +1,219 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://xagent.testin.cn/schemas/developer/v1/canonical-script.schema.json",
4
+ "title": "XAgent Canonical Script v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version", "version", "steps", "variables"],
8
+ "properties": {
9
+ "schema_version": {"const": "xagent-canonical/v1"},
10
+ "version": {"const": 1},
11
+ "variables": {"type": "object", "additionalProperties": true},
12
+ "steps": {
13
+ "type": "array",
14
+ "minItems": 1,
15
+ "maxItems": 1000,
16
+ "items": {"$ref": "#/$defs/step"}
17
+ }
18
+ },
19
+ "$defs": {
20
+ "prepareDevice": {
21
+ "type": "object",
22
+ "additionalProperties": false,
23
+ "required": ["action"],
24
+ "properties": {
25
+ "action": {"const": "prepareDevice"}
26
+ }
27
+ },
28
+ "install": {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": ["action", "appDownloadUrl"],
32
+ "properties": {
33
+ "action": {"const": "install"},
34
+ "appDownloadUrl": {"type": "string", "minLength": 1},
35
+ "appPackage": {"type": "string", "minLength": 1},
36
+ "description": {"type": "string", "maxLength": 1000}
37
+ }
38
+ },
39
+ "appLaunch": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": ["action"],
43
+ "properties": {
44
+ "action": {"const": "appLaunch"},
45
+ "appPackage": {"type": "string", "minLength": 1},
46
+ "appName": {"type": "string", "minLength": 1},
47
+ "launchPath": {"type": "string", "minLength": 1},
48
+ "description": {"type": "string", "maxLength": 1000}
49
+ },
50
+ "anyOf": [
51
+ {"required": ["appPackage"]},
52
+ {"required": ["appName"]}
53
+ ]
54
+ },
55
+ "uninstall": {
56
+ "type": "object",
57
+ "additionalProperties": false,
58
+ "required": ["action"],
59
+ "properties": {
60
+ "action": {"const": "uninstall"},
61
+ "appPackage": {"type": "string", "minLength": 1},
62
+ "appName": {"type": "string", "minLength": 1},
63
+ "description": {"type": "string", "maxLength": 1000}
64
+ },
65
+ "anyOf": [
66
+ {"required": ["appPackage"]},
67
+ {"required": ["appName"]}
68
+ ]
69
+ },
70
+ "click": {
71
+ "type": "object",
72
+ "additionalProperties": false,
73
+ "required": ["action", "target"],
74
+ "properties": {
75
+ "action": {"const": "click"},
76
+ "target": {"type": "string", "minLength": 1},
77
+ "type": {"enum": ["click", "tap", "longPress", "doubleClick", "rightClick"]},
78
+ "duration": {"type": "integer", "minimum": 1, "maximum": 3600000},
79
+ "description": {"type": "string", "maxLength": 1000}
80
+ },
81
+ "allOf": [
82
+ {
83
+ "if": {"required": ["duration"]},
84
+ "then": {
85
+ "required": ["type"],
86
+ "properties": {"type": {"const": "longPress"}}
87
+ }
88
+ }
89
+ ]
90
+ },
91
+ "input": {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "required": ["action", "text"],
95
+ "properties": {
96
+ "action": {"const": "input"},
97
+ "text": {"type": "string"},
98
+ "target": {"type": "string", "minLength": 1},
99
+ "clearFirst": {"type": "boolean"},
100
+ "inputMode": {"enum": ["smart", "secret"]},
101
+ "description": {"type": "string", "maxLength": 1000}
102
+ }
103
+ },
104
+ "scroll": {"$ref": "public-script.schema.json#/$defs/scroll"},
105
+ "scroll_between": {"$ref": "public-script.schema.json#/$defs/scroll_between"},
106
+ "drag": {"$ref": "public-script.schema.json#/$defs/drag"},
107
+ "screenshot": {"$ref": "public-script.schema.json#/$defs/screenshot"},
108
+ "extract": {"$ref": "public-script.schema.json#/$defs/extract"},
109
+ "waitFor": {
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "required": ["action"],
113
+ "properties": {
114
+ "action": {"const": "waitFor"},
115
+ "time": {"type": "integer", "minimum": 0, "maximum": 3600000},
116
+ "condition": {"type": "string", "minLength": 1},
117
+ "timeout": {"type": "integer", "minimum": 1, "maximum": 3600000},
118
+ "description": {"type": "string", "maxLength": 1000}
119
+ },
120
+ "anyOf": [
121
+ {"required": ["time"]},
122
+ {"required": ["condition"]}
123
+ ]
124
+ },
125
+ "assert": {
126
+ "type": "object",
127
+ "additionalProperties": false,
128
+ "required": ["action"],
129
+ "properties": {
130
+ "action": {"const": "assert"},
131
+ "condition": {"type": "string", "minLength": 1},
132
+ "conditionType": {"enum": ["textVisible", "expr"]},
133
+ "target": {"type": "string", "minLength": 1},
134
+ "text": {"type": "string"},
135
+ "message": {"type": "string", "maxLength": 1000},
136
+ "description": {"type": "string", "maxLength": 1000}
137
+ },
138
+ "anyOf": [
139
+ {"required": ["condition"]},
140
+ {"required": ["target"]}
141
+ ]
142
+ },
143
+ "if": {
144
+ "type": "object",
145
+ "additionalProperties": false,
146
+ "required": ["action", "condition", "then"],
147
+ "properties": {
148
+ "action": {"const": "if"},
149
+ "condition": {"type": "string", "minLength": 1},
150
+ "then": {
151
+ "type": "array",
152
+ "minItems": 1,
153
+ "maxItems": 1000,
154
+ "items": {"$ref": "#/$defs/step"}
155
+ },
156
+ "else": {
157
+ "type": "array",
158
+ "minItems": 1,
159
+ "maxItems": 1000,
160
+ "items": {"$ref": "#/$defs/step"}
161
+ },
162
+ "description": {"type": "string", "maxLength": 1000}
163
+ }
164
+ },
165
+ "appStop": {"$ref": "public-script.schema.json#/$defs/appStop"},
166
+ "appClean": {"$ref": "public-script.schema.json#/$defs/appClean"},
167
+ "set": {"$ref": "public-script.schema.json#/$defs/set"},
168
+ "randomVar": {"$ref": "public-script.schema.json#/$defs/randomVar"},
169
+ "for": {
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "required": ["action", "steps"],
173
+ "properties": {
174
+ "action": {"const": "for"},
175
+ "count": {"oneOf": [{"type": "integer", "minimum": 0}, {"type": "string", "minLength": 1}]},
176
+ "condition": {"type": "string", "minLength": 1},
177
+ "dead_loop": {"type": "integer", "minimum": 1, "maximum": 10000},
178
+ "steps": {"type": "array", "minItems": 1, "maxItems": 1000, "items": {"$ref": "#/$defs/step"}},
179
+ "description": {"type": "string", "maxLength": 1000}
180
+ },
181
+ "oneOf": [{"required": ["count"]}, {"required": ["condition"]}]
182
+ },
183
+ "throw": {"$ref": "public-script.schema.json#/$defs/throw"},
184
+ "break": {"$ref": "public-script.schema.json#/$defs/break"},
185
+ "press_key": {"$ref": "public-script.schema.json#/$defs/press_key"},
186
+ "press_home": {"$ref": "public-script.schema.json#/$defs/press_home"},
187
+ "press_back": {"$ref": "public-script.schema.json#/$defs/press_back"},
188
+ "press_enter": {"$ref": "public-script.schema.json#/$defs/press_enter"},
189
+ "step": {
190
+ "oneOf": [
191
+ {"$ref": "#/$defs/prepareDevice"},
192
+ {"$ref": "#/$defs/install"},
193
+ {"$ref": "#/$defs/appLaunch"},
194
+ {"$ref": "#/$defs/uninstall"},
195
+ {"$ref": "#/$defs/click"},
196
+ {"$ref": "#/$defs/input"},
197
+ {"$ref": "#/$defs/scroll"},
198
+ {"$ref": "#/$defs/scroll_between"},
199
+ {"$ref": "#/$defs/drag"},
200
+ {"$ref": "#/$defs/screenshot"},
201
+ {"$ref": "#/$defs/extract"},
202
+ {"$ref": "#/$defs/waitFor"},
203
+ {"$ref": "#/$defs/assert"},
204
+ {"$ref": "#/$defs/if"},
205
+ {"$ref": "#/$defs/appStop"},
206
+ {"$ref": "#/$defs/appClean"},
207
+ {"$ref": "#/$defs/set"},
208
+ {"$ref": "#/$defs/randomVar"},
209
+ {"$ref": "#/$defs/for"},
210
+ {"$ref": "#/$defs/throw"},
211
+ {"$ref": "#/$defs/break"},
212
+ {"$ref": "#/$defs/press_key"},
213
+ {"$ref": "#/$defs/press_home"},
214
+ {"$ref": "#/$defs/press_back"},
215
+ {"$ref": "#/$defs/press_enter"}
216
+ ]
217
+ }
218
+ }
219
+ }