@aiscene/core 9.0.6 → 9.0.8

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 (686) hide show
  1. package/dist/es/agent/agent.mjs +24 -11
  2. package/dist/es/agent/agent.mjs.map +1 -1
  3. package/dist/es/agent/cache-config.mjs +19 -0
  4. package/dist/es/agent/cache-config.mjs.map +1 -0
  5. package/dist/es/agent/file-chooser.mjs +82 -0
  6. package/dist/es/agent/file-chooser.mjs.map +1 -0
  7. package/dist/es/agent/insight.mjs +101 -0
  8. package/dist/es/agent/insight.mjs.map +1 -0
  9. package/dist/es/agent/metrics.mjs +81 -0
  10. package/dist/es/agent/metrics.mjs.map +1 -0
  11. package/dist/es/agent/progress/ai-act-progress.mjs +199 -0
  12. package/dist/es/agent/progress/ai-act-progress.mjs.map +1 -0
  13. package/dist/es/agent/progress/index.mjs +2 -0
  14. package/dist/es/agent/progress/progress-bus.mjs +52 -0
  15. package/dist/es/agent/progress/progress-bus.mjs.map +1 -0
  16. package/dist/es/agent/prompt-context.mjs +25 -0
  17. package/dist/es/agent/prompt-context.mjs.map +1 -0
  18. package/dist/es/agent/record-to-report.mjs +14 -0
  19. package/dist/es/agent/record-to-report.mjs.map +1 -0
  20. package/dist/es/agent/run-gherkin-scenario.mjs +114 -0
  21. package/dist/es/agent/run-gherkin-scenario.mjs.map +1 -0
  22. package/dist/es/agent/run-markdown.mjs +62 -0
  23. package/dist/es/agent/run-markdown.mjs.map +1 -0
  24. package/dist/es/agent/screenshot-preparation.mjs +37 -0
  25. package/dist/es/agent/screenshot-preparation.mjs.map +1 -0
  26. package/dist/es/agent/ui-observer.mjs +385 -0
  27. package/dist/es/agent/ui-observer.mjs.map +1 -0
  28. package/dist/es/agent/utils.mjs +42 -4
  29. package/dist/es/agent/utils.mjs.map +1 -1
  30. package/dist/es/ai-model/connectivity/fixture.mjs +8 -0
  31. package/dist/es/ai-model/connectivity/fixture.mjs.map +1 -0
  32. package/dist/es/ai-model/connectivity/index.mjs +2 -0
  33. package/dist/es/ai-model/connectivity/run-connectivity-test.mjs +160 -0
  34. package/dist/es/ai-model/connectivity/run-connectivity-test.mjs.map +1 -0
  35. package/dist/es/ai-model/conversation-history.mjs.map +1 -1
  36. package/dist/es/ai-model/index.mjs +2 -1
  37. package/dist/es/ai-model/inspect.mjs +1 -1
  38. package/dist/es/ai-model/inspect.mjs.map +1 -1
  39. package/dist/es/ai-model/model-adapter/chat-completion.mjs +69 -0
  40. package/dist/es/ai-model/model-adapter/chat-completion.mjs.map +1 -0
  41. package/dist/es/ai-model/model-adapter/custom-planning-action.mjs +6 -0
  42. package/dist/es/ai-model/model-adapter/custom-planning-action.mjs.map +1 -0
  43. package/dist/es/ai-model/model-adapter/custom-planning-types.mjs +0 -0
  44. package/dist/es/ai-model/model-adapter/default-insight-protocol.mjs +28 -0
  45. package/dist/es/ai-model/model-adapter/default-insight-protocol.mjs.map +1 -0
  46. package/dist/es/ai-model/model-adapter/default-locate-protocol.mjs +145 -0
  47. package/dist/es/ai-model/model-adapter/default-locate-protocol.mjs.map +1 -0
  48. package/dist/es/ai-model/model-adapter/default-planning-protocol.mjs +124 -0
  49. package/dist/es/ai-model/model-adapter/default-planning-protocol.mjs.map +1 -0
  50. package/dist/es/ai-model/model-adapter/image-preprocess.mjs +27 -0
  51. package/dist/es/ai-model/model-adapter/image-preprocess.mjs.map +1 -0
  52. package/dist/es/ai-model/model-adapter/index.mjs +2 -0
  53. package/dist/es/ai-model/model-adapter/insight-protocol.mjs +0 -0
  54. package/dist/es/ai-model/model-adapter/insight.mjs +13 -0
  55. package/dist/es/ai-model/model-adapter/insight.mjs.map +1 -0
  56. package/dist/es/ai-model/model-adapter/locate-protocol.mjs +0 -0
  57. package/dist/es/ai-model/model-adapter/locate.mjs +53 -0
  58. package/dist/es/ai-model/model-adapter/locate.mjs.map +1 -0
  59. package/dist/es/ai-model/model-adapter/planning-protocol.mjs +0 -0
  60. package/dist/es/ai-model/model-adapter/planning.mjs +49 -0
  61. package/dist/es/ai-model/model-adapter/planning.mjs.map +1 -0
  62. package/dist/es/ai-model/model-adapter/resolve.mjs +54 -0
  63. package/dist/es/ai-model/model-adapter/resolve.mjs.map +1 -0
  64. package/dist/es/ai-model/model-adapter/types.mjs +0 -0
  65. package/dist/es/ai-model/models/auto-glm/actions.mjs +205 -0
  66. package/dist/es/ai-model/models/auto-glm/actions.mjs.map +1 -0
  67. package/dist/es/ai-model/models/auto-glm/adapter.mjs +45 -0
  68. package/dist/es/ai-model/models/auto-glm/adapter.mjs.map +1 -0
  69. package/dist/es/ai-model/models/auto-glm/locate.mjs +11 -0
  70. package/dist/es/ai-model/models/auto-glm/locate.mjs.map +1 -0
  71. package/dist/es/ai-model/models/auto-glm/parser.mjs +217 -0
  72. package/dist/es/ai-model/models/auto-glm/parser.mjs.map +1 -0
  73. package/dist/es/ai-model/models/auto-glm/planning.mjs +33 -0
  74. package/dist/es/ai-model/models/auto-glm/planning.mjs.map +1 -0
  75. package/dist/es/ai-model/models/auto-glm/prompt.mjs +214 -0
  76. package/dist/es/ai-model/models/auto-glm/prompt.mjs.map +1 -0
  77. package/dist/es/ai-model/models/deepseek/adapter.mjs +79 -0
  78. package/dist/es/ai-model/models/deepseek/adapter.mjs.map +1 -0
  79. package/dist/es/ai-model/models/deepseek/locate-protocol.mjs +89 -0
  80. package/dist/es/ai-model/models/deepseek/locate-protocol.mjs.map +1 -0
  81. package/dist/es/ai-model/models/default.mjs +13 -0
  82. package/dist/es/ai-model/models/default.mjs.map +1 -0
  83. package/dist/es/ai-model/models/doubao.mjs +95 -0
  84. package/dist/es/ai-model/models/doubao.mjs.map +1 -0
  85. package/dist/es/ai-model/models/gemini.mjs +100 -0
  86. package/dist/es/ai-model/models/gemini.mjs.map +1 -0
  87. package/dist/es/ai-model/models/glm.mjs +46 -0
  88. package/dist/es/ai-model/models/glm.mjs.map +1 -0
  89. package/dist/es/ai-model/models/gpt.mjs +43 -0
  90. package/dist/es/ai-model/models/gpt.mjs.map +1 -0
  91. package/dist/es/ai-model/models/index.mjs +2 -0
  92. package/dist/es/ai-model/models/kimi.mjs +102 -0
  93. package/dist/es/ai-model/models/kimi.mjs.map +1 -0
  94. package/dist/es/ai-model/models/mimo.mjs +36 -0
  95. package/dist/es/ai-model/models/mimo.mjs.map +1 -0
  96. package/dist/es/ai-model/models/qwen.mjs +139 -0
  97. package/dist/es/ai-model/models/qwen.mjs.map +1 -0
  98. package/dist/es/ai-model/models/registry.mjs +51 -0
  99. package/dist/es/ai-model/models/registry.mjs.map +1 -0
  100. package/dist/es/ai-model/models/ui-tars/actions.mjs +147 -0
  101. package/dist/es/ai-model/models/ui-tars/actions.mjs.map +1 -0
  102. package/dist/es/ai-model/models/ui-tars/adapter.mjs +102 -0
  103. package/dist/es/ai-model/models/ui-tars/adapter.mjs.map +1 -0
  104. package/dist/es/ai-model/models/ui-tars/parser.mjs +40 -0
  105. package/dist/es/ai-model/models/ui-tars/parser.mjs.map +1 -0
  106. package/dist/es/ai-model/models/ui-tars/planning.mjs +25 -0
  107. package/dist/es/ai-model/models/ui-tars/planning.mjs.map +1 -0
  108. package/dist/es/ai-model/models/ui-tars/prompt.mjs +36 -0
  109. package/dist/es/ai-model/models/ui-tars/prompt.mjs.map +1 -0
  110. package/dist/es/ai-model/models/utils/intent.mjs +6 -0
  111. package/dist/es/ai-model/models/utils/intent.mjs.map +1 -0
  112. package/dist/es/ai-model/prompt/insight/index.mjs +3 -0
  113. package/dist/es/ai-model/prompt/insight/system-prompt.mjs +104 -0
  114. package/dist/es/ai-model/prompt/insight/system-prompt.mjs.map +1 -0
  115. package/dist/es/ai-model/prompt/insight/user-prompt.mjs +23 -0
  116. package/dist/es/ai-model/prompt/insight/user-prompt.mjs.map +1 -0
  117. package/dist/es/ai-model/prompt/locate/element-system-prompt.mjs +12 -0
  118. package/dist/es/ai-model/prompt/locate/element-system-prompt.mjs.map +1 -0
  119. package/dist/es/ai-model/prompt/locate/grounding-rules.mjs +13 -0
  120. package/dist/es/ai-model/prompt/locate/grounding-rules.mjs.map +1 -0
  121. package/dist/es/ai-model/prompt/locate/index.mjs +4 -0
  122. package/dist/es/ai-model/prompt/locate/search-area-system-prompt.mjs +9 -0
  123. package/dist/es/ai-model/prompt/locate/search-area-system-prompt.mjs.map +1 -0
  124. package/dist/es/ai-model/prompt/planning/action-output-example.mjs +52 -0
  125. package/dist/es/ai-model/prompt/planning/action-output-example.mjs.map +1 -0
  126. package/dist/es/ai-model/prompt/planning/action-space-description.mjs +28 -0
  127. package/dist/es/ai-model/prompt/planning/action-space-description.mjs.map +1 -0
  128. package/dist/es/ai-model/prompt/planning/index.mjs +6 -0
  129. package/dist/es/ai-model/prompt/planning/multi-turn-example.mjs +221 -0
  130. package/dist/es/ai-model/prompt/planning/multi-turn-example.mjs.map +1 -0
  131. package/dist/es/ai-model/prompt/planning/planning-response-example.mjs +25 -0
  132. package/dist/es/ai-model/prompt/planning/planning-response-example.mjs.map +1 -0
  133. package/dist/es/ai-model/prompt/planning/sub-goals-text.mjs +17 -0
  134. package/dist/es/ai-model/prompt/planning/sub-goals-text.mjs.map +1 -0
  135. package/dist/es/ai-model/prompt/planning/system-prompt.mjs +293 -0
  136. package/dist/es/ai-model/prompt/planning/system-prompt.mjs.map +1 -0
  137. package/dist/es/ai-model/service-caller/codex-app-server.mjs +1 -0
  138. package/dist/es/ai-model/service-caller/codex-app-server.mjs.map +1 -1
  139. package/dist/es/ai-model/service-caller/index.mjs +35 -16
  140. package/dist/es/ai-model/service-caller/index.mjs.map +1 -1
  141. package/dist/es/ai-model/service-caller/model-call-recorder.mjs +74 -0
  142. package/dist/es/ai-model/service-caller/model-call-recorder.mjs.map +1 -0
  143. package/dist/es/ai-model/service-caller/openai-error.mjs +147 -0
  144. package/dist/es/ai-model/service-caller/openai-error.mjs.map +1 -0
  145. package/dist/es/ai-model/service-caller/proxy-deps.node.mjs +9 -0
  146. package/dist/es/ai-model/service-caller/proxy-deps.node.mjs.map +1 -0
  147. package/dist/es/ai-model/service-caller/proxy-deps.stub.mjs +12 -0
  148. package/dist/es/ai-model/service-caller/proxy-deps.stub.mjs.map +1 -0
  149. package/dist/es/ai-model/service-caller/semantic-retry.mjs +33 -0
  150. package/dist/es/ai-model/service-caller/semantic-retry.mjs.map +1 -0
  151. package/dist/es/ai-model/service-caller/types.mjs +0 -0
  152. package/dist/es/ai-model/shared/action-schema.mjs +15 -0
  153. package/dist/es/ai-model/shared/action-schema.mjs.map +1 -0
  154. package/dist/es/ai-model/shared/json.mjs +63 -0
  155. package/dist/es/ai-model/shared/json.mjs.map +1 -0
  156. package/dist/es/ai-model/shared/model-locate-result/bbox.mjs +60 -0
  157. package/dist/es/ai-model/shared/model-locate-result/bbox.mjs.map +1 -0
  158. package/dist/es/ai-model/shared/model-locate-result/coordinate-distance.mjs +10 -0
  159. package/dist/es/ai-model/shared/model-locate-result/coordinate-distance.mjs.map +1 -0
  160. package/dist/es/ai-model/shared/model-locate-result/errors.mjs +9 -0
  161. package/dist/es/ai-model/shared/model-locate-result/errors.mjs.map +1 -0
  162. package/dist/es/ai-model/shared/model-locate-result/factory.mjs +39 -0
  163. package/dist/es/ai-model/shared/model-locate-result/factory.mjs.map +1 -0
  164. package/dist/es/ai-model/shared/model-locate-result/index.mjs +6 -0
  165. package/dist/es/ai-model/shared/model-locate-result/parse.mjs +45 -0
  166. package/dist/es/ai-model/shared/model-locate-result/parse.mjs.map +1 -0
  167. package/dist/es/ai-model/shared/model-locate-result/pixel-bbox-mapper.mjs +67 -0
  168. package/dist/es/ai-model/shared/model-locate-result/pixel-bbox-mapper.mjs.map +1 -0
  169. package/dist/es/ai-model/shared/model-locate-result/prompt-spec.mjs +110 -0
  170. package/dist/es/ai-model/shared/model-locate-result/prompt-spec.mjs.map +1 -0
  171. package/dist/es/ai-model/shared/model-locate-result/types.mjs +9 -0
  172. package/dist/es/ai-model/shared/model-locate-result/types.mjs.map +1 -0
  173. package/dist/es/ai-model/shared/multimodal-prompt.mjs +55 -0
  174. package/dist/es/ai-model/shared/multimodal-prompt.mjs.map +1 -0
  175. package/dist/es/ai-model/shared/xml.mjs +42 -0
  176. package/dist/es/ai-model/shared/xml.mjs.map +1 -0
  177. package/dist/es/ai-model/workflows/grounding/index.mjs +4 -0
  178. package/dist/es/ai-model/workflows/grounding/locate-result-rect.mjs +23 -0
  179. package/dist/es/ai-model/workflows/grounding/locate-result-rect.mjs.map +1 -0
  180. package/dist/es/ai-model/workflows/grounding/locate.mjs +168 -0
  181. package/dist/es/ai-model/workflows/grounding/locate.mjs.map +1 -0
  182. package/dist/es/ai-model/workflows/grounding/planning-action-locate.mjs +97 -0
  183. package/dist/es/ai-model/workflows/grounding/planning-action-locate.mjs.map +1 -0
  184. package/dist/es/ai-model/workflows/grounding/search-area-mapping.mjs +18 -0
  185. package/dist/es/ai-model/workflows/grounding/search-area-mapping.mjs.map +1 -0
  186. package/dist/es/ai-model/workflows/grounding/search-area.mjs +55 -0
  187. package/dist/es/ai-model/workflows/grounding/search-area.mjs.map +1 -0
  188. package/dist/es/ai-model/workflows/grounding/section-locate.mjs +146 -0
  189. package/dist/es/ai-model/workflows/grounding/section-locate.mjs.map +1 -0
  190. package/dist/es/ai-model/workflows/grounding/types.mjs +0 -0
  191. package/dist/es/ai-model/workflows/grounding/utils.mjs +50 -0
  192. package/dist/es/ai-model/workflows/grounding/utils.mjs.map +1 -0
  193. package/dist/es/ai-model/workflows/insight/extraction.mjs +101 -0
  194. package/dist/es/ai-model/workflows/insight/extraction.mjs.map +1 -0
  195. package/dist/es/ai-model/workflows/insight/index.mjs +3 -0
  196. package/dist/es/ai-model/workflows/insight/insight-response-parser.mjs +26 -0
  197. package/dist/es/ai-model/workflows/insight/insight-response-parser.mjs.map +1 -0
  198. package/dist/es/ai-model/workflows/insight/order-sensitive.mjs +29 -0
  199. package/dist/es/ai-model/workflows/insight/order-sensitive.mjs.map +1 -0
  200. package/dist/es/ai-model/workflows/planning/conversation-history.mjs +185 -0
  201. package/dist/es/ai-model/workflows/planning/conversation-history.mjs.map +1 -0
  202. package/dist/es/ai-model/workflows/planning/custom-planning.mjs +129 -0
  203. package/dist/es/ai-model/workflows/planning/custom-planning.mjs.map +1 -0
  204. package/dist/es/ai-model/workflows/planning/index.mjs +4 -0
  205. package/dist/es/ai-model/workflows/planning/locate-normalization.mjs +41 -0
  206. package/dist/es/ai-model/workflows/planning/locate-normalization.mjs.map +1 -0
  207. package/dist/es/ai-model/workflows/planning/planning-action-log.mjs +22 -0
  208. package/dist/es/ai-model/workflows/planning/planning-action-log.mjs.map +1 -0
  209. package/dist/es/ai-model/workflows/planning/standard-planning-parser.mjs +99 -0
  210. package/dist/es/ai-model/workflows/planning/standard-planning-parser.mjs.map +1 -0
  211. package/dist/es/ai-model/workflows/planning/standard-planning.mjs +219 -0
  212. package/dist/es/ai-model/workflows/planning/standard-planning.mjs.map +1 -0
  213. package/dist/es/ai-model/workflows/planning/types.mjs +0 -0
  214. package/dist/es/ai-model/workflows/recorder-generation/common.mjs +171 -0
  215. package/dist/es/ai-model/workflows/recorder-generation/common.mjs.map +1 -0
  216. package/dist/es/ai-model/workflows/recorder-generation/index.mjs +5 -0
  217. package/dist/es/ai-model/workflows/recorder-generation/markdown.mjs +253 -0
  218. package/dist/es/ai-model/workflows/recorder-generation/markdown.mjs.map +1 -0
  219. package/dist/es/ai-model/workflows/recorder-generation/metadata.mjs +83 -0
  220. package/dist/es/ai-model/workflows/recorder-generation/metadata.mjs.map +1 -0
  221. package/dist/es/ai-model/workflows/recorder-generation/playwright.mjs +123 -0
  222. package/dist/es/ai-model/workflows/recorder-generation/playwright.mjs.map +1 -0
  223. package/dist/es/ai-model/workflows/recorder-generation/yaml.mjs +162 -0
  224. package/dist/es/ai-model/workflows/recorder-generation/yaml.mjs.map +1 -0
  225. package/dist/es/common.mjs +12 -1
  226. package/dist/es/common.mjs.map +1 -1
  227. package/dist/es/constants.mjs +4 -0
  228. package/dist/es/constants.mjs.map +1 -0
  229. package/dist/es/device/index.mjs.map +1 -1
  230. package/dist/es/device/input-strategy.mjs +34 -0
  231. package/dist/es/device/input-strategy.mjs.map +1 -0
  232. package/dist/es/dump/html-utils.mjs +16 -1
  233. package/dist/es/dump/html-utils.mjs.map +1 -1
  234. package/dist/es/dump/image-reference.mjs +63 -0
  235. package/dist/es/dump/image-reference.mjs.map +1 -0
  236. package/dist/es/dump/report-action-dump.mjs +244 -0
  237. package/dist/es/dump/report-action-dump.mjs.map +1 -0
  238. package/dist/es/dump/report-dump-compactor.mjs +200 -0
  239. package/dist/es/dump/report-dump-compactor.mjs.map +1 -0
  240. package/dist/es/dump/screenshot-store.mjs +124 -37
  241. package/dist/es/dump/screenshot-store.mjs.map +1 -1
  242. package/dist/es/dump/task-service-dump.mjs +17 -0
  243. package/dist/es/dump/task-service-dump.mjs.map +1 -0
  244. package/dist/es/dump/task-status.mjs +18 -0
  245. package/dist/es/dump/task-status.mjs.map +1 -0
  246. package/dist/es/element-describer.mjs +198 -0
  247. package/dist/es/element-describer.mjs.map +1 -0
  248. package/dist/es/errors.mjs +20 -0
  249. package/dist/es/errors.mjs.map +1 -0
  250. package/dist/es/report-html-template.mjs +4 -0
  251. package/dist/es/report-html-template.mjs.map +1 -0
  252. package/dist/es/report-stats.mjs +113 -0
  253. package/dist/es/report-stats.mjs.map +1 -0
  254. package/dist/es/screenshot-item.mjs +7 -2
  255. package/dist/es/screenshot-item.mjs.map +1 -1
  256. package/dist/es/service/index.mjs +10 -5
  257. package/dist/es/service/index.mjs.map +1 -1
  258. package/dist/es/task-runner.mjs.map +1 -1
  259. package/dist/es/types.mjs.map +1 -1
  260. package/dist/es/utils.mjs +1 -1
  261. package/dist/es/yaml/cleanup.mjs +13 -0
  262. package/dist/es/yaml/cleanup.mjs.map +1 -0
  263. package/dist/lib/agent/agent.js +24 -11
  264. package/dist/lib/agent/agent.js.map +1 -1
  265. package/dist/lib/agent/cache-config.js +53 -0
  266. package/dist/lib/agent/cache-config.js.map +1 -0
  267. package/dist/lib/agent/file-chooser.js +125 -0
  268. package/dist/lib/agent/file-chooser.js.map +1 -0
  269. package/dist/lib/agent/insight.js +135 -0
  270. package/dist/lib/agent/insight.js.map +1 -0
  271. package/dist/lib/agent/metrics.js +115 -0
  272. package/dist/lib/agent/metrics.js.map +1 -0
  273. package/dist/lib/agent/progress/ai-act-progress.js +239 -0
  274. package/dist/lib/agent/progress/ai-act-progress.js.map +1 -0
  275. package/dist/lib/agent/progress/index.js +67 -0
  276. package/dist/lib/agent/progress/index.js.map +1 -0
  277. package/dist/lib/agent/progress/progress-bus.js +86 -0
  278. package/dist/lib/agent/progress/progress-bus.js.map +1 -0
  279. package/dist/lib/agent/prompt-context.js +62 -0
  280. package/dist/lib/agent/prompt-context.js.map +1 -0
  281. package/dist/lib/agent/record-to-report.js +48 -0
  282. package/dist/lib/agent/record-to-report.js.map +1 -0
  283. package/dist/lib/agent/run-gherkin-scenario.js +151 -0
  284. package/dist/lib/agent/run-gherkin-scenario.js.map +1 -0
  285. package/dist/lib/agent/run-markdown.js +96 -0
  286. package/dist/lib/agent/run-markdown.js.map +1 -0
  287. package/dist/lib/agent/screenshot-preparation.js +74 -0
  288. package/dist/lib/agent/screenshot-preparation.js.map +1 -0
  289. package/dist/lib/agent/ui-observer.js +425 -0
  290. package/dist/lib/agent/ui-observer.js.map +1 -0
  291. package/dist/lib/agent/utils.js +46 -2
  292. package/dist/lib/agent/utils.js.map +1 -1
  293. package/dist/lib/ai-model/connectivity/fixture.js +45 -0
  294. package/dist/lib/ai-model/connectivity/fixture.js.map +1 -0
  295. package/dist/lib/ai-model/connectivity/index.js +38 -0
  296. package/dist/lib/ai-model/connectivity/index.js.map +1 -0
  297. package/dist/lib/ai-model/connectivity/run-connectivity-test.js +204 -0
  298. package/dist/lib/ai-model/connectivity/run-connectivity-test.js.map +1 -0
  299. package/dist/lib/ai-model/conversation-history.js.map +1 -1
  300. package/dist/lib/ai-model/index.js +15 -11
  301. package/dist/lib/ai-model/inspect.js +1 -1
  302. package/dist/lib/ai-model/inspect.js.map +1 -1
  303. package/dist/lib/ai-model/model-adapter/chat-completion.js +103 -0
  304. package/dist/lib/ai-model/model-adapter/chat-completion.js.map +1 -0
  305. package/dist/lib/ai-model/model-adapter/custom-planning-action.js +40 -0
  306. package/dist/lib/ai-model/model-adapter/custom-planning-action.js.map +1 -0
  307. package/dist/lib/ai-model/model-adapter/custom-planning-types.js +20 -0
  308. package/dist/lib/ai-model/model-adapter/custom-planning-types.js.map +1 -0
  309. package/dist/lib/ai-model/model-adapter/default-insight-protocol.js +62 -0
  310. package/dist/lib/ai-model/model-adapter/default-insight-protocol.js.map +1 -0
  311. package/dist/lib/ai-model/model-adapter/default-locate-protocol.js +182 -0
  312. package/dist/lib/ai-model/model-adapter/default-locate-protocol.js.map +1 -0
  313. package/dist/lib/ai-model/model-adapter/default-planning-protocol.js +170 -0
  314. package/dist/lib/ai-model/model-adapter/default-planning-protocol.js.map +1 -0
  315. package/dist/lib/ai-model/model-adapter/image-preprocess.js +61 -0
  316. package/dist/lib/ai-model/model-adapter/image-preprocess.js.map +1 -0
  317. package/dist/lib/ai-model/model-adapter/index.js +38 -0
  318. package/dist/lib/ai-model/model-adapter/index.js.map +1 -0
  319. package/dist/lib/ai-model/model-adapter/insight-protocol.js +20 -0
  320. package/dist/lib/ai-model/model-adapter/insight-protocol.js.map +1 -0
  321. package/dist/lib/ai-model/model-adapter/insight.js +50 -0
  322. package/dist/lib/ai-model/model-adapter/insight.js.map +1 -0
  323. package/dist/lib/ai-model/model-adapter/locate-protocol.js +20 -0
  324. package/dist/lib/ai-model/model-adapter/locate-protocol.js.map +1 -0
  325. package/dist/lib/ai-model/model-adapter/locate.js +87 -0
  326. package/dist/lib/ai-model/model-adapter/locate.js.map +1 -0
  327. package/dist/lib/ai-model/model-adapter/planning-protocol.js +20 -0
  328. package/dist/lib/ai-model/model-adapter/planning-protocol.js.map +1 -0
  329. package/dist/lib/ai-model/model-adapter/planning.js +86 -0
  330. package/dist/lib/ai-model/model-adapter/planning.js.map +1 -0
  331. package/dist/lib/ai-model/model-adapter/resolve.js +88 -0
  332. package/dist/lib/ai-model/model-adapter/resolve.js.map +1 -0
  333. package/dist/lib/ai-model/model-adapter/types.js +20 -0
  334. package/dist/lib/ai-model/model-adapter/types.js.map +1 -0
  335. package/dist/lib/ai-model/models/auto-glm/actions.js +239 -0
  336. package/dist/lib/ai-model/models/auto-glm/actions.js.map +1 -0
  337. package/dist/lib/ai-model/models/auto-glm/adapter.js +79 -0
  338. package/dist/lib/ai-model/models/auto-glm/adapter.js.map +1 -0
  339. package/dist/lib/ai-model/models/auto-glm/locate.js +45 -0
  340. package/dist/lib/ai-model/models/auto-glm/locate.js.map +1 -0
  341. package/dist/lib/ai-model/models/auto-glm/parser.js +260 -0
  342. package/dist/lib/ai-model/models/auto-glm/parser.js.map +1 -0
  343. package/dist/lib/ai-model/models/auto-glm/planning.js +67 -0
  344. package/dist/lib/ai-model/models/auto-glm/planning.js.map +1 -0
  345. package/dist/lib/ai-model/models/auto-glm/prompt.js +257 -0
  346. package/dist/lib/ai-model/models/auto-glm/prompt.js.map +1 -0
  347. package/dist/lib/ai-model/models/deepseek/adapter.js +113 -0
  348. package/dist/lib/ai-model/models/deepseek/adapter.js.map +1 -0
  349. package/dist/lib/ai-model/models/deepseek/locate-protocol.js +132 -0
  350. package/dist/lib/ai-model/models/deepseek/locate-protocol.js.map +1 -0
  351. package/dist/lib/ai-model/models/default.js +47 -0
  352. package/dist/lib/ai-model/models/default.js.map +1 -0
  353. package/dist/lib/ai-model/models/doubao.js +132 -0
  354. package/dist/lib/ai-model/models/doubao.js.map +1 -0
  355. package/dist/lib/ai-model/models/gemini.js +137 -0
  356. package/dist/lib/ai-model/models/gemini.js.map +1 -0
  357. package/dist/lib/ai-model/models/glm.js +80 -0
  358. package/dist/lib/ai-model/models/glm.js.map +1 -0
  359. package/dist/lib/ai-model/models/gpt.js +77 -0
  360. package/dist/lib/ai-model/models/gpt.js.map +1 -0
  361. package/dist/lib/ai-model/models/index.js +41 -0
  362. package/dist/lib/ai-model/models/index.js.map +1 -0
  363. package/dist/lib/ai-model/models/kimi.js +136 -0
  364. package/dist/lib/ai-model/models/kimi.js.map +1 -0
  365. package/dist/lib/ai-model/models/mimo.js +70 -0
  366. package/dist/lib/ai-model/models/mimo.js.map +1 -0
  367. package/dist/lib/ai-model/models/qwen.js +173 -0
  368. package/dist/lib/ai-model/models/qwen.js.map +1 -0
  369. package/dist/lib/ai-model/models/registry.js +91 -0
  370. package/dist/lib/ai-model/models/registry.js.map +1 -0
  371. package/dist/lib/ai-model/models/ui-tars/actions.js +181 -0
  372. package/dist/lib/ai-model/models/ui-tars/actions.js.map +1 -0
  373. package/dist/lib/ai-model/models/ui-tars/adapter.js +136 -0
  374. package/dist/lib/ai-model/models/ui-tars/adapter.js.map +1 -0
  375. package/dist/lib/ai-model/models/ui-tars/parser.js +74 -0
  376. package/dist/lib/ai-model/models/ui-tars/parser.js.map +1 -0
  377. package/dist/lib/ai-model/models/ui-tars/planning.js +59 -0
  378. package/dist/lib/ai-model/models/ui-tars/planning.js.map +1 -0
  379. package/dist/lib/ai-model/models/ui-tars/prompt.js +73 -0
  380. package/dist/lib/ai-model/models/ui-tars/prompt.js.map +1 -0
  381. package/dist/lib/ai-model/models/utils/intent.js +40 -0
  382. package/dist/lib/ai-model/models/utils/intent.js.map +1 -0
  383. package/dist/lib/ai-model/prompt/insight/index.js +45 -0
  384. package/dist/lib/ai-model/prompt/insight/index.js.map +1 -0
  385. package/dist/lib/ai-model/prompt/insight/system-prompt.js +138 -0
  386. package/dist/lib/ai-model/prompt/insight/system-prompt.js.map +1 -0
  387. package/dist/lib/ai-model/prompt/insight/user-prompt.js +60 -0
  388. package/dist/lib/ai-model/prompt/insight/user-prompt.js.map +1 -0
  389. package/dist/lib/ai-model/prompt/locate/element-system-prompt.js +46 -0
  390. package/dist/lib/ai-model/prompt/locate/element-system-prompt.js.map +1 -0
  391. package/dist/lib/ai-model/prompt/locate/grounding-rules.js +47 -0
  392. package/dist/lib/ai-model/prompt/locate/grounding-rules.js.map +1 -0
  393. package/dist/lib/ai-model/prompt/locate/index.js +46 -0
  394. package/dist/lib/ai-model/prompt/locate/index.js.map +1 -0
  395. package/dist/lib/ai-model/prompt/locate/search-area-system-prompt.js +43 -0
  396. package/dist/lib/ai-model/prompt/locate/search-area-system-prompt.js.map +1 -0
  397. package/dist/lib/ai-model/prompt/planning/action-output-example.js +92 -0
  398. package/dist/lib/ai-model/prompt/planning/action-output-example.js.map +1 -0
  399. package/dist/lib/ai-model/prompt/planning/action-space-description.js +75 -0
  400. package/dist/lib/ai-model/prompt/planning/action-space-description.js.map +1 -0
  401. package/dist/lib/ai-model/prompt/planning/index.js +63 -0
  402. package/dist/lib/ai-model/prompt/planning/index.js.map +1 -0
  403. package/dist/lib/ai-model/prompt/planning/multi-turn-example.js +255 -0
  404. package/dist/lib/ai-model/prompt/planning/multi-turn-example.js.map +1 -0
  405. package/dist/lib/ai-model/prompt/planning/planning-response-example.js +59 -0
  406. package/dist/lib/ai-model/prompt/planning/planning-response-example.js.map +1 -0
  407. package/dist/lib/ai-model/prompt/planning/sub-goals-text.js +51 -0
  408. package/dist/lib/ai-model/prompt/planning/sub-goals-text.js.map +1 -0
  409. package/dist/lib/ai-model/prompt/planning/system-prompt.js +327 -0
  410. package/dist/lib/ai-model/prompt/planning/system-prompt.js.map +1 -0
  411. package/dist/lib/ai-model/service-caller/codex-app-server.js +1 -0
  412. package/dist/lib/ai-model/service-caller/codex-app-server.js.map +1 -1
  413. package/dist/lib/ai-model/service-caller/index.js +35 -16
  414. package/dist/lib/ai-model/service-caller/index.js.map +1 -1
  415. package/dist/lib/ai-model/service-caller/model-call-recorder.js +124 -0
  416. package/dist/lib/ai-model/service-caller/model-call-recorder.js.map +1 -0
  417. package/dist/lib/ai-model/service-caller/openai-error.js +184 -0
  418. package/dist/lib/ai-model/service-caller/openai-error.js.map +1 -0
  419. package/dist/lib/ai-model/service-caller/proxy-deps.node.js +46 -0
  420. package/dist/lib/ai-model/service-caller/proxy-deps.node.js.map +1 -0
  421. package/dist/lib/ai-model/service-caller/proxy-deps.stub.js +49 -0
  422. package/dist/lib/ai-model/service-caller/proxy-deps.stub.js.map +1 -0
  423. package/dist/lib/ai-model/service-caller/semantic-retry.js +70 -0
  424. package/dist/lib/ai-model/service-caller/semantic-retry.js.map +1 -0
  425. package/dist/lib/ai-model/service-caller/types.js +20 -0
  426. package/dist/lib/ai-model/service-caller/types.js.map +1 -0
  427. package/dist/lib/ai-model/shared/action-schema.js +49 -0
  428. package/dist/lib/ai-model/shared/action-schema.js.map +1 -0
  429. package/dist/lib/ai-model/shared/json.js +103 -0
  430. package/dist/lib/ai-model/shared/json.js.map +1 -0
  431. package/dist/lib/ai-model/shared/model-locate-result/bbox.js +106 -0
  432. package/dist/lib/ai-model/shared/model-locate-result/bbox.js.map +1 -0
  433. package/dist/lib/ai-model/shared/model-locate-result/coordinate-distance.js +44 -0
  434. package/dist/lib/ai-model/shared/model-locate-result/coordinate-distance.js.map +1 -0
  435. package/dist/lib/ai-model/shared/model-locate-result/errors.js +46 -0
  436. package/dist/lib/ai-model/shared/model-locate-result/errors.js.map +1 -0
  437. package/dist/lib/ai-model/shared/model-locate-result/factory.js +76 -0
  438. package/dist/lib/ai-model/shared/model-locate-result/factory.js.map +1 -0
  439. package/dist/lib/ai-model/shared/model-locate-result/index.js +66 -0
  440. package/dist/lib/ai-model/shared/model-locate-result/index.js.map +1 -0
  441. package/dist/lib/ai-model/shared/model-locate-result/parse.js +88 -0
  442. package/dist/lib/ai-model/shared/model-locate-result/parse.js.map +1 -0
  443. package/dist/lib/ai-model/shared/model-locate-result/pixel-bbox-mapper.js +101 -0
  444. package/dist/lib/ai-model/shared/model-locate-result/pixel-bbox-mapper.js.map +1 -0
  445. package/dist/lib/ai-model/shared/model-locate-result/prompt-spec.js +156 -0
  446. package/dist/lib/ai-model/shared/model-locate-result/prompt-spec.js.map +1 -0
  447. package/dist/lib/ai-model/shared/model-locate-result/types.js +46 -0
  448. package/dist/lib/ai-model/shared/model-locate-result/types.js.map +1 -0
  449. package/dist/lib/ai-model/shared/multimodal-prompt.js +95 -0
  450. package/dist/lib/ai-model/shared/multimodal-prompt.js.map +1 -0
  451. package/dist/lib/ai-model/shared/xml.js +79 -0
  452. package/dist/lib/ai-model/shared/xml.js.map +1 -0
  453. package/dist/lib/ai-model/workflows/grounding/index.js +46 -0
  454. package/dist/lib/ai-model/workflows/grounding/index.js.map +1 -0
  455. package/dist/lib/ai-model/workflows/grounding/locate-result-rect.js +60 -0
  456. package/dist/lib/ai-model/workflows/grounding/locate-result-rect.js.map +1 -0
  457. package/dist/lib/ai-model/workflows/grounding/locate.js +208 -0
  458. package/dist/lib/ai-model/workflows/grounding/locate.js.map +1 -0
  459. package/dist/lib/ai-model/workflows/grounding/planning-action-locate.js +131 -0
  460. package/dist/lib/ai-model/workflows/grounding/planning-action-locate.js.map +1 -0
  461. package/dist/lib/ai-model/workflows/grounding/search-area-mapping.js +52 -0
  462. package/dist/lib/ai-model/workflows/grounding/search-area-mapping.js.map +1 -0
  463. package/dist/lib/ai-model/workflows/grounding/search-area.js +92 -0
  464. package/dist/lib/ai-model/workflows/grounding/search-area.js.map +1 -0
  465. package/dist/lib/ai-model/workflows/grounding/section-locate.js +180 -0
  466. package/dist/lib/ai-model/workflows/grounding/section-locate.js.map +1 -0
  467. package/dist/lib/ai-model/workflows/grounding/types.js +20 -0
  468. package/dist/lib/ai-model/workflows/grounding/types.js.map +1 -0
  469. package/dist/lib/ai-model/workflows/grounding/utils.js +87 -0
  470. package/dist/lib/ai-model/workflows/grounding/utils.js.map +1 -0
  471. package/dist/lib/ai-model/workflows/insight/extraction.js +135 -0
  472. package/dist/lib/ai-model/workflows/insight/extraction.js.map +1 -0
  473. package/dist/lib/ai-model/workflows/insight/index.js +42 -0
  474. package/dist/lib/ai-model/workflows/insight/index.js.map +1 -0
  475. package/dist/lib/ai-model/workflows/insight/insight-response-parser.js +60 -0
  476. package/dist/lib/ai-model/workflows/insight/insight-response-parser.js.map +1 -0
  477. package/dist/lib/ai-model/workflows/insight/order-sensitive.js +63 -0
  478. package/dist/lib/ai-model/workflows/insight/order-sensitive.js.map +1 -0
  479. package/dist/lib/ai-model/workflows/planning/conversation-history.js +219 -0
  480. package/dist/lib/ai-model/workflows/planning/conversation-history.js.map +1 -0
  481. package/dist/lib/ai-model/workflows/planning/custom-planning.js +166 -0
  482. package/dist/lib/ai-model/workflows/planning/custom-planning.js.map +1 -0
  483. package/dist/lib/ai-model/workflows/planning/index.js +49 -0
  484. package/dist/lib/ai-model/workflows/planning/index.js.map +1 -0
  485. package/dist/lib/ai-model/workflows/planning/locate-normalization.js +75 -0
  486. package/dist/lib/ai-model/workflows/planning/locate-normalization.js.map +1 -0
  487. package/dist/lib/ai-model/workflows/planning/planning-action-log.js +56 -0
  488. package/dist/lib/ai-model/workflows/planning/planning-action-log.js.map +1 -0
  489. package/dist/lib/ai-model/workflows/planning/standard-planning-parser.js +142 -0
  490. package/dist/lib/ai-model/workflows/planning/standard-planning-parser.js.map +1 -0
  491. package/dist/lib/ai-model/workflows/planning/standard-planning.js +253 -0
  492. package/dist/lib/ai-model/workflows/planning/standard-planning.js.map +1 -0
  493. package/dist/lib/ai-model/workflows/planning/types.js +20 -0
  494. package/dist/lib/ai-model/workflows/planning/types.js.map +1 -0
  495. package/dist/lib/ai-model/workflows/recorder-generation/common.js +232 -0
  496. package/dist/lib/ai-model/workflows/recorder-generation/common.js.map +1 -0
  497. package/dist/lib/ai-model/workflows/recorder-generation/index.js +68 -0
  498. package/dist/lib/ai-model/workflows/recorder-generation/index.js.map +1 -0
  499. package/dist/lib/ai-model/workflows/recorder-generation/markdown.js +293 -0
  500. package/dist/lib/ai-model/workflows/recorder-generation/markdown.js.map +1 -0
  501. package/dist/lib/ai-model/workflows/recorder-generation/metadata.js +117 -0
  502. package/dist/lib/ai-model/workflows/recorder-generation/metadata.js.map +1 -0
  503. package/dist/lib/ai-model/workflows/recorder-generation/playwright.js +184 -0
  504. package/dist/lib/ai-model/workflows/recorder-generation/playwright.js.map +1 -0
  505. package/dist/lib/ai-model/workflows/recorder-generation/yaml.js +232 -0
  506. package/dist/lib/ai-model/workflows/recorder-generation/yaml.js.map +1 -0
  507. package/dist/lib/common.js +18 -1
  508. package/dist/lib/common.js.map +1 -1
  509. package/dist/lib/constants.js +38 -0
  510. package/dist/lib/constants.js.map +1 -0
  511. package/dist/lib/device/index.js.map +1 -1
  512. package/dist/lib/device/input-strategy.js +80 -0
  513. package/dist/lib/device/input-strategy.js.map +1 -0
  514. package/dist/lib/dump/html-utils.js +18 -0
  515. package/dist/lib/dump/html-utils.js.map +1 -1
  516. package/dist/lib/dump/image-reference.js +115 -0
  517. package/dist/lib/dump/image-reference.js.map +1 -0
  518. package/dist/lib/dump/report-action-dump.js +284 -0
  519. package/dist/lib/dump/report-action-dump.js.map +1 -0
  520. package/dist/lib/dump/report-dump-compactor.js +234 -0
  521. package/dist/lib/dump/report-dump-compactor.js.map +1 -0
  522. package/dist/lib/dump/screenshot-store.js +146 -38
  523. package/dist/lib/dump/screenshot-store.js.map +1 -1
  524. package/dist/lib/dump/task-service-dump.js +54 -0
  525. package/dist/lib/dump/task-service-dump.js.map +1 -0
  526. package/dist/lib/dump/task-status.js +55 -0
  527. package/dist/lib/dump/task-status.js.map +1 -0
  528. package/dist/lib/element-describer.js +238 -0
  529. package/dist/lib/element-describer.js.map +1 -0
  530. package/dist/lib/errors.js +54 -0
  531. package/dist/lib/errors.js.map +1 -0
  532. package/dist/lib/report-html-template.js +38 -0
  533. package/dist/lib/report-html-template.js.map +1 -0
  534. package/dist/lib/report-stats.js +147 -0
  535. package/dist/lib/report-stats.js.map +1 -0
  536. package/dist/lib/screenshot-item.js +7 -2
  537. package/dist/lib/screenshot-item.js.map +1 -1
  538. package/dist/lib/service/index.js +10 -5
  539. package/dist/lib/service/index.js.map +1 -1
  540. package/dist/lib/task-runner.js.map +1 -1
  541. package/dist/lib/types.js +2 -2
  542. package/dist/lib/types.js.map +1 -1
  543. package/dist/lib/utils.js +1 -1
  544. package/dist/lib/yaml/cleanup.js +47 -0
  545. package/dist/lib/yaml/cleanup.js.map +1 -0
  546. package/dist/types/agent/agent.d.ts +5 -9
  547. package/dist/types/agent/cache-config.d.ts +2 -0
  548. package/dist/types/agent/file-chooser.d.ts +19 -0
  549. package/dist/types/agent/insight.d.ts +21 -0
  550. package/dist/types/agent/metrics.d.ts +48 -0
  551. package/dist/types/agent/progress/ai-act-progress.d.ts +21 -0
  552. package/dist/types/agent/progress/index.d.ts +2 -0
  553. package/dist/types/agent/progress/progress-bus.d.ts +33 -0
  554. package/dist/types/agent/prompt-context.d.ts +3 -0
  555. package/dist/types/agent/record-to-report.d.ts +2 -0
  556. package/dist/types/agent/run-gherkin-scenario.d.ts +26 -0
  557. package/dist/types/agent/run-markdown.d.ts +6 -0
  558. package/dist/types/agent/screenshot-preparation.d.ts +20 -0
  559. package/dist/types/agent/ui-observer.d.ts +103 -0
  560. package/dist/types/agent/utils.d.ts +12 -1
  561. package/dist/types/ai-model/connectivity/fixture.d.ts +5 -0
  562. package/dist/types/ai-model/connectivity/index.d.ts +1 -0
  563. package/dist/types/ai-model/connectivity/run-connectivity-test.d.ts +11 -0
  564. package/dist/types/ai-model/index.d.ts +2 -0
  565. package/dist/types/ai-model/model-adapter/chat-completion.d.ts +2 -0
  566. package/dist/types/ai-model/model-adapter/custom-planning-action.d.ts +25 -0
  567. package/dist/types/ai-model/model-adapter/custom-planning-types.d.ts +31 -0
  568. package/dist/types/ai-model/model-adapter/default-insight-protocol.d.ts +2 -0
  569. package/dist/types/ai-model/model-adapter/default-locate-protocol.d.ts +7 -0
  570. package/dist/types/ai-model/model-adapter/default-planning-protocol.d.ts +25 -0
  571. package/dist/types/ai-model/model-adapter/image-preprocess.d.ts +30 -0
  572. package/dist/types/ai-model/model-adapter/index.d.ts +2 -0
  573. package/dist/types/ai-model/model-adapter/insight-protocol.d.ts +24 -0
  574. package/dist/types/ai-model/model-adapter/insight.d.ts +3 -0
  575. package/dist/types/ai-model/model-adapter/locate-protocol.d.ts +23 -0
  576. package/dist/types/ai-model/model-adapter/locate.d.ts +4 -0
  577. package/dist/types/ai-model/model-adapter/planning-protocol.d.ts +53 -0
  578. package/dist/types/ai-model/model-adapter/planning.d.ts +6 -0
  579. package/dist/types/ai-model/model-adapter/resolve.d.ts +12 -0
  580. package/dist/types/ai-model/model-adapter/types.d.ts +218 -0
  581. package/dist/types/ai-model/models/auto-glm/actions.d.ts +81 -0
  582. package/dist/types/ai-model/models/auto-glm/adapter.d.ts +5 -0
  583. package/dist/types/ai-model/models/auto-glm/locate.d.ts +2 -0
  584. package/dist/types/ai-model/models/auto-glm/parser.d.ts +14 -0
  585. package/dist/types/ai-model/models/auto-glm/planning.d.ts +5 -0
  586. package/dist/types/ai-model/models/auto-glm/prompt.d.ts +4 -0
  587. package/dist/types/ai-model/models/deepseek/adapter.d.ts +39 -0
  588. package/dist/types/ai-model/models/deepseek/locate-protocol.d.ts +5 -0
  589. package/dist/types/ai-model/models/default.d.ts +2 -0
  590. package/dist/types/ai-model/models/doubao.d.ts +7 -0
  591. package/dist/types/ai-model/models/gemini.d.ts +37 -0
  592. package/dist/types/ai-model/models/glm.d.ts +21 -0
  593. package/dist/types/ai-model/models/gpt.d.ts +20 -0
  594. package/dist/types/ai-model/models/index.d.ts +2 -0
  595. package/dist/types/ai-model/models/kimi.d.ts +45 -0
  596. package/dist/types/ai-model/models/mimo.d.ts +10 -0
  597. package/dist/types/ai-model/models/qwen.d.ts +33 -0
  598. package/dist/types/ai-model/models/registry.d.ts +187 -0
  599. package/dist/types/ai-model/models/ui-tars/actions.d.ts +3 -0
  600. package/dist/types/ai-model/models/ui-tars/adapter.d.ts +6 -0
  601. package/dist/types/ai-model/models/ui-tars/parser.d.ts +72 -0
  602. package/dist/types/ai-model/models/ui-tars/planning.d.ts +4 -0
  603. package/dist/types/ai-model/models/ui-tars/prompt.d.ts +2 -0
  604. package/dist/types/ai-model/models/utils/intent.d.ts +2 -0
  605. package/dist/types/ai-model/prompt/insight/index.d.ts +2 -0
  606. package/dist/types/ai-model/prompt/insight/system-prompt.d.ts +6 -0
  607. package/dist/types/ai-model/prompt/insight/user-prompt.d.ts +3 -0
  608. package/dist/types/ai-model/prompt/locate/element-system-prompt.d.ts +4 -0
  609. package/dist/types/ai-model/prompt/locate/grounding-rules.d.ts +1 -0
  610. package/dist/types/ai-model/prompt/locate/index.d.ts +3 -0
  611. package/dist/types/ai-model/prompt/locate/search-area-system-prompt.d.ts +4 -0
  612. package/dist/types/ai-model/prompt/planning/action-output-example.d.ts +17 -0
  613. package/dist/types/ai-model/prompt/planning/action-space-description.d.ts +11 -0
  614. package/dist/types/ai-model/prompt/planning/index.d.ts +6 -0
  615. package/dist/types/ai-model/prompt/planning/multi-turn-example.d.ts +10 -0
  616. package/dist/types/ai-model/prompt/planning/planning-response-example.d.ts +28 -0
  617. package/dist/types/ai-model/prompt/planning/sub-goals-text.d.ts +2 -0
  618. package/dist/types/ai-model/prompt/planning/system-prompt.d.ts +18 -0
  619. package/dist/types/ai-model/service-caller/index.d.ts +21 -6
  620. package/dist/types/ai-model/service-caller/model-call-recorder.d.ts +12 -0
  621. package/dist/types/ai-model/service-caller/openai-error.d.ts +26 -0
  622. package/dist/types/ai-model/service-caller/proxy-deps.node.d.ts +2 -0
  623. package/dist/types/ai-model/service-caller/proxy-deps.stub.d.ts +2 -0
  624. package/dist/types/ai-model/service-caller/semantic-retry.d.ts +30 -0
  625. package/dist/types/ai-model/service-caller/types.d.ts +2 -0
  626. package/dist/types/ai-model/shared/action-schema.d.ts +4 -0
  627. package/dist/types/ai-model/shared/json.d.ts +26 -0
  628. package/dist/types/ai-model/shared/model-locate-result/bbox.d.ts +6 -0
  629. package/dist/types/ai-model/shared/model-locate-result/coordinate-distance.d.ts +4 -0
  630. package/dist/types/ai-model/shared/model-locate-result/errors.d.ts +2 -0
  631. package/dist/types/ai-model/shared/model-locate-result/factory.d.ts +3 -0
  632. package/dist/types/ai-model/shared/model-locate-result/index.d.ts +7 -0
  633. package/dist/types/ai-model/shared/model-locate-result/parse.d.ts +8 -0
  634. package/dist/types/ai-model/shared/model-locate-result/pixel-bbox-mapper.d.ts +7 -0
  635. package/dist/types/ai-model/shared/model-locate-result/prompt-spec.d.ts +6 -0
  636. package/dist/types/ai-model/shared/model-locate-result/types.d.ts +150 -0
  637. package/dist/types/ai-model/shared/multimodal-prompt.d.ts +13 -0
  638. package/dist/types/ai-model/shared/xml.d.ts +15 -0
  639. package/dist/types/ai-model/workflows/grounding/index.d.ts +3 -0
  640. package/dist/types/ai-model/workflows/grounding/locate-result-rect.d.ts +5 -0
  641. package/dist/types/ai-model/workflows/grounding/locate.d.ts +7 -0
  642. package/dist/types/ai-model/workflows/grounding/planning-action-locate.d.ts +4 -0
  643. package/dist/types/ai-model/workflows/grounding/search-area-mapping.d.ts +4 -0
  644. package/dist/types/ai-model/workflows/grounding/search-area.d.ts +18 -0
  645. package/dist/types/ai-model/workflows/grounding/section-locate.d.ts +16 -0
  646. package/dist/types/ai-model/workflows/grounding/types.d.ts +56 -0
  647. package/dist/types/ai-model/workflows/grounding/utils.d.ts +25 -0
  648. package/dist/types/ai-model/workflows/insight/extraction.d.ts +18 -0
  649. package/dist/types/ai-model/workflows/insight/index.d.ts +2 -0
  650. package/dist/types/ai-model/workflows/insight/insight-response-parser.d.ts +4 -0
  651. package/dist/types/ai-model/workflows/insight/order-sensitive.d.ts +6 -0
  652. package/dist/types/ai-model/workflows/planning/conversation-history.d.ts +105 -0
  653. package/dist/types/ai-model/workflows/planning/custom-planning.d.ts +7 -0
  654. package/dist/types/ai-model/workflows/planning/index.d.ts +3 -0
  655. package/dist/types/ai-model/workflows/planning/locate-normalization.d.ts +12 -0
  656. package/dist/types/ai-model/workflows/planning/planning-action-log.d.ts +2 -0
  657. package/dist/types/ai-model/workflows/planning/standard-planning-parser.d.ts +31 -0
  658. package/dist/types/ai-model/workflows/planning/standard-planning.d.ts +4 -0
  659. package/dist/types/ai-model/workflows/planning/types.d.ts +16 -0
  660. package/dist/types/ai-model/workflows/recorder-generation/common.d.ts +89 -0
  661. package/dist/types/ai-model/workflows/recorder-generation/index.d.ts +7 -0
  662. package/dist/types/ai-model/workflows/recorder-generation/markdown.d.ts +7 -0
  663. package/dist/types/ai-model/workflows/recorder-generation/metadata.d.ts +13 -0
  664. package/dist/types/ai-model/workflows/recorder-generation/playwright.d.ts +26 -0
  665. package/dist/types/ai-model/workflows/recorder-generation/yaml.d.ts +17 -0
  666. package/dist/types/common.d.ts +2 -0
  667. package/dist/types/constants.d.ts +1 -0
  668. package/dist/types/device/index.d.ts +15 -4
  669. package/dist/types/device/input-strategy.d.ts +44 -0
  670. package/dist/types/dump/html-utils.d.ts +1 -0
  671. package/dist/types/dump/image-reference.d.ts +36 -0
  672. package/dist/types/dump/report-action-dump.d.ts +127 -0
  673. package/dist/types/dump/report-dump-compactor.d.ts +7 -0
  674. package/dist/types/dump/screenshot-store.d.ts +32 -15
  675. package/dist/types/dump/task-service-dump.d.ts +3 -0
  676. package/dist/types/dump/task-status.d.ts +41 -0
  677. package/dist/types/element-describer.d.ts +43 -0
  678. package/dist/types/errors.d.ts +5 -0
  679. package/dist/types/report-html-template.d.ts +1 -0
  680. package/dist/types/report-stats.d.ts +39 -0
  681. package/dist/types/screenshot-item.d.ts +1 -0
  682. package/dist/types/service/index.d.ts +6 -2
  683. package/dist/types/task-runner.d.ts +6 -0
  684. package/dist/types/types.d.ts +98 -5
  685. package/dist/types/yaml/cleanup.d.ts +2 -0
  686. package/package.json +2 -2
