@midscene/core 0.25.4-beta-20250811115904.0 → 0.25.4-beta-20250812025613.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/ai-model.js +1 -1
- package/dist/es/{chunk-NY6RQSGJ.js → chunk-UC5NNLPY.js} +17 -17
- package/dist/es/{chunk-NY6RQSGJ.js.map → chunk-UC5NNLPY.js.map} +1 -1
- package/dist/es/{chunk-SR67R2OE.js → chunk-YNPMUA35.js} +3 -3
- package/dist/es/index.js +2 -2
- package/dist/es/utils.js +1 -1
- package/dist/lib/ai-model.js +2 -2
- package/dist/lib/{chunk-NY6RQSGJ.js → chunk-UC5NNLPY.js} +17 -17
- package/dist/lib/{chunk-NY6RQSGJ.js.map → chunk-UC5NNLPY.js.map} +1 -1
- package/dist/lib/{chunk-SR67R2OE.js → chunk-YNPMUA35.js} +3 -3
- package/dist/lib/index.js +12 -12
- package/dist/lib/utils.js +2 -2
- package/package.json +3 -3
- /package/dist/es/{chunk-SR67R2OE.js.map → chunk-YNPMUA35.js.map} +0 -0
- /package/dist/lib/{chunk-SR67R2OE.js.map → chunk-YNPMUA35.js.map} +0 -0
package/dist/es/ai-model.js
CHANGED
|
@@ -760,16 +760,15 @@ You are a versatile professional in software UI automation. Your outstanding con
|
|
|
760
760
|
## Workflow
|
|
761
761
|
|
|
762
762
|
1. Receive the screenshot, element description of screenshot(if any), user's instruction and previous logs.
|
|
763
|
-
2. Decompose the user's task into a sequence of actions, and place it in the \`actions\` field. There are different types of actions (${actionNameList}). The "About the action" section below will give you more details.
|
|
764
|
-
3.
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
- If no, don't plan more actions by closing the array. Get ready to reevaluate the task. Some talent people like you will handle this. Give him a clear description of what have been done and what to do next. Put your new plan in the \`furtherPlan\` field. The "How to compose the \`taskWillBeAccomplished\` and \`furtherPlan\` fields" section will give you more details.
|
|
763
|
+
2. Decompose the user's task into a sequence of feasible actions, and place it in the \`actions\` field. There are different types of actions (${actionNameList}). The "About the action" section below will give you more details.
|
|
764
|
+
3. Consider whether the user's instruction will be accomplished after the actions you composed.
|
|
765
|
+
- If the instruction is accomplished, set \`more_actions_needed_by_instruction\` to false.
|
|
766
|
+
- If more actions are needed, set \`more_actions_needed_by_instruction\` to true. Get ready to hand over to the next talent people like you. Carefully log what have been done in the \`log\` field, he or she will continue the task according to your logs.
|
|
767
|
+
4. If the task is not feasible on this page, set \`error\` field to the reason.
|
|
769
768
|
|
|
770
769
|
## Constraints
|
|
771
770
|
|
|
772
|
-
- All the actions you composed MUST be
|
|
771
|
+
- All the actions you composed MUST be feasible, which means all the action fields can be filled with the page context information you get. If not, don't plan this action.
|
|
773
772
|
- Trust the "What have been done" field about the task (if any), don't repeat actions in it.
|
|
774
773
|
- Respond only with valid JSON. Do not write an introduction or summary or markdown prefix like \`\`\`json\`\`\`.
|
|
775
774
|
- If the screenshot and the instruction are totally irrelevant, set reason in the \`error\` field.
|
|
@@ -807,15 +806,20 @@ The JSON format is as follows:
|
|
|
807
806
|
|
|
808
807
|
### Example: Decompose a task
|
|
809
808
|
|
|
810
|
-
When
|
|
809
|
+
When you received the following information:
|
|
810
|
+
|
|
811
|
+
* Instruction: 'Click the language switch button, wait 1s, click "English"'
|
|
812
|
+
* Logs: null
|
|
813
|
+
* Page Context (screenshot and description) shows: There is a language switch button, and the "English" option is not shown in the screenshot now.
|
|
811
814
|
|
|
812
815
|
By viewing the page screenshot and description, you should consider this and output the JSON:
|
|
813
816
|
|
|
814
|
-
* The
|
|
815
|
-
* The language switch button is shown in the screenshot,
|
|
817
|
+
* The user intent is: tap the switch button, sleep, and tap the 'English' option
|
|
818
|
+
* The language switch button is shown in the screenshot, and can be located by the page description or the id marked with a rectangle. So we can plan a Tap action to do this.
|
|
819
|
+
* Plan a Sleep action to wait for 1 second to ensure the language options are displayed.
|
|
816
820
|
* The "English" option button is not shown in the screenshot now, it means it may only show after the previous actions are finished. So don't plan any action to do this.
|
|
817
821
|
* Log what these action do: Click the language switch button to open the language options. Wait for 1 second.
|
|
818
|
-
* The task cannot be accomplished (because
|
|
822
|
+
* The task cannot be accomplished (because the last tapping action is not finished yet), so the \`more_actions_needed_by_instruction\` field is true. The \`error\` field is null.
|
|
819
823
|
|
|
820
824
|
{
|
|
821
825
|
"actions":[
|
|
@@ -845,7 +849,7 @@ Wrong output:
|
|
|
845
849
|
"thought": "Click the language switch button to open the language options.",
|
|
846
850
|
"param": null,
|
|
847
851
|
"locate": {
|
|
848
|
-
{ "id": "c81c4e9a33" }, // WRONG: prompt is missing
|
|
852
|
+
{ "id": "c81c4e9a33" }, // WRONG: prompt is missing, this is not a valid LocateParam
|
|
849
853
|
}
|
|
850
854
|
},
|
|
851
855
|
{
|
|
@@ -858,10 +862,6 @@ Wrong output:
|
|
|
858
862
|
"more_actions_needed_by_instruction": false, // WRONG: should be true
|
|
859
863
|
"log": "Click the language switch button to open the language options",
|
|
860
864
|
}
|
|
861
|
-
|
|
862
|
-
Reason:
|
|
863
|
-
* The \`prompt\` is missing in the first 'Locate' action
|
|
864
|
-
* Since the option button is not shown in the screenshot, there are still more actions to be done, so the \`more_actions_needed_by_instruction\` field should be true
|
|
865
865
|
`;
|
|
866
866
|
async function systemPromptToTaskPlanning({
|
|
867
867
|
actionSpace,
|
|
@@ -2911,4 +2911,4 @@ export {
|
|
|
2911
2911
|
resizeImageForUiTars
|
|
2912
2912
|
};
|
|
2913
2913
|
|
|
2914
|
-
//# sourceMappingURL=chunk-
|
|
2914
|
+
//# sourceMappingURL=chunk-UC5NNLPY.js.map
|