@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.
Files changed (34) hide show
  1. package/dist/es/ai-model.d.ts +3 -3
  2. package/dist/es/ai-model.js +1 -1
  3. package/dist/es/{chunk-6AFIPCHE.js → chunk-2ZBEOLD7.js} +12 -7
  4. package/dist/es/chunk-2ZBEOLD7.js.map +1 -0
  5. package/dist/es/{chunk-3LFZDNMQ.js → chunk-YCHAOUOW.js} +7 -46
  6. package/dist/es/chunk-YCHAOUOW.js.map +1 -0
  7. package/dist/es/index.d.ts +4 -4
  8. package/dist/es/index.js +2 -2
  9. package/dist/es/{llm-planning-ae19dc49.d.ts → llm-planning-3f26578e.d.ts} +1 -1
  10. package/dist/es/{types-d187efec.d.ts → types-c519555a.d.ts} +2 -16
  11. package/dist/es/utils.d.ts +1 -1
  12. package/dist/es/utils.js +1 -1
  13. package/dist/lib/ai-model.d.ts +3 -3
  14. package/dist/lib/ai-model.js +2 -2
  15. package/dist/lib/{chunk-6AFIPCHE.js → chunk-2ZBEOLD7.js} +11 -6
  16. package/dist/lib/chunk-2ZBEOLD7.js.map +1 -0
  17. package/dist/lib/{chunk-3LFZDNMQ.js → chunk-YCHAOUOW.js} +7 -46
  18. package/dist/lib/chunk-YCHAOUOW.js.map +1 -0
  19. package/dist/lib/index.d.ts +4 -4
  20. package/dist/lib/index.js +12 -12
  21. package/dist/lib/{llm-planning-ae19dc49.d.ts → llm-planning-3f26578e.d.ts} +1 -1
  22. package/dist/{types/types-d187efec.d.ts → lib/types-c519555a.d.ts} +2 -16
  23. package/dist/lib/utils.d.ts +1 -1
  24. package/dist/lib/utils.js +2 -2
  25. package/dist/types/ai-model.d.ts +3 -3
  26. package/dist/types/index.d.ts +4 -4
  27. package/dist/types/{llm-planning-ae19dc49.d.ts → llm-planning-3f26578e.d.ts} +1 -1
  28. package/dist/{lib/types-d187efec.d.ts → types/types-c519555a.d.ts} +2 -16
  29. package/dist/types/utils.d.ts +1 -1
  30. package/package.json +3 -3
  31. package/dist/es/chunk-3LFZDNMQ.js.map +0 -1
  32. package/dist/es/chunk-6AFIPCHE.js.map +0 -1
  33. package/dist/lib/chunk-3LFZDNMQ.js.map +0 -1
  34. package/dist/lib/chunk-6AFIPCHE.js.map +0 -1
package/dist/es/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getVersion
3
- } from "./chunk-6AFIPCHE.js";
3
+ } from "./chunk-2ZBEOLD7.js";
4
4
  import {
5
5
  AiAssert,
6
6
  AiExtractElementInfo,
@@ -11,7 +11,7 @@ import {
11
11
  describeUserPage,
12
12
  expandSearchArea,
13
13
  plan
14
- } from "./chunk-3LFZDNMQ.js";
14
+ } from "./chunk-YCHAOUOW.js";
15
15
 
16
16
  // src/ai-model/action-executor.ts
