@midscene/core 0.5.2 → 0.6.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.
@@ -4396,7 +4396,7 @@ Please return the result in JSON format as follows:
4396
4396
  {
4397
4397
  "reason": "PLACEHOLDER", // The thought process for finding the element, replace PLACEHOLDER with your thought process
4398
4398
  "text": "PLACEHOLDER", // Replace PLACEHOLDER with the text of elementInfo, if none, leave empty
4399
- "id": "PLACEHOLDER" // Replace PLACEHOLDER with the ID of elementInfo
4399
+ "id": "PLACEHOLDER" // Replace PLACEHOLDER with the ID of elementInfo, important: use id not indexId
4400
4400
  }
4401
4401
  // More elements...
4402
4402
  ],
@@ -4437,7 +4437,7 @@ Input Example:
4437
4437
  },
4438
4438
  {
4439
4439
  "id": "wefew2222few2", // ID of the element
4440
- "indexId": "1", // Index of the elementThe image is labeled to the left of the element
4440
+ "indexId": "1", // Index of the element,The image is labeled to the left of the element
4441
4441
  "attributes": { // Attributes of the element
4442
4442
  "nodeType": "IMG Node", // Type of element, types include: TEXT Node, IMG Node, BUTTON Node, INPUT Node
4443
4443
  "src": "data:image/png;base64,iVBORw0KGgoAAAANSU...",
@@ -4485,7 +4485,7 @@ Output Example:
4485
4485
  // Describe the reason for finding this element, replace with actual value in practice
4486
4486
  "reason": "Reason for finding element 4: It is located in the upper right corner, is an image type, and according to the screenshot, it is a shopping cart icon button",
4487
4487
  "text": "",
4488
- // ID of this element, replace with actual value in practice
4488
+ // ID(hashID) of this element, replace with actual value in practice, important: use id not indexId
4489
4489
  "id": "wefew2222few2"
4490
4490
  }
4491
4491
  ],
package/dist/es/index.js CHANGED
@@ -4561,7 +4561,7 @@ Please return the result in JSON format as follows:
4561
4561
  {
4562
4562
  "reason": "PLACEHOLDER", // The thought process for finding the element, replace PLACEHOLDER with your thought process
4563
4563
  "text": "PLACEHOLDER", // Replace PLACEHOLDER with the text of elementInfo, if none, leave empty
4564
- "id": "PLACEHOLDER" // Replace PLACEHOLDER with the ID of elementInfo
4564
+ "id": "PLACEHOLDER" // Replace PLACEHOLDER with the ID of elementInfo, important: use id not indexId
4565
4565
  }
4566
4566
  // More elements...
4567
4567
  ],
@@ -4602,7 +4602,7 @@ Input Example:
4602
4602
  },
4603
4603
  {
4604
4604
  "id": "wefew2222few2", // ID of the element
4605
- "indexId": "1", // Index of the elementThe image is labeled to the left of the element
4605
+ "indexId": "1", // Index of the element,The image is labeled to the left of the element
4606
4606
  "attributes": { // Attributes of the element
4607
4607
  "nodeType": "IMG Node", // Type of element, types include: TEXT Node, IMG Node, BUTTON Node, INPUT Node
4608
4608
  "src": "data:image/png;base64,iVBORw0KGgoAAAANSU...",
@@ -4650,7 +4650,7 @@ Output Example:
4650
4650
  // Describe the reason for finding this element, replace with actual value in practice
4651
4651
  "reason": "Reason for finding element 4: It is located in the upper right corner, is an image type, and according to the screenshot, it is a shopping cart icon button",
4652
4652
  "text": "",
4653
- // ID of this element, replace with actual value in practice
4653
+ // ID(hashID) of this element, replace with actual value in practice, important: use id not indexId
4654
4654
  "id": "wefew2222few2"
4655
4655
  }
4656
4656
  ],
@@ -5785,6 +5785,7 @@ export {
5785
5785
  AIResponseFormat,
5786
5786
  BaseElement,
5787
5787
  Executor,
5788
+ Insight,
5788
5789
  UIContext,
5789
5790
  src_default as default,
5790
5791
  getElement,
@@ -4416,7 +4416,7 @@ Please return the result in JSON format as follows:
4416
4416
  {
4417
4417
  "reason": "PLACEHOLDER", // The thought process for finding the element, replace PLACEHOLDER with your thought process
4418
4418
  "text": "PLACEHOLDER", // Replace PLACEHOLDER with the text of elementInfo, if none, leave empty
4419
- "id": "PLACEHOLDER" // Replace PLACEHOLDER with the ID of elementInfo
4419
+ "id": "PLACEHOLDER" // Replace PLACEHOLDER with the ID of elementInfo, important: use id not indexId
4420
4420
  }
4421
4421
  // More elements...
4422
4422
  ],
@@ -4457,7 +4457,7 @@ Input Example:
4457
4457
  },
