android-midscene-automation 1.1.10 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (739) hide show
  1. package/README.md +11 -1773
  2. package/bin/android-midscene-automation.js +2 -104
  3. package/package.json +6 -76
  4. package/AI/350/257/206/345/210/253/346/223/215/344/275/234/350/257/264/346/230/216.md +0 -442
  5. package/CHANGELOG.md +0 -284
  6. package/FAQ.md +0 -105
  7. package/USAGE.md +0 -1085
  8. package/artemis-main/.dockerignore +0 -15
  9. package/artemis-main/.env.example +0 -34
  10. package/artemis-main/CONTRIBUTING.md +0 -35
  11. package/artemis-main/Dockerfile +0 -68
  12. package/artemis-main/LICENSE +0 -202
  13. package/artemis-main/Makefile +0 -115
  14. package/artemis-main/README.md +0 -322
  15. package/artemis-main/README_CN.md +0 -320
  16. package/artemis-main/apps/__init__.py +0 -15
  17. package/artemis-main/apps/admin_console/__init__.py +0 -19
  18. package/artemis-main/apps/admin_console/core/__init__.py +0 -13
  19. package/artemis-main/apps/admin_console/core/config.py +0 -43
  20. package/artemis-main/apps/admin_console/core/security.py +0 -178
  21. package/artemis-main/apps/admin_console/core/state.py +0 -243
  22. package/artemis-main/apps/admin_console/database/__init__.py +0 -13
  23. package/artemis-main/apps/admin_console/database/connection.py +0 -60
  24. package/artemis-main/apps/admin_console/database/repositories/__init__.py +0 -13
  25. package/artemis-main/apps/admin_console/database/repositories/session_repository.py +0 -564
  26. package/artemis-main/apps/admin_console/database/repositories/step_repository.py +0 -512
  27. package/artemis-main/apps/admin_console/database/repositories/trace_repository.py +0 -133
  28. package/artemis-main/apps/admin_console/index.html +0 -3787
  29. package/artemis-main/apps/admin_console/replay_manager.py +0 -2585
  30. package/artemis-main/apps/admin_console/routers/__init__.py +0 -13
  31. package/artemis-main/apps/admin_console/routers/media.py +0 -198
  32. package/artemis-main/apps/admin_console/routers/replay.py +0 -91
  33. package/artemis-main/apps/admin_console/routers/sessions.py +0 -239
  34. package/artemis-main/apps/admin_console/routers/steps.py +0 -109
  35. package/artemis-main/apps/admin_console/routers/stream.py +0 -56
  36. package/artemis-main/apps/admin_console/routers/system.py +0 -761
  37. package/artemis-main/apps/admin_console/routers/tasks.py +0 -517
  38. package/artemis-main/apps/admin_console/schemas/__init__.py +0 -13
  39. package/artemis-main/apps/admin_console/schemas/task_schema.py +0 -47
  40. package/artemis-main/apps/admin_console/server.py +0 -541
  41. package/artemis-main/apps/admin_console/services/__init__.py +0 -13
  42. package/artemis-main/apps/admin_console/services/device_stream_service.py +0 -137
  43. package/artemis-main/apps/admin_console/services/ipc_service.py +0 -262
  44. package/artemis-main/apps/admin_console/services/media_service.py +0 -623
  45. package/artemis-main/apps/admin_console/services/model_service.py +0 -148
  46. package/artemis-main/apps/admin_console/services/task_preset_catalog.py +0 -514
  47. package/artemis-main/apps/admin_console/services/task_queue_service.py +0 -1719
  48. package/artemis-main/apps/admin_console/services/worker_process_io.py +0 -144
  49. package/artemis-main/apps/showcase_ui/README.md +0 -31
  50. package/artemis-main/apps/showcase_ui/angular.json +0 -132
  51. package/artemis-main/apps/showcase_ui/package-lock.json +0 -9472
  52. package/artemis-main/apps/showcase_ui/package.json +0 -39
  53. package/artemis-main/apps/showcase_ui/proxy.conf.json +0 -23
  54. package/artemis-main/apps/showcase_ui/public/favicon.ico +0 -0
  55. package/artemis-main/apps/showcase_ui/public/logo.png +0 -0
  56. package/artemis-main/apps/showcase_ui/public/logo.svg +0 -56
  57. package/artemis-main/apps/showcase_ui/src/app/app.component.html +0 -24
  58. package/artemis-main/apps/showcase_ui/src/app/app.component.scss +0 -49
  59. package/artemis-main/apps/showcase_ui/src/app/app.component.spec.ts +0 -42
  60. package/artemis-main/apps/showcase_ui/src/app/app.component.ts +0 -32
  61. package/artemis-main/apps/showcase_ui/src/app/app.config.ts +0 -29
  62. package/artemis-main/apps/showcase_ui/src/app/app.routes.ts +0 -27
  63. package/artemis-main/apps/showcase_ui/src/app/components/agent-stream/agent-stream-startup.spec.ts +0 -108
  64. package/artemis-main/apps/showcase_ui/src/app/components/agent-stream/agent-stream.component.html +0 -1436
  65. package/artemis-main/apps/showcase_ui/src/app/components/agent-stream/agent-stream.component.scss +0 -3973
  66. package/artemis-main/apps/showcase_ui/src/app/components/agent-stream/agent-stream.component.ts +0 -2235
  67. package/artemis-main/apps/showcase_ui/src/app/components/chat-interface/chat-interface.component.html +0 -380
  68. package/artemis-main/apps/showcase_ui/src/app/components/chat-interface/chat-interface.component.scss +0 -1171
  69. package/artemis-main/apps/showcase_ui/src/app/components/chat-interface/chat-interface.component.ts +0 -270
  70. package/artemis-main/apps/showcase_ui/src/app/components/floating-video-player/floating-video-player.component.html +0 -433
  71. package/artemis-main/apps/showcase_ui/src/app/components/floating-video-player/floating-video-player.component.scss +0 -987
  72. package/artemis-main/apps/showcase_ui/src/app/components/floating-video-player/floating-video-player.component.ts +0 -632
  73. package/artemis-main/apps/showcase_ui/src/app/components/legacy-agent-stream/legacy-agent-stream.component.html +0 -130
  74. package/artemis-main/apps/showcase_ui/src/app/components/legacy-agent-stream/legacy-agent-stream.component.scss +0 -406
  75. package/artemis-main/apps/showcase_ui/src/app/components/legacy-agent-stream/legacy-agent-stream.component.ts +0 -74
  76. package/artemis-main/apps/showcase_ui/src/app/components/nav-switcher/nav-switcher.component.scss +0 -115
  77. package/artemis-main/apps/showcase_ui/src/app/components/nav-switcher/nav-switcher.component.ts +0 -52
  78. package/artemis-main/apps/showcase_ui/src/app/core/data/smart-tasks.data.ts +0 -334
  79. package/artemis-main/apps/showcase_ui/src/app/core/i18n/language.service.spec.ts +0 -55
  80. package/artemis-main/apps/showcase_ui/src/app/core/i18n/language.service.ts +0 -61
  81. package/artemis-main/apps/showcase_ui/src/app/core/i18n/translate.pipe.ts +0 -11
  82. package/artemis-main/apps/showcase_ui/src/app/core/i18n/zh-cn.ts +0 -651
  83. package/artemis-main/apps/showcase_ui/src/app/core/models/markdown.model.ts +0 -43
  84. package/artemis-main/apps/showcase_ui/src/app/core/models/pro-tuning.model.spec.ts +0 -47
  85. package/artemis-main/apps/showcase_ui/src/app/core/models/pro-tuning.model.ts +0 -165
  86. package/artemis-main/apps/showcase_ui/src/app/core/models/session.model.ts +0 -85
  87. package/artemis-main/apps/showcase_ui/src/app/core/models/stream.model.ts +0 -246
  88. package/artemis-main/apps/showcase_ui/src/app/core/models/system.model.ts +0 -118
  89. package/artemis-main/apps/showcase_ui/src/app/core/services/task-recommendation.service.ts +0 -111
  90. package/artemis-main/apps/showcase_ui/src/app/pages/home/home.component.html +0 -2130
  91. package/artemis-main/apps/showcase_ui/src/app/pages/home/home.component.scss +0 -5204
  92. package/artemis-main/apps/showcase_ui/src/app/pages/home/home.component.ts +0 -1189
  93. package/artemis-main/apps/showcase_ui/src/app/pages/legacy-workspace/legacy-workspace.component.html +0 -39
  94. package/artemis-main/apps/showcase_ui/src/app/pages/legacy-workspace/legacy-workspace.component.scss +0 -151
  95. package/artemis-main/apps/showcase_ui/src/app/pages/legacy-workspace/legacy-workspace.component.ts +0 -58
  96. package/artemis-main/apps/showcase_ui/src/app/pages/workspace/workspace.component.html +0 -201
  97. package/artemis-main/apps/showcase_ui/src/app/pages/workspace/workspace.component.scss +0 -886
  98. package/artemis-main/apps/showcase_ui/src/app/pages/workspace/workspace.component.ts +0 -324
  99. package/artemis-main/apps/showcase_ui/src/app/services/agent.service.spec.ts +0 -418
  100. package/artemis-main/apps/showcase_ui/src/app/services/agent.service.ts +0 -2012
  101. package/artemis-main/apps/showcase_ui/src/app/services/system.service.spec.ts +0 -173
  102. package/artemis-main/apps/showcase_ui/src/app/services/system.service.ts +0 -620
  103. package/artemis-main/apps/showcase_ui/src/app/utils/action-formatter.util.spec.ts +0 -513
  104. package/artemis-main/apps/showcase_ui/src/app/utils/action-formatter.util.ts +0 -1015
  105. package/artemis-main/apps/showcase_ui/src/app/utils/image-overlay.util.spec.ts +0 -85
  106. package/artemis-main/apps/showcase_ui/src/app/utils/image-overlay.util.ts +0 -662
  107. package/artemis-main/apps/showcase_ui/src/app/utils/markdown-parser.util.spec.ts +0 -70
  108. package/artemis-main/apps/showcase_ui/src/app/utils/markdown-parser.util.ts +0 -383
  109. package/artemis-main/apps/showcase_ui/src/app/utils/recording-timeline.util.spec.ts +0 -107
  110. package/artemis-main/apps/showcase_ui/src/app/utils/recording-timeline.util.ts +0 -123
  111. package/artemis-main/apps/showcase_ui/src/app/utils/run-info.util.spec.ts +0 -92
  112. package/artemis-main/apps/showcase_ui/src/app/utils/run-info.util.ts +0 -116
  113. package/artemis-main/apps/showcase_ui/src/app/utils/stream-aggregator.util.spec.ts +0 -640
  114. package/artemis-main/apps/showcase_ui/src/app/utils/stream-aggregator.util.ts +0 -1021
  115. package/artemis-main/apps/showcase_ui/src/app/utils/tool-formatter.util.spec.ts +0 -375
  116. package/artemis-main/apps/showcase_ui/src/app/utils/tool-formatter.util.ts +0 -1419
  117. package/artemis-main/apps/showcase_ui/src/index.html +0 -37
  118. package/artemis-main/apps/showcase_ui/src/main.ts +0 -22
  119. package/artemis-main/apps/showcase_ui/src/styles.scss +0 -60
  120. package/artemis-main/apps/showcase_ui/tsconfig.app.json +0 -23
  121. package/artemis-main/apps/showcase_ui/tsconfig.json +0 -27
  122. package/artemis-main/apps/showcase_ui/tsconfig.spec.json +0 -23
  123. package/artemis-main/artemis/__init__.py +0 -44
  124. package/artemis-main/artemis/__main__.py +0 -18
  125. package/artemis-main/artemis/_legacy_imports.py +0 -94
  126. package/artemis-main/artemis/_version.py +0 -30
  127. package/artemis-main/artemis/agents/__init__.py +0 -17
  128. package/artemis-main/artemis/agents/checker/checker.json +0 -9
  129. package/artemis-main/artemis/agents/checker/checker.py +0 -859
  130. package/artemis-main/artemis/agents/diagnoser/diagnoser.json +0 -23
  131. package/artemis-main/artemis/agents/diagnoser/diagnoser.py +0 -608
  132. package/artemis-main/artemis/agents/explorer/constants.py +0 -52
  133. package/artemis-main/artemis/agents/explorer/explorer.json +0 -57
  134. package/artemis-main/artemis/agents/explorer/explorer.py +0 -473
  135. package/artemis-main/artemis/agents/explorer/geometry.py +0 -73
  136. package/artemis-main/artemis/agents/explorer/native_runner.py +0 -878
  137. package/artemis-main/artemis/agents/explorer/perception_tools.py +0 -632
  138. package/artemis-main/artemis/agents/explorer/run_setup.py +0 -403
  139. package/artemis-main/artemis/agents/explorer/screen_index.py +0 -266
  140. package/artemis-main/artemis/agents/explorer/tiers.py +0 -110
  141. package/artemis-main/artemis/agents/explorer/tool_declarations.py +0 -394
  142. package/artemis-main/artemis/agents/explorer/universal_runner.py +0 -317
  143. package/artemis-main/artemis/agents/flash/context_compressor.py +0 -452
  144. package/artemis-main/artemis/agents/flash/flash_runner.md +0 -51
  145. package/artemis-main/artemis/agents/flash/flash_summarizer.md +0 -53
  146. package/artemis-main/artemis/agents/flash/flash_summarizer_single.md +0 -54
  147. package/artemis-main/artemis/agents/flash/runner.py +0 -1167
  148. package/artemis-main/artemis/agents/flash/summarizer.py +0 -511
  149. package/artemis-main/artemis/agents/history_analyzer/history_analyzer.md +0 -8
  150. package/artemis-main/artemis/agents/history_analyzer/history_analyzer.py +0 -182
  151. package/artemis-main/artemis/agents/image_processor/image_processor.md +0 -74
  152. package/artemis-main/artemis/agents/image_processor/image_processor.py +0 -322
  153. package/artemis-main/artemis/agents/log_analyzer/log_analyzer.md +0 -15
  154. package/artemis-main/artemis/agents/log_analyzer/log_analyzer.py +0 -403
  155. package/artemis-main/artemis/agents/log_analyzer/log_reader_sub_agent.md +0 -8
  156. package/artemis-main/artemis/agents/log_analyzer/output_analyzer.md +0 -11
  157. package/artemis-main/artemis/agents/log_analyzer/output_analyzer.py +0 -163
  158. package/artemis-main/artemis/agents/object_detector/object_detector.json +0 -9
  159. package/artemis-main/artemis/agents/object_detector/object_detector.py +0 -211
  160. package/artemis-main/artemis/agents/operator/operator.json +0 -3
  161. package/artemis-main/artemis/agents/operator/operator.py +0 -1394
  162. package/artemis-main/artemis/agents/operator/prompts.py +0 -1064
  163. package/artemis-main/artemis/agents/outputter/outputter.md +0 -36
  164. package/artemis-main/artemis/agents/outputter/outputter.py +0 -552
  165. package/artemis-main/artemis/agents/planner/planner.json +0 -32
  166. package/artemis-main/artemis/agents/planner/planner.py +0 -436
  167. package/artemis-main/artemis/agents/prompt_assembly.py +0 -79
  168. package/artemis-main/artemis/agents/summarizer/summarizer.py +0 -190
  169. package/artemis-main/artemis/agents/validator/action_execution.py +0 -98
  170. package/artemis-main/artemis/agents/validator/categories.py +0 -33
  171. package/artemis-main/artemis/agents/validator/execution_loop.py +0 -488
  172. package/artemis-main/artemis/agents/validator/incidents.py +0 -120
  173. package/artemis-main/artemis/agents/validator/pixel_safety_net.md +0 -15
  174. package/artemis-main/artemis/agents/validator/precondition_pixel.py +0 -320
  175. package/artemis-main/artemis/agents/validator/precondition_xml.py +0 -672
  176. package/artemis-main/artemis/agents/validator/tool_declarations.py +0 -332
  177. package/artemis-main/artemis/agents/validator/validator.py +0 -188
  178. package/artemis-main/artemis/agents/video_analyzer/__init__.py +0 -15
  179. package/artemis-main/artemis/agents/video_analyzer/audio_native.py +0 -543
  180. package/artemis-main/artemis/agents/video_analyzer/blackboard.py +0 -821
  181. package/artemis-main/artemis/agents/video_analyzer/chunk_agentic.py +0 -455
  182. package/artemis-main/artemis/agents/video_analyzer/chunk_conversation.py +0 -491
  183. package/artemis-main/artemis/agents/video_analyzer/chunk_native.py +0 -437
  184. package/artemis-main/artemis/agents/video_analyzer/conflict_resolution.py +0 -137
  185. package/artemis-main/artemis/agents/video_analyzer/gemini_files.py +0 -162
  186. package/artemis-main/artemis/agents/video_analyzer/native_coordinator.py +0 -541
  187. package/artemis-main/artemis/agents/video_analyzer/reliability.py +0 -128
  188. package/artemis-main/artemis/agents/video_analyzer/universal_engine.py +0 -487
  189. package/artemis-main/artemis/agents/video_analyzer/universal_tools.py +0 -323
  190. package/artemis-main/artemis/agents/video_analyzer/video_analyzer.md +0 -51
  191. package/artemis-main/artemis/agents/video_analyzer/video_analyzer.py +0 -875
  192. package/artemis-main/artemis/agents/video_analyzer/video_sub_agent.md +0 -15
  193. package/artemis-main/artemis/agents/video_analyzer/video_sub_agent_audio.md +0 -12
  194. package/artemis-main/artemis/clients/accessibility_client.py +0 -438
  195. package/artemis-main/artemis/clients/screen_client_factory.py +0 -403
  196. package/artemis-main/artemis/config/__init__.py +0 -309
  197. package/artemis-main/artemis/config/agent.py +0 -1098
  198. package/artemis-main/artemis/config/constants.py +0 -151
  199. package/artemis-main/artemis/config/core/__init__.py +0 -24
  200. package/artemis-main/artemis/config/core/engine.py +0 -118
  201. package/artemis-main/artemis/config/core/interpolator.py +0 -78
  202. package/artemis-main/artemis/config/llm.py +0 -267
  203. package/artemis-main/artemis/config/paths.py +0 -244
  204. package/artemis-main/artemis/config/runtime.py +0 -197
  205. package/artemis-main/artemis/config/settings.py +0 -315
  206. package/artemis-main/artemis/constants.py +0 -47
  207. package/artemis-main/artemis/context.py +0 -289
  208. package/artemis-main/artemis/controllers/__init__.py +0 -41
  209. package/artemis-main/artemis/controllers/controller_factory.py +0 -41
  210. package/artemis-main/artemis/controllers/device_controller.py +0 -29
  211. package/artemis-main/artemis/controllers/types.py +0 -37
  212. package/artemis-main/artemis/controllers/unified_controller.py +0 -649
  213. package/artemis-main/artemis/core/__init__.py +0 -21
  214. package/artemis-main/artemis/core/diagnostics/__init__.py +0 -90
  215. package/artemis-main/artemis/core/diagnostics/adb_keys.py +0 -270
  216. package/artemis-main/artemis/core/diagnostics/adb_server_connection.py +0 -330
  217. package/artemis-main/artemis/core/diagnostics/device_smoke.py +0 -364
  218. package/artemis-main/artemis/core/diagnostics/emulator_manager.py +0 -501
  219. package/artemis-main/artemis/core/diagnostics/engine.py +0 -438
  220. package/artemis-main/artemis/core/diagnostics/hierarchy_parity.py +0 -216
  221. package/artemis-main/artemis/core/diagnostics/probes/adb_probe.py +0 -887
  222. package/artemis-main/artemis/core/diagnostics/probes/base.py +0 -45
  223. package/artemis-main/artemis/core/diagnostics/probes/credentials_probe.py +0 -296
  224. package/artemis-main/artemis/core/diagnostics/probes/host_probe.py +0 -427
  225. package/artemis-main/artemis/core/diagnostics/probes/runtime_probe.py +0 -169
  226. package/artemis-main/artemis/core/diagnostics/probes/toolchain_probe.py +0 -139
  227. package/artemis-main/artemis/core/diagnostics/readiness.py +0 -83
  228. package/artemis-main/artemis/core/diagnostics/schema.py +0 -118
  229. package/artemis-main/artemis/core/tool_declaration.py +0 -43
  230. package/artemis-main/artemis/core/tool_failure.py +0 -56
  231. package/artemis-main/artemis/data_engine/context_vars.py +0 -24
  232. package/artemis-main/artemis/data_engine/engine.py +0 -1615
  233. package/artemis-main/artemis/data_engine/history_reader.py +0 -142
  234. package/artemis-main/artemis/data_engine/models.py +0 -131
  235. package/artemis-main/artemis/data_engine/storage.py +0 -1245
  236. package/artemis-main/artemis/data_engine/trace.py +0 -727
  237. package/artemis-main/artemis/drivers/__init__.py +0 -48
  238. package/artemis-main/artemis/drivers/android/adb_driver.py +0 -507
  239. package/artemis-main/artemis/drivers/android/hierarchy.py +0 -64
  240. package/artemis-main/artemis/drivers/android/input_ime.py +0 -120
  241. package/artemis-main/artemis/drivers/android/recorder.py +0 -57
  242. package/artemis-main/artemis/drivers/base.py +0 -290
  243. package/artemis-main/artemis/drivers/cloud/cloud_driver.py +0 -117
  244. package/artemis-main/artemis/drivers/factory.py +0 -80
  245. package/artemis-main/artemis/drivers/mock/mock_driver.py +0 -198
  246. package/artemis-main/artemis/drivers/types.py +0 -67
  247. package/artemis-main/artemis/graph/checkpoints.py +0 -1243
  248. package/artemis-main/artemis/graph/graph.py +0 -1055
  249. package/artemis-main/artemis/graph/perception.py +0 -234
  250. package/artemis-main/artemis/graph/state.py +0 -151
  251. package/artemis-main/artemis/graph/visibility.py +0 -238
  252. package/artemis-main/artemis/interfaces/cli/__init__.py +0 -19
  253. package/artemis-main/artemis/interfaces/cli/commands/__init__.py +0 -15
  254. package/artemis-main/artemis/interfaces/cli/commands/batch.py +0 -278
  255. package/artemis-main/artemis/interfaces/cli/commands/doctor.py +0 -468
  256. package/artemis-main/artemis/interfaces/cli/commands/helper.py +0 -226
  257. package/artemis-main/artemis/interfaces/cli/commands/init.py +0 -193
  258. package/artemis-main/artemis/interfaces/cli/commands/mcp.py +0 -862
  259. package/artemis-main/artemis/interfaces/cli/commands/run.py +0 -463
  260. package/artemis-main/artemis/interfaces/cli/commands/server.py +0 -151
  261. package/artemis-main/artemis/interfaces/cli/commands/server_lifecycle.py +0 -328
  262. package/artemis-main/artemis/interfaces/cli/commands/trace.py +0 -111
  263. package/artemis-main/artemis/interfaces/cli/commands/ui.py +0 -404
  264. package/artemis-main/artemis/interfaces/cli/main.py +0 -109
  265. package/artemis-main/artemis/interfaces/sdk/__init__.py +0 -31
  266. package/artemis-main/artemis/interfaces/sdk/client.py +0 -19
  267. package/artemis-main/artemis/interfaces/sdk/task.py +0 -72
  268. package/artemis-main/artemis/llm/__init__.py +0 -25
  269. package/artemis-main/artemis/llm/fake_model.py +0 -179
  270. package/artemis-main/artemis/llm/google/__init__.py +0 -57
  271. package/artemis-main/artemis/llm/google/provider.py +0 -185
  272. package/artemis-main/artemis/llm/google/usage.py +0 -148
  273. package/artemis-main/artemis/llm/parser.py +0 -32
  274. package/artemis-main/artemis/llm/reliability.py +0 -267
  275. package/artemis-main/artemis/llm/router.py +0 -389
  276. package/artemis-main/artemis/llm/schemas.py +0 -36
  277. package/artemis-main/artemis/llm/structured.py +0 -196
  278. package/artemis-main/artemis/main.py +0 -58
  279. package/artemis-main/artemis/mcp/__init__.py +0 -20
  280. package/artemis-main/artemis/mcp/action_executor.py +0 -760
  281. package/artemis-main/artemis/mcp/action_manifest.py +0 -320
  282. package/artemis-main/artemis/mcp/action_names.py +0 -172
  283. package/artemis-main/artemis/mcp/action_server.py +0 -202
  284. package/artemis-main/artemis/mcp/action_session.py +0 -245
  285. package/artemis-main/artemis/mcp/action_specs.py +0 -868
  286. package/artemis-main/artemis/mcp/action_types.py +0 -86
  287. package/artemis-main/artemis/mcp/actuators/__init__.py +0 -21
  288. package/artemis-main/artemis/mcp/actuators/adb.py +0 -414
  289. package/artemis-main/artemis/mcp/actuators/base.py +0 -113
  290. package/artemis-main/artemis/mcp/actuators/mock.py +0 -70
  291. package/artemis-main/artemis/mcp/adb_server.py +0 -490
  292. package/artemis-main/artemis/mcp/observation.py +0 -133
  293. package/artemis-main/artemis/mcp/xml_search_server.py +0 -297
  294. package/artemis-main/artemis/memory/__init__.py +0 -90
  295. package/artemis-main/artemis/memory/chunking.py +0 -1843
  296. package/artemis-main/artemis/memory/context_policy.py +0 -226
  297. package/artemis-main/artemis/memory/step_capsule.md +0 -73
  298. package/artemis-main/artemis/memory/step_memory.py +0 -281
  299. package/artemis-main/artemis/memory/transcript.py +0 -798
  300. package/artemis-main/artemis/platform/__init__.py +0 -61
  301. package/artemis-main/artemis/platform/base.py +0 -104
  302. package/artemis-main/artemis/platform/darwin.py +0 -184
  303. package/artemis-main/artemis/platform/linux.py +0 -207
  304. package/artemis-main/artemis/platform/windows.py +0 -193
  305. package/artemis-main/artemis/resources/__init__.py +0 -46
  306. package/artemis-main/artemis/runtime/__init__.py +0 -108
  307. package/artemis-main/artemis/runtime/adb_endpoint.py +0 -173
  308. package/artemis-main/artemis/runtime/awake_lease.py +0 -283
  309. package/artemis-main/artemis/runtime/awake_service.py +0 -343
  310. package/artemis-main/artemis/runtime/cancel_requests.py +0 -254
  311. package/artemis-main/artemis/runtime/daemon_client.py +0 -422
  312. package/artemis-main/artemis/runtime/device_lock.py +0 -1013
  313. package/artemis-main/artemis/runtime/device_pool.py +0 -478
  314. package/artemis-main/artemis/runtime/helper_manager.py +0 -1030
  315. package/artemis-main/artemis/runtime/process_probe.py +0 -98
  316. package/artemis-main/artemis/runtime/server_lifecycle.py +0 -435
  317. package/artemis-main/artemis/runtime/supervisor.py +0 -121
  318. package/artemis-main/artemis/runtime/trace_store.py +0 -375
  319. package/artemis-main/artemis/sdk/__init__.py +0 -26
  320. package/artemis-main/artemis/sdk/agent.py +0 -485
  321. package/artemis-main/artemis/sdk/builders/__init__.py +0 -29
  322. package/artemis-main/artemis/sdk/builders/agent_config_builder.py +0 -474
  323. package/artemis-main/artemis/sdk/constants.py +0 -15
  324. package/artemis-main/artemis/sdk/run_outcome.py +0 -58
  325. package/artemis-main/artemis/sdk/types/__init__.py +0 -61
  326. package/artemis-main/artemis/sdk/types/agent.py +0 -89
  327. package/artemis-main/artemis/sdk/utils.py +0 -28
  328. package/artemis-main/artemis/services/llm.py +0 -1040
  329. package/artemis-main/artemis/services/token_meter.py +0 -267
  330. package/artemis-main/artemis/telemetry/__init__.py +0 -35
  331. package/artemis-main/artemis/telemetry/models.py +0 -64
  332. package/artemis-main/artemis/telemetry/replay.py +0 -34
  333. package/artemis-main/artemis/telemetry/storage/json_storage.py +0 -47
  334. package/artemis-main/artemis/telemetry/tracer.py +0 -85
  335. package/artemis-main/artemis/toolchain/__init__.py +0 -52
  336. package/artemis-main/artemis/toolchain/descriptors.py +0 -92
  337. package/artemis-main/artemis/toolchain/resolver.py +0 -185
  338. package/artemis-main/artemis/tools/base.py +0 -232
  339. package/artemis-main/artemis/tools/command_tool.py +0 -1240
  340. package/artemis-main/artemis/tools/committee_prompts.json +0 -5
  341. package/artemis-main/artemis/tools/committee_tool.py +0 -422
  342. package/artemis-main/artemis/tools/diagnoser_submit_answer_tool.py +0 -87
  343. package/artemis-main/artemis/tools/diagnostic_tool.py +0 -120
  344. package/artemis-main/artemis/tools/explorer_tool.py +0 -581
  345. package/artemis-main/artemis/tools/history/__init__.py +0 -398
  346. package/artemis-main/artemis/tools/history/replay.py +0 -120
  347. package/artemis-main/artemis/tools/history/screenshot.py +0 -139
  348. package/artemis-main/artemis/tools/history/search.py +0 -563
  349. package/artemis-main/artemis/tools/image_processor_tool.py +0 -124
  350. package/artemis-main/artemis/tools/index.py +0 -47
  351. package/artemis-main/artemis/tools/log_tool.py +0 -108
  352. package/artemis-main/artemis/tools/mobile/launch_app.py +0 -132
  353. package/artemis-main/artemis/tools/mobile/log_utils.py +0 -138
  354. package/artemis-main/artemis/tools/mobile/ocr.py +0 -202
  355. package/artemis-main/artemis/tools/mobile/read_hierarchy.py +0 -108
  356. package/artemis-main/artemis/tools/mobile/read_logs.py +0 -116
  357. package/artemis-main/artemis/tools/mobile/search_logs.py +0 -260
  358. package/artemis-main/artemis/tools/object_detection_tool.py +0 -244
  359. package/artemis-main/artemis/tools/scratchpad.py +0 -819
  360. package/artemis-main/artemis/tools/system/adb_shell.py +0 -31
  361. package/artemis-main/artemis/tools/tool_wrapper.py +0 -270
  362. package/artemis-main/artemis/tools/video_tool.py +0 -261
  363. package/artemis-main/artemis/tools/wait_tool.py +0 -97
  364. package/artemis-main/artemis/utils/app_launch_utils.py +0 -207
  365. package/artemis-main/artemis/utils/coordinates.py +0 -606
  366. package/artemis-main/artemis/utils/credentials_validator.py +0 -201
  367. package/artemis-main/artemis/utils/cv_canvas.py +0 -189
  368. package/artemis-main/artemis/utils/cython_compat.py +0 -45
  369. package/artemis-main/artemis/utils/element_hit_test.py +0 -80
  370. package/artemis-main/artemis/utils/image_diff.py +0 -335
  371. package/artemis-main/artemis/utils/image_hash.py +0 -80
  372. package/artemis-main/artemis/utils/notes.py +0 -470
  373. package/artemis-main/artemis/utils/ocr_api.py +0 -105
  374. package/artemis-main/artemis/utils/ocr_xml_fusion.py +0 -318
  375. package/artemis-main/artemis/utils/plan_grammar.py +0 -513
  376. package/artemis-main/artemis/utils/python_executor.py +0 -213
  377. package/artemis-main/artemis/utils/startup_progress.py +0 -60
  378. package/artemis-main/artemis/utils/task_tree.py +0 -1174
  379. package/artemis-main/artemis/utils/text.py +0 -37
  380. package/artemis-main/artemis/utils/ui_filter.py +0 -651
  381. package/artemis-main/artemis/utils/video.py +0 -685
  382. package/artemis-main/artemis/utils/visualization.py +0 -802
  383. package/artemis-main/config/artemis.example.jsonc +0 -12
  384. package/artemis-main/mcp_server/README.md +0 -111
  385. package/artemis-main/mcp_server/__init__.py +0 -21
  386. package/artemis-main/mcp_server/__main__.py +0 -20
  387. package/artemis-main/mcp_server/background/__init__.py +0 -15
  388. package/artemis-main/mcp_server/background/task_runner.py +0 -453
  389. package/artemis-main/mcp_server/base.py +0 -49
  390. package/artemis-main/mcp_server/notifiers/__init__.py +0 -74
  391. package/artemis-main/mcp_server/notifiers/agentapi.py +0 -289
  392. package/artemis-main/mcp_server/notifiers/base.py +0 -45
  393. package/artemis-main/mcp_server/notifiers/composite.py +0 -87
  394. package/artemis-main/mcp_server/notifiers/desktop.py +0 -108
  395. package/artemis-main/mcp_server/notifiers/file.py +0 -69
  396. package/artemis-main/mcp_server/notifiers/script.py +0 -90
  397. package/artemis-main/mcp_server/notifiers/webhook.py +0 -87
  398. package/artemis-main/mcp_server/rules.md +0 -68
  399. package/artemis-main/mcp_server/server.py +0 -106
  400. package/artemis-main/mcp_server/tools/__init__.py +0 -29
  401. package/artemis-main/mcp_server/tools/device_state.py +0 -107
  402. package/artemis-main/mcp_server/tools/diagnose.py +0 -1249
  403. package/artemis-main/mcp_server/tools/inspect_trace.py +0 -394
  404. package/artemis-main/mcp_server/tools/task_manager.py +0 -627
  405. package/artemis-main/mcp_server/tools/task_runner.py +0 -548
  406. package/artemis-main/mcp_server/utils/__init__.py +0 -15
  407. package/artemis-main/mcp_server/utils/device_utils.py +0 -180
  408. package/artemis-main/mcp_server/utils/env_utils.py +0 -65
  409. package/artemis-main/packages/artemis-accessibility-helper/ArtemisAccessibilityHelper.apk +0 -0
  410. package/artemis-main/packages/artemis-accessibility-helper/app/build.gradle.kts +0 -35
  411. package/artemis-main/packages/artemis-accessibility-helper/app/src/main/AndroidManifest.xml +0 -49
  412. package/artemis-main/packages/artemis-accessibility-helper/app/src/main/java/com/artemis/helper/A11yNode.java +0 -274
  413. package/artemis-main/packages/artemis-accessibility-helper/app/src/main/java/com/artemis/helper/ArtemisAccessibilityService.java +0 -227
  414. package/artemis-main/packages/artemis-accessibility-helper/app/src/main/java/com/artemis/helper/CommandServer.java +0 -463
  415. package/artemis-main/packages/artemis-accessibility-helper/app/src/main/java/com/artemis/helper/DisplayUtils.java +0 -111
  416. package/artemis-main/packages/artemis-accessibility-helper/app/src/main/java/com/artemis/helper/GestureController.java +0 -232
  417. package/artemis-main/packages/artemis-accessibility-helper/app/src/main/java/com/artemis/helper/HierarchyDumper.java +0 -832
  418. package/artemis-main/packages/artemis-accessibility-helper/app/src/main/java/com/artemis/helper/TokenReceiver.java +0 -36
  419. package/artemis-main/packages/artemis-accessibility-helper/app/src/main/java/com/artemis/helper/TokenStore.java +0 -38
  420. package/artemis-main/packages/artemis-accessibility-helper/app/src/main/java/com/artemis/helper/XmlUtils.java +0 -102
  421. package/artemis-main/packages/artemis-accessibility-helper/app/src/main/res/values/strings.xml +0 -4
  422. package/artemis-main/packages/artemis-accessibility-helper/app/src/main/res/xml/accessibility_service_config.xml +0 -10
  423. package/artemis-main/packages/artemis-accessibility-helper/build.gradle.kts +0 -3
  424. package/artemis-main/packages/artemis-accessibility-helper/build_apk.sh +0 -215
  425. package/artemis-main/packages/artemis-accessibility-helper/debug.keystore +0 -0
  426. package/artemis-main/packages/artemis-accessibility-helper/gradle.properties +0 -2
  427. package/artemis-main/packages/artemis-accessibility-helper/helper_manifest.json +0 -7
  428. package/artemis-main/packages/artemis-accessibility-helper/settings.gradle.kts +0 -17
  429. package/artemis-main/packages/artemis-client/DESIGN.md +0 -89
  430. package/artemis-main/packages/artemis-client/README.md +0 -112
  431. package/artemis-main/packages/artemis-client/examples/basic.py +0 -30
  432. package/artemis-main/packages/artemis-client/pyproject.toml +0 -36
  433. package/artemis-main/packages/artemis-client/src/artemis_client/__init__.py +0 -45
  434. package/artemis-main/packages/artemis-client/src/artemis_client/client.py +0 -401
  435. package/artemis-main/packages/artemis-client/src/artemis_client/errors.py +0 -66
  436. package/artemis-main/packages/artemis-client/src/artemis_client/models.py +0 -212
  437. package/artemis-main/packages/artemis-client/src/artemis_client/py.typed +0 -1
  438. package/artemis-main/packages/artemis-client/src/artemis_client/transport.py +0 -134
  439. package/artemis-main/packages/artemis-client/tests/test_client.py +0 -289
  440. package/artemis-main/packages/artemis-client/tests/test_transport.py +0 -85
  441. package/artemis-main/pyproject.toml +0 -259
  442. package/artemis-main/pyright-core.json +0 -17
  443. package/artemis-main/scripts/check_dependency_sources.py +0 -68
  444. package/artemis-main/scripts/install_deps.ps1 +0 -520
  445. package/artemis-main/scripts/install_deps.sh +0 -533
  446. package/artemis-main/scripts/quality_ratchet.py +0 -97
  447. package/artemis-main/scripts/real_device_video_acceptance.py +0 -483
  448. package/artemis-main/scripts/run_edge_case_part.py +0 -327
  449. package/artemis-main/scripts/run_ui.py +0 -242
  450. package/artemis-main/scripts/start.ps1 +0 -500
  451. package/artemis-main/scripts/test_all_edge_cases.py +0 -269
  452. package/artemis-main/scripts/verify_concurrency_and_devices.py +0 -385
  453. package/artemis-main/setup.py +0 -164
  454. package/artemis-main/start.bat +0 -35
  455. package/artemis-main/start.sh +0 -423
  456. package/artemis-main/third_party/mobile_use/LICENSE +0 -190
  457. package/artemis-main/third_party/mobile_use/METADATA +0 -27
  458. package/artemis-main/third_party/mobile_use/NOTICE +0 -12
  459. package/artemis-main/third_party/mobile_use/__init__.py +0 -19
  460. package/artemis-main/third_party/mobile_use/agents/__init__.py +0 -13
  461. package/artemis-main/third_party/mobile_use/agents/hopper/__init__.py +0 -13
  462. package/artemis-main/third_party/mobile_use/agents/hopper/hopper.md +0 -22
  463. package/artemis-main/third_party/mobile_use/agents/hopper/hopper.py +0 -80
  464. package/artemis-main/third_party/mobile_use/clients/__init__.py +0 -13
  465. package/artemis-main/third_party/mobile_use/clients/ui_automator_client.py +0 -482
  466. package/artemis-main/third_party/mobile_use/config/__init__.py +0 -13
  467. package/artemis-main/third_party/mobile_use/config/llm.py +0 -183
  468. package/artemis-main/third_party/mobile_use/config/output.py +0 -184
  469. package/artemis-main/third_party/mobile_use/context.py +0 -119
  470. package/artemis-main/third_party/mobile_use/controllers/__init__.py +0 -13
  471. package/artemis-main/third_party/mobile_use/controllers/platform_specific_commands_controller.py +0 -151
  472. package/artemis-main/third_party/mobile_use/controllers/types.py +0 -92
  473. package/artemis-main/third_party/mobile_use/controllers/unified_controller.py +0 -183
  474. package/artemis-main/third_party/mobile_use/graph.py +0 -54
  475. package/artemis-main/third_party/mobile_use/llm_service.py +0 -193
  476. package/artemis-main/third_party/mobile_use/main.py +0 -130
  477. package/artemis-main/third_party/mobile_use/sdk/__init__.py +0 -13
  478. package/artemis-main/third_party/mobile_use/sdk/agent.py +0 -1060
  479. package/artemis-main/third_party/mobile_use/sdk/builders/__init__.py +0 -13
  480. package/artemis-main/third_party/mobile_use/sdk/builders/agent_config_builder.py +0 -225
  481. package/artemis-main/third_party/mobile_use/sdk/builders/index.py +0 -33
  482. package/artemis-main/third_party/mobile_use/sdk/builders/task_request_builder.py +0 -243
  483. package/artemis-main/third_party/mobile_use/sdk/types/__init__.py +0 -13
  484. package/artemis-main/third_party/mobile_use/sdk/types/agent.py +0 -98
  485. package/artemis-main/third_party/mobile_use/sdk/types/exceptions.py +0 -109
  486. package/artemis-main/third_party/mobile_use/sdk/types/task.py +0 -234
  487. package/artemis-main/third_party/mobile_use/testing.py +0 -59
  488. package/artemis-main/third_party/mobile_use/tools/__init__.py +0 -13
  489. package/artemis-main/third_party/mobile_use/tools/index.py +0 -44
  490. package/artemis-main/third_party/mobile_use/tools/mobile/__init__.py +0 -13
  491. package/artemis-main/third_party/mobile_use/tools/mobile/launch_app.py +0 -89
  492. package/artemis-main/third_party/mobile_use/tools/tool_wrapper.py +0 -52
  493. package/artemis-main/third_party/mobile_use/utils/__init__.py +0 -13
  494. package/artemis-main/third_party/mobile_use/utils/app_launch_utils.py +0 -217
  495. package/artemis-main/third_party/mobile_use/utils/cli_helpers.py +0 -60
  496. package/artemis-main/third_party/mobile_use/utils/decorators.py +0 -158
  497. package/artemis-main/third_party/mobile_use/utils/file.py +0 -31
  498. package/artemis-main/third_party/mobile_use/utils/logger.py +0 -216
  499. package/artemis-main/third_party/mobile_use/utils/media.py +0 -213
  500. package/artemis-main/third_party/mobile_use/utils/shell_utils.py +0 -39
  501. package/artemis-main/third_party/mobile_use/utils/video.py +0 -398
  502. package/artemis-main/uv.lock +0 -4908
  503. package/bin/artemis-config.mjs +0 -15
  504. package/bin/artemis-embedded.py +0 -56
  505. package/bin/start-artemis.mjs +0 -30
  506. package/bin/start-dev.mjs +0 -112
  507. package/bin/sync-readme-docs.mjs +0 -49
  508. package/bin/test_artemis_embedded.py +0 -44
  509. package/index.html +0 -12
  510. package/remote-agent/index.ts +0 -232
  511. package/server/analytics.test.ts +0 -46
  512. package/server/analytics.ts +0 -24
  513. package/server/android-device-info.ts +0 -28
  514. package/server/android-sdk.ts +0 -104
  515. package/server/api-safety-analytics.test.ts +0 -57
  516. package/server/appium-auto-save.test.ts +0 -79
  517. package/server/appium-config.test.ts +0 -182
  518. package/server/appium-recorder/ai-deduplication.test.ts +0 -80
  519. package/server/appium-recorder/ai-deduplication.ts +0 -74
  520. package/server/appium-recorder/ai-observation.test.ts +0 -125
  521. package/server/appium-recorder/ai-observation.ts +0 -125
  522. package/server/appium-recorder/ai-recognition.test.ts +0 -27
  523. package/server/appium-recorder/ai-recognition.ts +0 -186
  524. package/server/appium-recorder/appium-runner.ts +0 -1985
  525. package/server/appium-recorder/appium-version.test.ts +0 -55
  526. package/server/appium-recorder/bounded-loop.test.ts +0 -55
  527. package/server/appium-recorder/bounded-loop.ts +0 -129
  528. package/server/appium-recorder/condition-timeout.ts +0 -4
  529. package/server/appium-recorder/element-tap.test.ts +0 -312
  530. package/server/appium-recorder/flow-layout.test.ts +0 -52
  531. package/server/appium-recorder/history-capture.ts +0 -35
  532. package/server/appium-recorder/image-check.ts +0 -174
  533. package/server/appium-recorder/managed-appium.ts +0 -198
  534. package/server/appium-recorder/managed-cleanup.test.ts +0 -113
  535. package/server/appium-recorder/open-gallery.ts +0 -61
  536. package/server/appium-recorder/prompt-optimizer.ts +0 -57
  537. package/server/appium-recorder/random-value-replay.test.ts +0 -76
  538. package/server/appium-recorder/random-value.test.ts +0 -114
  539. package/server/appium-recorder/random-value.ts +0 -34
  540. package/server/appium-recorder/replay-lifecycle.test.ts +0 -123
  541. package/server/appium-recorder/replay-log.ts +0 -13
  542. package/server/appium-recorder/replay-mp4.ts +0 -72
  543. package/server/appium-recorder/replay-video-segments.ts +0 -77
  544. package/server/appium-recorder/replay-video.ts +0 -125
  545. package/server/appium-recorder/report-summary.test.ts +0 -78
  546. package/server/appium-recorder/report-summary.ts +0 -60
  547. package/server/appium-recorder/report.ts +0 -935
  548. package/server/appium-recorder/repository.ts +0 -561
  549. package/server/appium-recorder/request-timeout.test.ts +0 -34
  550. package/server/appium-recorder/request-timeout.ts +0 -34
  551. package/server/appium-recorder/routes.ts +0 -524
  552. package/server/appium-recorder/run-history.ts +0 -53
  553. package/server/appium-recorder/scrcpy-recording-source.ts +0 -85
  554. package/server/appium-recorder/screenshot.ts +0 -22
  555. package/server/appium-recorder/script-export.ts +0 -80
  556. package/server/appium-recorder/script-import.test.ts +0 -45
  557. package/server/appium-recorder/stop-app.ts +0 -18
  558. package/server/appium-recorder/tree-dump.ts +0 -66
  559. package/server/appium-recorder/variable-store.ts +0 -22
  560. package/server/appium-recorder/variables.ts +0 -89
  561. package/server/appium-recorder/video-response.ts +0 -36
  562. package/server/appium-recorder/visual-change.ts +0 -184
  563. package/server/artemis.ts +0 -34
  564. package/server/config-access.test.ts +0 -27
  565. package/server/config-access.ts +0 -27
  566. package/server/config-store.ts +0 -137
  567. package/server/config.ts +0 -272
  568. package/server/device-locks/repository.ts +0 -147
  569. package/server/device-locks/service.ts +0 -72
  570. package/server/device-locks/types.ts +0 -22
  571. package/server/device-sessions/repository.ts +0 -169
  572. package/server/device-sessions/service.ts +0 -59
  573. package/server/device-sessions/types.ts +0 -24
  574. package/server/http-api.ts +0 -1505
  575. package/server/model-tester.ts +0 -121
  576. package/server/operations/repository.ts +0 -226
  577. package/server/operations/service.ts +0 -84
  578. package/server/operations/types.ts +0 -27
  579. package/server/paths.ts +0 -36
  580. package/server/remote-agents/protocol.ts +0 -40
  581. package/server/remote-agents/registry.test.ts +0 -65
  582. package/server/remote-agents/registry.ts +0 -191
  583. package/server/remote-agents/replay-integration.test.ts +0 -79
  584. package/server/remote-agents/routes.ts +0 -86
  585. package/server/request-body.test.ts +0 -40
  586. package/server/request-body.ts +0 -48
  587. package/server/script-agent.ts +0 -289
  588. package/server/script-db.ts +0 -255
  589. package/server/script-runner.ts +0 -554
  590. package/server/storage/sqlite.ts +0 -112
  591. package/server/test-case-import/formatter.ts +0 -28
  592. package/server/test-case-import/parsers/excel.ts +0 -69
  593. package/server/test-case-import/parsers/txt.ts +0 -11
  594. package/server/test-case-import/parsers/word.ts +0 -9
  595. package/server/test-case-import/service.ts +0 -58
  596. package/server/test-case-import/text-normalizer.ts +0 -98
  597. package/server/test-case-import/types.ts +0 -24
  598. package/server/test-case-import/validator.ts +0 -34
  599. package/src/App.vue +0 -1022
  600. package/src/analytics/summary.ts +0 -75
  601. package/src/api.ts +0 -320
  602. package/src/appium-recorder/AppiumPage.vue +0 -2836
  603. package/src/appium-recorder/RunHistoryDialog.vue +0 -203
  604. package/src/appium-recorder/action-descriptions.ts +0 -49
  605. package/src/appium-recorder/ai-deduplication.ts +0 -34
  606. package/src/appium-recorder/ai-prompt-presets.ts +0 -34
  607. package/src/appium-recorder/ai-recognition.ts +0 -48
  608. package/src/appium-recorder/api.ts +0 -209
  609. package/src/appium-recorder/bounded-loop.ts +0 -74
  610. package/src/appium-recorder/components/AiRecognitionPromptInput.vue +0 -41
  611. package/src/appium-recorder/components/AiRecognitionSettings.vue +0 -251
  612. package/src/appium-recorder/components/AiRecognitionTestDialog.vue +0 -86
  613. package/src/appium-recorder/components/BranchTimeoutSettings.vue +0 -23
  614. package/src/appium-recorder/components/BreakLoopSettings.vue +0 -45
  615. package/src/appium-recorder/components/ComponentInspector.vue +0 -33
  616. package/src/appium-recorder/components/ComponentTree.vue +0 -139
  617. package/src/appium-recorder/components/CoordinatePointPicker.vue +0 -23
  618. package/src/appium-recorder/components/FlowActionMenu.vue +0 -257
  619. package/src/appium-recorder/components/FlowCanvas.vue +0 -391
  620. package/src/appium-recorder/components/FlowNodeCard.vue +0 -318
  621. package/src/appium-recorder/components/FlowNodeSearch.vue +0 -62
  622. package/src/appium-recorder/components/FlowRoundedEdge.vue +0 -58
  623. package/src/appium-recorder/components/FlowStepEditor.vue +0 -541
  624. package/src/appium-recorder/components/ImageCheckDialog.vue +0 -172
  625. package/src/appium-recorder/components/LongPressSettings.vue +0 -58
  626. package/src/appium-recorder/components/LoopSettings.vue +0 -39
  627. package/src/appium-recorder/components/MergeBranchesDialog.vue +0 -102
  628. package/src/appium-recorder/components/NestedConditionBranches.vue +0 -403
  629. package/src/appium-recorder/components/NewScriptDialog.vue +0 -27
  630. package/src/appium-recorder/components/NodeDetail.vue +0 -179
  631. package/src/appium-recorder/components/PresetVariables.vue +0 -110
  632. package/src/appium-recorder/components/RandomValueSettings.vue +0 -139
  633. package/src/appium-recorder/components/RecordedSteps.vue +0 -468
  634. package/src/appium-recorder/components/RecorderWorkspace.vue +0 -132
  635. package/src/appium-recorder/components/ScriptParameterSettings.vue +0 -65
  636. package/src/appium-recorder/components/StageLogSettings.vue +0 -17
  637. package/src/appium-recorder/components/TextClickSettings.vue +0 -19
  638. package/src/appium-recorder/components/VariableExtractionSettings.vue +0 -19
  639. package/src/appium-recorder/components/VariableTable.vue +0 -82
  640. package/src/appium-recorder/components/VisualChangeDialog.vue +0 -151
  641. package/src/appium-recorder/components/VisualChangeEndPicker.vue +0 -21
  642. package/src/appium-recorder/coordinate-preview.ts +0 -37
  643. package/src/appium-recorder/flow-appearance.ts +0 -70
  644. package/src/appium-recorder/flow-copy.ts +0 -278
  645. package/src/appium-recorder/flow-graph.ts +0 -868
  646. package/src/appium-recorder/flow-insert.ts +0 -27
  647. package/src/appium-recorder/flow-labels.ts +0 -138
  648. package/src/appium-recorder/flow-layout.ts +0 -88
  649. package/src/appium-recorder/flow-merge.ts +0 -123
  650. package/src/appium-recorder/flow-normalize.ts +0 -77
  651. package/src/appium-recorder/flow-remove.ts +0 -75
  652. package/src/appium-recorder/flow-search.ts +0 -29
  653. package/src/appium-recorder/flow-unmerge.ts +0 -145
  654. package/src/appium-recorder/image-check.ts +0 -121
  655. package/src/appium-recorder/long-press.ts +0 -27
  656. package/src/appium-recorder/native-control-state.ts +0 -33
  657. package/src/appium-recorder/node-locators.ts +0 -25
  658. package/src/appium-recorder/node-timeout.ts +0 -1
  659. package/src/appium-recorder/random-value.ts +0 -60
  660. package/src/appium-recorder/report-summary.ts +0 -60
  661. package/src/appium-recorder/run-history.ts +0 -53
  662. package/src/appium-recorder/stage-log.ts +0 -21
  663. package/src/appium-recorder/text-click.ts +0 -9
  664. package/src/appium-recorder/tree.ts +0 -176
  665. package/src/appium-recorder/types.ts +0 -198
  666. package/src/appium-recorder/variable-presets.ts +0 -24
  667. package/src/appium-recorder/variables.ts +0 -34
  668. package/src/appium-recorder/visual-change-pairs.ts +0 -155
  669. package/src/appium-recorder/visual-change.ts +0 -87
  670. package/src/assets/appium-actions/add.svg +0 -7
  671. package/src/assets/appium-actions/android.svg +0 -6
  672. package/src/assets/appium-actions/back.svg +0 -6
  673. package/src/assets/appium-actions/bidirection.svg +0 -6
  674. package/src/assets/appium-actions/browser.svg +0 -6
  675. package/src/assets/appium-actions/clear.svg +0 -3
  676. package/src/assets/appium-actions/crosshair.svg +0 -6
  677. package/src/assets/appium-actions/eye.svg +0 -3
  678. package/src/assets/appium-actions/pause.svg +0 -7
  679. package/src/assets/appium-actions/phone.svg +0 -9
  680. package/src/assets/appium-actions/pin.svg +0 -6
  681. package/src/assets/appium-actions/power.svg +0 -6
  682. package/src/assets/appium-actions/select.svg +0 -3
  683. package/src/assets/appium-actions/sidebar.svg +0 -6
  684. package/src/assets/appium-actions/text.svg +0 -6
  685. package/src/assets/appium-actions/zoom.svg +0 -6
  686. package/src/assets/device-actions/back.svg +0 -5
  687. package/src/assets/device-actions/home.svg +0 -3
  688. package/src/assets/device-actions/power.svg +0 -5
  689. package/src/assets/device-actions/tasks.svg +0 -3
  690. package/src/assets/device-actions/volume-down.svg +0 -3
  691. package/src/assets/device-actions/volume-up.svg +0 -3
  692. package/src/components/AppSidebar.vue +0 -32
  693. package/src/components/MidsceneMaintenanceNotice.vue +0 -17
  694. package/src/components/analytics/AnalysisCharts.vue +0 -189
  695. package/src/components/analytics/ReportAnalysis.vue +0 -78
  696. package/src/components/config/AiDeduplicationSettings.vue +0 -70
  697. package/src/components/config/AiPromptPresetsSettings.vue +0 -113
  698. package/src/components/config/AppiumConfigPanel.vue +0 -113
  699. package/src/components/config/AppiumModelSettings.vue +0 -45
  700. package/src/components/config/BaseConfigPanel.vue +0 -106
  701. package/src/components/config/FlowAppearanceSettings.vue +0 -150
  702. package/src/components/config/MidsceneConfigPanel.vue +0 -211
  703. package/src/components/config/ReplayReportSummarySettings.vue +0 -118
  704. package/src/components/device/DeviceInfoTooltip.vue +0 -55
  705. package/src/components/device/DevicePreviewPanel.vue +0 -482
  706. package/src/components/generator/GeneratedCodePanel.vue +0 -70
  707. package/src/components/generator/TestCaseFileUpload.vue +0 -97
  708. package/src/components/help/HelpCenter.vue +0 -204
  709. package/src/components/help/MarkdownDocument.vue +0 -139
  710. package/src/composables/use-device-preview.ts +0 -279
  711. package/src/composables/use-initial-resource.ts +0 -17
  712. package/src/composables/use-script-execution.ts +0 -277
  713. package/src/config/credentials.ts +0 -2
  714. package/src/config/midscene-model-presets.ts +0 -103
  715. package/src/config/prompt-example.ts +0 -10
  716. package/src/config/prompt-presets.ts +0 -172
  717. package/src/config/use-appium-auto-save.ts +0 -75
  718. package/src/config/use-model-config.ts +0 -161
  719. package/src/main.ts +0 -10
  720. package/src/pages/AiGeneratorPage.vue +0 -273
  721. package/src/pages/AnalysisPage.vue +0 -60
  722. package/src/pages/ArtemisPage.vue +0 -72
  723. package/src/pages/AutomationPage.vue +0 -161
  724. package/src/pages/ConfigPage.vue +0 -165
  725. package/src/pages/GeneratorPage.vue +0 -104
  726. package/src/pages/ManualStepsPage.vue +0 -179
  727. package/src/script-generator/codegen.ts +0 -126
  728. package/src/script-generator/index.ts +0 -4
  729. package/src/script-generator/presets.ts +0 -37
  730. package/src/script-generator/step-options.ts +0 -52
  731. package/src/script-generator/types.ts +0 -27
  732. package/src/style.css +0 -4183
  733. package/src/types.ts +0 -167
  734. package/src/vite-env.d.ts +0 -1
  735. package/tsconfig.app.json +0 -8
  736. package/tsconfig.json +0 -11
  737. package/tsconfig.node.json +0 -16
  738. package/vite.config.ts +0 -28
  739. package//346/265/201/347/250/213/350/212/202/347/202/271/346/223/215/344/275/234/350/257/264/346/230/216.md +0 -408
