@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.
- package/README.md +157 -0
- package/dist/action/client.d.ts +13 -0
- package/dist/action/client.d.ts.map +1 -0
- package/dist/action/client.js +28 -0
- package/dist/action/client.js.map +1 -0
- package/dist/action/mcp-content.d.ts +2 -0
- package/dist/action/mcp-content.d.ts.map +1 -0
- package/dist/action/mcp-content.js +116 -0
- package/dist/action/mcp-content.js.map +1 -0
- package/dist/action/protocol.d.ts +36 -0
- package/dist/action/protocol.d.ts.map +1 -0
- package/dist/action/protocol.js +29 -0
- package/dist/action/protocol.js.map +1 -0
- package/dist/assets/contracts/app-list.schema.json +31 -0
- package/dist/assets/contracts/app-upload.schema.json +45 -0
- package/dist/assets/contracts/app.schema.json +18 -0
- package/dist/assets/contracts/authoring-attempt-create.schema.json +12 -0
- package/dist/assets/contracts/authoring-attempt.schema.json +56 -0
- package/dist/assets/contracts/authoring-complete.schema.json +13 -0
- package/dist/assets/contracts/authoring-draft-attempt-create.schema.json +12 -0
- package/dist/assets/contracts/authoring-observation.schema.json +28 -0
- package/dist/assets/contracts/authoring-revision-create.schema.json +13 -0
- package/dist/assets/contracts/authoring-revision.schema.json +19 -0
- package/dist/assets/contracts/authoring-session-create.schema.json +11 -0
- package/dist/assets/contracts/authoring-session.schema.json +54 -0
- package/dist/assets/contracts/canonical-script.schema.json +219 -0
- package/dist/assets/contracts/compat-script.schema.json +380 -0
- package/dist/assets/contracts/device-list.schema.json +19 -0
- package/dist/assets/contracts/error.schema.json +47 -0
- package/dist/assets/contracts/execution-target.schema.json +55 -0
- package/dist/assets/contracts/fixtures/authoring-attempt-create.valid.json +4 -0
- package/dist/assets/contracts/fixtures/authoring-attempt.passed.json +16 -0
- package/dist/assets/contracts/fixtures/authoring-draft-attempt-create.valid.json +10 -0
- package/dist/assets/contracts/fixtures/authoring-observation.valid.json +7 -0
- package/dist/assets/contracts/fixtures/authoring-revision.valid.json +16 -0
- package/dist/assets/contracts/fixtures/authoring-session.active.json +12 -0
- package/dist/assets/contracts/fixtures/canonical-script.valid.json +17 -0
- package/dist/assets/contracts/fixtures/ci-exit-status-cases.json +44 -0
- package/dist/assets/contracts/fixtures/command-mutual-exclusion-cases.json +20 -0
- package/dist/assets/contracts/fixtures/compat-script.all-platform-actions.yaml +227 -0
- package/dist/assets/contracts/fixtures/execution-target.both.invalid.json +7 -0
- package/dist/assets/contracts/fixtures/execution-target.concurrency-two.invalid.json +4 -0
- package/dist/assets/contracts/fixtures/execution-target.count-two.invalid.json +6 -0
- package/dist/assets/contracts/fixtures/execution-target.dynamic.valid.json +12 -0
- package/dist/assets/contracts/fixtures/execution-target.fixed.valid.json +4 -0
- package/dist/assets/contracts/fixtures/execution-target.multiple-devices.invalid.json +4 -0
- package/dist/assets/contracts/fixtures/execution-target.multiple-filters.invalid.json +7 -0
- package/dist/assets/contracts/fixtures/execution-target.strategy-all.invalid.json +6 -0
- package/dist/assets/contracts/fixtures/idempotency.conflict.json +26 -0
- package/dist/assets/contracts/fixtures/idempotency.same-request.json +26 -0
- package/dist/assets/contracts/fixtures/principal.personal.json +23 -0
- package/dist/assets/contracts/fixtures/principal.project-ci.json +20 -0
- package/dist/assets/contracts/fixtures/project-config.no-default.valid.json +9 -0
- package/dist/assets/contracts/fixtures/project-config.secret.invalid.json +10 -0
- package/dist/assets/contracts/fixtures/project-config.target-name.invalid.json +10 -0
- package/dist/assets/contracts/fixtures/project-config.valid.json +22 -0
- package/dist/assets/contracts/fixtures/public-script.all-cli-actions.yaml +39 -0
- package/dist/assets/contracts/fixtures/public-script.invalid.json +8 -0
- package/dist/assets/contracts/fixtures/public-script.valid.json +17 -0
- package/dist/assets/contracts/fixtures/run-create-v2.device-id.invalid.json +16 -0
- package/dist/assets/contracts/fixtures/run-create.personal-upload.valid.json +20 -0
- package/dist/assets/contracts/fixtures/run-create.single-device.json +19 -0
- package/dist/assets/contracts/fixtures/run-create.target.valid.json +22 -0
- package/dist/assets/contracts/fixtures/run.queued.json +19 -0
- package/dist/assets/contracts/fixtures/run.target.queued.json +38 -0
- package/dist/assets/contracts/fixtures/skill-catalog.valid.json +19 -0
- package/dist/assets/contracts/fixtures/skill-reference.valid.json +9 -0
- package/dist/assets/contracts/fixtures/skill.valid.json +10 -0
- package/dist/assets/contracts/fixtures/target-hash-cases.json +30 -0
- package/dist/assets/contracts/fixtures/target-preview.hash-mismatch.error.json +8 -0
- package/dist/assets/contracts/fixtures/target-preview.no-match.error.json +9 -0
- package/dist/assets/contracts/fixtures/target-preview.request.valid.json +9 -0
- package/dist/assets/contracts/fixtures/target-preview.success.json +18 -0
- package/dist/assets/contracts/fixtures/target-preview.unavailable.json +18 -0
- package/dist/assets/contracts/principal.schema.json +72 -0
- package/dist/assets/contracts/project-config.schema.json +23 -0
- package/dist/assets/contracts/public-script.schema.json +397 -0
- package/dist/assets/contracts/run-create-v2.schema.json +78 -0
- package/dist/assets/contracts/run-create.schema.json +70 -0
- package/dist/assets/contracts/run.schema.json +137 -0
- package/dist/assets/contracts/skill-catalog.schema.json +15 -0
- package/dist/assets/contracts/skill-reference.schema.json +17 -0
- package/dist/assets/contracts/skill-summary.schema.json +28 -0
- package/dist/assets/contracts/skill.schema.json +30 -0
- package/dist/assets/contracts/target-preview.schema.json +75 -0
- package/dist/assets/integrations/manifest.json +17 -0
- package/dist/assets/integrations/xagent-skill/SKILL.md +28 -0
- package/dist/assets/integrations/xagent-skill/agents/openai.yaml +4 -0
- package/dist/assets/integrations/xagent-skill/references/cli-mcp-interop.md +10 -0
- package/dist/assets/integrations/xagent-skill/references/host-adapters.md +9 -0
- package/dist/assets/integrations/xagent-skill/references/installation.md +10 -0
- package/dist/assets/integrations/xagent-skill/references/privacy.md +3 -0
- package/dist/assets/integrations/xagent-skill/references/routing.md +32 -0
- package/dist/assets/integrations/xagent-skill/scripts/install-cli.ps1 +5 -0
- package/dist/assets/integrations/xagent-skill/scripts/install-cli.sh +6 -0
- package/dist/assets/skills/xagent-analyze-failure/SKILL.md +13 -0
- package/dist/assets/skills/xagent-analyze-failure/agents/openai.yaml +4 -0
- package/dist/assets/skills/xagent-analyze-failure/references/failure-classification.md +20 -0
- package/dist/assets/skills/xagent-author-test/SKILL.md +19 -0
- package/dist/assets/skills/xagent-author-test/agents/openai.yaml +4 -0
- package/dist/assets/skills/xagent-author-test/references/authoring-workflow.md +41 -0
- package/dist/assets/skills/xagent-author-test/references/host-interaction-adapters.md +81 -0
- package/dist/assets/skills/xagent-author-test/references/interaction-modes.md +97 -0
- package/dist/assets/skills/xagent-author-test/references/interactive-steering.md +57 -0
- package/dist/assets/skills/xagent-author-test/references/script-actions.md +34 -0
- package/dist/assets/skills/xagent-author-test/references/script-format.md +100 -0
- package/dist/assets/skills/xagent-cli/SKILL.md +31 -0
- package/dist/assets/skills/xagent-cli/agents/openai.yaml +4 -0
- package/dist/assets/skills/xagent-cli/references/capability-routing.md +36 -0
- package/dist/assets/skills/xagent-cli/references/cli-commands.md +23 -0
- package/dist/assets/skills/xagent-cli/references/failure-routing.md +18 -0
- package/dist/assets/skills/xagent-cli/references/host-modes.md +21 -0
- package/dist/assets/skills/xagent-cli/references/mcp-tools.md +26 -0
- package/dist/assets/skills/xagent-cli/references/permissions.md +17 -0
- package/dist/assets/skills/xagent-explore-device/SKILL.md +26 -0
- package/dist/assets/skills/xagent-explore-device/agents/openai.yaml +4 -0
- package/dist/assets/skills/xagent-explore-device/references/actions.md +24 -0
- package/dist/assets/skills/xagent-explore-device/references/single-action-protocol.md +59 -0
- package/dist/assets/skills/xagent-explore-device/references/tool-adapters.md +32 -0
- package/dist/assets/skills/xagent-repair-test/SKILL.md +16 -0
- package/dist/assets/skills/xagent-repair-test/agents/openai.yaml +4 -0
- package/dist/assets/skills/xagent-repair-test/references/repair-workflow.md +21 -0
- package/dist/assets/skills/xagent-run-test/SKILL.md +16 -0
- package/dist/assets/skills/xagent-run-test/agents/openai.yaml +4 -0
- package/dist/assets/skills/xagent-run-test/references/execution-modes.md +23 -0
- package/dist/assets/skills/xagent-run-test/references/result-status.md +13 -0
- package/dist/assets/skills/xagent-test-report/SKILL.md +20 -0
- package/dist/assets/skills/xagent-test-report/agents/openai.yaml +4 -0
- package/dist/assets/skills/xagent-test-report/references/evidence-policy.md +20 -0
- package/dist/assets/skills/xagent-test-report/references/report-template.md +41 -0
- package/dist/assets/skills/xagent-test-report/references/result-classification.md +13 -0
- package/dist/authoring/draft-store.d.ts +19 -0
- package/dist/authoring/draft-store.d.ts.map +1 -0
- package/dist/authoring/draft-store.js +104 -0
- package/dist/authoring/draft-store.js.map +1 -0
- package/dist/authoring/session-lease.d.ts +64 -0
- package/dist/authoring/session-lease.d.ts.map +1 -0
- package/dist/authoring/session-lease.js +190 -0
- package/dist/authoring/session-lease.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +529 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/credentials.d.ts +16 -0
- package/dist/config/credentials.d.ts.map +1 -0
- package/dist/config/credentials.js +93 -0
- package/dist/config/credentials.js.map +1 -0
- package/dist/config/store.d.ts +37 -0
- package/dist/config/store.d.ts.map +1 -0
- package/dist/config/store.js +142 -0
- package/dist/config/store.js.map +1 -0
- package/dist/core/assets.d.ts +5 -0
- package/dist/core/assets.d.ts.map +1 -0
- package/dist/core/assets.js +46 -0
- package/dist/core/assets.js.map +1 -0
- package/dist/core/errors.d.ts +19 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +36 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/interrupt.d.ts +8 -0
- package/dist/core/interrupt.d.ts.map +1 -0
- package/dist/core/interrupt.js +54 -0
- package/dist/core/interrupt.js.map +1 -0
- package/dist/core/json.d.ts +5 -0
- package/dist/core/json.d.ts.map +1 -0
- package/dist/core/json.js +21 -0
- package/dist/core/json.js.map +1 -0
- package/dist/core/version.d.ts +8 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +8 -0
- package/dist/core/version.js.map +1 -0
- package/dist/integrations/manager.d.ts +12 -0
- package/dist/integrations/manager.d.ts.map +1 -0
- package/dist/integrations/manager.js +218 -0
- package/dist/integrations/manager.js.map +1 -0
- package/dist/integrations/routing.d.ts +105 -0
- package/dist/integrations/routing.d.ts.map +1 -0
- package/dist/integrations/routing.js +85 -0
- package/dist/integrations/routing.js.map +1 -0
- package/dist/mcp/server.d.ts +4 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +69 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +30 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +345 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/project/config.d.ts +15 -0
- package/dist/project/config.d.ts.map +1 -0
- package/dist/project/config.js +46 -0
- package/dist/project/config.js.map +1 -0
- package/dist/run/progress.d.ts +5 -0
- package/dist/run/progress.d.ts.map +1 -0
- package/dist/run/progress.js +29 -0
- package/dist/run/progress.js.map +1 -0
- package/dist/script/service.d.ts +42 -0
- package/dist/script/service.d.ts.map +1 -0
- package/dist/script/service.js +457 -0
- package/dist/script/service.js.map +1 -0
- package/dist/sdk/authoring.d.ts +19 -0
- package/dist/sdk/authoring.d.ts.map +1 -0
- package/dist/sdk/authoring.js +43 -0
- package/dist/sdk/authoring.js.map +1 -0
- package/dist/sdk/client.d.ts +49 -0
- package/dist/sdk/client.d.ts.map +1 -0
- package/dist/sdk/client.js +241 -0
- package/dist/sdk/client.js.map +1 -0
- package/dist/skills/catalog.d.ts +7 -0
- package/dist/skills/catalog.d.ts.map +1 -0
- package/dist/skills/catalog.js +59 -0
- package/dist/skills/catalog.js.map +1 -0
- 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
|
+
}
|