@anuraghq/mobius 0.0.0-stage → 0.1.1
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/LICENSE +202 -0
- package/README.md +371 -2
- package/bin/mobiusagent-driver-darwin-arm64 +0 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +151 -0
- package/dist/core/protocol.d.ts +294 -0
- package/dist/core/protocol.js +82 -0
- package/dist/execution/connector.d.ts +82 -0
- package/dist/execution/connector.js +11 -0
- package/dist/execution/drivers/mobiusagent.d.ts +57 -0
- package/dist/execution/drivers/mobiusagent.js +165 -0
- package/dist/execution/drivers/nodes.d.ts +47 -0
- package/dist/execution/drivers/nodes.js +104 -0
- package/dist/execution/observe.d.ts +48 -0
- package/dist/execution/observe.js +246 -0
- package/dist/execution/session.d.ts +112 -0
- package/dist/execution/session.js +328 -0
- package/dist/infrastructure/plane.d.ts +25 -0
- package/dist/infrastructure/plane.js +16 -0
- package/dist/infrastructure/registry.d.ts +19 -0
- package/dist/infrastructure/registry.js +49 -0
- package/dist/interface/engine.d.ts +24 -0
- package/dist/interface/engine.js +38 -0
- package/dist/interface/http.d.ts +4 -0
- package/dist/interface/http.js +85 -0
- package/dist/interface/mcp.d.ts +21 -0
- package/dist/interface/mcp.js +378 -0
- package/dist/interface/mobius-tools.d.ts +10 -0
- package/dist/interface/mobius-tools.js +328 -0
- package/dist/observability/audit.d.ts +52 -0
- package/dist/observability/audit.js +98 -0
- package/dist/observability/signing.d.ts +37 -0
- package/dist/observability/signing.js +87 -0
- package/dist/policy/policy.d.ts +147 -0
- package/dist/policy/policy.js +347 -0
- package/ios-agent/brand.py +62 -0
- package/ios-agent/brand.sh +19 -0
- package/ios-agent/setup.sh +32 -0
- package/ios-agent/wda-mobius-fast-touch.patch +73 -0
- package/package.json +49 -4
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
diff --git a/WebDriverAgentLib/Commands/FBCustomCommands.m b/WebDriverAgentLib/Commands/FBCustomCommands.m
|
|
2
|
+
index 97ecfbc..9a71636 100644
|
|
3
|
+
--- a/WebDriverAgentLib/Commands/FBCustomCommands.m
|
|
4
|
+
+++ b/WebDriverAgentLib/Commands/FBCustomCommands.m
|
|
5
|
+
@@ -31,6 +31,9 @@
|
|
6
|
+
#import "XCUIElement+FBIsVisible.h"
|
|
7
|
+
#import "XCUIElementQuery.h"
|
|
8
|
+
#import "FBUnattachedAppLauncher.h"
|
|
9
|
+
+#import "FBXCTestDaemonsProxy.h"
|
|
10
|
+
+#import "XCPointerEventPath.h"
|
|
11
|
+
+#import "XCSynthesizedEventRecord.h"
|
|
12
|
+
|
|
13
|
+
@implementation FBCustomCommands
|
|
14
|
+
|
|
15
|
+
@@ -39,6 +42,9 @@
|
|
16
|
+
return
|
|
17
|
+
@[
|
|
18
|
+
[[FBRoute POST:@"/timeouts"] respondWithTarget:self action:@selector(handleTimeouts:)],
|
|
19
|
+
+ // Mobius fast touch: one raw event straight to the event synthesizer. No app lookup, no wait-for-stable.
|
|
20
|
+
+ [[FBRoute POST:@"/mobius/tap"].withoutSession respondWithTarget:self action:@selector(handleMobiusTap:)],
|
|
21
|
+
+ [[FBRoute POST:@"/mobius/swipe"].withoutSession respondWithTarget:self action:@selector(handleMobiusSwipe:)],
|
|
22
|
+
[[FBRoute POST:@"/wda/homescreen"].withoutSession respondWithTarget:self action:@selector(handleHomescreenCommand:)],
|
|
23
|
+
[[FBRoute POST:@"/wda/deactivateApp"] respondWithTarget:self action:@selector(handleDeactivateAppCommand:)],
|
|
24
|
+
[[FBRoute POST:@"/wda/keyboard/dismiss"] respondWithTarget:self action:@selector(handleDismissKeyboardCommand:)],
|
|
25
|
+
@@ -134,6 +140,48 @@
|
|
26
|
+
|
|
27
|
+
#pragma mark - Helpers
|
|
28
|
+
|
|
29
|
+
+#pragma mark - Mobius fast touch
|
|
30
|
+
+
|
|
31
|
+
+static UIInterfaceOrientation FBMobiusOrientation(NSDictionary *args)
|
|
32
|
+
+{
|
|
33
|
+
+ NSString *o = args[@"orientation"];
|
|
34
|
+
+ if ([o isEqualToString:@"landscape_left"]) return UIInterfaceOrientationLandscapeLeft;
|
|
35
|
+
+ if ([o isEqualToString:@"landscape_right"]) return UIInterfaceOrientationLandscapeRight;
|
|
36
|
+
+ if ([o isEqualToString:@"upside_down"]) return UIInterfaceOrientationPortraitUpsideDown;
|
|
37
|
+
+ return UIInterfaceOrientationPortrait;
|
|
38
|
+
+}
|
|
39
|
+
+
|
|
40
|
+
+static id<FBResponsePayload> FBMobiusSynthesize(XCPointerEventPath *path, NSDictionary *args)
|
|
41
|
+
+{
|
|
42
|
+
+ XCSynthesizedEventRecord *record = [[XCSynthesizedEventRecord alloc] initWithName:@"Mobius touch"
|
|
43
|
+
+ interfaceOrientation:FBMobiusOrientation(args)];
|
|
44
|
+
+ [record addPointerEventPath:path];
|
|
45
|
+
+ NSError *error;
|
|
46
|
+
+ if (![FBXCTestDaemonsProxy synthesizeEventWithRecord:record error:&error]) {
|
|
47
|
+
+ return FBResponseWithUnknownError(error);
|
|
48
|
+
+ }
|
|
49
|
+
+ return FBResponseWithOK();
|
|
50
|
+
+}
|
|
51
|
+
+
|
|
52
|
+
++ (id<FBResponsePayload>)handleMobiusTap:(FBRouteRequest *)request
|
|
53
|
+
+{
|
|
54
|
+
+ CGPoint p = CGPointMake([request.arguments[@"x"] doubleValue], [request.arguments[@"y"] doubleValue]);
|
|
55
|
+
+ double hold = request.arguments[@"hold"] ? [request.arguments[@"hold"] doubleValue] : 0.05;
|
|
56
|
+
+ XCPointerEventPath *path = [[XCPointerEventPath alloc] initForTouchAtPoint:p offset:0];
|
|
57
|
+
+ [path liftUpAtOffset:hold];
|
|
58
|
+
+ return FBMobiusSynthesize(path, request.arguments);
|
|
59
|
+
+}
|
|
60
|
+
+
|
|
61
|
+
++ (id<FBResponsePayload>)handleMobiusSwipe:(FBRouteRequest *)request
|
|
62
|
+
+{
|
|
63
|
+
+ NSDictionary *a = request.arguments;
|
|
64
|
+
+ double duration = a[@"duration"] ? [a[@"duration"] doubleValue] : 0.2;
|
|
65
|
+
+ XCPointerEventPath *path = [[XCPointerEventPath alloc] initForTouchAtPoint:CGPointMake([a[@"x1"] doubleValue], [a[@"y1"] doubleValue]) offset:0];
|
|
66
|
+
+ [path moveToPoint:CGPointMake([a[@"x2"] doubleValue], [a[@"y2"] doubleValue]) atOffset:duration];
|
|
67
|
+
+ [path liftUpAtOffset:duration + 0.01];
|
|
68
|
+
+ return FBMobiusSynthesize(path, a);
|
|
69
|
+
+}
|
|
70
|
+
+
|
|
71
|
+
+ (id<FBResponsePayload>)handleGetScreen:(FBRouteRequest *)request
|
|
72
|
+
{
|
|
73
|
+
XCUIApplication *app = XCUIApplication.fb_systemApplication;
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anuraghq/mobius",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Let AI agents use a real phone, safely. MCP server + its own fast device driver for Android, iPhones and iOS simulators: 75 tools, approvals, policy, masking, signed audit, performance and accessibility reports.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"mobius": "dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"bin",
|
|
13
|
+
"ios-agent",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=22.5"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"mcp",
|
|
22
|
+
"model-context-protocol",
|
|
23
|
+
"android",
|
|
24
|
+
"ios",
|
|
25
|
+
"iphone",
|
|
26
|
+
"simulator",
|
|
27
|
+
"emulator",
|
|
28
|
+
"mobile",
|
|
29
|
+
"ai-agent",
|
|
30
|
+
"agent-safety",
|
|
31
|
+
"claude",
|
|
32
|
+
"automation",
|
|
33
|
+
"testing",
|
|
34
|
+
"qa",
|
|
35
|
+
"performance",
|
|
36
|
+
"accessibility"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
40
|
+
"prepack": "npm run build && node scripts/prepack.mjs"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"repository": "github:Anu-Code07/mobius",
|
|
46
|
+
"homepage": "https://github.com/Anu-Code07/mobius#readme",
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@modelcontextprotocol/sdk": "^1.32.0",
|
|
49
|
+
"zod": "^4.1.0"
|
|
50
|
+
}
|
|
51
|
+
}
|