17
17
  import {
@@ -1,4 +1,4 @@
1
- import { m as AIUsageInfo, U as UIContext, aE as ReferenceImage, r as AIElementLocatorResponse, N as ElementById, g as InsightExtractOption, u as AIDataExtractionResponse, w as AIAssertionResponse, ay as PageType, W as PlanningAIResponse } from './types-d187efec.js';
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' | 'AndroidLongPress' | 'AndroidPull';
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 FreeFn as a$, type PlanningActionParamAssert as a0, type PlanningActionParamSleep as a1, type PlanningActionParamError as a2, type PlanningActionParamWaitFor as a3, type PlanningActionParamAndroidLongPress as a4, type PlanningActionParamAndroidPull as a5, type Color as a6, type BaseAgentParserOpt as a7, type PuppeteerParserOpt as a8, type PlaywrightParserOpt as a9, type StreamingCallback as aA, type CodeGenerationChunk as aB, type StreamingAIResponse as aC, type LocateOption as aD, type ReferenceImage as aE, type scrollParam as aF, type MidsceneYamlScriptEnvBase as aG, type MidsceneYamlScriptWebEnv as aH, type MidsceneYamlScriptAndroidEnv as aI, type MidsceneYamlScriptEnv as aJ, type MidsceneYamlFlowItemAIAction as aK, type MidsceneYamlFlowItemAIAssert as aL, type MidsceneYamlFlowItemAIQuery as aM, type MidsceneYamlFlowItemAINumber as aN, type MidsceneYamlFlowItemAIString as aO, type MidsceneYamlFlowItemAIAsk as aP, type MidsceneYamlFlowItemAIBoolean as aQ, type MidsceneYamlFlowItemAILocate as aR, type MidsceneYamlFlowItemAIWaitFor as aS, type MidsceneYamlFlowItemAITap as aT, type MidsceneYamlFlowItemAIHover as aU, type MidsceneYamlFlowItemAIInput as aV, type MidsceneYamlFlowItemAIKeyboardPress as aW, type MidsceneYamlFlowItemAIScroll as aX, type MidsceneYamlFlowItemEvaluateJavaScript as aY, type MidsceneYamlFlowItemSleep as aZ, type MidsceneYamlFlowItemLogScreenshot as a_, type ExecutionRecorderItem as aa, type ExecutionTaskType as ab, type ExecutorContext as ac, type ExecutionTaskHitBy as ad, type ExecutionTaskReturn as ae, type ExecutionTaskInsightLocateParam as af, type ExecutionTaskInsightLocateOutput as ag, type ExecutionTaskInsightDumpLog as ah, type ExecutionTaskInsightLocateApply as ai, type ExecutionTaskInsightLocate as aj, type ExecutionTaskInsightQueryParam as ak, type ExecutionTaskInsightQueryOutput as al, type ExecutionTaskInsightQueryApply as am, type ExecutionTaskInsightQuery as an, type ExecutionTaskInsightAssertionParam as ao, type ExecutionTaskInsightAssertionApply as ap, type ExecutionTaskInsightAssertion as aq, type ExecutionTaskActionApply as ar, type ExecutionTaskAction as as, type ExecutionTaskLogApply as at, type ExecutionTaskLog as au, type ExecutionTaskPlanningApply as av, type ExecutionTaskPlanning as aw, type GroupedActionDump as ax, type PageType as ay, type StreamingCodeGenerationOptions as az, type ExecutionTaskApply as b, type ScriptPlayerTaskStatus as b0, type ScriptPlayerStatusValue as b1, type MidsceneYamlConfig as b2, type MidsceneYamlConfigOutput as b3, 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 };
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 };
@@ -1,4 +1,4 @@
1
- import { R as ReportDumpWithAttributes } from './types-d187efec.js';
1
+ import { R as ReportDumpWithAttributes } from './types-c519555a.js';
2
2
  import { Rect } from '@midscene/shared/types';
3
3
  import '@midscene/shared/constants';
4
4
  import 'openai/resources';
package/dist/es/utils.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  uploadTestInfoToServer,
13
13
  writeDumpReport,
14
14
  writeLogFile
