@team-agent/installer 0.5.128 → 0.6.1
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.
- package/README.md +4 -4
- package/README.zh.md +1 -1
- package/package.json +4 -8
- package/skills/team-agent/SKILL.md +37 -20
- package/skills/team-agent/command-coverage.json +169 -183
- package/skills/team-agent/docs/reference/team-agent-operator.md +64 -30
- package/skills/team-agent/references/recovery-runbook.md +1 -1
- package/skills/team-agent/references/team-agent-operator.md +64 -30
- package/templates/team_state.md +1 -1
- package/Cargo.lock +0 -1063
- package/Cargo.toml +0 -36
- package/crates/team-agent/Cargo.toml +0 -69
- package/crates/team-agent/src/app_server_test_support.rs +0 -258
- package/crates/team-agent/src/cli/adapters.rs +0 -1288
- package/crates/team-agent/src/cli/arguments.rs +0 -405
- package/crates/team-agent/src/cli/attach_app_server_leader.rs +0 -98
- package/crates/team-agent/src/cli/diagnose.rs +0 -1721
- package/crates/team-agent/src/cli/emit.rs +0 -2930
- package/crates/team-agent/src/cli/grok_slot.rs +0 -384
- package/crates/team-agent/src/cli/helpers.rs +0 -91
- package/crates/team-agent/src/cli/intent/runtime.rs +0 -1216
- package/crates/team-agent/src/cli/intent/runtime_tests.rs +0 -912
- package/crates/team-agent/src/cli/intent/tests.rs +0 -689
- package/crates/team-agent/src/cli/intent.rs +0 -664
- package/crates/team-agent/src/cli/leader.rs +0 -300
- package/crates/team-agent/src/cli/leader_prompt.rs +0 -261
- package/crates/team-agent/src/cli/leaders.rs +0 -418
- package/crates/team-agent/src/cli/mod.rs +0 -6545
- package/crates/team-agent/src/cli/models.rs +0 -1206
- package/crates/team-agent/src/cli/named_address.rs +0 -1651
- package/crates/team-agent/src/cli/profile.rs +0 -342
- package/crates/team-agent/src/cli/route.rs +0 -212
- package/crates/team-agent/src/cli/schedule.rs +0 -175
- package/crates/team-agent/src/cli/send/coordinator.rs +0 -164
- package/crates/team-agent/src/cli/send/mailbox.rs +0 -145
- package/crates/team-agent/src/cli/send/persist.rs +0 -156
- package/crates/team-agent/src/cli/send/presentation.rs +0 -370
- package/crates/team-agent/src/cli/send/resolve.rs +0 -573
- package/crates/team-agent/src/cli/send.rs +0 -199
- package/crates/team-agent/src/cli/shutdown_socket.rs +0 -288
- package/crates/team-agent/src/cli/spec.rs +0 -165
- package/crates/team-agent/src/cli/status.rs +0 -280
- package/crates/team-agent/src/cli/status_port/agents.rs +0 -358
- package/crates/team-agent/src/cli/status_port/approvals.rs +0 -79
- package/crates/team-agent/src/cli/status_port/brief.rs +0 -1981
- package/crates/team-agent/src/cli/status_port/compact.rs +0 -240
- package/crates/team-agent/src/cli/status_port/format.rs +0 -146
- package/crates/team-agent/src/cli/status_port/inbox.rs +0 -62
- package/crates/team-agent/src/cli/status_port/runtime.rs +0 -197
- package/crates/team-agent/src/cli/status_port/snapshot.rs +0 -208
- package/crates/team-agent/src/cli/status_port/store.rs +0 -416
- package/crates/team-agent/src/cli/status_port/tests.rs +0 -90
- package/crates/team-agent/src/cli/status_port.rs +0 -92
- package/crates/team-agent/src/cli/tests/base.rs +0 -885
- package/crates/team-agent/src/cli/tests/divergence.rs +0 -518
- package/crates/team-agent/src/cli/tests/lane_c.rs +0 -453
- package/crates/team-agent/src/cli/tests/leader_watch.rs +0 -322
- package/crates/team-agent/src/cli/tests/main_preserved.rs +0 -430
- package/crates/team-agent/src/cli/tests/missing_subcommands.rs +0 -336
- package/crates/team-agent/src/cli/tests/mod.rs +0 -137
- package/crates/team-agent/src/cli/tests/named_address.rs +0 -761
- package/crates/team-agent/src/cli/tests/parser_safety.rs +0 -383
- package/crates/team-agent/src/cli/tests/run_delegation.rs +0 -484
- package/crates/team-agent/src/cli/tests/shutdown_kill_plan.rs +0 -2179
- package/crates/team-agent/src/cli/tests/status_brief.rs +0 -1514
- package/crates/team-agent/src/cli/tests/status_send.rs +0 -888
- package/crates/team-agent/src/cli/tests/verb_install_skill.rs +0 -93
- package/crates/team-agent/src/cli/tests/verb_profile.rs +0 -392
- package/crates/team-agent/src/cli/triage.rs +0 -234
- package/crates/team-agent/src/cli/types.rs +0 -591
- package/crates/team-agent/src/codex_app_server.rs +0 -546
- package/crates/team-agent/src/communication_mode/mod.rs +0 -56
- package/crates/team-agent/src/compiler/tests.rs +0 -827
- package/crates/team-agent/src/compiler.rs +0 -890
- package/crates/team-agent/src/conpty/backend.rs +0 -829
- package/crates/team-agent/src/conpty/mod.rs +0 -33
- package/crates/team-agent/src/contract_runtime/backend.rs +0 -1744
- package/crates/team-agent/src/contract_runtime/commands.rs +0 -671
- package/crates/team-agent/src/contract_runtime/config.rs +0 -364
- package/crates/team-agent/src/contract_runtime/config_tests.rs +0 -76
- package/crates/team-agent/src/contract_runtime/discovery.rs +0 -449
- package/crates/team-agent/src/contract_runtime/fork.rs +0 -361
- package/crates/team-agent/src/contract_runtime/forward.rs +0 -288
- package/crates/team-agent/src/contract_runtime/framework.rs +0 -367
- package/crates/team-agent/src/contract_runtime/mcp.rs +0 -394
- package/crates/team-agent/src/contract_runtime/mod.rs +0 -17
- package/crates/team-agent/src/contract_runtime/prompt.rs +0 -216
- package/crates/team-agent/src/contract_runtime/pump.rs +0 -271
- package/crates/team-agent/src/contract_runtime/registry.rs +0 -553
- package/crates/team-agent/src/contract_runtime/workspace.rs +0 -228
- package/crates/team-agent/src/coordinator/backoff.rs +0 -741
- package/crates/team-agent/src/coordinator/conpty_shim.rs +0 -805
- package/crates/team-agent/src/coordinator/health.rs +0 -1185
- package/crates/team-agent/src/coordinator/mod.rs +0 -119
- package/crates/team-agent/src/coordinator/orphan.rs +0 -110
- package/crates/team-agent/src/coordinator/runtime_detectors.rs +0 -798
- package/crates/team-agent/src/coordinator/runtime_observation.rs +0 -84
- package/crates/team-agent/src/coordinator/steps/abnormal.rs +0 -2309
- package/crates/team-agent/src/coordinator/steps/delivery.rs +0 -15
- package/crates/team-agent/src/coordinator/steps/health_sync.rs +0 -15
- package/crates/team-agent/src/coordinator/steps/mod.rs +0 -126
- package/crates/team-agent/src/coordinator/steps/persist.rs +0 -15
- package/crates/team-agent/src/coordinator/steps/runtime_prompts.rs +0 -15
- package/crates/team-agent/src/coordinator/steps/session_gate.rs +0 -16
- package/crates/team-agent/src/coordinator/tests/a0_lostupdate.rs +0 -158
- package/crates/team-agent/src/coordinator/tests/abnormal.rs +0 -312
- package/crates/team-agent/src/coordinator/tests/api_error_recovery.rs +0 -300
- package/crates/team-agent/src/coordinator/tests/basics.rs +0 -211
- package/crates/team-agent/src/coordinator/tests/daemon.rs +0 -514
- package/crates/team-agent/src/coordinator/tests/energy.rs +0 -549
- package/crates/team-agent/src/coordinator/tests/health_sync.rs +0 -503
- package/crates/team-agent/src/coordinator/tests/main_preserved.rs +0 -186
- package/crates/team-agent/src/coordinator/tests/mod.rs +0 -295
- package/crates/team-agent/src/coordinator/tests/s3_bounded.rs +0 -207
- package/crates/team-agent/src/coordinator/tests/spine.rs +0 -308
- package/crates/team-agent/src/coordinator/tests/takeover.rs +0 -286
- package/crates/team-agent/src/coordinator/tests/tick_core.rs +0 -237
- package/crates/team-agent/src/coordinator/tick.rs +0 -3024
- package/crates/team-agent/src/coordinator/types.rs +0 -540
- package/crates/team-agent/src/db/agent_health_capture.rs +0 -126
- package/crates/team-agent/src/db/message_store.rs +0 -1527
- package/crates/team-agent/src/db/migration.rs +0 -984
- package/crates/team-agent/src/db/mod.rs +0 -26
- package/crates/team-agent/src/db/schema.rs +0 -663
- package/crates/team-agent/src/diagnose/comms.rs +0 -242
- package/crates/team-agent/src/diagnose/mod.rs +0 -44
- package/crates/team-agent/src/diagnose/orphans.rs +0 -889
- package/crates/team-agent/src/direct_delivery.rs +0 -368
- package/crates/team-agent/src/event_log.rs +0 -502
- package/crates/team-agent/src/fake_worker.rs +0 -303
- package/crates/team-agent/src/inbox_store.rs +0 -169
- package/crates/team-agent/src/kill_audit.rs +0 -106
- package/crates/team-agent/src/layout/manager.rs +0 -248
- package/crates/team-agent/src/layout/mod.rs +0 -36
- package/crates/team-agent/src/layout/overlay.rs +0 -134
- package/crates/team-agent/src/layout/placement.rs +0 -52
- package/crates/team-agent/src/layout/recovery.rs +0 -106
- package/crates/team-agent/src/layout/runtime_sessions.rs +0 -317
- package/crates/team-agent/src/layout/sessions.rs +0 -294
- package/crates/team-agent/src/layout/tmux_endpoint.rs +0 -165
- package/crates/team-agent/src/layout/worker_env.rs +0 -721
- package/crates/team-agent/src/layout/worker_window_helpers.rs +0 -37
- package/crates/team-agent/src/leader/helpers.rs +0 -178
- package/crates/team-agent/src/leader/incident.rs +0 -6
- package/crates/team-agent/src/leader/lease.rs +0 -3356
- package/crates/team-agent/src/leader/mod.rs +0 -104
- package/crates/team-agent/src/leader/owner_bind.rs +0 -400
- package/crates/team-agent/src/leader/prompt.rs +0 -905
- package/crates/team-agent/src/leader/provider_attribution.rs +0 -247
- package/crates/team-agent/src/leader/rediscover/tests.rs +0 -689
- package/crates/team-agent/src/leader/rediscover.rs +0 -1192
- package/crates/team-agent/src/leader/registry.rs +0 -888
- package/crates/team-agent/src/leader/start.rs +0 -4501
- package/crates/team-agent/src/leader/takeover.rs +0 -65
- package/crates/team-agent/src/leader/tests/basics.rs +0 -337
- package/crates/team-agent/src/leader/tests/byte_findings.rs +0 -355
- package/crates/team-agent/src/leader/tests/claim_leader_mailbox_flush_contract.rs +0 -544
- package/crates/team-agent/src/leader/tests/historical_inventory_upgrade_gate_red.rs +0 -624
- package/crates/team-agent/src/leader/tests/identity.rs +0 -465
- package/crates/team-agent/src/leader/tests/identity_session_names.rs +0 -42
- package/crates/team-agent/src/leader/tests/idle.rs +0 -113
- package/crates/team-agent/src/leader/tests/lease_api.rs +0 -520
- package/crates/team-agent/src/leader/tests/lease_claim.rs +0 -629
- package/crates/team-agent/src/leader/tests/mod.rs +0 -106
- package/crates/team-agent/src/leader/tests/prompt_contract.rs +0 -268
- package/crates/team-agent/src/leader/tests/rediscover.rs +0 -403
- package/crates/team-agent/src/leader/tests/rehomed_env.rs +0 -83
- package/crates/team-agent/src/leader/tests/team_in_team_state_scope_red.rs +0 -1273
- package/crates/team-agent/src/leader/tests/terminal_and_replay_vs_rerender_invariants_red.rs +0 -417
- package/crates/team-agent/src/leader/tests/wake_start_owner.rs +0 -168
- package/crates/team-agent/src/leader/types.rs +0 -534
- package/crates/team-agent/src/lib.rs +0 -147
- package/crates/team-agent/src/lifecycle/helpers.rs +0 -212
- package/crates/team-agent/src/lifecycle/launch/add_agent.rs +0 -881
- package/crates/team-agent/src/lifecycle/launch/add_agent_state.rs +0 -598
- package/crates/team-agent/src/lifecycle/launch/agent_state.rs +0 -332
- package/crates/team-agent/src/lifecycle/launch/clone_agent.rs +0 -204
- package/crates/team-agent/src/lifecycle/launch/fork_agent.rs +0 -107
- package/crates/team-agent/src/lifecycle/launch/fork_entry.rs +0 -144
- package/crates/team-agent/src/lifecycle/launch/identity.rs +0 -674
- package/crates/team-agent/src/lifecycle/launch/layout.rs +0 -350
- package/crates/team-agent/src/lifecycle/launch/leader_context.rs +0 -589
- package/crates/team-agent/src/lifecycle/launch/mcp_config.rs +0 -160
- package/crates/team-agent/src/lifecycle/launch/ownership.rs +0 -105
- package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +0 -899
- package/crates/team-agent/src/lifecycle/launch/pi_mcp_extension.js +0 -225
- package/crates/team-agent/src/lifecycle/launch/plan.rs +0 -269
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +0 -5200
- package/crates/team-agent/src/lifecycle/launch/quick_start_transport.rs +0 -368
- package/crates/team-agent/src/lifecycle/launch/readiness.rs +0 -519
- package/crates/team-agent/src/lifecycle/launch/role_source.rs +0 -287
- package/crates/team-agent/src/lifecycle/launch/spawn.rs +0 -473
- package/crates/team-agent/src/lifecycle/launch/spec_state.rs +0 -801
- package/crates/team-agent/src/lifecycle/launch/state_projection.rs +0 -624
- package/crates/team-agent/src/lifecycle/launch/worker_env.rs +0 -558
- package/crates/team-agent/src/lifecycle/launch.rs +0 -557
- package/crates/team-agent/src/lifecycle/lock.rs +0 -350
- package/crates/team-agent/src/lifecycle/mod.rs +0 -79
- package/crates/team-agent/src/lifecycle/pane_input_lock.rs +0 -239
- package/crates/team-agent/src/lifecycle/profile_launch.rs +0 -1067
- package/crates/team-agent/src/lifecycle/profile_smoke.rs +0 -557
- package/crates/team-agent/src/lifecycle/restart/agent.rs +0 -2199
- package/crates/team-agent/src/lifecycle/restart/avatar.rs +0 -1798
- package/crates/team-agent/src/lifecycle/restart/claude_fork.rs +0 -163
- package/crates/team-agent/src/lifecycle/restart/common.rs +0 -2362
- package/crates/team-agent/src/lifecycle/restart/orchestrator.rs +0 -65
- package/crates/team-agent/src/lifecycle/restart/preflight.rs +0 -113
- package/crates/team-agent/src/lifecycle/restart/rebuild.rs +0 -5135
- package/crates/team-agent/src/lifecycle/restart/remove.rs +0 -1504
- package/crates/team-agent/src/lifecycle/restart/selection.rs +0 -559
- package/crates/team-agent/src/lifecycle/restart/team_state.rs +0 -329
- package/crates/team-agent/src/lifecycle/restart.rs +0 -227
- package/crates/team-agent/src/lifecycle/role_config.rs +0 -1230
- package/crates/team-agent/src/lifecycle/tests/acceptance_b_batch_red.rs +0 -1021
- package/crates/team-agent/src/lifecycle/tests/agent_ops.rs +0 -1205
- package/crates/team-agent/src/lifecycle/tests/b0_legacy_snapshot_nonauthority_contract.rs +0 -265
- package/crates/team-agent/src/lifecycle/tests/b0_reader_hideone_audit_contract.rs +0 -490
- package/crates/team-agent/src/lifecycle/tests/behavioral_diff_264_red.rs +0 -656
- package/crates/team-agent/src/lifecycle/tests/claude_compatible_config_red.rs +0 -325
- package/crates/team-agent/src/lifecycle/tests/claude_profile_launch_red.rs +0 -447
- package/crates/team-agent/src/lifecycle/tests/cli_argv_routing_red.rs +0 -1638
- package/crates/team-agent/src/lifecycle/tests/clone_agent_preserves_source_tools.rs +0 -427
- package/crates/team-agent/src/lifecycle/tests/clone_fork_copilot_perms_red.rs +0 -770
- package/crates/team-agent/src/lifecycle/tests/communication_mode_runtime_contract_red.rs +0 -419
- package/crates/team-agent/src/lifecycle/tests/copilot_provider_red.rs +0 -2035
- package/crates/team-agent/src/lifecycle/tests/core.rs +0 -1327
- package/crates/team-agent/src/lifecycle/tests/f032_startup_prompt_best_effort_red.rs +0 -315
- package/crates/team-agent/src/lifecycle/tests/fixtures/pi_list_models_g0.stdout.txt +0 -222
- package/crates/team-agent/src/lifecycle/tests/fixtures/pi_list_models_spaced_ids.stdout.txt +0 -9
- package/crates/team-agent/src/lifecycle/tests/fixtures/pi_native_mcp_host.mjs +0 -72
- package/crates/team-agent/src/lifecycle/tests/gate_fixtures.rs +0 -562
- package/crates/team-agent/src/lifecycle/tests/grok_require_explicit_model_red.rs +0 -110
- package/crates/team-agent/src/lifecycle/tests/harvest2_a_batch_red.rs +0 -512
- package/crates/team-agent/src/lifecycle/tests/host_cotenant_death_p0_contract.rs +0 -921
- package/crates/team-agent/src/lifecycle/tests/issue238_codex_effort_contract.rs +0 -68
- package/crates/team-agent/src/lifecycle/tests/lane_ops.rs +0 -1851
- package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +0 -3983
- package/crates/team-agent/src/lifecycle/tests/lifecycle_lock.rs +0 -339
- package/crates/team-agent/src/lifecycle/tests/lifecycle_rollback_red.rs +0 -596
- package/crates/team-agent/src/lifecycle/tests/main_preserved.rs +0 -513
- package/crates/team-agent/src/lifecycle/tests/mcp_tool_name_format_red.rs +0 -69
- package/crates/team-agent/src/lifecycle/tests/phase_b_contracts.rs +0 -824
- package/crates/team-agent/src/lifecycle/tests/phase_golden.rs +0 -723
- package/crates/team-agent/src/lifecycle/tests/pi_catalog_red.rs +0 -164
- package/crates/team-agent/src/lifecycle/tests/pi_command_red.rs +0 -200
- package/crates/team-agent/src/lifecycle/tests/pi_compiler_red.rs +0 -210
- package/crates/team-agent/src/lifecycle/tests/pi_dual_entry_red.rs +0 -527
- package/crates/team-agent/src/lifecycle/tests/pi_executable_mcp_red.rs +0 -1062
- package/crates/team-agent/src/lifecycle/tests/pi_fork_session_inheritance_red.rs +0 -1419
- package/crates/team-agent/src/lifecycle/tests/pi_lifecycle_doctor_red.rs +0 -98
- package/crates/team-agent/src/lifecycle/tests/pi_native_mcp_capability_red.rs +0 -550
- package/crates/team-agent/src/lifecycle/tests/pi_session_delivery_red.rs +0 -226
- package/crates/team-agent/src/lifecycle/tests/quick_start_worker_readiness_red.rs +0 -332
- package/crates/team-agent/src/lifecycle/tests/realmachine_clusters_1_6_red.rs +0 -786
- package/crates/team-agent/src/lifecycle/tests/realmachine_residual_g1_g4_red.rs +0 -648
- package/crates/team-agent/src/lifecycle/tests/restart.rs +0 -185
- package/crates/team-agent/src/lifecycle/tests/restart_build_before_destroy_0540_contract.rs +0 -1053
- package/crates/team-agent/src/lifecycle/tests/restart_liveness_red.rs +0 -679
- package/crates/team-agent/src/lifecycle/tests/restart_rebind_hotfix_252_red.rs +0 -1126
- package/crates/team-agent/src/lifecycle/tests/restart_session_capture_red.rs +0 -153
- package/crates/team-agent/src/lifecycle/tests/resume_recover_red.rs +0 -427
- package/crates/team-agent/src/lifecycle/tests/stale_team_saveconflict_contract.rs +0 -431
- package/crates/team-agent/src/lifecycle/tests/startup_latency_contract.rs +0 -1066
- package/crates/team-agent/src/lifecycle/tests/status_credential_redaction_contract.rs +0 -876
- package/crates/team-agent/src/lifecycle/tests/subprep_codex_trust_roundtrip_red.rs +0 -1026
- package/crates/team-agent/src/lifecycle/tests/swallow_batch4_semantics_red.rs +0 -342
- package/crates/team-agent/src/lifecycle/tests/team_in_team_identity_scope_red.rs +0 -543
- package/crates/team-agent/src/lifecycle/tests/team_in_team_sibling_quick_start_red.rs +0 -1103
- package/crates/team-agent/src/lifecycle/tests/team_in_team_state_scope_red.rs +0 -1276
- package/crates/team-agent/src/lifecycle/tests/team_key_retirement_roster_red.rs +0 -145
- package/crates/team-agent/src/lifecycle/tests/team_key_retirement_txn_red.rs +0 -603
- package/crates/team-agent/src/lifecycle/tests/test_isolation_escape_contract.rs +0 -936
- package/crates/team-agent/src/lifecycle/tests/upgrade_compat_0211_red.rs +0 -970
- package/crates/team-agent/src/lifecycle/tests/verify_rs031_window_consistency_red.rs +0 -995
- package/crates/team-agent/src/lifecycle/tests/worker_spawn_env_red.rs +0 -836
- package/crates/team-agent/src/lifecycle/tests.rs +0 -105
- package/crates/team-agent/src/lifecycle/types.rs +0 -877
- package/crates/team-agent/src/lifecycle/worker_command_context.rs +0 -363
- package/crates/team-agent/src/main.rs +0 -52
- package/crates/team-agent/src/mcp_server/helpers.rs +0 -510
- package/crates/team-agent/src/mcp_server/lifecycle_tools/mod.rs +0 -6
- package/crates/team-agent/src/mcp_server/lifecycle_tools/state_status.rs +0 -43
- package/crates/team-agent/src/mcp_server/mod.rs +0 -119
- package/crates/team-agent/src/mcp_server/normalize.rs +0 -485
- package/crates/team-agent/src/mcp_server/readiness.rs +0 -527
- package/crates/team-agent/src/mcp_server/readiness_tests.rs +0 -348
- package/crates/team-agent/src/mcp_server/tests/golden.rs +0 -285
- package/crates/team-agent/src/mcp_server/tests/normalize.rs +0 -247
- package/crates/team-agent/src/mcp_server/tests/scoped.rs +0 -158
- package/crates/team-agent/src/mcp_server/tests/send.rs +0 -353
- package/crates/team-agent/src/mcp_server/tests/tools.rs +0 -341
- package/crates/team-agent/src/mcp_server/tests/wire.rs +0 -254
- package/crates/team-agent/src/mcp_server/tests.rs +0 -43
- package/crates/team-agent/src/mcp_server/tools.rs +0 -889
- package/crates/team-agent/src/mcp_server/types.rs +0 -396
- package/crates/team-agent/src/mcp_server/wire.rs +0 -867
- package/crates/team-agent/src/messaging/activity.rs +0 -461
- package/crates/team-agent/src/messaging/address.rs +0 -87
- package/crates/team-agent/src/messaging/delivery.rs +0 -3727
- package/crates/team-agent/src/messaging/delivery_consumption_tests.rs +0 -234
- package/crates/team-agent/src/messaging/enter_rescue.rs +0 -362
- package/crates/team-agent/src/messaging/enter_rescue_tests.rs +0 -633
- package/crates/team-agent/src/messaging/helpers.rs +0 -336
- package/crates/team-agent/src/messaging/leader_channel.rs +0 -287
- package/crates/team-agent/src/messaging/leader_receiver.rs +0 -786
- package/crates/team-agent/src/messaging/mod.rs +0 -167
- package/crates/team-agent/src/messaging/persist.rs +0 -377
- package/crates/team-agent/src/messaging/presentation.rs +0 -417
- package/crates/team-agent/src/messaging/reminders.rs +0 -316
- package/crates/team-agent/src/messaging/results/collection_tests.rs +0 -719
- package/crates/team-agent/src/messaging/results.rs +0 -1415
- package/crates/team-agent/src/messaging/scheduler.rs +0 -223
- package/crates/team-agent/src/messaging/selftest.rs +0 -315
- package/crates/team-agent/src/messaging/send.rs +0 -981
- package/crates/team-agent/src/messaging/tests/basic.rs +0 -346
- package/crates/team-agent/src/messaging/tests/dup_inject.rs +0 -657
- package/crates/team-agent/src/messaging/tests/e23.rs +0 -49
- package/crates/team-agent/src/messaging/tests/leader_channel.rs +0 -169
- package/crates/team-agent/src/messaging/tests/leader_inject_acceptance.rs +0 -817
- package/crates/team-agent/src/messaging/tests/main_preserved.rs +0 -85
- package/crates/team-agent/src/messaging/tests/mod.rs +0 -306
- package/crates/team-agent/src/messaging/tests/runtime.rs +0 -3549
- package/crates/team-agent/src/messaging/tests/spine.rs +0 -853
- package/crates/team-agent/src/messaging/tests/wave2.rs +0 -381
- package/crates/team-agent/src/messaging/trust.rs +0 -215
- package/crates/team-agent/src/messaging/types.rs +0 -472
- package/crates/team-agent/src/messaging/wait.rs +0 -366
- package/crates/team-agent/src/messaging/watchers.rs +0 -916
- package/crates/team-agent/src/model/enums.rs +0 -356
- package/crates/team-agent/src/model/errors.rs +0 -18
- package/crates/team-agent/src/model/ids.rs +0 -165
- package/crates/team-agent/src/model/mod.rs +0 -29
- package/crates/team-agent/src/model/name_similarity.rs +0 -252
- package/crates/team-agent/src/model/pane_authority_refusal.rs +0 -359
- package/crates/team-agent/src/model/paths.rs +0 -257
- package/crates/team-agent/src/model/routing.rs +0 -387
- package/crates/team-agent/src/model/spec.rs +0 -1184
- package/crates/team-agent/src/model/task_graph.rs +0 -321
- package/crates/team-agent/src/model/testdata/fuzz.golden.yaml +0 -43
- package/crates/team-agent/src/model/testdata/fuzz.yaml +0 -43
- package/crates/team-agent/src/model/testdata/spec_invalid_a.yaml +0 -209
- package/crates/team-agent/src/model/testdata/team.spec.golden.yaml +0 -208
- package/crates/team-agent/src/model/testdata/team.spec.yaml +0 -208
- package/crates/team-agent/src/model/yaml/tests.rs +0 -188
- package/crates/team-agent/src/model/yaml.rs +0 -802
- package/crates/team-agent/src/os_probe.rs +0 -280
- package/crates/team-agent/src/packaging/install.rs +0 -219
- package/crates/team-agent/src/packaging/migrate.rs +0 -38
- package/crates/team-agent/src/packaging/mod.rs +0 -91
- package/crates/team-agent/src/packaging/repair.rs +0 -33
- package/crates/team-agent/src/packaging/tests.rs +0 -822
- package/crates/team-agent/src/packaging/types.rs +0 -417
- package/crates/team-agent/src/platform/argv.rs +0 -331
- package/crates/team-agent/src/platform/errors.rs +0 -104
- package/crates/team-agent/src/platform/file_lock.rs +0 -279
- package/crates/team-agent/src/platform/mod.rs +0 -5
- package/crates/team-agent/src/platform/process.rs +0 -545
- package/crates/team-agent/src/provider/adapter.rs +0 -1150
- package/crates/team-agent/src/provider/adapters/claude.rs +0 -78
- package/crates/team-agent/src/provider/adapters/claude_fork.rs +0 -131
- package/crates/team-agent/src/provider/adapters/copilot.rs +0 -75
- package/crates/team-agent/src/provider/adapters/copilot_fork.rs +0 -307
- package/crates/team-agent/src/provider/adapters/fake.rs +0 -18
- package/crates/team-agent/src/provider/adapters/mod.rs +0 -30
- package/crates/team-agent/src/provider/adapters/pi.rs +0 -106
- package/crates/team-agent/src/provider/approvals/mod.rs +0 -3
- package/crates/team-agent/src/provider/approvals/parsing.rs +0 -586
- package/crates/team-agent/src/provider/approvals/runtime_prompts.rs +0 -205
- package/crates/team-agent/src/provider/argv_route.rs +0 -405
- package/crates/team-agent/src/provider/bypass_flags.rs +0 -116
- package/crates/team-agent/src/provider/classify.rs +0 -708
- package/crates/team-agent/src/provider/command_helpers.rs +0 -45
- package/crates/team-agent/src/provider/faults.rs +0 -165
- package/crates/team-agent/src/provider/helpers.rs +0 -52
- package/crates/team-agent/src/provider/mod.rs +0 -78
- package/crates/team-agent/src/provider/model_catalog.rs +0 -910
- package/crates/team-agent/src/provider/session/capture.rs +0 -2731
- package/crates/team-agent/src/provider/session/context_fork/claude.rs +0 -123
- package/crates/team-agent/src/provider/session/context_fork/outcome.rs +0 -172
- package/crates/team-agent/src/provider/session/context_fork.rs +0 -396
- package/crates/team-agent/src/provider/session/mod.rs +0 -36
- package/crates/team-agent/src/provider/session/resume.rs +0 -269
- package/crates/team-agent/src/provider/session_scan/claude.rs +0 -523
- package/crates/team-agent/src/provider/session_scan/common/tests.rs +0 -316
- package/crates/team-agent/src/provider/session_scan/common.rs +0 -654
- package/crates/team-agent/src/provider/session_scan/copilot.rs +0 -280
- package/crates/team-agent/src/provider/session_scan/pi.rs +0 -185
- package/crates/team-agent/src/provider/session_scan.rs +0 -71
- package/crates/team-agent/src/provider/startup_prompt.rs +0 -757
- package/crates/team-agent/src/provider/submit_now.rs +0 -71
- package/crates/team-agent/src/provider/testdata/copilot-ready-marker.txt +0 -5
- package/crates/team-agent/src/provider/testdata/copilot-trust-prompt.txt +0 -19
- package/crates/team-agent/src/provider/testdata/grok-models-authenticated.stdout +0 -9
- package/crates/team-agent/src/provider/testdata/grok-models-unauthenticated.stdout +0 -7
- package/crates/team-agent/src/provider/tests/adapter.rs +0 -441
- package/crates/team-agent/src/provider/tests/classify.rs +0 -148
- package/crates/team-agent/src/provider/tests/command_helpers.rs +0 -35
- package/crates/team-agent/src/provider/tests/copilot_fork.rs +0 -191
- package/crates/team-agent/src/provider/tests/faults.rs +0 -200
- package/crates/team-agent/src/provider/tests/idle.rs +0 -177
- package/crates/team-agent/src/provider/tests/wire.rs +0 -213
- package/crates/team-agent/src/provider/tests.rs +0 -32
- package/crates/team-agent/src/provider/types.rs +0 -529
- package/crates/team-agent/src/provider/wire.rs +0 -394
- package/crates/team-agent/src/redaction.rs +0 -259
- package/crates/team-agent/src/state/abnormal_watch/tests/mod.rs +0 -248
- package/crates/team-agent/src/state/abnormal_watch.rs +0 -144
- package/crates/team-agent/src/state/identity.rs +0 -914
- package/crates/team-agent/src/state/identity_keys.rs +0 -132
- package/crates/team-agent/src/state/mod.rs +0 -74
- package/crates/team-agent/src/state/owner_gate.rs +0 -482
- package/crates/team-agent/src/state/ownership.rs +0 -563
- package/crates/team-agent/src/state/paths.rs +0 -395
- package/crates/team-agent/src/state/persist.rs +0 -3811
- package/crates/team-agent/src/state/projection.rs +0 -1508
- package/crates/team-agent/src/state/repository/intent.rs +0 -14
- package/crates/team-agent/src/state/repository/tests.rs +0 -184
- package/crates/team-agent/src/state/repository.rs +0 -866
- package/crates/team-agent/src/state/selector.rs +0 -160
- package/crates/team-agent/src/state/testdata/state-rich.canonical.json +0 -133
- package/crates/team-agent/src/test_support/models_timeout_fixture.rs +0 -144
- package/crates/team-agent/src/tmux_backend/enter_rescue.rs +0 -325
- package/crates/team-agent/src/tmux_backend/enter_rescue_tests.rs +0 -432
- package/crates/team-agent/src/tmux_backend/native_input.rs +0 -513
- package/crates/team-agent/src/tmux_backend/native_input_tests.rs +0 -742
- package/crates/team-agent/src/tmux_backend/tests.rs +0 -4103
- package/crates/team-agent/src/tmux_backend.rs +0 -4492
- package/crates/team-agent/src/topology.rs +0 -537
- package/crates/team-agent/src/transport/enter_rescue.rs +0 -166
- package/crates/team-agent/src/transport/native_input.rs +0 -491
- package/crates/team-agent/src/transport/test_support.rs +0 -743
- package/crates/team-agent/src/transport/tests/behavior.rs +0 -326
- package/crates/team-agent/src/transport/tests/mod.rs +0 -194
- package/crates/team-agent/src/transport/tests/wire.rs +0 -574
- package/crates/team-agent/src/transport.rs +0 -1655
- package/crates/team-agent/src/transport_factory.rs +0 -819
|
@@ -1,591 +0,0 @@
|
|
|
1
|
-
//!
|
|
2
|
-
//! cli · types — 错误信封 / 退出码 / 命令结果载体 / leader passthrough 参数 /
|
|
3
|
-
//! 每子命令的 clap-style arg 结构 / 五行 summary 计数桶。
|
|
4
|
-
|
|
5
|
-
use super::*;
|
|
6
|
-
use crate::provider::Provider;
|
|
7
|
-
use crate::transport::PaneId;
|
|
8
|
-
|
|
9
|
-
// =============================================================================
|
|
10
|
-
// ERRORS / EXIT(helpers.py `_emit_cli_error` / `_cli_error_payload`)
|
|
11
|
-
// =============================================================================
|
|
12
|
-
|
|
13
|
-
/// CLI 顶层错误信封(`_cli_error_payload`,`helpers.py:137-155`)。`--json` 时序列化为
|
|
14
|
-
/// `{ok:false, error, action, log, reason?, session_name?, next_actions?}`(字节级保留)。
|
|
15
|
-
/// 人读时打 `error:`/`action:`/`log:` 三行到 stderr(`helpers.py:132-134`)。
|
|
16
|
-
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
17
|
-
pub(crate) struct CliErrorPayload {
|
|
18
|
-
/// 恒 `false`(错误信封)。
|
|
19
|
-
pub ok: bool,
|
|
20
|
-
pub error: String,
|
|
21
|
-
pub action: String,
|
|
22
|
-
/// `.team/logs/cli-error-<ts>.log` 路径(mkdir 失败 fallback cwd,`helpers.py:122-125`)。
|
|
23
|
-
pub log: String,
|
|
24
|
-
/// tmux session 冲突时富化 `tmux_session_name_conflict`(`helpers.py:146-154`)。
|
|
25
|
-
#[serde(skip_serializing_if = "Option::is_none")]
|
|
26
|
-
pub reason: Option<String>,
|
|
27
|
-
#[serde(skip_serializing_if = "Option::is_none")]
|
|
28
|
-
pub session_name: Option<String>,
|
|
29
|
-
#[serde(skip_serializing_if = "Option::is_none")]
|
|
30
|
-
pub next_actions: Option<Vec<String>>,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/// CLI 层错误(lib 边界 thiserror,§12)。bin main 经 [`run`] 把它落盘 + 转
|
|
34
|
-
/// [`CliErrorPayload`] + 退出码 1(`main` `except → _emit_cli_error → SystemExit(1)`)。
|
|
35
|
-
#[derive(Debug, Error)]
|
|
36
|
-
pub enum CliError {
|
|
37
|
-
/// 委派的 runtime/lifecycle/state 错误(对应 Python `TeamAgentError`)。message == `str(exc)`。
|
|
38
|
-
#[error("{0}")]
|
|
39
|
-
Runtime(String),
|
|
40
|
-
/// argparse 风格用法错误 / 互斥违反(如 `--summary` + `--json`、`--fix` 缺 `--gate`)。
|
|
41
|
-
/// 对应 Python 抛 `TeamAgentError` 或 parser.error。
|
|
42
|
-
#[error("usage error: {0}")]
|
|
43
|
-
Usage(String),
|
|
44
|
-
/// Preserve the original refusal for audit while carrying safe human guidance.
|
|
45
|
-
#[error("usage error: {audit}")]
|
|
46
|
-
AddressRefusal {
|
|
47
|
-
audit: String,
|
|
48
|
-
error: String,
|
|
49
|
-
action: String,
|
|
50
|
-
},
|
|
51
|
-
/// state 解析失败(歧义/未找到 team 等)。透传 step 5。
|
|
52
|
-
#[error("{0}")]
|
|
53
|
-
State(#[from] crate::state::StateError),
|
|
54
|
-
/// messaging 委派失败(send/stuck)。透传 step 11。
|
|
55
|
-
#[error("{0}")]
|
|
56
|
-
Messaging(crate::messaging::MessagingError),
|
|
57
|
-
/// I/O(cli-error 落盘)。bug-084:写路径降级,不裸 panic。
|
|
58
|
-
#[error("io: {0}")]
|
|
59
|
-
Io(#[from] std::io::Error),
|
|
60
|
-
/// JSON 解析。
|
|
61
|
-
#[error("json: {0}")]
|
|
62
|
-
Json(#[from] serde_json::Error),
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
impl From<crate::messaging::MessagingError> for CliError {
|
|
66
|
-
fn from(error: crate::messaging::MessagingError) -> Self {
|
|
67
|
-
match error {
|
|
68
|
-
crate::messaging::MessagingError::Validation(message)
|
|
69
|
-
if message.starts_with("unknown task id:") =>
|
|
70
|
-
{
|
|
71
|
-
CliError::Runtime(message)
|
|
72
|
-
}
|
|
73
|
-
other => CliError::Messaging(other),
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
impl CliError {
|
|
79
|
-
/// `_cli_error_payload`(`helpers.py:137-155`):落盘日志后构造稳定信封。tmux session
|
|
80
|
-
/// 冲突时按 command 富化 reason/session_name/next_actions(`helpers.py:158-187`)。
|
|
81
|
-
pub(crate) fn to_payload(&self, log_path: &Path, command: &str) -> CliErrorPayload {
|
|
82
|
-
let error = self.to_string();
|
|
83
|
-
let mut payload = CliErrorPayload {
|
|
84
|
-
ok: false,
|
|
85
|
-
error: error.clone(),
|
|
86
|
-
action: if super::spec::command_spec(command).is_some() {
|
|
87
|
-
"Run team-agent doctor --workspace . for the selected team, or inspect the error log shown here."
|
|
88
|
-
} else {
|
|
89
|
-
"run `team-agent doctor` or inspect the log path shown here"
|
|
90
|
-
}
|
|
91
|
-
.to_string(),
|
|
92
|
-
log: log_path.to_string_lossy().to_string(),
|
|
93
|
-
reason: None,
|
|
94
|
-
session_name: None,
|
|
95
|
-
next_actions: None,
|
|
96
|
-
};
|
|
97
|
-
if let Some(session) = tmux_conflict_session(&error) {
|
|
98
|
-
payload.reason = Some("tmux_session_name_conflict".to_string());
|
|
99
|
-
payload.session_name = Some(session.clone());
|
|
100
|
-
if command == "quick-start" {
|
|
101
|
-
payload.action = format!(
|
|
102
|
-
"Terminal session `{session}` already exists and may belong to your existing team. Resume with team-agent restart; use --allow-fresh only after explicitly accepting loss of saved context. To create another team, change the name in TEAM.md before quick-start. Do not shut down an existing team to bypass this refusal."
|
|
103
|
-
);
|
|
104
|
-
payload.next_actions = Some(vec![
|
|
105
|
-
"If this is your existing team, resume it with team-agent restart.".to_string(),
|
|
106
|
-
"To create another team, change the name in TEAM.md before running team-agent quick-start."
|
|
107
|
-
.to_string(),
|
|
108
|
-
]);
|
|
109
|
-
} else {
|
|
110
|
-
payload.action = format!(
|
|
111
|
-
"Terminal session `{session}` already exists and may belong to a running team. Do not shut it down; choose another team name before starting."
|
|
112
|
-
);
|
|
113
|
-
payload.next_actions = Some(vec!["Choose another team name before starting.".to_string()]);
|
|
114
|
-
}
|
|
115
|
-
} else if error.contains("Team Agent launcher flag")
|
|
116
|
-
&& error.contains("must appear before --")
|
|
117
|
-
{
|
|
118
|
-
payload.action =
|
|
119
|
-
String::from("Place Team Agent launcher options before --; only native provider arguments belong after --.");
|
|
120
|
-
} else if error.contains("managed launcher refuses a different ambient tmux server") {
|
|
121
|
-
payload.action = String::from(
|
|
122
|
-
"Leave the current tmux client before retrying. Add --allow-nested-attach before -- only when nested attachment is intentional.",
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
payload
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/// CLI 进程退出码(`main`:`result.ok is False` 或异常 → `SystemExit(1)`,否则 0)。
|
|
130
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
131
|
-
pub enum ExitCode {
|
|
132
|
-
Ok,
|
|
133
|
-
Error,
|
|
134
|
-
Usage,
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
impl ExitCode {
|
|
138
|
-
pub fn code(self) -> i32 {
|
|
139
|
-
match self {
|
|
140
|
-
ExitCode::Ok => 0,
|
|
141
|
-
ExitCode::Error => 1,
|
|
142
|
-
ExitCode::Usage => 2,
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// =============================================================================
|
|
148
|
-
// 命令结果(每个 subcommand handler 返回的 typed 富载体)
|
|
149
|
-
// =============================================================================
|
|
150
|
-
|
|
151
|
-
/// 单条 subcommand 的输出载体(`cmd_*` 的返回 + `emit` 的输入,`helpers.py:12-23`)。
|
|
152
|
-
/// Python `cmd_*` 返回 `dict | str | None`:
|
|
153
|
-
/// - `Json(Value)` ← 委派 runtime 的稳定 `{ok, ...}` dict(`--json` 序列化 sort_keys+indent=2)。
|
|
154
|
-
/// - `Human(String)` ← 人读渲染(`format_status`/`cmd_advanced`/五行 summary/comms boundary text)。
|
|
155
|
-
/// - `None` ← passthrough 命令(`cmd_codex`/`cmd_claude`,直接 SystemExit,无 emit)。
|
|
156
|
-
#[derive(Debug, Clone, PartialEq)]
|
|
157
|
-
pub enum CmdOutput {
|
|
158
|
-
/// 机器可读稳定 dict(`--json` 路径或 `result.get("ok") is False` 路径)。
|
|
159
|
-
Json(Value),
|
|
160
|
-
/// 人读字符串(`emit` 非 dict 分支直接 print)。
|
|
161
|
-
Human(String),
|
|
162
|
-
/// 无输出(passthrough;不经 `emit`)。
|
|
163
|
-
None,
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/// subcommand handler 的统一返回(card:"each returns a typed CmdResult + CliError")。
|
|
167
|
-
/// 携带:输出载体 + 派生退出码 + 命令后是否需吐 leader inbox 摘要。
|
|
168
|
-
/// `main` 据 `output` 走 `emit`,据 `exit` 决定 `SystemExit`(`parser.py:494-508`)。
|
|
169
|
-
#[derive(Debug, Clone, PartialEq)]
|
|
170
|
-
pub struct CmdResult {
|
|
171
|
-
pub output: CmdOutput,
|
|
172
|
-
/// `result.get("ok") is False` → `ExitCode::Error`(`parser.py:507-508`),否则 `Ok`。
|
|
173
|
-
pub exit: ExitCode,
|
|
174
|
-
/// `--json` 旗标(决定 `emit` 与 inbox 摘要落 stderr vs stdout,`parser.py:505-506`)。
|
|
175
|
-
pub as_json: bool,
|
|
176
|
-
/// Preserve nested object insertion order for byte-faithful stored envelopes.
|
|
177
|
-
pub preserve_json_order: bool,
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
impl CmdResult {
|
|
181
|
-
/// 委派 dict 结果 → CmdResult(从 `{ok:..}` 推 exit code)。
|
|
182
|
-
pub fn from_json(value: Value, as_json: bool) -> Self {
|
|
183
|
-
let exit = if value.get("ok").and_then(Value::as_bool) == Some(false) {
|
|
184
|
-
ExitCode::Error
|
|
185
|
-
} else {
|
|
186
|
-
ExitCode::Ok
|
|
187
|
-
};
|
|
188
|
-
Self {
|
|
189
|
-
output: CmdOutput::Json(value),
|
|
190
|
-
exit,
|
|
191
|
-
as_json,
|
|
192
|
-
preserve_json_order: false,
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
pub fn human(text: impl Into<String>) -> Self {
|
|
196
|
-
Self {
|
|
197
|
-
output: CmdOutput::Human(text.into()),
|
|
198
|
-
exit: ExitCode::Ok,
|
|
199
|
-
as_json: false,
|
|
200
|
-
preserve_json_order: false,
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
pub fn none() -> Self {
|
|
204
|
-
Self {
|
|
205
|
-
output: CmdOutput::None,
|
|
206
|
-
exit: ExitCode::Ok,
|
|
207
|
-
as_json: false,
|
|
208
|
-
preserve_json_order: false,
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// =============================================================================
|
|
214
|
-
// `codex`/`claude` passthrough 解析(helpers.py `_provider_args`/`_leader_launcher_args`)
|
|
215
|
-
// =============================================================================
|
|
216
|
-
|
|
217
|
-
/// `_leader_launcher_args`(`helpers.py:196-226`):leader passthrough 的 `--`/`--attach`/
|
|
218
|
-
/// `--attach-existing`/`--confirm`/`--attach-session[=]` 解析结果(`AttachLauncherArgs`)。
|
|
219
|
-
#[derive(Debug, Clone, PartialEq, Eq, Default)]
|
|
220
|
-
pub struct LeaderLauncherArgs {
|
|
221
|
-
/// `--` 之后或非旗标的透传给 provider 的 args。
|
|
222
|
-
pub provider_args: Vec<String>,
|
|
223
|
-
/// `--attach`/`--attach-existing`。
|
|
224
|
-
pub attach_existing: bool,
|
|
225
|
-
/// `--confirm`。
|
|
226
|
-
pub confirm_attach: bool,
|
|
227
|
-
/// `--attach-session <name>` / `--attach-session=<name>`。
|
|
228
|
-
pub attach_session: Option<String>,
|
|
229
|
-
/// 0.3.16 topology opt-out: keep the old external/current-pane leader launcher path.
|
|
230
|
-
pub external_leader: bool,
|
|
231
|
-
/// N41 explicit opt-in for attaching a managed leader from another tmux server.
|
|
232
|
-
pub allow_nested_attach: bool,
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// =============================================================================
|
|
236
|
-
// 五行 triage summary 计数桶(commands.py `_agent_summary_counts` / `_interaction_counts`)
|
|
237
|
-
// =============================================================================
|
|
238
|
-
|
|
239
|
-
/// 五行 triage 的 agent 分类桶(`_agent_summary_counts`,`commands.py:309-330`)。
|
|
240
|
-
/// **bug-071/077/085 铁律(§11)**:`blocked/awaiting_approval/interrupted/missing/stuck/uncertain`
|
|
241
|
-
/// 及任何无匹配态显式落 [`Unknown`](`else: unknown += 1`),**绝不 fallthrough 成 idle**。
|
|
242
|
-
/// 穷尽 match 在编译期防漏 idle 臂。
|
|
243
|
-
///
|
|
244
|
-
/// [`Unknown`]: SummaryBucket::Unknown
|
|
245
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
|
246
|
-
pub enum SummaryBucket {
|
|
247
|
-
Running,
|
|
248
|
-
Busy,
|
|
249
|
-
Idle,
|
|
250
|
-
Stopped,
|
|
251
|
-
Failed,
|
|
252
|
-
Unknown,
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/// 五行 summary 的 agent 计数(`_agent_summary_counts` 返回的 dict 的 typed 版)。
|
|
256
|
-
/// 渲染 line[2] 的 `running=.. busy=.. idle=.. stopped=.. failed=.. unknown=..`(Gap 18a 字节锁)。
|
|
257
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
|
258
|
-
pub struct SummaryCounts {
|
|
259
|
-
pub running: usize,
|
|
260
|
-
pub busy: usize,
|
|
261
|
-
pub idle: usize,
|
|
262
|
-
pub stopped: usize,
|
|
263
|
-
pub failed: usize,
|
|
264
|
-
pub unknown: usize,
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
impl SummaryCounts {
|
|
268
|
-
pub fn total(self) -> usize {
|
|
269
|
-
self.running + self.busy + self.idle + self.stopped + self.failed + self.unknown
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
/// `interacted` marker 计数(`_interaction_counts`,`commands.py:292-306`)。源自 status 富化的
|
|
274
|
-
/// 每-agent `interacted` 字段(非空且 ≠ `"never"` 计 interacted,否则 never)。
|
|
275
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
|
276
|
-
pub struct InteractionCounts {
|
|
277
|
-
pub interacted: usize,
|
|
278
|
-
pub never: usize,
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// =============================================================================
|
|
282
|
-
// clap-style arg structs(每个子命令一个;字段名 == argparse dest)
|
|
283
|
-
// =============================================================================
|
|
284
|
-
|
|
285
|
-
/// `quick-start`(`parser.py:105`)。
|
|
286
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
287
|
-
pub struct QuickStartArgs {
|
|
288
|
-
pub workspace: PathBuf,
|
|
289
|
-
pub agents_dir: PathBuf,
|
|
290
|
-
pub name: Option<String>,
|
|
291
|
-
pub team_id: Option<String>,
|
|
292
|
-
pub yes: bool,
|
|
293
|
-
pub json: bool,
|
|
294
|
-
/// Include internal receiver/topology diagnostics in the response.
|
|
295
|
-
pub detail: bool,
|
|
296
|
-
/// 0.5.x Phase 1d Batch 2: explicit backend override
|
|
297
|
-
/// (`--backend <tmux|conpty>`). `None` = default (factory 5-layer
|
|
298
|
-
/// resolution; almost always `tmux` on a cold quick-start).
|
|
299
|
-
/// Explicit `Some("conpty")` on a host without a live shim client
|
|
300
|
-
/// surfaces `MuxUnavailable` honestly (CR C-1 ①) — NEVER silent
|
|
301
|
-
/// downgrade to tmux. Explicit `Some("pty")` refuses (CR C-1 ②).
|
|
302
|
-
pub backend: Option<String>,
|
|
303
|
-
// Stage QR (quick-start/restart separation, design doc
|
|
304
|
-
// .team/artifacts/quickstart-restart-separation-design.md): the
|
|
305
|
-
// `fresh` field is intentionally REMOVED. Reset semantics now live
|
|
306
|
-
// exclusively on restart (`restart --allow-fresh`) and must be
|
|
307
|
-
// user-confirmed. quick-start is now an initial-creation-only verb.
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
/// `send`(`parser.py:262`)。`target` xor `--to`(fanout);`message` 多 token join 空格。
|
|
311
|
-
#[derive(Debug, Clone, PartialEq)]
|
|
312
|
-
pub struct SendArgs {
|
|
313
|
-
pub target: Option<String>,
|
|
314
|
-
pub message: Vec<String>,
|
|
315
|
-
/// `--to a,b,c`(comma-split fanout)。
|
|
316
|
-
pub targets: Option<String>,
|
|
317
|
-
pub workspace: PathBuf,
|
|
318
|
-
pub team: Option<String>,
|
|
319
|
-
pub task: Option<String>,
|
|
320
|
-
pub sender: TrustedSender,
|
|
321
|
-
pub no_ack: bool,
|
|
322
|
-
pub no_wait: bool,
|
|
323
|
-
pub watch_result: bool,
|
|
324
|
-
pub timeout: f64,
|
|
325
|
-
pub confirm_human: bool,
|
|
326
|
-
pub json: bool,
|
|
327
|
-
/// `--message-id <id>` — caller-supplied idempotency key (CR-015/054).
|
|
328
|
-
/// When set, the store insert uses this id verbatim; a repeat with the same
|
|
329
|
-
/// id returns a `Duplicate` refusal instead of creating a second row.
|
|
330
|
-
pub message_id: Option<String>,
|
|
331
|
-
pub presentation: crate::messaging::presentation::PresentationRequest,
|
|
332
|
-
/// Deprecated compatibility input. Public send refuses pane identity and
|
|
333
|
-
/// requires a logical recipient so persistence always precedes delivery.
|
|
334
|
-
pub pane: Option<String>,
|
|
335
|
-
/// `--to-name <name>` — stable named addressing. Mutually exclusive with
|
|
336
|
-
/// `target` / `targets` / `--pane`; resolves workspace/team/agent or leader
|
|
337
|
-
/// name before delegating to the persisted message primitive.
|
|
338
|
-
pub to_name: Option<String>,
|
|
339
|
-
/// E7 (0.5.9 host-leader-registry-design): `--to-leader NAME` resolves
|
|
340
|
-
/// NAME through `~/.team-agent/leaders`, canonical-validates, and then
|
|
341
|
-
/// delegates to the E6 leader delivery path (live inject or offline
|
|
342
|
-
/// mailbox with `queued_until_leader_attach`).
|
|
343
|
-
pub to_leader: Option<String>,
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
/// `status`(`parser.py:182`)。`--summary`/`--json`/`--detail` 三态(summary xor json,见 `cmd_status`)。
|
|
347
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
348
|
-
pub struct StatusArgs {
|
|
349
|
-
pub agent: Option<String>,
|
|
350
|
-
pub workspace: PathBuf,
|
|
351
|
-
pub detail: bool,
|
|
352
|
-
pub summary: bool,
|
|
353
|
-
pub json: bool,
|
|
354
|
-
/// Stage 4: explicit `--team` scope (read-only command; multi-team
|
|
355
|
-
/// workspaces use this for filtering, not for refusal).
|
|
356
|
-
pub team: Option<String>,
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
/// `approvals`(`parser.py:195`)。
|
|
360
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
361
|
-
pub struct ApprovalsArgs {
|
|
362
|
-
pub agent: Option<String>,
|
|
363
|
-
pub workspace: PathBuf,
|
|
364
|
-
pub json: bool,
|
|
365
|
-
/// Stage 4: explicit `--team` scope.
|
|
366
|
-
pub team: Option<String>,
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
/// `inbox`(`parser.py:217`)。极简消息兜底查看器。
|
|
370
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
371
|
-
pub struct InboxArgs {
|
|
372
|
-
pub agent: String,
|
|
373
|
-
pub workspace: PathBuf,
|
|
374
|
-
pub limit: usize,
|
|
375
|
-
pub json: bool,
|
|
376
|
-
/// Stage 4: explicit `--team` scope.
|
|
377
|
-
pub team: Option<String>,
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
/// `takeover`(`parser.py:242`)。`--confirm` 必需(覆写 recorded team_owner)。
|
|
381
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
382
|
-
pub struct TakeoverArgs {
|
|
383
|
-
pub workspace: PathBuf,
|
|
384
|
-
pub team: Option<String>,
|
|
385
|
-
pub confirm: bool,
|
|
386
|
-
pub json: bool,
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
/// `claim-leader`(`parser.py:249`)。`--confirm` 缺省 = dry-run 摘要。
|
|
390
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
391
|
-
pub struct ClaimLeaderArgs {
|
|
392
|
-
pub workspace: PathBuf,
|
|
393
|
-
pub team: Option<String>,
|
|
394
|
-
pub confirm: bool,
|
|
395
|
-
pub json: bool,
|
|
396
|
-
/// Include internal receiver/topology diagnostics in the response.
|
|
397
|
-
pub detail: bool,
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
/// `attach-leader` public CLI args. `cmd_attach_leader` consumes the typed pane/provider
|
|
401
|
-
/// fields and returns/writes a `leader_receiver` binding through the leader lease port.
|
|
402
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
403
|
-
pub struct AttachLeaderArgs {
|
|
404
|
-
pub workspace: PathBuf,
|
|
405
|
-
pub team: Option<String>,
|
|
406
|
-
pub pane: Option<PaneId>,
|
|
407
|
-
pub provider: Provider,
|
|
408
|
-
pub confirm: bool,
|
|
409
|
-
pub json: bool,
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
/// Explicit Codex app-server leader binding args.
|
|
413
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
414
|
-
pub struct AttachAppServerLeaderArgs {
|
|
415
|
-
pub workspace: PathBuf,
|
|
416
|
-
pub team: Option<String>,
|
|
417
|
-
pub socket: String,
|
|
418
|
-
pub thread_id: String,
|
|
419
|
-
pub json: bool,
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
/// `shutdown`(`parser.py:355`)。`--keep-logs` 默认 true。
|
|
423
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
424
|
-
pub struct ShutdownArgs {
|
|
425
|
-
pub workspace: PathBuf,
|
|
426
|
-
pub team: Option<String>,
|
|
427
|
-
pub keep_logs: bool,
|
|
428
|
-
pub json: bool,
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/// `restart`(`parser.py:362`)。
|
|
432
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
433
|
-
pub struct RestartArgs {
|
|
434
|
-
pub workspace: PathBuf,
|
|
435
|
-
pub team: Option<String>,
|
|
436
|
-
pub allow_fresh: bool,
|
|
437
|
-
pub session_converge_deadline_ms: Option<u64>,
|
|
438
|
-
pub json: bool,
|
|
439
|
-
/// Include internal receiver/topology diagnostics in the response.
|
|
440
|
-
pub detail: bool,
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
/// `start-agent`(`parser.py:369`)。
|
|
444
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
445
|
-
pub struct StartAgentArgs {
|
|
446
|
-
pub role_config: crate::lifecycle::role_config::RoleConfigPatch,
|
|
447
|
-
pub agent: String,
|
|
448
|
-
pub workspace: PathBuf,
|
|
449
|
-
pub team: Option<String>,
|
|
450
|
-
pub force: bool,
|
|
451
|
-
pub allow_fresh: bool,
|
|
452
|
-
pub json: bool,
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
/// `stop-agent`(`parser.py:379`)。
|
|
456
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
457
|
-
pub struct StopAgentArgs {
|
|
458
|
-
pub agent: String,
|
|
459
|
-
pub workspace: PathBuf,
|
|
460
|
-
pub team: Option<String>,
|
|
461
|
-
pub json: bool,
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
/// `reset-agent`(`parser.py:386`)。`--discard-session` 必需。
|
|
465
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
466
|
-
pub struct ResetAgentArgs {
|
|
467
|
-
pub agent: String,
|
|
468
|
-
pub workspace: PathBuf,
|
|
469
|
-
pub team: Option<String>,
|
|
470
|
-
pub discard_session: bool,
|
|
471
|
-
pub json: bool,
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
/// `add-agent`: provider and bypass are explicit CLI or role-file decisions.
|
|
475
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
476
|
-
pub struct AddAgentArgs {
|
|
477
|
-
pub role_config: crate::lifecycle::role_config::RoleConfigPatch,
|
|
478
|
-
pub agent: String,
|
|
479
|
-
pub workspace: PathBuf,
|
|
480
|
-
pub team: Option<String>,
|
|
481
|
-
pub role_file: String,
|
|
482
|
-
pub force: bool,
|
|
483
|
-
pub json: bool,
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
/// `fork-agent`(`parser.py:404`)。`--as` 必需。
|
|
487
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
488
|
-
pub struct ForkAgentArgs {
|
|
489
|
-
pub source_agent: String,
|
|
490
|
-
pub workspace: PathBuf,
|
|
491
|
-
pub team: Option<String>,
|
|
492
|
-
pub as_agent: String,
|
|
493
|
-
pub label: Option<String>,
|
|
494
|
-
pub json: bool,
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
498
|
-
pub struct CloneAgentArgs {
|
|
499
|
-
pub source_agent: String,
|
|
500
|
-
pub workspace: PathBuf,
|
|
501
|
-
pub team: Option<String>,
|
|
502
|
-
pub as_agent: String,
|
|
503
|
-
pub label: Option<String>,
|
|
504
|
-
pub json: bool,
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
/// `remove-agent`(`parser.py:414`)。`--from-spec` 须配 `--confirm`。
|
|
508
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
509
|
-
pub struct RemoveAgentArgs {
|
|
510
|
-
pub agent: String,
|
|
511
|
-
pub workspace: PathBuf,
|
|
512
|
-
pub team: Option<String>,
|
|
513
|
-
pub from_spec: bool,
|
|
514
|
-
pub confirm: bool,
|
|
515
|
-
pub force: bool,
|
|
516
|
-
pub json: bool,
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
/// `doctor`(`parser.py:318`)。`--gate` ∈ {orphans, comms};`--fix` 须配 `--gate`(`cmd_doctor` 校验)。
|
|
520
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
521
|
-
pub struct DoctorArgs {
|
|
522
|
-
pub spec: Option<PathBuf>,
|
|
523
|
-
pub workspace: PathBuf,
|
|
524
|
-
/// `None` / `Some(Orphans)` / `Some(Comms)`。
|
|
525
|
-
pub gate: Option<DoctorGate>,
|
|
526
|
-
pub comms: bool,
|
|
527
|
-
pub team: Option<String>,
|
|
528
|
-
pub fix: bool,
|
|
529
|
-
pub fix_schema: bool,
|
|
530
|
-
pub cleanup_orphans: bool,
|
|
531
|
-
pub confirm: bool,
|
|
532
|
-
pub json: bool,
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
/// `doctor --gate` 选择(`commands.py:218-236`;clap choices)。
|
|
536
|
-
/// swallow batch 3: an unrecognized gate is carried verbatim so the doctor exit can
|
|
537
|
-
/// refuse with `unknown_gate` (Python commands.py:234-235 raises) instead of silently
|
|
538
|
-
/// falling through to the default doctor (empty green).
|
|
539
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
540
|
-
pub enum DoctorGate {
|
|
541
|
-
Orphans,
|
|
542
|
-
Comms,
|
|
543
|
-
Unknown(String),
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
/// E7 (0.5.9 host-leader-registry-design §4.1): `team-agent leaders`
|
|
547
|
-
/// enumerates the host discovery index and classifies each entry as
|
|
548
|
-
/// LIVE, STALE, or AMBIGUOUS after re-validating against canonical
|
|
549
|
-
/// workspace state.
|
|
550
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
551
|
-
pub enum LeadersView {
|
|
552
|
-
Live,
|
|
553
|
-
All,
|
|
554
|
-
Stale,
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
558
|
-
pub struct LeadersArgs {
|
|
559
|
-
pub view: LeadersView,
|
|
560
|
-
pub query: Option<String>,
|
|
561
|
-
pub prune: bool,
|
|
562
|
-
pub dry_run: bool,
|
|
563
|
-
pub json: bool,
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
/// Read-only provider model catalog discovery.
|
|
567
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
568
|
-
pub struct ModelsArgs {
|
|
569
|
-
pub provider: String,
|
|
570
|
-
pub search: Option<String>,
|
|
571
|
-
pub json: bool,
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
/// `profile {init,doctor,show}`(`parser.py:131`)。
|
|
575
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
576
|
-
pub struct ProfileArgs {
|
|
577
|
-
pub command: String,
|
|
578
|
-
pub name: String,
|
|
579
|
-
pub workspace: PathBuf,
|
|
580
|
-
pub team: Option<String>,
|
|
581
|
-
pub auth_mode: Option<String>,
|
|
582
|
-
pub proxy_mode: Option<String>,
|
|
583
|
-
pub json: bool,
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
587
|
-
pub struct WaitArgs {
|
|
588
|
-
pub task_id: String,
|
|
589
|
-
pub workspace: PathBuf,
|
|
590
|
-
pub json: bool,
|
|
591
|
-
}
|