autoglm.js 0.0.10 → 0.0.11
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/index.mjs +8 -4
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -350,7 +350,7 @@ const SYSTEM_PROMPT_ZH = `今天的日期是: ${formatted_date}
|
|
|
350
350
|
- do(action="Wait", duration="x seconds")
|
|
351
351
|
等待页面加载,x为需要等待多少秒。
|
|
352
352
|
- finish(message="xxx")
|
|
353
|
-
finish是结束任务的操作,表示准确完整完成任务,message
|
|
353
|
+
finish是结束任务的操作,表示准确完整完成任务,message参数是任务完成后的总结信息,必须简洁明了地说明执行结果。
|
|
354
354
|
|
|
355
355
|
必须遵循的规则:
|
|
356
356
|
1. 在执行任何操作前,先检查当前app是否是目标app,如果不是,先执行 Launch。
|
|
@@ -1202,10 +1202,14 @@ function getActionType(node) {
|
|
|
1202
1202
|
*/
|
|
1203
1203
|
function parseAction(actionStr) {
|
|
1204
1204
|
if (actionStr.startsWith("finish(")) {
|
|
1205
|
-
const match = actionStr.match(/finish\(message=(.*)\)/);
|
|
1206
|
-
return {
|
|
1205
|
+
const match = actionStr.match(/finish\(message=(.*)\)/s);
|
|
1206
|
+
if (match) return {
|
|
1207
|
+
_metadata: "finish",
|
|
1208
|
+
message: parseQuotedString(match[1].trim())
|
|
1209
|
+
};
|
|
1210
|
+
else return {
|
|
1207
1211
|
_metadata: "finish",
|
|
1208
|
-
message:
|
|
1212
|
+
message: void 0
|
|
1209
1213
|
};
|
|
1210
1214
|
}
|
|
1211
1215
|
if (actionStr.startsWith("do(")) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autoglm.js",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.11",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "AutoGLM.js is a JavaScript library for Open-AutoGLM",
|
|
7
7
|
"author": "FliPPeDround <flippedround@qq.com>",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
},
|
|
50
50
|
"optionalDependencies": {
|
|
51
51
|
"@autoglm.js/adb-keyboard": "0.0.1",
|
|
52
|
+
"@autoglm.js/platform-tools-darwin": "36.0.0",
|
|
52
53
|
"@autoglm.js/platform-tools-linux": "36.0.0",
|
|
53
|
-
"@autoglm.js/platform-tools-windows": "36.0.0"
|
|
54
|
-
"@autoglm.js/platform-tools-darwin": "36.0.0"
|
|
54
|
+
"@autoglm.js/platform-tools-windows": "36.0.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/fs-extra": "^11.0.4",
|