@@ -0,0 +1,187 @@
1
+ import type { IModelConfig, TModelFamily } from '@aiscene/shared/env';
2
+ import type { ModelAdapter, ModelAdapterDefinition, ModelRuntime } from '../model-adapter/types';
3
+ export declare const MODEL_ADAPTER_CONFIGS: {
4
+ 'xiaomi-mimo': {
5
+ chatCompletion: {
6
+ unsupportedUserConfig: ("reasoningEffort" | "reasoningBudget")[];
7
+ buildChatCompletionParams: (input: import("../model-adapter/types").ChatCompletionCallContext) => import("../model-adapter/types").ChatCompletionParamsResult;
8
+ useReasoningAsContentFallback: true;
9
+ };
10
+ };
11
+ kimi: {
12
+ chatCompletion: {
13
+ unsupportedUserConfig: ("reasoningEffort" | "reasoningBudget")[];
14
+ buildChatCompletionParams: (input: import("../model-adapter/types").ChatCompletionCallContext) => import("../model-adapter/types").ChatCompletionParamsResult;
15
+ useReasoningAsContentFallback: true;
16
+ };
17
+ locate: {
18
+ element: {
19
+ resultFormat: {
20
+ coordinates: {
21
+ readonly shape: "point";
22
+ readonly order: "xy";
23
+ readonly normalizedBy: 1;
24
+ };
25
+ parseRawLocateValue: (input: unknown) => import("../shared/model-locate-result").LocateResultValue;
26
+ };
27
+ };
28
+ };
29
+ };
30
+ kimi3: {
31
+ chatCompletion: {
32
+ unsupportedUserConfig: ("reasoningEnabled" | "reasoningBudget")[];
33
+ buildChatCompletionParams: (input: import("../model-adapter/types").ChatCompletionCallContext) => import("../model-adapter/types").ChatCompletionParamsResult;
34
+ useReasoningAsContentFallback: true;
35
+ replayRawAssistantMessage: true;
36
+ };
37
+ locate: {
38
+ element: {
39
+ resultFormat: {
40
+ coordinates: {
41
+ readonly shape: "point";
42
+ readonly order: "xy";
43
+ readonly normalizedBy: 1;
44
+ };
45
+ parseRawLocateValue: (input: unknown) => import("../shared/model-locate-result").LocateResultValue;
46
+ };
47
+ };
48
+ };
49
+ };
50
+ 'gpt-5': {
51
+ chatCompletion: {
52
+ unsupportedUserConfig: "reasoningBudget"[];
53
+ buildChatCompletionParams: (input: import("../model-adapter/types").ChatCompletionCallContext) => import("../model-adapter/types").ChatCompletionParamsResult;
54
+ resolveImageDetail: (input: import("../model-adapter/types").ChatCompletionCallContext) => import("../model-adapter/types").ImageDetail | undefined;
55
+ };
56
+ locate: {
57
+ element: {
58
+ resultFormat: {
59
+ coordinates: {
60
+ shape: "bbox";
61
+ order: "xy";
62
+ };
63
+ };
64
+ };
65
+ };
66
+ };
67
+ 'auto-glm': ModelAdapterDefinition;
68
+ 'auto-glm-multilingual': ModelAdapterDefinition;
69
+ 'glm-v': {
70
+ chatCompletion: {
71
+ unsupportedUserConfig: ("reasoningEffort" | "reasoningBudget")[];
72
+ buildChatCompletionParams: (input: import("../model-adapter/types").ChatCompletionCallContext) => import("../model-adapter/types").ChatCompletionParamsResult;
73
+ useReasoningAsContentFallback: true;
74
+ };
75
+ locate: {
76
+ element: {
77
+ resultFormat: {
78
+ coordinates: {
79
+ shape: "bbox";
80
+ order: "xy";
81
+ normalizedBy: number;
82
+ };
83
+ };
84
+ };
85
+ };
86
+ };
87
+ 'vlm-ui-tars': ModelAdapterDefinition;
88
+ 'vlm-ui-tars-doubao': ModelAdapterDefinition;
89
+ 'vlm-ui-tars-doubao-1.5': ModelAdapterDefinition;
90
+ gemini: {
91
+ chatCompletion: {
92
+ unsupportedUserConfig: "reasoningBudget"[];
93
+ buildChatCompletionParams: (input: import("../model-adapter/types").ChatCompletionCallContext) => import("../model-adapter/types").ChatCompletionParamsResult;
94
+ messageExtraction: {
95
+ kind: "custom";
96
+ extractContentAndReasoning: (message: (import("../model-adapter/types").ChatCompletionContentSource | (Omit<import("openai/resources/index.mjs").ChatCompletionMessage, "content"> & {
97
+ content: string | null | (Record<string, unknown> & {
98
+ text?: string;
99
+ thought?: boolean;
100
+ })[];
101
+ reasoning_content?: string;
102
+ extra_content?: unknown;
103
+ }) | (Omit<import("openai/resources/index.mjs").ChatCompletionChunk.Choice.Delta, "content"> & {
104
+ content: string | null | (Record<string, unknown> & {
105
+ text?: string;
106
+ thought?: boolean;
107
+ })[];
108
+ reasoning_content?: string;
109
+ extra_content?: unknown;
110
+ })) | undefined) => import("../model-adapter/types").ContentAndReasoning;
111
+ };
112
+ };
113
+ locate: {
114
+ element: {
115
+ resultFormat: {
116
+ coordinates: {
117
+ shape: "bbox";
118
+ order: "yx";
119
+ normalizedBy: number;
120
+ };
121
+ };
122
+ };
123
+ };
124
+ };
125
+ 'doubao-vision': ModelAdapterDefinition;
126
+ 'doubao-seed': ModelAdapterDefinition;
127
+ deepseek: {
128
+ chatCompletion: {
129
+ unsupportedUserConfig: "reasoningBudget"[];
130
+ buildChatCompletionParams: (input: import("../model-adapter/types").ChatCompletionCallContext) => import("../model-adapter/types").ChatCompletionParamsResult;
131
+ useReasoningAsContentFallback: true;
132
+ replayRawAssistantMessage: false;
133
+ };
134
+ locate: {
135
+ element: {
136
+ protocol: import("../model-adapter/locate-protocol").StandardLocateProtocol;
137
+ resultFormat: {
138
+ coordinates: {
139
+ readonly shape: "point";
140
+ readonly order: "xy";
141
+ readonly normalizedBy: 1000;
142
+ };
143
+ parseRawLocateValue: (input: unknown) => import("../shared/model-locate-result").LocateResultValue;
144
+ };
145
+ };
146
+ searchArea: {
147
+ protocol: import("../model-adapter/locate-protocol").StandardLocateProtocol;
148
+ resultFormat: {
149
+ coordinates: {
150
+ readonly shape: "bbox";
151
+ readonly order: "xy";
152
+ readonly normalizedBy: 1000;
153
+ };
154
+ parseRawLocateValue: (input: unknown) => import("../shared/model-locate-result").LocateResultValue;
155
+ };
156
+ };
157
+ };
158
+ };
159
+ 'qwen2.5-vl': {
160
+ acceptBbox2dAlias: true;
161
+ chatCompletion: {
162
+ unsupportedUserConfig: ("reasoningEnabled" | "reasoningEffort" | "reasoningBudget")[];
163
+ buildChatCompletionParams: (input: import("../model-adapter/types").ChatCompletionCallContext) => import("../model-adapter/types").ChatCompletionParamsResult;
164
+ };
165
+ imagePreprocess: {
166
+ padBlockSize: number;
167
+ };
168
+ locate: {
169
+ element: {
170
+ resultFormat: {
171
+ coordinates: {
172
+ readonly shape: "bbox";
173
+ readonly order: "xy";
174
+ };
175
+ parseRawLocateValue: (input: unknown) => import("../shared/model-locate-result").LocateResultValue;
176
+ mapLocateResultToPixelBbox: (result: import("../shared/model-locate-result").LocateResultValue) => import("../shared/model-locate-result").PixelBbox;
177
+ };
178
+ };
179
+ };
180
+ };
181
+ 'qwen3-vl': ModelAdapterDefinition;
182
+ qwen3: ModelAdapterDefinition;
183
+ 'qwen3.5': ModelAdapterDefinition;
184
+ 'qwen3.6': ModelAdapterDefinition;
185
+ };
186
+ export declare function getModelAdapter(modelFamily?: TModelFamily): ModelAdapter;
187
+ export declare function getModelRuntime(config: IModelConfig): ModelRuntime;
@@ -0,0 +1,3 @@
1
+ import type { PlanningAction } from '../../../types';
2
+ import type { UiTarsParsedPlanningResponse } from './parser';
3
+ export declare function transformUiTarsActions(parsedPlanningResponse: UiTarsParsedPlanningResponse): PlanningAction[];
@@ -0,0 +1,6 @@
1
+ import type { ModelAdapterDefinition } from '../../model-adapter/types';
2
+ export declare const uiTarsAdapters: {
3
+ 'vlm-ui-tars': ModelAdapterDefinition;
4
+ 'vlm-ui-tars-doubao': ModelAdapterDefinition;
5
+ 'vlm-ui-tars-doubao-1.5': ModelAdapterDefinition;
6
+ };
@@ -0,0 +1,72 @@
1
+ import type { Size } from '../../../types';
2
+ import type { UITarsModelVersion } from '@aiscene/shared/env';
3
+ import { actionParser } from '@ui-tars/action-parser';
4
+ type ActionType = 'click' | 'left_double' | 'right_single' | 'drag' | 'type' | 'hotkey' | 'finished' | 'scroll' | 'wait';
5
+ export interface UiTarsParsedPlanningResponse {
6
+ rawResponse: string;
7
+ actions: ReturnType<typeof actionParser>['parsed'];
8
+ }
9
+ export declare function parseUiTarsPlanningResponse(rawResponse: string, shotSize: Size, uiTarsModelVersion: UITarsModelVersion): UiTarsParsedPlanningResponse;
10
+ interface BaseAction {
11
+ action_type: ActionType;
12
+ action_inputs: Record<string, any>;
13
+ reflection: string | null;
14
+ thought: string | null;
15
+ }
16
+ interface ClickAction extends BaseAction {
17
+ action_type: 'click';
18
+ action_inputs: {
19
+ start_box: string;
20
+ };
21
+ }
22
+ interface DragAction extends BaseAction {
23
+ action_type: 'drag';
24
+ action_inputs: {
25
+ start_box: string;
26
+ end_box: string;
27
+ };
28
+ }
29
+ interface WaitAction extends BaseAction {
30
+ action_type: 'wait';
31
+ action_inputs: {
32
+ time: string;
33
+ };
34
+ }
35
+ interface LeftDoubleAction extends BaseAction {
36
+ action_type: 'left_double';
37
+ action_inputs: {
38
+ start_box: string;
39
+ };
40
+ }
41
+ interface RightSingleAction extends BaseAction {
42
+ action_type: 'right_single';
43
+ action_inputs: {
44
+ start_box: string;
45
+ };
46
+ }
47
+ interface TypeAction extends BaseAction {
48
+ action_type: 'type';
49
+ action_inputs: {
50
+ content: string;
51
+ };
52
+ }
53
+ interface HotkeyAction extends BaseAction {
54
+ action_type: 'hotkey';
55
+ action_inputs: {
56
+ key: string;
57
+ };
58
+ }
59
+ interface ScrollAction extends BaseAction {
60
+ action_type: 'scroll';
61
+ action_inputs: {
62
+ direction: 'up' | 'down';
63
+ };
64
+ }
65
+ interface FinishedAction extends BaseAction {
66
+ action_type: 'finished';
67
+ action_inputs: {
68
+ content?: string;
69
+ };
70
+ }
71
+ export type Action = ClickAction | LeftDoubleAction | RightSingleAction | DragAction | TypeAction | HotkeyAction | ScrollAction | FinishedAction | WaitAction;
72
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { UITarsModelVersion } from '@aiscene/shared/env';
2
+ import type { CustomPlanningDefinition } from '../../model-adapter/custom-planning-types';
3
+ import { type UiTarsParsedPlanningResponse } from './parser';
4
+ export declare function createUiTarsPlanner(uiTarsModelVersion: UITarsModelVersion): CustomPlanningDefinition<UiTarsParsedPlanningResponse>;
@@ -0,0 +1,2 @@
1
+ export declare function getUiTarsPlanningPrompt(): string;
2
+ export declare const getSummary: (prediction: string) => string;
@@ -0,0 +1,2 @@
1
+ import type { TIntent } from '@aiscene/shared/env';
2
+ export declare function isLocateIntent(intent?: TIntent): boolean;
@@ -0,0 +1,2 @@
1
+ export { buildInsightSystemPrompt } from './system-prompt';
2
+ export { buildTypeQueryDemandValue, extractDataQueryPrompt, } from './user-prompt';
@@ -0,0 +1,6 @@
1
+ import type { InsightProtocol } from '../../model-adapter/insight-protocol';
2
+ export declare function buildInsightSystemPrompt(options: {
3
+ screenshotIncluded?: boolean;
4
+ referenceImagesIncluded?: boolean;
5
+ insightProtocol: InsightProtocol;
6
+ }): string;
@@ -0,0 +1,3 @@
1
+ import type { ServiceExtractParam } from '../../../types';
2
+ export declare function buildTypeQueryDemandValue(type: 'Boolean' | 'Number' | 'String' | 'Assert' | 'WaitFor', demand: ServiceExtractParam): string;
3
+ export declare const extractDataQueryPrompt: (pageDescription: string, dataQuery: string | Record<string, string>, context?: string) => string;
@@ -0,0 +1,4 @@
1
+ export declare function buildElementLocateSystemPrompt({ systemPromptIntroduction, responseInstructions, }: {
2
+ systemPromptIntroduction: string;
3
+ responseInstructions: string;
4
+ }): string;
@@ -0,0 +1 @@
1
+ export declare function locateGroundingRules(): string;
@@ -0,0 +1,3 @@
1
+ export { buildElementLocateSystemPrompt } from './element-system-prompt';
2
+ export { locateGroundingRules } from './grounding-rules';
3
+ export { buildSearchAreaLocateSystemPrompt } from './search-area-system-prompt';
@@ -0,0 +1,4 @@
1
+ export declare function buildSearchAreaLocateSystemPrompt({ systemPromptIntroduction, responseInstructions, }: {
2
+ systemPromptIntroduction: string;
3
+ responseInstructions: string;
4
+ }): string;
@@ -0,0 +1,17 @@
1
+ import type { DeviceAction } from '../../../types';
2
+ import type { PlanningActionOutputProtocol } from '../../model-adapter/planning-protocol';
3
+ import type { LocateResultPromptSpec } from '../../shared/model-locate-result';
4
+ export type ActionOutputExampleDefinition = Pick<DeviceAction<any>, 'name' | 'paramSchema' | 'sample'>;
5
+ export declare const buildActionOutputExample: (action: ActionOutputExampleDefinition, { locatePromptSpec, locateResultExampleIndex, buildActionOutput, }: {
6
+ locatePromptSpec?: LocateResultPromptSpec;
7
+ /**
8
+ * Selects the locate result example value injected into this action.
9
+ * Keep the same index for the same example across multi-turn prompt
10
+ * variants, and use different indexes for different examples to avoid
11
+ * reusing identical locate coordinates.
12
+ */
13
+ locateResultExampleIndex?: number;
14
+ buildActionOutput: PlanningActionOutputProtocol["buildActionOutput"];
15
+ }) => string | undefined;
16
+ export declare const createSampleTapAction: (prompt: string) => ActionOutputExampleDefinition;
17
+ export declare const createSampleInputAction: (value: string) => ActionOutputExampleDefinition;
@@ -0,0 +1,11 @@
1
+ import type { DeviceAction } from '../../../types';
2
+ import type { PlanningActionSpaceFormat, StandardPlanningProtocol } from '../../model-adapter/planning-protocol';
3
+ import type { LocateResultPromptSpec } from '../../shared/model-locate-result';
4
+ type BuildPlanningActionSpaceDescriptionInput = {
5
+ actionSpace: DeviceAction<any>[];
6
+ locatePromptSpec?: LocateResultPromptSpec;
7
+ planningProtocol: StandardPlanningProtocol;
8
+ };
9
+ export declare const serializeActionDescriptions: (actionDescriptions: unknown[], format: PlanningActionSpaceFormat) => string;
10
+ export declare const buildPlanningActionSpaceDescription: ({ actionSpace, locatePromptSpec, planningProtocol, }: BuildPlanningActionSpaceDescriptionInput) => string;
11
+ export {};
@@ -0,0 +1,6 @@
1
+ export { buildStandardPlanningSystemPrompt } from './system-prompt';
2
+ export { buildPlanningActionSpaceDescription, serializeActionDescriptions, } from './action-space-description';
3
+ export { buildActionOutputExample, createSampleInputAction, createSampleTapAction, } from './action-output-example';
4
+ export type { ActionOutputExampleDefinition } from './action-output-example';
5
+ export { buildPlanningResponseExample } from './planning-response-example';
6
+ export { buildSubGoalsText } from './sub-goals-text';
@@ -0,0 +1,10 @@
1
+ import type { PlanningActionOutputProtocol } from '../../model-adapter/planning-protocol';
2
+ import type { LocateResultPromptSpec } from '../../shared/model-locate-result';
3
+ export declare const buildPlanningMultiTurnExample: ({ includeSubGoals, includeThought, includeLog, locatePromptSpec, actionOutputProtocol, prefix, }: {
4
+ includeSubGoals: boolean;
5
+ includeThought: boolean;
6
+ includeLog: boolean;
7
+ locatePromptSpec?: LocateResultPromptSpec;
8
+ actionOutputProtocol: PlanningActionOutputProtocol;
9
+ prefix?: string;
10
+ }) => string;
@@ -0,0 +1,28 @@
1
+ import type { SubGoalStatus } from '../../../types';
2
+ type PlanningSubGoalExample = {
3
+ index: number;
4
+ status: Extract<SubGoalStatus, 'pending' | 'finished'>;
5
+ description: string;
6
+ };
7
+ type PlanningResponseActionOutputExample = {
8
+ log?: string;
9
+ actionOutputExample: string | undefined;
10
+ complete?: never;
11
+ };
12
+ type PlanningResponseCompleteExample = {
13
+ complete: {
14
+ success: boolean;
15
+ message: string;
16
+ };
17
+ log?: never;
18
+ actionOutputExample?: never;
19
+ };
20
+ export type BuildPlanningResponseExampleInput = {
21
+ prefix?: string;
22
+ planning?: string;
23
+ updateSubGoals?: PlanningSubGoalExample[];
24
+ markSubGoalsDone?: number[];
25
+ memory?: string;
26
+ } & (PlanningResponseActionOutputExample | PlanningResponseCompleteExample);
27
+ export declare const buildPlanningResponseExample: (input: BuildPlanningResponseExampleInput) => string;
28
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { SubGoal } from '../../../types';
2
+ export declare const buildSubGoalsText: (subGoals: readonly SubGoal[]) => string;
@@ -0,0 +1,18 @@
1
+ import type { DeviceAction } from '../../../types';
2
+ import type { StandardPlanningProtocol } from '../../model-adapter/planning-protocol';
3
+ import type { LocateResultPromptSpec } from '../../shared/model-locate-result';
4
+ type BuildStandardPlanningSystemPromptInput = {
5
+ actionSpace: DeviceAction<any>[];
6
+ includeSubGoals?: boolean;
7
+ includeThought?: boolean;
8
+ includeLog?: boolean;
9
+ planningProtocol: StandardPlanningProtocol;
10
+ } & ({
11
+ includeLocateInPlanning: true;
12
+ locatePromptSpec: LocateResultPromptSpec;
13
+ } | {
14
+ includeLocateInPlanning: false;
15
+ locatePromptSpec?: never;
16
+ });
17
+ export declare function buildStandardPlanningSystemPrompt(input: BuildStandardPlanningSystemPromptInput): Promise<string>;
18
+ export {};
@@ -3,39 +3,53 @@ import type { StreamingCallback } from '../../types';
3
3
  export declare class AIResponseParseError extends Error {
4
4
  usage?: AIUsageInfo;
5
5
  rawResponse: string;
6
- constructor(message: string, rawResponse: string, usage?: AIUsageInfo);
6
+ rawChoiceMessage?: unknown;
7
+ reasoningContent?: string;
8
+ constructor(message: string, rawResponse: string, usage?: AIUsageInfo, rawChoiceMessage?: unknown, reasoningContent?: string);
7
9
  }
