@autotest/agent 0.0.2 → 0.0.4

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 (530) hide show
  1. package/README.md +166 -95
  2. package/dist/api/agent_api.d.ts +3 -7
  3. package/dist/api/agent_api.js +12 -12
  4. package/dist/api/autotest_agent.d.ts +0 -1
  5. package/dist/api/autotest_agent.js +0 -1
  6. package/dist/api/types.d.ts +0 -1
  7. package/dist/api/types.js +0 -1
  8. package/dist/autotest-cli.d.ts +0 -1
  9. package/dist/autotest-cli.js +9 -3
  10. package/dist/common/case_manager.d.ts +0 -1
  11. package/dist/common/case_manager.js +0 -1
  12. package/dist/common/collect_case.d.ts +0 -1
  13. package/dist/common/collect_case.js +0 -1
  14. package/dist/common/common_errors.d.ts +0 -1
  15. package/dist/common/common_errors.js +0 -1
  16. package/dist/common/config/config.yaml +134 -113
  17. package/dist/common/config/config_validator.d.ts +0 -1
  18. package/dist/common/config/config_validator.js +0 -1
  19. package/dist/common/config/manager.d.ts +0 -1
  20. package/dist/common/config/manager.js +0 -1
  21. package/dist/common/config/output.d.ts +0 -1
  22. package/dist/common/config/output.js +0 -1
  23. package/dist/common/config/types.d.ts +2243 -2244
  24. package/dist/common/config/types.js +2 -3
  25. package/dist/common/dfx/client_factory.d.ts +0 -1
  26. package/dist/common/dfx/client_factory.js +0 -1
  27. package/dist/common/dfx/context.d.ts +0 -1
  28. package/dist/common/dfx/context.js +0 -1
  29. package/dist/common/dfx/index.d.ts +0 -1
  30. package/dist/common/dfx/index.js +0 -1
  31. package/dist/common/dfx/recorder.d.ts +0 -1
  32. package/dist/common/dfx/recorder.js +0 -1
  33. package/dist/common/dfx/recording_fetch.d.ts +0 -1
  34. package/dist/common/dfx/recording_fetch.js +0 -1
  35. package/dist/common/dfx/source.d.ts +0 -1
  36. package/dist/common/dfx/source.js +0 -1
  37. package/dist/common/image_cacher.d.ts +0 -1
  38. package/dist/common/image_cacher.js +0 -1
  39. package/dist/common/image_helper.d.ts +0 -1
  40. package/dist/common/image_helper.js +0 -1
  41. package/dist/common/image_similarity.d.ts +0 -1
  42. package/dist/common/image_similarity.js +0 -1
  43. package/dist/common/llm_cache/cache_transport.d.ts +2 -1
  44. package/dist/common/llm_cache/cache_transport.js +4 -1
  45. package/dist/common/llm_cache/prompt_cache.d.ts +53 -0
  46. package/dist/common/llm_cache/prompt_cache.js +113 -0
  47. package/dist/common/logger.d.ts +0 -1
  48. package/dist/common/logger.js +0 -1
  49. package/dist/common/model/custom_model.d.ts +0 -1
  50. package/dist/common/model/custom_model.js +57 -6
  51. package/dist/common/model/index.d.ts +0 -1
  52. package/dist/common/model/index.js +0 -1
  53. package/dist/common/path_utils.d.ts +7 -4
  54. package/dist/common/path_utils.js +12 -6
  55. package/dist/common/result_parser.d.ts +0 -1
  56. package/dist/common/result_parser.js +1 -2
  57. package/dist/common/usage/token_usage.d.ts +0 -1
  58. package/dist/common/usage/token_usage.js +0 -1
  59. package/dist/common/utils.d.ts +0 -1
  60. package/dist/common/utils.js +0 -1
  61. package/dist/core/agent/layered_agent/ability_helper.d.ts +0 -1
  62. package/dist/core/agent/layered_agent/ability_helper.js +0 -1
  63. package/dist/core/agent/layered_agent/agent.d.ts +0 -1
  64. package/dist/core/agent/layered_agent/agent.js +0 -1
  65. package/dist/core/agent/layered_agent/agent_registry.d.ts +0 -1
  66. package/dist/core/agent/layered_agent/agent_registry.js +0 -1
  67. package/dist/core/agent/layered_agent/decision.d.ts +0 -1
  68. package/dist/core/agent/layered_agent/decision.js +61 -24
  69. package/dist/core/agent/layered_agent/execute_agent/action_handler.d.ts +0 -1
  70. package/dist/core/agent/layered_agent/execute_agent/action_handler.js +0 -1
  71. package/dist/core/agent/layered_agent/execute_agent/agent_factory.d.ts +1 -2
  72. package/dist/core/agent/layered_agent/execute_agent/agent_factory.js +0 -1
  73. package/dist/core/agent/layered_agent/execute_agent/base_agent.d.ts +0 -1
  74. package/dist/core/agent/layered_agent/execute_agent/base_agent.js +0 -1
  75. package/dist/core/agent/layered_agent/execute_agent/general_agent.d.ts +0 -1
  76. package/dist/core/agent/layered_agent/execute_agent/general_agent.js +0 -1
  77. package/dist/core/agent/layered_agent/execute_agent/glm_agent.d.ts +0 -1
  78. package/dist/core/agent/layered_agent/execute_agent/glm_agent.js +0 -1
  79. package/dist/core/agent/layered_agent/execute_agent/i18n.d.ts +0 -1
  80. package/dist/core/agent/layered_agent/execute_agent/i18n.js +0 -1
  81. package/dist/core/agent/layered_agent/execute_agent/index.d.ts +0 -1
  82. package/dist/core/agent/layered_agent/execute_agent/index.js +0 -1
  83. package/dist/core/agent/layered_agent/execute_agent/mai_ui_agent.d.ts +0 -1
  84. package/dist/core/agent/layered_agent/execute_agent/mai_ui_agent.js +0 -1
  85. package/dist/core/agent/layered_agent/execute_agent/mcp_prompts.d.ts +1 -2
  86. package/dist/core/agent/layered_agent/execute_agent/mcp_prompts.js +5 -6
  87. package/dist/core/agent/layered_agent/execute_agent/parser/general_parser.d.ts +0 -1
  88. package/dist/core/agent/layered_agent/execute_agent/parser/general_parser.js +1 -2
  89. package/dist/core/agent/layered_agent/execute_agent/parser/glm_parser.d.ts +0 -1
  90. package/dist/core/agent/layered_agent/execute_agent/parser/glm_parser.js +1 -2
  91. package/dist/core/agent/layered_agent/execute_agent/parser/index.d.ts +0 -1
  92. package/dist/core/agent/layered_agent/execute_agent/parser/index.js +0 -1
  93. package/dist/core/agent/layered_agent/execute_agent/parser/mai_ui_parser.d.ts +0 -1
  94. package/dist/core/agent/layered_agent/execute_agent/parser/mai_ui_parser.js +1 -2
  95. package/dist/core/agent/layered_agent/execute_agent/prompts.d.ts +1 -2
  96. package/dist/core/agent/layered_agent/execute_agent/prompts.js +5 -6
  97. package/dist/core/agent/layered_agent/execute_agent/simple_reporter.d.ts +0 -1
  98. package/dist/core/agent/layered_agent/execute_agent/simple_reporter.js +0 -1
  99. package/dist/core/agent/layered_agent/execute_agent/utils.d.ts +0 -1
  100. package/dist/core/agent/layered_agent/execute_agent/utils.js +0 -1
  101. package/dist/core/agent/report_analyzer_agent/agent.d.ts +0 -1
  102. package/dist/core/agent/report_analyzer_agent/agent.js +0 -1
  103. package/dist/core/agent/report_analyzer_agent/config.d.ts +0 -1
  104. package/dist/core/agent/report_analyzer_agent/config.js +0 -1
  105. package/dist/core/agent/report_analyzer_agent/data_loader.d.ts +0 -1
  106. package/dist/core/agent/report_analyzer_agent/data_loader.js +0 -1
  107. package/dist/core/agent/report_analyzer_agent/guardrails.d.ts +0 -1
  108. package/dist/core/agent/report_analyzer_agent/guardrails.js +0 -1
  109. package/dist/core/agent/report_analyzer_agent/hooks.d.ts +0 -1
  110. package/dist/core/agent/report_analyzer_agent/hooks.js +0 -1
  111. package/dist/core/agent/report_analyzer_agent/index.d.ts +0 -1
  112. package/dist/core/agent/report_analyzer_agent/index.js +0 -1
  113. package/dist/core/agent/report_analyzer_agent/key_steps_builder.d.ts +0 -1
  114. package/dist/core/agent/report_analyzer_agent/key_steps_builder.js +0 -1
  115. package/dist/core/agent/report_analyzer_agent/mapping.d.ts +0 -1
  116. package/dist/core/agent/report_analyzer_agent/mapping.js +0 -1
  117. package/dist/core/agent/report_analyzer_agent/parse.d.ts +0 -1
  118. package/dist/core/agent/report_analyzer_agent/parse.js +0 -1
  119. package/dist/core/agent/report_analyzer_agent/prompt.d.ts +0 -1
  120. package/dist/core/agent/report_analyzer_agent/prompt.js +0 -1
  121. package/dist/core/agent/report_analyzer_agent/report_writer.d.ts +0 -1
  122. package/dist/core/agent/report_analyzer_agent/report_writer.js +0 -1
  123. package/dist/core/agent/report_analyzer_agent/tools.d.ts +0 -1
  124. package/dist/core/agent/report_analyzer_agent/tools.js +0 -1
  125. package/dist/core/agent/report_analyzer_agent/types.d.ts +0 -1
  126. package/dist/core/agent/report_analyzer_agent/types.js +0 -1
  127. package/dist/core/agent/rewrite_agent/agent.d.ts +0 -1
  128. package/dist/core/agent/rewrite_agent/agent.js +0 -1
  129. package/dist/core/agent/rewrite_agent/guardrails.d.ts +0 -1
  130. package/dist/core/agent/rewrite_agent/guardrails.js +0 -1
  131. package/dist/core/agent/rewrite_agent/mapping.d.ts +0 -1
  132. package/dist/core/agent/rewrite_agent/mapping.js +0 -1
  133. package/dist/core/agent/rewrite_agent/parse.d.ts +0 -1
  134. package/dist/core/agent/rewrite_agent/parse.js +0 -1
  135. package/dist/core/agent/rewrite_agent/types.d.ts +0 -1
  136. package/dist/core/agent/rewrite_agent/types.js +0 -1
  137. package/dist/core/agent/single_agent/agent.d.ts +0 -1
  138. package/dist/core/agent/single_agent/agent.js +1 -2
  139. package/dist/core/agent/single_agent/hook_manager.d.ts +0 -1
  140. package/dist/core/agent/single_agent/hook_manager.js +0 -1
  141. package/dist/core/agent/single_agent/hooks.d.ts +0 -1
  142. package/dist/core/agent/single_agent/hooks.js +0 -1
  143. package/dist/core/agent/single_agent/image_utils.d.ts +0 -1
  144. package/dist/core/agent/single_agent/image_utils.js +0 -1
  145. package/dist/core/agent/single_agent/scroll_search_agent.d.ts +0 -1
  146. package/dist/core/agent/single_agent/scroll_search_agent.js +0 -1
  147. package/dist/core/agent/single_agent/subagent_manager.d.ts +0 -1
  148. package/dist/core/agent/single_agent/subagent_manager.js +0 -1
  149. package/dist/core/agent/single_agent/tool_recorder_hook.d.ts +0 -1
  150. package/dist/core/agent/single_agent/tool_recorder_hook.js +0 -1
  151. package/dist/core/agent/types.d.ts +0 -1
  152. package/dist/core/agent/types.js +0 -1
  153. package/dist/core/agent/utils/message_builder.d.ts +0 -1
  154. package/dist/core/agent/utils/message_builder.js +0 -1
  155. package/dist/core/device/device_protocol.d.ts +0 -1
  156. package/dist/core/device/device_protocol.js +0 -1
  157. package/dist/core/device/hdc/apps.d.ts +0 -1
  158. package/dist/core/device/hdc/apps.js +0 -1
  159. package/dist/core/device/hdc/device.d.ts +0 -1
  160. package/dist/core/device/hdc/device.js +0 -1
  161. package/dist/core/device/hdc/index.d.ts +0 -1
  162. package/dist/core/device/hdc/index.js +0 -1
  163. package/dist/core/device/hdc/input.d.ts +0 -1
  164. package/dist/core/device/hdc/input.js +0 -1
  165. package/dist/core/device/hdc/screenshot.d.ts +0 -1
  166. package/dist/core/device/hdc/screenshot.js +0 -1
  167. package/dist/core/device/index.d.ts +0 -1
  168. package/dist/core/device/index.js +0 -1
  169. package/dist/core/device/types.d.ts +0 -1
  170. package/dist/core/device/types.js +0 -1
  171. package/dist/core/knowledge/knowledge_manager.d.ts +0 -1
  172. package/dist/core/knowledge/knowledge_manager.js +0 -1
  173. package/dist/core/knowledge/vectordb.d.ts +0 -1
  174. package/dist/core/knowledge/vectordb.js +0 -1
  175. package/dist/core/mcp/adapter_factory.d.ts +0 -1
  176. package/dist/core/mcp/adapter_factory.js +0 -1
  177. package/dist/core/mcp/android_adapter.d.ts +1 -2
  178. package/dist/core/mcp/android_adapter.js +0 -1
  179. package/dist/core/mcp/base_adapter.d.ts +0 -1
  180. package/dist/core/mcp/base_adapter.js +0 -1
  181. package/dist/core/mcp/harmony_hdc_adapter.d.ts +9 -1
  182. package/dist/core/mcp/harmony_hdc_adapter.js +195 -2
  183. package/dist/core/mcp/ios_adapter.d.ts +1 -2
  184. package/dist/core/mcp/ios_adapter.js +0 -1
  185. package/dist/core/mcp/local_tools.d.ts +0 -1
  186. package/dist/core/mcp/local_tools.js +0 -1
  187. package/dist/core/mcp/mcp_tools.d.ts +19 -3
  188. package/dist/core/mcp/mcp_tools.js +40 -13
  189. package/dist/core/mcp/types.d.ts +0 -1
  190. package/dist/core/mcp/types.js +0 -1
  191. package/dist/core/memory/_utils.d.ts +18 -0
  192. package/dist/core/memory/_utils.js +140 -0
  193. package/dist/core/memory/compressed_session.d.ts +0 -1
  194. package/dist/core/memory/compressed_session.js +0 -1
  195. package/dist/core/memory/context_compressor.d.ts +0 -1
  196. package/dist/core/memory/context_compressor.js +0 -1
  197. package/dist/core/memory/index.d.ts +0 -1
  198. package/dist/core/memory/index.js +0 -1
  199. package/dist/core/memory/memory_manager.d.ts +0 -1
  200. package/dist/core/memory/memory_manager.js +0 -1
  201. package/dist/core/memory/reflector.d.ts +0 -1
  202. package/dist/core/memory/reflector.js +2 -3
  203. package/dist/core/memory/replan_manager.d.ts +9 -0
  204. package/dist/core/memory/replan_manager.js +12 -0
  205. package/dist/core/memory/session_factory.d.ts +0 -1
  206. package/dist/core/memory/session_factory.js +0 -1
  207. package/dist/core/memory/tool_player.d.ts +0 -1
  208. package/dist/core/memory/tool_player.js +0 -1
  209. package/dist/core/memory/tool_player_popup.d.ts +66 -0
  210. package/dist/core/memory/tool_player_popup.js +276 -0
  211. package/dist/core/memory/tool_player_replan.d.ts +49 -0
  212. package/dist/core/memory/tool_player_replan.js +226 -0
  213. package/dist/core/memory/tool_player_xpath.d.ts +52 -0
  214. package/dist/core/memory/tool_player_xpath.js +139 -0
  215. package/dist/core/memory/tool_recorder.d.ts +0 -1
  216. package/dist/core/memory/tool_recorder.js +0 -1
  217. package/dist/core/preprocessor/task_splitter.d.ts +0 -1
  218. package/dist/core/preprocessor/task_splitter.js +0 -1
  219. package/dist/core/prompt/prompt_loader.d.ts +0 -1
  220. package/dist/core/prompt/prompt_loader.js +3 -2
  221. package/dist/core/prompt/templates/debug/hypium/hypium_v2.0_optimize_scroll_search.md +310 -0
  222. package/dist/core/prompt/templates/debug/hypium/hypium_v2.0_relative_1000.md +284 -0
  223. package/dist/core/prompt/templates/debug/planner/planner_v3.0.md +140 -0
  224. package/dist/core/prompt/templates/debug/single/single_v2.0_optimize_scroll_search.md +272 -0
  225. package/dist/core/prompt/templates/debug/single/single_v2.0_relative_1000.md +277 -0
  226. package/dist/core/prompt/templates/single/single_v2.0_0_1000.md +315 -0
  227. package/dist/core/skill/skill_manager.d.ts +0 -1
  228. package/dist/core/skill/skill_manager.js +4 -2
  229. package/dist/core/skill/skills/cancel-all-follows/SKILL.md +23 -0
  230. package/dist/core/skill/skills/create-local-image/SKILL.md +12 -0
  231. package/dist/core/skill/skills/create-local-video/SKILL.md +12 -0
  232. package/dist/core/skill/skills/dismiss-popups/SKILL.md +39 -0
  233. package/dist/core/skill/skills/douyin_test_skills.md +16 -0
  234. package/dist/data_types/action.d.ts +0 -1
  235. package/dist/data_types/action.js +0 -1
  236. package/dist/data_types/agent.d.ts +0 -1
  237. package/dist/data_types/agent.js +0 -1
  238. package/dist/data_types/case.d.ts +32 -0
  239. package/dist/data_types/case.js +57 -0
  240. package/dist/data_types/device.d.ts +0 -1
  241. package/dist/data_types/device.js +0 -1
  242. package/dist/data_types/index.d.ts +2 -1
  243. package/dist/data_types/index.js +6 -2
  244. package/dist/data_types/report.d.ts +0 -1
  245. package/dist/data_types/report.js +0 -1
  246. package/dist/data_types/screen.d.ts +12 -0
  247. package/dist/data_types/screen.js +23 -0
  248. package/dist/data_types/task.d.ts +0 -1
  249. package/dist/data_types/task.js +0 -1
  250. package/dist/index.d.ts +1 -2
  251. package/dist/index.js +37 -9
  252. package/dist/loop/cli.d.ts +0 -1
  253. package/dist/loop/cli.js +0 -1
  254. package/dist/loop/orchestrator.d.ts +0 -1
  255. package/dist/loop/orchestrator.js +0 -1
  256. package/dist/loop/result_writer.d.ts +0 -1
  257. package/dist/loop/result_writer.js +0 -1
  258. package/dist/loop/types.d.ts +0 -1
  259. package/dist/loop/types.js +0 -1
  260. package/dist/mcp-server/server.d.ts +0 -1
  261. package/dist/mcp-server/server.js +88 -24
  262. package/dist/mcp-server/types.d.ts +283 -118
  263. package/dist/mcp-server/types.js +173 -31
  264. package/dist/reporter/batch_summary.d.ts +0 -1
  265. package/dist/reporter/batch_summary.js +0 -1
  266. package/dist/reporter/generator.d.ts +0 -15
  267. package/dist/reporter/generator.js +18 -505
  268. package/dist/reporter/html_template/index.d.ts +56 -0
  269. package/dist/reporter/html_template/index.js +524 -0
  270. package/dist/reporter/json_report.d.ts +1 -0
  271. package/dist/reporter/json_report.js +6 -0
  272. package/dist/reporter/types.d.ts +15 -15
  273. package/dist/reporter/types.js +1 -1
  274. package/dist/tools/batch_runner.d.ts +3 -2
  275. package/dist/tools/batch_runner.js +24 -8
  276. package/dist/tools/case_runner/report.d.ts +9 -0
  277. package/dist/tools/case_runner/report.js +264 -0
  278. package/dist/tools/case_runner/runner.d.ts +57 -0
  279. package/dist/tools/case_runner/runner.js +410 -0
  280. package/dist/tools/config/config_tool.d.ts +13 -0
  281. package/dist/tools/config/config_tool.js +339 -0
  282. package/dist/tools/prompt_compare/compare_runner.d.ts +13 -0
  283. package/dist/tools/prompt_compare/compare_runner.js +360 -0
  284. package/package.json +7 -3
  285. package/dist/api/agent_api.d.ts.map +0 -1
  286. package/dist/api/agent_api.js.map +0 -1
  287. package/dist/api/autotest_agent.d.ts.map +0 -1
  288. package/dist/api/autotest_agent.js.map +0 -1
  289. package/dist/api/types.d.ts.map +0 -1
  290. package/dist/api/types.js.map +0 -1
  291. package/dist/autotest-cli.d.ts.map +0 -1
  292. package/dist/autotest-cli.js.map +0 -1
  293. package/dist/common/case_manager.d.ts.map +0 -1
  294. package/dist/common/case_manager.js.map +0 -1
  295. package/dist/common/collect_case.d.ts.map +0 -1
  296. package/dist/common/collect_case.js.map +0 -1
  297. package/dist/common/common_errors.d.ts.map +0 -1
  298. package/dist/common/common_errors.js.map +0 -1
  299. package/dist/common/config/config_validator.d.ts.map +0 -1
  300. package/dist/common/config/config_validator.js.map +0 -1
  301. package/dist/common/config/manager.d.ts.map +0 -1
  302. package/dist/common/config/manager.js.map +0 -1
  303. package/dist/common/config/output.d.ts.map +0 -1
  304. package/dist/common/config/output.js.map +0 -1
  305. package/dist/common/config/types.d.ts.map +0 -1
  306. package/dist/common/config/types.js.map +0 -1
  307. package/dist/common/dfx/client_factory.d.ts.map +0 -1
  308. package/dist/common/dfx/client_factory.js.map +0 -1
  309. package/dist/common/dfx/context.d.ts.map +0 -1
  310. package/dist/common/dfx/context.js.map +0 -1
  311. package/dist/common/dfx/index.d.ts.map +0 -1
  312. package/dist/common/dfx/index.js.map +0 -1
  313. package/dist/common/dfx/recorder.d.ts.map +0 -1
  314. package/dist/common/dfx/recorder.js.map +0 -1
  315. package/dist/common/dfx/recording_fetch.d.ts.map +0 -1
  316. package/dist/common/dfx/recording_fetch.js.map +0 -1
  317. package/dist/common/dfx/source.d.ts.map +0 -1
  318. package/dist/common/dfx/source.js.map +0 -1
  319. package/dist/common/image_cacher.d.ts.map +0 -1
  320. package/dist/common/image_cacher.js.map +0 -1
  321. package/dist/common/image_helper.d.ts.map +0 -1
  322. package/dist/common/image_helper.js.map +0 -1
  323. package/dist/common/image_similarity.d.ts.map +0 -1
  324. package/dist/common/image_similarity.js.map +0 -1
  325. package/dist/common/llm_cache/cache_transport.d.ts.map +0 -1
  326. package/dist/common/llm_cache/cache_transport.js.map +0 -1
  327. package/dist/common/logger.d.ts.map +0 -1
  328. package/dist/common/logger.js.map +0 -1
  329. package/dist/common/model/custom_model.d.ts.map +0 -1
  330. package/dist/common/model/custom_model.js.map +0 -1
  331. package/dist/common/model/index.d.ts.map +0 -1
  332. package/dist/common/model/index.js.map +0 -1
  333. package/dist/common/path_utils.d.ts.map +0 -1
  334. package/dist/common/path_utils.js.map +0 -1
  335. package/dist/common/result_parser.d.ts.map +0 -1
  336. package/dist/common/result_parser.js.map +0 -1
  337. package/dist/common/usage/token_usage.d.ts.map +0 -1
  338. package/dist/common/usage/token_usage.js.map +0 -1
  339. package/dist/common/utils.d.ts.map +0 -1
  340. package/dist/common/utils.js.map +0 -1
  341. package/dist/core/agent/layered_agent/ability_helper.d.ts.map +0 -1
  342. package/dist/core/agent/layered_agent/ability_helper.js.map +0 -1
  343. package/dist/core/agent/layered_agent/agent.d.ts.map +0 -1
  344. package/dist/core/agent/layered_agent/agent.js.map +0 -1
  345. package/dist/core/agent/layered_agent/agent_registry.d.ts.map +0 -1
  346. package/dist/core/agent/layered_agent/agent_registry.js.map +0 -1
  347. package/dist/core/agent/layered_agent/decision.d.ts.map +0 -1
  348. package/dist/core/agent/layered_agent/decision.js.map +0 -1
  349. package/dist/core/agent/layered_agent/execute_agent/action_handler.d.ts.map +0 -1
  350. package/dist/core/agent/layered_agent/execute_agent/action_handler.js.map +0 -1
  351. package/dist/core/agent/layered_agent/execute_agent/agent_factory.d.ts.map +0 -1
  352. package/dist/core/agent/layered_agent/execute_agent/agent_factory.js.map +0 -1
  353. package/dist/core/agent/layered_agent/execute_agent/base_agent.d.ts.map +0 -1
  354. package/dist/core/agent/layered_agent/execute_agent/base_agent.js.map +0 -1
  355. package/dist/core/agent/layered_agent/execute_agent/general_agent.d.ts.map +0 -1
  356. package/dist/core/agent/layered_agent/execute_agent/general_agent.js.map +0 -1
  357. package/dist/core/agent/layered_agent/execute_agent/glm_agent.d.ts.map +0 -1
  358. package/dist/core/agent/layered_agent/execute_agent/glm_agent.js.map +0 -1
  359. package/dist/core/agent/layered_agent/execute_agent/i18n.d.ts.map +0 -1
  360. package/dist/core/agent/layered_agent/execute_agent/i18n.js.map +0 -1
  361. package/dist/core/agent/layered_agent/execute_agent/index.d.ts.map +0 -1
  362. package/dist/core/agent/layered_agent/execute_agent/index.js.map +0 -1
  363. package/dist/core/agent/layered_agent/execute_agent/mai_ui_agent.d.ts.map +0 -1
  364. package/dist/core/agent/layered_agent/execute_agent/mai_ui_agent.js.map +0 -1
  365. package/dist/core/agent/layered_agent/execute_agent/mcp_prompts.d.ts.map +0 -1
  366. package/dist/core/agent/layered_agent/execute_agent/mcp_prompts.js.map +0 -1
  367. package/dist/core/agent/layered_agent/execute_agent/parser/general_parser.d.ts.map +0 -1
  368. package/dist/core/agent/layered_agent/execute_agent/parser/general_parser.js.map +0 -1
  369. package/dist/core/agent/layered_agent/execute_agent/parser/glm_parser.d.ts.map +0 -1
  370. package/dist/core/agent/layered_agent/execute_agent/parser/glm_parser.js.map +0 -1
  371. package/dist/core/agent/layered_agent/execute_agent/parser/index.d.ts.map +0 -1
  372. package/dist/core/agent/layered_agent/execute_agent/parser/index.js.map +0 -1
  373. package/dist/core/agent/layered_agent/execute_agent/parser/mai_ui_parser.d.ts.map +0 -1
  374. package/dist/core/agent/layered_agent/execute_agent/parser/mai_ui_parser.js.map +0 -1
  375. package/dist/core/agent/layered_agent/execute_agent/prompts.d.ts.map +0 -1
  376. package/dist/core/agent/layered_agent/execute_agent/prompts.js.map +0 -1
  377. package/dist/core/agent/layered_agent/execute_agent/simple_reporter.d.ts.map +0 -1
  378. package/dist/core/agent/layered_agent/execute_agent/simple_reporter.js.map +0 -1
  379. package/dist/core/agent/layered_agent/execute_agent/utils.d.ts.map +0 -1
  380. package/dist/core/agent/layered_agent/execute_agent/utils.js.map +0 -1
  381. package/dist/core/agent/report_analyzer_agent/agent.d.ts.map +0 -1
  382. package/dist/core/agent/report_analyzer_agent/agent.js.map +0 -1
  383. package/dist/core/agent/report_analyzer_agent/config.d.ts.map +0 -1
  384. package/dist/core/agent/report_analyzer_agent/config.js.map +0 -1
  385. package/dist/core/agent/report_analyzer_agent/data_loader.d.ts.map +0 -1
  386. package/dist/core/agent/report_analyzer_agent/data_loader.js.map +0 -1
  387. package/dist/core/agent/report_analyzer_agent/guardrails.d.ts.map +0 -1
  388. package/dist/core/agent/report_analyzer_agent/guardrails.js.map +0 -1
  389. package/dist/core/agent/report_analyzer_agent/hooks.d.ts.map +0 -1
  390. package/dist/core/agent/report_analyzer_agent/hooks.js.map +0 -1
  391. package/dist/core/agent/report_analyzer_agent/index.d.ts.map +0 -1
  392. package/dist/core/agent/report_analyzer_agent/index.js.map +0 -1
  393. package/dist/core/agent/report_analyzer_agent/key_steps_builder.d.ts.map +0 -1
  394. package/dist/core/agent/report_analyzer_agent/key_steps_builder.js.map +0 -1
  395. package/dist/core/agent/report_analyzer_agent/mapping.d.ts.map +0 -1
  396. package/dist/core/agent/report_analyzer_agent/mapping.js.map +0 -1
  397. package/dist/core/agent/report_analyzer_agent/parse.d.ts.map +0 -1
  398. package/dist/core/agent/report_analyzer_agent/parse.js.map +0 -1
  399. package/dist/core/agent/report_analyzer_agent/prompt.d.ts.map +0 -1
  400. package/dist/core/agent/report_analyzer_agent/prompt.js.map +0 -1
  401. package/dist/core/agent/report_analyzer_agent/report_writer.d.ts.map +0 -1
  402. package/dist/core/agent/report_analyzer_agent/report_writer.js.map +0 -1
  403. package/dist/core/agent/report_analyzer_agent/tools.d.ts.map +0 -1
  404. package/dist/core/agent/report_analyzer_agent/tools.js.map +0 -1
  405. package/dist/core/agent/report_analyzer_agent/types.d.ts.map +0 -1
  406. package/dist/core/agent/report_analyzer_agent/types.js.map +0 -1
  407. package/dist/core/agent/rewrite_agent/agent.d.ts.map +0 -1
  408. package/dist/core/agent/rewrite_agent/agent.js.map +0 -1
  409. package/dist/core/agent/rewrite_agent/guardrails.d.ts.map +0 -1
  410. package/dist/core/agent/rewrite_agent/guardrails.js.map +0 -1
  411. package/dist/core/agent/rewrite_agent/mapping.d.ts.map +0 -1
  412. package/dist/core/agent/rewrite_agent/mapping.js.map +0 -1
  413. package/dist/core/agent/rewrite_agent/parse.d.ts.map +0 -1
  414. package/dist/core/agent/rewrite_agent/parse.js.map +0 -1
  415. package/dist/core/agent/rewrite_agent/types.d.ts.map +0 -1
  416. package/dist/core/agent/rewrite_agent/types.js.map +0 -1
  417. package/dist/core/agent/single_agent/agent.d.ts.map +0 -1
  418. package/dist/core/agent/single_agent/agent.js.map +0 -1
  419. package/dist/core/agent/single_agent/hook_manager.d.ts.map +0 -1
  420. package/dist/core/agent/single_agent/hook_manager.js.map +0 -1
  421. package/dist/core/agent/single_agent/hooks.d.ts.map +0 -1
  422. package/dist/core/agent/single_agent/hooks.js.map +0 -1
  423. package/dist/core/agent/single_agent/image_utils.d.ts.map +0 -1
  424. package/dist/core/agent/single_agent/image_utils.js.map +0 -1
  425. package/dist/core/agent/single_agent/scroll_search_agent.d.ts.map +0 -1
  426. package/dist/core/agent/single_agent/scroll_search_agent.js.map +0 -1
  427. package/dist/core/agent/single_agent/subagent_manager.d.ts.map +0 -1
  428. package/dist/core/agent/single_agent/subagent_manager.js.map +0 -1
  429. package/dist/core/agent/single_agent/tool_recorder_hook.d.ts.map +0 -1
  430. package/dist/core/agent/single_agent/tool_recorder_hook.js.map +0 -1
  431. package/dist/core/agent/types.d.ts.map +0 -1
  432. package/dist/core/agent/types.js.map +0 -1
  433. package/dist/core/agent/utils/message_builder.d.ts.map +0 -1
  434. package/dist/core/agent/utils/message_builder.js.map +0 -1
  435. package/dist/core/device/device_protocol.d.ts.map +0 -1
  436. package/dist/core/device/device_protocol.js.map +0 -1
  437. package/dist/core/device/hdc/apps.d.ts.map +0 -1
  438. package/dist/core/device/hdc/apps.js.map +0 -1
  439. package/dist/core/device/hdc/device.d.ts.map +0 -1
  440. package/dist/core/device/hdc/device.js.map +0 -1
  441. package/dist/core/device/hdc/index.d.ts.map +0 -1
  442. package/dist/core/device/hdc/index.js.map +0 -1
  443. package/dist/core/device/hdc/input.d.ts.map +0 -1
  444. package/dist/core/device/hdc/input.js.map +0 -1
  445. package/dist/core/device/hdc/screenshot.d.ts.map +0 -1
  446. package/dist/core/device/hdc/screenshot.js.map +0 -1
  447. package/dist/core/device/index.d.ts.map +0 -1
  448. package/dist/core/device/index.js.map +0 -1
  449. package/dist/core/device/types.d.ts.map +0 -1
  450. package/dist/core/device/types.js.map +0 -1
  451. package/dist/core/knowledge/knowledge_manager.d.ts.map +0 -1
  452. package/dist/core/knowledge/knowledge_manager.js.map +0 -1
  453. package/dist/core/knowledge/vectordb.d.ts.map +0 -1
  454. package/dist/core/knowledge/vectordb.js.map +0 -1
  455. package/dist/core/mcp/adapter_factory.d.ts.map +0 -1
  456. package/dist/core/mcp/adapter_factory.js.map +0 -1
  457. package/dist/core/mcp/android_adapter.d.ts.map +0 -1
  458. package/dist/core/mcp/android_adapter.js.map +0 -1
  459. package/dist/core/mcp/base_adapter.d.ts.map +0 -1
  460. package/dist/core/mcp/base_adapter.js.map +0 -1
  461. package/dist/core/mcp/harmony_hdc_adapter.d.ts.map +0 -1
  462. package/dist/core/mcp/harmony_hdc_adapter.js.map +0 -1
  463. package/dist/core/mcp/ios_adapter.d.ts.map +0 -1
  464. package/dist/core/mcp/ios_adapter.js.map +0 -1
  465. package/dist/core/mcp/local_tools.d.ts.map +0 -1
  466. package/dist/core/mcp/local_tools.js.map +0 -1
  467. package/dist/core/mcp/mcp_tools.d.ts.map +0 -1
  468. package/dist/core/mcp/mcp_tools.js.map +0 -1
  469. package/dist/core/mcp/types.d.ts.map +0 -1
  470. package/dist/core/mcp/types.js.map +0 -1
  471. package/dist/core/memory/compressed_session.d.ts.map +0 -1
  472. package/dist/core/memory/compressed_session.js.map +0 -1
  473. package/dist/core/memory/context_compressor.d.ts.map +0 -1
  474. package/dist/core/memory/context_compressor.js.map +0 -1
  475. package/dist/core/memory/index.d.ts.map +0 -1
  476. package/dist/core/memory/index.js.map +0 -1
  477. package/dist/core/memory/memory_manager.d.ts.map +0 -1
  478. package/dist/core/memory/memory_manager.js.map +0 -1
  479. package/dist/core/memory/reflector.d.ts.map +0 -1
  480. package/dist/core/memory/reflector.js.map +0 -1
  481. package/dist/core/memory/session_factory.d.ts.map +0 -1
  482. package/dist/core/memory/session_factory.js.map +0 -1
  483. package/dist/core/memory/tool_player.d.ts.map +0 -1
  484. package/dist/core/memory/tool_player.js.map +0 -1
  485. package/dist/core/memory/tool_recorder.d.ts.map +0 -1
  486. package/dist/core/memory/tool_recorder.js.map +0 -1
  487. package/dist/core/preprocessor/task_splitter.d.ts.map +0 -1
  488. package/dist/core/preprocessor/task_splitter.js.map +0 -1
  489. package/dist/core/prompt/prompt_loader.d.ts.map +0 -1
  490. package/dist/core/prompt/prompt_loader.js.map +0 -1
  491. package/dist/core/skill/skill_manager.d.ts.map +0 -1
  492. package/dist/core/skill/skill_manager.js.map +0 -1
  493. package/dist/data_types/action.d.ts.map +0 -1
  494. package/dist/data_types/action.js.map +0 -1
  495. package/dist/data_types/agent.d.ts.map +0 -1
  496. package/dist/data_types/agent.js.map +0 -1
  497. package/dist/data_types/device.d.ts.map +0 -1
  498. package/dist/data_types/device.js.map +0 -1
  499. package/dist/data_types/index.d.ts.map +0 -1
  500. package/dist/data_types/index.js.map +0 -1
  501. package/dist/data_types/report.d.ts.map +0 -1
  502. package/dist/data_types/report.js.map +0 -1
  503. package/dist/data_types/task.d.ts.map +0 -1
  504. package/dist/data_types/task.js.map +0 -1
  505. package/dist/hypium_generator/generator.d.ts +0 -38
  506. package/dist/hypium_generator/generator.d.ts.map +0 -1
  507. package/dist/hypium_generator/generator.js +0 -847
  508. package/dist/hypium_generator/generator.js.map +0 -1
  509. package/dist/index.d.ts.map +0 -1
  510. package/dist/index.js.map +0 -1
  511. package/dist/loop/cli.d.ts.map +0 -1
  512. package/dist/loop/cli.js.map +0 -1
  513. package/dist/loop/orchestrator.d.ts.map +0 -1
  514. package/dist/loop/orchestrator.js.map +0 -1
  515. package/dist/loop/result_writer.d.ts.map +0 -1
  516. package/dist/loop/result_writer.js.map +0 -1
  517. package/dist/loop/types.d.ts.map +0 -1
  518. package/dist/loop/types.js.map +0 -1
  519. package/dist/mcp-server/server.d.ts.map +0 -1
  520. package/dist/mcp-server/server.js.map +0 -1
  521. package/dist/mcp-server/types.d.ts.map +0 -1
  522. package/dist/mcp-server/types.js.map +0 -1
  523. package/dist/reporter/batch_summary.d.ts.map +0 -1
  524. package/dist/reporter/batch_summary.js.map +0 -1
  525. package/dist/reporter/generator.d.ts.map +0 -1
  526. package/dist/reporter/generator.js.map +0 -1
  527. package/dist/reporter/types.d.ts.map +0 -1
  528. package/dist/reporter/types.js.map +0 -1
  529. package/dist/tools/batch_runner.d.ts.map +0 -1
  530. package/dist/tools/batch_runner.js.map +0 -1
