@midscene/core 0.24.2-beta-20250801111909.0 → 0.25.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 +8 -4
  2. package/dist/es/ai-model.js +3 -1
  3. package/dist/es/{chunk-2RCMQS5O.js → chunk-FEGAGUMN.js} +3 -3
  4. package/dist/es/{chunk-KFA65L55.js → chunk-JS4CT3XV.js} +22 -17
  5. package/dist/es/chunk-JS4CT3XV.js.map +1 -0
  6. package/dist/es/index.d.ts +4 -4
  7. package/dist/es/index.js +36 -12
  8. package/dist/es/index.js.map +1 -1
  9. package/dist/es/{llm-planning-4c782a8d.d.ts → llm-planning-877248da.d.ts} +2 -2
  10. package/dist/es/{types-7b64b80b.d.ts → types-512d3687.d.ts} +2 -3
  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 +8 -4
  14. package/dist/lib/ai-model.js +4 -2
  15. package/dist/lib/{chunk-2RCMQS5O.js → chunk-FEGAGUMN.js} +3 -3
  16. package/dist/lib/{chunk-KFA65L55.js → chunk-JS4CT3XV.js} +22 -17
  17. package/dist/lib/chunk-JS4CT3XV.js.map +1 -0
  18. package/dist/lib/index.d.ts +4 -4
  19. package/dist/lib/index.js +47 -23
  20. package/dist/lib/index.js.map +1 -1
  21. package/dist/lib/{llm-planning-4c782a8d.d.ts → llm-planning-877248da.d.ts} +2 -2
  22. package/dist/{types/types-7b64b80b.d.ts → lib/types-512d3687.d.ts} +2 -3
  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 +8 -4
  26. package/dist/types/index.d.ts +4 -4
  27. package/dist/types/{llm-planning-4c782a8d.d.ts → llm-planning-877248da.d.ts} +2 -2
  28. package/dist/{lib/types-7b64b80b.d.ts → types/types-512d3687.d.ts} +2 -3
  29. package/dist/types/utils.d.ts +1 -1
  30. package/package.json +3 -3
  31. package/dist/es/chunk-KFA65L55.js.map +0 -1
  32. package/dist/lib/chunk-KFA65L55.js.map +0 -1
  33. /package/dist/es/{chunk-2RCMQS5O.js.map → chunk-FEGAGUMN.js.map} +0 -0
  34. /package/dist/lib/{chunk-2RCMQS5O.js.map → chunk-FEGAGUMN.js.map} +0 -0
@@ -1,9 +1,9 @@
1
- import { aD as StreamingCallback, p as AIUsageInfo, aC as StreamingCodeGenerationOptions, aF as StreamingAIResponse, Y as PlanningAction, l as MidsceneYamlFlowItem } from './types-7b64b80b.js';
1
+ import { aC as StreamingCallback, o as AIUsageInfo, aB as StreamingCodeGenerationOptions, aE as StreamingAIResponse, X as PlanningAction, l as MidsceneYamlFlowItem } from './types-512d3687.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-4c782a8d.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-4c782a8d.js';
5
+ import { b as AIActionType, e as AIArgs } from './llm-planning-877248da.js';
6
+ export { a as AiAssert, g as AiExtractElementInfo, A as AiLocateElement, h as AiLocateSection, i as adaptBboxToRect, c as callAiFn, d as describeUserPage, f as elementByPositionWithElementInfo, p as plan } from './llm-planning-877248da.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';
@@ -21,6 +21,10 @@ declare function callToGetJSONObject<T>(messages: ChatCompletionMessageParam[],
21
21
  content: T;
22
22
  usage?: AIUsageInfo;
23
23
  }>;
24
+ declare function callAiFnWithStringResponse<T>(msgs: AIArgs, AIActionTypeValue: AIActionType): Promise<{
25
+ content: string;
26
+ usage?: AIUsageInfo;
27
+ }>;
24
28
 
25
29
  declare function systemPromptToLocateElement(vlMode: ReturnType<typeof vlLocateMode>): string;
26
30
 
@@ -92,4 +96,4 @@ declare function vlmPlanning(options: {
92
96
  }>;
93
97
  declare function resizeImageForUiTars(imageBase64: string, size: Size): Promise<string>;
94
98
 
95
- export { AIActionType, call as callAi, callToGetJSONObject, generatePlaywrightTest, generatePlaywrightTestStream, generateYamlTest, generateYamlTestStream, resizeImageForUiTars, systemPromptToLocateElement, vlmPlanning };
99
+ export { AIActionType, AIArgs, call as callAi, callAiFnWithStringResponse, callToGetJSONObject, generatePlaywrightTest, generatePlaywrightTestStream, generateYamlTest, generateYamlTestStream, resizeImageForUiTars, systemPromptToLocateElement, vlmPlanning };
@@ -7,6 +7,7 @@ import {
7
7
  adaptBboxToRect,
8
8
  call,
9
9
  callAiFn,
10
+ callAiFnWithStringResponse,
10
11
  callToGetJSONObject,
11
12
  describeUserPage,
12
13
  elementByPositionWithElementInfo,
@@ -18,7 +19,7 @@ import {
18
19
  resizeImageForUiTars,
19
20
  systemPromptToLocateElement,
20
21
  vlmPlanning
21
- } from "./chunk-KFA65L55.js";
22
+ } from "./chunk-JS4CT3XV.js";
22
23
  export {
23
24
  AIActionType,
24
25
  AiAssert,
@@ -28,6 +29,7 @@ export {
28
29
  adaptBboxToRect,
29
30
  call as callAi,
30
31
  callAiFn,
32
+ callAiFnWithStringResponse,
31
33
  callToGetJSONObject,
32
34
  describeUserPage,
33
35
  elementByPositionWithElementInfo,