15
- } from "./chunk-6AFIPCHE.js";
15
+ } from "./chunk-2ZBEOLD7.js";
16
16
  export {
17
17
  getTmpDir,
18
18
  getTmpFile,
@@ -1,9 +1,9 @@
1
- import { aA as StreamingCallback, m as AIUsageInfo, az as StreamingCodeGenerationOptions, aC as StreamingAIResponse, V as PlanningAction, j as MidsceneYamlFlowItem } from './types-d187efec.js';
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-ae19dc49.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-ae19dc49.js';
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';
@@ -18,7 +18,7 @@
18
18
 
19
19
 
20
20
 
21
- var _chunk3LFZDNMQjs = require('./chunk-3LFZDNMQ.js');
21
+ var _chunkYCHAOUOWjs = require('./chunk-YCHAOUOW.js');
22
22
 
23
23
 
24
24
 
@@ -39,4 +39,4 @@ var _chunk3LFZDNMQjs = require('./chunk-3LFZDNMQ.js');
39
39
 
40
40
 
41
41
 
42
- exports.AIActionType = _chunk3LFZDNMQjs.AIActionType; exports.AiAssert = _chunk3LFZDNMQjs.AiAssert; exports.AiExtractElementInfo = _chunk3LFZDNMQjs.AiExtractElementInfo; exports.AiLocateElement = _chunk3LFZDNMQjs.AiLocateElement; exports.AiLocateSection = _chunk3LFZDNMQjs.AiLocateSection; exports.adaptBboxToRect = _chunk3LFZDNMQjs.adaptBboxToRect; exports.callAi = _chunk3LFZDNMQjs.call; exports.callAiFn = _chunk3LFZDNMQjs.callAiFn; exports.callToGetJSONObject = _chunk3LFZDNMQjs.callToGetJSONObject; exports.describeUserPage = _chunk3LFZDNMQjs.describeUserPage; exports.elementByPositionWithElementInfo = _chunk3LFZDNMQjs.elementByPositionWithElementInfo; exports.generatePlaywrightTest = _chunk3LFZDNMQjs.generatePlaywrightTest; exports.generatePlaywrightTestStream = _chunk3LFZDNMQjs.generatePlaywrightTestStream; exports.generateYamlTest = _chunk3LFZDNMQjs.generateYamlTest; exports.generateYamlTestStream = _chunk3LFZDNMQjs.generateYamlTestStream; exports.plan = _chunk3LFZDNMQjs.plan; exports.resizeImageForUiTars = _chunk3LFZDNMQjs.resizeImageForUiTars; exports.systemPromptToLocateElement = _chunk3LFZDNMQjs.systemPromptToLocateElement; exports.vlmPlanning = _chunk3LFZDNMQjs.vlmPlanning;
42
+ exports.AIActionType = _chunkYCHAOUOWjs.AIActionType; exports.AiAssert = _chunkYCHAOUOWjs.AiAssert; exports.AiExtractElementInfo = _chunkYCHAOUOWjs.AiExtractElementInfo; exports.AiLocateElement = _chunkYCHAOUOWjs.AiLocateElement; exports.AiLocateSection = _chunkYCHAOUOWjs.AiLocateSection; exports.adaptBboxToRect = _chunkYCHAOUOWjs.adaptBboxToRect; exports.callAi = _chunkYCHAOUOWjs.call; exports.callAiFn = _chunkYCHAOUOWjs.callAiFn; exports.callToGetJSONObject = _chunkYCHAOUOWjs.callToGetJSONObject; exports.describeUserPage = _chunkYCHAOUOWjs.describeUserPage; exports.elementByPositionWithElementInfo = _chunkYCHAOUOWjs.elementByPositionWithElementInfo; exports.generatePlaywrightTest = _chunkYCHAOUOWjs.generatePlaywrightTest; exports.generatePlaywrightTestStream = _chunkYCHAOUOWjs.generatePlaywrightTestStream; exports.generateYamlTest = _chunkYCHAOUOWjs.generateYamlTest; exports.generateYamlTestStream = _chunkYCHAOUOWjs.generateYamlTestStream; exports.plan = _chunkYCHAOUOWjs.plan; exports.resizeImageForUiTars = _chunkYCHAOUOWjs.resizeImageForUiTars; exports.systemPromptToLocateElement = _chunkYCHAOUOWjs.systemPromptToLocateElement; exports.vlmPlanning = _chunkYCHAOUOWjs.vlmPlanning;