@xenon-device-management/xenon 1.1.0
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 +446 -0
- package/lib/package.json +207 -0
- package/lib/public/assets/Layouts-7IT8aFLI.js +11 -0
- package/lib/public/assets/Layouts-DPMls9vh.css +1 -0
- package/lib/public/assets/ai-settings-BbnfgdEx.js +11 -0
- package/lib/public/assets/apps-CRMrI4_p.js +16 -0
- package/lib/public/assets/apps-CcM77dgg.css +1 -0
- package/lib/public/assets/badge-B1nKs8zj.css +1 -0
- package/lib/public/assets/badge-CSvl5xIU.js +11 -0
- package/lib/public/assets/button-CJlKn4PZ.css +1 -0
- package/lib/public/assets/button-CvLaGFYj.js +26 -0
- package/lib/public/assets/calendar-6w-D6Oaw.js +6 -0
- package/lib/public/assets/clock-DcdeWBPr.js +6 -0
- package/lib/public/assets/cpu-DiSoXT9n.js +6 -0
- package/lib/public/assets/device-explorer-CajM63OJ.js +193 -0
- package/lib/public/assets/device-explorer-CxdUAoTL.css +1 -0
- package/lib/public/assets/index-ByQwMN5T.js +174 -0
- package/lib/public/assets/index-C1DBaoSh.js +1 -0
- package/lib/public/assets/index-qzCez_kk.css +1 -0
- package/lib/public/assets/lock-B23ibZmo.js +6 -0
- package/lib/public/assets/maintenance-settings-CirzA6yG.js +6 -0
- package/lib/public/assets/mouse-pointer-2-Cz76SHFb.js +6 -0
- package/lib/public/assets/plus-BBwlIevt.js +6 -0
- package/lib/public/assets/session-dashboard-C2k7FFv_.css +1 -0
- package/lib/public/assets/session-dashboard-HPDtwPOZ.js +62 -0
- package/lib/public/assets/settings-DrZsZwdc.js +1 -0
- package/lib/public/assets/trash-2-DQpvzJec.js +6 -0
- package/lib/public/assets/useSocket-Dxsqae2a.js +16 -0
- package/lib/public/assets/webhook-settings-CDPgsgkb.css +1 -0
- package/lib/public/assets/webhook-settings-Cp-B4Nrw.js +1 -0
- package/lib/public/assets/zap-DovP6iow.js +6 -0
- package/lib/public/favicon.ico +0 -0
- package/lib/public/favicon.png +0 -0
- package/lib/public/favicon.svg +9 -0
- package/lib/public/index.html +46 -0
- package/lib/public/logo.svg +17 -0
- package/lib/public/logo192.png +0 -0
- package/lib/public/logo512.png +0 -0
- package/lib/public/manifest.json +25 -0
- package/lib/public/robots.txt +3 -0
- package/lib/schema.json +348 -0
- package/lib/src/InternalHttpClient.js +212 -0
- package/lib/src/PluginContext.js +29 -0
- package/lib/src/XenonCapabilityManager.js +199 -0
- package/lib/src/app/index.js +167 -0
- package/lib/src/app/routers/apps.js +79 -0
- package/lib/src/app/routers/config.js +131 -0
- package/lib/src/app/routers/control.js +835 -0
- package/lib/src/app/routers/dashboard.js +301 -0
- package/lib/src/app/routers/grid.js +352 -0
- package/lib/src/app/routers/reservation.js +190 -0
- package/lib/src/app/routers/webhook.js +83 -0
- package/lib/src/app/swagger-docs.js +203 -0
- package/lib/src/app/swagger.js +366 -0
- package/lib/src/chromeUtils.js +148 -0
- package/lib/src/commands/handle.js +19 -0
- package/lib/src/commands/index.js +8 -0
- package/lib/src/config.js +73 -0
- package/lib/src/dashboard/asset-manager.js +84 -0
- package/lib/src/dashboard/commands.js +284 -0
- package/lib/src/dashboard/event-manager.js +699 -0
- package/lib/src/dashboard/services/app-service.js +134 -0
- package/lib/src/dashboard/services/failure-analysis-service.js +173 -0
- package/lib/src/dashboard/services/session-service.js +113 -0
- package/lib/src/data-service/CircuitBreaker.js +83 -0
- package/lib/src/data-service/config-service.js +155 -0
- package/lib/src/data-service/db.js +122 -0
- package/lib/src/data-service/device-service.js +320 -0
- package/lib/src/data-service/device-store.interface.js +2 -0
- package/lib/src/data-service/device-store.js +345 -0
- package/lib/src/data-service/pending-sessions-service.js +25 -0
- package/lib/src/data-service/pluginArgs.js +25 -0
- package/lib/src/data-service/prisma-service.js +31 -0
- package/lib/src/data-service/prisma-store.js +385 -0
- package/lib/src/data-service/queue-service.js +150 -0
- package/lib/src/data-service/web-config-service.js +130 -0
- package/lib/src/device-managers/AndroidDeviceManager.js +1155 -0
- package/lib/src/device-managers/ChromeDriverManager.js +68 -0
- package/lib/src/device-managers/HealthMonitorService.js +325 -0
- package/lib/src/device-managers/IOSDeviceManager.js +351 -0
- package/lib/src/device-managers/NodeDevices.js +82 -0
- package/lib/src/device-managers/android/AndroidStreamService.js +370 -0
- package/lib/src/device-managers/android/DeviceLockManager.js +45 -0
- package/lib/src/device-managers/cloud/CapabilityManager.js +26 -0
- package/lib/src/device-managers/cloud/Devices.js +86 -0
- package/lib/src/device-managers/iOSTracker.js +44 -0
- package/lib/src/device-managers/index.js +89 -0
- package/lib/src/device-managers/ios/IOSDiscoveryService.js +268 -0
- package/lib/src/device-managers/ios/IOSStreamService.js +893 -0
- package/lib/src/device-managers/ios/WDAClient.js +866 -0
- package/lib/src/device-utils.js +663 -0
- package/lib/src/enums/Capabilities.js +8 -0
- package/lib/src/enums/Cloud.js +11 -0
- package/lib/src/enums/Platform.js +9 -0
- package/lib/src/enums/SessionType.js +9 -0
- package/lib/src/enums/SocketEvents.js +15 -0
- package/lib/src/helpers/UniversalMjpegProxy.js +273 -0
- package/lib/src/helpers/index.js +229 -0
- package/lib/src/index.js +95 -0
- package/lib/src/interceptors/CommandInterceptor.js +524 -0
- package/lib/src/interfaces/ICloudManager.js +2 -0
- package/lib/src/interfaces/IDevice.js +2 -0
- package/lib/src/interfaces/IDeviceFilterOptions.js +2 -0
- package/lib/src/interfaces/IDeviceManager.js +2 -0
- package/lib/src/interfaces/IOptions.js +2 -0
- package/lib/src/interfaces/IPluginArgs.js +55 -0
- package/lib/src/interfaces/ISessionCapability.js +2 -0
- package/lib/src/logger.js +225 -0
- package/lib/src/plugin.js +244 -0
- package/lib/src/prisma.js +12 -0
- package/lib/src/profiling/AndroidAppProfiler.js +213 -0
- package/lib/src/proxy/wd-command-proxy.js +221 -0
- package/lib/src/scripts/generate-database-migration.js +59 -0
- package/lib/src/scripts/initialize-database.js +55 -0
- package/lib/src/scripts/install-go-ios.js +66 -0
- package/lib/src/scripts/prepare-prisma.js +89 -0
- package/lib/src/services/AICommandService.js +143 -0
- package/lib/src/services/AIService.js +466 -0
- package/lib/src/services/CleanupService.js +141 -0
- package/lib/src/services/EventBus.js +74 -0
- package/lib/src/services/InspectorService.js +395 -0
- package/lib/src/services/MetricsService.js +134 -0
- package/lib/src/services/NetworkConditioningService.js +173 -0
- package/lib/src/services/NotificationService.js +163 -0
- package/lib/src/services/RequestLogService.js +252 -0
- package/lib/src/services/ResourceIsolationService.js +122 -0
- package/lib/src/services/SecurityService.js +120 -0
- package/lib/src/services/ServerManager.js +284 -0
- package/lib/src/services/SessionHeartbeatService.js +158 -0
- package/lib/src/services/SessionLifecycleService.js +572 -0
- package/lib/src/services/SocketClient.js +71 -0
- package/lib/src/services/SocketServer.js +87 -0
- package/lib/src/services/TracingService.js +132 -0
- package/lib/src/services/VideoPipelineService.js +220 -0
- package/lib/src/services/healing/FuzzyXmlHealingProvider.js +333 -0
- package/lib/src/services/healing/HealEtalonService.js +98 -0
- package/lib/src/services/healing/HealedLocatorGenerator.js +132 -0
- package/lib/src/services/healing/HealingOrchestrator.js +165 -0
- package/lib/src/services/healing/LlmHealingProvider.js +77 -0
- package/lib/src/services/healing/OcrHealingProvider.js +119 -0
- package/lib/src/services/healing/ResilioTreeHealingProvider.js +100 -0
- package/lib/src/services/healing/VisualAiHealingProvider.js +90 -0
- package/lib/src/services/healing/types.js +12 -0
- package/lib/src/services/omni-vision/OmniVisionService.js +718 -0
- package/lib/src/services/omni-vision/VisionAssertionService.js +68 -0
- package/lib/src/sessions/CloudSession.js +42 -0
- package/lib/src/sessions/LocalSession.js +313 -0
- package/lib/src/sessions/RemoteSession.js +287 -0
- package/lib/src/sessions/SessionManager.js +238 -0
- package/lib/src/sessions/XenonSession.js +44 -0
- package/lib/src/types/CLIArgs.js +2 -0
- package/lib/src/types/CloudArgs.js +2 -0
- package/lib/src/types/CloudSchema.js +131 -0
- package/lib/src/types/DeviceType.js +2 -0
- package/lib/src/types/DeviceUpdate.js +2 -0
- package/lib/src/types/IOSDevice.js +2 -0
- package/lib/src/types/Platform.js +2 -0
- package/lib/src/types/SessionStatus.js +11 -0
- package/lib/src/validators/CapabilityValidator.js +93 -0
- package/lib/test/e2e/android/conf.spec.js +43 -0
- package/lib/test/e2e/android/conf2.spec.js +44 -0
- package/lib/test/e2e/android/conf3.spec.js +44 -0
- package/lib/test/e2e/e2ehelper.js +113 -0
- package/lib/test/e2e/hubnode/forward-request.spec.js +224 -0
- package/lib/test/e2e/hubnode/hubnode.spec.js +214 -0
- package/lib/test/e2e/ios/conf1.spec.js +39 -0
- package/lib/test/e2e/ios/conf2.spec.js +39 -0
- package/lib/test/e2e/plugin-harness.js +236 -0
- package/lib/test/e2e/plugin.spec.js +97 -0
- package/lib/test/e2e/telemetry_verification.spec.js +83 -0
- package/lib/test/e2e/video-recording-test.spec.js +63 -0
- package/lib/test/helpers/test-container.js +112 -0
- package/lib/test/integration/androidDevices.spec.js +137 -0
- package/lib/test/integration/cliArgs.js +73 -0
- package/lib/test/integration/ios/01iOSSimulator.spec.js +291 -0
- package/lib/test/integration/ios/02iOSDevices.spec.js +75 -0
- package/lib/test/integration/testHelpers.js +74 -0
- package/lib/test/unit/AndroidDeviceManager.spec.js +178 -0
- package/lib/test/unit/ChromeDriverManager.spec.js +26 -0
- package/lib/test/unit/CleanupService.spec.js +21 -0
- package/lib/test/unit/DeviceModel.spec.js +157 -0
- package/lib/test/unit/FuzzyXmlHealingProvider.test.js +294 -0
- package/lib/test/unit/GetAdbOriginal.js +42 -0
- package/lib/test/unit/HealingCascade.test.js +128 -0
- package/lib/test/unit/IOSDeviceManager.spec.js +261 -0
- package/lib/test/unit/RemoteIOs.spec.js +78 -0
- package/lib/test/unit/ResilioTreeHealingProvider.test.js +96 -0
- package/lib/test/unit/commands.spec.js +27 -0
- package/lib/test/unit/config.spec.js +27 -0
- package/lib/test/unit/device-service.spec.js +307 -0
- package/lib/test/unit/device-utils.spec.js +313 -0
- package/lib/test/unit/fixtures/device.config.js +4 -0
- package/lib/test/unit/fixtures/devices.js +89 -0
- package/lib/test/unit/helpers.spec.js +62 -0
- package/lib/test/unit/omni-vision.spec.js +100 -0
- package/lib/test/unit/plugin.spec.js +133 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +207 -0
- package/prisma/data.db +0 -0
- package/prisma/dev.db +0 -0
- package/prisma/dev.db-journal +0 -0
- package/prisma/migrations/20231011074725_initial_tables/migration.sql +47 -0
- package/prisma/migrations/20231226115334_update_session_log/migration.sql +2 -0
- package/prisma/migrations/20251204113710_add_video_recording_enabled/migration.sql +29 -0
- package/prisma/migrations/20251204132449_add_log_table/migration.sql +11 -0
- package/prisma/migrations/20251205050111_add_profiling_support/migration.sql +47 -0
- package/prisma/migrations/20251205050947_add_is_error_field/migration.sql +24 -0
- package/prisma/migrations/20260126201337_add_app_model/migration.sql +18 -0
- package/prisma/migrations/20260130115722_add_performance_trace_and_xenon_sync/migration.sql +2 -0
- package/prisma/migrations/20260130135114_add_device_models/migration.sql +57 -0
- package/prisma/migrations/20260130140655_make_systemport_optional/migration.sql +45 -0
- package/prisma/migrations/20260130140932_make_device_fields_optional/migration.sql +45 -0
- package/prisma/migrations/20260130141040_final_schema_fix/migration.sql +45 -0
- package/prisma/migrations/20260130143234_add_device_health_fields/migration.sql +4 -0
- package/prisma/migrations/20260130144921_add_failure_category/migration.sql +2 -0
- package/prisma/migrations/20260131151456_add_webhook_config/migration.sql +10 -0
- package/prisma/migrations/20260201094507_add_device_tags/migration.sql +11 -0
- package/prisma/migrations/20260201103410_add_managed_process/migration.sql +15 -0
- package/prisma/migrations/20260201140637_add_web_config/migration.sql +22 -0
- package/prisma/migrations/20260201162232_add_session_progress/migration.sql +2 -0
- package/prisma/migrations/20260201174231_add_total_healed_count/migration.sql +2 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema.prisma +210 -0
- package/schema.json +348 -0
- package/scripts/build-xenon.sh +32 -0
- package/scripts/dev/debug-gemini.ts +44 -0
- package/scripts/generate-types-from-schema.js +86 -0
- package/scripts/install-compatible-driver.js +39 -0
package/schema.json
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"additionalProperties": false,
|
|
4
|
+
"description": "Appium configuration schema for the Xenon plugin.",
|
|
5
|
+
"properties": {
|
|
6
|
+
"platform": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"enum": [
|
|
9
|
+
"ios",
|
|
10
|
+
"android",
|
|
11
|
+
"both"
|
|
12
|
+
],
|
|
13
|
+
"default": "both"
|
|
14
|
+
},
|
|
15
|
+
"androidDeviceType": {
|
|
16
|
+
"title": "DeviceTypeToInclude",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"enum": [
|
|
19
|
+
"both",
|
|
20
|
+
"real",
|
|
21
|
+
"simulated"
|
|
22
|
+
],
|
|
23
|
+
"default": "both"
|
|
24
|
+
},
|
|
25
|
+
"simulators": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": {
|
|
28
|
+
"$ref": "#/definitions/SimulatorConfig"
|
|
29
|
+
},
|
|
30
|
+
"default": []
|
|
31
|
+
},
|
|
32
|
+
"iosDeviceType": {
|
|
33
|
+
"title": "DeviceTypeToInclude1",
|
|
34
|
+
"type": "string",
|
|
35
|
+
"enum": [
|
|
36
|
+
"both",
|
|
37
|
+
"real",
|
|
38
|
+
"simulated"
|
|
39
|
+
],
|
|
40
|
+
"default": "both"
|
|
41
|
+
},
|
|
42
|
+
"hub": {
|
|
43
|
+
"type": "string"
|
|
44
|
+
},
|
|
45
|
+
"remoteMachineProxyIP": {
|
|
46
|
+
"type": "string"
|
|
47
|
+
},
|
|
48
|
+
"adbRemote": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
},
|
|
53
|
+
"default": []
|
|
54
|
+
},
|
|
55
|
+
"skipChromeDownload": {
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"default": true
|
|
58
|
+
},
|
|
59
|
+
"maxSessions": {
|
|
60
|
+
"type": "number",
|
|
61
|
+
"default": 8
|
|
62
|
+
},
|
|
63
|
+
"cloud": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"description": "Cloud configuration object. See CloudConfig interface for details."
|
|
66
|
+
},
|
|
67
|
+
"derivedDataPath": {
|
|
68
|
+
"title": "IDerivedDataPath",
|
|
69
|
+
"type": "object",
|
|
70
|
+
"additionalProperties": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
},
|
|
73
|
+
"description": "Map of derived data paths for iOS simulators/devices."
|
|
74
|
+
},
|
|
75
|
+
"emulators": {
|
|
76
|
+
"type": "array",
|
|
77
|
+
"items": {
|
|
78
|
+
"$ref": "#/definitions/EmulatorConfig"
|
|
79
|
+
},
|
|
80
|
+
"default": []
|
|
81
|
+
},
|
|
82
|
+
"proxy": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"description": "Proxy configuration object. See AxiosProxy interface for details."
|
|
85
|
+
},
|
|
86
|
+
"deviceAvailabilityTimeoutMs": {
|
|
87
|
+
"type": "number",
|
|
88
|
+
"default": 300000
|
|
89
|
+
},
|
|
90
|
+
"deviceAvailabilityQueryIntervalMs": {
|
|
91
|
+
"type": "number",
|
|
92
|
+
"default": 10000
|
|
93
|
+
},
|
|
94
|
+
"sendNodeDevicesToHubIntervalMs": {
|
|
95
|
+
"type": "number",
|
|
96
|
+
"default": 30000
|
|
97
|
+
},
|
|
98
|
+
"checkStaleDevicesIntervalMs": {
|
|
99
|
+
"type": "number",
|
|
100
|
+
"default": 30000
|
|
101
|
+
},
|
|
102
|
+
"checkBlockedDevicesIntervalMs": {
|
|
103
|
+
"type": "number",
|
|
104
|
+
"default": 30000
|
|
105
|
+
},
|
|
106
|
+
"newCommandTimeoutSec": {
|
|
107
|
+
"type": "number",
|
|
108
|
+
"default": 60
|
|
109
|
+
},
|
|
110
|
+
"bindHostOrIp": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"default": "127.0.0.1"
|
|
113
|
+
},
|
|
114
|
+
"enableDashboard": {
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"default": false
|
|
117
|
+
},
|
|
118
|
+
"bootedSimulators": {
|
|
119
|
+
"type": "boolean",
|
|
120
|
+
"default": false
|
|
121
|
+
},
|
|
122
|
+
"removeDevicesFromDatabaseBeforeRunningThePlugin": {
|
|
123
|
+
"type": "boolean",
|
|
124
|
+
"default": false
|
|
125
|
+
},
|
|
126
|
+
"healthCheckIntervalMs": {
|
|
127
|
+
"type": "number",
|
|
128
|
+
"default": 86400000
|
|
129
|
+
},
|
|
130
|
+
"healthCheckSchedule": {
|
|
131
|
+
"type": "string"
|
|
132
|
+
},
|
|
133
|
+
"databaseProvider": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"enum": [
|
|
136
|
+
"sqlite",
|
|
137
|
+
"postgresql"
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"databaseUrl": {
|
|
141
|
+
"type": "string"
|
|
142
|
+
},
|
|
143
|
+
"aiProvider": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"enum": [
|
|
146
|
+
"gemini",
|
|
147
|
+
"openai",
|
|
148
|
+
"anthropic",
|
|
149
|
+
"ollama"
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
"aiModel": {
|
|
153
|
+
"type": "string"
|
|
154
|
+
},
|
|
155
|
+
"aiBaseUrl": {
|
|
156
|
+
"type": "string"
|
|
157
|
+
},
|
|
158
|
+
"geminiApiKey": {
|
|
159
|
+
"type": "string"
|
|
160
|
+
},
|
|
161
|
+
"openaiApiKey": {
|
|
162
|
+
"type": "string"
|
|
163
|
+
},
|
|
164
|
+
"anthropicApiKey": {
|
|
165
|
+
"type": "string"
|
|
166
|
+
},
|
|
167
|
+
"enableSelfHealing": {
|
|
168
|
+
"type": "boolean",
|
|
169
|
+
"default": true
|
|
170
|
+
},
|
|
171
|
+
"buildCleanupDays": {
|
|
172
|
+
"type": "number",
|
|
173
|
+
"default": 30
|
|
174
|
+
},
|
|
175
|
+
"buildCleanupMaxCount": {
|
|
176
|
+
"type": "number",
|
|
177
|
+
"default": 100
|
|
178
|
+
},
|
|
179
|
+
"buildCleanupSchedule": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"default": "0 0 * * *"
|
|
182
|
+
},
|
|
183
|
+
"deleteBuildAssets": {
|
|
184
|
+
"type": "boolean",
|
|
185
|
+
"default": true
|
|
186
|
+
},
|
|
187
|
+
"sessionHeartbeatIntervalMs": {
|
|
188
|
+
"type": "number",
|
|
189
|
+
"default": 30000
|
|
190
|
+
},
|
|
191
|
+
"enableJsonLogging": {
|
|
192
|
+
"type": "boolean",
|
|
193
|
+
"default": false
|
|
194
|
+
},
|
|
195
|
+
"tlsRejectUnauthorized": {
|
|
196
|
+
"type": "boolean",
|
|
197
|
+
"default": true,
|
|
198
|
+
"description": "Whether to verify TLS certificates for internal outgoing requests. Default is true. Set to false only for dev/test."
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"required": [
|
|
202
|
+
"platform",
|
|
203
|
+
"androidDeviceType",
|
|
204
|
+
"iosDeviceType",
|
|
205
|
+
"skipChromeDownload",
|
|
206
|
+
"maxSessions",
|
|
207
|
+
"deviceAvailabilityTimeoutMs",
|
|
208
|
+
"deviceAvailabilityQueryIntervalMs",
|
|
209
|
+
"sendNodeDevicesToHubIntervalMs",
|
|
210
|
+
"checkStaleDevicesIntervalMs",
|
|
211
|
+
"checkBlockedDevicesIntervalMs",
|
|
212
|
+
"newCommandTimeoutSec",
|
|
213
|
+
"bindHostOrIp",
|
|
214
|
+
"enableDashboard",
|
|
215
|
+
"bootedSimulators",
|
|
216
|
+
"removeDevicesFromDatabaseBeforeRunningThePlugin",
|
|
217
|
+
"healthCheckIntervalMs",
|
|
218
|
+
"enableSelfHealing",
|
|
219
|
+
"buildCleanupDays",
|
|
220
|
+
"buildCleanupMaxCount",
|
|
221
|
+
"buildCleanupSchedule",
|
|
222
|
+
"deleteBuildAssets",
|
|
223
|
+
"sessionHeartbeatIntervalMs",
|
|
224
|
+
"enableJsonLogging"
|
|
225
|
+
],
|
|
226
|
+
"title": "IPluginArgs",
|
|
227
|
+
"type": "object",
|
|
228
|
+
"definitions": {
|
|
229
|
+
"AxiosProxy": {
|
|
230
|
+
"type": "object",
|
|
231
|
+
"title": "AxiosProxy",
|
|
232
|
+
"properties": {
|
|
233
|
+
"host": {
|
|
234
|
+
"type": "string"
|
|
235
|
+
},
|
|
236
|
+
"port": {
|
|
237
|
+
"type": "integer"
|
|
238
|
+
},
|
|
239
|
+
"protocol": {
|
|
240
|
+
"type": "string",
|
|
241
|
+
"enum": [
|
|
242
|
+
"http",
|
|
243
|
+
"https"
|
|
244
|
+
]
|
|
245
|
+
},
|
|
246
|
+
"auth": {
|
|
247
|
+
"type": "object"
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"additionalProperties": true,
|
|
251
|
+
"description": "Proxy configuration object. Contains 'host', 'port', 'auth', 'protocol'."
|
|
252
|
+
},
|
|
253
|
+
"CloudConfig": {
|
|
254
|
+
"type": "object",
|
|
255
|
+
"title": "CloudConfig",
|
|
256
|
+
"additionalProperties": false,
|
|
257
|
+
"description": "Cloud configuration object. Should be provided via config file.",
|
|
258
|
+
"properties": {
|
|
259
|
+
"cloudName": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"description": "Name of the cloud provider (e.g. browserstack, saucelabs, pcloudy, lambdatest)"
|
|
262
|
+
},
|
|
263
|
+
"url": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"format": "uri",
|
|
266
|
+
"description": "URL of the cloud provider hub"
|
|
267
|
+
},
|
|
268
|
+
"apiKey": {
|
|
269
|
+
"type": "string",
|
|
270
|
+
"description": "API Key for the cloud provider"
|
|
271
|
+
},
|
|
272
|
+
"apiUrl": {
|
|
273
|
+
"type": "string",
|
|
274
|
+
"format": "uri",
|
|
275
|
+
"description": "API URL for the cloud provider"
|
|
276
|
+
},
|
|
277
|
+
"devices": {
|
|
278
|
+
"type": "array",
|
|
279
|
+
"items": {
|
|
280
|
+
"$ref": "#/definitions/CloudDevice"
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
"required": [
|
|
285
|
+
"cloudName",
|
|
286
|
+
"url",
|
|
287
|
+
"apiKey",
|
|
288
|
+
"devices"
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
"CloudDevice": {
|
|
292
|
+
"type": "object",
|
|
293
|
+
"title": "CloudDevice",
|
|
294
|
+
"additionalProperties": true,
|
|
295
|
+
"description": "Device configuration object",
|
|
296
|
+
"properties": {
|
|
297
|
+
"deviceName": {
|
|
298
|
+
"type": "string"
|
|
299
|
+
},
|
|
300
|
+
"platform": {
|
|
301
|
+
"type": "string"
|
|
302
|
+
},
|
|
303
|
+
"os_version": {
|
|
304
|
+
"type": "string"
|
|
305
|
+
},
|
|
306
|
+
"platformVersion": {
|
|
307
|
+
"type": "string"
|
|
308
|
+
},
|
|
309
|
+
"pCloudy_DeviceManufacturer": {
|
|
310
|
+
"type": "string"
|
|
311
|
+
},
|
|
312
|
+
"pCloudy_DeviceVersion": {
|
|
313
|
+
"type": "string"
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
"SimulatorConfig": {
|
|
318
|
+
"type": "object",
|
|
319
|
+
"title": "SimulatorConfig",
|
|
320
|
+
"properties": {
|
|
321
|
+
"name": {
|
|
322
|
+
"type": "string"
|
|
323
|
+
},
|
|
324
|
+
"sdk": {
|
|
325
|
+
"type": "string"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"required": [
|
|
329
|
+
"name",
|
|
330
|
+
"sdk"
|
|
331
|
+
],
|
|
332
|
+
"additionalProperties": true
|
|
333
|
+
},
|
|
334
|
+
"EmulatorConfig": {
|
|
335
|
+
"type": "object",
|
|
336
|
+
"title": "EmulatorConfig",
|
|
337
|
+
"properties": {
|
|
338
|
+
"avdName": {
|
|
339
|
+
"type": "string"
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
"required": [
|
|
343
|
+
"avdName"
|
|
344
|
+
],
|
|
345
|
+
"additionalProperties": true
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
# Xenon Build & Asset Sync
|
|
5
|
+
# Rebuilds the frontend and copies artifacts to the plugin delivery directory.
|
|
6
|
+
|
|
7
|
+
echo "🚀 Starting Xenon Production Build..."
|
|
8
|
+
|
|
9
|
+
# 1. Install & Build Web Frontend
|
|
10
|
+
cd web
|
|
11
|
+
echo "📦 Installing web dependencies..."
|
|
12
|
+
npm install
|
|
13
|
+
echo "🏗 Building web dashboard..."
|
|
14
|
+
npm run build
|
|
15
|
+
cd ..
|
|
16
|
+
|
|
17
|
+
# 2. Sync Artifacts
|
|
18
|
+
echo "🔄 Syncing build artifacts..."
|
|
19
|
+
rm -rf src/public
|
|
20
|
+
mkdir -p src/public
|
|
21
|
+
|
|
22
|
+
# Using absolute-ish path for robustness in CI
|
|
23
|
+
if [ -d "web/build" ] && [ "$(ls -A web/build)" ]; then
|
|
24
|
+
echo "📦 Copying artifacts from web/build to src/public..."
|
|
25
|
+
cp -R web/build/. src/public/
|
|
26
|
+
echo "✅ Xenon build complete."
|
|
27
|
+
else
|
|
28
|
+
echo "❌ Error: web/build directory not found or empty. Frontend build failed?"
|
|
29
|
+
ls -la web/ || true
|
|
30
|
+
ls -la web/build/ || true
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { GoogleGenerativeAI } from '@google/generative-ai';
|
|
2
|
+
import * as dotenv from 'dotenv';
|
|
3
|
+
dotenv.config();
|
|
4
|
+
|
|
5
|
+
async function debugGemini() {
|
|
6
|
+
const apiKey = process.env.GEMINI_API_KEY;
|
|
7
|
+
if (!apiKey) {
|
|
8
|
+
console.error('No GEMINI_API_KEY found in .env');
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
console.log('Testing with API Key (truncated):', apiKey.substring(0, 5) + '...');
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const genAI = new GoogleGenerativeAI(apiKey);
|
|
16
|
+
|
|
17
|
+
// Try v1 first
|
|
18
|
+
console.log('\n--- Testing v1 Endpoint ---');
|
|
19
|
+
try {
|
|
20
|
+
const modelV1 = genAI.getGenerativeModel({ model: 'gemini-1.5-flash' }, { apiVersion: 'v1' });
|
|
21
|
+
const resultV1 = await modelV1.generateContent('Hi');
|
|
22
|
+
console.log('v1 Success:', resultV1.response.text());
|
|
23
|
+
} catch (e: any) {
|
|
24
|
+
console.error('v1 Failed:', e.message);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Try v1beta
|
|
28
|
+
console.log('\n--- Testing v1beta Endpoint ---');
|
|
29
|
+
try {
|
|
30
|
+
const modelBeta = genAI.getGenerativeModel(
|
|
31
|
+
{ model: 'gemini-1.5-flash' },
|
|
32
|
+
{ apiVersion: 'v1beta' },
|
|
33
|
+
);
|
|
34
|
+
const resultBeta = await modelBeta.generateContent('Hi');
|
|
35
|
+
console.log('v1beta Success:', resultBeta.response.text());
|
|
36
|
+
} catch (e: any) {
|
|
37
|
+
console.error('v1beta Failed:', e.message);
|
|
38
|
+
}
|
|
39
|
+
} catch (err: any) {
|
|
40
|
+
console.error('Debug failed:', err.message);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
debugGemini();
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const { compileFromFile } = require('json-schema-to-typescript');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
async function generate() {
|
|
6
|
+
const schemaPath = path.join(__dirname, '../schema.json');
|
|
7
|
+
const outputPath = path.join(__dirname, '../src/interfaces/IPluginArgs.ts');
|
|
8
|
+
|
|
9
|
+
console.log(`Generating types from ${schemaPath}...`);
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
const schema = JSON.parse(fs.readFileSync(schemaPath, 'utf8'));
|
|
13
|
+
|
|
14
|
+
// Inject strict definitions into properties for type generation only.
|
|
15
|
+
// This keeps the runtime schema.json simple and compatible with Appium's CLI flattener.
|
|
16
|
+
schema.properties.cloud = { '$ref': '#/definitions/CloudConfig' };
|
|
17
|
+
schema.properties.proxy = { '$ref': '#/definitions/AxiosProxy' };
|
|
18
|
+
|
|
19
|
+
const { compile } = require('json-schema-to-typescript');
|
|
20
|
+
const ts = await compile(schema, 'IPluginArgs', {
|
|
21
|
+
bannerComment: `/* eslint-disable */
|
|
22
|
+
/**
|
|
23
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
24
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
25
|
+
* and run "npm run build:schema" to regenerate this file.
|
|
26
|
+
*/
|
|
27
|
+
import ip from 'ip';`,
|
|
28
|
+
style: {
|
|
29
|
+
singleQuote: true,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const defaultArgs = `
|
|
34
|
+
export const DefaultPluginArgs: IPluginArgs = {
|
|
35
|
+
platform: 'both',
|
|
36
|
+
iosDeviceType: 'both',
|
|
37
|
+
androidDeviceType: 'both',
|
|
38
|
+
skipChromeDownload: true,
|
|
39
|
+
hub: undefined,
|
|
40
|
+
maxSessions: 8,
|
|
41
|
+
derivedDataPath: undefined,
|
|
42
|
+
adbRemote: [],
|
|
43
|
+
remoteMachineProxyIP: undefined,
|
|
44
|
+
proxy: undefined,
|
|
45
|
+
emulators: [],
|
|
46
|
+
simulators: [],
|
|
47
|
+
deviceAvailabilityTimeoutMs: 300000,
|
|
48
|
+
deviceAvailabilityQueryIntervalMs: 10000,
|
|
49
|
+
sendNodeDevicesToHubIntervalMs: 30000,
|
|
50
|
+
checkStaleDevicesIntervalMs: 30000,
|
|
51
|
+
checkBlockedDevicesIntervalMs: 30000,
|
|
52
|
+
newCommandTimeoutSec: 60,
|
|
53
|
+
cloud: undefined,
|
|
54
|
+
bindHostOrIp: ip.address(),
|
|
55
|
+
enableDashboard: false,
|
|
56
|
+
bootedSimulators: false,
|
|
57
|
+
healthCheckIntervalMs: 86400000,
|
|
58
|
+
healthCheckSchedule: undefined,
|
|
59
|
+
removeDevicesFromDatabaseBeforeRunningThePlugin: false,
|
|
60
|
+
databaseProvider: undefined,
|
|
61
|
+
databaseUrl: undefined,
|
|
62
|
+
aiProvider: undefined,
|
|
63
|
+
aiModel: undefined,
|
|
64
|
+
aiBaseUrl: undefined,
|
|
65
|
+
geminiApiKey: undefined,
|
|
66
|
+
openaiApiKey: undefined,
|
|
67
|
+
anthropicApiKey: undefined,
|
|
68
|
+
enableSelfHealing: true,
|
|
69
|
+
buildCleanupDays: 30,
|
|
70
|
+
buildCleanupMaxCount: 100,
|
|
71
|
+
buildCleanupSchedule: '0 0 * * *',
|
|
72
|
+
deleteBuildAssets: true,
|
|
73
|
+
sessionHeartbeatIntervalMs: 30000,
|
|
74
|
+
enableJsonLogging: false,
|
|
75
|
+
};
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
fs.writeFileSync(outputPath, ts + defaultArgs);
|
|
79
|
+
console.log(`Successfully generated types at ${outputPath}`);
|
|
80
|
+
} catch (e) {
|
|
81
|
+
console.error('Error generating types:', e);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
generate();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execSync } = require('child_process');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const semver = require('semver');
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
console.log('Detecting Appium server version...');
|
|
9
|
+
// Prefer local appium CLI if available, else fall back to global 'appium'
|
|
10
|
+
const localAppium = path.resolve(__dirname, '..', 'node_modules', '.bin', 'appium');
|
|
11
|
+
const appiumCmd = fs.existsSync(localAppium) ? localAppium : 'appium';
|
|
12
|
+
const versionRaw = execSync(`${appiumCmd} --version`, { encoding: 'utf8' }).trim();
|
|
13
|
+
// appium --version returns something like "2.4.1" or "3.0.0-rc.2"
|
|
14
|
+
const version = semver.coerce(versionRaw);
|
|
15
|
+
if (!version) {
|
|
16
|
+
console.error('Unable to parse Appium version:', versionRaw);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const major = version.major;
|
|
21
|
+
console.log('Appium server version detected:', version.raw);
|
|
22
|
+
|
|
23
|
+
let driverToInstall = 'xcuitest@5.14.0';
|
|
24
|
+
if (major >= 3) {
|
|
25
|
+
console.log('Appium 3.x detected; installing latest compatible xcuitest driver');
|
|
26
|
+
driverToInstall = 'xcuitest';
|
|
27
|
+
} else {
|
|
28
|
+
console.log(
|
|
29
|
+
'Appium 2.x detected; installing xcuitest driver compatible with Appium 2.4.1 (5.14.0)',
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const cmd = `${appiumCmd} driver install ${driverToInstall}`;
|
|
34
|
+
console.log('Running:', cmd);
|
|
35
|
+
execSync(cmd, { stdio: 'inherit' });
|
|
36
|
+
} catch (err) {
|
|
37
|
+
console.error('Failed to install driver:', err.message);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|