@@ -1,1098 +0,0 @@
1
- # Copyright 2026 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- """Agent tools, sub-agent capabilities, and explorer settings configuration."""
16
-
17
- import os
18
- from pathlib import Path
19
- from typing import Any, Literal
20
-
21
- from pydantic import BaseModel, Field, model_validator
22
-
23
- from artemis.config.constants import (
24
- AGENT_CONFIG_FILENAME,
25
- DEFAULT_EXPLORER_VERSION,
26
- ExplorerVersion,
27
- )
28
- from artemis.config.paths import ROOT_DIR, get_config_path
29
- from artemis.llm.google import VideoProcessing
30
- from third_party.mobile_use.utils.file import load_jsonc
31
- from third_party.mobile_use.utils.logger import get_logger
32
-
33
- logger = get_logger(__name__)
34
-
35
-
36
- class VideoAnalyzerConfig(BaseModel):
37
- """Configuration specific to VideoAnalyzer and screen recording."""
38
-
39
- enabled: bool | None = Field(
40
- default=None,
41
- description=(
42
- "Whether continuous screen video recording and video analyzer tools "
43
- "are enabled. If None, auto-detected based on scrcpy & ffmpeg availability."
44
- ),
45
- )
46
- enable_ledger: bool = Field(
47
- default=True,
48
- description="Whether to enable video action ledger state tracking.",
49
- )
50
- chunk_size_seconds: float = Field(
51
- default=60.0,
52
- ge=5.0,
53
- le=300.0,
54
- description="Maximum duration of an initial video-analysis chunk.",
55
- )
56
- min_chunk_seconds: float = Field(
57
- default=4.0,
58
- ge=1.0,
59
- le=30.0,
60
- description="Smallest chunk produced by failure-driven bisection.",
61
- )
62
- max_split_depth: int = Field(
63
- default=4,
64
- ge=0,
65
- le=8,
66
- description="Maximum recursive chunk bisection depth after failures.",
67
- )
68
- circuit_breaker_threshold: int = Field(
69
- default=3,
70
- ge=1,
71
- le=20,
72
- description="Consecutive transient model failures before opening the circuit.",
73
- )
74
- circuit_breaker_cooldown_seconds: float = Field(
75
- default=60.0,
76
- ge=1.0,
77
- le=900.0,
78
- description="How long an unhealthy video model remains bypassed.",
79
- )
80
- action_window_seconds: float = Field(
81
- default=2.0,
82
- ge=0.0,
83
- le=10.0,
84
- description="Dense-perception window on each side of a recorded mobile action.",
85
- )
86
- dense_action_fps: float = Field(
87
- default=4.0,
88
- ge=1.0,
89
- le=15.0,
90
- description="Frame sampling rate around recorded mobile actions.",
91
- )
92
- max_dense_action_frames: int = Field(
93
- default=24,
94
- ge=0,
95
- le=120,
96
- description="Maximum additional action-proximal keyframes per chunk.",
97
- )
98
- native_max_retries: int = Field(
99
- default=1,
100
- ge=0,
101
- le=5,
102
- description=(
103
- "Retries against the native video provider before switching to the "
104
- "configured universal fallback. A value of 1 means two total attempts."
105
- ),
106
- )
107
- model_call_timeout_seconds: float = Field(
108
- default=120.0,
109
- ge=15.0,
110
- le=600.0,
111
- description="Hard timeout for one native or universal video-model response.",
112
- )
113
- processing: VideoProcessing = Field(
114
- default="auto",
115
- description=(
116
- "How Gemini sub-agents watch a clip. 'agentic' lets the model search,"
117
- " scan and re-watch the clip on demand (Gemini Interactions API);"
118
- " 'static' samples it at a fixed frame rate; 'auto' picks agentic on"
119
- " Gemini 3.6+ Flash models and static everywhere else."
120
- ),
121
- )
122
- agentic_chunk_size_seconds: float = Field(
123
- default=600.0,
124
- ge=30.0,
125
- le=1800.0,
126
- description=(
127
- "Maximum clip length handed to one agentic sub-agent. Static mode keeps"
128
- " using chunk_size_seconds."
129
- ),
130
- )
131
- agentic_call_timeout_seconds: float = Field(
132
- default=300.0,
133
- ge=30.0,
134
- le=1200.0,
135
- description="Hard timeout for one agentic sub-agent response.",
136
- )
137
- model_config = {"extra": "allow"}
138
-
139
-
140
- class PlannerValidationConfig(BaseModel):
141
- """Configuration specific to Planner validation of milestone changes."""
142
-
143
- enabled: bool = Field(
144
- default=True,
145
- description=(
146
- "Whether every top-level milestone text change is reviewed by the"
147
- " lightweight async planner validator. The review is advisory: a"
148
- " flagged change is never rolled back, the Operator only receives"
149
- " the concern and its reason as feedback."
150
- ),
151
- )
152
- model_config = {"extra": "allow"}
153
-
154
-
155
- class CommitteeConfig(BaseModel):
156
- """Configuration specific to Multi-Agent Committee / Council."""
157
-
158
- enabled: bool = Field(
159
- default=False,
160
- description="Whether to equip Operator with the ask_committee tool.",
161
- )
162
- debate_rounds: int = Field(
163
- default=2,
164
- ge=1,
165
- le=5,
166
- description="Number of debate rounds among council members (1-5).",
167
- )
168
- model_config = {"extra": "allow"}
169
-
170
-
171
- class CheckerConfig(BaseModel):
172
- """Configuration for plan-driven checkpoint verification and the final review."""
173
-
174
- enabled: bool = Field(
175
- default=True,
176
- description=(
177
- "Master switch (compat alias): False disables BOTH midway"
178
- " checkpoints and the final check."
179
- ),
180
- )
181
- midway_checks: bool = Field(
182
- default=False,
183
- description=(
184
- "Whether plan-declared midway checkpoints run (requires enabled=True)."
185
- " Off in the factory layering: final check on, midway checks off."
186
- ),
187
- )
188
- final_check: bool = Field(
189
- default=True,
190
- description="Whether the exit final review runs (requires enabled=True).",
191
- )
192
- max_iterations: int = Field(
193
- default=20,
194
- ge=1,
195
- le=50,
196
- description="Maximum verification iterations for Checker LLM reasoning and inspection.",
197
- )
198
- final_check_max_attempts: int = Field(
199
- default=3,
200
- ge=1,
201
- le=10,
202
- description="Maximum final-review attempts before ending with a blocked outcome.",
203
- )
204
- checkpoint_max_repairs: int = Field(
205
- default=2,
206
- ge=0,
207
- le=10,
208
- description="Per-checkpoint repair quota for failed verify criteria.",
209
- )
210
- max_concurrent_checkpoints: int = Field(
211
- default=3,
212
- ge=1,
213
- le=10,
214
- description="Maximum concurrently running checkpoint attempts.",
215
- )
216
- checkpoint_timeout: float = Field(
217
- default=180.0,
218
- gt=0,
219
- description="Per-attempt timeout (seconds) for one checkpoint check.",
220
- )
221
- settlement_timeout: float = Field(
222
- default=120.0,
223
- gt=0,
224
- description="Aggregate timeout (seconds) for the exit settlement barrier.",
225
- )
226
- assert_failure_policy: Literal["continue", "halt"] = Field(
227
- default="continue",
228
- description="Whether an assert failure lets execution continue or halts the run.",
229
- )
230
- device_probes: bool = Field(
231
- default=True,
232
- description="Whether the Checker's enumerated read-only device probes are registered.",
233
- )
234
- model_config = {"extra": "allow"}
235
-
236
-
237
- #: Coarse verification presets exposed to the CLI (``--verification-level``)
238
- #: and the admin console (``verification_level`` on ``/api/run``). Each preset
239
- #: is a partial :class:`CheckerConfig` override; unspecified fields keep the
240
- #: values from ``artemis.jsonc``. ``final`` mirrors the factory layering.
241
- VerificationLevel = Literal["off", "final", "checkpoints", "strict"]
242
- DEFAULT_VERIFICATION_LEVEL: VerificationLevel = "final"
243
- VERIFICATION_LEVEL_PRESETS: dict[str, dict[str, Any]] = {
244
- # No Checker at all: the Operator self-reports completion, nothing audits it.
245
- "off": {"enabled": False},
246
- # Factory layering: one exit audit against the user's goal, no midway checkpoints.
247
- "final": {"enabled": True, "midway_checks": False, "final_check": True},
248
- # Every plan-declared checkpoint runs at its subgoal's completion, plus the exit audit.
249
- "checkpoints": {"enabled": True, "midway_checks": True, "final_check": True},
250
- # Checkpoints + exit audit with a larger repair budget; a failed assert halts the run.
251
- "strict": {
252
- "enabled": True,
253
- "midway_checks": True,
254
- "final_check": True,
255
- "assert_failure_policy": "halt",
256
- "checkpoint_max_repairs": 4,
257
- "final_check_max_attempts": 5,
258
- "max_iterations": 30,
259
- },
260
- }
261
-
262
-
263
- def checker_overrides_for_level(level: str | None) -> dict[str, Any]:
264
- """Return the :class:`CheckerConfig` field overrides for a verification level.
265
-
266
- Args:
267
- level: One of ``off``, ``final``, ``checkpoints`` or ``strict``
268
- (case-insensitive, surrounding whitespace ignored).
269
-
270
- Raises:
271
- ValueError: when ``level`` is not a known preset.
272
- """
273
- key = str(level or "").strip().lower()
274
- preset = VERIFICATION_LEVEL_PRESETS.get(key)
275
- if preset is None:
276
- known = ", ".join(VERIFICATION_LEVEL_PRESETS)
277
- raise ValueError(f"Unknown verification level {level!r}; expected one of: {known}")
278
- return dict(preset)
279
-
280
-
281
- def verification_level_for_checker(checker: "CheckerConfig") -> VerificationLevel:
282
- """Classify an effective :class:`CheckerConfig` back onto the coarse ladder.
283
-
284
- Used by launcher UIs to show where the configured defaults sit; the inverse of
285
- :func:`checker_overrides_for_level` for the fields the presets control.
286
- """
287
- if not checker.enabled or (not checker.midway_checks and not checker.final_check):
288
- return "off"
289
- if checker.midway_checks:
290
- return "strict" if checker.assert_failure_policy == "halt" else "checkpoints"
291
- return "final"
292
-
293
-
294
- def run_tuning_for_profile(
295
- profile: str | None,
296
- *,
297
- checker: "CheckerConfig",
298
- explorer: "ExplorerConfig",
299
- explorer_versions: dict[str, str] | None = None,
300
- ) -> dict[str, str] | None:
301
- """Return Pro verification and explorer settings for session metadata.
302
-
303
- Flash has no per-run tuning and returns None.
304
- """
305
- key = str(profile or "").strip().lower()
306
- if key != "pro":
307
- return None
308
- return {
309
- "verification_level": verification_level_for_checker(checker),
310
- "explorer_mode": explorer.resolve(profile="pro", per_agent_overrides=explorer_versions),
311
- }
312
-
313
-
314
- class OutputterConfig(BaseModel):
315
- """Configuration specific to Outputter post-execution report synthesis agent."""
316
-
317
- enabled: bool = Field(
318
- default=True,
319
- description="Whether Outputter agent is mounted for post-execution report/structured output synthesis.",
320
- )
321
- force_synthesis: bool = Field(
322
- default=False,
323
- description="Whether to force Outputter synthesis even when no structured schema is explicitly requested.",
324
- )
325
- model_config = {"extra": "allow"}
326
-
327
-
328
- class ExplorerConfig(BaseModel):
329
- """Configuration specific to UI Explorer visual sub-agent (Flash / Pro / Ultra)."""
330
-
331
- default_version: ExplorerVersion = Field(
332
- default=DEFAULT_EXPLORER_VERSION,
333
- description="Default Explorer version mode ('flash', 'pro', or 'ultra').",
334
- )
335
- flash_mode: ExplorerVersion = Field(
336
- default="flash",
337
- description="Explorer version mode when main system runs under Flash profile (FlashRunner).",
338
- )
339
- pro_mode: ExplorerVersion = Field(
340
- default="flash",
341
- description="Explorer version mode when main system runs under Pro profile (Graph / Operator / Validator).",
342
- )
343
- caching: bool | None = Field(
344
- default=None,
345
- description=(
346
- "Gemini explicit context caching for multi-turn Explorer tiers. ``None``"
347
- " (default) uses the tier's own default: off for pro, on for ultra."
348
- ),
349
- )
350
- model_config = {"extra": "allow"}
351
-
352
- def resolve(
353
- self,
354
- explicit_version: str | None = None,
355
- agent_name: str | None = None,
356
- profile: str | None = None,
357
- per_agent_overrides: dict[str, str] | None = None,
358
- ) -> ExplorerVersion:
359
- """Resolves active Explorer version with clean precedence rules."""
360
- if explicit_version:
361
- v = str(explicit_version).strip().lower()
362
- if v in ("flash", "pro", "ultra"):
363
- return v # type: ignore
364
-
365
- env_v = os.getenv("ARTEMIS_EXPLORER_VERSION", "").strip().lower()
366
- if env_v in ("flash", "pro", "ultra"):
367
- return env_v # type: ignore
368
-
369
- if per_agent_overrides and agent_name and agent_name in per_agent_overrides:
370
- v = str(per_agent_overrides[agent_name]).strip().lower()
371
- if v in ("flash", "pro", "ultra"):
372
- return v # type: ignore
373
-
374
- if profile in ("flash", "flash_runner") or agent_name in ("flash", "flash_runner"):
375
- return self.flash_mode
376
- if profile in ("pro", "operator", "validator") or agent_name in (
377
- "pro",
378
- "operator",
379
- "validator",
380
- ):
381
- return self.pro_mode
382
-
383
- return self.default_version
384
-
385
-
386
- class StepSummarizerConfig(BaseModel):
387
- """Configuration specific to Flash asynchronous step visual summarization."""
388
-
389
- enabled: bool = Field(
390
- default=True,
391
- description="Whether to asynchronously summarize historical steps to replace pruned images.",
392
- )
393
- model: str = Field(
394
- default="gemini-2.5-flash-lite",
395
- description="Lightweight model used for background step state summarization.",
396
- )
397
- prune_history_xml: bool = Field(
398
- default=True,
399
- description="Whether to prune outdated heavy UI XML trees from historical turns.",
400
- )
401
- retry_limit: int = Field(
402
- default=3,
403
- ge=0,
404
- description=(
405
- "Maximum retries per step summary after the first attempt; on"
406
- " exhaustion the step is marked summary_status=failed instead of"
407
- " retrying forever."
408
- ),
409
- )
410
- model_config = {"extra": "allow"}
411
-
412
-
413
- class MemoryRuntimeConfig(BaseModel):
414
- """Scheduling options for the shared step-memory runtime (agent.memory.runtime)."""
415
-
416
- max_concurrency: int = Field(
417
- default=2,
418
- ge=1,
419
- le=16,
420
- description=(
421
- "Maximum background summary attempts running concurrently."
422
- " Default 2 per the 2026-09-01 on-device baseline"
423
- " (history-baseline-2026-09-01.md §6): the serial queue at 1 pushed"
424
- " summary-ready P90 past the scrub-edge grace window; lens calls"
425
- " are independent lightweight-model requests, so 2 is low-risk."
426
- ),
427
- )
428
- retry_limit: int = Field(
429
- default=3,
430
- ge=0,
431
- description=(
432
- "Maximum retries per summary job after the first attempt; on"
433
- " exhaustion the job enters an explicit failed state."
434
- ),
435
- )
436
- flush_timeout_s: float = Field(
437
- default=30.0,
438
- gt=0,
439
- description="Upper bound in seconds for draining in-flight summary jobs at shutdown.",
440
- )
441
- model_config = {"extra": "allow"}
442
-
443
-
444
- class MemoryTranscriptConfig(BaseModel):
445
- """Scrub-edge options for the message transcript (agent.memory.transcript)."""
446
-
447
- enabled: bool = Field(
448
- default=True,
449
- description=(
450
- "Whether the Pro operator builds its prompt from the session"
451
- " transcript ledger (S/F/A regions + per-turn tail) instead of the"
452
- " legacy per-turn 2-message rebuild. On by default since M5"
453
- " (2026-09-01, per the on-device A/B in"
454
- " history-baseline-2026-09-01.md); this is also the rollback"
455
- " switch — setting it to false restores the legacy path"
456
- " byte-for-byte, and L2/L3 chunk compression rides the same flag."
457
- ),
458
- )
459
- image_scrub_depth: int = Field(
460
- default=3,
461
- ge=1,
462
- description=(
463
- "Depth K of the screenshot scrub edge from the start gate up: the"
464
- " K-th most recent screenshot (the live one counts as depth 1) is"
465
- " replaced by its visual summary."
466
- ),
467
- )
468
- image_scrub_depth_relaxed: int = Field(
469
- default=6,
470
- ge=1,
471
- description=(
472
- "Screenshot scrub depth while the operator's measured context is"
473
- " below budget*start_ratio (nothing is being replaced yet, so"
474
- " more raw screenshots stay in view). Must be >= image_scrub_depth;"
475
- " set equal to it to disable the occupancy-driven depth. A change"
476
- " of depth never rewrites an already-scrubbed message."
477
- ),
478
- )
479
- pending_grace_steps: int = Field(
480
- default=3,
481
- ge=0,
482
- description=(
483
- "Extra image-depths a step may retain its screenshot past the"
484
- " scrub edge while its summary is still pending; afterwards the"
485
- " image is replaced by a placeholder referencing the DataEngine step."
486
- ),
487
- )
488
- xml_scrub_depth: int | None = Field(
489
- default=1,
490
- ge=1,
491
- description=(
492
- "Text edge of the scrub: once a message is deeper than this many"
493
- " image-bearing observations (1 = as soon as a newer observation"
494
- " exists) its UI element list, plan recitation and per-turn"
495
- " ephemeral blocks are removed. Kept shallow on purpose: only the"
496
- " live observation carries an indexed element list, so a stale"
497
- " [n] index can never be picked up as a target. Screenshots follow"
498
- " image_scrub_depth / image_scrub_depth_relaxed."
499
- ),
500
- )
501
- context_budget_tokens: int = Field(
502
- default=80000,
503
- ge=1024,
504
- description=(
505
- "Measured-token budget for the transcript context (provisional"
506
- " default pending the on-device baseline; §3.4). The soft/hard"
507
- " ratios below are applied against this budget."
508
- ),
509
- )
510
- start_ratio: float = Field(
511
- default=0.35,
512
- ge=0.0,
513
- lt=1.0,
514
- description=(
515
- "Start gate: below budget*start_ratio of the operator's measured"
516
- " prompt size, closed segments only prepare their capsule in the"
517
- " background — the original turns stay in the transcript. Ready"
518
- " chunks replace their turns once the measured context reaches"
519
- " this ratio (the hard threshold overrides it). 0 restores"
520
- " swap-as-soon-as-ready."
521
- ),
522
- )
523
- soft_ratio: float = Field(
524
- default=0.7,
525
- gt=0.0,
526
- lt=1.0,
527
- description=(
528
- "Soft threshold: when the operator's last measured prompt size"
529
- " reaches budget*soft_ratio, the oldest open segment is"
530
- " chunk-compressed (L2)."
531
- ),
532
- )
533
- hard_ratio: float = Field(
534
- default=0.9,
535
- gt=0.0,
536
- le=1.0,
537
- description=(
538
- "Hard threshold: when the operator's last measured prompt size"
539
- " reaches budget*hard_ratio, ready chunks swap as L2 blocks first;"
540
- " only if that would not bring the estimated context back under the"
541
- " line does everything closed force-swap (pending chunks included)"
542
- " and the whole frozen region fold into a recall-only era — L3: the"
543
- " period paragraph with the per-step index. The fold is permanent;"
544
- " later L2 chunks are appended after it."
545
- ),
546
- )
547
- min_active_steps: int = Field(
548
- default=5,
549
- ge=1,
550
- description=(
551
- "Sliding-window floor: no compression trigger may shrink the"
552
- " active region below this many most-recent raw turns."
553
- ),
554
- )
555
- similarity_hint: bool = Field(
556
- default=True,
557
- description=(
558
- "Whether the operator prompt injects a local historical-state hint"
559
- " when the current screen's perceptual hash closely matches a much"
560
- " older step's post-action screen (no model call, no historical"
561
- " image). Silent when the match is within the recent 3 steps —"
562
- " that regime belongs to the pixel-level same-screen note."
563
- ),
564
- )
565
- similarity_max_distance: int = Field(
566
- default=5,
567
- ge=0,
568
- le=64,
569
- description=(
570
- "Maximum Hamming distance between 64-bit dHash values for the"
571
- " historical-state hint to fire. Calibrated 2026-09-01 from 460"
572
- " dHash-stamped on-device steps (16 sessions): same-screen"
573
- " re-captures cluster at distance <=4, genuinely different screens"
574
- " mass at >=7 (valley at 5-6); cross-app pairs (guaranteed"
575
- " different screens) score <=5 in only 0.14% of cases vs 0.24% at"
576
- " the previous provisional 8."
577
- ),
578
- )
579
- model_config = {"extra": "allow"}
580
-
581
- @model_validator(mode="after")
582
- def _ratios_are_ordered(self) -> "MemoryTranscriptConfig":
583
- """The three thresholds form a ladder against the same budget."""
584
- if not (0.0 <= self.start_ratio <= self.soft_ratio <= self.hard_ratio <= 1.0):
585
- raise ValueError(
586
- "memory.transcript ratios must satisfy"
587
- " 0 <= start_ratio <= soft_ratio <= hard_ratio <= 1"
588
- f" (got start_ratio={self.start_ratio}, soft_ratio={self.soft_ratio},"
589
- f" hard_ratio={self.hard_ratio})."
590
- )
591
- if self.image_scrub_depth_relaxed < self.image_scrub_depth:
592
- raise ValueError(
593
- "memory.transcript.image_scrub_depth_relaxed must be >= image_scrub_depth"
594
- f" (got {self.image_scrub_depth_relaxed} < {self.image_scrub_depth})."
595
- )
596
- return self
597
-
598
-
599
- class MemoryRecallConfig(BaseModel):
600
- """search_history tool options (agent.memory.recall)."""
601
-
602
- enabled: bool = Field(
603
- default=True,
604
- description=(
605
- "Whether the operator (Pro and Flash) gets the search_history tool"
606
- " for deterministic lookups into cold (compressed/evicted) history."
607
- " replay_steps and get_step_screenshot are not gated by this flag."
608
- ),
609
- )
610
- max_results: int = Field(
611
- default=5,
612
- ge=1,
613
- le=20,
614
- description="Upper bound on results per search_history call.",
615
- )
616
- max_text_tokens: int = Field(
617
- default=2000,
618
- ge=128,
619
- description=(
620
- "Estimated-token cap (char/4) on one search_history response;"
621
- " excerpts are truncated to fit."
622
- ),
623
- )
624
- screen_scan_steps: int = Field(
625
- default=150,
626
- ge=0,
627
- description=(
628
- "How many most-recent steps have their screenshot OCR/UI-tree text"
629
- " scanned by search_history (per-image JSON loads are the expensive"
630
- " part of the sweep). Narrow with step_range to reach older steps."
631
- ),
632
- )
633
- model_config = {"extra": "allow"}
634
-
635
-
636
- class MemoryReplayConfig(BaseModel):
637
- """replay_steps tool options (agent.memory.replay)."""
638
-
639
- max_steps: int = Field(
640
- default=5,
641
- ge=1,
642
- le=50,
643
- description="Maximum steps replayed per replay_steps call.",
644
- )
645
- max_tokens: int = Field(
646
- default=12000,
647
- ge=128,
648
- description=(
649
- "Estimated-token budget (char/4) of one replay_steps response."
650
- " When exceeded, whole trailing steps are dropped; individual"
651
- " steps are kept intact."
652
- ),
653
- )
654
- model_config = {"extra": "allow"}
655
-
656
-
657
- class MemoryChunkingConfig(BaseModel):
658
- """Segment (L2) chunk compression options (agent.memory.chunking)."""
659
-
660
- max_steps: int = Field(
661
- default=12,
662
- ge=1,
663
- description=(
664
- "Size-threshold trigger: an open segment of this many steps is"
665
- " chunk-compressed even without a milestone switch. Also the"
666
- " maximum steps per chunk when a longer segment is split."
667
- ),
668
- )
669
- target_source_tokens: int = Field(
670
- default=2000,
671
- ge=128,
672
- description=(
673
- "Size-threshold trigger: estimated source tokens (transcript"
674
- " characters through the session-calibrated ratio, 4 chars/token"
675
- " by default) over the open segment's eligible portion that force"
676
- " a chunk compression."
677
- ),
678
- )
679
- min_steps: int = Field(
680
- default=3,
681
- ge=1,
682
- description=(
683
- "Minimum turns in a chunk closed by the size or pressure trigger:"
684
- " below this the eligible turns keep accumulating instead of"
685
- " becoming one-step chunks (each chunk costs a capsule call)."
686
- " Milestone closes are exempt (a complete segment is a unit) and"
687
- " the hard threshold waives it (emergency)."
688
- ),
689
- )
690
- model: str = Field(
691
- default="gemini-3.8-flash",
692
- description="Model used for the chunk-level StepCapsuleLens (bands ①+②).",
693
- )
694
- max_chunks: int = Field(
695
- default=8,
696
- ge=1,
697
- description=(
698
- "Maximum full three-band chunk blocks kept in the frozen region;"
699
- " older chunks merge into eras (headers set-merged, ledgers kept)."
700
- ),
701
- )
702
- max_eras: int | None = Field(
703
- default=None,
704
- ge=1,
705
- description=(
706
- "Maximum eras kept with their per-segment ledgers; older eras"
707
- " collapse their ledgers to search_history marker lines. None"
708
- " (default) follows max_chunks, preserving the pre-M5 equal-value"
709
- " behavior."
710
- ),
711
- )
712
-
713
- @model_validator(mode="after")
714
- def _min_steps_within_cap(self) -> "MemoryChunkingConfig":
715
- if self.min_steps > self.max_steps:
716
- raise ValueError(
717
- "memory.chunking.min_steps must not exceed max_steps"
718
- f" (got min_steps={self.min_steps}, max_steps={self.max_steps})."
719
- )
720
- return self
721
-
722
- model_config = {"extra": "allow"}
723
-
724
-
725
- class MemoryConfig(BaseModel):
726
- """Unified step-memory configuration block (agent.memory)."""
727
-
728
- runtime: MemoryRuntimeConfig = Field(
729
- default_factory=MemoryRuntimeConfig,
730
- description="Shared background summarization runtime scheduling options.",
731
- )
732
- transcript: MemoryTranscriptConfig = Field(
733
- default_factory=MemoryTranscriptConfig,
734
- description="Transcript scrub-edge options.",
735
- )
736
- chunking: MemoryChunkingConfig = Field(
737
- default_factory=MemoryChunkingConfig,
738
- description="Segment chunk (L2) compression options.",
739
- )
740
- recall: MemoryRecallConfig = Field(
741
- default_factory=MemoryRecallConfig,
742
- description="search_history tool options.",
743
- )
744
- replay: MemoryReplayConfig = Field(
745
- default_factory=MemoryReplayConfig,
746
- description="replay_steps tool options.",
747
- )
748
- policies: dict[str, dict[str, Any]] = Field(
749
- default_factory=dict,
750
- description=(
751
- "Per-agent overrides of the compiled-history ContextPolicy table"
752
- " (artemis.memory.context_policy); keys are agent names, values"
753
- " are policy field overrides (e.g. {'planner': {'last_n_detailed': 3}})."
754
- ),
755
- )
756
- model_config = {"extra": "allow"}
757
-
758
-
759
- class FlashProfileConfig(BaseModel):
760
- """Configuration options specific to the ⚡ Flash execution profile (FlashRunner/ReactiveRunner)."""
761
-
762
- max_turns: int = Field(
763
- default=0,
764
- ge=0,
765
- description=(
766
- "Maximum reactive turns for Flash execution; 0 (the default) means"
767
- " unlimited. Context growth is bounded by the transcript ledger's"
768
- " scrub edge and chunk compression, not by a turn cap, so a long"
769
- " task simply runs until it reports its status."
770
- ),
771
- )
772
- explorer_mode: ExplorerVersion = Field(
773
- default="flash",
774
- description="Perception mode for Flash runner ('flash' for 1-shot detection).",
775
- )
776
- step_summarizer: StepSummarizerConfig = Field(
777
- default_factory=StepSummarizerConfig,
778
- description="Asynchronous visual context compressor settings.",
779
- )
780
- model_config = {"extra": "allow"}
781
-
782
-
783
- class ProExplorerConfig(BaseModel):
784
- """Explorer perception settings under Pro profile."""
785
-
786
- mode: ExplorerVersion = Field(
787
- default="flash",
788
- description="Explorer perception mode under Pro profile ('flash', 'pro', or 'ultra').",
789
- )
790
- caching: bool = Field(
791
- default=True,
792
- description="Whether to enable context caching for multi-turn Pro/Ultra exploration.",
793
- )
794
- model_config = {"extra": "allow"}
795
-
796
-
797
- class ExecutionConfig(BaseModel):
798
- """Validator execution tiers for the Pro profile."""
799
-
800
- max_burst_actions: int = Field(
801
- default=4,
802
- ge=2,
803
- le=10,
804
- description=(
805
- "Maximum turn-ending actions the Operator may chain into one fast-action"
806
- " burst (executed back to back without the safety net). A longer turn is"
807
- " rejected before execution and fed back to the Operator."
808
- ),
809
- )
810
- plan_ledger_gate: bool = Field(
811
- default=True,
812
- description=(
813
- "Require active plan sub-goals and periodically prompt the Operator to"
814
- " update stale plan progress."
815
- ),
816
- )
817
- plan_ledger_stale_turns: int = Field(
818
- default=4,
819
- ge=0,
820
- description=(
821
- "Action turns allowed without a task_plan change before the ledger gate"
822
- " prompts for an update. Set to 0 to disable staleness checks."
823
- ),
824
- )
825
-
826
-
827
- class ProProfileConfig(BaseModel):
828
- """Configuration options specific to the 🚀 Pro execution profile (LangGraph / Multi-Agent Closed-Loop)."""
829
-
830
- execution: ExecutionConfig = Field(
831
- default_factory=ExecutionConfig,
832
- description="Validator execution tiers (vetted single action vs fast-action burst).",
833
- )
834
- explorer: ProExplorerConfig = Field(
835
- default_factory=ProExplorerConfig,
836
- description="Explorer perception settings for Pro profile.",
837
- )
838
- planner_validation: PlannerValidationConfig = Field(
839
- default_factory=PlannerValidationConfig,
840
- description="Planner milestone consistency validation settings.",
841
- )
842
- committee: CommitteeConfig = Field(
843
- default_factory=CommitteeConfig,
844
- description="Multi-Agent Committee council debate settings.",
845
- )
846
- checker: CheckerConfig = Field(
847
- default_factory=CheckerConfig,
848
- description="Checker checkpoint verification and exit final review settings.",
849
- )
850
- video_analyzer: VideoAnalyzerConfig = Field(
851
- default_factory=VideoAnalyzerConfig,
852
- description="Screen video action ledger tracking settings.",
853
- )
854
- model_config = {"extra": "allow"}
855
-
856
-
857
- class AgentGlobalConfig(BaseModel):
858
- """Global configuration parsed from artemis.jsonc / agent_config.json."""
859
-
860
- # ⚡ Profile-categorized configurations
861
- flash: FlashProfileConfig = Field(
862
- default_factory=FlashProfileConfig,
863
- description="Options for ⚡ Flash reactive runner execution.",
864
- )
865
- pro: ProProfileConfig = Field(
866
- default_factory=ProProfileConfig,
867
- description="Options for 🚀 Pro multi-agent graph execution.",
868
- )
869
-
870
- # 🌐 Core Component Configurations
871
- explorer: ExplorerConfig = Field(
872
- default_factory=ExplorerConfig,
873
- description="UI Explorer sub-agent runtime options.",
874
- )
875
- explorer_versions: dict[str, str] = Field(
876
- default_factory=dict,
877
- description=(
878
- "Advanced per-agent override of the Explorer tier (e.g."
879
- ' {"validator": "ultra"}). Empty by default so that'
880
- " ``explorer.flash_mode`` / ``explorer.pro_mode`` decide."
881
- ),
882
- )
883
- planner_validation: PlannerValidationConfig = Field(
884
- default_factory=PlannerValidationConfig,
885
- description="Planner milestone validation runtime options.",
886
- )
887
- committee: CommitteeConfig = Field(
888
- default_factory=CommitteeConfig,
889
- description="Committee council runtime options.",
890
- )
891
- checker: CheckerConfig = Field(
892
- default_factory=CheckerConfig,
893
- description="Checker checkpoint verification and exit final review runtime options.",
894
- )
895
- outputter: OutputterConfig = Field(
896
- default_factory=OutputterConfig,
897
- description="Outputter synthesis agent runtime options.",
898
- )
899
- denylisted_tools: dict[str, list[str]] = Field(
900
- default_factory=dict,
901
- description="List of denylisted tools per agent.",
902
- )
903
- video_analyzer: VideoAnalyzerConfig = Field(
904
- default_factory=VideoAnalyzerConfig,
905
- description="Video analyzer runtime options.",
906
- )
907
- memory: MemoryConfig = Field(
908
- default_factory=MemoryConfig,
909
- description="Unified step-memory runtime and transcript scrub options.",
910
- )
911
-
912
- model_config = {"extra": "allow"}
913
-
914
- @model_validator(mode="before")
915
- @classmethod
916
- def synchronize_profiles_and_components(cls, data: Any) -> Any:
917
- """Bidirectionally synchronize between categorized 'flash'/'pro' blocks and component fields."""
918
- if not isinstance(data, dict):
919
- return data
920
-
921
- # 1. Sync from pro block to root components if provided
922
- if "pro" in data and isinstance(data["pro"], dict):
923
- pro_data = data["pro"]
924
- if "checker" in pro_data and "checker" not in data:
925
- data["checker"] = pro_data["checker"]
926
- if "committee" in pro_data and "committee" not in data:
927
- data["committee"] = pro_data["committee"]
928
- if "planner_validation" in pro_data and "planner_validation" not in data:
929
- data["planner_validation"] = pro_data["planner_validation"]
930
- if "video_analyzer" in pro_data and "video_analyzer" not in data:
931
- data["video_analyzer"] = pro_data["video_analyzer"]
932
- if "explorer" in pro_data and isinstance(pro_data["explorer"], dict):
933
- exp_pro = pro_data["explorer"]
934
- if "explorer" not in data:
935
- data["explorer"] = {}
936
- if isinstance(data["explorer"], dict):
937
- if "mode" in exp_pro and "pro_mode" not in data["explorer"]:
938
- data["explorer"]["pro_mode"] = exp_pro["mode"]
939
- if "caching" in exp_pro and "caching" not in data["explorer"]:
940
- data["explorer"]["caching"] = exp_pro["caching"]
941
-
942
- # 2. Sync from flash block to explorer.flash_mode
943
- if "flash" in data and isinstance(data["flash"], dict):
944
- flash_data = data["flash"]
945
- if "explorer_mode" in flash_data:
946
- if "explorer" not in data:
947
- data["explorer"] = {}
948
- if isinstance(data["explorer"], dict) and "flash_mode" not in data["explorer"]:
949
- data["explorer"]["flash_mode"] = flash_data["explorer_mode"]
950
-
951
- # 3. Sync from root components to pro/flash blocks if pro/flash block is omitted
952
- if "checker" in data and ("pro" not in data or "checker" not in data.get("pro", {})):
953
- data.setdefault("pro", {})["checker"] = data["checker"]
954
- if "committee" in data and ("pro" not in data or "committee" not in data.get("pro", {})):
955
- data.setdefault("pro", {})["committee"] = data["committee"]
956
- if "planner_validation" in data and (
957
- "pro" not in data or "planner_validation" not in data.get("pro", {})
958
- ):
959
- data.setdefault("pro", {})["planner_validation"] = data["planner_validation"]
960
- if "video_analyzer" in data and (
961
- "pro" not in data or "video_analyzer" not in data.get("pro", {})
962
- ):
963
- data.setdefault("pro", {})["video_analyzer"] = data["video_analyzer"]
964
-
965
- # 3b. Legacy alias: an explicit flash.step_summarizer.retry_limit keeps
966
- # working by seeding memory.runtime.retry_limit when the new key is
967
- # absent (an explicit new key wins over the legacy one).
968
- flash_block = data.get("flash")
969
- flash_ss = flash_block.get("step_summarizer") if isinstance(flash_block, dict) else None
970
- if isinstance(flash_ss, dict) and "retry_limit" in flash_ss:
971
- mem_block = data.setdefault("memory", {})
972
- if isinstance(mem_block, dict):
973
- runtime_block = mem_block.setdefault("runtime", {})
974
- if isinstance(runtime_block, dict):
975
- runtime_block.setdefault("retry_limit", flash_ss["retry_limit"])
976
-
977
- # 4. Environment variable overrides (highest precedence for runtime switches)
978
- def _parse_bool(var_name: str) -> bool | None:
979
- v = os.getenv(var_name)
980
- if v is None:
981
- return None
982
- v_clean = v.strip().lower()
983
- if v_clean in ("1", "true", "yes", "on"):
984
- return True
985
- if v_clean in ("0", "false", "no", "off"):
986
- return False
987
- return None
988
-
989
- chk_env = _parse_bool("ARTEMIS_CHECKER_ENABLED")
990
- if chk_env is not None:
991
- data.setdefault("checker", {})["enabled"] = chk_env
992
- data.setdefault("pro", {}).setdefault("checker", {})["enabled"] = chk_env
993
-
994
- comm_env = _parse_bool("ARTEMIS_COMMITTEE_ENABLED")
995
- if comm_env is not None:
996
- data.setdefault("committee", {})["enabled"] = comm_env
997
- data.setdefault("pro", {}).setdefault("committee", {})["enabled"] = comm_env
998
-
999
- pv_env = _parse_bool("ARTEMIS_PLANNER_VALIDATION_ENABLED")
1000
- if pv_env is not None:
1001
- data.setdefault("planner_validation", {})["enabled"] = pv_env
1002
- data.setdefault("pro", {}).setdefault("planner_validation", {})["enabled"] = pv_env
1003
-
1004
- out_env = _parse_bool("ARTEMIS_OUTPUTTER_ENABLED")
1005
- if out_env is not None:
1006
- data.setdefault("outputter", {})["enabled"] = out_env
1007
-
1008
- vid_rec_env = _parse_bool("ARTEMIS_VIDEO_RECORDING_ENABLED") or _parse_bool(
1009
- "ARTEMIS_WITH_VIDEO_RECORDING_TOOLS"
1010
- )
1011
- if vid_rec_env is not None:
1012
- data.setdefault("video_analyzer", {})["enabled"] = vid_rec_env
1013
- data.setdefault("pro", {}).setdefault("video_analyzer", {})["enabled"] = vid_rec_env
1014
-
1015
- vid_env = _parse_bool("ARTEMIS_VIDEO_LEDGER_ENABLED")
1016
- if vid_env is not None:
1017
- data.setdefault("video_analyzer", {})["enable_ledger"] = vid_env
1018
- data.setdefault("pro", {}).setdefault("video_analyzer", {})["enable_ledger"] = vid_env
1019
-
1020
- return data
1021
-
1022
- def get_explorer_version(
1023
- self,
1024
- explicit_version: str | None = None,
1025
- agent_name: str | None = "operator",
1026
- profile: str | None = None,
1027
- ) -> ExplorerVersion:
1028
- """Resolve Explorer version from this configuration."""
1029
- return self.explorer.resolve(
1030
- explicit_version=explicit_version,
1031
- agent_name=agent_name,
1032
- profile=profile,
1033
- per_agent_overrides=self.explorer_versions,
1034
- )
1035
-
1036
-
1037
- def resolve_explorer_version(
1038
- ctx: Any | None = None,
1039
- explicit_version: str | None = None,
1040
- agent_or_profile_name: str | None = "operator",
1041
- ) -> ExplorerVersion:
1042
- """Resolves the active Explorer tier for a calling agent or profile.
1043
-
1044
- Precedence: explicit argument, ``ARTEMIS_EXPLORER_VERSION`` environment
1045
- override, then the user's agent configuration (per-agent override, profile
1046
- mode, default version) found on ``ctx.agent_config`` or, failing that, on
1047
- ``ctx.execution_setup``. The tier is a user setting: calling agents never
1048
- pass it themselves.
1049
- """
1050
- for source in (
1051
- getattr(ctx, "agent_config", None),
1052
- getattr(ctx, "execution_setup", None),
1053
- ):
1054
- explorer_cfg = getattr(source, "explorer", None)
1055
- if explorer_cfg is not None and hasattr(explorer_cfg, "resolve"):
1056
- return explorer_cfg.resolve(
1057
- explicit_version=explicit_version,
1058
- agent_name=agent_or_profile_name,
1059
- per_agent_overrides=getattr(source, "explorer_versions", None),
1060
- )
1061
-
1062
- return ExplorerConfig().resolve(
1063
- explicit_version=explicit_version, agent_name=agent_or_profile_name
1064
- )
1065
-
1066
-
1067
- def load_agent_config(
1068
- config_path: Path | None = None,
1069
- ) -> AgentGlobalConfig:
1070
- """Load and validate AgentGlobalConfig from artemis.jsonc or agent_config.json.
1071
-
1072
- Args:
1073
- config_path: Optional explicit file path to configuration file.
1074
-
1075
- Returns:
1076
- Validated AgentGlobalConfig instance.
1077
- """
1078
- resolved_path = config_path
1079
- if not resolved_path:
1080
- for candidate in ("artemis.jsonc", "artemis.json", AGENT_CONFIG_FILENAME):
1081
- try:
1082
- resolved_path = get_config_path(candidate)
1083
- break
1084
- except FileNotFoundError:
1085
- continue
1086
-
1087
- if not resolved_path:
1088
- resolved_path = get_config_path(AGENT_CONFIG_FILENAME, ROOT_DIR / AGENT_CONFIG_FILENAME)
1089
-
1090
- try:
1091
- with open(resolved_path, encoding="utf-8") as f:
1092
- data = load_jsonc(f)
1093
- if isinstance(data, dict) and "agent" in data:
1094
- return AgentGlobalConfig.model_validate(data["agent"])
1095
- return AgentGlobalConfig.model_validate(data)
1096
- except Exception as e:
1097
- logger.error(f"Failed to load agent config from '{resolved_path}': {e}")
1098
- raise ValueError(f"Failed to parse '{resolved_path}': {e}") from e