8
- import { type IModelConfig, type TModelFamily } from '@aiscene/shared/env';
10
+ import { type IModelConfig, type TModelFamily, type TModelReasoningEnabled } from '@aiscene/shared/env';
9
11
  import type { ChatCompletionMessageParam } from 'openai/resources/index';
10
12
  import type { AIArgs } from '../../common';
11
- export declare function callAI(messages: ChatCompletionMessageParam[], modelConfig: IModelConfig, options?: {
13
+ import type { ModelRuntime } from '../models';
14
+ type ModelRuntimeInput = IModelConfig | ModelRuntime;
15
+ export declare function callAI(messages: ChatCompletionMessageParam[], modelRuntimeOrConfig: ModelRuntimeInput, options?: {
12
16
  stream?: boolean;
13
17
  onChunk?: StreamingCallback;
14
18
  abortSignal?: AbortSignal;
19
+ requiresOriginalImageDetail?: boolean;
20
+ expectedJsonObjectResponse?: boolean;
21
+ semanticRetryAttempt?: number;
15
22
  }): Promise<{
16
23
  content: string;
17
24
  reasoning_content?: string;
25
+ rawChoiceMessage?: unknown;
18
26
  usage?: AIUsageInfo;
19
27
  isStreamed: boolean;
20
28
  }>;
21
- export declare function callAIWithObjectResponse<T>(messages: ChatCompletionMessageParam[], modelConfig: IModelConfig, options?: {
29
+ export declare function callAIWithObjectResponse<T>(messages: ChatCompletionMessageParam[], modelRuntimeOrConfig: ModelRuntimeInput, options?: {
22
30
  abortSignal?: AbortSignal;
31
+ jsonParserSource?: unknown;
32
+ retryTimes?: number;
33
+ retryInterval?: number;
23
34
  }): Promise<{
24
35
  content: T;
25
36
  contentString: string;
26
37
  usage?: AIUsageInfo;
27
38
  reasoning_content?: string;
39
+ rawChoiceMessage?: unknown;
28
40
  }>;
29
- export declare function callAIWithStringResponse(msgs: AIArgs, modelConfig: IModelConfig, options?: {
41
+ export declare function callAIWithStringResponse(msgs: AIArgs, modelRuntimeOrConfig: ModelRuntimeInput, options?: {
30
42
  abortSignal?: AbortSignal;
43
+ requiresOriginalImageDetail?: boolean;
31
44
  }): Promise<{
32
45
  content: string;
33
46
  usage?: AIUsageInfo;
47
+ rawChoiceMessage?: unknown;
34
48
  }>;
35
49
  export declare function extractJSONFromCodeBlock(response: string): string;
36
50
  export declare function preprocessDoubaoBboxJson(input: string): string;
37
51
  export declare function resolveReasoningConfig({ reasoningEnabled, reasoningEffort, reasoningBudget, modelFamily, }: {
38
- reasoningEnabled?: boolean;
52
+ reasoningEnabled?: TModelReasoningEnabled;
39
53
  reasoningEffort?: string;
40
54
  reasoningBudget?: number;
41
55
  modelFamily?: TModelFamily;
@@ -44,3 +58,4 @@ export declare function resolveReasoningConfig({ reasoningEnabled, reasoningEffo
44
58
  debugMessage?: string;
45
59
  };
46
60
  export declare function safeParseJson(input: string, modelFamily: TModelFamily | undefined): any;
61
+ export {};
@@ -0,0 +1,12 @@
1
+ export declare function isModelCallRecordingEnabled(): boolean;
2
+ export declare class ModelCallRecorder {
3
+ private readonly processStartTime;
4
+ private filePath;
5
+ private filePathPromise;
6
+ private writeQueue;
7
+ private initializeFilePath;
8
+ private getFilePath;
9
+ private writeEvent;
10
+ record(event: Record<string, unknown>): Promise<void>;
11
+ }
12
+ export declare function recordModelCallEvent(event: Record<string, unknown>): Promise<void>;
@@ -0,0 +1,26 @@
1
+ export interface OpenAIErrorResponseContext {
2
+ recordEvent?: (event: Record<string, unknown>) => void;
3
+ responseRequestIds?: Array<{
4
+ attempt: number;
5
+ requestId: string;
6
+ status: number;
7
+ ok: boolean;
8
+ }>;
9
+ rawResponseBodies?: Array<{
10
+ attempt: number;
11
+ body: string;
12
+ }>;
13
+ fetchErrors?: Array<{
14
+ attempt: number;
15
+ error: string;
16
+ }>;
17
+ httpResponses?: Array<{
18
+ attempt: number;
19
+ status: number;
20
+ ok: boolean;
21
+ headers: Array<[string, string]>;
22
+ body?: string;
23
+ }>;
24
+ }
25
+ export declare function wrapOpenAICompatibleFetch(context: OpenAIErrorResponseContext): typeof fetch;
26
+ export declare function formatOpenAIAPIErrorDetails(_error: unknown, context: OpenAIErrorResponseContext): string;
@@ -0,0 +1,2 @@
1
+ export declare function loadUndici(): Promise<typeof import('undici')>;
2
+ export declare function loadFetchSocks(): Promise<typeof import('fetch-socks')>;
@@ -0,0 +1,2 @@
1
+ export declare function loadUndici(): Promise<typeof import('undici')>;
2
+ export declare function loadFetchSocks(): Promise<typeof import('fetch-socks')>;
@@ -0,0 +1,30 @@
1
+ import type { ChatCompletionMessageParam } from 'openai/resources/index';
2
+ export declare function withSemanticRetryFeedback(messages: ChatCompletionMessageParam[], previousParseError?: unknown): ChatCompletionMessageParam[];
3
+ export type CallAiAndParseWithRetryOptions<Response, Parsed> = {
4
+ /** Sends a single model request. Request errors are always propagated as-is. */
5
+ /**
6
+ * `retryAttempt` is local to this retry loop: 0 for the initial request,
7
+ * then incremented after each parsing failure.
8
+ */
9
+ callAi: (retryAttempt: number, previousParseError?: unknown) => Promise<Response>;
10
+ /** Parses a successful model response. Only failures from this callback retry. */
11
+ parseResponse: (response: Response) => Parsed | Promise<Parsed>;
12
+ /** Converts the final parsing failure into the caller's domain error. */
13
+ toParseError: (error: unknown, response: Response) => Error;
14
+ /** Number of additional model requests after a parsing failure. Defaults to 0. */
15
+ parseRetryTimes?: number;
16
+ /** Delay in milliseconds before retrying a parsing failure. Defaults to 0. */
17
+ parseRetryInterval?: number;
18
+ abortSignal?: AbortSignal;
19
+ /** Runs immediately before a parsing failure triggers another model request. */
20
+ onParseRetry?: (error: unknown, response: Response) => void;
21
+ };
22
+ /**
23
+ * Calls AI and parses its response, retrying only when the response cannot be
24
+ * structurally parsed.
25
+ *
26
+ * Errors thrown by callAi() intentionally bypass this retry mechanism and are
27
+ * propagated as-is. Only a successful callAi() response that fails the
28
+ * parseResponse() callback triggers another model request.
29
+ */
30
+ export declare function callAiAndParseWithRetry<Response, Parsed>({ callAi, parseResponse, toParseError, parseRetryTimes, parseRetryInterval, abortSignal, onParseRetry, }: CallAiAndParseWithRetryOptions<Response, Parsed>): Promise<Parsed>;
@@ -0,0 +1,2 @@
1
+ import type { ChatCompletionMessageParam } from 'openai/resources/index';
2
+ export type AIArgs = ChatCompletionMessageParam[];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Find ZodDefault in the wrapper chain and return its default value.
3
+ */
4
+ export declare const getZodDefaultValue: (field: unknown) => unknown | undefined;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Extract the JSON portion from a model response.
3
+ *
4
+ * This mainly handles fenced JSON like ```json { ... } ``` by removing the
5
+ * fence. If that does not produce a JSON object, it falls back to a greedy regex
6
+ * that extracts from the first "{" to the last "}". If that still fails, the
7
+ * original response is returned.
8
+ *
9
+ * Expected model responses are JSON objects, possibly wrapped in markdown
10
+ * fences. Natural language mixed with JSON, or arrays like
11
+ * [{"type":"Tap"}, {"type":"Hover"}], are outside the supported contract and
12
+ * are not reliably recoverable.
13
+ *
14
+ * This extractor is also used by extraction responses that can be any
15
+ * JSON value. In those cases, arrays/strings/numbers have no object braces and
16
+ * pass through unchanged.
17
+ */
18
+ export declare function extractJSONFromCodeBlock(response: string): string;
19
+ export type JsonParserSource = 'generic-object' | 'planning-action-param' | 'locate' | 'section-locator';
20
+ export interface JsonParserContext {
21
+ source: JsonParserSource;
22
+ preserveStringValueKeys?: string[];
23
+ }
24
+ export type JsonParser = (raw: string, context?: JsonParserContext) => unknown;
25
+ export declare function assertJsonObject(parsed: unknown): asserts parsed is Record<string, unknown>;
26
+ export declare function parseModelResponseJson(raw: string, context?: JsonParserContext): any;
@@ -0,0 +1,6 @@
1
+ import type { LocateResultBbox, LocateResultContext, PixelBbox } from './types';
2
+ export declare function maxPixelIndex(size: number): number;
3
+ export declare function normalizedCoordinateToPixelIndex(value: number, normalizedBy: number, size: number): number;
4
+ export declare function mapNormalizedCoordinatesToPixelBbox(coordinates: LocateResultBbox, normalizedBy: number, width: number, height: number): PixelBbox;
5
+ export declare function expandPointToBbox(x: number, y: number, maxX: number, maxY: number, halfSize: number): LocateResultBbox;
6
+ export declare function finalizePixelBbox(pixelBbox: PixelBbox, rawResult: unknown, { preparedSize, contentSize }: LocateResultContext): PixelBbox;
@@ -0,0 +1,4 @@
1
+ import type { Size } from '../../../types';
2
+ import type { ResolvedLocateResultCoordinates } from './types';
3
+ export type CoordinateDistanceAxis = 'x' | 'y';
4
+ export declare function createCoordinateDistanceToPixels(size: Size, coordinateSystem: ResolvedLocateResultCoordinates): (delta: number, axis: CoordinateDistanceAxis) => number;
@@ -0,0 +1,2 @@
1
+ export declare const defaultModelFamilyRequiredForLocateMessage = "Default model family is required for locate. Configure MIDSCENE_MODEL_FAMILY so Midscene can parse locate coordinates correctly. https://midscenejs.com/model-config";
2
+ export declare function planningModelFamilyRequiredForLocateMessage(slot?: string): "Planning model family is required because aiAct is asking the planning model to return locate coordinates. Configure MIDSCENE_PLANNING_MODEL_FAMILY for the planning model, or remove the separate planning model config and configure MIDSCENE_MODEL_FAMILY on the default model. https://midscenejs.com/model-config" | "Default model family is required because aiAct is asking the default model to return locate coordinates during planning. Configure MIDSCENE_MODEL_FAMILY so Midscene can parse planning locate coordinates correctly. https://midscenejs.com/model-config";
@@ -0,0 +1,3 @@
1
+ import type { LocateResultCodec, LocateResultCoordinates, LocateResultFormatDefinition, ResolvedLocateResultCoordinates } from './types';
2
+ export declare function resolveLocateResultCoordinates(coordinates: LocateResultCoordinates): ResolvedLocateResultCoordinates;
3
+ export declare function createLocateResultCodec(config: LocateResultFormatDefinition): LocateResultCodec;