devicely 2.3.3 → 2.3.5
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 +168 -249
- package/bin/devicely.js +1 -1
- package/config/apps_presets.conf +19 -0
- package/lib/actionSchema.js +1 -0
- package/lib/advanced-logger.js +1 -1
- package/lib/aiProviders.js +1 -1
- package/lib/aiProvidersConfig.js +1 -1
- package/lib/androidDeviceDetection.js +1 -1
- package/lib/api/v1/auth.js +1 -0
- package/lib/api/v1/deviceResolver.js +1 -0
- package/lib/api/v1/index.js +1 -0
- package/lib/api/v1/operations.js +1 -0
- package/lib/api/v1/passcode.js +1 -0
- package/lib/api/v1/resultNormalizer.js +1 -0
- package/lib/api/v1/screenCapture.js +1 -0
- package/lib/api/v1/uiTree.js +1 -0
- package/lib/appListing.js +1 -0
- package/lib/appMappings.js +1 -1
- package/lib/cognitiveLocator.js +1 -1
- package/lib/commanderService.js +1 -1
- package/lib/deviceContextProvider.js +1 -0
- package/lib/deviceDetection.js +1 -1
- package/lib/deviceDriver.js +1 -0
- package/lib/deviceHealthMonitor.js +1 -0
- package/lib/devices.js +1 -1
- package/lib/doctor.js +1 -1
- package/lib/encryption.js +1 -1
- package/lib/executor.js +1 -1
- package/lib/frontend/asset-manifest.json +5 -7
- package/lib/frontend/index.html +1 -1
- package/lib/frontend/static/js/main.bd89f5ef.js +2 -0
- package/lib/hybridAI.js +1 -1
- package/lib/intelligentLocatorService.js +1 -1
- package/lib/lightweightAI.js +1 -1
- package/lib/localBuiltInAI.js +1 -1
- package/lib/localBuiltInAI_backup.js +1 -1
- package/lib/localBuiltInAI_simple.js +1 -1
- package/lib/locatorStrategy.js +1 -1
- package/lib/logger.js +1 -1
- package/lib/mcp/audit.js +1 -0
- package/lib/mcp/client.js +1 -0
- package/lib/mcp/clientConfigs.js +1 -0
- package/lib/mcp/format.js +1 -0
- package/lib/mcp/http.js +1 -0
- package/lib/mcp/index.js +1 -0
- package/lib/mcp/policy.js +1 -0
- package/lib/mcp/prompts.js +1 -0
- package/lib/mcp/resources.js +1 -0
- package/lib/mcp/schemas.js +1 -0
- package/lib/mcp/stdio.js +3 -0
- package/lib/mcp/tools/act.js +1 -0
- package/lib/mcp/tools/apps.js +1 -0
- package/lib/mcp/tools/devices.js +1 -0
- package/lib/mcp/tools/diagnostics.js +1 -0
- package/lib/mcp/tools/flow.js +1 -0
- package/lib/mcp/tools/multi.js +1 -0
- package/lib/mcp/tools/observe.js +1 -0
- package/lib/mcp/tools/recordings.js +1 -0
- package/lib/mjpegStream.js +1 -0
- package/lib/package.json +9 -1
- package/lib/quick-start-logger.js +1 -1
- package/lib/recordingSteps.js +1 -0
- package/lib/recordingStore.js +1 -0
- package/lib/replayEngine.js +1 -0
- package/lib/scriptLoader.js +1 -1
- package/lib/server.js +1 -1
- package/lib/tensorflowAI.js +1 -1
- package/lib/tinyAI.js +1 -1
- package/lib/universalSessionManager.js +1 -1
- package/lib/virtualDevices/androidEmulatorProvider.js +1 -0
- package/lib/virtualDevices/index.js +1 -0
- package/lib/virtualDevices/iosSimulatorCommands.js +1 -0
- package/lib/virtualDevices/iosSimulatorProvider.js +1 -0
- package/lib/virtualDevices/parsers.js +1 -0
- package/lib/virtualDevices/ports.js +1 -0
- package/lib/virtualDevices/toolchain.js +1 -0
- package/lib/virtualDevices/wdaSimulator.js +1 -0
- package/package.json +8 -14
- package/scripts/shell/android_device_control.enc +1 -1
- package/scripts/shell/connect_android_usb_multi_final.enc +1 -1
- package/scripts/shell/connect_ios_usb_multi_final.enc +1 -1
- package/scripts/shell/connect_ios_wireless_multi_final.enc +1 -1
- package/lib/.env.example +0 -20
- package/lib/aiProviders.js.strategic-backup +0 -657
- package/lib/devices.js.strategic-backup +0 -57
- package/lib/encryption.js.strategic-backup +0 -61
- package/lib/eslint.config.js +0 -1
- package/lib/executor.js.strategic-backup +0 -107
- package/lib/frontend/static/css/main.ed39ba12.css +0 -2
- package/lib/frontend/static/js/main.bb9425de.js +0 -3
- package/lib/jest.config.js +0 -1
- package/lib/logger-demo.js +0 -2
- package/lib/logger-integration-examples.js +0 -102
- package/lib/public/asset-manifest.json +0 -13
- package/lib/public/index.html +0 -1
- package/lib/public/static/css/main.ed39ba12.css +0 -2
- package/lib/public/voice-test.html +0 -156
- package/lib/server.js.strategic-backup +0 -6298
- package/lib/tensorflowAI.js.strategic-backup +0 -717
- package/lib/tests/__mocks__/logger.js +0 -12
- package/lib/tests/integration/deviceSync.test.js +0 -74
- package/lib/tests/setup/testSetup.js +0 -1
- package/lib/tests/unit/commanderService.test.js +0 -70
- package/lib/tsconfig.json +0 -18
- /package/lib/{public → frontend}/static/css/main.1bbcfef2.css +0 -0
- /package/lib/frontend/static/js/{main.bb9425de.js.LICENSE.txt → main.bd89f5ef.js.LICENSE.txt} +0 -0
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const axios = require('axios');
|
|
2
|
-
const CommanderService = require('../../commanderService');
|
|
3
|
-
|
|
4
|
-
// Need to mock default export properly for CommonJS
|
|
5
|
-
jest.mock('axios', () => {
|
|
6
|
-
return {
|
|
7
|
-
post: jest.fn(),
|
|
8
|
-
get: jest.fn(),
|
|
9
|
-
delete: jest.fn()
|
|
10
|
-
};
|
|
11
|
-
});
|
|
12
|
-
jest.mock('../../logger');
|
|
13
|
-
|
|
14
|
-
describe('Device Sync Integration', () => {
|
|
15
|
-
let commander;
|
|
16
|
-
let mockWss;
|
|
17
|
-
let mockConnectedDevices;
|
|
18
|
-
|
|
19
|
-
beforeEach(() => {
|
|
20
|
-
mockWss = {
|
|
21
|
-
clients: new Set(),
|
|
22
|
-
// mock broadcast implementation
|
|
23
|
-
};
|
|
24
|
-
mockConnectedDevices = [
|
|
25
|
-
{ name: 'LeaderDevice', udid: 'L1', platform: 'ios', port: 8100 },
|
|
26
|
-
{ name: 'Follower1', udid: 'F1', platform: 'ios', port: 8101 },
|
|
27
|
-
{ name: 'Follower2', udid: 'F2', platform: 'android', port: 8102 }
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
global.sessionManager = {
|
|
31
|
-
getByName: jest.fn((name) => {
|
|
32
|
-
const dev = mockConnectedDevices.find(d => d.name === name);
|
|
33
|
-
if (dev && dev.platform === 'ios') {
|
|
34
|
-
return { sessionId: 'mock-session-id', port: dev.port };
|
|
35
|
-
}
|
|
36
|
-
return null;
|
|
37
|
-
})
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
commander = new CommanderService(mockWss, mockConnectedDevices);
|
|
41
|
-
|
|
42
|
-
// Silence some expected console errors during tests
|
|
43
|
-
jest.spyOn(console, 'error').mockImplementation(() => {});
|
|
44
|
-
jest.spyOn(console, 'log').mockImplementation(() => {});
|
|
45
|
-
jest.spyOn(console, 'warn').mockImplementation(() => {});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
afterEach(() => {
|
|
49
|
-
jest.restoreAllMocks();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('should recover from network drop using exponential backoff', async () => {
|
|
53
|
-
commander.commanderDevice = mockConnectedDevices[0];
|
|
54
|
-
const follower = mockConnectedDevices[1];
|
|
55
|
-
// Erase global session to trigger /status lookup loop
|
|
56
|
-
follower.sessionId = undefined;
|
|
57
|
-
follower.wdaSessionId = undefined;
|
|
58
|
-
commander.connectedDevices = [];
|
|
59
|
-
|
|
60
|
-
let attempts = 0;
|
|
61
|
-
require('axios').get.mockImplementation(async () => {
|
|
62
|
-
attempts++;
|
|
63
|
-
if (attempts < 3) throw new Error('ECONNREFUSED');
|
|
64
|
-
return { data: { sessionId: 'mock-recovered-id' } };
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
await commander._executeOnFollowerWithLocators(follower, {}, 0, 0);
|
|
68
|
-
expect(attempts).toBeGreaterThan(1);
|
|
69
|
-
|
|
70
|
-
// Verify error catching allows graceful exit and won't crash process
|
|
71
|
-
attempts = 0;
|
|
72
|
-
await expect(commander._executeOnFollowerWithLocators(follower, {}, 0, 0)).resolves.not.toThrow();
|
|
73
|
-
}, 20000);
|
|
74
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
jest.mock('../../logger', () => require('../__mocks__/logger'));
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
const CommanderService = require('../../commanderService');
|
|
2
|
-
|
|
3
|
-
// Mock out heavy dependencies
|
|
4
|
-
jest.mock('child_process');
|
|
5
|
-
jest.mock('axios');
|
|
6
|
-
jest.mock('../../locatorStrategy');
|
|
7
|
-
jest.mock('../../logger');
|
|
8
|
-
|
|
9
|
-
describe('CommanderService', () => {
|
|
10
|
-
let commander;
|
|
11
|
-
let mockWss;
|
|
12
|
-
let mockConnectedDevices;
|
|
13
|
-
|
|
14
|
-
beforeEach(() => {
|
|
15
|
-
mockWss = {
|
|
16
|
-
clients: new Set(),
|
|
17
|
-
removeListener: jest.fn(),
|
|
18
|
-
removeAllListeners: jest.fn()
|
|
19
|
-
};
|
|
20
|
-
mockConnectedDevices = [];
|
|
21
|
-
|
|
22
|
-
// Setup a clean instance for each test
|
|
23
|
-
commander = new CommanderService(mockWss, mockConnectedDevices);
|
|
24
|
-
|
|
25
|
-
// Add global session manager mock
|
|
26
|
-
global.sessionManager = {
|
|
27
|
-
getByName: jest.fn(),
|
|
28
|
-
getSessionByDeviceName: jest.fn()
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
afterEach(() => {
|
|
33
|
-
jest.clearAllMocks();
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
describe('Connection Management', () => {
|
|
37
|
-
it('should dispose resources cleanly via dispose()', () => {
|
|
38
|
-
commander.isActive = true;
|
|
39
|
-
commander.followerDevices.add({name: 'test_follower', platform: 'ios'});
|
|
40
|
-
commander.eventQueue.push({ type: 'test' });
|
|
41
|
-
|
|
42
|
-
// Setup fake intervals
|
|
43
|
-
commander.screenStreamInterval = setInterval(() => {}, 1000);
|
|
44
|
-
commander.touchMonitorInterval = setInterval(() => {}, 1000);
|
|
45
|
-
|
|
46
|
-
commander.dispose();
|
|
47
|
-
|
|
48
|
-
expect(commander.isActive).toBe(false);
|
|
49
|
-
expect(commander.followerDevices.size).toBe(0);
|
|
50
|
-
expect(commander.eventQueue.length).toBe(0);
|
|
51
|
-
expect(commander.screenStreamInterval).toBeNull();
|
|
52
|
-
expect(commander.touchMonitorInterval).toBeNull();
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('should reject invalid bounds for elements', () => {
|
|
56
|
-
expect(commander.isElementInteractive('Button', { width: 0, height: 10, x: 10, y: 10 }, 'test')).toBe(false);
|
|
57
|
-
expect(commander.isElementInteractive('Button', { width: 10, height: 10, x: -5, y: 10 }, 'test')).toBe(false);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('should handle device drop gracefully clearing connected references', () => {
|
|
61
|
-
commander.isActive = true;
|
|
62
|
-
commander.commanderDevice = { name: 'Device1', platform: 'ios' };
|
|
63
|
-
commander.followerDevices.add({name: 'Device2', platform: 'ios'});
|
|
64
|
-
|
|
65
|
-
commander.removeFollower('Device2');
|
|
66
|
-
|
|
67
|
-
expect(commander.followerDevices.size).toBe(0);
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
});
|
package/lib/tsconfig.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2022",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"lib": ["es2022", "DOM"],
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
"rootDir": "../../",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"noImplicitAny": true,
|
|
13
|
-
"resolveJsonModule": true,
|
|
14
|
-
"allowJs": true
|
|
15
|
-
},
|
|
16
|
-
"include": ["**/*.js"],
|
|
17
|
-
"exclude": ["node_modules", "dist", "*.strategic-backup", "logger-integration-examples.js"]
|
|
18
|
-
}
|
|
File without changes
|
/package/lib/frontend/static/js/{main.bb9425de.js.LICENSE.txt → main.bd89f5ef.js.LICENSE.txt}
RENAMED
|
File without changes
|