@midscene/ios 1.0.3-beta-20251223004639.0 → 1.0.3-beta-20251223070556.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/dist/es/bin.mjs +10 -26
- package/dist/lib/bin.js +10 -26
- package/package.json +5 -5
- package/static/index.html +1 -1
- package/static/static/js/{index.af7dda97.js → index.bd1efdb8.js} +4 -4
- package/static/static/js/index.bd1efdb8.js.map +1 -0
- package/static/static/js/index.af7dda97.js.map +0 -1
- /package/static/static/js/{index.af7dda97.js.LICENSE.txt → index.bd1efdb8.js.LICENSE.txt} +0 -0
package/dist/es/bin.mjs
CHANGED
|
@@ -22,12 +22,12 @@ import { findAllMidsceneLocatorField as ai_model_findAllMidsceneLocatorField } f
|
|
|
22
22
|
import { buildDetailedLocateParam } from "@midscene/core/yaml";
|
|
23
23
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
24
24
|
import { fileURLToPath } from "node:url";
|
|
25
|
-
import { Agent, paramStr, typeStr } from "@midscene/core/agent";
|
|
26
25
|
import { getTmpDir, sleep } from "@midscene/core/utils";
|
|
27
26
|
import { DEFAULT_WDA_PORT, PLAYGROUND_SERVER_PORT as constants_PLAYGROUND_SERVER_PORT } from "@midscene/shared/constants";
|
|
28
27
|
import { overrideAIConfig } from "@midscene/shared/env";
|
|
29
28
|
import { uuid as utils_uuid } from "@midscene/shared/utils";
|
|
30
29
|
import { exec } from "node:child_process";
|
|
30
|
+
import { Agent } from "@midscene/core/agent";
|
|
31
31
|
import { getDebug } from "@midscene/shared/logger";
|
|
32
32
|
import node_assert from "node:assert";
|
|
33
33
|
import { getMidsceneLocationSchema, z } from "@midscene/core";
|
|
@@ -11559,12 +11559,9 @@ class PlaygroundServer {
|
|
|
11559
11559
|
});
|
|
11560
11560
|
this._app.get('/task-progress/:requestId', async (req, res)=>{
|
|
11561
11561
|
const { requestId } = req.params;
|
|
11562
|
-
const
|
|
11563
|
-
const lastMessage = progressMessages.length > 0 ? progressMessages[progressMessages.length - 1] : void 0;
|
|
11564
|
-
const tip = lastMessage && 'string' == typeof lastMessage.action ? `${lastMessage.action} - ${lastMessage.description || ''}` : '';
|
|
11562
|
+
const executionDump = this.taskExecutionDumps[requestId] || null;
|
|
11565
11563
|
res.json({
|
|
11566
|
-
|
|
11567
|
-
progressMessages
|
|
11564
|
+
executionDump
|
|
11568
11565
|
});
|
|
11569
11566
|
});
|
|
11570
11567
|
this._app.post('/action-space', async (req, res)=>{
|
|
@@ -11629,22 +11626,9 @@ class PlaygroundServer {
|
|
|
11629
11626
|
});
|
|
11630
11627
|
if (requestId) {
|
|
11631
11628
|
this.currentTaskId = requestId;
|
|
11632
|
-
this.
|
|
11629
|
+
this.taskExecutionDumps[requestId] = null;
|
|
11633
11630
|
this.agent.onDumpUpdate = (_dump, executionDump)=>{
|
|
11634
|
-
if (executionDump
|
|
11635
|
-
const action = typeStr(task);
|
|
11636
|
-
const description = paramStr(task) || '';
|
|
11637
|
-
const taskStatus = task.status;
|
|
11638
|
-
const status = 'cancelled' === taskStatus ? 'failed' : taskStatus;
|
|
11639
|
-
return {
|
|
11640
|
-
id: `progress-task-${index}`,
|
|
11641
|
-
taskId: `task-${index}`,
|
|
11642
|
-
action,
|
|
11643
|
-
description,
|
|
11644
|
-
status,
|
|
11645
|
-
timestamp: task.timing?.start || Date.now()
|
|
11646
|
-
};
|
|
11647
|
-
});
|
|
11631
|
+
if (executionDump) this.taskExecutionDumps[requestId] = executionDump;
|
|
11648
11632
|
};
|
|
11649
11633
|
}
|
|
11650
11634
|
const response = {
|
|
@@ -11689,7 +11673,7 @@ class PlaygroundServer {
|
|
|
11689
11673
|
if (response.error) console.error(`handle request failed after ${timeCost}ms: requestId: ${requestId}, ${response.error}`);
|
|
11690
11674
|
else console.log(`handle request done after ${timeCost}ms: requestId: ${requestId}`);
|
|
11691
11675
|
if (requestId) {
|
|
11692
|
-
delete this.
|
|
11676
|
+
delete this.taskExecutionDumps[requestId];
|
|
11693
11677
|
if (this.currentTaskId === requestId) this.currentTaskId = null;
|
|
11694
11678
|
}
|
|
11695
11679
|
});
|
|
@@ -11717,7 +11701,7 @@ class PlaygroundServer {
|
|
|
11717
11701
|
console.warn('Failed to get execution data before cancel:', error);
|
|
11718
11702
|
}
|
|
11719
11703
|
await this.recreateAgent();
|
|
11720
|
-
delete this.
|
|
11704
|
+
delete this.taskExecutionDumps[requestId];
|
|
11721
11705
|
this.currentTaskId = null;
|
|
11722
11706
|
res.json({
|
|
11723
11707
|
status: 'cancelled',
|
|
@@ -11844,7 +11828,7 @@ class PlaygroundServer {
|
|
|
11844
11828
|
} catch (error) {
|
|
11845
11829
|
console.warn('Failed to destroy agent:', error);
|
|
11846
11830
|
}
|
|
11847
|
-
this.
|
|
11831
|
+
this.taskExecutionDumps = {};
|
|
11848
11832
|
this.server.close((error)=>{
|
|
11849
11833
|
if (error) reject(error);
|
|
11850
11834
|
else {
|
|
@@ -11862,7 +11846,7 @@ class PlaygroundServer {
|
|
|
11862
11846
|
_define_property(this, "port", void 0);
|
|
11863
11847
|
_define_property(this, "agent", void 0);
|
|
11864
11848
|
_define_property(this, "staticPath", void 0);
|
|
11865
|
-
_define_property(this, "
|
|
11849
|
+
_define_property(this, "taskExecutionDumps", void 0);
|
|
11866
11850
|
_define_property(this, "id", void 0);
|
|
11867
11851
|
_define_property(this, "_initialized", false);
|
|
11868
11852
|
_define_property(this, "agentFactory", void 0);
|
|
@@ -11870,7 +11854,7 @@ class PlaygroundServer {
|
|
|
11870
11854
|
this._app = express();
|
|
11871
11855
|
this.tmpDir = getTmpDir();
|
|
11872
11856
|
this.staticPath = staticPath;
|
|
11873
|
-
this.
|
|
11857
|
+
this.taskExecutionDumps = {};
|
|
11874
11858
|
this.id = id || utils_uuid();
|
|
11875
11859
|
if ('function' == typeof agent) {
|
|
11876
11860
|
this.agentFactory = agent;
|
package/dist/lib/bin.js
CHANGED
|
@@ -11608,7 +11608,6 @@ var __webpack_exports__ = {};
|
|
|
11608
11608
|
}
|
|
11609
11609
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
11610
11610
|
const external_node_url_namespaceObject = require("node:url");
|
|
11611
|
-
const agent_namespaceObject = require("@midscene/core/agent");
|
|
11612
11611
|
const utils_namespaceObject = require("@midscene/core/utils");
|
|
11613
11612
|
const constants_namespaceObject = require("@midscene/shared/constants");
|
|
11614
11613
|
const env_namespaceObject = require("@midscene/shared/env");
|
|
@@ -11703,12 +11702,9 @@ var __webpack_exports__ = {};
|
|
|
11703
11702
|
});
|
|
11704
11703
|
this._app.get('/task-progress/:requestId', async (req, res)=>{
|
|
11705
11704
|
const { requestId } = req.params;
|
|
11706
|
-
const
|
|
11707
|
-
const lastMessage = progressMessages.length > 0 ? progressMessages[progressMessages.length - 1] : void 0;
|
|
11708
|
-
const tip = lastMessage && 'string' == typeof lastMessage.action ? `${lastMessage.action} - ${lastMessage.description || ''}` : '';
|
|
11705
|
+
const executionDump = this.taskExecutionDumps[requestId] || null;
|
|
11709
11706
|
res.json({
|
|
11710
|
-
|
|
11711
|
-
progressMessages
|
|
11707
|
+
executionDump
|
|
11712
11708
|
});
|
|
11713
11709
|
});
|
|
11714
11710
|
this._app.post('/action-space', async (req, res)=>{
|
|
@@ -11773,22 +11769,9 @@ var __webpack_exports__ = {};
|
|
|
11773
11769
|
});
|
|
11774
11770
|
if (requestId) {
|
|
11775
11771
|
this.currentTaskId = requestId;
|
|
11776
|
-
this.
|
|
11772
|
+
this.taskExecutionDumps[requestId] = null;
|
|
11777
11773
|
this.agent.onDumpUpdate = (_dump, executionDump)=>{
|
|
11778
|
-
if (executionDump
|
|
11779
|
-
const action = (0, agent_namespaceObject.typeStr)(task);
|
|
11780
|
-
const description = (0, agent_namespaceObject.paramStr)(task) || '';
|
|
11781
|
-
const taskStatus = task.status;
|
|
11782
|
-
const status = 'cancelled' === taskStatus ? 'failed' : taskStatus;
|
|
11783
|
-
return {
|
|
11784
|
-
id: `progress-task-${index}`,
|
|
11785
|
-
taskId: `task-${index}`,
|
|
11786
|
-
action,
|
|
11787
|
-
description,
|
|
11788
|
-
status,
|
|
11789
|
-
timestamp: task.timing?.start || Date.now()
|
|
11790
|
-
};
|
|
11791
|
-
});
|
|
11774
|
+
if (executionDump) this.taskExecutionDumps[requestId] = executionDump;
|
|
11792
11775
|
};
|
|
11793
11776
|
}
|
|
11794
11777
|
const response = {
|
|
@@ -11833,7 +11816,7 @@ var __webpack_exports__ = {};
|
|
|
11833
11816
|
if (response.error) console.error(`handle request failed after ${timeCost}ms: requestId: ${requestId}, ${response.error}`);
|
|
11834
11817
|
else console.log(`handle request done after ${timeCost}ms: requestId: ${requestId}`);
|
|
11835
11818
|
if (requestId) {
|
|
11836
|
-
delete this.
|
|
11819
|
+
delete this.taskExecutionDumps[requestId];
|
|
11837
11820
|
if (this.currentTaskId === requestId) this.currentTaskId = null;
|
|
11838
11821
|
}
|
|
11839
11822
|
});
|
|
@@ -11861,7 +11844,7 @@ var __webpack_exports__ = {};
|
|
|
11861
11844
|
console.warn('Failed to get execution data before cancel:', error);
|
|
11862
11845
|
}
|
|
11863
11846
|
await this.recreateAgent();
|
|
11864
|
-
delete this.
|
|
11847
|
+
delete this.taskExecutionDumps[requestId];
|
|
11865
11848
|
this.currentTaskId = null;
|
|
11866
11849
|
res.json({
|
|
11867
11850
|
status: 'cancelled',
|
|
@@ -11988,7 +11971,7 @@ var __webpack_exports__ = {};
|
|
|
11988
11971
|
} catch (error) {
|
|
11989
11972
|
console.warn('Failed to destroy agent:', error);
|
|
11990
11973
|
}
|
|
11991
|
-
this.
|
|
11974
|
+
this.taskExecutionDumps = {};
|
|
11992
11975
|
this.server.close((error)=>{
|
|
11993
11976
|
if (error) reject(error);
|
|
11994
11977
|
else {
|
|
@@ -12006,7 +11989,7 @@ var __webpack_exports__ = {};
|
|
|
12006
11989
|
_define_property(this, "port", void 0);
|
|
12007
11990
|
_define_property(this, "agent", void 0);
|
|
12008
11991
|
_define_property(this, "staticPath", void 0);
|
|
12009
|
-
_define_property(this, "
|
|
11992
|
+
_define_property(this, "taskExecutionDumps", void 0);
|
|
12010
11993
|
_define_property(this, "id", void 0);
|
|
12011
11994
|
_define_property(this, "_initialized", false);
|
|
12012
11995
|
_define_property(this, "agentFactory", void 0);
|
|
@@ -12014,7 +11997,7 @@ var __webpack_exports__ = {};
|
|
|
12014
11997
|
this._app = express();
|
|
12015
11998
|
this.tmpDir = (0, utils_namespaceObject.getTmpDir)();
|
|
12016
11999
|
this.staticPath = staticPath;
|
|
12017
|
-
this.
|
|
12000
|
+
this.taskExecutionDumps = {};
|
|
12018
12001
|
this.id = id || (0, shared_utils_namespaceObject.uuid)();
|
|
12019
12002
|
if ('function' == typeof agent) {
|
|
12020
12003
|
this.agentFactory = agent;
|
|
@@ -12027,6 +12010,7 @@ var __webpack_exports__ = {};
|
|
|
12027
12010
|
}
|
|
12028
12011
|
const external_node_child_process_namespaceObject = require("node:child_process");
|
|
12029
12012
|
__webpack_require__("../../node_modules/.pnpm/cors@2.8.5/node_modules/cors/lib/index.js");
|
|
12013
|
+
const agent_namespaceObject = require("@midscene/core/agent");
|
|
12030
12014
|
const logger_namespaceObject = require("@midscene/shared/logger");
|
|
12031
12015
|
const external_node_assert_namespaceObject = require("node:assert");
|
|
12032
12016
|
var external_node_assert_default = /*#__PURE__*/ __webpack_require__.n(external_node_assert_namespaceObject);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/ios",
|
|
3
|
-
"version": "1.0.3-beta-
|
|
3
|
+
"version": "1.0.3-beta-20251223070556.0",
|
|
4
4
|
"description": "iOS automation library for Midscene",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"iOS UI automation",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@inquirer/prompts": "^7.8.6",
|
|
40
40
|
"open": "10.1.0",
|
|
41
|
-
"@midscene/core": "1.0.3-beta-
|
|
42
|
-
"@midscene/shared": "1.0.3-beta-
|
|
43
|
-
"@midscene/webdriver": "1.0.3-beta-
|
|
41
|
+
"@midscene/core": "1.0.3-beta-20251223070556.0",
|
|
42
|
+
"@midscene/shared": "1.0.3-beta-20251223070556.0",
|
|
43
|
+
"@midscene/webdriver": "1.0.3-beta-20251223070556.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@rslib/core": "^0.18.3",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"tsx": "^4.19.2",
|
|
51
51
|
"vitest": "3.0.5",
|
|
52
52
|
"zod": "3.24.3",
|
|
53
|
-
"@midscene/playground": "1.0.3-beta-
|
|
53
|
+
"@midscene/playground": "1.0.3-beta-20251223070556.0"
|
|
54
54
|
},
|
|
55
55
|
"license": "MIT",
|
|
56
56
|
"scripts": {
|
package/static/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html><head><link rel="icon" href="/favicon.ico"><title>Midscene Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.7b1abe58.js"></script><script defer src="/static/js/430.53da0b9c.js"></script><script defer src="/static/js/index.
|
|
1
|
+
<!doctype html><html><head><link rel="icon" href="/favicon.ico"><title>Midscene Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.7b1abe58.js"></script><script defer src="/static/js/430.53da0b9c.js"></script><script defer src="/static/js/index.bd1efdb8.js"></script><link href="/static/css/index.f2964c15.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
|