@aiscene/core 1.6.2

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 (279) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -0
  3. package/dist/es/agent/agent.mjs +749 -0
  4. package/dist/es/agent/agent.mjs.map +1 -0
  5. package/dist/es/agent/common.mjs +0 -0
  6. package/dist/es/agent/execution-session.mjs +41 -0
  7. package/dist/es/agent/execution-session.mjs.map +1 -0
  8. package/dist/es/agent/index.mjs +6 -0
  9. package/dist/es/agent/task-builder.mjs +332 -0
  10. package/dist/es/agent/task-builder.mjs.map +1 -0
  11. package/dist/es/agent/task-cache.mjs +214 -0
  12. package/dist/es/agent/task-cache.mjs.map +1 -0
  13. package/dist/es/agent/tasks.mjs +424 -0
  14. package/dist/es/agent/tasks.mjs.map +1 -0
  15. package/dist/es/agent/ui-utils.mjs +91 -0
  16. package/dist/es/agent/ui-utils.mjs.map +1 -0
  17. package/dist/es/agent/utils.mjs +198 -0
  18. package/dist/es/agent/utils.mjs.map +1 -0
  19. package/dist/es/ai-model/auto-glm/actions.mjs +237 -0
  20. package/dist/es/ai-model/auto-glm/actions.mjs.map +1 -0
  21. package/dist/es/ai-model/auto-glm/index.mjs +6 -0
  22. package/dist/es/ai-model/auto-glm/parser.mjs +239 -0
  23. package/dist/es/ai-model/auto-glm/parser.mjs.map +1 -0
  24. package/dist/es/ai-model/auto-glm/planning.mjs +71 -0
  25. package/dist/es/ai-model/auto-glm/planning.mjs.map +1 -0
  26. package/dist/es/ai-model/auto-glm/prompt.mjs +222 -0
  27. package/dist/es/ai-model/auto-glm/prompt.mjs.map +1 -0
  28. package/dist/es/ai-model/auto-glm/util.mjs +9 -0
  29. package/dist/es/ai-model/auto-glm/util.mjs.map +1 -0
  30. package/dist/es/ai-model/conversation-history.mjs +195 -0
  31. package/dist/es/ai-model/conversation-history.mjs.map +1 -0
  32. package/dist/es/ai-model/index.mjs +11 -0
  33. package/dist/es/ai-model/inspect.mjs +394 -0
  34. package/dist/es/ai-model/inspect.mjs.map +1 -0
  35. package/dist/es/ai-model/llm-planning.mjs +233 -0
  36. package/dist/es/ai-model/llm-planning.mjs.map +1 -0
  37. package/dist/es/ai-model/prompt/common.mjs +7 -0
  38. package/dist/es/ai-model/prompt/common.mjs.map +1 -0
  39. package/dist/es/ai-model/prompt/describe.mjs +66 -0
  40. package/dist/es/ai-model/prompt/describe.mjs.map +1 -0
  41. package/dist/es/ai-model/prompt/extraction.mjs +169 -0
  42. package/dist/es/ai-model/prompt/extraction.mjs.map +1 -0
  43. package/dist/es/ai-model/prompt/llm-locator.mjs +51 -0
  44. package/dist/es/ai-model/prompt/llm-locator.mjs.map +1 -0
  45. package/dist/es/ai-model/prompt/llm-planning.mjs +568 -0
  46. package/dist/es/ai-model/prompt/llm-planning.mjs.map +1 -0
  47. package/dist/es/ai-model/prompt/llm-section-locator.mjs +44 -0
  48. package/dist/es/ai-model/prompt/llm-section-locator.mjs.map +1 -0
  49. package/dist/es/ai-model/prompt/order-sensitive-judge.mjs +35 -0
  50. package/dist/es/ai-model/prompt/order-sensitive-judge.mjs.map +1 -0
  51. package/dist/es/ai-model/prompt/playwright-generator.mjs +117 -0
  52. package/dist/es/ai-model/prompt/playwright-generator.mjs.map +1 -0
  53. package/dist/es/ai-model/prompt/ui-tars-planning.mjs +36 -0
  54. package/dist/es/ai-model/prompt/ui-tars-planning.mjs.map +1 -0
  55. package/dist/es/ai-model/prompt/util.mjs +59 -0
  56. package/dist/es/ai-model/prompt/util.mjs.map +1 -0
  57. package/dist/es/ai-model/prompt/yaml-generator.mjs +219 -0
  58. package/dist/es/ai-model/prompt/yaml-generator.mjs.map +1 -0
  59. package/dist/es/ai-model/service-caller/codex-app-server.mjs +575 -0
  60. package/dist/es/ai-model/service-caller/codex-app-server.mjs.map +1 -0
  61. package/dist/es/ai-model/service-caller/image-detail.mjs +6 -0
  62. package/dist/es/ai-model/service-caller/image-detail.mjs.map +1 -0
  63. package/dist/es/ai-model/service-caller/index.mjs +473 -0
  64. package/dist/es/ai-model/service-caller/index.mjs.map +1 -0
  65. package/dist/es/ai-model/ui-tars-planning.mjs +249 -0
  66. package/dist/es/ai-model/ui-tars-planning.mjs.map +1 -0
  67. package/dist/es/common.mjs +371 -0
  68. package/dist/es/common.mjs.map +1 -0
  69. package/dist/es/device/device-options.mjs +0 -0
  70. package/dist/es/device/index.mjs +341 -0
  71. package/dist/es/device/index.mjs.map +1 -0
  72. package/dist/es/dump/html-utils.mjs +284 -0
  73. package/dist/es/dump/html-utils.mjs.map +1 -0
  74. package/dist/es/dump/image-restoration.mjs +43 -0
  75. package/dist/es/dump/image-restoration.mjs.map +1 -0
  76. package/dist/es/dump/index.mjs +3 -0
  77. package/dist/es/index.mjs +15 -0
  78. package/dist/es/index.mjs.map +1 -0
  79. package/dist/es/report-generator.mjs +162 -0
  80. package/dist/es/report-generator.mjs.map +1 -0
  81. package/dist/es/report.mjs +137 -0
  82. package/dist/es/report.mjs.map +1 -0
  83. package/dist/es/screenshot-item.mjs +105 -0
  84. package/dist/es/screenshot-item.mjs.map +1 -0
  85. package/dist/es/service/index.mjs +274 -0
  86. package/dist/es/service/index.mjs.map +1 -0
  87. package/dist/es/service/utils.mjs +15 -0
  88. package/dist/es/service/utils.mjs.map +1 -0
  89. package/dist/es/skill/index.mjs +38 -0
  90. package/dist/es/skill/index.mjs.map +1 -0
  91. package/dist/es/task-runner.mjs +263 -0
  92. package/dist/es/task-runner.mjs.map +1 -0
  93. package/dist/es/task-timing.mjs +12 -0
  94. package/dist/es/task-timing.mjs.map +1 -0
  95. package/dist/es/tree.mjs +13 -0
  96. package/dist/es/tree.mjs.map +1 -0
  97. package/dist/es/types.mjs +199 -0
  98. package/dist/es/types.mjs.map +1 -0
  99. package/dist/es/utils.mjs +229 -0
  100. package/dist/es/utils.mjs.map +1 -0
  101. package/dist/es/yaml/builder.mjs +13 -0
  102. package/dist/es/yaml/builder.mjs.map +1 -0
  103. package/dist/es/yaml/index.mjs +4 -0
  104. package/dist/es/yaml/player.mjs +434 -0
  105. package/dist/es/yaml/player.mjs.map +1 -0
  106. package/dist/es/yaml/utils.mjs +102 -0
  107. package/dist/es/yaml/utils.mjs.map +1 -0
  108. package/dist/es/yaml.mjs +0 -0
  109. package/dist/lib/agent/agent.js +797 -0
  110. package/dist/lib/agent/agent.js.map +1 -0
  111. package/dist/lib/agent/common.js +5 -0
  112. package/dist/lib/agent/execution-session.js +75 -0
  113. package/dist/lib/agent/execution-session.js.map +1 -0
  114. package/dist/lib/agent/index.js +81 -0
  115. package/dist/lib/agent/index.js.map +1 -0
  116. package/dist/lib/agent/task-builder.js +369 -0
  117. package/dist/lib/agent/task-builder.js.map +1 -0
  118. package/dist/lib/agent/task-cache.js +266 -0
  119. package/dist/lib/agent/task-cache.js.map +1 -0
  120. package/dist/lib/agent/tasks.js +467 -0
  121. package/dist/lib/agent/tasks.js.map +1 -0
  122. package/dist/lib/agent/ui-utils.js +143 -0
  123. package/dist/lib/agent/ui-utils.js.map +1 -0
  124. package/dist/lib/agent/utils.js +275 -0
  125. package/dist/lib/agent/utils.js.map +1 -0
  126. package/dist/lib/ai-model/auto-glm/actions.js +271 -0
  127. package/dist/lib/ai-model/auto-glm/actions.js.map +1 -0
  128. package/dist/lib/ai-model/auto-glm/index.js +66 -0
  129. package/dist/lib/ai-model/auto-glm/index.js.map +1 -0
  130. package/dist/lib/ai-model/auto-glm/parser.js +282 -0
  131. package/dist/lib/ai-model/auto-glm/parser.js.map +1 -0
  132. package/dist/lib/ai-model/auto-glm/planning.js +105 -0
  133. package/dist/lib/ai-model/auto-glm/planning.js.map +1 -0
  134. package/dist/lib/ai-model/auto-glm/prompt.js +259 -0
  135. package/dist/lib/ai-model/auto-glm/prompt.js.map +1 -0
  136. package/dist/lib/ai-model/auto-glm/util.js +46 -0
  137. package/dist/lib/ai-model/auto-glm/util.js.map +1 -0
  138. package/dist/lib/ai-model/conversation-history.js +229 -0
  139. package/dist/lib/ai-model/conversation-history.js.map +1 -0
  140. package/dist/lib/ai-model/index.js +125 -0
  141. package/dist/lib/ai-model/index.js.map +1 -0
  142. package/dist/lib/ai-model/inspect.js +440 -0
  143. package/dist/lib/ai-model/inspect.js.map +1 -0
  144. package/dist/lib/ai-model/llm-planning.js +270 -0
  145. package/dist/lib/ai-model/llm-planning.js.map +1 -0
  146. package/dist/lib/ai-model/prompt/common.js +41 -0
  147. package/dist/lib/ai-model/prompt/common.js.map +1 -0
  148. package/dist/lib/ai-model/prompt/describe.js +100 -0
  149. package/dist/lib/ai-model/prompt/describe.js.map +1 -0
  150. package/dist/lib/ai-model/prompt/extraction.js +209 -0
  151. package/dist/lib/ai-model/prompt/extraction.js.map +1 -0
  152. package/dist/lib/ai-model/prompt/llm-locator.js +88 -0
  153. package/dist/lib/ai-model/prompt/llm-locator.js.map +1 -0
  154. package/dist/lib/ai-model/prompt/llm-planning.js +605 -0
  155. package/dist/lib/ai-model/prompt/llm-planning.js.map +1 -0
  156. package/dist/lib/ai-model/prompt/llm-section-locator.js +81 -0
  157. package/dist/lib/ai-model/prompt/llm-section-locator.js.map +1 -0
  158. package/dist/lib/ai-model/prompt/order-sensitive-judge.js +72 -0
  159. package/dist/lib/ai-model/prompt/order-sensitive-judge.js.map +1 -0
  160. package/dist/lib/ai-model/prompt/playwright-generator.js +178 -0
  161. package/dist/lib/ai-model/prompt/playwright-generator.js.map +1 -0
  162. package/dist/lib/ai-model/prompt/ui-tars-planning.js +73 -0
  163. package/dist/lib/ai-model/prompt/ui-tars-planning.js.map +1 -0
  164. package/dist/lib/ai-model/prompt/util.js +105 -0
  165. package/dist/lib/ai-model/prompt/util.js.map +1 -0
  166. package/dist/lib/ai-model/prompt/yaml-generator.js +280 -0
  167. package/dist/lib/ai-model/prompt/yaml-generator.js.map +1 -0
  168. package/dist/lib/ai-model/service-caller/codex-app-server.js +624 -0
  169. package/dist/lib/ai-model/service-caller/codex-app-server.js.map +1 -0
  170. package/dist/lib/ai-model/service-caller/image-detail.js +40 -0
  171. package/dist/lib/ai-model/service-caller/image-detail.js.map +1 -0
  172. package/dist/lib/ai-model/service-caller/index.js +538 -0
  173. package/dist/lib/ai-model/service-caller/index.js.map +1 -0
  174. package/dist/lib/ai-model/ui-tars-planning.js +283 -0
  175. package/dist/lib/ai-model/ui-tars-planning.js.map +1 -0
  176. package/dist/lib/common.js +480 -0
  177. package/dist/lib/common.js.map +1 -0
  178. package/dist/lib/device/device-options.js +20 -0
  179. package/dist/lib/device/device-options.js.map +1 -0
  180. package/dist/lib/device/index.js +468 -0
  181. package/dist/lib/device/index.js.map +1 -0
  182. package/dist/lib/dump/html-utils.js +357 -0
  183. package/dist/lib/dump/html-utils.js.map +1 -0
  184. package/dist/lib/dump/image-restoration.js +77 -0
  185. package/dist/lib/dump/image-restoration.js.map +1 -0
  186. package/dist/lib/dump/index.js +60 -0
  187. package/dist/lib/dump/index.js.map +1 -0
  188. package/dist/lib/index.js +146 -0
  189. package/dist/lib/index.js.map +1 -0
  190. package/dist/lib/report-generator.js +200 -0
  191. package/dist/lib/report-generator.js.map +1 -0
  192. package/dist/lib/report.js +171 -0
  193. package/dist/lib/report.js.map +1 -0
  194. package/dist/lib/screenshot-item.js +139 -0
  195. package/dist/lib/screenshot-item.js.map +1 -0
  196. package/dist/lib/service/index.js +308 -0
  197. package/dist/lib/service/index.js.map +1 -0
  198. package/dist/lib/service/utils.js +49 -0
  199. package/dist/lib/service/utils.js.map +1 -0
  200. package/dist/lib/skill/index.js +72 -0
  201. package/dist/lib/skill/index.js.map +1 -0
  202. package/dist/lib/task-runner.js +300 -0
  203. package/dist/lib/task-runner.js.map +1 -0
  204. package/dist/lib/task-timing.js +46 -0
  205. package/dist/lib/task-timing.js.map +1 -0
  206. package/dist/lib/tree.js +53 -0
  207. package/dist/lib/tree.js.map +1 -0
  208. package/dist/lib/types.js +288 -0
  209. package/dist/lib/types.js.map +1 -0
  210. package/dist/lib/utils.js +308 -0
  211. package/dist/lib/utils.js.map +1 -0
  212. package/dist/lib/yaml/builder.js +57 -0
  213. package/dist/lib/yaml/builder.js.map +1 -0
  214. package/dist/lib/yaml/index.js +81 -0
  215. package/dist/lib/yaml/index.js.map +1 -0
  216. package/dist/lib/yaml/player.js +468 -0
  217. package/dist/lib/yaml/player.js.map +1 -0
  218. package/dist/lib/yaml/utils.js +155 -0
  219. package/dist/lib/yaml/utils.js.map +1 -0
  220. package/dist/lib/yaml.js +20 -0
  221. package/dist/lib/yaml.js.map +1 -0
  222. package/dist/types/agent/agent.d.ts +205 -0
  223. package/dist/types/agent/common.d.ts +0 -0
  224. package/dist/types/agent/execution-session.d.ts +36 -0
  225. package/dist/types/agent/index.d.ts +10 -0
  226. package/dist/types/agent/task-builder.d.ts +34 -0
  227. package/dist/types/agent/task-cache.d.ts +49 -0
  228. package/dist/types/agent/tasks.d.ts +69 -0
  229. package/dist/types/agent/ui-utils.d.ts +14 -0
  230. package/dist/types/agent/utils.d.ts +31 -0
  231. package/dist/types/ai-model/auto-glm/actions.d.ts +78 -0
  232. package/dist/types/ai-model/auto-glm/index.d.ts +6 -0
  233. package/dist/types/ai-model/auto-glm/parser.d.ts +18 -0
  234. package/dist/types/ai-model/auto-glm/planning.d.ts +12 -0
  235. package/dist/types/ai-model/auto-glm/prompt.d.ts +27 -0
  236. package/dist/types/ai-model/auto-glm/util.d.ts +13 -0
  237. package/dist/types/ai-model/conversation-history.d.ts +105 -0
  238. package/dist/types/ai-model/index.d.ts +14 -0
  239. package/dist/types/ai-model/inspect.d.ts +67 -0
  240. package/dist/types/ai-model/llm-planning.d.ts +19 -0
  241. package/dist/types/ai-model/prompt/common.d.ts +2 -0
  242. package/dist/types/ai-model/prompt/describe.d.ts +1 -0
  243. package/dist/types/ai-model/prompt/extraction.d.ts +7 -0
  244. package/dist/types/ai-model/prompt/llm-locator.d.ts +3 -0
  245. package/dist/types/ai-model/prompt/llm-planning.d.ts +10 -0
  246. package/dist/types/ai-model/prompt/llm-section-locator.d.ts +3 -0
  247. package/dist/types/ai-model/prompt/order-sensitive-judge.d.ts +2 -0
  248. package/dist/types/ai-model/prompt/playwright-generator.d.ts +26 -0
  249. package/dist/types/ai-model/prompt/ui-tars-planning.d.ts +2 -0
  250. package/dist/types/ai-model/prompt/util.d.ts +33 -0
  251. package/dist/types/ai-model/prompt/yaml-generator.d.ts +100 -0
  252. package/dist/types/ai-model/service-caller/codex-app-server.d.ts +42 -0
  253. package/dist/types/ai-model/service-caller/image-detail.d.ts +2 -0
  254. package/dist/types/ai-model/service-caller/index.d.ts +49 -0
  255. package/dist/types/ai-model/ui-tars-planning.d.ts +72 -0
  256. package/dist/types/common.d.ts +288 -0
  257. package/dist/types/device/device-options.d.ts +142 -0
  258. package/dist/types/device/index.d.ts +2528 -0
  259. package/dist/types/dump/html-utils.d.ts +63 -0
  260. package/dist/types/dump/image-restoration.d.ts +6 -0
  261. package/dist/types/dump/index.d.ts +5 -0
  262. package/dist/types/index.d.ts +17 -0
  263. package/dist/types/report-generator.d.ts +66 -0
  264. package/dist/types/report.d.ts +22 -0
  265. package/dist/types/screenshot-item.d.ts +66 -0
  266. package/dist/types/service/index.d.ts +24 -0
  267. package/dist/types/service/utils.d.ts +2 -0
  268. package/dist/types/skill/index.d.ts +25 -0
  269. package/dist/types/task-runner.d.ts +50 -0
  270. package/dist/types/task-timing.d.ts +8 -0
  271. package/dist/types/tree.d.ts +4 -0
  272. package/dist/types/types.d.ts +669 -0
  273. package/dist/types/utils.d.ts +40 -0
  274. package/dist/types/yaml/builder.d.ts +2 -0
  275. package/dist/types/yaml/index.d.ts +4 -0
  276. package/dist/types/yaml/player.d.ts +34 -0
  277. package/dist/types/yaml/utils.d.ts +9 -0
  278. package/dist/types/yaml.d.ts +215 -0
  279. package/package.json +111 -0
