@midscene/core 1.3.3 → 1.3.4
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/agent/utils.mjs +1 -1
- package/dist/es/ai-model/prompt/util.mjs +13 -3
- package/dist/es/ai-model/prompt/util.mjs.map +1 -1
- package/dist/es/ai-model/service-caller/index.mjs +8 -4
- package/dist/es/ai-model/service-caller/index.mjs.map +1 -1
- package/dist/es/types.mjs.map +1 -1
- package/dist/es/utils.mjs +2 -2
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/ai-model/prompt/util.js +13 -3
- package/dist/lib/ai-model/prompt/util.js.map +1 -1
- package/dist/lib/ai-model/service-caller/index.js +8 -4
- package/dist/lib/ai-model/service-caller/index.js.map +1 -1
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/types/ai-model/prompt/util.d.ts +7 -1
- package/dist/types/types.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { SubGoal } from '../../types';
|
|
2
2
|
/**
|
|
3
|
-
* Extract content from an XML tag in a string
|
|
3
|
+
* Extract content from an XML tag in a string, searching from the end.
|
|
4
|
+
* This approach handles cases where models prepend thinking content (like <think>...</think>)
|
|
5
|
+
* before the actual response tags, or when there are incomplete/nested tags.
|
|
6
|
+
*
|
|
7
|
+
* Strategy: Find the LAST closing tag, then search backwards for the nearest opening tag.
|
|
8
|
+
* This ensures we get the last complete tag pair, even if there are incomplete tags before it.
|
|
9
|
+
*
|
|
4
10
|
* @param xmlString - The XML string to parse
|
|
5
11
|
* @param tagName - The name of the tag to extract (case-insensitive)
|
|
6
12
|
* @returns The trimmed content of the tag, or undefined if not found
|
package/dist/types/types.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export type AIUsageInfo = Record<string, any> & {
|
|
|
16
16
|
model_name: string | undefined;
|
|
17
17
|
model_description: string | undefined;
|
|
18
18
|
intent: string | undefined;
|
|
19
|
+
request_id: string | undefined;
|
|
19
20
|
};
|
|
20
21
|
export type { LocateResultElement };
|
|
21
22
|
export type AISingleElementResponseByPosition = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/core",
|
|
3
3
|
"description": "Automate browser actions, extract data, and perform assertions using AI. It offers JavaScript SDK, Chrome extension, and support for scripting in YAML. See https://midscenejs.com/ for details.",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.4",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
7
7
|
"main": "./dist/lib/index.js",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"semver": "7.5.2",
|
|
90
90
|
"undici": "^6.0.0",
|
|
91
91
|
"zod": "3.24.3",
|
|
92
|
-
"@midscene/shared": "1.3.
|
|
92
|
+
"@midscene/shared": "1.3.4"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@rslib/core": "^0.18.3",
|