@@ -31,4 +31,3 @@ declare class AgentRegistryImpl {
31
31
  }
32
32
  export declare const agentRegistry: AgentRegistryImpl;
33
33
  export type { AgentRegistryImpl };
34
- //# sourceMappingURL=agent_registry.d.ts.map
@@ -73,4 +73,3 @@ class AgentRegistryImpl {
73
73
  }
74
74
  }
75
75
  exports.agentRegistry = AgentRegistryImpl.getInstance();
76
- //# sourceMappingURL=agent_registry.js.map
@@ -79,4 +79,3 @@ export interface DecisionChatArgs {
79
79
  }
80
80
  export declare function decisionChat(chatArgs: DecisionChatArgs): Promise<DecisionResult>;
81
81
  export type { AgentResult };
82
- //# sourceMappingURL=decision.d.ts.map
@@ -12,6 +12,7 @@ const model_1 = require("../../../common/model");
12
12
  const cache_transport_1 = require("../../../common/llm_cache/cache_transport");
13
13
  const prompt_loader_1 = require("../../prompt/prompt_loader");
14
14
  const skill_manager_1 = require("../../skill/skill_manager");
15
+ const utils_1 = require("../../../common/utils");
15
16
  const agent_registry_1 = require("./agent_registry");
16
17
  const agent_factory_1 = require("./execute_agent/agent_factory");
