@midscene/core 0.24.1 → 0.24.2-beta-20250730081235.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.d.ts +3 -3
- package/dist/es/ai-model.js +1 -1
- package/dist/es/{chunk-HUEQURIG.js → chunk-KGBLKK6O.js} +3 -3
- package/dist/es/{chunk-TV47VKQ7.js → chunk-NAMQEUK6.js} +26 -7
- package/dist/es/chunk-NAMQEUK6.js.map +1 -0
- package/dist/es/index.d.ts +4 -4
- package/dist/es/index.js +2 -2
- package/dist/es/{llm-planning-3407bd42.d.ts → llm-planning-6575ef56.d.ts} +1 -1
- package/dist/es/{types-4d9c9a85.d.ts → types-7b554c6a.d.ts} +7 -2
- package/dist/es/utils.d.ts +1 -1
- package/dist/es/utils.js +1 -1
- package/dist/lib/ai-model.d.ts +3 -3
- package/dist/lib/ai-model.js +2 -2
- package/dist/lib/{chunk-HUEQURIG.js → chunk-KGBLKK6O.js} +3 -3
- package/dist/lib/{chunk-TV47VKQ7.js → chunk-NAMQEUK6.js} +26 -7
- package/dist/lib/chunk-NAMQEUK6.js.map +1 -0
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +12 -12
- package/dist/lib/{llm-planning-3407bd42.d.ts → llm-planning-6575ef56.d.ts} +1 -1
- package/dist/{types/types-4d9c9a85.d.ts → lib/types-7b554c6a.d.ts} +7 -2
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/types/ai-model.d.ts +3 -3
- package/dist/types/index.d.ts +4 -4
- package/dist/types/{llm-planning-3407bd42.d.ts → llm-planning-6575ef56.d.ts} +1 -1
- package/dist/{lib/types-4d9c9a85.d.ts → types/types-7b554c6a.d.ts} +7 -2
- package/dist/types/utils.d.ts +1 -1
- package/package.json +3 -3
- package/dist/es/chunk-TV47VKQ7.js.map +0 -1
- package/dist/lib/chunk-TV47VKQ7.js.map +0 -1
- /package/dist/es/{chunk-HUEQURIG.js.map → chunk-KGBLKK6O.js.map} +0 -0
- /package/dist/lib/{chunk-HUEQURIG.js.map → chunk-KGBLKK6O.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 _chunkKGBLKK6Ojs = require('./chunk-KGBLKK6O.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ var _chunkHUEQURIGjs = require('./chunk-HUEQURIG.js');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkNAMQEUK6js = require('./chunk-NAMQEUK6.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: _chunkKGBLKK6Ojs.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: _chunkKGBLKK6Ojs.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 = _chunkNAMQEUK6js.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 _chunkNAMQEUK6js.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 _chunkNAMQEUK6js.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 _chunkNAMQEUK6js.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 _chunkNAMQEUK6js.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 = _chunkNAMQEUK6js.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 || _chunkNAMQEUK6js.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 = _chunkNAMQEUK6js.AiAssert; exports.AiLocateElement = _chunkNAMQEUK6js.AiLocateElement; exports.Executor = Executor; exports.Insight = Insight; exports.MIDSCENE_MODEL_NAME = _env.MIDSCENE_MODEL_NAME; exports.default = src_default; exports.describeUserPage = _chunkNAMQEUK6js.describeUserPage; exports.getAIConfig = _env.getAIConfig; exports.getVersion = _chunkKGBLKK6Ojs.getVersion; exports.plan = _chunkNAMQEUK6js.plan;
|
|
535
535
|
|
|
536
536
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as AIUsageInfo, U as UIContext,
|
|
1
|
+
import { m as AIUsageInfo, U as UIContext, aD as ReferenceImage, r as AIElementLocatorResponse, N as ElementById, g as InsightExtractOption, u as AIDataExtractionResponse, w as AIAssertionResponse, ax as PageType, W as PlanningAIResponse } from './types-7b554c6a.js';
|
|
2
2
|
import { Rect, ElementTreeNode, BaseElement } from '@midscene/shared/types';
|
|
3
3
|
import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam } from 'openai/resources';
|
|
4
4
|
|
|
@@ -354,7 +354,7 @@ interface PlanningLocateParam extends DetailedLocateParam {
|
|
|
354
354
|
}
|
|
355
355
|
interface PlanningAction<ParamType = any> {
|
|
356
356
|
thought?: string;
|
|
357
|
-
type: 'Locate' | 'Tap' | 'RightClick' | 'Hover' | 'Drag' | 'Input' | 'KeyboardPress' | 'Scroll' | 'Error' | 'ExpectedFalsyCondition' | 'Assert' | 'AssertWithoutThrow' | 'Sleep' | 'Finished' | 'AndroidBackButton' | 'AndroidHomeButton' | 'AndroidRecentAppsButton';
|
|
357
|
+
type: 'Locate' | 'Tap' | 'RightClick' | 'Hover' | 'Drag' | 'Input' | 'KeyboardPress' | 'Scroll' | 'Error' | 'ExpectedFalsyCondition' | 'Assert' | 'AssertWithoutThrow' | 'Sleep' | 'Finished' | 'AndroidBackButton' | 'AndroidHomeButton' | 'AndroidRecentAppsButton' | 'AndroidLongPress';
|
|
358
358
|
param: ParamType;
|
|
359
359
|
locate?: PlanningLocateParam | null;
|
|
360
360
|
}
|
|
@@ -390,6 +390,11 @@ interface PlanningActionParamError {
|
|
|
390
390
|
type PlanningActionParamWaitFor = AgentWaitForOpt & {
|
|
391
391
|
assertion: string;
|
|
392
392
|
};
|
|
393
|
+
interface PlanningActionParamAndroidLongPress {
|
|
394
|
+
x: number;
|
|
395
|
+
y: number;
|
|
396
|
+
duration?: number;
|
|
397
|
+
}
|
|
393
398
|
/**
|
|
394
399
|
* misc
|
|
395
400
|
*/
|
|
@@ -525,4 +530,4 @@ interface StreamingAIResponse {
|
|
|
525
530
|
isStreamed: boolean;
|
|
526
531
|
}
|
|
527
532
|
|
|
528
|
-
export { type PlanningActionParamScroll as $, type AIDescribeElementResponse as A, type EnsureObject as B, type CallAIFn as C, type DumpSubscriber as D, type ExecutionTask as E, type InsightExtractParam as F, type LocateResultElement as G, type DumpMeta as H, type InsightAction as I, type InsightDump as J, type LiteUISection as K, type LocateResult as L, type MidsceneYamlScript as M, type ElementById as N, type OnTaskStartTip as O, type PartialInsightDumpFromSDK as P, type AgentWaitForOpt as Q, type ReportDumpWithAttributes as R, type AgentAssertOpt as S, type PlanningLocateParam as T, UIContext as U, type PlanningAction as V, type PlanningAIResponse as W, type PlanningActionParamTap as X, type PlanningActionParamHover as Y, type PlanningActionParamRightClick as Z, type PlanningActionParamInputOrKeyPress as _, type ExecutionTaskProgressOptions as a, type
|
|
533
|
+
export { type PlanningActionParamScroll as $, type AIDescribeElementResponse as A, type EnsureObject as B, type CallAIFn as C, type DumpSubscriber as D, type ExecutionTask as E, type InsightExtractParam as F, type LocateResultElement as G, type DumpMeta as H, type InsightAction as I, type InsightDump as J, type LiteUISection as K, type LocateResult as L, type MidsceneYamlScript as M, type ElementById as N, type OnTaskStartTip as O, type PartialInsightDumpFromSDK as P, type AgentWaitForOpt as Q, type ReportDumpWithAttributes as R, type AgentAssertOpt as S, type PlanningLocateParam as T, UIContext as U, type PlanningAction as V, type PlanningAIResponse as W, type PlanningActionParamTap as X, type PlanningActionParamHover as Y, type PlanningActionParamRightClick as Z, type PlanningActionParamInputOrKeyPress as _, type ExecutionTaskProgressOptions as a, type ScriptPlayerTaskStatus as a$, type PlanningActionParamAssert as a0, type PlanningActionParamSleep as a1, type PlanningActionParamError as a2, type PlanningActionParamWaitFor as a3, type PlanningActionParamAndroidLongPress as a4, type Color as a5, type BaseAgentParserOpt as a6, type PuppeteerParserOpt as a7, type PlaywrightParserOpt as a8, type ExecutionRecorderItem as a9, type CodeGenerationChunk as aA, type StreamingAIResponse as aB, type LocateOption as aC, type ReferenceImage as aD, type scrollParam as aE, type MidsceneYamlScriptEnvBase as aF, type MidsceneYamlScriptWebEnv as aG, type MidsceneYamlScriptAndroidEnv as aH, type MidsceneYamlScriptEnv as aI, type MidsceneYamlFlowItemAIAction as aJ, type MidsceneYamlFlowItemAIAssert as aK, type MidsceneYamlFlowItemAIQuery as aL, type MidsceneYamlFlowItemAINumber as aM, type MidsceneYamlFlowItemAIString as aN, type MidsceneYamlFlowItemAIAsk as aO, type MidsceneYamlFlowItemAIBoolean as aP, type MidsceneYamlFlowItemAILocate as aQ, type MidsceneYamlFlowItemAIWaitFor as aR, type MidsceneYamlFlowItemAITap as aS, type MidsceneYamlFlowItemAIHover as aT, type MidsceneYamlFlowItemAIInput as aU, type MidsceneYamlFlowItemAIKeyboardPress as aV, type MidsceneYamlFlowItemAIScroll as aW, type MidsceneYamlFlowItemEvaluateJavaScript as aX, type MidsceneYamlFlowItemSleep as aY, type MidsceneYamlFlowItemLogScreenshot as aZ, type FreeFn as a_, type ExecutionTaskType as aa, type ExecutorContext as ab, type ExecutionTaskHitBy as ac, type ExecutionTaskReturn as ad, type ExecutionTaskInsightLocateParam as ae, type ExecutionTaskInsightLocateOutput as af, type ExecutionTaskInsightDumpLog as ag, type ExecutionTaskInsightLocateApply as ah, type ExecutionTaskInsightLocate as ai, type ExecutionTaskInsightQueryParam as aj, type ExecutionTaskInsightQueryOutput as ak, type ExecutionTaskInsightQueryApply as al, type ExecutionTaskInsightQuery as am, type ExecutionTaskInsightAssertionParam as an, type ExecutionTaskInsightAssertionApply as ao, type ExecutionTaskInsightAssertion as ap, type ExecutionTaskActionApply as aq, type ExecutionTaskAction as ar, type ExecutionTaskLogApply as as, type ExecutionTaskLog as at, type ExecutionTaskPlanningApply as au, type ExecutionTaskPlanning as av, type GroupedActionDump as aw, type PageType as ax, type StreamingCodeGenerationOptions as ay, type StreamingCallback as az, type ExecutionTaskApply as b, type ScriptPlayerStatusValue as b0, type MidsceneYamlConfig as b1, type MidsceneYamlConfigOutput as b2, type ExecutionDump as c, type InsightTaskInfo as d, type InsightOptions as e, type DetailedLocateParam as f, type InsightExtractOption as g, type InsightAssertionResponse as h, type MidsceneYamlTask as i, type MidsceneYamlFlowItem as j, type MidsceneYamlFlowItemAIRightClick as k, type MidsceneYamlConfigResult as l, type AIUsageInfo as m, AIResponseFormat as n, type AISingleElementResponseById as o, type AISingleElementResponseByPosition as p, type AISingleElementResponse as q, type AIElementLocatorResponse as r, type AIElementCoordinatesResponse as s, type AIElementResponse as t, type AIDataExtractionResponse as u, type AISectionLocatorResponse as v, type AIAssertionResponse as w, type LocatorValidatorOption as x, type LocateValidatorResult as y, type AgentDescribeElementAtPointResult as z };
|
package/dist/lib/utils.d.ts
CHANGED
package/dist/lib/utils.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkKGBLKK6Ojs = require('./chunk-KGBLKK6O.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -27,4 +27,4 @@ var _chunkHUEQURIGjs = require('./chunk-HUEQURIG.js');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
exports.getTmpDir =
|
|
30
|
+
exports.getTmpDir = _chunkKGBLKK6Ojs.getTmpDir; exports.getTmpFile = _chunkKGBLKK6Ojs.getTmpFile; exports.getVersion = _chunkKGBLKK6Ojs.getVersion; exports.groupedActionDumpFileExt = _chunkKGBLKK6Ojs.groupedActionDumpFileExt; exports.insertScriptBeforeClosingHtml = _chunkKGBLKK6Ojs.insertScriptBeforeClosingHtml; exports.overlapped = _chunkKGBLKK6Ojs.overlapped; exports.replacerForPageObject = _chunkKGBLKK6Ojs.replacerForPageObject; exports.reportHTMLContent = _chunkKGBLKK6Ojs.reportHTMLContent; exports.sleep = _chunkKGBLKK6Ojs.sleep; exports.stringifyDumpData = _chunkKGBLKK6Ojs.stringifyDumpData; exports.uploadTestInfoToServer = _chunkKGBLKK6Ojs.uploadTestInfoToServer; exports.writeDumpReport = _chunkKGBLKK6Ojs.writeDumpReport; exports.writeLogFile = _chunkKGBLKK6Ojs.writeLogFile;
|
package/dist/types/ai-model.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { az as StreamingCallback, m as AIUsageInfo, ay as StreamingCodeGenerationOptions, aB as StreamingAIResponse, V as PlanningAction, j as MidsceneYamlFlowItem } from './types-7b554c6a.js';
|
|
2
2
|
import OpenAI from 'openai';
|
|
3
3
|
import { ChatCompletionMessageParam } from 'openai/resources';
|
|
4
4
|
export { ChatCompletionMessageParam } from 'openai/resources';
|
|
5
|
-
import { b as AIActionType } from './llm-planning-
|
|
6
|
-
export { a as AiAssert, f as AiExtractElementInfo, A as AiLocateElement, g as AiLocateSection, h as adaptBboxToRect, c as callAiFn, d as describeUserPage, e as elementByPositionWithElementInfo, p as plan } from './llm-planning-
|
|
5
|
+
import { b as AIActionType } from './llm-planning-6575ef56.js';
|
|
6
|
+
export { a as AiAssert, f as AiExtractElementInfo, A as AiLocateElement, g as AiLocateSection, h as adaptBboxToRect, c as callAiFn, d as describeUserPage, e as elementByPositionWithElementInfo, p as plan } from './llm-planning-6575ef56.js';
|
|
7
7
|
import { vlLocateMode } from '@midscene/shared/env';
|
|
8
8
|
import { actionParser } from '@ui-tars/action-parser';
|
|
9
9
|
import { Size } from '@midscene/shared/types';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as ExecutionTask, a as ExecutionTaskProgressOptions, b as ExecutionTaskApply, c as ExecutionDump, U as UIContext, I as InsightAction, D as DumpSubscriber, d as InsightTaskInfo, e as InsightOptions, f as DetailedLocateParam, L as LocateResult, g as InsightExtractOption, h as InsightAssertionResponse, A as AIDescribeElementResponse } from './types-
|
|
2
|
-
export { w as AIAssertionResponse, u as AIDataExtractionResponse, s as AIElementCoordinatesResponse, r as AIElementLocatorResponse, t as AIElementResponse, n as AIResponseFormat, v as AISectionLocatorResponse, q as AISingleElementResponse, o as AISingleElementResponseById, p as AISingleElementResponseByPosition, m as AIUsageInfo, S as AgentAssertOpt, z as AgentDescribeElementAtPointResult, Q as AgentWaitForOpt,
|
|
3
|
-
import { c as callAiFn } from './llm-planning-
|
|
4
|
-
export { a as AiAssert, A as AiLocateElement, d as describeUserPage, p as plan } from './llm-planning-
|
|
1
|
+
import { E as ExecutionTask, a as ExecutionTaskProgressOptions, b as ExecutionTaskApply, c as ExecutionDump, U as UIContext, I as InsightAction, D as DumpSubscriber, d as InsightTaskInfo, e as InsightOptions, f as DetailedLocateParam, L as LocateResult, g as InsightExtractOption, h as InsightAssertionResponse, A as AIDescribeElementResponse } from './types-7b554c6a.js';
|
|
2
|
+
export { w as AIAssertionResponse, u as AIDataExtractionResponse, s as AIElementCoordinatesResponse, r as AIElementLocatorResponse, t as AIElementResponse, n as AIResponseFormat, v as AISectionLocatorResponse, q as AISingleElementResponse, o as AISingleElementResponseById, p as AISingleElementResponseByPosition, m as AIUsageInfo, S as AgentAssertOpt, z as AgentDescribeElementAtPointResult, Q as AgentWaitForOpt, a6 as BaseAgentParserOpt, C as CallAIFn, aA as CodeGenerationChunk, a5 as Color, H as DumpMeta, N as ElementById, B as EnsureObject, a9 as ExecutionRecorderItem, ar as ExecutionTaskAction, aq as ExecutionTaskActionApply, ac as ExecutionTaskHitBy, ap as ExecutionTaskInsightAssertion, ao as ExecutionTaskInsightAssertionApply, an as ExecutionTaskInsightAssertionParam, ag as ExecutionTaskInsightDumpLog, ai as ExecutionTaskInsightLocate, ah as ExecutionTaskInsightLocateApply, af as ExecutionTaskInsightLocateOutput, ae as ExecutionTaskInsightLocateParam, am as ExecutionTaskInsightQuery, al as ExecutionTaskInsightQueryApply, ak as ExecutionTaskInsightQueryOutput, aj as ExecutionTaskInsightQueryParam, at as ExecutionTaskLog, as as ExecutionTaskLogApply, av as ExecutionTaskPlanning, au as ExecutionTaskPlanningApply, ad as ExecutionTaskReturn, aa as ExecutionTaskType, ab as ExecutorContext, a_ as FreeFn, aw as GroupedActionDump, J as InsightDump, F as InsightExtractParam, K as LiteUISection, aC as LocateOption, G as LocateResultElement, y as LocateValidatorResult, x as LocatorValidatorOption, b1 as MidsceneYamlConfig, b2 as MidsceneYamlConfigOutput, l as MidsceneYamlConfigResult, j as MidsceneYamlFlowItem, aJ as MidsceneYamlFlowItemAIAction, aO as MidsceneYamlFlowItemAIAsk, aK as MidsceneYamlFlowItemAIAssert, aP as MidsceneYamlFlowItemAIBoolean, aT as MidsceneYamlFlowItemAIHover, aU as MidsceneYamlFlowItemAIInput, aV as MidsceneYamlFlowItemAIKeyboardPress, aQ as MidsceneYamlFlowItemAILocate, aM as MidsceneYamlFlowItemAINumber, aL as MidsceneYamlFlowItemAIQuery, k as MidsceneYamlFlowItemAIRightClick, aW as MidsceneYamlFlowItemAIScroll, aN as MidsceneYamlFlowItemAIString, aS as MidsceneYamlFlowItemAITap, aR as MidsceneYamlFlowItemAIWaitFor, aX as MidsceneYamlFlowItemEvaluateJavaScript, aZ as MidsceneYamlFlowItemLogScreenshot, aY as MidsceneYamlFlowItemSleep, M as MidsceneYamlScript, aH as MidsceneYamlScriptAndroidEnv, aI as MidsceneYamlScriptEnv, aF as MidsceneYamlScriptEnvBase, aG as MidsceneYamlScriptWebEnv, i as MidsceneYamlTask, O as OnTaskStartTip, ax as PageType, P as PartialInsightDumpFromSDK, W as PlanningAIResponse, V as PlanningAction, a4 as PlanningActionParamAndroidLongPress, a0 as PlanningActionParamAssert, a2 as PlanningActionParamError, Y as PlanningActionParamHover, _ as PlanningActionParamInputOrKeyPress, Z as PlanningActionParamRightClick, $ as PlanningActionParamScroll, a1 as PlanningActionParamSleep, X as PlanningActionParamTap, a3 as PlanningActionParamWaitFor, T as PlanningLocateParam, a8 as PlaywrightParserOpt, a7 as PuppeteerParserOpt, aD as ReferenceImage, R as ReportDumpWithAttributes, b0 as ScriptPlayerStatusValue, a$ as ScriptPlayerTaskStatus, aB as StreamingAIResponse, az as StreamingCallback, ay as StreamingCodeGenerationOptions, aE as scrollParam } from './types-7b554c6a.js';
|
|
3
|
+
import { c as callAiFn } from './llm-planning-6575ef56.js';
|
|
4
|
+
export { a as AiAssert, A as AiLocateElement, d as describeUserPage, p as plan } from './llm-planning-6575ef56.js';
|
|
5
5
|
import { BaseElement, Rect } from '@midscene/shared/types';
|
|
6
6
|
export { BaseElement, ElementTreeNode, Point, Rect, Size } from '@midscene/shared/types';
|
|
7
7
|
export { getVersion } from './utils.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as AIUsageInfo, U as UIContext,
|
|
1
|
+
import { m as AIUsageInfo, U as UIContext, aD as ReferenceImage, r as AIElementLocatorResponse, N as ElementById, g as InsightExtractOption, u as AIDataExtractionResponse, w as AIAssertionResponse, ax as PageType, W as PlanningAIResponse } from './types-7b554c6a.js';
|
|
2
2
|
import { Rect, ElementTreeNode, BaseElement } from '@midscene/shared/types';
|
|
3
3
|
import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam } from 'openai/resources';
|
|
4
4
|
|
|
@@ -354,7 +354,7 @@ interface PlanningLocateParam extends DetailedLocateParam {
|
|
|
354
354
|
}
|
|
355
355
|
interface PlanningAction<ParamType = any> {
|
|
356
356
|
thought?: string;
|
|
357
|
-
type: 'Locate' | 'Tap' | 'RightClick' | 'Hover' | 'Drag' | 'Input' | 'KeyboardPress' | 'Scroll' | 'Error' | 'ExpectedFalsyCondition' | 'Assert' | 'AssertWithoutThrow' | 'Sleep' | 'Finished' | 'AndroidBackButton' | 'AndroidHomeButton' | 'AndroidRecentAppsButton';
|
|
357
|
+
type: 'Locate' | 'Tap' | 'RightClick' | 'Hover' | 'Drag' | 'Input' | 'KeyboardPress' | 'Scroll' | 'Error' | 'ExpectedFalsyCondition' | 'Assert' | 'AssertWithoutThrow' | 'Sleep' | 'Finished' | 'AndroidBackButton' | 'AndroidHomeButton' | 'AndroidRecentAppsButton' | 'AndroidLongPress';
|
|
358
358
|
param: ParamType;
|
|
359
359
|
locate?: PlanningLocateParam | null;
|
|
360
360
|
}
|
|
@@ -390,6 +390,11 @@ interface PlanningActionParamError {
|
|
|
390
390
|
type PlanningActionParamWaitFor = AgentWaitForOpt & {
|
|
391
391
|
assertion: string;
|
|
392
392
|
};
|
|
393
|
+
interface PlanningActionParamAndroidLongPress {
|
|
394
|
+
x: number;
|
|
395
|
+
y: number;
|
|
396
|
+
duration?: number;
|
|
397
|
+
}
|
|
393
398
|
/**
|
|
394
399
|
* misc
|
|
395
400
|
*/
|
|
@@ -525,4 +530,4 @@ interface StreamingAIResponse {
|
|
|
525
530
|
isStreamed: boolean;
|
|
526
531
|
}
|
|
527
532
|
|
|
528
|
-
export { type PlanningActionParamScroll as $, type AIDescribeElementResponse as A, type EnsureObject as B, type CallAIFn as C, type DumpSubscriber as D, type ExecutionTask as E, type InsightExtractParam as F, type LocateResultElement as G, type DumpMeta as H, type InsightAction as I, type InsightDump as J, type LiteUISection as K, type LocateResult as L, type MidsceneYamlScript as M, type ElementById as N, type OnTaskStartTip as O, type PartialInsightDumpFromSDK as P, type AgentWaitForOpt as Q, type ReportDumpWithAttributes as R, type AgentAssertOpt as S, type PlanningLocateParam as T, UIContext as U, type PlanningAction as V, type PlanningAIResponse as W, type PlanningActionParamTap as X, type PlanningActionParamHover as Y, type PlanningActionParamRightClick as Z, type PlanningActionParamInputOrKeyPress as _, type ExecutionTaskProgressOptions as a, type
|
|
533
|
+
export { type PlanningActionParamScroll as $, type AIDescribeElementResponse as A, type EnsureObject as B, type CallAIFn as C, type DumpSubscriber as D, type ExecutionTask as E, type InsightExtractParam as F, type LocateResultElement as G, type DumpMeta as H, type InsightAction as I, type InsightDump as J, type LiteUISection as K, type LocateResult as L, type MidsceneYamlScript as M, type ElementById as N, type OnTaskStartTip as O, type PartialInsightDumpFromSDK as P, type AgentWaitForOpt as Q, type ReportDumpWithAttributes as R, type AgentAssertOpt as S, type PlanningLocateParam as T, UIContext as U, type PlanningAction as V, type PlanningAIResponse as W, type PlanningActionParamTap as X, type PlanningActionParamHover as Y, type PlanningActionParamRightClick as Z, type PlanningActionParamInputOrKeyPress as _, type ExecutionTaskProgressOptions as a, type ScriptPlayerTaskStatus as a$, type PlanningActionParamAssert as a0, type PlanningActionParamSleep as a1, type PlanningActionParamError as a2, type PlanningActionParamWaitFor as a3, type PlanningActionParamAndroidLongPress as a4, type Color as a5, type BaseAgentParserOpt as a6, type PuppeteerParserOpt as a7, type PlaywrightParserOpt as a8, type ExecutionRecorderItem as a9, type CodeGenerationChunk as aA, type StreamingAIResponse as aB, type LocateOption as aC, type ReferenceImage as aD, type scrollParam as aE, type MidsceneYamlScriptEnvBase as aF, type MidsceneYamlScriptWebEnv as aG, type MidsceneYamlScriptAndroidEnv as aH, type MidsceneYamlScriptEnv as aI, type MidsceneYamlFlowItemAIAction as aJ, type MidsceneYamlFlowItemAIAssert as aK, type MidsceneYamlFlowItemAIQuery as aL, type MidsceneYamlFlowItemAINumber as aM, type MidsceneYamlFlowItemAIString as aN, type MidsceneYamlFlowItemAIAsk as aO, type MidsceneYamlFlowItemAIBoolean as aP, type MidsceneYamlFlowItemAILocate as aQ, type MidsceneYamlFlowItemAIWaitFor as aR, type MidsceneYamlFlowItemAITap as aS, type MidsceneYamlFlowItemAIHover as aT, type MidsceneYamlFlowItemAIInput as aU, type MidsceneYamlFlowItemAIKeyboardPress as aV, type MidsceneYamlFlowItemAIScroll as aW, type MidsceneYamlFlowItemEvaluateJavaScript as aX, type MidsceneYamlFlowItemSleep as aY, type MidsceneYamlFlowItemLogScreenshot as aZ, type FreeFn as a_, type ExecutionTaskType as aa, type ExecutorContext as ab, type ExecutionTaskHitBy as ac, type ExecutionTaskReturn as ad, type ExecutionTaskInsightLocateParam as ae, type ExecutionTaskInsightLocateOutput as af, type ExecutionTaskInsightDumpLog as ag, type ExecutionTaskInsightLocateApply as ah, type ExecutionTaskInsightLocate as ai, type ExecutionTaskInsightQueryParam as aj, type ExecutionTaskInsightQueryOutput as ak, type ExecutionTaskInsightQueryApply as al, type ExecutionTaskInsightQuery as am, type ExecutionTaskInsightAssertionParam as an, type ExecutionTaskInsightAssertionApply as ao, type ExecutionTaskInsightAssertion as ap, type ExecutionTaskActionApply as aq, type ExecutionTaskAction as ar, type ExecutionTaskLogApply as as, type ExecutionTaskLog as at, type ExecutionTaskPlanningApply as au, type ExecutionTaskPlanning as av, type GroupedActionDump as aw, type PageType as ax, type StreamingCodeGenerationOptions as ay, type StreamingCallback as az, type ExecutionTaskApply as b, type ScriptPlayerStatusValue as b0, type MidsceneYamlConfig as b1, type MidsceneYamlConfigOutput as b2, type ExecutionDump as c, type InsightTaskInfo as d, type InsightOptions as e, type DetailedLocateParam as f, type InsightExtractOption as g, type InsightAssertionResponse as h, type MidsceneYamlTask as i, type MidsceneYamlFlowItem as j, type MidsceneYamlFlowItemAIRightClick as k, type MidsceneYamlConfigResult as l, type AIUsageInfo as m, AIResponseFormat as n, type AISingleElementResponseById as o, type AISingleElementResponseByPosition as p, type AISingleElementResponse as q, type AIElementLocatorResponse as r, type AIElementCoordinatesResponse as s, type AIElementResponse as t, type AIDataExtractionResponse as u, type AISectionLocatorResponse as v, type AIAssertionResponse as w, type LocatorValidatorOption as x, type LocateValidatorResult as y, type AgentDescribeElementAtPointResult as z };
|
package/dist/types/utils.d.ts
CHANGED
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.24.
|
|
4
|
+
"version": "0.24.2-beta-20250730081235.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/recorder": "0.24.
|
|
48
|
-
"@midscene/shared": "0.24.
|
|
47
|
+
"@midscene/recorder": "0.24.2-beta-20250730081235.0",
|
|
48
|
+
"@midscene/shared": "0.24.2-beta-20250730081235.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@modern-js/module-tools": "2.60.6",
|