@midscene/core 0.19.1-beta-20250616124611.0 → 0.19.1-beta-20250616133247.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-EYIL4AHP.js → chunk-7EB47UPF.js} +3 -4
- package/dist/es/{chunk-EYIL4AHP.js.map → chunk-7EB47UPF.js.map} +1 -1
- package/dist/es/{chunk-FIMT74SQ.js → chunk-NQEPCJPP.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-EYIL4AHP.js → chunk-7EB47UPF.js} +3 -4
- package/dist/lib/{chunk-EYIL4AHP.js.map → chunk-7EB47UPF.js.map} +1 -1
- package/dist/lib/{chunk-FIMT74SQ.js → chunk-NQEPCJPP.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-FIMT74SQ.js.map → chunk-NQEPCJPP.js.map} +0 -0
- /package/dist/lib/{chunk-FIMT74SQ.js.map → chunk-NQEPCJPP.js.map} +0 -0
package/dist/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNQEPCJPPjs = require('./chunk-NQEPCJPP.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ var _chunkFIMT74SQjs = require('./chunk-FIMT74SQ.js');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunk7EB47UPFjs = require('./chunk-7EB47UPF.js');
|
|
15
15
|
|
|
16
16
|
// src/ai-model/action-executor.ts
|
|
17
17
|
|
|
@@ -171,7 +171,7 @@ ${_optionalChain([this, 'access', _7 => _7.latestErrorTask, 'call', _8 => _8(),
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
const dumpData = {
|
|
174
|
-
sdkVersion:
|
|
174
|
+
sdkVersion: _chunkNQEPCJPPjs.getVersion.call(void 0, ),
|
|
175
175
|
model_name: _env.getAIConfig.call(void 0, _env.MIDSCENE_MODEL_NAME) || "",
|
|
176
176
|
model_description: modelDescription,
|
|
177
177
|
logTime: Date.now(),
|
|
@@ -219,7 +219,7 @@ var _logger = require('@midscene/shared/logger');
|
|
|
219
219
|
|
|
220
220
|
function emitInsightDump(data, dumpSubscriber) {
|
|
221
221
|
const baseData = {
|
|
222
|
-
sdkVersion:
|
|
222
|
+
sdkVersion: _chunkNQEPCJPPjs.getVersion.call(void 0, ),
|
|
223
223
|
logTime: Date.now(),
|
|
224
224
|
model_name: _env.getAIConfig.call(void 0, _env.MIDSCENE_MODEL_NAME) || ""
|
|
225
225
|
};
|
|
@@ -235,7 +235,7 @@ function emitInsightDump(data, dumpSubscriber) {
|
|
|
235
235
|
var debug = _logger.getDebug.call(void 0, "ai:insight");
|
|
236
236
|
var Insight = class {
|
|
237
237
|
constructor(context, opt) {
|
|
238
|
-
this.aiVendorFn =
|
|
238
|
+
this.aiVendorFn = _chunk7EB47UPFjs.callAiFn;
|
|
239
239
|
_utils.assert.call(void 0, context, "context is required for Insight");
|
|
240
240
|
if (typeof context === "function") {
|
|
241
241
|
this.contextRetrieverFn = context;
|
|
@@ -278,7 +278,7 @@ var Insight = class {
|
|
|
278
278
|
let searchAreaUsage = void 0;
|
|
279
279
|
let searchAreaResponse = void 0;
|
|
280
280
|
if (searchAreaPrompt) {
|
|
281
|
-
searchAreaResponse = await
|
|
281
|
+
searchAreaResponse = await _chunk7EB47UPFjs.AiLocateSection.call(void 0, {
|
|
282
282
|
context,
|
|
283
283
|
sectionDescription: searchAreaPrompt
|
|
284
284
|
});
|
|
@@ -291,7 +291,7 @@ var Insight = class {
|
|
|
291
291
|
searchArea = searchAreaResponse.rect;
|
|
292
292
|
}
|
|
293
293
|
const startTime = Date.now();
|
|
294
|
-
const { parseResult, rect, elementById, rawResponse, usage } = await
|
|
294
|
+
const { parseResult, rect, elementById, rawResponse, usage } = await _chunk7EB47UPFjs.AiLocateElement.call(void 0, {
|
|
295
295
|
callAI: callAI || this.aiVendorFn,
|
|
296
296
|
context,
|
|
297
297
|
targetElementDescription: queryPrompt,
|
|
@@ -379,7 +379,7 @@ ${parseResult.errors.join("\n")}`;
|
|
|
379
379
|
this.onceDumpUpdatedFn = void 0;
|
|
380
380
|
const context = await this.contextRetrieverFn("extract");
|
|
381
381
|
const startTime = Date.now();
|
|
382
|
-
const { parseResult, usage } = await
|
|
382
|
+
const { parseResult, usage } = await _chunk7EB47UPFjs.AiExtractElementInfo.call(void 0, {
|
|
383
383
|
context,
|
|
384
384
|
dataQuery: dataDemand,
|
|
385
385
|
extractOption: opt
|
|
@@ -431,7 +431,7 @@ ${parseResult.errors.join("\n")}`;
|
|
|
431
431
|
this.onceDumpUpdatedFn = void 0;
|
|
432
432
|
const context = await this.contextRetrieverFn("assert");
|
|
433
433
|
const startTime = Date.now();
|
|
434
|
-
const assertResult = await
|
|
434
|
+
const assertResult = await _chunk7EB47UPFjs.AiAssert.call(void 0, {
|
|
435
435
|
assertion,
|
|
436
436
|
context
|
|
437
437
|
});
|
|
@@ -485,7 +485,7 @@ ${parseResult.errors.join("\n")}`;
|
|
|
485
485
|
borderThickness: 3
|
|
486
486
|
});
|
|
487
487
|
if (_optionalChain([opt, 'optionalAccess', _22 => _22.deepThink])) {
|
|
488
|
-
const searchArea =
|
|
488
|
+
const searchArea = _chunk7EB47UPFjs.expandSearchArea.call(void 0, targetRect, context.size);
|
|
489
489
|
debug("describe: set searchArea", searchArea);
|
|
490
490
|
imagePayload = await _img.cropByRect.call(void 0,
|
|
491
491
|
imagePayload,
|
|
@@ -508,7 +508,7 @@ ${parseResult.errors.join("\n")}`;
|
|
|
508
508
|
]
|
|
509
509
|
}
|
|
510
510
|
];
|
|
511
|
-
const callAIFn = this.aiVendorFn ||
|
|
511
|
+
const callAIFn = this.aiVendorFn || _chunk7EB47UPFjs.callToGetJSONObject;
|
|
512
512
|
const res = await callAIFn(msgs, 4 /* DESCRIBE_ELEMENT */);
|
|
513
513
|
const { content } = res;
|
|
514
514
|
_utils.assert.call(void 0, !content.error, `describe failed: ${content.error}`);
|
|
@@ -531,6 +531,6 @@ var src_default = Insight;
|
|
|
531
531
|
|
|
532
532
|
|
|
533
533
|
|
|
534
|
-
exports.AiAssert =
|
|
534
|
+
exports.AiAssert = _chunk7EB47UPFjs.AiAssert; exports.AiLocateElement = _chunk7EB47UPFjs.AiLocateElement; exports.Executor = Executor; exports.Insight = Insight; exports.MIDSCENE_MODEL_NAME = _env.MIDSCENE_MODEL_NAME; exports.default = src_default; exports.describeUserPage = _chunk7EB47UPFjs.describeUserPage; exports.getAIConfig = _env.getAIConfig; exports.getVersion = _chunkNQEPCJPPjs.getVersion; exports.plan = _chunk7EB47UPFjs.plan;
|
|
535
535
|
|
|
536
536
|
//# sourceMappingURL=index.js.map
|
package/dist/lib/utils.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkNQEPCJPPjs = require('./chunk-NQEPCJPP.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -27,4 +27,4 @@ var _chunkFIMT74SQjs = require('./chunk-FIMT74SQ.js');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
exports.getTmpDir =
|
|
30
|
+
exports.getTmpDir = _chunkNQEPCJPPjs.getTmpDir; exports.getTmpFile = _chunkNQEPCJPPjs.getTmpFile; exports.getVersion = _chunkNQEPCJPPjs.getVersion; exports.groupedActionDumpFileExt = _chunkNQEPCJPPjs.groupedActionDumpFileExt; exports.overlapped = _chunkNQEPCJPPjs.overlapped; exports.replaceStringWithFirstAppearance = _chunkNQEPCJPPjs.replaceStringWithFirstAppearance; exports.replacerForPageObject = _chunkNQEPCJPPjs.replacerForPageObject; exports.reportHTMLContent = _chunkNQEPCJPPjs.reportHTMLContent; exports.sleep = _chunkNQEPCJPPjs.sleep; exports.stringifyDumpData = _chunkNQEPCJPPjs.stringifyDumpData; exports.uploadTestInfoToServer = _chunkNQEPCJPPjs.uploadTestInfoToServer; exports.writeDumpReport = _chunkNQEPCJPPjs.writeDumpReport; exports.writeLogFile = _chunkNQEPCJPPjs.writeLogFile;
|
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": "0.19.1-beta-
|
|
4
|
+
"version": "0.19.1-beta-20250616133247.0",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
7
7
|
"jsnext:source": "./src/index.ts",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"langsmith": "0.3.7",
|
|
45
45
|
"openai": "4.81.0",
|
|
46
46
|
"socks-proxy-agent": "8.0.4",
|
|
47
|
-
"@midscene/
|
|
48
|
-
"@midscene/
|
|
47
|
+
"@midscene/recorder": "0.19.1-beta-20250616133247.0",
|
|
48
|
+
"@midscene/shared": "0.19.1-beta-20250616133247.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@modern-js/module-tools": "2.60.6",
|
|
File without changes
|
|
File without changes
|