simvyn 2.6.3 → 2.6.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 +3 -2
- package/dist/dashboard/assets/{index-QWG80lyd.js → index-By3-ogT3.js} +212 -106
- package/dist/dashboard/assets/index-By3-ogT3.js.map +1 -0
- package/dist/dashboard/assets/{index-CdpK-4e0.css → index-DkqAjveq.css} +8 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/index.js +167 -5
- package/package.json +1 -1
- package/dist/dashboard/assets/index-QWG80lyd.js.map +0 -1
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
}
|
|
39
39
|
</style>
|
|
40
40
|
<title>simvyn</title>
|
|
41
|
-
<script type="module" crossorigin src="/assets/index-
|
|
42
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
41
|
+
<script type="module" crossorigin src="/assets/index-By3-ogT3.js"></script>
|
|
42
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DkqAjveq.css">
|
|
43
43
|
</head>
|
|
44
44
|
<body>
|
|
45
45
|
<div id="root"></div>
|
package/dist/index.js
CHANGED
|
@@ -513,9 +513,60 @@ function createAndroidAdapter() {
|
|
|
513
513
|
enabled ? "1" : "0"
|
|
514
514
|
]);
|
|
515
515
|
},
|
|
516
|
+
async setOrientation(deviceId, orientation) {
|
|
517
|
+
if (deviceId.startsWith("avd:"))
|
|
518
|
+
throw new Error("Device must be booted for orientation operations");
|
|
519
|
+
const map = {
|
|
520
|
+
portrait: "0",
|
|
521
|
+
"landscape-left": "1",
|
|
522
|
+
"portrait-upside-down": "2",
|
|
523
|
+
"landscape-right": "3"
|
|
524
|
+
};
|
|
525
|
+
const value = map[orientation];
|
|
526
|
+
if (!value && !["0", "1", "2", "3"].includes(orientation))
|
|
527
|
+
throw new Error(
|
|
528
|
+
`Invalid orientation: ${orientation}. Use: portrait, landscape-left, landscape-right, portrait-upside-down`
|
|
529
|
+
);
|
|
530
|
+
const rotation = value ?? orientation;
|
|
531
|
+
await verboseExec("adb", [
|
|
532
|
+
"-s",
|
|
533
|
+
deviceId,
|
|
534
|
+
"shell",
|
|
535
|
+
"settings",
|
|
536
|
+
"put",
|
|
537
|
+
"system",
|
|
538
|
+
"accelerometer_rotation",
|
|
539
|
+
"0"
|
|
540
|
+
]);
|
|
541
|
+
await verboseExec("adb", [
|
|
542
|
+
"-s",
|
|
543
|
+
deviceId,
|
|
544
|
+
"shell",
|
|
545
|
+
"settings",
|
|
546
|
+
"put",
|
|
547
|
+
"system",
|
|
548
|
+
"user_rotation",
|
|
549
|
+
rotation
|
|
550
|
+
]);
|
|
551
|
+
},
|
|
516
552
|
setStatusBar: void 0,
|
|
517
553
|
clearStatusBar: void 0,
|
|
518
|
-
setContentSize
|
|
554
|
+
async setContentSize(deviceId, size) {
|
|
555
|
+
if (deviceId.startsWith("avd:"))
|
|
556
|
+
throw new Error("Device must be booted to change font scale");
|
|
557
|
+
const scale = CONTENT_SIZE_TO_FONT_SCALE[size];
|
|
558
|
+
if (scale === void 0) throw new Error(`Unknown content size: ${size}`);
|
|
559
|
+
await verboseExec("adb", [
|
|
560
|
+
"-s",
|
|
561
|
+
deviceId,
|
|
562
|
+
"shell",
|
|
563
|
+
"settings",
|
|
564
|
+
"put",
|
|
565
|
+
"system",
|
|
566
|
+
"font_scale",
|
|
567
|
+
scale.toString()
|
|
568
|
+
]);
|
|
569
|
+
},
|
|
519
570
|
setIncreaseContrast: void 0,
|
|
520
571
|
async addForward(deviceId, local, remote) {
|
|
521
572
|
if (deviceId.startsWith("avd:")) throw new Error("Device must be booted for port forwarding");
|
|
@@ -698,15 +749,31 @@ function createAndroidAdapter() {
|
|
|
698
749
|
"displayOverride",
|
|
699
750
|
"batterySimulation",
|
|
700
751
|
"inputInjection",
|
|
701
|
-
"bugReport"
|
|
752
|
+
"bugReport",
|
|
753
|
+
"orientation"
|
|
702
754
|
];
|
|
703
755
|
}
|
|
704
756
|
};
|
|
705
757
|
}
|
|
758
|
+
var CONTENT_SIZE_TO_FONT_SCALE;
|
|
706
759
|
var init_android = __esm({
|
|
707
760
|
"../core/src/adapters/android.ts"() {
|
|
708
761
|
"use strict";
|
|
709
762
|
init_verbose_exec();
|
|
763
|
+
CONTENT_SIZE_TO_FONT_SCALE = {
|
|
764
|
+
"extra-small": 0.85,
|
|
765
|
+
small: 0.9,
|
|
766
|
+
medium: 1,
|
|
767
|
+
large: 1.1,
|
|
768
|
+
"extra-large": 1.2,
|
|
769
|
+
"extra-extra-large": 1.3,
|
|
770
|
+
"extra-extra-extra-large": 1.4,
|
|
771
|
+
"accessibility-medium": 1.5,
|
|
772
|
+
"accessibility-large": 1.7,
|
|
773
|
+
"accessibility-extra-large": 2,
|
|
774
|
+
"accessibility-extra-extra-large": 2.5,
|
|
775
|
+
"accessibility-extra-extra-extra-large": 3
|
|
776
|
+
};
|
|
710
777
|
}
|
|
711
778
|
});
|
|
712
779
|
|
|
@@ -1040,7 +1107,23 @@ function createIosAdapter() {
|
|
|
1040
1107
|
return null;
|
|
1041
1108
|
}
|
|
1042
1109
|
},
|
|
1043
|
-
clearAppData
|
|
1110
|
+
async clearAppData(deviceId, bundleId) {
|
|
1111
|
+
if (isPhysicalDevice(deviceId))
|
|
1112
|
+
throw new Error("Clear app data is not available on physical iOS devices");
|
|
1113
|
+
const { stdout } = await verboseExec("xcrun", [
|
|
1114
|
+
"simctl",
|
|
1115
|
+
"get_app_container",
|
|
1116
|
+
deviceId,
|
|
1117
|
+
bundleId,
|
|
1118
|
+
"data"
|
|
1119
|
+
]);
|
|
1120
|
+
const containerPath = stdout.trim();
|
|
1121
|
+
if (!containerPath) throw new Error(`No data container found for ${bundleId}`);
|
|
1122
|
+
const entries = await readdir(containerPath);
|
|
1123
|
+
await Promise.all(
|
|
1124
|
+
entries.map((entry) => rm(join2(containerPath, entry), { recursive: true, force: true }))
|
|
1125
|
+
);
|
|
1126
|
+
},
|
|
1044
1127
|
async openUrl(deviceId, url) {
|
|
1045
1128
|
if (isPhysicalDevice(deviceId)) {
|
|
1046
1129
|
await verboseExec("xcrun", [
|
|
@@ -1881,6 +1964,30 @@ var init_action_registry = __esm({
|
|
|
1881
1964
|
},
|
|
1882
1965
|
isSupported: (adapter) => !!adapter.setIncreaseContrast
|
|
1883
1966
|
},
|
|
1967
|
+
{
|
|
1968
|
+
id: "set-orientation",
|
|
1969
|
+
label: "Set Orientation",
|
|
1970
|
+
description: "Rotate the device to a specific orientation (Android only)",
|
|
1971
|
+
module: "device-settings",
|
|
1972
|
+
params: [
|
|
1973
|
+
{
|
|
1974
|
+
key: "orientation",
|
|
1975
|
+
label: "Orientation",
|
|
1976
|
+
type: "select",
|
|
1977
|
+
required: true,
|
|
1978
|
+
options: [
|
|
1979
|
+
{ label: "Portrait", value: "portrait" },
|
|
1980
|
+
{ label: "Landscape Left", value: "landscape-left" },
|
|
1981
|
+
{ label: "Landscape Right", value: "landscape-right" },
|
|
1982
|
+
{ label: "Portrait Upside Down", value: "portrait-upside-down" }
|
|
1983
|
+
]
|
|
1984
|
+
}
|
|
1985
|
+
],
|
|
1986
|
+
async execute(adapter, deviceId, params) {
|
|
1987
|
+
await adapter.setOrientation(deviceId, params.orientation);
|
|
1988
|
+
},
|
|
1989
|
+
isSupported: (adapter) => !!adapter.setOrientation
|
|
1990
|
+
},
|
|
1884
1991
|
{
|
|
1885
1992
|
id: "boot-device",
|
|
1886
1993
|
label: "Boot Device",
|
|
@@ -3544,7 +3651,7 @@ var appManagementModule = {
|
|
|
3544
3651
|
dm.stop();
|
|
3545
3652
|
}
|
|
3546
3653
|
});
|
|
3547
|
-
app.command("clear-data <device> <bundle-id>").description("Clear app data
|
|
3654
|
+
app.command("clear-data <device> <bundle-id>").description("Clear app data").action(async (deviceId, bundleId) => {
|
|
3548
3655
|
const { createAvailableAdapters: createAvailableAdapters2, createDeviceManager: createDeviceManager2 } = await Promise.resolve().then(() => (init_src(), src_exports));
|
|
3549
3656
|
const adapters = await createAvailableAdapters2();
|
|
3550
3657
|
const dm = createDeviceManager2(adapters);
|
|
@@ -5404,6 +5511,40 @@ function registerSettingsCli(program2) {
|
|
|
5404
5511
|
dm.stop();
|
|
5405
5512
|
}
|
|
5406
5513
|
});
|
|
5514
|
+
settings.command("orientation <device> <orientation>").description(
|
|
5515
|
+
"Set device orientation (portrait, landscape-left, landscape-right, portrait-upside-down)"
|
|
5516
|
+
).action(async (deviceId, orientation) => {
|
|
5517
|
+
const valid = ["portrait", "landscape-left", "landscape-right", "portrait-upside-down"];
|
|
5518
|
+
if (!valid.includes(orientation)) {
|
|
5519
|
+
console.error(`Invalid orientation: ${orientation}`);
|
|
5520
|
+
console.error(`Valid options: ${valid.join(", ")}`);
|
|
5521
|
+
process.exit(1);
|
|
5522
|
+
}
|
|
5523
|
+
const { createAvailableAdapters: createAvailableAdapters2, createDeviceManager: createDeviceManager2 } = await Promise.resolve().then(() => (init_src(), src_exports));
|
|
5524
|
+
const adapters = await createAvailableAdapters2();
|
|
5525
|
+
const dm = createDeviceManager2(adapters);
|
|
5526
|
+
try {
|
|
5527
|
+
const devices = await dm.refresh();
|
|
5528
|
+
const target = devices.find((d) => d.id === deviceId || d.id.startsWith(deviceId));
|
|
5529
|
+
if (!target) {
|
|
5530
|
+
console.error(`Device not found: ${deviceId}`);
|
|
5531
|
+
process.exit(1);
|
|
5532
|
+
}
|
|
5533
|
+
if (target.state !== "booted") {
|
|
5534
|
+
console.error("Device must be booted");
|
|
5535
|
+
process.exit(1);
|
|
5536
|
+
}
|
|
5537
|
+
const adapter = dm.getAdapter(target.platform);
|
|
5538
|
+
if (!adapter?.setOrientation) {
|
|
5539
|
+
console.error(`Orientation not supported for ${target.platform}`);
|
|
5540
|
+
process.exit(1);
|
|
5541
|
+
}
|
|
5542
|
+
await adapter.setOrientation(target.id, orientation);
|
|
5543
|
+
console.log(`Orientation set to ${orientation} on ${target.name}`);
|
|
5544
|
+
} finally {
|
|
5545
|
+
dm.stop();
|
|
5546
|
+
}
|
|
5547
|
+
});
|
|
5407
5548
|
}
|
|
5408
5549
|
function registerA11yCli(program2) {
|
|
5409
5550
|
const a11y = program2.command("a11y").description("Accessibility commands");
|
|
@@ -6526,6 +6667,25 @@ async function settingsRoutes(fastify) {
|
|
|
6526
6667
|
}
|
|
6527
6668
|
}
|
|
6528
6669
|
);
|
|
6670
|
+
fastify.post(
|
|
6671
|
+
"/orientation",
|
|
6672
|
+
async (req, reply) => {
|
|
6673
|
+
const { deviceId, orientation } = req.body;
|
|
6674
|
+
const device = fastify.deviceManager.devices.find((d) => d.id === deviceId);
|
|
6675
|
+
if (!device) return reply.status(404).send({ error: "Device not found" });
|
|
6676
|
+
if (device.state !== "booted")
|
|
6677
|
+
return reply.status(400).send({ error: "Device must be booted" });
|
|
6678
|
+
const adapter = fastify.deviceManager.getAdapter(device.platform);
|
|
6679
|
+
if (!adapter?.setOrientation)
|
|
6680
|
+
return reply.status(400).send({ error: "Orientation not supported for this platform" });
|
|
6681
|
+
try {
|
|
6682
|
+
await adapter.setOrientation(device.id, orientation);
|
|
6683
|
+
return { success: true };
|
|
6684
|
+
} catch (err) {
|
|
6685
|
+
return reply.status(500).send({ error: err.message });
|
|
6686
|
+
}
|
|
6687
|
+
}
|
|
6688
|
+
);
|
|
6529
6689
|
fastify.get("/capabilities", async (req, reply) => {
|
|
6530
6690
|
const { deviceId } = req.query;
|
|
6531
6691
|
const device = fastify.deviceManager.devices.find((d) => d.id === deviceId);
|
|
@@ -6547,6 +6707,7 @@ async function settingsRoutes(fastify) {
|
|
|
6547
6707
|
batterySimulation: !!adapter?.setBattery,
|
|
6548
6708
|
inputInjection: !!adapter?.inputTap,
|
|
6549
6709
|
bugReport: !!adapter?.collectBugReport,
|
|
6710
|
+
orientation: !!adapter?.setOrientation,
|
|
6550
6711
|
fileSystem: !isIosPhysical,
|
|
6551
6712
|
database: !isIosPhysical
|
|
6552
6713
|
};
|
|
@@ -6575,7 +6736,8 @@ var deviceSettingsModule = {
|
|
|
6575
6736
|
"displayOverride",
|
|
6576
6737
|
"batterySimulation",
|
|
6577
6738
|
"inputInjection",
|
|
6578
|
-
"bugReport"
|
|
6739
|
+
"bugReport",
|
|
6740
|
+
"orientation"
|
|
6579
6741
|
]
|
|
6580
6742
|
};
|
|
6581
6743
|
var manifest_default8 = deviceSettingsModule;
|
package/package.json
CHANGED