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.
- loopx/__init__.py +1 -1
- loopx/agent_onboarding.py +12 -0
- loopx/agy_goal_mode/__init__.py +413 -58
- loopx/agy_goal_mode/host_runtime.py +237 -0
- loopx/ark_managed_agent_host.py +1 -1
- loopx/authority.py +5 -4
- loopx/bootstrap_command_pack.py +4 -2
- loopx/canary/planner.py +0 -45
- loopx/canary/premerge.py +4 -1
- loopx/canary/runner.py +22 -22
- loopx/capabilities/README.md +1 -0
- loopx/capabilities/anti_entropy/README.md +185 -0
- loopx/capabilities/anti_entropy/__init__.py +47 -0
- loopx/capabilities/anti_entropy/agent_tool.py +29 -0
- loopx/capabilities/anti_entropy/catalog_entry.py +112 -0
- loopx/capabilities/anti_entropy/cli.py +47 -0
- loopx/capabilities/anti_entropy/contract.py +158 -0
- loopx/capabilities/anti_entropy/feedback.py +252 -0
- loopx/capabilities/anti_entropy/js_reference.py +1146 -0
- loopx/capabilities/anti_entropy/oracles.py +1329 -0
- loopx/capabilities/anti_entropy/turn_context.py +582 -0
- loopx/capabilities/benchmark_toolkit/README.md +83 -0
- loopx/capabilities/benchmark_toolkit/__init__.py +6 -0
- loopx/capabilities/benchmark_toolkit/catalog_entry.py +31 -0
- loopx/capabilities/benchmark_toolkit/concurrency_envelope.py +47 -40
- loopx/capabilities/benchmark_toolkit/experiment_board.py +24 -6
- loopx/capabilities/benchmark_toolkit/integrity.py +180 -10
- loopx/capabilities/benchmark_toolkit/terminal_followthrough.py +138 -0
- loopx/capabilities/benchmark_toolkit/trajectory_assessment_store.py +158 -66
- loopx/capabilities/benchmark_toolkit/trajectory_tool_context.py +13 -6
- loopx/capabilities/catalog.py +2 -0
- loopx/capabilities/change_quality/policy.py +4 -3
- loopx/capabilities/change_quality/result.py +30 -17
- loopx/capabilities/change_quality/scope.py +73 -16
- loopx/capabilities/configuration_ui.py +17 -7
- loopx/capabilities/context_providers/openviking.py +17 -9
- loopx/capabilities/decision_context/outcome_feedback.py +1 -1
- loopx/capabilities/decision_context/packets.py +19 -19
- loopx/capabilities/explore/README.md +48 -5
- loopx/capabilities/explore/composition_frontier.py +10 -8
- loopx/capabilities/explore/execution_observation.py +3 -2
- loopx/capabilities/explore/harness_gate.py +4 -3
- loopx/capabilities/explore/machine_defaults.py +4 -3
- loopx/capabilities/explore/measurements.py +3 -2
- loopx/capabilities/explore/research_frontier.py +9 -4
- loopx/capabilities/explore/result_log.py +26 -14
- loopx/capabilities/explore/result_writeback.py +35 -7
- loopx/capabilities/explore/speculative_scheduler.py +6 -5
- loopx/capabilities/explore/todo_branch_plan.py +1 -1
- loopx/capabilities/explore/turn_context.py +54 -14
- loopx/capabilities/integration_branch/core.py +156 -10
- loopx/capabilities/issue_fix/README.md +76 -11
- loopx/capabilities/issue_fix/README.zh-CN.md +57 -7
- loopx/capabilities/issue_fix/cli.py +126 -16
- loopx/capabilities/issue_fix/correction_settlement.py +407 -0
- loopx/capabilities/issue_fix/github_public.py +75 -0
- loopx/capabilities/issue_fix/pr_lifecycle.py +731 -21
- loopx/capabilities/issue_fix/pr_wait_reconcile.py +3 -4
- loopx/capabilities/issue_fix/reviewer_notification.py +5 -4
- loopx/capabilities/machine_configuration/context_delivery.py +37 -13
- loopx/capabilities/manager_context/README.md +143 -4
- loopx/capabilities/manager_context/chat_history.py +5 -3
- loopx/capabilities/manager_context/discovery.py +59 -11
- loopx/capabilities/manager_context/inspection.py +58 -7
- loopx/capabilities/manager_context/presentation.py +11 -2
- loopx/capabilities/manager_context/report_source.py +1 -1
- loopx/capabilities/manager_context/roundtrip.py +72 -6
- loopx/capabilities/material_lifecycle/_validation.py +7 -0
- loopx/capabilities/material_lifecycle/ranking.py +2 -4
- loopx/capabilities/material_lifecycle/rebuild.py +2 -4
- loopx/capabilities/native_chat/antigravity_activity.py +123 -0
- loopx/capabilities/native_chat/antigravity_adapter.py +1335 -0
- loopx/capabilities/native_chat/codex_adapter.py +673 -24
- loopx/capabilities/native_chat/codex_auth.py +84 -0
- loopx/capabilities/native_chat/codex_context.py +70 -0
- loopx/capabilities/native_chat/conversation_bindings.py +7 -2
- loopx/capabilities/native_chat/external_conversations.py +1102 -52
- loopx/capabilities/native_chat/file_discovery.py +69 -0
- loopx/capabilities/native_chat/manager_context.py +117 -0
- loopx/capabilities/native_chat/manager_input.py +76 -0
- loopx/capabilities/native_chat/model_settings.py +65 -4
- loopx/capabilities/native_chat/queue_api.py +92 -0
- loopx/capabilities/native_chat/result_review_evidence.py +54 -0
- loopx/capabilities/native_chat/steward_managed_mode.py +42 -15
- loopx/capabilities/native_chat/steward_reports.py +7 -0
- loopx/capabilities/native_chat/steward_turn.py +107 -27
- loopx/capabilities/periodic_report/README.md +6 -0
- loopx/capabilities/periodic_report/cli.py +16 -1
- loopx/capabilities/periodic_report/goal_configuration.py +7 -1
- loopx/capabilities/periodic_report/machine_defaults.py +10 -0
- loopx/capabilities/periodic_report/post_writeback_hook.py +61 -35
- loopx/capabilities/periodic_report/private_generation.py +1 -1
- loopx/capabilities/periodic_report/review.py +143 -0
- loopx/capabilities/pr_review_queue/README.md +17 -8
- loopx/capabilities/pr_review_queue/approval_closeout.py +3 -2
- loopx/capabilities/pr_review_queue/github_source.py +13 -7
- loopx/capabilities/pr_review_queue/merge_readiness.py +22 -2
- loopx/capabilities/pr_review_queue/order.py +3 -2
- loopx/capabilities/progress_review/context.py +36 -51
- loopx/capabilities/repository_change_window/repository.py +59 -6
- loopx/capabilities/reward_memory/application.py +8 -2
- loopx/capabilities/reward_memory/experiment.py +3 -2
- loopx/capabilities/reward_memory/registry.py +1 -1
- loopx/capabilities/reward_memory/scoped_feedback.py +3 -2
- loopx/capabilities/semantic_preference/__init__.py +32 -9
- loopx/capabilities/steward_executor/machine_defaults.py +2 -0
- loopx/capabilities/todo_replan_cadence/goal_configuration.py +1 -1
- loopx/capabilities/todo_replan_cadence/machine_defaults.py +28 -10
- loopx/capabilities/turn_context.py +19 -11
- loopx/{chat_automation_cadence_api.py → chat/automation_cadence_api.py} +2 -2
- loopx/{chat_completed_todos.py → chat/completed_todos.py} +56 -34
- loopx/{chat_coordination.py → chat/coordination.py} +42 -25
- loopx/{chat_endpoint_catalog.py → chat/endpoint_catalog.py} +32 -4
- loopx/{chat_goal_configuration_api.py → chat/goal_configuration_api.py} +25 -20
- loopx/{chat_goal_subagent_api.py → chat/goal_subagent_api.py} +5 -5
- loopx/{chat_machine_configuration_api.py → chat/machine_configuration_api.py} +10 -5
- loopx/{chat_manager_details.py → chat/manager_details.py} +4 -4
- loopx/{chat_manager_history.py → chat/manager_history.py} +6 -6
- loopx/{chat_monitor_actions.py → chat/monitor_actions.py} +4 -4
- loopx/{chat_session_open.py → chat/session_open.py} +1 -1
- loopx/{chat_ssh_source_api.py → chat/ssh_source_api.py} +3 -3
- loopx/{chat_status_api.py → chat/status_api.py} +20 -20
- loopx/{chat_todo_actions.py → chat/todo_actions.py} +6 -6
- loopx/{chat_todo_detail.py → chat/todo_detail.py} +3 -3
- loopx/{chat_usage_statistics_api.py → chat/usage_statistics_api.py} +1 -1
- loopx/{chat_workspace_directory.py → chat/workspace_directory.py} +6 -6
- loopx/chat.py +117 -21
- loopx/chat_action_normalization.py +2 -0
- loopx/chat_actions.py +28 -2
- loopx/chat_agent.py +107 -78
- loopx/chat_endpoints.py +1 -0
- loopx/chat_ingress.py +215 -7
- loopx/chat_loopx_mode.py +2 -1
- loopx/chat_manager.py +83 -10
- loopx/chat_manager_context.py +36 -3
- loopx/chat_runtime.py +412 -257
- loopx/chat_server.py +31 -20
- loopx/chat_store.py +94 -45
- loopx/claude_goal_mode/scripts/install.py +18 -11
- loopx/cli.py +16 -79
- loopx/cli_commands/anti_entropy.py +219 -0
- loopx/cli_commands/benchmark_concurrency.py +43 -2
- loopx/cli_commands/benchmark_dispatch.py +2 -0
- loopx/cli_commands/benchmark_experiment_board.py +3 -0
- loopx/cli_commands/benchmark_trajectory.py +6 -0
- loopx/cli_commands/context_machine.py +53 -10
- loopx/cli_commands/explore_feishu_commands.py +2 -0
- loopx/cli_commands/lark_kanban.py +34 -1
- loopx/cli_commands/manager_inbox.py +11 -0
- loopx/cli_commands/project_lifecycle_refresh_state.py +25 -28
- loopx/cli_commands/quota.py +68 -58
- loopx/cli_commands/quota_action_selection.py +1 -0
- loopx/cli_commands/quota_capture.py +466 -521
- loopx/cli_commands/quota_context.py +23 -7
- loopx/cli_commands/quota_context_reader.py +650 -0
- loopx/cli_commands/quota_monitor_poll.py +3 -1
- loopx/cli_commands/quota_presentation.py +2 -3
- loopx/cli_commands/quota_registration.py +20 -7
- loopx/cli_commands/quota_reward_memory.py +5 -20
- loopx/cli_commands/refresh_settlement.py +198 -50
- loopx/cli_commands/registry_admin.py +2 -0
- loopx/cli_commands/registry_admin_configure.py +8 -0
- loopx/cli_commands/slash_commands.py +21 -0
- loopx/cli_commands/support_control.py +21 -73
- loopx/cli_commands/support_control_heartbeat.py +52 -3
- loopx/cli_commands/support_control_heartbeat_registration.py +10 -2
- loopx/cli_commands/support_control_update.py +9 -4
- loopx/cli_commands/support_control_upgrade.py +6 -2
- loopx/cli_commands/task_lease.py +10 -6
- loopx/cli_commands/task_lease_arguments.py +10 -13
- loopx/cli_commands/todo.py +12 -3
- loopx/cli_commands/todo_argument_validation.py +9 -5
- loopx/cli_commands/todo_event.py +95 -3
- loopx/cli_commands/todo_list.py +1 -0
- loopx/cli_commands/todo_registration.py +9 -0
- loopx/cli_commands/turn.py +58 -34
- loopx/cli_commands/turn_decision.py +19 -10
- loopx/cli_commands/turn_host_request.py +5 -6
- loopx/cli_commands/turn_inspection.py +4 -2
- loopx/cli_commands/turn_post_writeback.py +33 -8
- loopx/cli_commands/turn_registration.py +6 -0
- loopx/cli_commands/turn_rendering.py +34 -0
- loopx/cli_commands/turn_run_once.py +63 -100
- loopx/cli_commands/turn_todo_writeback.py +1 -51
- loopx/cli_commands/update_artifact.py +16 -3
- loopx/cli_commands/update_operation.py +3 -1
- loopx/cli_commands/usage_ping.py +5 -0
- loopx/cli_commands/workflow_skills.py +14 -1
- loopx/cli_runtime.py +186 -13
- loopx/codex_app_thread_activity.py +48 -0
- loopx/collaboration_mcp.py +42 -29
- loopx/command_invocation.py +34 -3
- loopx/configure_goal.py +4 -0
- loopx/contract.py +225 -48
- loopx/control_plane/agents/agent_lane_recommendation.py +12 -11
- loopx/control_plane/agents/agent_scope.py +13 -8
- loopx/control_plane/agents/capability_gate.py +4 -3
- loopx/control_plane/agents/capability_memory.py +9 -3
- loopx/control_plane/agents/legacy_migration.py +3 -2
- loopx/control_plane/agents/profile.py +29 -11
- loopx/control_plane/agents/workspace_guard.py +4 -3
- loopx/control_plane/capabilities/benchmark_terminal_followthrough.ts +115 -0
- loopx/control_plane/capabilities/explore_execution_observation.ts +3 -1
- loopx/control_plane/capabilities/explore_measurements.ts +12 -4
- loopx/control_plane/capabilities/explore_result_writeback.ts +68 -11
- loopx/control_plane/capabilities/explore_turn_context.ts +53 -2
- loopx/control_plane/capabilities/trajectory_assessment.ts +2 -0
- loopx/control_plane/capabilities/trajectory_assessment_types.ts +15 -0
- loopx/control_plane/capabilities/trajectory_case_study.ts +80 -0
- loopx/control_plane/capabilities/trajectory_codex_usage.ts +5 -0
- loopx/control_plane/capabilities/trajectory_loopx_requests.ts +96 -0
- loopx/control_plane/capabilities/trajectory_tool_context.ts +2 -2
- loopx/control_plane/capabilities/trajectory_usage_comparison.ts +107 -0
- loopx/control_plane/capability_hooks.py +42 -3
- loopx/control_plane/chat_turn_acceptance.py +49 -0
- loopx/control_plane/collaboration/conversation_binding.ts +1032 -48
- loopx/control_plane/collaboration/conversation_inventory.py +17 -16
- loopx/control_plane/collaboration/conversation_reply_context.ts +42 -2
- loopx/control_plane/collaboration/conversation_scope.ts +43 -0
- loopx/control_plane/collaboration/delegation.ts +1 -21
- loopx/control_plane/collaboration/goal_instance_lifecycle.ts +18 -1
- loopx/control_plane/collaboration/goal_instance_scope.py +45 -4
- loopx/control_plane/collaboration/inbox.py +21 -16
- loopx/control_plane/collaboration/inbox_read.ts +40 -16
- loopx/control_plane/collaboration/inbox_receipts.ts +25 -6
- loopx/control_plane/collaboration/links.py +30 -12
- loopx/control_plane/collaboration/peer_host_route.py +11 -1
- loopx/control_plane/collaboration/peers.py +59 -12
- loopx/control_plane/collaboration/result_publication.ts +58 -3
- loopx/control_plane/collaboration/return_delivery.ts +28 -10
- loopx/control_plane/collaboration/steward_managed_mode.ts +14 -4
- loopx/control_plane/collaboration/turn_context.ts +10 -3
- loopx/control_plane/coordination/authority_store.ts +20 -0
- loopx/control_plane/coordination/canonical_snapshot_page.ts +3 -5
- loopx/control_plane/coordination/claim_execution.ts +38 -11
- loopx/control_plane/coordination/claim_execution_recovery.ts +66 -0
- loopx/control_plane/coordination/local_authority.py +82 -60
- loopx/control_plane/coordination/local_authority_runtime.ts +36 -3
- loopx/control_plane/coordination/local_authority_shadow.ts +0 -8
- loopx/control_plane/coordination/sqlite_authority_store.ts +26 -1
- loopx/control_plane/coordination/task_lease_lifecycle.ts +2 -0
- loopx/control_plane/coordination/todo_claim.ts +8 -3
- loopx/control_plane/coordination/todo_terminal_lifecycle.ts +188 -61
- loopx/control_plane/coordination/todo_terminal_reentry.ts +4 -2
- loopx/control_plane/coordination/todo_update.ts +11 -3
- loopx/control_plane/effect_program.py +3 -0
- loopx/control_plane/effect_program.ts +3 -0
- loopx/control_plane/effect_runtime.py +107 -34
- loopx/control_plane/effect_runtime_errors.ts +10 -2
- loopx/control_plane/effect_runtime_handlers.ts +29 -63
- loopx/control_plane/effect_runtime_server.ts +3 -29
- loopx/control_plane/effect_runtime_snapshot.ts +17 -2
- loopx/control_plane/effect_runtime_snapshot_methods.json +31 -0
- loopx/control_plane/goal_vision_lifecycle.json +3 -0
- loopx/control_plane/goals/acceptance.py +4 -1
- loopx/control_plane/goals/acceptance_authority.ts +16 -6
- loopx/control_plane/goals/acceptance_contract.ts +15 -6
- loopx/control_plane/goals/active_state_metadata.py +28 -0
- loopx/control_plane/goals/contract_health.py +3 -3
- loopx/control_plane/goals/creation_outcome.ts +22 -0
- loopx/control_plane/goals/global_registry_health.py +64 -1
- loopx/control_plane/goals/goal_frontier/__init__.py +20 -17
- loopx/control_plane/goals/goal_frontier/acceptance.py +3 -2
- loopx/control_plane/goals/goal_frontier/ack_policy.py +5 -3
- loopx/control_plane/goals/goal_frontier/fallback_source.py +4 -3
- loopx/control_plane/goals/goal_frontier/outcome_continuity.py +57 -46
- loopx/control_plane/goals/goal_frontier/semantic_history.py +6 -5
- loopx/control_plane/goals/goal_frontier/terminal.py +10 -4
- loopx/control_plane/goals/goal_vision_state.py +5 -9
- loopx/control_plane/goals/goal_vision_wait.py +14 -0
- loopx/control_plane/goals/outcome_requirements.ts +46 -7
- loopx/control_plane/goals/source_session_registry_state.py +1 -1
- loopx/control_plane/goals/start_contract.py +22 -1
- loopx/control_plane/goals/start_goal_todo_delta.py +31 -2
- loopx/control_plane/goals/task_planning.py +13 -1
- loopx/control_plane/goals/vision_checkpoint.py +5 -3
- loopx/control_plane/goals/vision_checkpoint.ts +125 -28
- loopx/control_plane/goals/vision_wait_coverage.ts +9 -75
- loopx/control_plane/governed_capability.ts +0 -6
- loopx/control_plane/heartbeat/bootstrap_prompt.py +10 -3
- loopx/control_plane/heartbeat/budget.py +5 -4
- loopx/control_plane/heartbeat/builder.py +40 -17
- loopx/control_plane/heartbeat/host.py +1 -0
- loopx/control_plane/heartbeat/task_body.py +12 -1
- loopx/control_plane/post_writeback_composition_retry.py +5 -3
- loopx/control_plane/presentation/action_review_plan.ts +26 -0
- loopx/control_plane/presentation/explore_history.ts +16 -5
- loopx/control_plane/presentation/global_manager_read.ts +255 -0
- loopx/control_plane/presentation/global_risk_read.ts +338 -0
- loopx/control_plane/presentation/goal_source_links.ts +51 -7
- loopx/control_plane/presentation/owner_attention.ts +23 -1
- loopx/control_plane/presentation/report_review.ts +44 -0
- loopx/control_plane/presentation/report_review_binding.ts +8 -0
- loopx/control_plane/projection_envelope_facts.py +7 -6
- loopx/control_plane/quota/_supporting_projections.py +7 -6
- loopx/control_plane/quota/adaptive_children.ts +223 -0
- loopx/control_plane/quota/blocked_retry.py +8 -7
- loopx/control_plane/quota/cli_projection.py +92 -247
- loopx/control_plane/quota/context_delivery.ts +34 -12
- loopx/control_plane/quota/context_selection.ts +90 -9
- loopx/control_plane/quota/decision_summary.py +6 -5
- loopx/control_plane/quota/diagnostic_projection.ts +125 -12
- loopx/control_plane/quota/effect_program.py +59 -11
- loopx/control_plane/quota/execution_preparation.py +198 -0
- loopx/control_plane/quota/goal_boundary.py +19 -18
- loopx/control_plane/quota/heartbeat_recommendation.py +12 -11
- loopx/control_plane/quota/host_poll_receipts.py +0 -44
- loopx/control_plane/quota/ledger_readback.py +5 -4
- loopx/control_plane/quota/live_decision.py +88 -7
- loopx/control_plane/quota/monitor_poll.py +7 -7
- loopx/control_plane/quota/native_context_lifecycle.ts +36 -0
- loopx/control_plane/quota/progressive_context.ts +595 -24
- loopx/control_plane/quota/projection_repair.py +36 -25
- loopx/control_plane/quota/recent_runs.py +10 -9
- loopx/control_plane/quota/scheduler_ack.py +9 -8
- loopx/control_plane/quota/settlement.py +114 -47
- loopx/control_plane/quota/settlement_cli.py +5 -4
- loopx/control_plane/quota/settlement_plan.ts +37 -22
- loopx/control_plane/quota/settlement_precedence.py +3 -1
- loopx/control_plane/quota/settlement_readback.ts +44 -15
- loopx/control_plane/quota/settlement_validation.py +29 -3
- loopx/control_plane/quota/settlement_workspace_causality.py +4 -3
- loopx/control_plane/quota/should_run.py +5 -4
- loopx/control_plane/quota/should_run_packet.py +29 -8
- loopx/control_plane/quota/should_run_prepare.py +79 -64
- loopx/control_plane/quota/slot_accounting.py +18 -16
- loopx/control_plane/quota/spend_sources.py +37 -23
- loopx/control_plane/quota/stall_repair.py +5 -4
- loopx/control_plane/quota/task_orchestration.py +8 -7
- loopx/control_plane/quota/task_orchestration_admission.py +99 -451
- loopx/control_plane/quota/turn_envelope.py +253 -43
- loopx/control_plane/quota/turn_envelope.ts +1218 -267
- loopx/control_plane/quota/usage_collector.py +15 -7
- loopx/control_plane/reward_memory.py +16 -5
- loopx/control_plane/runtime/agent_evidence_history.py +3 -2
- loopx/control_plane/runtime/decision_freshness.py +5 -4
- loopx/control_plane/runtime/document_io.py +22 -2
- loopx/control_plane/runtime/execution_identity.ts +11 -5
- loopx/control_plane/runtime/local_state_migration.py +30 -20
- loopx/control_plane/runtime/local_state_write_correctness.py +0 -73
- loopx/control_plane/runtime/private_permissions.py +198 -0
- loopx/control_plane/runtime/run_context_retention.py +4 -3
- loopx/control_plane/runtime/runtime_projection_route.py +2 -2
- loopx/control_plane/runtime/usage_statistics.ts +15 -9
- loopx/control_plane/runtime/usage_statistics_cli.ts +3 -1
- loopx/control_plane/runtime/usage_statistics_environment.ts +49 -0
- loopx/control_plane/runtime/validation_command.py +36 -2
- loopx/control_plane/runtime_decode.ts +37 -0
- loopx/control_plane/scheduler/arbitration.py +14 -5
- loopx/control_plane/scheduler/automation_liveness.py +5 -4
- loopx/control_plane/scheduler/execution_context.py +52 -24
- loopx/control_plane/scheduler/external_evidence_observation.py +7 -6
- loopx/control_plane/scheduler/heartbeat_followup_cli.ts +12 -0
- loopx/control_plane/scheduler/hint.ts +8 -3
- loopx/control_plane/scheduler/hint_followup.ts +2 -1
- loopx/control_plane/scheduler/monitor_batch_receipts.py +1 -1
- loopx/control_plane/scheduler/monitor_todo.py +3 -2
- loopx/control_plane/state_recovery_io.py +22 -2
- loopx/control_plane/status/autonomous_replan_projection.py +3 -1
- loopx/control_plane/status/goal_source.py +30 -14
- loopx/control_plane/stride_decision_schema.json +1 -0
- loopx/control_plane/subagent_context.ts +18 -14
- loopx/control_plane/testing/actual_default_model_behavior_portfolio.py +8 -3
- loopx/control_plane/testing/canary_harness.py +7 -0
- loopx/control_plane/testing/capability_monitor_repair_tool_behavior.py +19 -3
- loopx/control_plane/testing/cli_output_budget.py +68 -22
- loopx/control_plane/testing/cli_output_differential.py +83 -2
- loopx/control_plane/testing/cli_output_semantics.py +1 -1
- loopx/control_plane/testing/doubao_model_behavior_actor.py +5 -1
- loopx/control_plane/testing/model_tool_behavior.py +135 -0
- loopx/control_plane/testing/replan_semantic_action_behavior.py +492 -75
- loopx/control_plane/testing/replan_vision_closeout_behavior.py +26 -21
- loopx/control_plane/testing/scoped_gate_successor_tool_behavior.py +32 -34
- loopx/control_plane/testing/selected_todo_tool_behavior.py +16 -2
- loopx/control_plane/testing/terminal_settlement_tool_behavior.py +89 -15
- loopx/control_plane/todos/active_state_editing.py +0 -31
- loopx/control_plane/todos/authoring_scope.ts +5 -1
- loopx/control_plane/todos/automatic_resume.ts +79 -0
- loopx/control_plane/todos/completion_state.py +3 -2
- loopx/control_plane/todos/completion_transaction.py +5 -4
- loopx/control_plane/todos/completion_validation.py +23 -89
- loopx/control_plane/todos/completion_validation_accountability.py +8 -1
- loopx/control_plane/todos/completion_validation_store.py +7 -6
- loopx/control_plane/todos/context_projection.ts +18 -4
- loopx/control_plane/todos/decision_scope.py +58 -8
- loopx/control_plane/todos/decision_scope.ts +88 -1
- loopx/control_plane/todos/durable_completion.py +125 -237
- loopx/control_plane/todos/field_update.ts +2 -10
- loopx/control_plane/todos/goal_todo_projection.py +78 -22
- loopx/control_plane/todos/handoff_note.py +11 -4
- loopx/control_plane/todos/list_readback.py +2 -0
- loopx/control_plane/todos/machine_region.py +1 -0
- loopx/control_plane/todos/machine_section_projection.py +406 -21
- loopx/control_plane/todos/markdown.py +17 -8
- loopx/control_plane/todos/mutation_response.py +0 -115
- loopx/control_plane/todos/provider_projection.py +6 -0
- loopx/control_plane/todos/provider_terminal_lifecycle.py +12 -0
- loopx/control_plane/todos/provider_update.py +4 -1
- loopx/control_plane/todos/quota_selection.py +122 -11
- loopx/control_plane/todos/quota_selection.ts +318 -3
- loopx/control_plane/todos/quota_summary.py +133 -309
- loopx/control_plane/todos/read_codec.ts +36 -2
- loopx/control_plane/todos/read_projection.ts +158 -5
- loopx/control_plane/todos/read_transaction.ts +194 -18
- loopx/control_plane/todos/read_transport.ts +15 -5
- loopx/control_plane/todos/resume_planning.ts +46 -2
- loopx/control_plane/todos/standing_decision.py +2 -33
- loopx/control_plane/todos/standing_decision.ts +0 -9
- loopx/control_plane/todos/succession_warning.py +3 -2
- loopx/control_plane/todos/summary_item.py +175 -0
- loopx/control_plane/todos/summary_lanes.ts +7 -1
- loopx/control_plane/todos/todo_index.py +3 -2
- loopx/control_plane/todos/todo_semantics.py +6 -4
- loopx/control_plane/todos/todo_summary.py +10 -9
- loopx/control_plane/todos/user_gate.py +5 -0
- loopx/control_plane/todos/work_requirements.ts +11 -1
- loopx/control_plane/turn_driver/capability_context.ts +47 -6
- loopx/control_plane/turn_driver/chat_queue_steering.ts +163 -0
- loopx/control_plane/turn_driver/codex_agent_session.py +6 -3
- loopx/control_plane/turn_driver/codex_cli.py +109 -40
- loopx/control_plane/turn_driver/codex_context.py +384 -55
- loopx/control_plane/turn_driver/codex_context_history.py +10 -11
- loopx/control_plane/turn_driver/codex_execution_preparation.py +389 -0
- loopx/control_plane/turn_driver/codex_input_trace.py +3 -4
- loopx/control_plane/turn_driver/codex_operation_host.py +14 -9
- loopx/control_plane/turn_driver/codex_sessions.py +40 -15
- loopx/control_plane/turn_driver/codex_stdio.py +31 -0
- loopx/control_plane/turn_driver/command_validation.py +10 -0
- loopx/control_plane/turn_driver/decision_capture.py +375 -47
- loopx/control_plane/turn_driver/driver.py +172 -65
- loopx/control_plane/turn_driver/dsh_operation_host.py +5 -5
- loopx/control_plane/turn_driver/executor.py +138 -77
- loopx/control_plane/turn_driver/host_bridge_transport.py +58 -7
- loopx/control_plane/turn_driver/host_candidate.py +199 -76
- loopx/control_plane/turn_driver/host_failure.py +14 -0
- loopx/control_plane/turn_driver/host_failure.ts +29 -0
- loopx/control_plane/turn_driver/journal_store.py +15 -6
- loopx/control_plane/turn_driver/lane_fence.py +6 -0
- loopx/control_plane/turn_driver/loop_controller.py +16 -15
- loopx/control_plane/turn_driver/loop_controller.ts +12 -4
- loopx/control_plane/turn_driver/managed_step.py +1 -2
- loopx/control_plane/turn_driver/native_context_profile.py +20 -0
- loopx/control_plane/turn_driver/native_context_selection.py +94 -0
- loopx/control_plane/turn_driver/native_first_read.py +75 -0
- loopx/control_plane/turn_driver/session_recovery.py +16 -3
- loopx/control_plane/turn_driver/settlement.py +11 -2
- loopx/control_plane/turn_driver/subagent_execution_topology.py +3 -1
- loopx/control_plane/turn_driver/turn_journal.ts +28 -28
- loopx/control_plane/turn_driver/turn_journal_effects.ts +15 -25
- loopx/control_plane/turn_driver/turn_journal_query.ts +12 -5
- loopx/control_plane/turn_driver/turn_journal_runtime.py +4 -0
- loopx/control_plane/work_items/action_selection_admission.ts +12 -1
- loopx/control_plane/work_items/action_selection_contract.py +1 -0
- loopx/control_plane/work_items/attention_queue.py +5 -1
- loopx/control_plane/work_items/attention_routing.py +8 -2
- loopx/control_plane/work_items/autonomous_replan_obligation.py +4 -0
- loopx/control_plane/work_items/capability_monitor_fallback.py +6 -5
- loopx/control_plane/work_items/context_readback.py +21 -36
- loopx/control_plane/work_items/delivery_history.py +1 -1
- loopx/control_plane/work_items/execution_preparation.ts +129 -0
- loopx/control_plane/work_items/interaction_contract.py +124 -47
- loopx/control_plane/work_items/interaction_contract.ts +145 -25
- loopx/control_plane/work_items/issue_meta_surface.py +1 -1
- loopx/control_plane/work_items/operator_inbox.py +4 -1
- loopx/control_plane/work_items/planning_inventory.py +4 -2
- loopx/control_plane/work_items/primary_action.py +0 -26
- loopx/control_plane/work_items/progress_observation.py +3 -2
- loopx/control_plane/work_items/progress_review_evidence.ts +78 -3
- loopx/control_plane/work_items/project_asset.py +7 -0
- loopx/control_plane/work_items/repair_delta.py +1 -1
- loopx/control_plane/work_items/replan_context.ts +3 -3
- loopx/control_plane/work_items/replan_context_codec.py +8 -7
- loopx/control_plane/work_items/replan_history.ts +14 -8
- loopx/control_plane/work_items/replan_history_codec.py +3 -1
- loopx/control_plane/work_items/replan_history_settlement.ts +3 -1
- loopx/control_plane/work_items/replan_semantics.ts +16 -10
- loopx/control_plane/work_items/replan_semantics_codec.py +4 -3
- loopx/control_plane/work_items/replan_settlement.py +3 -0
- loopx/control_plane/work_items/replan_settlement.ts +22 -4
- loopx/control_plane/work_items/runtime_capability_reentry.py +6 -5
- loopx/control_plane/work_items/semantic_replan_writeback.py +9 -16
- loopx/control_plane/work_items/stride_policy.ts +30 -46
- loopx/control_plane/work_items/task_graph.py +199 -988
- loopx/control_plane/work_items/task_graph.ts +676 -28
- loopx/control_plane/work_items/task_lease_acquire.ts +2 -55
- loopx/control_plane/work_items/task_lease_acquire_decision.ts +156 -57
- loopx/control_plane/work_items/task_lease_eligibility.ts +0 -34
- loopx/control_plane/work_items/work_lane_context.py +6 -5
- loopx/control_plane/work_items/write_scope_codec.ts +102 -0
- loopx/control_plane/work_items/yardstick_decision.py +24 -0
- loopx/control_plane/work_items/yardstick_decision.ts +194 -0
- loopx/desktop_installation.py +2 -1
- loopx/doctor.py +126 -28
- loopx/doctor_git.py +193 -106
- loopx/domain_packs/issue_fix.py +83 -2
- loopx/domain_state.py +18 -16
- loopx/dsh_goal_mode/turn_host_adapter.py +44 -22
- loopx/entrypoint.py +1 -0
- loopx/execution_profile.py +26 -10
- loopx/explore_graph.py +6 -5
- loopx/extensions/codex_native_child.py +10 -2
- loopx/extensions/lark/README.md +4 -2
- loopx/extensions/lark/event_collector.py +102 -13
- loopx/extensions/lark/event_inbox.py +6 -4
- loopx/extensions/lark/goal_topic_runtime_service.py +58 -9
- loopx/extensions/lark/inbox_reactions.py +73 -9
- loopx/extensions/lark/manager_context.py +11 -0
- loopx/extensions/lark/manager_returns.py +44 -9
- loopx/extensions/lark/owner_attention.py +42 -1
- loopx/extensions/lark/presentation/explore_record_values.py +99 -0
- loopx/extensions/lark/presentation/explore_results.py +198 -83
- loopx/extensions/lark/presentation/explore_stage_document.py +23 -8
- loopx/extensions/lark/presentation/kanban.py +159 -40
- loopx/extensions/lark/private_conversation_api.py +22 -1
- loopx/extensions/lark/private_conversations.py +438 -169
- loopx/extensions/lark/private_delivery_discovery.py +65 -0
- loopx/extensions/lark/private_ingress.py +239 -2
- loopx/extensions/lark/private_progress.py +34 -5
- loopx/extensions/manifest.py +1 -1
- loopx/extensions/process_runtime.py +135 -51
- loopx/extensions/turn_host.py +3 -1
- loopx/feedback.py +46 -14
- loopx/file_lock.py +29 -3
- loopx/global_registry.py +77 -16
- loopx/global_risks.py +73 -996
- loopx/global_todos.py +205 -173
- loopx/goal_portfolio.py +7 -2
- loopx/help_surface.py +1 -2
- loopx/history.py +8 -7
- loopx/host_loop_activation.py +22 -2
- loopx/hosts/checkpoint_retention.py +19 -6
- loopx/hosts/codex_checkpoint.py +132 -26
- loopx/hosts/managed_service_runtime.py +366 -0
- loopx/hosts/research_checkpoint.py +41 -4
- loopx/hosts/skill_facade.py +30 -1
- loopx/install_contract.py +1 -1
- loopx/kunluncode_goal_mode/runtime.py +30 -0
- loopx/long_task_cadence.py +4 -3
- loopx/orchestration.py +3 -2
- loopx/pr_review.py +9 -5
- loopx/presentation/answer_instruction.py +32 -1
- loopx/presentation/background_services_api.py +5 -1
- loopx/presentation/codex_accounts_api.py +1 -1
- loopx/presentation/configuration_api.py +4 -4
- loopx/presentation/explore_results_api.py +81 -5
- loopx/presentation/goal_source_routing.py +55 -4
- loopx/presentation/renderers/quota_markdown.py +8 -6
- loopx/presentation/report_reviews_api.py +33 -0
- loopx/presentation/research_analysis_api.py +31 -8
- loopx/presentation/runtime_workspace.py +1 -1
- loopx/project_prompt.py +2 -2
- loopx/public_safe_text.py +15 -2
- loopx/quota.py +38 -37
- loopx/registry.py +77 -37
- loopx/release_manifest.py +7 -3
- loopx/runtime.py +3 -2
- loopx/runtime_activation.py +60 -14
- loopx/semantics/vocabulary_v0.json +4 -2
- loopx/skill_install_readback.py +11 -9
- loopx/slash_command_install.py +194 -12
- loopx/slash_commands.py +4 -2
- loopx/state_projection.py +5 -4
- loopx/state_refresh.py +44 -15
- loopx/status.py +6 -13
- loopx/summary_all.py +122 -626
- loopx/usage_ping.py +27 -5
- loopx/web/chat/asset-retention.json +24 -21
- loopx/web/chat/assets/answer-report-page-ByuYQEFZ.js +1 -0
- loopx/web/chat/assets/benchmark-study-page-BtROYzAO.js +1 -0
- loopx/web/chat/assets/chat-BMrKlOiD.js +63 -0
- loopx/web/chat/assets/content-production-results-C-a8ZHSQ.js +3 -0
- loopx/web/chat/assets/{frontstage-developer-page-CN1JwJZs.js → frontstage-developer-page-BQAcGdhh.js} +1 -1
- loopx/web/chat/assets/goal-report-reviews-CATRBM4H.css +1 -0
- loopx/web/chat/assets/goal-report-reviews-Coo-AMp1.js +1 -0
- loopx/web/chat/assets/index-CWA342tY.css +1 -0
- loopx/web/chat/assets/index-DOg9hYm6.js +51 -0
- loopx/web/chat/assets/workspace-settings-page-BqF8uEcI.js +7 -0
- loopx/web/chat/assets/x-D3cABN2-.js +1 -0
- loopx/web/chat/bundle-manifest.json +238 -187
- loopx/web/chat/index.html +4 -5
- loopx/windows_install.py +3 -0
- loopx/worker_bridge.py +0 -57
- loopx/workflow_skill_install.py +21 -5
- loopx/workflow_skills/ego_delivery.py +6 -5
- loopx/zcode_goal_mode/cli.ts +2 -1
- loopx/zcode_goal_mode/diagnostics.py +1 -1
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-benchmark/SKILL.md +21 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-review/SKILL.md +7 -5
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/SKILL.md +7 -3
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/heartbeat-hosts.md +49 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/outcome-refinement.md +34 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/SKILL.md +13 -4
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/references/repair-patterns.md +39 -3
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/references/targeted-diagnostics.md +28 -1
- {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/METADATA +2 -2
- {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/RECORD +637 -586
- loopx/control_plane/coordination/local_snapshot.py +0 -67
- loopx/control_plane/todos/completion_fence.py +0 -78
- loopx/control_plane/todos/update_source.py +0 -43
- loopx/web/chat/assets/answer-report-page-C6t2sUaA.js +0 -1
- loopx/web/chat/assets/answer-report-page-qfpC8lma.css +0 -1
- loopx/web/chat/assets/benchmark-study-page-CbeJaE5f.js +0 -1
- loopx/web/chat/assets/chat-DQ8MlhDg.js +0 -72
- loopx/web/chat/assets/content-production-results-CU67baBd.js +0 -3
- loopx/web/chat/assets/index-B6mebcGd.js +0 -42
- loopx/web/chat/assets/index-W4WVpCAp.css +0 -1
- loopx/web/chat/assets/workspace-settings-page-DQBucRl6.js +0 -7
- loopx/web/chat/assets/workspace-settings-page-YXd5Kmd-.css +0 -1
- /loopx/{chat_event_cache.py → chat/event_cache.py} +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-benchmark/.loopx-skill-scope +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-benchmark/agents/openai.yaml +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-change-quality/.loopx-skill-scope +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-change-quality/SKILL.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-change-quality/agents/openai.yaml +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-doc-registry/.loopx-skill-scope +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-doc-registry/SKILL.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-doc-registry/agents/openai.yaml +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-material/.loopx-skill-scope +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-material/SKILL.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-material/agents/openai.yaml +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-performance-diagnosis/.loopx-skill-scope +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-performance-diagnosis/SKILL.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-performance-diagnosis/agents/openai.yaml +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-program/.loopx-skill-scope +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-program/SKILL.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-program/agents/openai.yaml +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-program/references/snapshot-contract.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-program/scripts/diff_snapshot.py +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-review/.loopx-skill-scope +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-pr-review/agents/openai.yaml +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/.loopx-skill-scope +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/agents/openai.yaml +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/autonomous-execution.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/handoff-and-feedback.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/installation-and-diagnosis.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/materials-explore-quality.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-project/references/start-and-connect.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/.loopx-skill-scope +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/agents/openai.yaml +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/references/pattern-lookup.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/references/upstream-issue-escalation.md +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/scripts/find_pattern.py +0 -0
- {loopx-2.2.0.data → loopx-2.3.0.data}/data/share/loopx/skills/loopx-self-repair/scripts/lexical_retrieval.py +0 -0
- {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/WHEEL +0 -0
- {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/entry_points.txt +0 -0
- {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/licenses/LICENSE +0 -0
- {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/licenses/LICENSE-MIT +0 -0
- {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/licenses/NOTICE +0 -0
- {loopx-2.2.0.dist-info → loopx-2.3.0.dist-info}/top_level.txt +0 -0
loopx/__init__.py
CHANGED
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 "
|
loopx/agy_goal_mode/__init__.py
CHANGED
|
@@ -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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
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
|
|
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 =
|
|
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.
|
|
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
|
|
77
|
-
"no
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
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
|
|
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
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"the
|
|
94
|
-
"
|
|
95
|
-
"
|
|
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
|
|
99
|
-
"
|
|
100
|
-
"
|
|
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
|
-
"""
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
|
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
|
+
)
|