@midscene/core 0.24.2-beta-20250731030716.0 → 0.24.2-beta-20250731035845.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-6AFIPCHE.js → chunk-2ZBEOLD7.js} +12 -7
- package/dist/es/chunk-2ZBEOLD7.js.map +1 -0
- package/dist/es/{chunk-3LFZDNMQ.js → chunk-YCHAOUOW.js} +7 -46
- package/dist/es/chunk-YCHAOUOW.js.map +1 -0
- package/dist/es/index.d.ts +4 -4
- package/dist/es/index.js +2 -2
- package/dist/es/{llm-planning-ae19dc49.d.ts → llm-planning-3f26578e.d.ts} +1 -1
- package/dist/es/{types-d187efec.d.ts → types-c519555a.d.ts} +2 -16
- 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-6AFIPCHE.js → chunk-2ZBEOLD7.js} +11 -6
- package/dist/lib/chunk-2ZBEOLD7.js.map +1 -0
- package/dist/lib/{chunk-3LFZDNMQ.js → chunk-YCHAOUOW.js} +7 -46
- package/dist/lib/chunk-YCHAOUOW.js.map +1 -0
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +12 -12
- package/dist/lib/{llm-planning-ae19dc49.d.ts → llm-planning-3f26578e.d.ts} +1 -1
- package/dist/{types/types-d187efec.d.ts → lib/types-c519555a.d.ts} +2 -16
- 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-ae19dc49.d.ts → llm-planning-3f26578e.d.ts} +1 -1
- package/dist/{lib/types-d187efec.d.ts → types/types-c519555a.d.ts} +2 -16
- package/dist/types/utils.d.ts +1 -1
- package/package.json +3 -3
- package/dist/es/chunk-3LFZDNMQ.js.map +0 -1
- package/dist/es/chunk-6AFIPCHE.js.map +0 -1
- package/dist/lib/chunk-3LFZDNMQ.js.map +0 -1
- package/dist/lib/chunk-6AFIPCHE.js.map +0 -1
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 _chunk2ZBEOLD7js = require('./chunk-2ZBEOLD7.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ var _chunk6AFIPCHEjs = require('./chunk-6AFIPCHE.js');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkYCHAOUOWjs = require('./chunk-YCHAOUOW.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: _chunk2ZBEOLD7js.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: _chunk2ZBEOLD7js.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 = _chunkYCHAOUOWjs.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 _chunkYCHAOUOWjs.AiLocateSection.call(void 0, {
|
|
282
282
|
context,
|
|
283
283
|
sectionDescription: searchAreaPrompt
|
|
284
284
|
});
|
|
@@ -298,7 +298,7 @@ var Insight = class {
|
|
|
298
298
|
rawResponse,
|
|
299
299
|
usage,
|
|
300
300
|
isOrderSensitive
|
|
301
|
-
} = await
|
|
301
|
+
} = await _chunkYCHAOUOWjs.AiLocateElement.call(void 0, {
|
|
302
302
|
callAI: callAI || this.aiVendorFn,
|
|
303
303
|
context,
|
|
304
304
|
targetElementDescription: queryPrompt,
|
|
@@ -387,7 +387,7 @@ ${parseResult.errors.join("\n")}`;
|
|
|
387
387
|
this.onceDumpUpdatedFn = void 0;
|
|
388
388
|
const context = await this.contextRetrieverFn("extract");
|
|
389
389
|
const startTime = Date.now();
|
|
390
|
-
const { parseResult, usage } = await
|
|
390
|
+
const { parseResult, usage } = await _chunkYCHAOUOWjs.AiExtractElementInfo.call(void 0, {
|
|
391
391
|
context,
|
|
392
392
|
dataQuery: dataDemand,
|
|
393
393
|
extractOption: opt
|
|
@@ -439,7 +439,7 @@ ${parseResult.errors.join("\n")}`;
|
|
|
439
439
|
this.onceDumpUpdatedFn = void 0;
|
|
440
440
|
const context = await this.contextRetrieverFn("assert");
|
|
441
441
|
const startTime = Date.now();
|
|
442
|
-
const assertResult = await
|
|
442
|
+
const assertResult = await _chunkYCHAOUOWjs.AiAssert.call(void 0, {
|
|
443
443
|
assertion,
|
|
444
444
|
context
|
|
445
445
|
});
|
|
@@ -493,7 +493,7 @@ ${parseResult.errors.join("\n")}`;
|
|
|
493
493
|
borderThickness: 3
|
|
494
494
|
});
|
|
495
495
|
if (_optionalChain([opt, 'optionalAccess', _22 => _22.deepThink])) {
|
|
496
|
-
const searchArea =
|
|
496
|
+
const searchArea = _chunkYCHAOUOWjs.expandSearchArea.call(void 0, targetRect, context.size);
|
|
497
497
|
debug("describe: set searchArea", searchArea);
|
|
498
498
|
imagePayload = await _img.cropByRect.call(void 0,
|
|
499
499
|
imagePayload,
|
|
@@ -516,7 +516,7 @@ ${parseResult.errors.join("\n")}`;
|
|
|
516
516
|
]
|
|
517
517
|
}
|
|
518
518
|
];
|
|
519
|
-
const callAIFn = this.aiVendorFn ||
|
|
519
|
+
const callAIFn = this.aiVendorFn || _chunkYCHAOUOWjs.callToGetJSONObject;
|
|
520
520
|
const res = await callAIFn(msgs, 4 /* DESCRIBE_ELEMENT */);
|
|
521
521
|
const { content } = res;
|
|
522
522
|
_utils.assert.call(void 0, !content.error, `describe failed: ${content.error}`);
|
|
@@ -539,6 +539,6 @@ var src_default = Insight;
|
|
|
539
539
|
|
|
540
540
|
|
|
541
541
|
|
|
542
|
-
exports.AiAssert =
|
|
542
|
+
exports.AiAssert = _chunkYCHAOUOWjs.AiAssert; exports.AiLocateElement = _chunkYCHAOUOWjs.AiLocateElement; exports.Executor = Executor; exports.Insight = Insight; exports.MIDSCENE_MODEL_NAME = _env.MIDSCENE_MODEL_NAME; exports.default = src_default; exports.describeUserPage = _chunkYCHAOUOWjs.describeUserPage; exports.getAIConfig = _env.getAIConfig; exports.getVersion = _chunk2ZBEOLD7js.getVersion; exports.plan = _chunkYCHAOUOWjs.plan;
|
|
543
543
|
|
|
544
544
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as AIUsageInfo, U as UIContext,
|
|
1
|
+
import { m as AIUsageInfo, U as UIContext, aC as ReferenceImage, r as AIElementLocatorResponse, N as ElementById, g as InsightExtractOption, u as AIDataExtractionResponse, w as AIAssertionResponse, aw as PageType, W as PlanningAIResponse } from './types-c519555a.js';
|
|
2
2
|
import { Rect, ElementTreeNode, BaseElement } from '@midscene/shared/types';
|
|
3
3
|
import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam } from 'openai/resources';
|
|
4
4
|
|
|
@@ -357,7 +357,7 @@ interface PlanningLocateParam extends DetailedLocateParam {
|
|
|
357
357
|
}
|
|
358
358
|
interface PlanningAction<ParamType = any> {
|
|
359
359
|
thought?: string;
|
|
360
|
-
type: 'Locate' | 'Tap' | 'RightClick' | 'Hover' | 'Drag' | 'Input' | 'KeyboardPress' | 'Scroll' | 'Error' | 'ExpectedFalsyCondition' | 'Assert' | 'AssertWithoutThrow' | 'Sleep' | 'Finished' | 'AndroidBackButton' | 'AndroidHomeButton' | 'AndroidRecentAppsButton'
|
|
360
|
+
type: 'Locate' | 'Tap' | 'RightClick' | 'Hover' | 'Drag' | 'Input' | 'KeyboardPress' | 'Scroll' | 'Error' | 'ExpectedFalsyCondition' | 'Assert' | 'AssertWithoutThrow' | 'Sleep' | 'Finished' | 'AndroidBackButton' | 'AndroidHomeButton' | 'AndroidRecentAppsButton';
|
|
361
361
|
param: ParamType;
|
|
362
362
|
locate?: PlanningLocateParam | null;
|
|
363
363
|
}
|
|
@@ -393,20 +393,6 @@ interface PlanningActionParamError {
|
|
|
393
393
|
type PlanningActionParamWaitFor = AgentWaitForOpt & {
|
|
394
394
|
assertion: string;
|
|
395
395
|
};
|
|
396
|
-
interface PlanningActionParamAndroidLongPress {
|
|
397
|
-
x: number;
|
|
398
|
-
y: number;
|
|
399
|
-
duration?: number;
|
|
400
|
-
}
|
|
401
|
-
interface PlanningActionParamAndroidPull {
|
|
402
|
-
direction: 'up' | 'down';
|
|
403
|
-
startPoint?: {
|
|
404
|
-
x: number;
|
|
405
|
-
y: number;
|
|
406
|
-
};
|
|
407
|
-
distance?: number;
|
|
408
|
-
duration?: number;
|
|
409
|
-
}
|
|
410
396
|
/**
|
|
411
397
|
* misc
|
|
412
398
|
*/
|
|
@@ -542,4 +528,4 @@ interface StreamingAIResponse {
|
|
|
542
528
|
isStreamed: boolean;
|
|
543
529
|
}
|
|
544
530
|
|
|
545
|
-
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
|
|
531
|
+
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 ScriptPlayerStatusValue as a$, type PlanningActionParamAssert as a0, type PlanningActionParamSleep as a1, type PlanningActionParamError as a2, type PlanningActionParamWaitFor as a3, type Color as a4, type BaseAgentParserOpt as a5, type PuppeteerParserOpt as a6, type PlaywrightParserOpt as a7, type ExecutionRecorderItem as a8, type ExecutionTaskType as a9, type StreamingAIResponse as aA, type LocateOption as aB, type ReferenceImage as aC, type scrollParam as aD, type MidsceneYamlScriptEnvBase as aE, type MidsceneYamlScriptWebEnv as aF, type MidsceneYamlScriptAndroidEnv as aG, type MidsceneYamlScriptEnv as aH, type MidsceneYamlFlowItemAIAction as aI, type MidsceneYamlFlowItemAIAssert as aJ, type MidsceneYamlFlowItemAIQuery as aK, type MidsceneYamlFlowItemAINumber as aL, type MidsceneYamlFlowItemAIString as aM, type MidsceneYamlFlowItemAIAsk as aN, type MidsceneYamlFlowItemAIBoolean as aO, type MidsceneYamlFlowItemAILocate as aP, type MidsceneYamlFlowItemAIWaitFor as aQ, type MidsceneYamlFlowItemAITap as aR, type MidsceneYamlFlowItemAIHover as aS, type MidsceneYamlFlowItemAIInput as aT, type MidsceneYamlFlowItemAIKeyboardPress as aU, type MidsceneYamlFlowItemAIScroll as aV, type MidsceneYamlFlowItemEvaluateJavaScript as aW, type MidsceneYamlFlowItemSleep as aX, type MidsceneYamlFlowItemLogScreenshot as aY, type FreeFn as aZ, type ScriptPlayerTaskStatus as a_, type ExecutorContext as aa, type ExecutionTaskHitBy as ab, type ExecutionTaskReturn as ac, type ExecutionTaskInsightLocateParam as ad, type ExecutionTaskInsightLocateOutput as ae, type ExecutionTaskInsightDumpLog as af, type ExecutionTaskInsightLocateApply as ag, type ExecutionTaskInsightLocate as ah, type ExecutionTaskInsightQueryParam as ai, type ExecutionTaskInsightQueryOutput as aj, type ExecutionTaskInsightQueryApply as ak, type ExecutionTaskInsightQuery as al, type ExecutionTaskInsightAssertionParam as am, type ExecutionTaskInsightAssertionApply as an, type ExecutionTaskInsightAssertion as ao, type ExecutionTaskActionApply as ap, type ExecutionTaskAction as aq, type ExecutionTaskLogApply as ar, type ExecutionTaskLog as as, type ExecutionTaskPlanningApply as at, type ExecutionTaskPlanning as au, type GroupedActionDump as av, type PageType as aw, type StreamingCodeGenerationOptions as ax, type StreamingCallback as ay, type CodeGenerationChunk as az, type ExecutionTaskApply as b, type MidsceneYamlConfig as b0, type MidsceneYamlConfigOutput as b1, 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 _chunk2ZBEOLD7js = require('./chunk-2ZBEOLD7.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -27,4 +27,4 @@ var _chunk6AFIPCHEjs = require('./chunk-6AFIPCHE.js');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
exports.getTmpDir =
|
|
30
|
+
exports.getTmpDir = _chunk2ZBEOLD7js.getTmpDir; exports.getTmpFile = _chunk2ZBEOLD7js.getTmpFile; exports.getVersion = _chunk2ZBEOLD7js.getVersion; exports.groupedActionDumpFileExt = _chunk2ZBEOLD7js.groupedActionDumpFileExt; exports.insertScriptBeforeClosingHtml = _chunk2ZBEOLD7js.insertScriptBeforeClosingHtml; exports.overlapped = _chunk2ZBEOLD7js.overlapped; exports.replacerForPageObject = _chunk2ZBEOLD7js.replacerForPageObject; exports.reportHTMLContent = _chunk2ZBEOLD7js.reportHTMLContent; exports.sleep = _chunk2ZBEOLD7js.sleep; exports.stringifyDumpData = _chunk2ZBEOLD7js.stringifyDumpData; exports.uploadTestInfoToServer = _chunk2ZBEOLD7js.uploadTestInfoToServer; exports.writeDumpReport = _chunk2ZBEOLD7js.writeDumpReport; exports.writeLogFile = _chunk2ZBEOLD7js.writeLogFile;
|
package/dist/types/ai-model.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ay as StreamingCallback, m as AIUsageInfo, ax as StreamingCodeGenerationOptions, aA as StreamingAIResponse, V as PlanningAction, j as MidsceneYamlFlowItem } from './types-c519555a.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-3f26578e.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-3f26578e.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-c519555a.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, a5 as BaseAgentParserOpt, C as CallAIFn, az as CodeGenerationChunk, a4 as Color, H as DumpMeta, N as ElementById, B as EnsureObject, a8 as ExecutionRecorderItem, aq as ExecutionTaskAction, ap as ExecutionTaskActionApply, ab as ExecutionTaskHitBy, ao as ExecutionTaskInsightAssertion, an as ExecutionTaskInsightAssertionApply, am as ExecutionTaskInsightAssertionParam, af as ExecutionTaskInsightDumpLog, ah as ExecutionTaskInsightLocate, ag as ExecutionTaskInsightLocateApply, ae as ExecutionTaskInsightLocateOutput, ad as ExecutionTaskInsightLocateParam, al as ExecutionTaskInsightQuery, ak as ExecutionTaskInsightQueryApply, aj as ExecutionTaskInsightQueryOutput, ai as ExecutionTaskInsightQueryParam, as as ExecutionTaskLog, ar as ExecutionTaskLogApply, au as ExecutionTaskPlanning, at as ExecutionTaskPlanningApply, ac as ExecutionTaskReturn, a9 as ExecutionTaskType, aa as ExecutorContext, aZ as FreeFn, av as GroupedActionDump, J as InsightDump, F as InsightExtractParam, K as LiteUISection, aB as LocateOption, G as LocateResultElement, y as LocateValidatorResult, x as LocatorValidatorOption, b0 as MidsceneYamlConfig, b1 as MidsceneYamlConfigOutput, l as MidsceneYamlConfigResult, j as MidsceneYamlFlowItem, aI as MidsceneYamlFlowItemAIAction, aN as MidsceneYamlFlowItemAIAsk, aJ as MidsceneYamlFlowItemAIAssert, aO as MidsceneYamlFlowItemAIBoolean, aS as MidsceneYamlFlowItemAIHover, aT as MidsceneYamlFlowItemAIInput, aU as MidsceneYamlFlowItemAIKeyboardPress, aP as MidsceneYamlFlowItemAILocate, aL as MidsceneYamlFlowItemAINumber, aK as MidsceneYamlFlowItemAIQuery, k as MidsceneYamlFlowItemAIRightClick, aV as MidsceneYamlFlowItemAIScroll, aM as MidsceneYamlFlowItemAIString, aR as MidsceneYamlFlowItemAITap, aQ as MidsceneYamlFlowItemAIWaitFor, aW as MidsceneYamlFlowItemEvaluateJavaScript, aY as MidsceneYamlFlowItemLogScreenshot, aX as MidsceneYamlFlowItemSleep, M as MidsceneYamlScript, aG as MidsceneYamlScriptAndroidEnv, aH as MidsceneYamlScriptEnv, aE as MidsceneYamlScriptEnvBase, aF as MidsceneYamlScriptWebEnv, i as MidsceneYamlTask, O as OnTaskStartTip, aw as PageType, P as PartialInsightDumpFromSDK, W as PlanningAIResponse, V as PlanningAction, 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, a7 as PlaywrightParserOpt, a6 as PuppeteerParserOpt, aC as ReferenceImage, R as ReportDumpWithAttributes, a$ as ScriptPlayerStatusValue, a_ as ScriptPlayerTaskStatus, aA as StreamingAIResponse, ay as StreamingCallback, ax as StreamingCodeGenerationOptions, aD as scrollParam } from './types-c519555a.js';
|
|
3
|
+
import { c as callAiFn } from './llm-planning-3f26578e.js';
|
|
4
|
+
export { a as AiAssert, A as AiLocateElement, d as describeUserPage, p as plan } from './llm-planning-3f26578e.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, aC as ReferenceImage, r as AIElementLocatorResponse, N as ElementById, g as InsightExtractOption, u as AIDataExtractionResponse, w as AIAssertionResponse, aw as PageType, W as PlanningAIResponse } from './types-c519555a.js';
|
|
2
2
|
import { Rect, ElementTreeNode, BaseElement } from '@midscene/shared/types';
|
|
3
3
|
import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam } from 'openai/resources';
|
|
4
4
|
|
|
@@ -357,7 +357,7 @@ interface PlanningLocateParam extends DetailedLocateParam {
|
|
|
357
357
|
}
|
|
358
358
|
interface PlanningAction<ParamType = any> {
|
|
359
359
|
thought?: string;
|
|
360
|
-
type: 'Locate' | 'Tap' | 'RightClick' | 'Hover' | 'Drag' | 'Input' | 'KeyboardPress' | 'Scroll' | 'Error' | 'ExpectedFalsyCondition' | 'Assert' | 'AssertWithoutThrow' | 'Sleep' | 'Finished' | 'AndroidBackButton' | 'AndroidHomeButton' | 'AndroidRecentAppsButton'
|
|
360
|
+
type: 'Locate' | 'Tap' | 'RightClick' | 'Hover' | 'Drag' | 'Input' | 'KeyboardPress' | 'Scroll' | 'Error' | 'ExpectedFalsyCondition' | 'Assert' | 'AssertWithoutThrow' | 'Sleep' | 'Finished' | 'AndroidBackButton' | 'AndroidHomeButton' | 'AndroidRecentAppsButton';
|
|
361
361
|
param: ParamType;
|
|
362
362
|
locate?: PlanningLocateParam | null;
|
|
363
363
|
}
|
|
@@ -393,20 +393,6 @@ interface PlanningActionParamError {
|
|
|
393
393
|
type PlanningActionParamWaitFor = AgentWaitForOpt & {
|
|
394
394
|
assertion: string;
|
|
395
395
|
};
|
|
396
|
-
interface PlanningActionParamAndroidLongPress {
|
|
397
|
-
x: number;
|
|
398
|
-
y: number;
|
|
399
|
-
duration?: number;
|
|
400
|
-
}
|
|
401
|
-
interface PlanningActionParamAndroidPull {
|
|
402
|
-
direction: 'up' | 'down';
|
|
403
|
-
startPoint?: {
|
|
404
|
-
x: number;
|
|
405
|
-
y: number;
|
|
406
|
-
};
|
|
407
|
-
distance?: number;
|
|
408
|
-
duration?: number;
|
|
409
|
-
}
|
|
410
396
|
/**
|
|
411
397
|
* misc
|
|
412
398
|
*/
|
|
@@ -542,4 +528,4 @@ interface StreamingAIResponse {
|
|
|
542
528
|
isStreamed: boolean;
|
|
543
529
|
}
|
|
544
530
|
|
|
545
|
-
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
|
|
531
|
+
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 ScriptPlayerStatusValue as a$, type PlanningActionParamAssert as a0, type PlanningActionParamSleep as a1, type PlanningActionParamError as a2, type PlanningActionParamWaitFor as a3, type Color as a4, type BaseAgentParserOpt as a5, type PuppeteerParserOpt as a6, type PlaywrightParserOpt as a7, type ExecutionRecorderItem as a8, type ExecutionTaskType as a9, type StreamingAIResponse as aA, type LocateOption as aB, type ReferenceImage as aC, type scrollParam as aD, type MidsceneYamlScriptEnvBase as aE, type MidsceneYamlScriptWebEnv as aF, type MidsceneYamlScriptAndroidEnv as aG, type MidsceneYamlScriptEnv as aH, type MidsceneYamlFlowItemAIAction as aI, type MidsceneYamlFlowItemAIAssert as aJ, type MidsceneYamlFlowItemAIQuery as aK, type MidsceneYamlFlowItemAINumber as aL, type MidsceneYamlFlowItemAIString as aM, type MidsceneYamlFlowItemAIAsk as aN, type MidsceneYamlFlowItemAIBoolean as aO, type MidsceneYamlFlowItemAILocate as aP, type MidsceneYamlFlowItemAIWaitFor as aQ, type MidsceneYamlFlowItemAITap as aR, type MidsceneYamlFlowItemAIHover as aS, type MidsceneYamlFlowItemAIInput as aT, type MidsceneYamlFlowItemAIKeyboardPress as aU, type MidsceneYamlFlowItemAIScroll as aV, type MidsceneYamlFlowItemEvaluateJavaScript as aW, type MidsceneYamlFlowItemSleep as aX, type MidsceneYamlFlowItemLogScreenshot as aY, type FreeFn as aZ, type ScriptPlayerTaskStatus as a_, type ExecutorContext as aa, type ExecutionTaskHitBy as ab, type ExecutionTaskReturn as ac, type ExecutionTaskInsightLocateParam as ad, type ExecutionTaskInsightLocateOutput as ae, type ExecutionTaskInsightDumpLog as af, type ExecutionTaskInsightLocateApply as ag, type ExecutionTaskInsightLocate as ah, type ExecutionTaskInsightQueryParam as ai, type ExecutionTaskInsightQueryOutput as aj, type ExecutionTaskInsightQueryApply as ak, type ExecutionTaskInsightQuery as al, type ExecutionTaskInsightAssertionParam as am, type ExecutionTaskInsightAssertionApply as an, type ExecutionTaskInsightAssertion as ao, type ExecutionTaskActionApply as ap, type ExecutionTaskAction as aq, type ExecutionTaskLogApply as ar, type ExecutionTaskLog as as, type ExecutionTaskPlanningApply as at, type ExecutionTaskPlanning as au, type GroupedActionDump as av, type PageType as aw, type StreamingCodeGenerationOptions as ax, type StreamingCallback as ay, type CodeGenerationChunk as az, type ExecutionTaskApply as b, type MidsceneYamlConfig as b0, type MidsceneYamlConfigOutput as b1, 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.2-beta-
|
|
4
|
+
"version": "0.24.2-beta-20250731035845.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/shared": "0.24.2-beta-20250731035845.0",
|
|
48
|
+
"@midscene/recorder": "0.24.2-beta-20250731035845.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@modern-js/module-tools": "2.60.6",
|