loopx 2.2.0__py3-none-any.whl → 2.3.0__py3-none-any.whl

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 (649) hide show
  1. loopx/__init__.py +1 -1
  2. loopx/agent_onboarding.py +12 -0
  3. loopx/agy_goal_mode/__init__.py +413 -58
  4. loopx/agy_goal_mode/host_runtime.py +237 -0
  5. loopx/ark_managed_agent_host.py +1 -1
  6. loopx/authority.py +5 -4
  7. loopx/bootstrap_command_pack.py +4 -2
  8. loopx/canary/planner.py +0 -45
  9. loopx/canary/premerge.py +4 -1
  10. loopx/canary/runner.py +22 -22
  11. loopx/capabilities/README.md +1 -0
  12. loopx/capabilities/anti_entropy/README.md +185 -0
  13. loopx/capabilities/anti_entropy/__init__.py +47 -0
  14. loopx/capabilities/anti_entropy/agent_tool.py +29 -0
  15. loopx/capabilities/anti_entropy/catalog_entry.py +112 -0
  16. loopx/capabilities/anti_entropy/cli.py +47 -0
  17. loopx/capabilities/anti_entropy/contract.py +158 -0
  18. loopx/capabilities/anti_entropy/feedback.py +252 -0
  19. loopx/capabilities/anti_entropy/js_reference.py +1146 -0
  20. loopx/capabilities/anti_entropy/oracles.py +1329 -0
  21. loopx/capabilities/anti_entropy/turn_context.py +582 -0
  22. loopx/capabilities/benchmark_toolkit/README.md +83 -0
  23. loopx/capabilities/benchmark_toolkit/__init__.py +6 -0
  24. loopx/capabilities/benchmark_toolkit/catalog_entry.py +31 -0
  25. loopx/capabilities/benchmark_toolkit/concurrency_envelope.py +47 -40
  26. loopx/capabilities/benchmark_toolkit/experiment_board.py +24 -6
  27. loopx/capabilities/benchmark_toolkit/integrity.py +180 -10
  28. loopx/capabilities/benchmark_toolkit/terminal_followthrough.py +138 -0
  29. loopx/capabilities/benchmark_toolkit/trajectory_assessment_store.py +158 -66
  30. loopx/capabilities/benchmark_toolkit/trajectory_tool_context.py +13 -6
  31. loopx/capabilities/catalog.py +2 -0
  32. loopx/capabilities/change_quality/policy.py +4 -3
  33. loopx/capabilities/change_quality/result.py +30 -17
  34. loopx/capabilities/change_quality/scope.py +73 -16
  35. loopx/capabilities/configuration_ui.py +17 -7
  36. loopx/capabilities/context_providers/openviking.py +17 -9
  37. loopx/capabilities/decision_context/outcome_feedback.py +1 -1
  38. loopx/capabilities/decision_context/packets.py +19 -19
  39. loopx/capabilities/explore/README.md +48 -5
  40. loopx/capabilities/explore/composition_frontier.py +10 -8
  41. loopx/capabilities/explore/execution_observation.py +3 -2
  42. loopx/capabilities/explore/harness_gate.py +4 -3
  43. loopx/capabilities/explore/machine_defaults.py +4 -3
  44. loopx/capabilities/explore/measurements.py +3 -2
  45. loopx/capabilities/explore/research_frontier.py +9 -4
  46. loopx/capabilities/explore/result_log.py +26 -14
  47. loopx/capabilities/explore/result_writeback.py +35 -7
  48. loopx/capabilities/explore/speculative_scheduler.py +6 -5
  49. loopx/capabilities/explore/todo_branch_plan.py +1 -1
  50. loopx/capabilities/explore/turn_context.py +54 -14
  51. loopx/capabilities/integration_branch/core.py +156 -10
  52. loopx/capabilities/issue_fix/README.md +76 -11
  53. loopx/capabilities/issue_fix/README.zh-CN.md +57 -7
  54. loopx/capabilities/issue_fix/cli.py +126 -16
  55. loopx/capabilities/issue_fix/correction_settlement.py +407 -0
  56. loopx/capabilities/issue_fix/github_public.py +75 -0
  57. loopx/capabilities/issue_fix/pr_lifecycle.py +731 -21
  58. loopx/capabilities/issue_fix/pr_wait_reconcile.py +3 -4
  59. loopx/capabilities/issue_fix/reviewer_notification.py +5 -4
  60. loopx/capabilities/machine_configuration/context_delivery.py +37 -13
  61. loopx/capabilities/manager_context/README.md +143 -4
  62. loopx/capabilities/manager_context/chat_history.py +5 -3
  63. loopx/capabilities/manager_context/discovery.py +59 -11
  64. loopx/capabilities/manager_context/inspection.py +58 -7
  65. loopx/capabilities/manager_context/presentation.py +11 -2
  66. loopx/capabilities/manager_context/report_source.py +1 -1
  67. loopx/capabilities/manager_context/roundtrip.py +72 -6
  68. loopx/capabilities/material_lifecycle/_validation.py +7 -0
  69. loopx/capabilities/material_lifecycle/ranking.py +2 -4
  70. loopx/capabilities/material_lifecycle/rebuild.py +2 -4
  71. loopx/capabilities/native_chat/antigravity_activity.py +123 -0
  72. loopx/capabilities/native_chat/antigravity_adapter.py +1335 -0
  73. loopx/capabilities/native_chat/codex_adapter.py +673 -24
  74. loopx/capabilities/native_chat/codex_auth.py +84 -0
  75. loopx/capabilities/native_chat/codex_context.py +70 -0
  76. loopx/capabilities/native_chat/conversation_bindings.py +7 -2
  77. loopx/capabilities/native_chat/external_conversations.py +1102 -52
  78. loopx/capabilities/native_chat/file_discovery.py +69 -0
  79. loopx/capabilities/native_chat/manager_context.py +117 -0
  80. loopx/capabilities/native_chat/manager_input.py +76 -0
  81. loopx/capabilities/native_chat/model_settings.py +65 -4
  82. loopx/capabilities/native_chat/queue_api.py +92 -0
  83. loopx/capabilities/native_chat/result_review_evidence.py +54 -0
  84. loopx/capabilities/native_chat/steward_managed_mode.py +42 -15
  85. loopx/capabilities/native_chat/steward_reports.py +7 -0
  86. loopx/capabilities/native_chat/steward_turn.py +107 -27
  87. loopx/capabilities/periodic_report/README.md +6 -0
  88. loopx/capabilities/periodic_report/cli.py +16 -1
  89. loopx/capabilities/periodic_report/goal_configuration.py +7 -1
  90. loopx/capabilities/periodic_report/machine_defaults.py +10 -0
  91. loopx/capabilities/periodic_report/post_writeback_hook.py +61 -35
  92. loopx/capabilities/periodic_report/private_generation.py +1 -1
  93. loopx/capabilities/periodic_report/review.py +143 -0
  94. loopx/capabilities/pr_review_queue/README.md +17 -8
  95. loopx/capabilities/pr_review_queue/approval_closeout.py +3 -2
  96. loopx/capabilities/pr_review_queue/github_source.py +13 -7
  97. loopx/capabilities/pr_review_queue/merge_readiness.py +22 -2
  98. loopx/capabilities/pr_review_queue/order.py +3 -2
  99. loopx/capabilities/progress_review/context.py +36 -51
  100. loopx/capabilities/repository_change_window/repository.py +59 -6
  101. loopx/capabilities/reward_memory/application.py +8 -2
  102. loopx/capabilities/reward_memory/experiment.py +3 -2
  103. loopx/capabilities/reward_memory/registry.py +1 -1
  104. loopx/capabilities/reward_memory/scoped_feedback.py +3 -2
  105. loopx/capabilities/semantic_preference/__init__.py +32 -9
  106. loopx/capabilities/steward_executor/machine_defaults.py +2 -0
  107. loopx/capabilities/todo_replan_cadence/goal_configuration.py +1 -1
  108. loopx/capabilities/todo_replan_cadence/machine_defaults.py +28 -10
  109. loopx/capabilities/turn_context.py +19 -11
  110. loopx/{chat_automation_cadence_api.py → chat/automation_cadence_api.py} +2 -2
  111. loopx/{chat_completed_todos.py → chat/completed_todos.py} +56 -34
  112. loopx/{chat_coordination.py → chat/coordination.py} +42 -25
  113. loopx/{chat_endpoint_catalog.py → chat/endpoint_catalog.py} +32 -4
  114. loopx/{chat_goal_configuration_api.py → chat/goal_configuration_api.py} +25 -20
  115. loopx/{chat_goal_subagent_api.py → chat/goal_subagent_api.py} +5 -5
  116. loopx/{chat_machine_configuration_api.py → chat/machine_configuration_api.py} +10 -5
  117. loopx/{chat_manager_details.py → chat/manager_details.py} +4 -4
  118. loopx/{chat_manager_history.py → chat/manager_history.py} +6 -6
  119. loopx/{chat_monitor_actions.py → chat/monitor_actions.py} +4 -4
  120. loopx/{chat_session_open.py → chat/session_open.py} +1 -1
  121. loopx/{chat_ssh_source_api.py → chat/ssh_source_api.py} +3 -3
  122. loopx/{chat_status_api.py → chat/status_api.py} +20 -20
  123. loopx/{chat_todo_actions.py → chat/todo_actions.py} +6 -6
  124. loopx/{chat_todo_detail.py → chat/todo_detail.py} +3 -3
  125. loopx/{chat_usage_statistics_api.py → chat/usage_statistics_api.py} +1 -1
  126. loopx/{chat_workspace_directory.py → chat/workspace_directory.py} +6 -6
  127. loopx/chat.py +117 -21
  128. loopx/chat_action_normalization.py +2 -0
  129. loopx/chat_actions.py +28 -2
  130. loopx/chat_agent.py +107 -78
  131. loopx/chat_endpoints.py +1 -0
  132. loopx/chat_ingress.py +215 -7
  133. loopx/chat_loopx_mode.py +2 -1
  134. loopx/chat_manager.py +83 -10
  135. loopx/chat_manager_context.py +36 -3
  136. loopx/chat_runtime.py +412 -257
  137. loopx/chat_server.py +31 -20
  138. loopx/chat_store.py +94 -45
  139. loopx/claude_goal_mode/scripts/install.py +18 -11
  140. loopx/cli.py +16 -79
  141. loopx/cli_commands/anti_entropy.py +219 -0
  142. loopx/cli_commands/benchmark_concurrency.py +43 -2
  143. loopx/cli_commands/benchmark_dispatch.py +2 -0
  144. loopx/cli_commands/benchmark_experiment_board.py +3 -0
  145. loopx/cli_commands/benchmark_trajectory.py +6 -0
  146. loopx/cli_commands/context_machine.py +53 -10
  147. loopx/cli_commands/explore_feishu_commands.py +2 -0
  148. loopx/cli_commands/lark_kanban.py +34 -1
  149. loopx/cli_commands/manager_inbox.py +11 -0
  150. loopx/cli_commands/project_lifecycle_refresh_state.py +25 -28
  151. loopx/cli_commands/quota.py +68 -58
  152. loopx/cli_commands/quota_action_selection.py +1 -0
  153. loopx/cli_commands/quota_capture.py +466 -521
  154. loopx/cli_commands/quota_context.py +23 -7
  155. loopx/cli_commands/quota_context_reader.py +650 -0
  156. loopx/cli_commands/quota_monitor_poll.py +3 -1
  157. loopx/cli_commands/quota_presentation.py +2 -3
  158. loopx/cli_commands/quota_registration.py +20 -7
  159. loopx/cli_commands/quota_reward_memory.py +5 -20
  160. loopx/cli_commands/refresh_settlement.py +198 -50
  161. loopx/cli_commands/registry_admin.py +2 -0
  162. loopx/cli_commands/registry_admin_configure.py +8 -0
  163. loopx/cli_commands/slash_commands.py +21 -0
  164. loopx/cli_commands/support_control.py +21 -73
  165. loopx/cli_commands/support_control_heartbeat.py +52 -3
  166. loopx/cli_commands/support_control_heartbeat_registration.py +10 -2
  167. loopx/cli_commands/support_control_update.py +9 -4
  168. loopx/cli_commands/support_control_upgrade.py +6 -2
  169. loopx/cli_commands/task_lease.py +10 -6
  170. loopx/cli_commands/task_lease_arguments.py +10 -13
  171. loopx/cli_commands/todo.py +12 -3
  172. loopx/cli_commands/todo_argument_validation.py +9 -5
  173. loopx/cli_commands/todo_event.py +95 -3
  174. loopx/cli_commands/todo_list.py +1 -0
  175. loopx/cli_commands/todo_registration.py +9 -0
  176. loopx/cli_commands/turn.py +58 -34
  177. loopx/cli_commands/turn_decision.py +19 -10
  178. loopx/cli_commands/turn_host_request.py +5 -6
  179. loopx/cli_commands/turn_inspection.py +4 -2
  180. loopx/cli_commands/turn_post_writeback.py +33 -8
  181. loopx/cli_commands/turn_registration.py +6 -0
  182. loopx/cli_commands/turn_rendering.py +34 -0
  183. loopx/cli_commands/turn_run_once.py +63 -100
  184. loopx/cli_commands/turn_todo_writeback.py +1 -51
  185. loopx/cli_commands/update_artifact.py +16 -3
  186. loopx/cli_commands/update_operation.py +3 -1
  187. loopx/cli_commands/usage_ping.py +5 -0
  188. loopx/cli_commands/workflow_skills.py +14 -1
  189. loopx/cli_runtime.py +186 -13
  190. loopx/codex_app_thread_activity.py +48 -0
  191. loopx/collaboration_mcp.py +42 -29
  192. loopx/command_invocation.py +34 -3
  193. loopx/configure_goal.py +4 -0
  194. loopx/contract.py +225 -48
  195. loopx/control_plane/agents/agent_lane_recommendation.py +12 -11
  196. loopx/control_plane/agents/agent_scope.py +13 -8
  197. loopx/control_plane/agents/capability_gate.py +4 -3
  198. loopx/control_plane/agents/capability_memory.py +9 -3
  199. loopx/control_plane/agents/legacy_migration.py +3 -2
  200. loopx/control_plane/agents/profile.py +29 -11
  201. loopx/control_plane/agents/workspace_guard.py +4 -3
  202. loopx/control_plane/capabilities/benchmark_terminal_followthrough.ts +115 -0
  203. loopx/control_plane/capabilities/explore_execution_observation.ts +3 -1
  204. loopx/control_plane/capabilities/explore_measurements.ts +12 -4
  205. loopx/control_plane/capabilities/explore_result_writeback.ts +68 -11
  206. loopx/control_plane/capabilities/explore_turn_context.ts +53 -2
  207. loopx/control_plane/capabilities/trajectory_assessment.ts +2 -0
  208. loopx/control_plane/capabilities/trajectory_assessment_types.ts +15 -0
  209. loopx/control_plane/capabilities/trajectory_case_study.ts +80 -0
  210. loopx/control_plane/capabilities/trajectory_codex_usage.ts +5 -0
  211. loopx/control_plane/capabilities/trajectory_loopx_requests.ts +96 -0
  212. loopx/control_plane/capabilities/trajectory_tool_context.ts +2 -2
  213. loopx/control_plane/capabilities/trajectory_usage_comparison.ts +107 -0
  214. loopx/control_plane/capability_hooks.py +42 -3
  215. loopx/control_plane/chat_turn_acceptance.py +49 -0
  216. loopx/control_plane/collaboration/conversation_binding.ts +1032 -48
  217. loopx/control_plane/collaboration/conversation_inventory.py +17 -16
  218. loopx/control_plane/collaboration/conversation_reply_context.ts +42 -2
  219. loopx/control_plane/collaboration/conversation_scope.ts +43 -0
  220. loopx/control_plane/collaboration/delegation.ts +1 -21
  221. loopx/control_plane/collaboration/goal_instance_lifecycle.ts +18 -1
  222. loopx/control_plane/collaboration/goal_instance_scope.py +45 -4
  223. loopx/control_plane/collaboration/inbox.py +21 -16
  224. loopx/control_plane/collaboration/inbox_read.ts +40 -16
  225. loopx/control_plane/collaboration/inbox_receipts.ts +25 -6
  226. loopx/control_plane/collaboration/links.py +30 -12
  227. loopx/control_plane/collaboration/peer_host_route.py +11 -1
  228. loopx/control_plane/collaboration/peers.py +59 -12
  229. loopx/control_plane/collaboration/result_publication.ts +58 -3
  230. loopx/control_plane/collaboration/return_delivery.ts +28 -10
  231. loopx/control_plane/collaboration/steward_managed_mode.ts +14 -4
  232. loopx/control_plane/collaboration/turn_context.ts +10 -3
  233. loopx/control_plane/coordination/authority_store.ts +20 -0
  234. loopx/control_plane/coordination/canonical_snapshot_page.ts +3 -5
  235. loopx/control_plane/coordination/claim_execution.ts +38 -11
  236. loopx/control_plane/coordination/claim_execution_recovery.ts +66 -0
  237. loopx/control_plane/coordination/local_authority.py +82 -60
  238. loopx/control_plane/coordination/local_authority_runtime.ts +36 -3
  239. loopx/control_plane/coordination/local_authority_shadow.ts +0 -8
  240. loopx/control_plane/coordination/sqlite_authority_store.ts +26 -1
  241. loopx/control_plane/coordination/task_lease_lifecycle.ts +2 -0
  242. loopx/control_plane/coordination/todo_claim.ts +8 -3
  243. loopx/control_plane/coordination/todo_terminal_lifecycle.ts +188 -61
  244. loopx/control_plane/coordination/todo_terminal_reentry.ts +4 -2
  245. loopx/control_plane/coordination/todo_update.ts +11 -3
  246. loopx/control_plane/effect_program.py +3 -0
  247. loopx/control_plane/effect_program.ts +3 -0
  248. loopx/control_plane/effect_runtime.py +107 -34
  249. loopx/control_plane/effect_runtime_errors.ts +10 -2
  250. loopx/control_plane/effect_runtime_handlers.ts +29 -63
  251. loopx/control_plane/effect_runtime_server.ts +3 -29
  252. loopx/control_plane/effect_runtime_snapshot.ts +17 -2
  253. loopx/control_plane/effect_runtime_snapshot_methods.json +31 -0
  254. loopx/control_plane/goal_vision_lifecycle.json +3 -0
  255. loopx/control_plane/goals/acceptance.py +4 -1
  256. loopx/control_plane/goals/acceptance_authority.ts +16 -6
  257. loopx/control_plane/goals/acceptance_contract.ts +15 -6
  258. loopx/control_plane/goals/active_state_metadata.py +28 -0
  259. loopx/control_plane/goals/contract_health.py +3 -3
  260. loopx/control_plane/goals/creation_outcome.ts +22 -0
  261. loopx/control_plane/goals/global_registry_health.py +64 -1
  262. loopx/control_plane/goals/goal_frontier/__init__.py +20 -17
  263. loopx/control_plane/goals/goal_frontier/acceptance.py +3 -2
  264. loopx/control_plane/goals/goal_frontier/ack_policy.py +5 -3
  265. loopx/control_plane/goals/goal_frontier/fallback_source.py +4 -3
  266. loopx/control_plane/goals/goal_frontier/outcome_continuity.py +57 -46
  267. loopx/control_plane/goals/goal_frontier/semantic_history.py +6 -5
  268. loopx/control_plane/goals/goal_frontier/terminal.py +10 -4
  269. loopx/control_plane/goals/goal_vision_state.py +5 -9
  270. loopx/control_plane/goals/goal_vision_wait.py +14 -0
  271. loopx/control_plane/goals/outcome_requirements.ts +46 -7
  272. loopx/control_plane/goals/source_session_registry_state.py +1 -1
  273. loopx/control_plane/goals/start_contract.py +22 -1
  274. loopx/control_plane/goals/start_goal_todo_delta.py +31 -2
  275. loopx/control_plane/goals/task_planning.py +13 -1
  276. loopx/control_plane/goals/vision_checkpoint.py +5 -3
  277. loopx/control_plane/goals/vision_checkpoint.ts +125 -28
  278. loopx/control_plane/goals/vision_wait_coverage.ts +9 -75
  279. loopx/control_plane/governed_capability.ts +0 -6
  280. loopx/control_plane/heartbeat/bootstrap_prompt.py +10 -3
  281. loopx/control_plane/heartbeat/budget.py +5 -4
  282. loopx/control_plane/heartbeat/builder.py +40 -17
  283. loopx/control_plane/heartbeat/host.py +1 -0
  284. loopx/control_plane/heartbeat/task_body.py +12 -1
  285. loopx/control_plane/post_writeback_composition_retry.py +5 -3
  286. loopx/control_plane/presentation/action_review_plan.ts +26 -0
  287. loopx/control_plane/presentation/explore_history.ts +16 -5
  288. loopx/control_plane/presentation/global_manager_read.ts +255 -0
  289. loopx/control_plane/presentation/global_risk_read.ts +338 -0
  290. loopx/control_plane/presentation/goal_source_links.ts +51 -7
  291. loopx/control_plane/presentation/owner_attention.ts +23 -1
  292. loopx/control_plane/presentation/report_review.ts +44 -0
  293. loopx/control_plane/presentation/report_review_binding.ts +8 -0
  294. loopx/control_plane/projection_envelope_facts.py +7 -6
  295. loopx/control_plane/quota/_supporting_projections.py +7 -6
  296. loopx/control_plane/quota/adaptive_children.ts +223 -0
  297. loopx/control_plane/quota/blocked_retry.py +8 -7
  298. loopx/control_plane/quota/cli_projection.py +92 -247
  299. loopx/control_plane/quota/context_delivery.ts +34 -12
  300. loopx/control_plane/quota/context_selection.ts +90 -9
  301. loopx/control_plane/quota/decision_summary.py +6 -5
  302. loopx/control_plane/quota/diagnostic_projection.ts +125 -12
  303. loopx/control_plane/quota/effect_program.py +59 -11
  304. loopx/control_plane/quota/execution_preparation.py +198 -0
  305. loopx/control_plane/quota/goal_boundary.py +19 -18
  306. loopx/control_plane/quota/heartbeat_recommendation.py +12 -11
  307. loopx/control_plane/quota/host_poll_receipts.py +0 -44
  308. loopx/control_plane/quota/ledger_readback.py +5 -4
  309. loopx/control_plane/quota/live_decision.py +88 -7
  310. loopx/control_plane/quota/monitor_poll.py +7 -7
  311. loopx/control_plane/quota/native_context_lifecycle.ts +36 -0
  312. loopx/control_plane/quota/progressive_context.ts +595 -24
  313. loopx/control_plane/quota/projection_repair.py +36 -25
  314. loopx/control_plane/quota/recent_runs.py +10 -9
  315. loopx/control_plane/quota/scheduler_ack.py +9 -8
  316. loopx/control_plane/quota/settlement.py +114 -47
  317. loopx/control_plane/quota/settlement_cli.py +5 -4
  318. loopx/control_plane/quota/settlement_plan.ts +37 -22
  319. loopx/control_plane/quota/settlement_precedence.py +3 -1
  320. loopx/control_plane/quota/settlement_readback.ts +44 -15
  321. loopx/control_plane/quota/settlement_validation.py +29 -3
  322. loopx/control_plane/quota/settlement_workspace_causality.py +4 -3
  323. loopx/control_plane/quota/should_run.py +5 -4
  324. loopx/control_plane/quota/should_run_packet.py +29 -8
  325. loopx/control_plane/quota/should_run_prepare.py +79 -64
  326. loopx/control_plane/quota/slot_accounting.py +18 -16
  327. loopx/control_plane/quota/spend_sources.py +37 -23
  328. loopx/control_plane/quota/stall_repair.py +5 -4
  329. loopx/control_plane/quota/task_orchestration.py +8 -7
  330. loopx/control_plane/quota/task_orchestration_admission.py +99 -451
  331. loopx/control_plane/quota/turn_envelope.py +253 -43
  332. loopx/control_plane/quota/turn_envelope.ts +1218 -267
  333. loopx/control_plane/quota/usage_collector.py +15 -7
  334. loopx/control_plane/reward_memory.py +16 -5
  335. loopx/control_plane/runtime/agent_evidence_history.py +3 -2
  336. loopx/control_plane/runtime/decision_freshness.py +5 -4
  337. loopx/control_plane/runtime/document_io.py +22 -2
  338. loopx/control_plane/runtime/execution_identity.ts +11 -5
  339. loopx/control_plane/runtime/local_state_migration.py +30 -20
  340. loopx/control_plane/runtime/local_state_write_correctness.py +0 -73
  341. loopx/control_plane/runtime/private_permissions.py +198 -0
  342. loopx/control_plane/runtime/run_context_retention.py +4 -3
  343. loopx/control_plane/runtime/runtime_projection_route.py +2 -2
  344. loopx/control_plane/runtime/usage_statistics.ts +15 -9
  345. loopx/control_plane/runtime/usage_statistics_cli.ts +3 -1
  346. loopx/control_plane/runtime/usage_statistics_environment.ts +49 -0
  347. loopx/control_plane/runtime/validation_command.py +36 -2
  348. loopx/control_plane/runtime_decode.ts +37 -0
  349. loopx/control_plane/scheduler/arbitration.py +14 -5
  350. loopx/control_plane/scheduler/automation_liveness.py +5 -4
  351. loopx/control_plane/scheduler/execution_context.py +52 -24
  352. loopx/control_plane/scheduler/external_evidence_observation.py +7 -6
  353. loopx/control_plane/scheduler/heartbeat_followup_cli.ts +12 -0
  354. loopx/control_plane/scheduler/hint.ts +8 -3
  355. loopx/control_plane/scheduler/hint_followup.ts +2 -1
  356. loopx/control_plane/scheduler/monitor_batch_receipts.py +1 -1
  357. loopx/control_plane/scheduler/monitor_todo.py +3 -2
  358. loopx/control_plane/state_recovery_io.py +22 -2
  359. loopx/control_plane/status/autonomous_replan_projection.py +3 -1
  360. loopx/control_plane/status/goal_source.py +30 -14
  361. loopx/control_plane/stride_decision_schema.json +1 -0
  362. loopx/control_plane/subagent_context.ts +18 -14
  363. loopx/control_plane/testing/actual_default_model_behavior_portfolio.py +8 -3
  364. loopx/control_plane/testing/canary_harness.py +7 -0
  365. loopx/control_plane/testing/capability_monitor_repair_tool_behavior.py +19 -3
  366. loopx/control_plane/testing/cli_output_budget.py +68 -22
  367. loopx/control_plane/testing/cli_output_differential.py +83 -2
  368. loopx/control_plane/testing/cli_output_semantics.py +1 -1
  369. loopx/control_plane/testing/doubao_model_behavior_actor.py +5 -1
  370. loopx/control_plane/testing/model_tool_behavior.py +135 -0
  371. loopx/control_plane/testing/replan_semantic_action_behavior.py +492 -75
  372. loopx/control_plane/testing/replan_vision_closeout_behavior.py +26 -21
  373. loopx/control_plane/testing/scoped_gate_successor_tool_behavior.py +32 -34
  374. loopx/control_plane/testing/selected_todo_tool_behavior.py +16 -2
  375. loopx/control_plane/testing/terminal_settlement_tool_behavior.py +89 -15
  376. loopx/control_plane/todos/active_state_editing.py +0 -31
  377. loopx/control_plane/todos/authoring_scope.ts +5 -1
  378. loopx/control_plane/todos/automatic_resume.ts +79 -0
  379. loopx/control_plane/todos/completion_state.py +3 -2
  380. loopx/control_plane/todos/completion_transaction.py +5 -4
  381. loopx/control_plane/todos/completion_validation.py +23 -89
  382. loopx/control_plane/todos/completion_validation_accountability.py +8 -1
  383. loopx/control_plane/todos/completion_validation_store.py +7 -6
  384. loopx/control_plane/todos/context_projection.ts +18 -4
  385. loopx/control_plane/todos/decision_scope.py +58 -8
  386. loopx/control_plane/todos/decision_scope.ts +88 -1
  387. loopx/control_plane/todos/durable_completion.py +125 -237
  388. loopx/control_plane/todos/field_update.ts +2 -10
  389. loopx/control_plane/todos/goal_todo_projection.py +78 -22
  390. loopx/control_plane/todos/handoff_note.py +11 -4
  391. loopx/control_plane/todos/list_readback.py +2 -0
  392. loopx/control_plane/todos/machine_region.py +1 -0
  393. loopx/control_plane/todos/machine_section_projection.py +406 -21
  394. loopx/control_plane/todos/markdown.py +17 -8
  395. loopx/control_plane/todos/mutation_response.py +0 -115
  396. loopx/control_plane/todos/provider_projection.py +6 -0
  397. loopx/control_plane/todos/provider_terminal_lifecycle.py +12 -0
  398. loopx/control_plane/todos/provider_update.py +4 -1
  399. loopx/control_plane/todos/quota_selection.py +122 -11
  400. loopx/control_plane/todos/quota_selection.ts +318 -3
  401. loopx/control_plane/todos/quota_summary.py +133 -309
  402. loopx/control_plane/todos/read_codec.ts +36 -2
  403. loopx/control_plane/todos/read_projection.ts +158 -5
  404. loopx/control_plane/todos/read_transaction.ts +194 -18
  405. loopx/control_plane/todos/read_transport.ts +15 -5
  406. loopx/control_plane/todos/resume_planning.ts +46 -2
  407. loopx/control_plane/todos/standing_decision.py +2 -33
  408. loopx/control_plane/todos/standing_decision.ts +0 -9
  409. loopx/control_plane/todos/succession_warning.py +3 -2
  410. loopx/control_plane/todos/summary_item.py +175 -0
  411. loopx/control_plane/todos/summary_lanes.ts +7 -1
  412. loopx/control_plane/todos/todo_index.py +3 -2
  413. loopx/control_plane/todos/todo_semantics.py +6 -4
  414. loopx/control_plane/todos/todo_summary.py +10 -9
  415. loopx/control_plane/todos/user_gate.py +5 -0
  416. loopx/control_plane/todos/work_requirements.ts +11 -1
  417. loopx/control_plane/turn_driver/capability_context.ts +47 -6
  418. loopx/control_plane/turn_driver/chat_queue_steering.ts +163 -0
  419. loopx/control_plane/turn_driver/codex_agent_session.py +6 -3
  420. loopx/control_plane/turn_driver/codex_cli.py +109 -40
  421. loopx/control_plane/turn_driver/codex_context.py +384 -55
  422. loopx/control_plane/turn_driver/codex_context_history.py +10 -11
  423. loopx/control_plane/turn_driver/codex_execution_preparation.py +389 -0
  424. loopx/control_plane/turn_driver/codex_input_trace.py +3 -4
  425. loopx/control_plane/turn_driver/codex_operation_host.py +14 -9
  426. loopx/control_plane/turn_driver/codex_sessions.py +40 -15
  427. loopx/control_plane/turn_driver/codex_stdio.py +31 -0
  428. loopx/control_plane/turn_driver/command_validation.py +10 -0
  429. loopx/control_plane/turn_driver/decision_capture.py +375 -47
  430. loopx/control_plane/turn_driver/driver.py +172 -65
  431. loopx/control_plane/turn_driver/dsh_operation_host.py +5 -5
  432. loopx/control_plane/turn_driver/executor.py +138 -77
  433. loopx/control_plane/turn_driver/host_bridge_transport.py +58 -7
  434. loopx/control_plane/turn_driver/host_candidate.py +199 -76
  435. loopx/control_plane/turn_driver/host_failure.py +14 -0
  436. loopx/control_plane/turn_driver/host_failure.ts +29 -0
  437. loopx/control_plane/turn_driver/journal_store.py +15 -6
  438. loopx/control_plane/turn_driver/lane_fence.py +6 -0
  439. loopx/control_plane/turn_driver/loop_controller.py +16 -15
  440. loopx/control_plane/turn_driver/loop_controller.ts +12 -4
  441. loopx/control_plane/turn_driver/managed_step.py +1 -2
  442. loopx/control_plane/turn_driver/native_context_profile.py +20 -0
  443. loopx/control_plane/turn_driver/native_context_selection.py +94 -0
  444. loopx/control_plane/turn_driver/native_first_read.py +75 -0
  445. loopx/control_plane/turn_driver/session_recovery.py +16 -3
  446. loopx/control_plane/turn_driver/settlement.py +11 -2
  447. loopx/control_plane/turn_driver/subagent_execution_topology.py +3 -1
  448. loopx/control_plane/turn_driver/turn_journal.ts +28 -28
  449. loopx/control_plane/turn_driver/turn_journal_effects.ts +15 -25
  450. loopx/control_plane/turn_driver/turn_journal_query.ts +12 -5
  451. loopx/control_plane/turn_driver/turn_journal_runtime.py +4 -0
  452. loopx/control_plane/work_items/action_selection_admission.ts +12 -1
  453. loopx/control_plane/work_items/action_selection_contract.py +1 -0
  454. loopx/control_plane/work_items/attention_queue.py +5 -1
  455. loopx/control_plane/work_items/attention_routing.py +8 -2
  456. loopx/control_plane/work_items/autonomous_replan_obligation.py +4 -0
  457. loopx/control_plane/work_items/capability_monitor_fallback.py +6 -5
  458. loopx/control_plane/work_items/context_readback.py +21 -36
  459. loopx/control_plane/work_items/delivery_history.py +1 -1
  460. loopx/control_plane/work_items/execution_preparation.ts +129 -0
  461. loopx/control_plane/work_items/interaction_contract.py +124 -47
  462. loopx/control_plane/work_items/interaction_contract.ts +145 -25
  463. loopx/control_plane/work_items/issue_meta_surface.py +1 -1
  464. loopx/control_plane/work_items/operator_inbox.py +4 -1
  465. loopx/control_plane/work_items/planning_inventory.py +4 -2
  466. loopx/control_plane/work_items/primary_action.py +0 -26
  467. loopx/control_plane/work_items/progress_observation.py +3 -2
  468. loopx/control_plane/work_items/progress_review_evidence.ts +78 -3
  469. loopx/control_plane/work_items/project_asset.py +7 -0
  470. loopx/control_plane/work_items/repair_delta.py +1 -1
  471. loopx/control_plane/work_items/replan_context.ts +3 -3
  472. loopx/control_plane/work_items/replan_context_codec.py +8 -7
  473. loopx/control_plane/work_items/replan_history.ts +14 -8
  474. loopx/control_plane/work_items/replan_history_codec.py +3 -1
  475. loopx/control_plane/work_items/replan_history_settlement.ts +3 -1
  476. loopx/control_plane/work_items/replan_semantics.ts +16 -10
  477. loopx/control_plane/work_items/replan_semantics_codec.py +4 -3
  478. loopx/control_plane/work_items/replan_settlement.py +3 -0
  479. loopx/control_plane/work_items/replan_settlement.ts +22 -4
  480. loopx/control_plane/work_items/runtime_capability_reentry.py +6 -5
  481. loopx/control_plane/work_items/semantic_replan_writeback.py +9 -16
  482. loopx/control_plane/work_items/stride_policy.ts +30 -46
  483. loopx/control_plane/work_items/task_graph.py +199 -988
  484. loopx/control_plane/work_items/task_graph.ts +676 -28
  485. loopx/control_plane/work_items/task_lease_acquire.ts +2 -55
  486. loopx/control_plane/work_items/task_lease_acquire_decision.ts +156 -57
  487. loopx/control_plane/work_items/task_lease_eligibility.ts +0 -34
  488. loopx/control_plane/work_items/work_lane_context.py +6 -5
  489. loopx/control_plane/work_items/write_scope_codec.ts +102 -0
  490. loopx/control_plane/work_items/yardstick_decision.py +24 -0
  491. loopx/control_plane/work_items/yardstick_decision.ts +194 -0
  492. loopx/desktop_installation.py +2 -1
  493. loopx/doctor.py +126 -28
  494. loopx/doctor_git.py +193 -106
  495. loopx/domain_packs/issue_fix.py +83 -2
  496. loopx/domain_state.py +18 -16
  497. loopx/dsh_goal_mode/turn_host_adapter.py +44 -22
  498. loopx/entrypoint.py +1 -0
  499. loopx/execution_profile.py +26 -10
  500. loopx/explore_graph.py +6 -5
  501. loopx/extensions/codex_native_child.py +10 -2
  502. loopx/extensions/lark/README.md +4 -2
  503. loopx/extensions/lark/event_collector.py +102 -13
  504. loopx/extensions/lark/event_inbox.py +6 -4
  505. loopx/extensions/lark/goal_topic_runtime_service.py +58 -9
  506. loopx/extensions/lark/inbox_reactions.py +73 -9
  507. loopx/extensions/lark/manager_context.py +11 -0
  508. loopx/extensions/lark/manager_returns.py +44 -9
  509. loopx/extensions/lark/owner_attention.py +42 -1
  510. loopx/extensions/lark/presentation/explore_record_values.py +99 -0
  511. loopx/extensions/lark/presentation/explore_results.py +198 -83
  512. loopx/extensions/lark/presentation/explore_stage_document.py +23 -8
  513. loopx/extensions/lark/presentation/kanban.py +159 -40
  514. loopx/extensions/lark/private_conversation_api.py +22 -1
  515. loopx/extensions/lark/private_conversations.py +438 -169
  516. loopx/extensions/lark/private_delivery_discovery.py +65 -0
  517. loopx/extensions/lark/private_ingress.py +239 -2
  518. loopx/extensions/lark/private_progress.py +34 -5
  519. loopx/extensions/manifest.py +1 -1
  520. loopx/extensions/process_runtime.py +135 -51
  521. loopx/extensions/turn_host.py +3 -1
  522. loopx/feedback.py +46 -14
  523. loopx/file_lock.py +29 -3
  524. loopx/global_registry.py +77 -16
  525. loopx/global_risks.py +73 -996
  526. loopx/global_todos.py +205 -173
  527. loopx/goal_portfolio.py +7 -2
  528. loopx/help_surface.py +1 -2
  529. loopx/history.py +8 -7
  530. loopx/host_loop_activation.py +22 -2
  531. loopx/hosts/checkpoint_retention.py +19 -6
  532. loopx/hosts/codex_checkpoint.py +132 -26
  533. loopx/hosts/managed_service_runtime.py +366 -0
  534. loopx/hosts/research_checkpoint.py +41 -4
  535. loopx/hosts/skill_facade.py +30 -1
  536. loopx/install_contract.py +1 -1
  537. loopx/kunluncode_goal_mode/runtime.py +30 -0
  538. loopx/long_task_cadence.py +4 -3
  539. loopx/orchestration.py +3 -2
  540. loopx/pr_review.py +9 -5
  541. loopx/presentation/answer_instruction.py +32 -1
  542. loopx/presentation/background_services_api.py +5 -1
  543. loopx/presentation/codex_accounts_api.py +1 -1
  544. loopx/presentation/configuration_api.py +4 -4
  545. loopx/presentation/explore_results_api.py +81 -5
  546. loopx/presentation/goal_source_routing.py +55 -4
  547. loopx/presentation/renderers/quota_markdown.py +8 -6
  548. loopx/presentation/report_reviews_api.py +33 -0
  549. loopx/presentation/research_analysis_api.py +31 -8
  550. loopx/presentation/runtime_workspace.py +1 -1
  551. loopx/project_prompt.py +2 -2
  552. loopx/public_safe_text.py +15 -2
  553. loopx/quota.py +38 -37
  554. loopx/registry.py +77 -37
  555. loopx/release_manifest.py +7 -3
  556. loopx/runtime.py +3 -2
  557. loopx/runtime_activation.py +60 -14
  558. loopx/semantics/vocabulary_v0.json +4 -2
  559. loopx/skill_install_readback.py +11 -9
  560. loopx/slash_command_install.py +194 -12
  561. loopx/slash_commands.py +4 -2
  562. loopx/state_projection.py +5 -4
  563. loopx/state_refresh.py +44 -15
  564. loopx/status.py +6 -13
  565. loopx/summary_all.py +122 -626
  566. loopx/usage_ping.py +27 -5
  567. loopx/web/chat/asset-retention.json +24 -21
  568. loopx/web/chat/assets/answer-report-page-ByuYQEFZ.js +1 -0
  569. loopx/web/chat/assets/benchmark-study-page-BtROYzAO.js +1 -0
  570. loopx/web/chat/assets/chat-BMrKlOiD.js +63 -0
  571. loopx/web/chat/assets/content-production-results-C-a8ZHSQ.js +3 -0
  572. loopx/web/chat/assets/{frontstage-developer-page-CN1JwJZs.js → frontstage-developer-page-BQAcGdhh.js} +1 -1
  573. loopx/web/chat/assets/goal-report-reviews-CATRBM4H.css +1 -0
  574. loopx/web/chat/assets/goal-report-reviews-Coo-AMp1.js +1 -0
  575. loopx/web/chat/assets/index-CWA342tY.css +1 -0
  576. loopx/web/chat/assets/index-DOg9hYm6.js +51 -0
  577. loopx/web/chat/assets/workspace-settings-page-BqF8uEcI.js +7 -0
  578. loopx/web/chat/assets/x-D3cABN2-.js +1 -0
  579. loopx/web/chat/bundle-manifest.json +238 -187
  580. loopx/web/chat/index.html +4 -5
  581. loopx/windows_install.py +3 -0
  582. loopx/worker_bridge.py +0 -57
  583. loopx/workflow_skill_install.py +21 -5
  584. loopx/workflow_skills/ego_delivery.py +6 -5
  585. loopx/zcode_goal_mode/cli.ts +2 -1
  586. loopx/zcode_goal_mode/diagnostics.py +1 -1
  587. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-benchmark/SKILL.md +21 -0
  588. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-review/SKILL.md +7 -5
  589. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/SKILL.md +7 -3
  590. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/heartbeat-hosts.md +49 -0
  591. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/outcome-refinement.md +34 -0
  592. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/SKILL.md +13 -4
  593. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/references/repair-patterns.md +39 -3
  594. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/references/targeted-diagnostics.md +28 -1
  595. {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/METADATA +2 -2
  596. {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/RECORD +637 -586
  597. loopx/control_plane/coordination/local_snapshot.py +0 -67
  598. loopx/control_plane/todos/completion_fence.py +0 -78
  599. loopx/control_plane/todos/update_source.py +0 -43
  600. loopx/web/chat/assets/answer-report-page-C6t2sUaA.js +0 -1
  601. loopx/web/chat/assets/answer-report-page-qfpC8lma.css +0 -1
  602. loopx/web/chat/assets/benchmark-study-page-CbeJaE5f.js +0 -1
  603. loopx/web/chat/assets/chat-DQ8MlhDg.js +0 -72
  604. loopx/web/chat/assets/content-production-results-CU67baBd.js +0 -3
  605. loopx/web/chat/assets/index-B6mebcGd.js +0 -42
  606. loopx/web/chat/assets/index-W4WVpCAp.css +0 -1
  607. loopx/web/chat/assets/workspace-settings-page-DQBucRl6.js +0 -7
  608. loopx/web/chat/assets/workspace-settings-page-YXd5Kmd-.css +0 -1
  609. /loopx/{chat_event_cache.py → chat/event_cache.py} +0 -0
  610. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-benchmark/.loopx-skill-scope +0 -0
  611. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-benchmark/agents/openai.yaml +0 -0
  612. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-change-quality/.loopx-skill-scope +0 -0
  613. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-change-quality/SKILL.md +0 -0
  614. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-change-quality/agents/openai.yaml +0 -0
  615. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-doc-registry/.loopx-skill-scope +0 -0
  616. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-doc-registry/SKILL.md +0 -0
  617. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-doc-registry/agents/openai.yaml +0 -0
  618. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-material/.loopx-skill-scope +0 -0
  619. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-material/SKILL.md +0 -0
  620. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-material/agents/openai.yaml +0 -0
  621. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-performance-diagnosis/.loopx-skill-scope +0 -0
  622. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-performance-diagnosis/SKILL.md +0 -0
  623. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-performance-diagnosis/agents/openai.yaml +0 -0
  624. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-program/.loopx-skill-scope +0 -0
  625. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-program/SKILL.md +0 -0
  626. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-program/agents/openai.yaml +0 -0
  627. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-program/references/snapshot-contract.md +0 -0
  628. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-program/scripts/diff_snapshot.py +0 -0
  629. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-review/.loopx-skill-scope +0 -0
  630. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-review/agents/openai.yaml +0 -0
  631. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/.loopx-skill-scope +0 -0
  632. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/agents/openai.yaml +0 -0
  633. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/autonomous-execution.md +0 -0
  634. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/handoff-and-feedback.md +0 -0
  635. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/installation-and-diagnosis.md +0 -0
  636. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/materials-explore-quality.md +0 -0
  637. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/start-and-connect.md +0 -0
  638. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/.loopx-skill-scope +0 -0
  639. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/agents/openai.yaml +0 -0
  640. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/references/pattern-lookup.md +0 -0
  641. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/references/upstream-issue-escalation.md +0 -0
  642. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/scripts/find_pattern.py +0 -0
  643. {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/scripts/lexical_retrieval.py +0 -0
  644. {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/WHEEL +0 -0
  645. {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/entry_points.txt +0 -0
  646. {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/licenses/LICENSE +0 -0
  647. {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/licenses/LICENSE-MIT +0 -0
  648. {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/licenses/NOTICE +0 -0
  649. {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/top_level.txt +0 -0
loopx/__init__.py CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  __all__ = ["__version__"]
4
4
 
5
- __version__ = "2.2.0"
5
+ __version__ = "2.3.0"
loopx/agent_onboarding.py CHANGED
@@ -64,6 +64,8 @@ def _surface_install_command(agent_type: str, cli_bin: str, project: str) -> str
64
64
  return f"{host_command(cli_bin)} slash-commands --install --surface zcode"
65
65
  if agent_type == "agy":
66
66
  return f"{host_command(cli_bin)} slash-commands --install --surface agy"
67
+ if agent_type == "antigravity-app":
68
+ return f"{host_command(cli_bin)} slash-commands --install --surface antigravity-app"
67
69
  if agent_type == "kiro-cli":
68
70
  return f"{host_command(cli_bin)} slash-commands --install --surface kiro-cli"
69
71
  if agent_type == "pi":
@@ -297,6 +299,7 @@ def _bootstrap_pack_command(
297
299
  "cursor-agent": "cursor-agent",
298
300
  "zcode": "zcode",
299
301
  "agy": "agy",
302
+ "antigravity-app": "antigravity-app",
300
303
  "kiro-cli": "kiro-cli",
301
304
  "deepseek-harness": "deepseek-harness",
302
305
  "deepseek-harness-native": "deepseek-harness-native",
@@ -373,6 +376,15 @@ def _start_instruction(agent_type: str) -> str:
373
376
  "wake Prompt; recurring via MaxIterations) when quota allows more "
374
377
  "work."
375
378
  )
379
+ if agent_type == "antigravity-app":
380
+ return (
381
+ "Invoke the LoopX skill from `~/.gemini/config/skills` via `/loopx <task>`; "
382
+ "after todo writeback, start every turn with `quota should-run`, suspend "
383
+ "directly via the native `schedule(DurationSeconds=..., Prompt=...)` tool "
384
+ "when `waiting_external` or CI checks are pending (instead of polling), "
385
+ "and optionally configure `~/.gemini/config/sidecar.json` for background "
386
+ "periodic heartbeats."
387
+ )
376
388
  if agent_type == "kiro-cli":
377
389
  return (
378
390
  f"Run `/loopx <task>` (the LoopX skill installed in "
@@ -1,26 +1,48 @@
1
+ """Antigravity CLI (``agy``) & Antigravity App (``antigravity-app``) host-surface constants and helpers.
2
+
3
+ Supports both:
4
+ - Legacy Antigravity CLI (``agy`` 1.x) flat skills in ``~/.gemini/antigravity-cli/skills/<name>.md`` with native ``/goal`` and ``schedule`` tools.
5
+ - Antigravity 2.0 / Antigravity App (``antigravity-app``) directory skills in ``~/.gemini/config/skills/<name>/SKILL.md``, in-session ``schedule(DurationSeconds=..., Prompt=...)`` closed-loop timer suspension (for ``waiting_external`` / CI waits), background ``sidecar.json`` periodic heartbeat template, and optional ``mcp_config.json`` + ``hooks.json`` bounded Stop recovery registration.
6
+ """
7
+
1
8
  from __future__ import annotations
2
9
 
10
+ import os
11
+ import shlex
12
+ import shutil
13
+ import sys
3
14
  from pathlib import Path
4
15
  from typing import Any
5
16
 
6
17
  AGY_INSTALL_SURFACE = "agy"
7
- DEFAULT_AGY_HOME = ".gemini/antigravity-cli"
8
- SKILLS_SUBDIR = "skills"
9
- SKILLS_ROOT_LABEL = "~/.gemini/antigravity-cli/skills"
10
- AGY_ACCEPTED_INPUTS = (
18
+ ANTIGRAVITY_APP_INSTALL_SURFACE = "antigravity-app"
19
+ ANTIGRAVITY_APP_AGENT_TYPE = "antigravity-app"
20
+
21
+ # Every token normalize_agent_type and the slash-commands installer accept for
22
+ # the Antigravity CLI surface.
23
+ AGY_ACCEPTED_INPUTS: tuple[str, ...] = (
11
24
  "agy",
12
25
  "antigravity",
13
26
  "antigravity-cli",
14
27
  "antigravity_cli",
15
28
  "antigravity cli",
29
+ "google-antigravity",
16
30
  "google antigravity",
17
31
  )
18
32
 
19
- # Native in-session automation primitives agy ships (verified against agy
20
- # 1.1.18 live; no external driver involved). The `schedule` tool takes
21
- # DurationSeconds + a wake Prompt, supports recurring wakes via MaxIterations
22
- # and one-shot early-termination conditions.
23
- AGY_NATIVE_WAKE_TOOLS = (
33
+ ANTIGRAVITY_APP_ACCEPTED_INPUTS: tuple[str, ...] = (
34
+ "antigravity-app",
35
+ "antigravity_app",
36
+ "antigravity app",
37
+ "agy-app",
38
+ "agy_app",
39
+ "agy app",
40
+ "antigravity-2",
41
+ "antigravity 2.0",
42
+ )
43
+
44
+ # Native in-session automation primitives agy and Antigravity App ship.
45
+ AGY_NATIVE_WAKE_TOOLS: tuple[str, ...] = (
24
46
  "schedule",
25
47
  "manage_task",
26
48
  "invoke_subagent",
@@ -28,38 +50,260 @@ AGY_NATIVE_WAKE_TOOLS = (
28
50
  "manage_inbox",
29
51
  )
30
52
 
31
- AGY_NATIVE_WAKE_FACTS = (
32
- "native `schedule` tool: DurationSeconds + Prompt wake message, recurring "
33
- "wakes via MaxIterations, one-shot early-termination conditions",
34
- "background tasks (`manage_task`) and async subagents "
35
- "(`invoke_subagent`/`send_message`) wake a live session without an "
36
- "external driver",
37
- "`hooks.json` (user or plugin) runs PostToolUse/Stop/PostInvocation "
38
- "automation on tool events",
53
+ AGY_NATIVE_WAKE_FACTS: tuple[str, ...] = (
54
+ "The built-in `schedule` tool arms a one-shot timer (`DurationSeconds` + "
55
+ "wake `Prompt`; optional `TimerCondition`: `never`, `any`, or a sender ID) "
56
+ "or a recurring cron (`CronExpression` + `Prompt`; optional `MaxIterations`, "
57
+ "`IsDaemon`, `ExactTiming`) that delivers its `Prompt` as a high-priority "
58
+ "wakeup notification when it fires; `manage_task` lists or kills active "
59
+ "schedules.",
60
+ "When a LoopX turn enters `waiting_external` (for example CI checks or PR "
61
+ "review waits), call `schedule(DurationSeconds=<poll_after_seconds>, "
62
+ "Prompt=...)` and end the turn immediately so the host wakes the session "
63
+ "reactively instead of running shell sleep polling loops.",
64
+ "Background `run_command` tasks and `invoke_subagent` runs also resume the "
65
+ "session reactively on completion or message arrival, so the agent does "
66
+ "not need a polling loop inside a turn.",
67
+ "All native wakes live inside the running Antigravity process; for "
68
+ "background periodic heartbeats in Antigravity 2.0 (`antigravity-app`), "
69
+ "configure `sidecar.json` and optional `hooks.json` bound Stop recovery in "
70
+ "`~/.gemini/config`.",
39
71
  )
40
72
 
41
73
  # Native goal primitive (built into the agy binary; live-verified on 1.1.18 in
42
- # both the interactive TUI and headless `-p` print mode). The host injects a
43
- # forced-continuation contract that audits work until the model emits the
44
- # completion token; `GoalState` persists across the session.
74
+ # both the TUI and headless `agy -p`).
45
75
  AGY_GOAL_COMMAND = "/goal"
46
- AGY_GOAL_COMMAND_DESCRIPTION = "Run until the specified goal is completely finished."
76
+ AGY_GOAL_COMMAND_DESCRIPTION = (
77
+ "Pursue a goal relentlessly until it is completely finished"
78
+ )
47
79
  AGY_GOAL_COMPLETE_TOKEN = "<!-- GOAL_COMPLETE -->"
48
80
  AGY_GOAL_CANCELLED_TOKEN = "<!-- GOAL_CANCELLED -->"
49
81
 
82
+ DEFAULT_AGY_HOME = ".gemini/antigravity-cli"
83
+ DEFAULT_ANTIGRAVITY_CONFIG_HOME = ".gemini/config"
84
+ ANTIGRAVITY_SKILLS_ROOT_LABEL = "~/.gemini/config/skills"
85
+ ANTIGRAVITY_LEGACY_SKILLS_ROOT_LABEL = "~/.gemini/antigravity-cli/skills"
86
+ ANTIGRAVITY_MCP_CONFIG_FILENAME = "mcp_config.json"
87
+ ANTIGRAVITY_HOOKS_CONFIG_FILENAME = "hooks.json"
88
+ ANTIGRAVITY_SIDECAR_FILENAME = "sidecar.json"
89
+ ANTIGRAVITY_MCP_CONFIG_LABEL = "~/.gemini/config/mcp_config.json"
90
+ ANTIGRAVITY_HOOKS_CONFIG_LABEL = "~/.gemini/config/hooks.json"
91
+ ANTIGRAVITY_SIDECAR_CONFIG_LABEL = (
92
+ "~/.gemini/config/sidecars/loopx-antigravity-heartbeat/sidecar.json"
93
+ )
94
+
95
+ ANTIGRAVITY_APP_AGENT_TYPE_CATALOG_ENTRY: dict[str, Any] = {
96
+ "display_name": "Antigravity App",
97
+ "host_loop": (
98
+ "Antigravity App native schedule timer closed loop + optional background "
99
+ "sidecar.json heartbeat and hooks.json bound Stop recovery"
100
+ ),
101
+ "entry": (
102
+ f"the LoopX skill installed in {ANTIGRAVITY_SKILLS_ROOT_LABEL} "
103
+ f"(compat: {ANTIGRAVITY_LEGACY_SKILLS_ROOT_LABEL})"
104
+ ),
105
+ "accepted_inputs": list(ANTIGRAVITY_APP_ACCEPTED_INPUTS),
106
+ }
107
+
108
+
109
+ def build_antigravity_sidecar_template(
110
+ *,
111
+ goal_id: str = "<goal-id>",
112
+ agent_id: str | None = None,
113
+ runtime_root: str | None = None,
114
+ cli_bin: str = "loopx",
115
+ interval_seconds: int = 180,
116
+ ) -> dict[str, Any]:
117
+ """Build a public-safe Antigravity 2.0 ``sidecar.json`` periodic heartbeat template."""
118
+ quota_args = [cli_bin, "--format", "json"]
119
+ if runtime_root:
120
+ quota_args.extend(["--runtime-root", runtime_root])
121
+ quota_args.extend(
122
+ [
123
+ "quota",
124
+ "should-run",
125
+ "--goal-id",
126
+ goal_id,
127
+ "--runtime-profile",
128
+ "antigravity_app",
129
+ ]
130
+ )
131
+ if agent_id:
132
+ quota_args.extend(["--agent-id", agent_id])
133
+ heartbeat_args = [cli_bin, "--format", "json"]
134
+ if runtime_root:
135
+ heartbeat_args.extend(["--runtime-root", runtime_root])
136
+ heartbeat_args.extend(
137
+ [
138
+ "heartbeat-prompt",
139
+ "--thin",
140
+ "--goal-id",
141
+ goal_id,
142
+ "--runtime-profile",
143
+ "antigravity_app",
144
+ ]
145
+ )
146
+ if agent_id:
147
+ heartbeat_args.extend(["--agent-id", agent_id])
148
+ bootstrap_prompt = (
149
+ "LoopX managed heartbeat bootstrap v2\n"
150
+ "每次唤醒先执行:\n"
151
+ f"```sh\n{shlex.join(heartbeat_args)}\n```\n"
152
+ "读取完整结果;仅 ok=true 时按本次 task_body 推进,不复用旧指令。"
153
+ '一次操作不代表结束;通知与执行分开,等待按当前调度契约(遇到 waiting_external / CI 等待时使用原生 schedule(DurationSeconds=..., TimerCondition="any") 挂起,不跑 shell sleep 空查)。'
154
+ "入口异常先做权限内恢复;契约仍不可用时不执行任务或记账,并报告阻塞。"
155
+ )
156
+ interval_minutes = max(1, int(interval_seconds) // 60)
157
+ cron_expr = cron_for_interval_minutes(interval_minutes)
158
+ return {
159
+ "schema_version": "loopx_antigravity_sidecar_template_v0",
160
+ "config_path": ANTIGRAVITY_SIDECAR_CONFIG_LABEL,
161
+ "sidecar_config_path": ANTIGRAVITY_SIDECAR_CONFIG_LABEL,
162
+ "sidecar_json": {
163
+ "builtin": "schedule",
164
+ "args": [
165
+ f"CRON_TZ=UTC {cron_expr}",
166
+ "agentapi",
167
+ "new-conversation",
168
+ "--model=pro",
169
+ "--",
170
+ bootstrap_prompt,
171
+ ],
172
+ "restart_policy": "always",
173
+ "display_name": "LoopX Antigravity Heartbeat",
174
+ "description": (f"LoopX periodic quota-gated heartbeat for goal {goal_id}"),
175
+ "agent_permissions": {
176
+ "access_grants": [
177
+ f"command({cli_bin})",
178
+ ]
179
+ },
180
+ },
181
+ "sidecar": {
182
+ "loopx-heartbeat": {
183
+ "description": (
184
+ f"LoopX periodic quota-gated heartbeat for goal {goal_id}"
185
+ ),
186
+ "cron": cron_expr,
187
+ "interval_seconds": int(interval_seconds),
188
+ "gate_command": shlex.join(quota_args),
189
+ "wake_when_json_field_true": "should_run",
190
+ "prompt_command": shlex.join(heartbeat_args),
191
+ "prompt_json_field": "task_body",
192
+ "bootstrap_prompt": bootstrap_prompt,
193
+ "suspend_on_waiting_external": {
194
+ "tool": "schedule",
195
+ "interval_minutes_field": (
196
+ "scheduler_hint.app_automation.recommended_interval_minutes"
197
+ ),
198
+ "fallback_interval_minutes_field": (
199
+ "scheduler_hint.local_scheduler.recommended_interval_minutes"
200
+ ),
201
+ "default_duration_seconds": int(interval_seconds),
202
+ },
203
+ "stateful_backoff": {
204
+ "state_key": "scheduler_hint.app_automation.stateful_backoff",
205
+ "recommended_rrule_field": (
206
+ "scheduler_hint.app_automation.recommended_rrule"
207
+ ),
208
+ "recommended_interval_minutes_field": (
209
+ "scheduler_hint.app_automation.recommended_interval_minutes"
210
+ ),
211
+ "ack_hint_field": (
212
+ "scheduler_hint.app_automation.ack_hint.cli_args"
213
+ ),
214
+ "failure_hint_field": (
215
+ "scheduler_hint.app_automation.failure_hint.cli_args"
216
+ ),
217
+ },
218
+ }
219
+ },
220
+ }
221
+
222
+
223
+ def _antigravity_provider_args(
224
+ operation: str,
225
+ *,
226
+ cli_bin: str,
227
+ goal_id: str | None,
228
+ agent_id: str | None,
229
+ conversation_id: str | None,
230
+ runtime_root: str | None,
231
+ registry: str | None = None,
232
+ resolve_local_executable: bool = True,
233
+ ) -> list[str]:
234
+ python_bin = sys.executable if resolve_local_executable else "python3"
235
+ resolved_cli_bin = (
236
+ (shutil.which(cli_bin) or cli_bin) if resolve_local_executable else cli_bin
237
+ )
238
+ args = [
239
+ python_bin,
240
+ "-E",
241
+ "-P",
242
+ "-m",
243
+ "loopx.agy_goal_mode.host_runtime",
244
+ operation,
245
+ "--cli-bin",
246
+ resolved_cli_bin,
247
+ "--goal-id",
248
+ goal_id or "<goal-id>",
249
+ "--agent-id",
250
+ agent_id or "<agent-id>",
251
+ "--conversation-id",
252
+ conversation_id or "<native-conversation-id>",
253
+ ]
254
+ if runtime_root:
255
+ args.extend(["--runtime-root", runtime_root])
256
+ if registry:
257
+ args.extend(["--registry", registry])
258
+ return args
259
+
260
+
261
+ def cron_for_interval_minutes(interval_minutes: int) -> str:
262
+ """Convert a LoopX ``recommended_interval_minutes`` into a 5-field cron expression."""
263
+ minutes = max(1, int(interval_minutes))
264
+ if minutes >= 60:
265
+ return "0 * * * *"
266
+ return f"*/{minutes} * * * *"
267
+
268
+
269
+ def build_antigravity_hooks_template(
270
+ *,
271
+ cli_bin: str = "loopx",
272
+ goal_id: str | None = None,
273
+ agent_id: str | None = None,
274
+ runtime_root: str | None = None,
275
+ conversation_id: str | None = None,
276
+ registry: str | None = None,
277
+ resolve_local_executable: bool = True,
278
+ ) -> dict[str, Any]:
279
+ """Native Stop hook; installation alone never binds an arbitrary chat."""
280
+ conversation_id = conversation_id or os.environ.get("ANTIGRAVITY_CONVERSATION_ID")
281
+ args = _antigravity_provider_args(
282
+ "stop-hook",
283
+ cli_bin=cli_bin,
284
+ goal_id=goal_id,
285
+ agent_id=agent_id,
286
+ conversation_id=conversation_id,
287
+ runtime_root=runtime_root,
288
+ registry=registry,
289
+ resolve_local_executable=resolve_local_executable,
290
+ )
291
+ return {
292
+ "loopx": {
293
+ "enabled": bool(
294
+ conversation_id and agent_id and goal_id and goal_id != "<goal-id>"
295
+ ),
296
+ "Stop": [{"type": "command", "command": shlex.join(args), "timeout": 30}],
297
+ }
298
+ }
299
+
50
300
 
51
301
  def agy_activation_extras() -> dict[str, Any]:
52
302
  """Keyword overrides for ``agy_cli_activation``'s facade call.
53
303
 
54
304
  Keeps the agy host facts (goal command, tokens, wake tools, gate text,
55
305
  activation steps) in the agy package instead of growing
56
- ``host_loop_activation.py`` past its module metric budget. agy ships BOTH
57
- halves of a goal-mode host, verified live on 1.1.18: a native goal
58
- primitive — ``/goal <task>`` ("Run until the specified goal is completely
59
- finished"), whose host-side forced continuation audits work until the
60
- model emits ``<!-- GOAL_COMPLETE -->`` — and a native in-session
61
- scheduler (``schedule`` tool plus background-task/subagent wakes). The
62
- loop and wakes live and die with the session; no cross-session daemon.
306
+ ``host_loop_activation.py`` past its module metric budget.
63
307
  """
64
308
  return {
65
309
  "activation_method": "bind_native_goal_with_advisory_quota_entry",
@@ -71,48 +315,159 @@ def agy_activation_extras() -> dict[str, Any]:
71
315
  "goal_complete_token": AGY_GOAL_COMPLETE_TOKEN,
72
316
  "goal_cancelled_token": AGY_GOAL_CANCELLED_TOKEN,
73
317
  "native_wake_tools": list(AGY_NATIVE_WAKE_TOOLS),
318
+ "native_wake_facts": list(AGY_NATIVE_WAKE_FACTS),
319
+ "skills_roots": [
320
+ ANTIGRAVITY_SKILLS_ROOT_LABEL,
321
+ ANTIGRAVITY_LEGACY_SKILLS_ROOT_LABEL,
322
+ ],
74
323
  "missing_host_tool_gate": (
75
324
  "agy's /goal loop and native wakes fire only while the CLI "
76
- "session is alive; there is no cross-session daemon. LoopX has "
77
- "no host hook intercepting native continuations, so quota "
78
- "pacing is advisory: the facade instructs, it cannot enforce. "
79
- "If the session ends before the goal is done, show the exact "
80
- "heartbeat-prompt command for the user to run and do not claim "
81
- "unattended heartbeat support."
325
+ "session stays alive (there is no background daemon), and "
326
+ "agy exposes no hook to intercept `/goal`'s forced-"
327
+ "continuation audit, so `quota should-run` is advisory "
328
+ "guidance rather than a host-enforced gate. If the session "
329
+ "cannot keep entering through `quota should-run`, show the "
330
+ "exact heartbeat-prompt command for the user to run and do "
331
+ "not claim unattended heartbeat support."
82
332
  ),
83
333
  },
84
334
  "extra_activation_steps": [
85
- "Bind the objective with the native goal command: "
335
+ "Bind the objective to agy's native goal loop by running "
86
336
  "`/goal <task_body>` — agy's forced continuation audits the work "
87
- "until completion is emitted; `<!-- GOAL_COMPLETE -->` ends the "
88
- "goal loop and `<!-- GOAL_CANCELLED -->` cancels it.",
89
- "Start every turn, native wake, and audit-continuation with "
90
- "`quota should-run` and honor a stop/throttle decision before any "
91
- "delivery work — instructed pacing, not a host-enforced gate.",
92
- "When a turn ends with work remaining and quota allows more, arm "
93
- "the next bounded segment with the native `schedule` tool "
94
- "(recurring wakes bounded by MaxIterations); the wake re-enters "
95
- "through `quota should-run` on the same advisory basis.",
337
+ "at the end of each turn and keeps the agent going until every "
338
+ f"aspect is verified and `{AGY_GOAL_COMPLETE_TOKEN}` is emitted "
339
+ f"(or `{AGY_GOAL_CANCELLED_TOKEN}` to abort).",
340
+ "At the start of every turn, wake and `/goal` audit-continuation, "
341
+ "run `quota should-run` first; when it says stop, emit "
342
+ f"`{AGY_GOAL_CANCELLED_TOKEN}` (or `{AGY_GOAL_COMPLETE_TOKEN}` "
343
+ "when the LoopX goal is genuinely complete) so the native goal "
344
+ "loop terminates instead of free-running past the quota.",
345
+ "When `quota should-run` allows continuation and more work or a "
346
+ "deferred check remains (such as `waiting_external` or CI checks), "
347
+ "arm the next wakeup in-session with agy's built-in `schedule` tool "
348
+ "(`DurationSeconds` + wake `Prompt`, or `CronExpression` with "
349
+ "`MaxIterations` for bounded recurring checks) instead of blind "
350
+ "polling; cancel obsolete timers via `manage_task` before stopping.",
96
351
  ],
97
352
  "host_scheduler_note": (
98
- "the native `/goal` loop and `schedule` tool drive this session; "
99
- "quota should-run entry is advisory guidance in the facade, not a "
100
- "host-enforced gate."
353
+ "use the built-in `schedule` tool (`DurationSeconds` or "
354
+ "`CronExpression` with `MaxIterations`) for in-session wakes, and "
355
+ f"emit `{AGY_GOAL_COMPLETE_TOKEN}` / `{AGY_GOAL_CANCELLED_TOKEN}` "
356
+ "to end the native `/goal` loop (neither survives after the agy "
357
+ "process exits)."
358
+ ),
359
+ }
360
+
361
+
362
+ def antigravity_app_activation_extras(
363
+ *,
364
+ goal_id: str = "<goal-id>",
365
+ agent_id: str | None = None,
366
+ runtime_root: str | None = None,
367
+ cli_bin: str = "loopx",
368
+ ) -> dict[str, Any]:
369
+ """Keyword overrides for ``antigravity_app_activation``'s facade call."""
370
+ sidecar_template = build_antigravity_sidecar_template(
371
+ goal_id=goal_id,
372
+ agent_id=agent_id,
373
+ runtime_root=runtime_root,
374
+ cli_bin=cli_bin,
375
+ )
376
+ hooks_template = build_antigravity_hooks_template(
377
+ cli_bin=cli_bin,
378
+ goal_id=goal_id,
379
+ agent_id=agent_id,
380
+ runtime_root=runtime_root,
381
+ resolve_local_executable=False,
382
+ )
383
+ wake_prompt = sidecar_template["sidecar"]["loopx-heartbeat"]["bootstrap_prompt"]
384
+ return {
385
+ "activation_method": "bind_antigravity_schedule_loop_and_sidecar",
386
+ "extra_host_mutation": {
387
+ "host_loop_primitive": "antigravity-schedule-tool-and-sidecar",
388
+ "loop_driver": "antigravity_app_schedule_timer_and_sidecar_loop",
389
+ "quota_gate_enforcement": "advisory_agent_entry_with_bound_stop_recovery",
390
+ "native_wake_tools": list(AGY_NATIVE_WAKE_TOOLS),
391
+ "native_wake_facts": list(AGY_NATIVE_WAKE_FACTS),
392
+ "skills_roots": [
393
+ ANTIGRAVITY_SKILLS_ROOT_LABEL,
394
+ ANTIGRAVITY_LEGACY_SKILLS_ROOT_LABEL,
395
+ ],
396
+ "host_mcp_server": "loopx",
397
+ "host_mcp_config": ANTIGRAVITY_MCP_CONFIG_LABEL,
398
+ "host_hooks_config": ANTIGRAVITY_HOOKS_CONFIG_LABEL,
399
+ "host_sidecar_config": ANTIGRAVITY_SIDECAR_CONFIG_LABEL,
400
+ "in_session_schedule_call": {
401
+ "tool": "schedule",
402
+ "arguments": {
403
+ "DurationSeconds": 180,
404
+ "Prompt": wake_prompt,
405
+ "TimerCondition": "any",
406
+ },
407
+ "when_to_use": (
408
+ "Call `schedule(DurationSeconds=..., Prompt=...)` and end the turn "
409
+ "whenever `waiting_external`, CI checks, or PR review gates block "
410
+ "immediate completion; never use shell sleep loops."
411
+ ),
412
+ },
413
+ "sidecar_template": sidecar_template,
414
+ "hooks_template": hooks_template,
415
+ "missing_host_tool_gate": (
416
+ "Antigravity App in-session `schedule(DurationSeconds=...)` timers fire "
417
+ "while the app session is active; for unattended background ticks, "
418
+ f"configure `sidecar.json` in `{ANTIGRAVITY_SIDECAR_CONFIG_LABEL}` "
419
+ f"and optional `hooks.json` in `{ANTIGRAVITY_HOOKS_CONFIG_LABEL}`."
420
+ ),
421
+ },
422
+ "extra_activation_steps": [
423
+ f"Install or refresh the Antigravity skill and optional MCP/hooks surface (`{cli_bin} slash-commands --install --surface antigravity-app --with-agy-mcp --with-agy-hooks` and `{cli_bin} workflow-skills --install --host-surface antigravity-app`).",
424
+ "When a turn enters `waiting_external` or waits on CI/review checks, suspend directly with the native `schedule(DurationSeconds=<poll_after_seconds>, Prompt=...)` tool and end the turn instead of polling in a shell loop.",
425
+ f"For background periodic heartbeats, write only `sidecar_template.sidecar_json` to `{ANTIGRAVITY_SIDECAR_CONFIG_LABEL}`. Preserve its existing id, model, permissions and host enable choice. Each fresh native heartbeat loads Core admission before work; do not persist an expanded execution body. Apply the bound `hooks_template` at the top level of hooks.json for bounded transport-error recovery; never wrap it in a `hooks` object.",
426
+ ],
427
+ "host_scheduler_note": (
428
+ "use the native `schedule(DurationSeconds=..., Prompt=...)` tool to suspend "
429
+ "and wake on `waiting_external` / CI waits, or configure `sidecar.json` for "
430
+ "background periodic heartbeats."
101
431
  ),
102
432
  }
103
433
 
104
434
 
105
435
  def agy_home(value: str | None = None) -> Path:
106
- """The fixed Antigravity CLI home: ``~/.gemini/antigravity-cli``.
107
-
108
- agy discovers global skills from ``~/.gemini/antigravity-cli/skills``
109
- using the documented flat layout — one markdown file per skill
110
- (``skills/<name>.md`` with front matter). The official CLI docs do not
111
- document any home override, so LoopX exposes none either: installs target
112
- exactly this path (HOME-relative, which keeps tests hermetic), and the
113
- root is shared with no other host (for example, Gemini CLI reads
114
- ``~/.gemini/skills``). ``value`` is an internal injection point
115
- for tests, not a public override.
436
+ """Resolve the legacy Antigravity CLI user home directory (``~/.gemini/antigravity-cli``).
437
+
438
+ Honours an explicit ``--agy-home`` override or ``AGY_CLI_HOME`` environment
439
+ variable while defaulting to ``~/.gemini/antigravity-cli`` for flat
440
+ ``skills/<name>.md`` compatibility.
116
441
  """
117
- raw = value or str(Path.home() / DEFAULT_AGY_HOME)
442
+ raw = value or os.environ.get("AGY_CLI_HOME")
443
+ if raw:
444
+ return Path(raw).expanduser()
445
+ return (Path.home() / DEFAULT_AGY_HOME).expanduser()
446
+
447
+
448
+ def antigravity_config_home(value: str | None = None) -> Path:
449
+ """Resolve the Antigravity 2.0 / Antigravity App config home (``~/.gemini/config``).
450
+
451
+ Honours an explicit ``--agy-home`` override or ``AGY_HOME`` / ``ANTIGRAVITY_HOME``
452
+ environment variables, defaulting to ``~/.gemini/config`` where
453
+ ``skills/<name>/SKILL.md``, ``mcp_config.json``, ``hooks.json``, and
454
+ ``sidecar.json`` live.
455
+ """
456
+ raw = (
457
+ value
458
+ or os.environ.get("AGY_HOME")
459
+ or os.environ.get("ANTIGRAVITY_HOME")
460
+ or str(Path.home() / DEFAULT_ANTIGRAVITY_CONFIG_HOME)
461
+ )
118
462
  return Path(raw).expanduser()
463
+
464
+
465
+ def antigravity_skill_roots(value: str | None = None) -> tuple[Path, ...]:
466
+ """Return Antigravity skill roots in discovery order (2.0 config first, then legacy CLI)."""
467
+ if value:
468
+ base = Path(value).expanduser()
469
+ return (base / "skills",)
470
+ return (
471
+ antigravity_config_home() / "skills",
472
+ agy_home() / "skills",
473
+ )