@@ -0,0 +1,31 @@
1
+ import type { TMultimodalPrompt, TUserPrompt } from '../common';
2
+ import type { AbstractInterface } from '../device';
3
+ import type { ElementCacheFeature, LocateResultElement, PlanningLocateParam, Rect, UIContext } from '../types';
4
+ import type { TModelFamily } from '@midscene/shared/env';
5
+ import type { TaskCache } from './task-cache';
6
+ export declare function commonContextParser(interfaceInstance: AbstractInterface, _opt: {
7
+ uploadServerUrl?: string;
8
+ screenshotShrinkFactor?: number;
9
+ modelFamily?: TModelFamily;
10
+ }): Promise<UIContext>;
11
+ export declare function getReportFileName(tag?: string): string;
12
+ export declare function printReportMsg(filepath: string): void;
13
+ /**
14
+ * Get the current execution file name
15
+ * @returns The name of the current execution file
16
+ */
17
+ export declare function getCurrentExecutionFile(trace?: string): string | false;
18
+ export declare function generateCacheId(fileName?: string): string;
19
+ export declare function ifPlanLocateParamIsBbox(planLocateParam: PlanningLocateParam): boolean;
20
+ export declare function matchElementFromPlan(planLocateParam: PlanningLocateParam): LocateResultElement | undefined;
21
+ export declare function matchElementFromCache(context: {
22
+ taskCache?: TaskCache;
23
+ interfaceInstance: AbstractInterface;
24
+ }, cacheEntry: ElementCacheFeature | undefined, cachePrompt: TUserPrompt, cacheable: boolean | undefined): Promise<LocateResultElement | undefined>;
25
+ export declare const getMidsceneVersion: () => string;
26
+ export declare const parsePrompt: (prompt: TUserPrompt) => {
27
+ textPrompt: string;
28
+ multimodalPrompt?: TMultimodalPrompt;
29
+ };
30
+ export declare const transformLogicalElementToScreenshot: (element: LocateResultElement, shrunkShotToLogicalRatio: number) => LocateResultElement;
31
+ export declare const transformLogicalRectToScreenshotRect: (rect: Rect, shrunkShotToLogicalRatio: number) => Rect;
@@ -0,0 +1,78 @@
1
+ import type { DeviceAction } from '../../device';
2
+ import type { PlanningAction } from '../../types';
3
+ export interface BaseAction {
4
+ _metadata: string;
5
+ think?: string;
6
+ }
7
+ export interface TapAction extends BaseAction {
8
+ _metadata: 'do';
9
+ action: 'Tap';
10
+ element: [number, number];
11
+ }
12
+ export interface DoubleTapAction extends BaseAction {
13
+ _metadata: 'do';
14
+ action: 'Double Tap';
15
+ element: [number, number];
16
+ }
17
+ export interface TypeAction extends BaseAction {
18
+ _metadata: 'do';
19
+ action: 'Type';
20
+ text: string;
21
+ }
22
+ export interface SwipeAction extends BaseAction {
23
+ _metadata: 'do';
24
+ action: 'Swipe';
25
+ start: [number, number];
26
+ end: [number, number];
27
+ }
28
+ export interface LongPressAction extends BaseAction {
29
+ _metadata: 'do';
30
+ action: 'Long Press';
31
+ element: [number, number];
32
+ }
33
+ export interface LaunchAction extends BaseAction {
34
+ _metadata: 'do';
35
+ action: 'Launch';
36
+ app: string;
37
+ }
38
+ export interface BackAction extends BaseAction {
39
+ _metadata: 'do';
40
+ action: 'Back';
41
+ }
42
+ export interface HomeAction extends BaseAction {
43
+ _metadata: 'do';
44
+ action: 'Home';
45
+ }
46
+ export interface WaitAction extends BaseAction {
47
+ _metadata: 'do';
48
+ action: 'Wait';
49
+ durationMs: number;
50
+ }
51
+ export interface InteractAction extends BaseAction {
52
+ _metadata: 'do';
53
+ action: 'Interact';
54
+ }
55
+ export interface CallAPIAction extends BaseAction {
56
+ _metadata: 'do';
57
+ action: 'Call_API';
58
+ instruction: string;
59
+ }
60
+ export interface TakeoverAction extends BaseAction {
61
+ _metadata: 'do';
62
+ action: 'Take_over';
63
+ message: string;
64
+ }
65
+ export interface NoteAction extends BaseAction {
66
+ _metadata: 'do';
67
+ action: 'Note';
68
+ message: string;
69
+ }
70
+ export interface FinishAction extends BaseAction {
71
+ _metadata: 'finish';
72
+ message: string;
73
+ }
74
+ export type ParsedAction = TapAction | DoubleTapAction | TypeAction | SwipeAction | LongPressAction | LaunchAction | BackAction | HomeAction | WaitAction | InteractAction | CallAPIAction | TakeoverAction | NoteAction | FinishAction;
75
+ export declare function transformAutoGLMAction(action: ParsedAction, size: {
76
+ width: number;
77
+ height: number;
78
+ }, actionSpace?: DeviceAction[]): PlanningAction[];
@@ -0,0 +1,6 @@
1
+ export { getAutoGLMLocatePrompt, getAutoGLMPlanPrompt } from './prompt';
2
+ export { parseAutoGLMLocateResponse, parseAutoGLMResponse, parseAction, } from './parser';
3
+ export { autoGLMPlanning } from './planning';
4
+ export { transformAutoGLMAction } from './actions';
5
+ export { isAutoGLM, isUITars } from './util';
6
+ export type { ParsedAction } from './actions';
@@ -0,0 +1,18 @@
1
+ import type { ParsedAction } from './actions';
2
+ export declare const extractValueAfter: (src: string, key: string) => string;
3
+ export declare function parseAction(response: {
4
+ think: string;
5
+ content: string;
6
+ }): ParsedAction;
7
+ export declare function parseAutoGLMResponse(content: string): {
8
+ think: string;
9
+ content: string;
10
+ };
11
+ export declare function parseAutoGLMLocateResponse(rawResponse: string): {
12
+ think: string;
13
+ coordinates: {
14
+ x: number;
15
+ y: number;
16
+ } | null;
17
+ error?: string;
18
+ };
@@ -0,0 +1,12 @@
1
+ import type { DeviceAction } from '../../device';
2
+ import type { PlanningAIResponse, UIContext } from '../../types';
3
+ import type { IModelConfig } from '@midscene/shared/env';
4
+ import type { ConversationHistory } from '../conversation-history';
5
+ export declare function autoGLMPlanning(userInstruction: string, options: {
6
+ conversationHistory: ConversationHistory;
7
+ context: UIContext;
8
+ modelConfig: IModelConfig;
9
+ actionContext?: string;
10
+ actionSpace?: DeviceAction[];
11
+ abortSignal?: AbortSignal;
12
+ }): Promise<PlanningAIResponse>;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Auto-GLM Prompt Templates
3
+ *
4
+ * Portions of this file are derived from Open-AutoGLM
5
+ * Copyright (c) 2024 zai-org
6
+ * Licensed under the Apache License, Version 2.0
7
+ *
8
+ * Source: https://github.com/zai-org/Open-AutoGLM
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ *
22
+ * Modifications:
23
+ * - Adapted prompts for Midscene.js integration
24
+ */
25
+ import type { TModelFamily } from '@midscene/shared/env';
26
+ export declare const getAutoGLMPlanPrompt: (modelFamily: TModelFamily | undefined) => string;
27
+ export declare const getAutoGLMLocatePrompt: (modelFamily: TModelFamily | undefined) => string;
@@ -0,0 +1,13 @@
1
+ import type { TModelFamily } from '@midscene/shared/env';
2
+ /**
3
+ * Check if the modelFamily is auto-glm or auto-glm-multilingual
4
+ * @param modelFamily The model family to check
5
+ * @returns true if modelFamily is auto-glm or auto-glm-multilingual
6
+ */
7
+ export declare function isAutoGLM(modelFamily: TModelFamily | undefined): boolean;
8
+ /**
9
+ * Check if the modelFamily is a UI-TARS variant
10
+ * @param modelFamily The model family to check
11
+ * @returns true if modelFamily is any UI-TARS variant
12
+ */
13
+ export declare function isUITars(modelFamily: TModelFamily | undefined): boolean;
@@ -0,0 +1,105 @@
1
+ import type { SubGoal } from '../types';
2
+ import type { ChatCompletionMessageParam } from 'openai/resources/index';
3
+ export interface ConversationHistoryOptions {
4
+ initialMessages?: ChatCompletionMessageParam[];
5
+ }
6
+ export declare class ConversationHistory {
7
+ private readonly messages;
8
+ private subGoals;
9
+ private memories;
10
+ private historicalLogs;
11
+ pendingFeedbackMessage: string;
12
+ constructor(options?: ConversationHistoryOptions);
13
+ resetPendingFeedbackMessageIfExists(): void;
14
+ append(message: ChatCompletionMessageParam): void;
15
+ seed(messages: ChatCompletionMessageParam[]): void;
16
+ reset(): void;
17
+ /**
18
+ * Snapshot the conversation history, and replace the images with text if the number of images exceeds the limit.
19
+ * @param maxImages - The maximum number of images to include in the snapshot. Undefined means no limit.
20
+ * @returns The snapshot of the conversation history.
21
+ */
22
+ snapshot(maxImages?: number): ChatCompletionMessageParam[];
23
+ get length(): number;
24
+ [Symbol.iterator](): IterableIterator<ChatCompletionMessageParam>;
25
+ toJSON(): ChatCompletionMessageParam[];
26
+ /**
27
+ * Set all sub-goals, replacing any existing ones.
28
+ * Automatically marks the first pending goal as running.
29
+ */
30
+ setSubGoals(subGoals: SubGoal[]): void;
31
+ /**
32
+ * Merge sub-goals from update-plan-content.
33
+ * Preserves existing descriptions when incoming description is empty.
34
+ *
35
+ * This handles compact XML updates like:
36
+ * <sub-goal index="1" status="finished" />
37
+ */
38
+ mergeSubGoals(subGoals: SubGoal[]): void;
39
+ /**
40
+ * Update a single sub-goal by index.
41
+ * Clears logs if status or description actually changes.
42
+ * @returns true if the sub-goal was found and updated, false otherwise
43
+ */
44
+ updateSubGoal(index: number, updates: Partial<Omit<SubGoal, 'index'>>): boolean;
45
+ /**
46
+ * Mark the first pending sub-goal as running.
47
+ * Clears logs since status changes.
48
+ */
49
+ markFirstPendingAsRunning(): void;
50
+ /**
51
+ * Mark a sub-goal as finished.
52
+ * Automatically marks the next pending goal as running.
53
+ * @returns true if the sub-goal was found and updated, false otherwise
54
+ */
55
+ markSubGoalFinished(index: number): boolean;
56
+ /**
57
+ * Mark all sub-goals as finished.
58
+ * Clears logs for any goal whose status actually changes.
59
+ */
60
+ markAllSubGoalsFinished(): void;
61
+ /**
62
+ * Append a log entry to the currently running sub-goal.
63
+ * The log describes an action performed while working on the sub-goal.
64
+ */
65
+ appendSubGoalLog(log: string): void;
66
+ /**
67
+ * Convert sub-goals to text representation.
68
+ * Includes actions performed (logs) for the current sub-goal.
69
+ */
70
+ subGoalsToText(): string;
71
+ /**
72
+ * Append a log entry to the historical logs list.
73
+ * Used in non-deepThink mode to track executed steps across planning rounds.
74
+ */
75
+ appendHistoricalLog(log: string): void;
76
+ /**
77
+ * Convert historical logs to text representation.
78
+ * Provides context about previously executed steps to the model.
79
+ */
80
+ historicalLogsToText(): string;
81
+ /**
82
+ * Append a memory to the memories list
83
+ */
84
+ appendMemory(memory: string): void;
85
+ /**
86
+ * Get all memories
87
+ */
88
+ getMemories(): string[];
89
+ /**
90
+ * Convert memories to text representation
91
+ */
92
+ memoriesToText(): string;
93
+ /**
94
+ * Clear all memories
95
+ */
96
+ clearMemories(): void;
97
+ /**
98
+ * Compress the conversation history if it exceeds the threshold.
99
+ * Removes the oldest messages and replaces them with a single placeholder message.
100
+ * @param threshold - The number of messages that triggers compression.
101
+ * @param keepCount - The number of recent messages to keep after compression.
102
+ * @returns true if compression was performed, false otherwise.
103
+ */
104
+ compressHistory(threshold: number, keepCount: number): boolean;
105
+ }
@@ -0,0 +1,14 @@
1
+ export { AIResponseParseError, callAIWithStringResponse, callAIWithObjectResponse, callAI, } from './service-caller/index';
2
+ export { systemPromptToLocateElement } from './prompt/llm-locator';
3
+ export { generatePlaywrightTest, generatePlaywrightTestStream, } from './prompt/playwright-generator';
4
+ export { generateYamlTest, generateYamlTestStream, } from './prompt/yaml-generator';
5
+ export type { ChatCompletionMessageParam } from 'openai/resources/index';
6
+ export { AiLocateElement, AiExtractElementInfo, AiLocateSection, AiJudgeOrderSensitive, } from './inspect';
7
+ export { plan } from './llm-planning';
8
+ export { autoGLMPlanning } from './auto-glm/planning';
9
+ export { adaptBboxToRect } from '../common';
10
+ export { uiTarsPlanning } from './ui-tars-planning';
11
+ export { ConversationHistory, type ConversationHistoryOptions, } from './conversation-history';
12
+ export type { SubGoal, SubGoalStatus } from '../types';
13
+ export type { AIArgs } from '../common';
14
+ export { getMidsceneLocationSchema, PointSchema, SizeSchema, RectSchema, TMultimodalPromptSchema, TUserPromptSchema, type TMultimodalPrompt, type TUserPrompt, findAllMidsceneLocatorField, dumpActionParam, parseActionParam, } from '../common';
@@ -0,0 +1,67 @@
1
+ import type { AIDataExtractionResponse, AIUsageInfo, Rect, ServiceExtractOption, UIContext } from '../types';
2
+ import type { IModelConfig } from '@midscene/shared/env';
3
+ import type { LocateResultElement } from '@midscene/shared/types';
4
+ import type { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam } from 'openai/resources/index';
5
+ import type { TMultimodalPrompt, TUserPrompt } from '../common';
6
+ import { callAIWithObjectResponse } from './service-caller/index';
7
+ export type AIArgs = [
8
+ ChatCompletionSystemMessageParam,
9
+ ...ChatCompletionUserMessageParam[]
10
+ ];
11
+ export declare function buildSearchAreaConfig(options: {
12
+ context: UIContext;
13
+ baseRect: Rect;
14
+ modelFamily: IModelConfig['modelFamily'];
15
+ }): Promise<{
16
+ rect: Rect;
17
+ imageBase64: string;
18
+ scale: number;
19
+ }>;
20
+ export declare function AiLocateElement(options: {
21
+ context: UIContext;
22
+ targetElementDescription: TUserPrompt;
23
+ searchConfig?: Awaited<ReturnType<typeof AiLocateSection>>;
24
+ modelConfig: IModelConfig;
25
+ abortSignal?: AbortSignal;
26
+ }): Promise<{
27
+ parseResult: {
28
+ elements: LocateResultElement[];
29
+ errors?: string[];
30
+ };
31
+ rect?: Rect;
32
+ rawResponse: string;
33
+ usage?: AIUsageInfo;
34
+ reasoning_content?: string;
35
+ }>;
36
+ export declare function AiLocateSection(options: {
37
+ context: UIContext;
38
+ sectionDescription: TUserPrompt;
39
+ modelConfig: IModelConfig;
40
+ abortSignal?: AbortSignal;
41
+ }): Promise<{
42
+ rect?: Rect;
43
+ imageBase64?: string;
44
+ scale?: number;
45
+ error?: string;
46
+ rawResponse: string;
47
+ usage?: AIUsageInfo;
48
+ }>;
49
+ export declare function AiExtractElementInfo<T>(options: {
50
+ dataQuery: string | Record<string, string>;
51
+ multimodalPrompt?: TMultimodalPrompt;
52
+ context: UIContext;
53
+ pageDescription?: string;
54
+ extractOption?: ServiceExtractOption;
55
+ modelConfig: IModelConfig;
56
+ }): Promise<{
57
+ parseResult: AIDataExtractionResponse<T>;
58
+ rawResponse: string;
59
+ usage: AIUsageInfo | undefined;
60
+ reasoning_content: string | undefined;
61
+ }>;
62
+ export declare function AiJudgeOrderSensitive(description: string, callAIFn: typeof callAIWithObjectResponse<{
63
+ isOrderSensitive: boolean;
64
+ }>, modelConfig: IModelConfig): Promise<{
65
+ isOrderSensitive: boolean;
66
+ usage?: AIUsageInfo;
67
+ }>;
@@ -0,0 +1,19 @@
1
+ import type { DeepThinkOption, DeviceAction, InterfaceType, PlanningAIResponse, RawResponsePlanningAIResponse, UIContext } from '../types';
2
+ import type { IModelConfig, TModelFamily } from '@midscene/shared/env';
3
+ import type { ConversationHistory } from './conversation-history';
4
+ /**
5
+ * Parse XML response from LLM and convert to RawResponsePlanningAIResponse
6
+ */
7
+ export declare function parseXMLPlanningResponse(xmlString: string, modelFamily: TModelFamily | undefined): RawResponsePlanningAIResponse;
8
+ export declare function plan(userInstruction: string, opts: {
9
+ context: UIContext;
10
+ interfaceType: InterfaceType;
11
+ actionSpace: DeviceAction<any>[];
12
+ actionContext?: string;
13
+ modelConfig: IModelConfig;
14
+ conversationHistory: ConversationHistory;
15
+ includeBbox: boolean;
16
+ imagesIncludeCount?: number;
17
+ deepThink?: DeepThinkOption;
18
+ abortSignal?: AbortSignal;
19
+ }): Promise<PlanningAIResponse>;
@@ -0,0 +1,2 @@
1
+ import type { TModelFamily } from '@midscene/shared/env';
2
+ export declare function bboxDescription(modelFamily: TModelFamily | undefined): "box_2d bounding box for the target element, should be [ymin, xmin, ymax, xmax] normalized to 0-1000." | "2d bounding box as [xmin, ymin, xmax, ymax]";
@@ -0,0 +1 @@
1
+ export declare const elementDescriberInstruction: () => string;
@@ -0,0 +1,7 @@
1
+ import type { AIDataExtractionResponse } from '../../types';
2
+ /**
3
+ * Parse XML response from LLM and convert to AIDataExtractionResponse
4
+ */
5
+ export declare function parseXMLExtractionResponse<T>(xmlString: string): AIDataExtractionResponse<T>;
6
+ export declare function systemPromptToExtract(): string;
7
+ export declare const extractDataQueryPrompt: (pageDescription: string, dataQuery: string | Record<string, string>) => string;
@@ -0,0 +1,3 @@
1
+ import type { TModelFamily } from '@midscene/shared/env';
2
+ export declare function systemPromptToLocateElement(modelFamily: TModelFamily | undefined): string;
3
+ export declare const findElementPrompt: (targetElementDescription: string) => string;
@@ -0,0 +1,10 @@
1
+ import type { DeviceAction } from '../../types';
2
+ import type { TModelFamily } from '@midscene/shared/env';
3
+ export declare const descriptionForAction: (action: DeviceAction<any>, locatorSchemaTypeDescription: string, includeBbox?: boolean) => string;
4
+ export declare function systemPromptToTaskPlanning({ actionSpace, modelFamily, includeBbox, includeThought, includeSubGoals, }: {
5
+ actionSpace: DeviceAction<any>[];
6
+ modelFamily: TModelFamily | undefined;
7
+ includeBbox: boolean;
8
+ includeThought?: boolean;
9
+ includeSubGoals?: boolean;
10
+ }): Promise<string>;
@@ -0,0 +1,3 @@
1
+ import type { TModelFamily } from '@midscene/shared/env';
2
+ export declare function systemPromptToLocateSection(modelFamily: TModelFamily | undefined): string;
3
+ export declare const sectionLocatorInstruction: (sectionDescription: string) => string;
@@ -0,0 +1,2 @@
1
+ export declare function systemPromptToJudgeOrderSensitive(): string;
2
+ export declare const orderSensitiveJudgePrompt: (description: string) => string;
@@ -0,0 +1,26 @@
1
+ import type { StreamingAIResponse, StreamingCodeGenerationOptions } from '../../types';
2
+ import type { IModelConfig } from '@midscene/shared/env';
3
+ import { type ChromeRecordedEvent, type EventCounts, type EventSummary, type InputDescription, type ProcessedEvent, createEventCounts, createMessageContent, extractInputDescriptions, filterEventsByType, getScreenshotsForLLM, prepareEventSummary, processEventsForLLM, validateEvents } from './yaml-generator';
4
+ export interface PlaywrightGenerationOptions {
5
+ testName?: string;
6
+ includeScreenshots?: boolean;
7
+ includeTimestamps?: boolean;
8
+ maxScreenshots?: number;
9
+ description?: string;
10
+ viewportSize?: {
11
+ width: number;
12
+ height: number;
13
+ };
14
+ waitForNetworkIdle?: boolean;
15
+ waitForNetworkIdleTimeout?: number;
16
+ }
17
+ export type { ChromeRecordedEvent, EventCounts, InputDescription, ProcessedEvent, EventSummary, };
18
+ export { getScreenshotsForLLM, filterEventsByType, createEventCounts, extractInputDescriptions, processEventsForLLM, prepareEventSummary, createMessageContent, validateEvents, };
19
+ /**
20
+ * Generates Playwright test code from recorded events
21
+ */
22
+ export declare const generatePlaywrightTest: (events: ChromeRecordedEvent[], options: PlaywrightGenerationOptions, modelConfig: IModelConfig) => Promise<string>;
23
+ /**
24
+ * Generates Playwright test code from recorded events with streaming support
25
+ */
26
+ export declare const generatePlaywrightTestStream: (events: ChromeRecordedEvent[], options: PlaywrightGenerationOptions & StreamingCodeGenerationOptions, modelConfig: IModelConfig) => Promise<StreamingAIResponse>;
@@ -0,0 +1,2 @@
1
+ export declare function getUiTarsPlanningPrompt(): string;
2
+ export declare const getSummary: (prediction: string) => string;
@@ -0,0 +1,33 @@
1
+ import type { SubGoal } from '../../types';
2
+ /**
3
+ * Extract content from an XML tag in a string, searching from the end.
4
+ * This approach handles cases where models prepend thinking content (like <think>...</think>)
5
+ * before the actual response tags, or when there are incomplete/nested tags.
6
+ *
7
+ * Strategy: Find the LAST closing tag, then search backwards for the nearest opening tag.
8
+ * This ensures we get the last complete tag pair, even if there are incomplete tags before it.
9
+ *
10
+ * @param xmlString - The XML string to parse
11
+ * @param tagName - The name of the tag to extract (case-insensitive)
12
+ * @returns The trimmed content of the tag, or undefined if not found
13
+ */
14
+ export declare function extractXMLTag(xmlString: string, tagName: string): string | undefined;
15
+ /**
16
+ * Parse sub-goals from XML content
17
+ * Handles both formats:
18
+ * - <sub-goal index="1" status="pending">description</sub-goal>
19
+ * - <sub-goal index="1" status="finished" />
20
+ */
21
+ export declare function parseSubGoalsFromXML(xmlContent: string): SubGoal[];
22
+ /**
23
+ * Extract indexes of sub-goals marked as finished from <mark-sub-goal-done> content
24
+ */
25
+ export declare function parseMarkFinishedIndexes(xmlContent: string): number[];
26
+ export declare const distanceThreshold = 16;
27
+ export declare function distance(point1: {
28
+ x: number;
29
+ y: number;
30
+ }, point2: {
31
+ x: number;
32
+ y: number;
33
+ }): number;
@@ -0,0 +1,100 @@
1
+ import type { StreamingAIResponse, StreamingCodeGenerationOptions } from '../../types';
2
+ import type { IModelConfig } from '@midscene/shared/env';
3
+ export interface EventCounts {
4
+ navigation: number;
5
+ click: number;
6
+ input: number;
7
+ scroll: number;
8
+ total: number;
9
+ }
10
+ export interface InputDescription {
11
+ description: string;
12
+ value: string;
13
+ }
14
+ export interface ProcessedEvent {
15
+ type: string;
16
+ timestamp: number;
17
+ url?: string;
18
+ title?: string;
19
+ elementDescription?: string;
20
+ value?: string;
21
+ pageInfo?: any;
22
+ elementRect?: any;
23
+ }
24
+ export interface EventSummary {
25
+ testName: string;
26
+ startUrl: string;
27
+ eventCounts: EventCounts;
28
+ urls: string[];
29
+ clickDescriptions: string[];
30
+ inputDescriptions: InputDescription[];
31
+ events: ProcessedEvent[];
32
+ }
33
+ export interface ChromeRecordedEvent {
34
+ type: string;
35
+ timestamp: number;
36
+ url?: string;
37
+ title?: string;
38
+ elementDescription?: string;
39
+ value?: string;
40
+ pageInfo?: any;
41
+ elementRect?: any;
42
+ screenshotBefore?: string;
43
+ screenshotAfter?: string;
44
+ screenshotWithBox?: string;
45
+ }
46
+ export interface YamlGenerationOptions {
47
+ testName?: string;
48
+ includeTimestamps?: boolean;
49
+ maxScreenshots?: number;
50
+ description?: string;
51
+ }
52
+ export interface FilteredEvents {
53
+ navigationEvents: ChromeRecordedEvent[];
54
+ clickEvents: ChromeRecordedEvent[];
55
+ inputEvents: ChromeRecordedEvent[];
56
+ scrollEvents: ChromeRecordedEvent[];
57
+ }
58
+ /**
59
+ * Get screenshots from events for LLM context
60
+ */
61
+ export declare const getScreenshotsForLLM: (events: ChromeRecordedEvent[], maxScreenshots?: number) => string[];
62
+ /**
63
+ * Filter events by type for easier processing
64
+ */
65
+ export declare const filterEventsByType: (events: ChromeRecordedEvent[]) => FilteredEvents;
66
+ /**
67
+ * Create event counts summary
68
+ */
69
+ export declare const createEventCounts: (filteredEvents: FilteredEvents, totalEvents: number) => EventCounts;
70
+ /**
71
+ * Extract input descriptions from input events
72
+ */
73
+ export declare const extractInputDescriptions: (inputEvents: ChromeRecordedEvent[]) => InputDescription[];
74
+ /**
75
+ * Process events for LLM consumption
76
+ */
77
+ export declare const processEventsForLLM: (events: ChromeRecordedEvent[]) => ProcessedEvent[];
78
+ /**
79
+ * Prepare comprehensive event summary for LLM
80
+ */
81
+ export declare const prepareEventSummary: (events: ChromeRecordedEvent[], options?: {
82
+ testName?: string;
83
+ maxScreenshots?: number;
84
+ }) => EventSummary;
85
+ /**
86
+ * Create message content for LLM with optional screenshots
87
+ */
88
+ export declare const createMessageContent: (promptText: string, screenshots?: string[], includeScreenshots?: boolean) => any[];
89
+ /**
90
+ * Validate events before processing
91
+ */
92
+ export declare const validateEvents: (events: ChromeRecordedEvent[]) => void;
93
+ /**
94
+ * Generates YAML test configuration from recorded events using AI
95
+ */
96
+ export declare const generateYamlTest: (events: ChromeRecordedEvent[], options: YamlGenerationOptions, modelConfig: IModelConfig) => Promise<string>;
97
+ /**
98
+ * Generates YAML test configuration from recorded events using AI with streaming support
99
+ */
100
+ export declare const generateYamlTestStream: (events: ChromeRecordedEvent[], options: YamlGenerationOptions & StreamingCodeGenerationOptions, modelConfig: IModelConfig) => Promise<StreamingAIResponse>;
@@ -0,0 +1,42 @@
1
+ import type { AIUsageInfo, DeepThinkOption, StreamingCallback } from '../../types';
2
+ import type { IModelConfig } from '@midscene/shared/env';
3
+ import type { ChatCompletionMessageParam } from 'openai/resources/index';
4
+ type CodexReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh';
5
+ type CodexTextInput = {
6
+ type: 'text';
7
+ text: string;
8
+ text_elements: any[];
9
+ };
10
+ type CodexImageInput = {
11
+ type: 'image';
12
+ url: string;
13
+ };
14
+ type CodexLocalImageInput = {
15
+ type: 'localImage';
16
+ path: string;
17
+ };
18
+ type CodexTurnInput = CodexTextInput | CodexImageInput | CodexLocalImageInput;
19
+ type CodexTurnResult = {
20
+ content: string;
21
+ reasoning_content?: string;
22
+ usage?: AIUsageInfo;
23
+ isStreamed: boolean;
24
+ };
25
+ export declare const isCodexAppServerProvider: (baseURL?: string) => boolean;
26
+ export declare const normalizeCodexLocalImagePath: (imageUrl: string, platform?: NodeJS.Platform) => string;
27
+ export declare const resolveCodexReasoningEffort: ({ deepThink, modelConfig, }: {
28
+ deepThink?: DeepThinkOption;
29
+ modelConfig: IModelConfig;
30
+ }) => CodexReasoningEffort | undefined;
31
+ export declare const buildCodexTurnPayloadFromMessages: (messages: ChatCompletionMessageParam[]) => {
32
+ developerInstructions?: string;
33
+ input: CodexTurnInput[];
34
+ };
35
+ export declare function callAIWithCodexAppServer(messages: ChatCompletionMessageParam[], modelConfig: IModelConfig, options?: {
36
+ stream?: boolean;
37
+ onChunk?: StreamingCallback;
38
+ deepThink?: DeepThinkOption;
39
+ abortSignal?: AbortSignal;
40
+ }): Promise<CodexTurnResult>;
41
+ export declare function __shutdownCodexAppServerForTests(): Promise<void>;
42
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { IModelConfig } from '@midscene/shared/env';
2
+ export declare function shouldForceOriginalImageDetail(modelConfig: Pick<IModelConfig, 'intent' | 'modelFamily'>): boolean;