17
18
  function mkEvent(eventType, content, opts) {
@@ -34,14 +35,15 @@ function createClientConfig(config) {
34
35
  return config.model.decision;
35
36
  }
36
37
  const DEFAULT_MCP_TOOLS = [
37
- { name: 'tap', description: 'Tap at the given coordinates', parameters: { x: 'number', y: 'number' } },
38
- { name: 'double_tap', description: 'Double tap at the given coordinates', parameters: { x: 'number', y: 'number' } },
39
- { name: 'long_press', description: 'Long press at the given coordinates', parameters: { x: 'number', y: 'number' } },
40
- { name: 'swipe', description: 'Swipe from start to end coordinates', parameters: { start_x: 'number', start_y: 'number', end_x: 'number', end_y: 'number' } },
38
+ { name: 'tap', description: 'Tap at the given coordinates. Coordinates are normalized decimals 0.0~1.0: (0.0,0.0)=top-left, (1.0,1.0)=bottom-right. Do NOT output integers like 499; use 0.499 instead', parameters: { x: 'number', y: 'number' } },
39
+ { name: 'double_tap', description: 'Double tap at the given coordinates. Coordinates are normalized decimals 0.0~1.0', parameters: { x: 'number', y: 'number' } },
40
+ { name: 'long_press', description: 'Long press at the given coordinates. Coordinates are normalized decimals 0.0~1.0', parameters: { x: 'number', y: 'number' } },
41
+ { name: 'swipe', description: 'Swipe from start to end coordinates. Coordinates are normalized decimals 0.0~1.0: (0.0,0.0)=top-left, (1.0,1.0)=bottom-right. Do NOT output integers', parameters: { start_x: 'number', start_y: 'number', end_x: 'number', end_y: 'number' } },
41
42
  { name: 'back', description: 'Press back key', parameters: {} },
42
43
  { name: 'go_home', description: 'Go to home screen', parameters: {} },
43
44
  { name: 'start_app', description: 'Start an application by name', parameters: { app_name: 'string' } },
44
45
  { name: 'type_text', description: 'Type text into the focused input', parameters: { text: 'string' } },
46
+ { name: 'chat', description: 'Send a sub-task instruction to the executor (describe what to do in natural language, e.g. click a button, swipe, input text). The executor will look at the screen and perform the actual operation', parameters: { message: 'string' } },
45
47
  { name: 'finish', description: 'Finish the task with a result message', parameters: { message: 'string' } },
46
48
  ];
47
49
  function collectAllTools(adapter) {
@@ -118,22 +120,41 @@ function extractFirstJsonObject(text) {
118
120
  }
119
121
  return null;
120
122
  }
123
+ function tryParseToolCall(jsonText, fallback) {
124
+ try {
125
+ const parsed = JSON.parse(jsonText);
126
+ const name = parsed.name ?? parsed.action ?? '';
127
+ const argumentsObj = parsed.arguments ?? {};
128
+ const reasoning = parsed.reasoning ?? undefined;
129
+ if (name === 'finish' || name === 'answer' || name === 'terminate' || !name) {
130
+ return { isFinish: true, message: argumentsObj.message ?? fallback, reasoning };
131
+ }
132
+ return { toolCall: { name, arguments: argumentsObj }, isFinish: false, reasoning };
133
+ }
134
+ catch {
135
+ return null;
136
+ }
137
+ }
138
+ function repairCoordinateJson(text) {
139
+ let out = text;
140
+ out = out.replace(/"x"\s*:\s*(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)\s*\}/g, '"x": $1, "y": $2}');
141
+ out = out.replace(/"start_x"\s*:\s*(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)\s*,\s*"end_x"\s*:\s*(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)\s*\}/g, '"start_x": $1, "start_y": $2, "end_x": $3, "end_y": $4}');
142
+ return out;
143
+ }
121
144
  function parsePlannerOutput(text) {
122
145
  const fenceMatch = text.match(/```(?:json)?\s*([\s\S]*?)```/i);
123
146
  const jsonText = fenceMatch?.[1]?.trim() ?? extractFirstJsonObject(text);
124
147
  if (jsonText) {
125
- try {
126
- const parsed = JSON.parse(jsonText);
127
- const name = parsed.name ?? parsed.action ?? '';
128
- const argumentsObj = parsed.arguments ?? {};
129
- if (name === 'finish' || name === 'answer' || name === 'terminate' || !name) {
130
- return { isFinish: true, message: argumentsObj.message ?? text };
131
- }
132
- return { toolCall: { name, arguments: argumentsObj }, isFinish: false };
133
- }
134
- catch {
135
- // fall through
148
+ const direct = tryParseToolCall(jsonText, text);
149
+ if (direct)
150
+ return direct;
151
+ const repaired = repairCoordinateJson(jsonText);
152
+ if (repaired !== jsonText) {
153
+ const fixed = tryParseToolCall(repaired, text);
154
+ if (fixed)
155
+ return fixed;
136
156
  }
157
+ return { isFinish: false, parseError: `Malformed planner JSON: ${jsonText}` };
137
158
  }
138
159
  return { isFinish: true, message: text };
139
160
  }
@@ -266,7 +287,7 @@ class DecisionPlanner {
266
287
  if (skillsMetadata) {
267
288
  systemPrompt += `\n\n## Available Skills\n${skillsMetadata}`;
268
289
  }
269
- systemPrompt += `\n\n## Available Tools\n${toolsText}\n\n## Output Format\nReturn a single tool call inside a json code fence: \`{"name": "tool_name", "arguments": {...}}\`. To finish, use the "finish" tool with a "message" argument that starts with PASS or FAIL.`;
290
+ systemPrompt += `\n\n## Available Tools\n${toolsText}\n\n## Output Format\nReturn a single JSON object inside a json code fence: \`{"reasoning": "<先简述当前屏幕观察,再声明完成条件/异常条件检查结论>", "name": "tool_name", "arguments": {...}}\`. The "reasoning" field is mandatory — every step must state your observation and judgment before the action. To finish, use \`{"reasoning": "<判定依据>", "name": "finish", "arguments": {"message": "PASS 或 FAIL - 原因"}}\`.\n\n## Coordinate System\nAll tap/swipe coordinates MUST be normalized decimals in 0.0~1.0: (0.0,0.0)=screen top-left, (1.0,1.0)=bottom-right. Never output integers (e.g. write 0.499, not 499) — integer coordinates will be mapped off-screen and the tap will miss.`;
270
291
  if (this.hooks) {
271
292
  await this.hooks.onAgentStart('layered');
272
293
  }
@@ -289,14 +310,29 @@ class DecisionPlanner {
289
310
  logger_1.logger.warn(`Failed to capture screenshot: ${e instanceof Error ? e.message : String(e)}`);
290
311
  }
291
312
  const decision = await this.planStep(task, systemPrompt, decisionModelConfig, screenshot);
292
- this.reportGenerator.addEvent(mkEvent(types_1.EventType.PLANNER_OUTPUT, `Planner decision: ${decision.toolCall?.name ?? 'finish'}`, {
313
+ this.reportGenerator.addEvent(mkEvent(types_1.EventType.PLANNER_OUTPUT, `Planner decision: ${decision.toolCall?.name ?? (decision.parseError ? 'parse_error' : 'finish')}`, {
293
314
  data: {
294
- action: decision.toolCall?.name ?? 'finish',
315
+ action: decision.toolCall?.name ?? (decision.parseError ? 'parse_error' : 'finish'),
295
316
  shouldFinish: decision.isFinish,
296
- reasoning: decision.message ?? '',
317
+ reasoning: decision.parseError ?? decision.reasoning ?? decision.message ?? '',
297
318
  },
298
319
  stepNumber: this.stepNumber,
299
320
  }));
321
+ if (decision.parseError) {
322
+ this.reportGenerator.addEvent(mkEvent(types_1.EventType.PLANNER_PARSE_ERROR, `Planner output parse error at step ${this.stepNumber}`, {
323
+ data: { parseError: decision.parseError },
324
+ stepNumber: this.stepNumber,
325
+ }));
326
+ this.reportGenerator.addEvent(mkEvent(types_1.EventType.STEP_END, `Step ${this.stepNumber} skipped (planner output parse error, will retry next step)`, {
327
+ data: { status: 'ERROR', parseError: decision.parseError },
328
+ stepNumber: this.stepNumber,
329
+ }));
330
+ this.history.push(`Step ${this.stepNumber}: [parse error] ${decision.parseError}`);
331
+ if (this.hooks) {
332
+ await this.hooks.onLLMEnd('layered', this.stepNumber, { decision, executorResult: null });
333
+ }
334
+ continue;
335
+ }
300
336
  if (decision.isFinish) {
301
337
  finalOutput = decision.message ?? '';
302
338
  const extracted = extractResult(finalOutput);
@@ -326,6 +362,7 @@ class DecisionPlanner {
326
362
  if (this.hooks) {
327
363
  await this.hooks.onAgentEnd('layered', { finalOutput, status: finalStatus });
328
364
  }
365
+ this.reportGenerator.endTask(finalOutput, finalStatus);
329
366
  const savedFiles = await this.reportGenerator.saveAll();
330
367
  return { finalOutput, status: finalStatus, savedFiles };
331
368
  }
@@ -345,7 +382,7 @@ class DecisionPlanner {
345
382
  this.reportGenerator.addEvent(mkEvent(types_1.EventType.PLANNER_START, `Planner observing screenshot for step ${this.stepNumber}`, { stepNumber: this.stepNumber }));
346
383
  this.reportGenerator.addEvent(mkEvent(types_1.EventType.LLM_CALL, `Planner LLM call for step ${this.stepNumber}`, { data: { role: 'planner' }, stepNumber: this.stepNumber }));
347
384
  const historyText = this.history.length > 0 ? this.history.join('\n') : 'none';
348
- const userPrompt = `Task: ${task}\n\nAction History:\n${historyText}\n\nObserve the current screenshot and decide the next action to advance the task. Return a single tool call in a json code fence.`;
385
+ const userPrompt = `Task: ${task}\n\nAction History:\n${historyText}\n\nObserve the current screenshot, state your observation and judgment (completion/exception check) in the "reasoning" field, then decide the next action. Return a single JSON object in a json code fence.`;
349
386
  const images = [];
350
387
  if (screenshot?.base64Data) {
351
388
  images.push({ base64Data: screenshot.base64Data, mimeType: 'image/jpeg' });
@@ -364,7 +401,8 @@ class DecisionPlanner {
364
401
  this.reportGenerator.addEvent(mkEvent(types_1.EventType.LLM_RESPONSE, `Planner LLM error: ${errMsg}`, { data: { simulated: true, role: 'planner' }, stepNumber: this.stepNumber }));
365
402
  return { isFinish: true, message: `Planner error: ${errMsg}` };
366
403
  }
367
- this.reportGenerator.addEvent(mkEvent(types_1.EventType.PLANNER_THINKING, llmResult.reasoning ?? llmResult.text, { stepNumber: this.stepNumber }));
404
+ const decision = parsePlannerOutput(llmResult.text);
405
+ this.reportGenerator.addEvent(mkEvent(types_1.EventType.PLANNER_THINKING, decision.reasoning ?? llmResult.reasoning ?? llmResult.text, { stepNumber: this.stepNumber }));
368
406
  this.reportGenerator.addEvent(mkEvent(types_1.EventType.LLM_RESPONSE, `Planner LLM response for step ${this.stepNumber}`, {
369
407
  data: { text: llmResult.text.slice(0, 200), finishReason: llmResult.finishReason, role: 'planner' },
370
408
  stepNumber: this.stepNumber,
@@ -372,11 +410,12 @@ class DecisionPlanner {
372
410
  if (llmResult.tokenUsage) {
373
411
  this.reportGenerator.addTokenUsage(llmResult.tokenUsage, 'DecisionAgent', this.stepNumber);
374
412
  }
375
- return parsePlannerOutput(llmResult.text);
413
+ return decision;
376
414
  }
377
415
  async executeStep(toolCall, screenshot) {
378
416
  const toolName = toolCall.name;
379
417
  const toolArgs = toolCall.arguments;
418
+ (0, utils_1.normalizeToolCoordinates)(toolName, toolArgs);
380
419
  this.reportGenerator.addEvent(mkEvent(types_1.EventType.PLANNER_TOOL_CALL, `Planner delegated to executor: ${toolName}`, {
381
420
  data: { tool_name: toolName, arguments: toolArgs, delegated: this.executorAgent != null },
382
421
  stepNumber: this.stepNumber,
@@ -456,7 +495,6 @@ async function decisionChat(chatArgs) {
456
495
  }
457
496
  result = await planner.run(args.task);
458
497
  logger_1.logger.info(`Final Result: ${result.finalOutput}`);
459
- reportGenerator.endTask(result.finalOutput, result.status);
460
498
  }
461
499
  catch (e) {
462
500
  const errMsg = e instanceof Error ? e.message : String(e);
@@ -476,4 +514,3 @@ async function decisionChat(chatArgs) {
476
514
  }
477
515
  return result;
478
516
  }
479
- //# sourceMappingURL=decision.js.map
@@ -23,4 +23,3 @@ export declare class ActionHandler {
23
23
  private defaultTakeover;
24
24
  }
25
25
  export {};
26
- //# sourceMappingURL=action_handler.d.ts.map
@@ -153,4 +153,3 @@ class ActionHandler {
153
153
  }
154
154
  }
155
155
  exports.ActionHandler = ActionHandler;
156
- //# sourceMappingURL=action_handler.js.map
@@ -17,8 +17,7 @@ export declare class AgentFactory {
17
17
  private static loaded;
18
18
  static register(name: string, factory: AgentFactoryFn): void;
19
19
  static getAgentFactory(provider: string): AgentFactoryFn;
20
- static create(provider: string | undefined, opts: AgentCreateOptions): BaseAgent;
20
+ static create(provider: string, opts: AgentCreateOptions): BaseAgent;
21
21
  static loadBuiltinAgents(): void;
22
22
  }
23
23
  export declare function createAgent(provider?: string): AgentFactoryFn;
24
- //# sourceMappingURL=agent_factory.d.ts.map
@@ -39,4 +39,3 @@ exports.AgentFactory = AgentFactory;
39
39
  function createAgent(provider = 'glm') {
40
40
  return AgentFactory.getAgentFactory(provider);
41
41
  }
42
- //# sourceMappingURL=agent_factory.js.map
@@ -80,4 +80,3 @@ export declare abstract class BaseAgent {
80
80
  arguments: Record<string, unknown>;
81
81
  }, _screenshot?: Screenshot | null): Promise<ExecutorStepResult>;
82
82
  }
83
- //# sourceMappingURL=base_agent.d.ts.map
@@ -110,4 +110,3 @@ class BaseAgent {
110
110
  }
111
111
  }
112
112
  exports.BaseAgent = BaseAgent;
113
- //# sourceMappingURL=base_agent.js.map
@@ -30,4 +30,3 @@ export declare class GeneralAgent extends BaseAgent {
30
30
  get isRunning(): boolean;
31
31
  }
32
32
  export declare function getMessagesForAgent(lang: string): import("./i18n").UIMessages;
33
- //# sourceMappingURL=general_agent.d.ts.map
@@ -205,4 +205,3 @@ exports.GeneralAgent = GeneralAgent;
205
205
  function getMessagesForAgent(lang) {
206
206
  return (0, i18n_1.getMessages)(lang);
207
207
  }
208
- //# sourceMappingURL=general_agent.js.map
@@ -33,4 +33,3 @@ export declare class GLMAgent extends BaseAgent {
33
33
  get screenshot(): unknown[];
34
34
  get isRunning(): boolean;
35
35
  }
36
- //# sourceMappingURL=glm_agent.d.ts.map
@@ -239,4 +239,3 @@ class GLMAgent extends base_agent_1.BaseAgent {
239
239
  }
240
240
  }
241
241
  exports.GLMAgent = GLMAgent;
242
- //# sourceMappingURL=glm_agent.js.map
@@ -23,4 +23,3 @@ export interface UIMessages {
23
23
  }
24
24
  export declare function getMessages(lang?: string): UIMessages;
25
25
  export declare function getMessage(key: keyof UIMessages, lang?: string): string;
26
- //# sourceMappingURL=i18n.d.ts.map
@@ -32,4 +32,3 @@ function getMessage(key, lang = 'en') {
32
32
  const messages = getMessages(lang);
33
33
  return messages[key] ?? String(key);
34
34
  }
35
- //# sourceMappingURL=i18n.js.map
@@ -13,4 +13,3 @@ export { getMessages, getMessage } from './i18n';
13
13
  export type { UIMessages } from './i18n';
14
14
  export { waitIfNotExceed, asyncWaitIfNotExceed, sleep, sleepSync, runAsyncFunc } from './utils';
15
15
  export * as Parser from './parser';
16
- //# sourceMappingURL=index.d.ts.map
@@ -65,4 +65,3 @@ Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { r
65
65
  Object.defineProperty(exports, "sleepSync", { enumerable: true, get: function () { return utils_1.sleepSync; } });
66
66
  Object.defineProperty(exports, "runAsyncFunc", { enumerable: true, get: function () { return utils_1.runAsyncFunc; } });
67
67
  exports.Parser = __importStar(require("./parser"));
68
- //# sourceMappingURL=index.js.map
@@ -49,4 +49,3 @@ export declare class MaiUiAgent extends BaseAgent {
49
49
  get isRunning(): boolean;
50
50
  cleanUp(): Promise<void>;
51
51
  }
52
- //# sourceMappingURL=mai_ui_agent.d.ts.map
@@ -314,4 +314,3 @@ class MaiUiAgent extends base_agent_1.BaseAgent {
314
314
  }
315
315
  }
316
316
  exports.MaiUiAgent = MaiUiAgent;
317
- //# sourceMappingURL=mai_ui_agent.js.map
@@ -1,4 +1,3 @@
1
- export declare const MCP_SYSTEM_PROMPT_BASIC = "You are a GUI operation agent. You will receive a task description, an action history, a screen screenshot, and a set of tools used for device operations. You need to decide the next action to take to complete the task based on the current interface state. Please operate based on the current interface and the given task, do not speculate about user intent.\n\n# Output Format Requirements\n- Must include a thinking section that first summarizes the history of operations, especially repeatedly retried operations, the decision reason for the current operation step, and the operation description.\n- The thinking section should summarize in one sentence.\n\n# Notes\n## Decide based on screenshot and history\n - Please analyze the current interface content based on the provided screenshot and user instruction, and select the most appropriate operation from the tools. Your judgment must be based on visual recognition of the controls on the interface.\n## Retry principle\n - Please pay attention to the operation history; the same operation sequence should be retried at most 2 times. If the operation does not achieve the expected result, terminate execution directly and report the failure reason.\n## Execution conditions\n - Please confirm whether the execution conditions are met before execution. If the execution conditions are not met, terminate execution directly and report the failure reason.\n## Target description\n - Please confirm the operations required by the target description in the task list, and only complete the operations specified in the target description.\n## Expected result\n - Please confirm the expected result before execution. If the expected result has been achieved, report completion directly.\n## Swipe description\n - Swipe from left to right -> right\n - Swipe from top to bottom -> down\n - Swipe from bottom to top -> up\n - Swipe from right to left -> left\n## Coordinate description\n - The coordinate format is (x, y), the coordinate range is (0, 1000), do not exceed the coordinate range.\n\n## Supported MCP Tools\n";
1
+ export declare const MCP_SYSTEM_PROMPT_BASIC = "You are a GUI operation agent. You will receive a task description, an action history, a screen screenshot, and a set of tools used for device operations. You need to decide the next action to take to complete the task based on the current interface state. Please operate based on the current interface and the given task, do not speculate about user intent.\n\n# Output Format Requirements\n- Must include a thinking section that first summarizes the history of operations, especially repeatedly retried operations, the decision reason for the current operation step, and the operation description.\n- The thinking section should summarize in one sentence.\n\n# Notes\n## Decide based on screenshot and history\n - Please analyze the current interface content based on the provided screenshot and user instruction, and select the most appropriate operation from the tools. Your judgment must be based on visual recognition of the controls on the interface.\n## Retry principle\n - Please pay attention to the operation history; the same operation sequence should be retried at most 2 times. If the operation does not achieve the expected result, terminate execution directly and report the failure reason.\n## Execution conditions\n - Please confirm whether the execution conditions are met before execution. If the execution conditions are not met, terminate execution directly and report the failure reason.\n## Target description\n - Please confirm the operations required by the target description in the task list, and only complete the operations specified in the target description.\n## Expected result\n - Please confirm the expected result before execution. If the expected result has been achieved, report completion directly.\n## Swipe description\n - Swipe from left to right -> right\n - Swipe from top to bottom -> down\n - Swipe from bottom to top -> up\n - Swipe from right to left -> left\n## Coordinate description\n - The coordinate format is (x, y), the coordinate range is (0.000, 1.000), do not exceed the coordinate range.\n\n## Supported MCP Tools\n";
2
2
  export declare const MCP_SYSTEM_PROMPT_ALL: string;
3
3
  export declare const MCP_SYSTEM_PROMPT: string;
4
- //# sourceMappingURL=mcp_prompts.d.ts.map
@@ -38,7 +38,7 @@ exports.MCP_SYSTEM_PROMPT_BASIC = `You are a GUI operation agent. You will recei
38
38
  - Swipe from bottom to top -> up
39
39
  - Swipe from right to left -> left
40
40
  ## Coordinate description
41
- - The coordinate format is (x, y), the coordinate range is (0, 1000), do not exceed the coordinate range.
41
+ - The coordinate format is (x, y), the coordinate range is (0.000, 1.000), do not exceed the coordinate range.
42
42
 
43
43
  ## Supported MCP Tools
44
44
  `;
@@ -82,11 +82,11 @@ ${'<thinking>\n' +
82
82
  '**Observation**: The current screen shows the Meituan home page, with address, search bar, scan icon, menu bar, image list, etc.\n' +
83
83
  '**Analysis**: I need to click the top search box and enter "Bawang Chaji".\n' +
84
84
  '**Usability check**: The page elements are available, without any occlusion.\n' +
85
- '**Decision**: The search box is located in the upper center of the screen, the coordinate is about [500, 100].\n' +
85
+ '**Decision**: The search box is located in the upper center of the screen, the coordinate is about [0.5, 0.1].\n' +
86
86
  '**Summary**: Next operation: click the search box.\n' +
87
87
  '</thinking>\n' +
88
88
  '```json\n' +
89
- '{"name": "tap", "arguments": {"x": 500, "y": 100}}\n' +
89
+ '{"name": "tap", "arguments": {"x": 0.5, "y": 0.1}}\n' +
90
90
  '```'}
91
91
 
92
92
  # Notes
@@ -113,7 +113,7 @@ ${'<thinking>\n' +
113
113
  - Swipe from bottom to top -> up, the X coordinate should remain unchanged.
114
114
  - Swipe from right to left -> left, the Y coordinate should remain unchanged.
115
115
  ## Coordinate description
116
- - The coordinate format is (x, y), the coordinate range is (0, 1000), do not exceed the coordinate range.
116
+ - The coordinate format is (x, y), the coordinate range is (0.000, 1.000), do not exceed the coordinate range.
117
117
  ## Operation guide
118
118
  - Special characters such as quotes and newlines in text input must be escaped.
119
119
  - Only return one action at a time, do not try to batch operations.
@@ -136,7 +136,7 @@ The thinking section should include:
136
136
 
137
137
  ### Common mistakes to avoid
138
138
  - Do not type directly without clicking the input box first.
139
- - Do not use coordinates outside the [0, 999] range.
139
+ - Do not use coordinates outside the [0.000, 1.000] range.
140
140
  - Do not omit the thinking tags.
141
141
  - Do not use comments or extra fields in the JSON.
142
142
  - Do not continuously perform multiple identical invalid operations.
@@ -152,4 +152,3 @@ The thinking section should include:
152
152
 
153
153
  Current date: ${getFormattedDate()}`;
154
154
  exports.MCP_SYSTEM_PROMPT = exports.MCP_SYSTEM_PROMPT_ALL;
155
- //# sourceMappingURL=mcp_prompts.js.map
@@ -19,4 +19,3 @@ export declare class GeneralParser {
19
19
  private clamp;
20
20
  }
21
21
  export {};
22
- //# sourceMappingURL=general_parser.d.ts.map
@@ -24,7 +24,7 @@ function lenientParse(text) {
24
24
  }
25
25
  class GeneralParser {
26
26
  get coordinateScale() {
27
- return 1000;
27
+ return 1;
28
28
  }
29
29
  parse(rawResponse, screenWidth, screenHeight) {
30
30
  const content = rawResponse.trim();
@@ -241,4 +241,3 @@ class GeneralParser {
241
241
  }
242
242
  }
243
243
  exports.GeneralParser = GeneralParser;
244
- //# sourceMappingURL=general_parser.js.map
@@ -11,4 +11,3 @@ export declare class GLMParser {
11
11
  private extractParams;
12
12
  }
13
13
  export {};
14
- //# sourceMappingURL=glm_parser.d.ts.map
@@ -26,7 +26,7 @@ function lenientParseValue(valueStr) {
26
26
  }
27
27
  class GLMParser {
28
28
  get coordinateScale() {
29
- return 1000;
29
+ return 1;
30
30
  }
31
31
  parse(rawResponse, screenWidth, screenHeight) {
32
32
  const actionStr = rawResponse.trim();
@@ -137,4 +137,3 @@ class GLMParser {
137
137
  }
138
138
  }
139
139
  exports.GLMParser = GLMParser;
140
- //# sourceMappingURL=glm_parser.js.map
@@ -4,4 +4,3 @@ export { GLMParser } from './glm_parser';
4
4
  export type { GLMAction } from './glm_parser';
5
5
  export { MaiUiParser } from './mai_ui_parser';
6
6
  export type { ParsedToolCall, TaggedParseResult } from './mai_ui_parser';
7
- //# sourceMappingURL=index.d.ts.map
@@ -7,4 +7,3 @@ var glm_parser_1 = require("./glm_parser");
7
7
  Object.defineProperty(exports, "GLMParser", { enumerable: true, get: function () { return glm_parser_1.GLMParser; } });
8
8
  var mai_ui_parser_1 = require("./mai_ui_parser");
9
9
  Object.defineProperty(exports, "MaiUiParser", { enumerable: true, get: function () { return mai_ui_parser_1.MaiUiParser; } });
10
- //# sourceMappingURL=index.js.map
@@ -14,4 +14,3 @@ export declare class MaiUiParser {
14
14
  private extractFirstJsonObject;
15
15
  convertRelativeToAbsolute(element: Array<number>, screenWidth: number, screenHeight: number): number[];
16
16
  }
17
- //# sourceMappingURL=mai_ui_parser.d.ts.map
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MaiUiParser = void 0;
4
4
  class MaiUiParser {
5
5
  get coordinateScale() {
6
- return 1000;
6
+ return 1;
7
7
  }
8
8
  parse(llmOutput, _screenWidth, _screenHeight) {
9
9
  const result = this.parseTaggedText(llmOutput);
@@ -92,4 +92,3 @@ class MaiUiParser {
92
92
  }
93
93
  }
94
94
  exports.MaiUiParser = MaiUiParser;
95
- //# sourceMappingURL=mai_ui_parser.js.map
@@ -1,2 +1 @@
1
- export declare const SYSTEM_PROMPT = "You are the execution-layer Agent, responsible for strictly executing instructions from the superior (decision layer).\n\n## Core Positioning (Highest Priority)\n\nYou are the execution layer, not the decision layer.\n- Your responsibility: execute instructions from the superior, do not judge whether the instruction is meaningful.\n- Your superior (Planner): responsible for decisions, judging whether the task is complete.\n- Your role: tool executor, not task decision-maker.\n\n---\n\n## Mandatory Execution Rules (Must Follow)\n\nMust execute:\n- Receive an instruction from the superior then must execute, do not judge whether it is meaningful.\n- The superior asks to swipe then must swipe, do not judge whether there is content.\n- The superior asks to click then must click, do not judge whether it is correct.\n\nForbidden autonomous behaviors:\n- Forbidden to autonomously terminate (task completion is judged by the superior).\n- Forbidden to autonomously go back (going back is decided by the superior).\n- Forbidden to autonomously explore (exploration is planned by the superior).\n- Forbidden to judge whether an operation is meaningful.\n- Forbidden to think about whether you should go back to the previous level.\n- Forbidden to think about whether the task is complete.\n\n---\n\n## Output Format\n\nEach operation must contain two parts:\n1. Thinking process: describe observation and localization inside thinking tags.\n2. Action instruction: return a JSON function call inside a json code fence.\n\nExample:\n\n<thinking>\n**Observation**: The current screen shows a short-video playback interface, the superior asks to swipe up.\n**Localization**: The superior asks to swipe in the middle area of the screen, the coordinate area is about [300-700, 400-600].\n**Execution**: Swipe from bottom to top in the middle of the screen.\n</thinking>\n```json\n{\"name\": \"swipe\", \"arguments\": {\"direction\": \"up\", \"coordinate\": [500, 500]}}\n```\n\n---\n\n## Action Space (Strictly Follow)\n\n### Basic Operations\n- Click: {\"name\": \"click\", \"arguments\": {\"coordinate\": [x, y]}}\n Used to click the UI element specified by the superior.\n\n- Long press: {\"name\": \"long_press\", \"arguments\": {\"coordinate\": [x, y]}}\n Used to long-press the element specified by the superior.\n\n- Type text: {\"name\": \"type\", \"arguments\": {\"text\": \"text to input\"}}\n You must click the input box to focus it first, then use this action to input text.\n\n### Swipe Operations\n- Swipe: {\"name\": \"swipe\", \"arguments\": {\"direction\": \"up|down|left|right\", \"coordinate\": [x, y]}}\n direction options: up (swipe up), down (swipe down), left (swipe left), right (swipe right).\n coordinate: specifies the swipe start point (the position specified by the superior).\n\n- Drag: {\"name\": \"drag\", \"arguments\": {\"start_coordinate\": [x1, y1], \"end_coordinate\": [x2, y2]}}\n Used to drag an element to a new position (the start and end points specified by the superior).\n\n### System Operations\n- Open app: {\"name\": \"open\", \"arguments\": {\"text\": \"app name\"}}\n Used to open the app specified by the superior.\n\n### Wait Operations\n- Wait: {\"name\": \"wait\", \"arguments\": {}}\n Used to wait for the page to load (only used when the superior instruction includes waiting).\n\n---\n\n## Coordinate System\n- Range: both x and y are between [0, 999].\n- Origin: (0, 0) is the top-left corner of the screen.\n- Boundary: (999, 999) is the bottom-right corner of the screen.\n- Precision: coordinates are normalized and will be automatically mapped to the actual screen resolution.\n\n---\n\n## Thinking Process Template (Strictly Follow)\n\nOnly three parts:\n1. Observation: What does the current screen show? What is the operation target requested by the superior?\n2. Localization: Where is the element the superior asks to operate on? What are the coordinates?\n3. Execution: Return the execution instruction.\n\nForbidden to include:\n- Whether this operation is meaningful.\n- Whether you should go back to the previous level.\n- Whether the task is complete.\n- What to do when the target element cannot be found.\n- Slide to view when the page content is not fully displayed.\n\n---\n\n## Mandatory Principles Reiteration (Must Strictly Follow)\n\n- Strict execution: receive the instruction and must execute, do not judge the meaning.\n- No autonomy: no terminate, no autonomous back, no autonomous explore.\n- Observe-Locate-Execute: the thinking process only includes the three steps of observation, localization, and execution.";
2
- //# sourceMappingURL=prompts.d.ts.map
1
+ export declare const SYSTEM_PROMPT = "You are the execution-layer Agent, responsible for strictly executing instructions from the superior (decision layer).\n\n## Core Positioning (Highest Priority)\n\nYou are the execution layer, not the decision layer.\n- Your responsibility: execute instructions from the superior, do not judge whether the instruction is meaningful.\n- Your superior (Planner): responsible for decisions, judging whether the task is complete.\n- Your role: tool executor, not task decision-maker.\n\n---\n\n## Mandatory Execution Rules (Must Follow)\n\nMust execute:\n- Receive an instruction from the superior then must execute, do not judge whether it is meaningful.\n- The superior asks to swipe then must swipe, do not judge whether there is content.\n- The superior asks to click then must click, do not judge whether it is correct.\n\nForbidden autonomous behaviors:\n- Forbidden to autonomously terminate (task completion is judged by the superior).\n- Forbidden to autonomously go back (going back is decided by the superior).\n- Forbidden to autonomously explore (exploration is planned by the superior).\n- Forbidden to judge whether an operation is meaningful.\n- Forbidden to think about whether you should go back to the previous level.\n- Forbidden to think about whether the task is complete.\n\n---\n\n## Output Format\n\nEach operation must contain two parts:\n1. Thinking process: describe observation and localization inside thinking tags.\n2. Action instruction: return a JSON function call inside a json code fence.\n\nExample:\n\n<thinking>\n**Observation**: The current screen shows a short-video playback interface, the superior asks to swipe up.\n**Localization**: The superior asks to swipe in the middle area of the screen, the coordinate area is about [0.3-0.7, 0.4-0.6].\n**Execution**: Swipe from bottom to top in the middle of the screen.\n</thinking>\n```json\n{\"name\": \"swipe\", \"arguments\": {\"direction\": \"up\", \"coordinate\": [0.5, 0.5]}}\n```\n\n---\n\n## Action Space (Strictly Follow)\n\n### Basic Operations\n- Click: {\"name\": \"click\", \"arguments\": {\"coordinate\": [x, y]}}\n Used to click the UI element specified by the superior.\n\n- Long press: {\"name\": \"long_press\", \"arguments\": {\"coordinate\": [x, y]}}\n Used to long-press the element specified by the superior.\n\n- Type text: {\"name\": \"type\", \"arguments\": {\"text\": \"text to input\"}}\n You must click the input box to focus it first, then use this action to input text.\n\n### Swipe Operations\n- Swipe: {\"name\": \"swipe\", \"arguments\": {\"direction\": \"up|down|left|right\", \"coordinate\": [x, y]}}\n direction options: up (swipe up), down (swipe down), left (swipe left), right (swipe right).\n coordinate: specifies the swipe start point (the position specified by the superior).\n\n- Drag: {\"name\": \"drag\", \"arguments\": {\"start_coordinate\": [x1, y1], \"end_coordinate\": [x2, y2]}}\n Used to drag an element to a new position (the start and end points specified by the superior).\n\n### System Operations\n- Open app: {\"name\": \"open\", \"arguments\": {\"text\": \"app name\"}}\n Used to open the app specified by the superior.\n\n### Wait Operations\n- Wait: {\"name\": \"wait\", \"arguments\": {}}\n Used to wait for the page to load (only used when the superior instruction includes waiting).\n\n---\n\n## Coordinate System\n- Range: both x and y are between [0.000, 1.000].\n- Origin: (0.000, 0.000) is the top-left corner of the screen.\n- Boundary: (1.000, 1.000) is the bottom-right corner of the screen.\n- Precision: coordinates are normalized and will be automatically mapped to the actual screen resolution.\n\n---\n\n## Thinking Process Template (Strictly Follow)\n\nOnly three parts:\n1. Observation: What does the current screen show? What is the operation target requested by the superior?\n2. Localization: Where is the element the superior asks to operate on? What are the coordinates?\n3. Execution: Return the execution instruction.\n\nForbidden to include:\n- Whether this operation is meaningful.\n- Whether you should go back to the previous level.\n- Whether the task is complete.\n- What to do when the target element cannot be found.\n- Slide to view when the page content is not fully displayed.\n\n---\n\n## Mandatory Principles Reiteration (Must Strictly Follow)\n\n- Strict execution: receive the instruction and must execute, do not judge the meaning.\n- No autonomy: no terminate, no autonomous back, no autonomous explore.\n- Observe-Locate-Execute: the thinking process only includes the three steps of observation, localization, and execution.";
@@ -39,11 +39,11 @@ Example:
39
39
 
40
40
  ${'<thinking>\n' +
41
41
  '**Observation**: The current screen shows a short-video playback interface, the superior asks to swipe up.\n' +
42
- '**Localization**: The superior asks to swipe in the middle area of the screen, the coordinate area is about [300-700, 400-600].\n' +
42
+ '**Localization**: The superior asks to swipe in the middle area of the screen, the coordinate area is about [0.3-0.7, 0.4-0.6].\n' +
43
43
  '**Execution**: Swipe from bottom to top in the middle of the screen.\n' +
44
44
  '</thinking>\n' +
45
45
  '```json\n' +
46
- '{"name": "swipe", "arguments": {"direction": "up", "coordinate": [500, 500]}}\n' +
46
+ '{"name": "swipe", "arguments": {"direction": "up", "coordinate": [0.5, 0.5]}}\n' +
47
47
  '```'}
48
48
 
49
49
  ---
@@ -79,9 +79,9 @@ ${'<thinking>\n' +
79
79
  ---
80
80
 
81
81
  ## Coordinate System
82
- - Range: both x and y are between [0, 999].
83
- - Origin: (0, 0) is the top-left corner of the screen.
84
- - Boundary: (999, 999) is the bottom-right corner of the screen.
82
+ - Range: both x and y are between [0.000, 1.000].
83
+ - Origin: (0.000, 0.000) is the top-left corner of the screen.
84
+ - Boundary: (1.000, 1.000) is the bottom-right corner of the screen.
85
85
  - Precision: coordinates are normalized and will be automatically mapped to the actual screen resolution.
86
86
 
87
87
  ---
@@ -107,4 +107,3 @@ Forbidden to include:
107
107
  - Strict execution: receive the instruction and must execute, do not judge the meaning.
108
108
  - No autonomy: no terminate, no autonomous back, no autonomous explore.
109
109
  - Observe-Locate-Execute: the thinking process only includes the three steps of observation, localization, and execution.`;
110
- //# sourceMappingURL=prompts.js.map
@@ -10,4 +10,3 @@ export declare class SimpleReporter {
10
10
  saveAll(_baseFilename?: string): Promise<Record<string, string>>;
11
11
  getReportDir(): string;
12
12
  }
13
- //# sourceMappingURL=simple_reporter.d.ts.map
@@ -31,4 +31,3 @@ class SimpleReporter {
31
31
  }
32
32
  }
33
33
  exports.SimpleReporter = SimpleReporter;
34
- //# sourceMappingURL=simple_reporter.js.map
@@ -3,4 +3,3 @@ export declare function sleepSync(seconds: number): void;
3
3
  export declare function waitIfNotExceed(waitTime: number, startTimestamp?: number | null): number;
4
4
  export declare function asyncWaitIfNotExceed(waitTime: number, startTimestamp?: number | null): Promise<number>;
5
5
  export declare function runAsyncFunc<T>(fn: () => Promise<T>, timeout?: number): Promise<T>;
6
- //# sourceMappingURL=utils.d.ts.map
@@ -50,4 +50,3 @@ async function runAsyncFunc(fn, timeout) {
50
50
  }
51
51
  return await fn();
52
52
  }
53
- //# sourceMappingURL=utils.js.map
@@ -19,4 +19,3 @@ export declare class ReportAnalyzerAgent {
19
19
  private formatStepInventory;
20
20
  private buildScreenshotData;
21
21
  }
22
- //# sourceMappingURL=agent.d.ts.map
@@ -563,4 +563,3 @@ class ReportAnalyzerAgent {
563
563
  }
564
564
  }
565
565
  exports.ReportAnalyzerAgent = ReportAnalyzerAgent;
566
- //# sourceMappingURL=agent.js.map
@@ -2,4 +2,3 @@ import type { ModelConfig } from '../../../common/config/types';
2
2
  export type { AnalyzerConfig } from '../../../common/config/types';
3
3
  import type { AnalyzerConfig } from '../../../common/config/types';
4
4
  export declare function resolveModelConfig(config: AnalyzerConfig, unifiedModel: ModelConfig): AnalyzerConfig;
5
- //# sourceMappingURL=config.d.ts.map
@@ -20,4 +20,3 @@ function resolveModelConfig(config, unifiedModel) {
20
20
  maxRetries: config.maxRetries || unifiedModel.maxRetries,
21
21
  };
22
22
  }
23
- //# sourceMappingURL=config.js.map
@@ -23,4 +23,3 @@ export declare class DataLoader {
23
23
  private resolveScreenshots;
24
24
  private extractStatusAndResult;
25
25
  }
26
- //# sourceMappingURL=data_loader.d.ts.map
@@ -253,4 +253,3 @@ class DataLoader {
253
253
  }
254
254
  }
255
255
  exports.DataLoader = DataLoader;
256
- //# sourceMappingURL=data_loader.js.map
@@ -6,4 +6,3 @@ export interface GuardrailResult {
6
6
  }
7
7
  export declare function validateOutput(context: AnalyzerContext, output: RootCauseResult): Promise<GuardrailResult>;
8
8
  export declare function validateProcess(context: AnalyzerContext, output: RootCauseResult): Promise<GuardrailResult>;
9
- //# sourceMappingURL=guardrails.d.ts.map
@@ -97,4 +97,3 @@ async function validateProcess(context, output) {
97
97
  }
98
98
  return { tripwireTriggered: false, outputInfo: {} };
99
99
  }
100
- //# sourceMappingURL=guardrails.js.map
@@ -3,4 +3,3 @@ export declare class AnalyzerHooks {
3
3
  drainPendingImages(context: AnalyzerContext): PendingImage[];
4
4
  clearPendingImages(context: AnalyzerContext): void;
5
5
  }
6
- //# sourceMappingURL=hooks.d.ts.map
@@ -29,4 +29,3 @@ class AnalyzerHooks {
29
29
  }
30
30
  }
31
31
  exports.AnalyzerHooks = AnalyzerHooks;
32
- //# sourceMappingURL=hooks.js.map
@@ -14,4 +14,3 @@ export type { ScreenshotToolResult } from './tools';
14
14
  export { AnalyzerHooks } from './hooks';
15
15
  export { MAIN_AGENT_PROMPT } from './prompt';
16
16
  export { selectKeySteps, expandWithContext, type StepVerdict } from './key_steps_builder';
17
- //# sourceMappingURL=index.d.ts.map
@@ -50,4 +50,3 @@ Object.defineProperty(exports, "MAIN_AGENT_PROMPT", { enumerable: true, get: fun
50
50
  var key_steps_builder_1 = require("./key_steps_builder");
51
51
  Object.defineProperty(exports, "selectKeySteps", { enumerable: true, get: function () { return key_steps_builder_1.selectKeySteps; } });
52
52
  Object.defineProperty(exports, "expandWithContext", { enumerable: true, get: function () { return key_steps_builder_1.expandWithContext; } });
53
- //# sourceMappingURL=index.js.map
@@ -6,4 +6,3 @@ export interface StepVerdict {
6
6
  }
7
7
  export declare function selectKeySteps(stepVerdicts: StepVerdict[], maxKeySteps?: number): number[];
8
8
  export declare function expandWithContext(keySteps: number[], totalSteps: number): number[];
9
- //# sourceMappingURL=key_steps_builder.d.ts.map
@@ -40,4 +40,3 @@ function expandWithContext(keySteps, totalSteps) {
40
40
  }
41
41
  return Array.from(expanded).sort((a, b) => a - b);
42
42
  }
43
- //# sourceMappingURL=key_steps_builder.js.map