4458
4458
  {
4459
4459
  "id": "wefew2222few2", // ID of the element
4460
- "indexId": "1", // Index of the elementThe image is labeled to the left of the element
4460
+ "indexId": "1", // Index of the element,The image is labeled to the left of the element
4461
4461
  "attributes": { // Attributes of the element
4462
4462
  "nodeType": "IMG Node", // Type of element, types include: TEXT Node, IMG Node, BUTTON Node, INPUT Node
4463
4463
  "src": "data:image/png;base64,iVBORw0KGgoAAAANSU...",
@@ -4505,7 +4505,7 @@ Output Example:
4505
4505
  // Describe the reason for finding this element, replace with actual value in practice
4506
4506
  "reason": "Reason for finding element 4: It is located in the upper right corner, is an image type, and according to the screenshot, it is a shopping cart icon button",
4507
4507
  "text": "",
4508
- // ID of this element, replace with actual value in practice
4508
+ // ID(hashID) of this element, replace with actual value in practice, important: use id not indexId
4509
4509
  "id": "wefew2222few2"
4510
4510
  }
4511
4511
  ],
package/dist/lib/index.js CHANGED
@@ -1020,6 +1020,7 @@ __export(src_exports, {
1020
1020
  AIResponseFormat: () => AIResponseFormat,
1021
1021
  BaseElement: () => BaseElement,
1022
1022
  Executor: () => Executor,
1023
+ Insight: () => Insight,
1023
1024
  UIContext: () => UIContext,
1024
1025
  default: () => src_default,
1025
1026
  getElement: () => getElement,
@@ -4582,7 +4583,7 @@ Please return the result in JSON format as follows:
4582
4583
  {
4583
4584
  "reason": "PLACEHOLDER", // The thought process for finding the element, replace PLACEHOLDER with your thought process
4584
4585
  "text": "PLACEHOLDER", // Replace PLACEHOLDER with the text of elementInfo, if none, leave empty
4585
- "id": "PLACEHOLDER" // Replace PLACEHOLDER with the ID of elementInfo
4586
+ "id": "PLACEHOLDER" // Replace PLACEHOLDER with the ID of elementInfo, important: use id not indexId
4586
4587
  }
4587
4588
  // More elements...
4588
4589
  ],
@@ -4623,7 +4624,7 @@ Input Example:
4623
4624
  },
4624
4625
  {
4625
4626
  "id": "wefew2222few2", // ID of the element
4626
- "indexId": "1", // Index of the elementThe image is labeled to the left of the element
4627
+ "indexId": "1", // Index of the element,The image is labeled to the left of the element
4627
4628
  "attributes": { // Attributes of the element
4628
4629
  "nodeType": "IMG Node", // Type of element, types include: TEXT Node, IMG Node, BUTTON Node, INPUT Node
4629
4630
  "src": "data:image/png;base64,iVBORw0KGgoAAAANSU...",
@@ -4671,7 +4672,7 @@ Output Example:
4671
4672
  // Describe the reason for finding this element, replace with actual value in practice
4672
4673
  "reason": "Reason for finding element 4: It is located in the upper right corner, is an image type, and according to the screenshot, it is a shopping cart icon button",
4673
4674
  "text": "",
4674
- // ID of this element, replace with actual value in practice
4675
+ // ID(hashID) of this element, replace with actual value in practice, important: use id not indexId
4675
4676
  "id": "wefew2222few2"
4676
4677
  }
4677
4678
  ],
@@ -5799,6 +5800,7 @@ var src_default = Insight;
5799
5800
  AIResponseFormat,
5800
5801
  BaseElement,
5801
5802
  Executor,
5803
+ Insight,
5802
5804
  UIContext,
5803
5805
  getElement,
5804
5806
  getSection,
@@ -41,4 +41,4 @@ declare class Insight<ElementType extends BaseElement = BaseElement, ContextType
41
41
  declare const getElement: typeof retrieveElement;
42
42
  declare const getSection: typeof retrieveSection;
43
43
 
44
- export { AISingleElementResponse, BaseElement, DumpSubscriber, ExecutionDump, ExecutionTask, ExecutionTaskApply, Executor, InsightAssertionResponse, InsightOptions, InsightTaskInfo, UIContext, Insight as default, getElement, getSection };
44
+ export { AISingleElementResponse, BaseElement, DumpSubscriber, ExecutionDump, ExecutionTask, ExecutionTaskApply, Executor, Insight, InsightAssertionResponse, InsightOptions, InsightTaskInfo, UIContext, Insight as default, getElement, getSection };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midscene/core",
3
3
  "description": "An AI-powered automation SDK can control the page, perform assertions, and extract data in JSON format using natural language. See https://midscenejs.com/ for details.",
4
- "version": "0.5.2",
4
+ "version": "0.6.0",
5
5
  "jsnext:source": "./src/index.ts",
6
6
  "type": "commonjs",
7
7
  "main": "./dist/lib/index.js",
@@ -38,7 +38,7 @@
38
38
  "node-fetch": "2.6.7",
39
39
  "openai": "4.57.1",
40
40
  "optional": "0.1.4",
41
- "@midscene/shared": "0.5.2"
41
+ "@midscene/shared": "0.6.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@modern-js/module-tools": "2.58.2",
@@ -66,6 +66,7 @@
66
66
  "test": "vitest --run",
67
67
  "test:ai": "AITEST=true npm run test",
68
68
  "evaluate": "npm run test:ai -- tests/ai/evaluate/inspect.test.ts",
69
+ "evaluate:update": "UPDATE_AI_DATA=true npm run test:ai -- tests/ai/evaluate/inspect.test.ts",
69
70
  "evaluate:plan": "PLAN_INSPECT=true npm run test:ai -- tests/ai/evaluate/inspect.test.ts"
70
71
  }
71
72
  }