@team-agent/installer 0.5.112 → 0.5.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/Cargo.lock +252 -84
  2. package/Cargo.toml +3 -1
  3. package/crates/team-agent/Cargo.toml +3 -0
  4. package/crates/team-agent/src/cli/adapters.rs +119 -50
  5. package/crates/team-agent/src/cli/diagnose.rs +36 -13
  6. package/crates/team-agent/src/cli/emit.rs +173 -109
  7. package/crates/team-agent/src/cli/leader.rs +16 -0
  8. package/crates/team-agent/src/cli/leader_prompt.rs +261 -0
  9. package/crates/team-agent/src/cli/leaders.rs +32 -32
  10. package/crates/team-agent/src/cli/mod.rs +158 -14
  11. package/crates/team-agent/src/cli/models.rs +68 -18
  12. package/crates/team-agent/src/cli/named_address.rs +17 -16
  13. package/crates/team-agent/src/cli/route.rs +4 -4
  14. package/crates/team-agent/src/cli/send/presentation.rs +19 -18
  15. package/crates/team-agent/src/cli/send/resolve.rs +11 -11
  16. package/crates/team-agent/src/cli/send.rs +4 -4
  17. package/crates/team-agent/src/cli/spec.rs +35 -29
  18. package/crates/team-agent/src/cli/status.rs +7 -7
  19. package/crates/team-agent/src/cli/status_port/brief.rs +268 -101
  20. package/crates/team-agent/src/cli/tests/base.rs +94 -6
  21. package/crates/team-agent/src/cli/tests/divergence.rs +3 -2
  22. package/crates/team-agent/src/cli/tests/lane_c.rs +1 -1
  23. package/crates/team-agent/src/cli/tests/named_address.rs +3 -3
  24. package/crates/team-agent/src/cli/tests/status_send.rs +9 -7
  25. package/crates/team-agent/src/cli/triage.rs +53 -2
  26. package/crates/team-agent/src/cli/types.rs +8 -8
  27. package/crates/team-agent/src/compiler/tests.rs +12 -0
  28. package/crates/team-agent/src/compiler.rs +65 -26
  29. package/crates/team-agent/src/contract_runtime/backend.rs +646 -0
  30. package/crates/team-agent/src/contract_runtime/config.rs +309 -0
  31. package/crates/team-agent/src/contract_runtime/discovery.rs +237 -0
  32. package/crates/team-agent/src/contract_runtime/forward.rs +229 -0
  33. package/crates/team-agent/src/contract_runtime/framework.rs +261 -0
  34. package/crates/team-agent/src/contract_runtime/mcp.rs +396 -0
  35. package/crates/team-agent/src/contract_runtime/mod.rs +14 -0
  36. package/crates/team-agent/src/contract_runtime/prompt.rs +216 -0
  37. package/crates/team-agent/src/contract_runtime/pump.rs +207 -0
  38. package/crates/team-agent/src/contract_runtime/registry.rs +30 -0
  39. package/crates/team-agent/src/coordinator/tick.rs +26 -8
  40. package/crates/team-agent/src/leader/mod.rs +1 -0
  41. package/crates/team-agent/src/leader/prompt.rs +906 -0
  42. package/crates/team-agent/src/leader/start.rs +265 -16
  43. package/crates/team-agent/src/leader/tests/identity.rs +21 -0
  44. package/crates/team-agent/src/leader/tests/mod.rs +2 -0
  45. package/crates/team-agent/src/leader/tests/prompt_contract.rs +268 -0
  46. package/crates/team-agent/src/leader/types.rs +6 -0
  47. package/crates/team-agent/src/lib.rs +4 -0
  48. package/crates/team-agent/src/lifecycle/launch/identity.rs +172 -13
  49. package/crates/team-agent/src/lifecycle/launch/quick_start.rs +760 -365
  50. package/crates/team-agent/src/lifecycle/launch/spawn.rs +38 -9
  51. package/crates/team-agent/src/lifecycle/launch/state_projection.rs +17 -0
  52. package/crates/team-agent/src/lifecycle/launch.rs +39 -28
  53. package/crates/team-agent/src/lifecycle/profile_launch.rs +58 -46
  54. package/crates/team-agent/src/lifecycle/restart/rebuild.rs +97 -52
  55. package/crates/team-agent/src/lifecycle/restart.rs +1 -1
  56. package/crates/team-agent/src/lifecycle/tests/stale_team_saveconflict_contract.rs +3 -2
  57. package/crates/team-agent/src/lifecycle/types.rs +4 -1
  58. package/crates/team-agent/src/lifecycle/worker_command_context.rs +37 -27
  59. package/crates/team-agent/src/main.rs +6 -0
  60. package/crates/team-agent/src/messaging/delivery.rs +50 -1
  61. package/crates/team-agent/src/messaging/send.rs +10 -0
  62. package/crates/team-agent/src/messaging/tests/leader_inject_acceptance.rs +131 -0
  63. package/crates/team-agent/src/model/spec.rs +24 -12
  64. package/crates/team-agent/src/provider/adapter.rs +8 -59
  65. package/crates/team-agent/src/provider/adapters/claude.rs +6 -14
  66. package/crates/team-agent/src/provider/adapters/codex.rs +8 -18
  67. package/crates/team-agent/src/provider/adapters/copilot.rs +5 -22
  68. package/crates/team-agent/src/provider/adapters/cursor_agent.rs +8 -45
  69. package/crates/team-agent/src/provider/adapters/grok.rs +7 -31
  70. package/crates/team-agent/src/provider/adapters/pi.rs +7 -18
  71. package/crates/team-agent/src/provider/command_helpers.rs +45 -0
  72. package/crates/team-agent/src/provider/mod.rs +1 -0
  73. package/crates/team-agent/src/provider/model_catalog.rs +21 -28
  74. package/crates/team-agent/src/provider/tests/adapter.rs +70 -0
  75. package/crates/team-agent/src/provider/tests/command_helpers.rs +55 -0
  76. package/crates/team-agent/src/state/persist.rs +73 -0
  77. package/package.json +4 -4
@@ -20,7 +20,7 @@ pub(super) fn watch_notice_json(target: &MessageTarget, opts: &SendOptions) -> V
20
20
  "watcher_id": format!("watch-{agent_id}"),
21
21
  "task_id": opts.task_id.as_ref().map(|t| t.as_str().to_string()),
22
22
  "agent_id": agent_id,
23
- "notice": "队友回复后会通知主控;用 team-agent inbox leader -n 3 查看。"
23
+ "notice": "The leader is notified when the agent replies; use team-agent inbox leader -n 3."
24
24
  })
25
25
  }
26
26
 
@@ -188,50 +188,51 @@ pub(super) fn send_human_output(value: &Value) -> String {
188
188
  let reason = value.get("reason").and_then(Value::as_str).unwrap_or("");
189
189
  let explanation =
190
190
  crate::cli::named_address::human_address_reason(reason).unwrap_or(match reason {
191
- "target_not_in_team" | "unknown_recipient" => "当前队伍没有这个队友。",
191
+ "target_not_in_team" | "unknown_recipient" => "The selected team has no such agent.",
192
192
  "missing_permissions" | "human_confirmation_required" => {
193
- "发送被拒绝:需要先确认交流权限。"
193
+ "Send refused: communication permission or human confirmation is required."
194
194
  }
195
195
  "recipient_busy" | "recipient_pane_in_non_input_mode" => {
196
- "队友当前不能接收任务;请先查看其状态。"
196
+ "The agent cannot receive a task now; check its status."
197
197
  }
198
198
  "routing_ambiguous" | "empty_target_list" | "ambiguous" => {
199
- "没有明确选定收信队友;请填写队友名和任务内容。"
199
+ "No recipient was selected unambiguously; provide an agent name and task message."
200
200
  }
201
201
  "team_owner_mismatch" | "PaneWorkspaceMismatch" | "session_drift" => {
202
- "队伍或终端归属不匹配;已停止发送。"
202
+ "Team or pane ownership mismatch; sending was refused."
203
203
  }
204
204
  "coordinator_unavailable" | "tmux_target_missing" => {
205
- "队伍连接暂不可用;本次没有确认送达。"
205
+ "The team channel is unavailable; delivery was not confirmed."
206
206
  }
207
207
  "message_already_claimed" | "duplicate" => {
208
- "这条消息已由其他发送处理接收;不要重复发送。"
208
+ "This message is already claimed or duplicated; do not resend."
209
209
  }
210
- "no_caller_pane" => "当前终端没有可用的队伍连接;请在主控的命令行/工具上下文发送。",
210
+ "no_caller_pane" => "The current terminal has no usable team channel; send from the leader's tool context.",
211
211
  _ => value
212
212
  .get("error")
213
213
  .and_then(Value::as_str)
214
- .unwrap_or("发送未成功;没有确认任务已送达。"),
214
+ .unwrap_or("Send was unsuccessful; task delivery was not confirmed."),
215
215
  });
216
- let mut out = format!("{explanation}\n下一步:先运行 team-agent status,使用列表中的队友名;连接问题用 team-agent doctor --workspace .。不要反复重发。");
216
+ let details = crate::cli::triage::diagnostic_details(value);
217
+ let mut out = format!("{explanation}\nReport: {details}\nAdditional diagnosis: use team-agent status for agent names or team-agent doctor --workspace . for channel problems. Do not resend repeatedly.");
217
218
  if let Some(suggested) = value
218
219
  .get("suggested_name")
219
220
  .and_then(Value::as_str)
220
221
  .filter(|name| !name.is_empty() && !name.contains(['/', ':', ',', '\n', '\r']))
221
222
  {
222
223
  out.push_str(&format!(
223
- "\n你是否想发给 {suggested}?确认后使用这个队友名。"
224
+ "\nDid you mean {suggested}? Confirm before using that agent name."
224
225
  ));
225
226
  }
226
227
  return out;
227
228
  }
228
229
  if value.get("status").and_then(Value::as_str) == Some("stored_only") {
229
- return format!("已给{agent}留下消息;本次没有发送到当前对话。\n下一步:用 team-agent inbox leader -n 3 查看回复;留言不保证自动执行。");
230
+ return format!("Message stored for {agent}; it was not injected into the current conversation.\nNext: use team-agent inbox leader -n 3 for replies. Mailbox storage does not guarantee execution.");
230
231
  }
231
232
  if value.get("delivered").and_then(Value::as_bool) == Some(true) {
232
- format!("已发给{agent}。{}", crate::cli::SEND_REMINDER)
233
+ format!("Delivered to {agent}. {}", crate::cli::SEND_REMINDER)
233
234
  } else {
234
- "任务已收下,但还未送到队友的对话。\n下一步:查看 team-agent status 或 team-agent doctor --workspace .,等真实回复,不反复重发。".to_string()
235
+ "Task accepted, but delivery to the agent's conversation is still pending.\nNext: check team-agent status or team-agent doctor --workspace .; wait for an actual reply without repeated sends.".to_string()
235
236
  }
236
237
  }
237
238
 
@@ -251,7 +252,7 @@ pub(super) fn send_human_target(value: &Value) -> String {
251
252
  !name.is_empty() && *name != "*" && !name.contains(['/', ':', ',', '\n', '\r'])
252
253
  })
253
254
  .map(str::to_string)
254
- .unwrap_or_else(|| "该队友".to_string())
255
+ .unwrap_or_else(|| "the recipient".to_string())
255
256
  }
256
257
 
257
258
  pub(super) fn send_human_status(value: &Value) -> String {
@@ -286,11 +287,11 @@ pub(super) fn send_reminder_for_value(value: &Value) -> &'static str {
286
287
  let status = value.get("status").and_then(Value::as_str);
287
288
  let delivery_status = value.get("delivery_status").and_then(Value::as_str);
288
289
  if status == Some("stored_only") {
289
- "本次只留言,没有发送到当前对话;留言不保证自动执行。"
290
+ "Mailbox-only: not injected into the current conversation; storage does not guarantee execution."
290
291
  } else if delivered == Some(true) && delivery_status != Some("pending") {
291
292
  crate::cli::SEND_REMINDER
292
293
  } else {
293
- "任务已收下,但还未确认送到队友对话。查看 team-agent status/doctor,等真实回复,不反复重发。"
294
+ "Task accepted, but delivery is unconfirmed. Check team-agent status/doctor; wait for an actual reply without repeated sends."
294
295
  }
295
296
  }
296
297
 
@@ -7,11 +7,11 @@ use serde_json::{json, Value};
7
7
 
8
8
  pub(super) fn warn_send_alias(flag: &str) {
9
9
  let spec = crate::cli::spec::command_spec("send");
10
- let sunset = spec.and_then(|spec| spec.sunset).unwrap_or("后续兼容版本");
10
+ let sunset = spec.and_then(|spec| spec.sunset).unwrap_or("a future compatibility release");
11
11
  let action = spec.and_then(|spec| spec.action).unwrap_or(
12
- "使用 team-agent send <agent> '任务内容',通过 --workspace/--team 选择项目和队伍",
12
+ "Use team-agent send <agent> 'task message'; select the workspace and team with --workspace/--team",
13
13
  );
14
- eprintln!("提示:{flag} 已弃用,将在{sunset}移除。下一步:{action}");
14
+ eprintln!("Warning: {flag} is deprecated and will be removed in {sunset}. Next: {action}");
15
15
  }
16
16
 
17
17
  pub(super) fn logical_to_from_args(
@@ -22,7 +22,7 @@ pub(super) fn logical_to_from_args(
22
22
  && (args.target.is_some() || args.targets.is_some() || args.to_leader.is_some())
23
23
  {
24
24
  return Err(CliError::Usage(
25
- "队友名与 --to-name/--pane/--to 不能同时使用;请只选一种收信方式".to_string(),
25
+ "An agent name cannot be combined with --to-name/--pane/--to; choose one addressing mode".to_string(),
26
26
  ));
27
27
  }
28
28
  let supplied = [
@@ -36,7 +36,7 @@ pub(super) fn logical_to_from_args(
36
36
  .count();
37
37
  if supplied > 1 {
38
38
  return Err(CliError::Usage(
39
- "队友名、--targets、--to-name 和 --to-leader 不能同时使用;请只选一种收信方式"
39
+ "An agent name, --targets, --to-name and --to-leader are mutually exclusive; choose one addressing mode"
40
40
  .to_string(),
41
41
  ));
42
42
  }
@@ -52,11 +52,11 @@ pub(super) fn logical_to_from_args(
52
52
  if args.target.is_none() && supplied > 0 && args.message.is_empty() {
53
53
  if args.to_name.is_some() {
54
54
  return Err(CliError::Usage(
55
- "请填写任务内容;--to-name 不能发送空消息".to_string(),
55
+ "Provide a task message; --to-name cannot send an empty message".to_string(),
56
56
  ));
57
57
  }
58
58
  return Err(CliError::Usage(
59
- "请在队友名后填写非空任务内容;例如 team-agent send worker '检查改动'".to_string(),
59
+ "Provide a nonempty task message after the agent name, such as team-agent send worker 'Review the changes'".to_string(),
60
60
  ));
61
61
  }
62
62
  Ok(logical_to)
@@ -182,7 +182,7 @@ pub(super) fn send_to_logical_to(
182
182
  .collect::<Vec<_>>();
183
183
  if names.is_empty() || names.len() != logical_to.split(',').count() {
184
184
  return Err(CliError::Usage(
185
- "收信列表中有空的队友名;请使用 status 返回的名称".to_string(),
185
+ "The recipient list contains an empty agent name; use names returned by status".to_string(),
186
186
  ));
187
187
  }
188
188
 
@@ -322,7 +322,7 @@ pub(super) fn adapt_positional_bare_error(
322
322
  .and_then(|suggested| suggested.rsplit('/').next())
323
323
  .map(str::to_string);
324
324
  if let Some(suggested) = error.suggested_name.as_deref() {
325
- error.action = format!("你是否想发给 {suggested}?确认后使用此队友名;通过 --workspace/--team 选择项目和队伍。");
325
+ error.action = format!("Did you mean {suggested}? Confirm the agent name; select the workspace and team with --workspace/--team.");
326
326
  }
327
327
  }
328
328
 
@@ -336,7 +336,7 @@ pub(super) fn logical_recipient_id(
336
336
  .ok_or_else(|| CliError::Runtime("resolved worker is missing agent id".to_string())),
337
337
  crate::cli::named_address::NamedTargetKind::Leader => Ok("leader".to_string()),
338
338
  crate::cli::named_address::NamedTargetKind::SessionWindow => Err(CliError::Usage(
339
- "不再支持按终端窗口发送;请使用队友名或 leader,并通过 --workspace/--team 选择队伍"
339
+ "Terminal-window addressing is no longer supported; use an agent name or leader, with --workspace/--team to select scope"
340
340
  .to_string(),
341
341
  )),
342
342
  }
@@ -350,7 +350,7 @@ pub(super) fn send_to_resolved_name(
350
350
  let recipient = logical_recipient_id(resolved)?;
351
351
  if resolved.warning.is_some() {
352
352
  eprintln!(
353
- "提示:旧收信方式已弃用;请用队友名发送,通过 --workspace/--team 选择项目和队伍。"
353
+ "Warning: legacy addressing is deprecated; send by agent name and select scope with --workspace/--team."
354
354
  );
355
355
  }
356
356
  let target = MessageTarget::Single(recipient);
@@ -41,20 +41,20 @@ pub fn cmd_send(args: &SendArgs) -> Result<CmdResult, CliError> {
41
41
  || args.to_leader.is_some()
42
42
  {
43
43
  let message = if args.to_name.is_some() {
44
- "队友名与 --to-name/--pane/--to 不能同时使用;请只选一种收信方式"
44
+ "An agent name cannot be combined with --to-name/--pane/--to; choose one addressing mode"
45
45
  } else {
46
- "--pane 不能与队友名、--to 或 --to-leader 同时使用"
46
+ "--pane cannot be combined with an agent name, --to or --to-leader"
47
47
  };
48
48
  return Err(CliError::Usage(message.to_string()));
49
49
  }
50
50
  let content = args.message.join(" ");
51
51
  if content.is_empty() {
52
52
  return Err(CliError::Usage(
53
- "请填写任务内容;--pane 不能发送空消息".to_string(),
53
+ "Provide a task message; --pane cannot send an empty message".to_string(),
54
54
  ));
55
55
  }
56
56
  return Err(CliError::Usage(format!(
57
- "--pane {pane_id} 已不再支持;请用 team-agent send <agent> '任务内容',通过 --workspace/--team 选择项目和队伍"
57
+ "--pane {pane_id} is no longer supported; use team-agent send <agent> 'task message' with --workspace/--team to select scope"
58
58
  )));
59
59
  }
60
60
  if args.targets.is_some() {
@@ -36,6 +36,7 @@ pub(crate) enum DispatchKind {
36
36
  Send,
37
37
  Status,
38
38
  Models,
39
+ KiroLeader,
39
40
  Inbox,
40
41
  Restart,
41
42
  Shutdown,
@@ -50,6 +51,7 @@ pub(crate) enum DispatchKind {
50
51
  Doctor,
51
52
  Approvals,
52
53
  Route,
54
+ LeaderPrompt,
53
55
  Profile,
54
56
  InstallSkill,
55
57
  ClaimLeader,
@@ -61,6 +63,7 @@ pub(crate) const ALL_DISPATCH_KINDS: &[DispatchKind] = &[
61
63
  DispatchKind::Send,
62
64
  DispatchKind::Status,
63
65
  DispatchKind::Models,
66
+ DispatchKind::KiroLeader,
64
67
  DispatchKind::Inbox,
65
68
  DispatchKind::Restart,
66
69
  DispatchKind::Shutdown,
@@ -75,6 +78,7 @@ pub(crate) const ALL_DISPATCH_KINDS: &[DispatchKind] = &[
75
78
  DispatchKind::Doctor,
76
79
  DispatchKind::Approvals,
77
80
  DispatchKind::Route,
81
+ DispatchKind::LeaderPrompt,
78
82
  DispatchKind::Profile,
79
83
  DispatchKind::InstallSkill,
80
84
  DispatchKind::ClaimLeader,
@@ -106,35 +110,37 @@ pub(crate) struct CommandSpec {
106
110
  // Only human operations belong here. Compatibility commands are private in emit.rs.
107
111
  #[rustfmt::skip]
108
112
  pub(crate) const COMMAND_SPECS: &[CommandSpec] = &[
109
- CommandSpec { name: "quick-start", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::QuickStart), summary: "从角色文件启动队伍,或查看已有队伍的连接方式", usage: "team-agent quick-start [TEAMDIR] [--workspace WORKSPACE] [--team TEAM] [--name NAME] [--team-id TEAM] [--yes] [--backend tmux|conpty] [--json] [--detail]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
110
- CommandSpec { name: "send", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Send), summary: "向指定队友派发任务", usage: "team-agent send <agent> MESSAGE... [--workspace WORKSPACE] [--team TEAM] [--mailbox] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: Some("后续兼容版本"), action: Some("使用 team-agent send <agent> '任务内容',用 --workspace 和 --team 选择队伍"), governance: None },
111
- CommandSpec { name: "status", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Status), summary: "查看队友状态,不读取队友的对话内容", usage: "team-agent status [<agent>] [--workspace WORKSPACE] [--team TEAM] [--json] [--summary|--detail]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
112
- CommandSpec { name: "models", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Models), summary: "查找工具实际支持的模型名称", usage: "team-agent models [--provider pi|cursor_agent|codex|claude|claude_code|grok] [QUERY|--search TEXT] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
113
- CommandSpec { name: "inbox", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Inbox), summary: "查看队友回复", usage: "team-agent inbox <agent> [-n N|--limit N] [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
114
- CommandSpec { name: "restart", tier: CommandTier::Core, category: CommandCategory::TeamLifecycle, kind: CommandKind::Dispatch(DispatchKind::Restart), summary: "恢复已有队伍,优先沿用已保存的会话", usage: "team-agent restart [WORKSPACE] [--team TEAM] [--allow-fresh] [--session-converge-deadline SECONDS] [--json] [--detail]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
115
- CommandSpec { name: "shutdown", tier: CommandTier::Core, category: CommandCategory::TeamLifecycle, kind: CommandKind::Dispatch(DispatchKind::Shutdown), summary: "关闭指定队伍,并查看是否仍有残留资源", usage: "team-agent shutdown [--workspace WORKSPACE] [--team TEAM] [--keep-logs] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
116
- CommandSpec { name: "add-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::AddAgent), summary: "新增并启动一位队友", usage: "team-agent add-agent <agent> [--role-file FILE] [--provider TOOL] [--model MODEL] [--effort LEVEL] [--bypass true|false] [--prompt TEXT] [--profile NAME] [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
117
- CommandSpec { name: "start-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::StartAgent), summary: "启动队伍中已有的队友", usage: "team-agent start-agent <agent> [--provider TOOL] [--model MODEL] [--effort LEVEL] [--bypass true|false] [--prompt TEXT] [--profile NAME] [--workspace WORKSPACE] [--team TEAM] [--allow-fresh] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
118
- CommandSpec { name: "stop-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::StopAgent), summary: "暂停一位队友,保留其配置和会话记录", usage: "team-agent stop-agent <agent> [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
119
- CommandSpec { name: "reset-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::ResetAgent), summary: "清除队友保存的会话关联", usage: "team-agent reset-agent <agent> --discard-session [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
120
- CommandSpec { name: "clone-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::CloneAgent), summary: "复制队友配置,创建新队友", usage: "team-agent clone-agent <agent> --as NEW_AGENT [--label LABEL] [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
121
- CommandSpec { name: "fork-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::ForkAgent), summary: "在工具支持的条件下从队友会话分出新队友", usage: "team-agent fork-agent <agent> --as NEW_AGENT [--label LABEL] [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
122
- CommandSpec { name: "remove-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::RemoveAgent), summary: "确认后移除一位队友", usage: "team-agent remove-agent <agent> --confirm [--workspace WORKSPACE] [--team TEAM] [--from-spec] [--force] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
123
- CommandSpec { name: "leaders", tier: CommandTier::Core, category: CommandCategory::Observe, kind: CommandKind::Dispatch(DispatchKind::Leaders), summary: "查看本机可用的主控及其所属队伍", usage: "team-agent leaders [QUERY|--search TEXT] [--all|--stale] [--json] | --prune [--dry-run] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
124
- CommandSpec { name: "doctor", tier: CommandTier::Core, category: CommandCategory::Observe, kind: CommandKind::Dispatch(DispatchKind::Doctor), summary: "检查队伍并给出恢复建议,默认不修复", usage: "team-agent doctor [SPEC] [--workspace WORKSPACE] [--team TEAM] [--comms] [--gate orphans|comms] [--fix] [--fix-schema] [--cleanup-orphans] [--confirm] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
125
- CommandSpec { name: "approvals", tier: CommandTier::Core, category: CommandCategory::Observe, kind: CommandKind::Dispatch(DispatchKind::Approvals), summary: "查看队友正在等待的权限确认", usage: "team-agent approvals [<agent>] [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
126
- CommandSpec { name: "route", tier: CommandTier::Core, category: CommandCategory::Setup, kind: CommandKind::Dispatch(DispatchKind::Route), summary: "设置工具启动时额外使用的命令行参数", usage: "team-agent route [status|enable|disable|show [TOOL]|set TOOL -- ARG...|add TOOL -- ARG...|clear TOOL] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
127
- CommandSpec { name: "profile", tier: CommandTier::Core, category: CommandCategory::Setup, kind: CommandKind::Dispatch(DispatchKind::Profile), summary: "管理登录方式和代理设置", usage: "team-agent profile init|doctor|show NAME [--workspace WORKSPACE] [--team TEAM] [--auth-mode MODE] [--proxy-mode direct|inherit] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
128
- CommandSpec { name: "install-skill", tier: CommandTier::Core, category: CommandCategory::Setup, kind: CommandKind::Dispatch(DispatchKind::InstallSkill), summary: "可选:安装已有的公开操作指南", usage: "team-agent install-skill (--source DIR|--uninstall) [--target codex|claude|copilot|all] [--dest DIR] [--dry-run] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
129
- CommandSpec { name: "claim-leader", tier: CommandTier::Guided, category: CommandCategory::GuidedRecovery, kind: CommandKind::Dispatch(DispatchKind::ClaimLeader), summary: "仅按体检提示,将当前终端登记为主控", usage: "team-agent claim-leader [--workspace WORKSPACE] [--team TEAM] [--confirm] [--json] [--detail]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
130
- CommandSpec { name: "takeover", tier: CommandTier::Guided, category: CommandCategory::GuidedRecovery, kind: CommandKind::Dispatch(DispatchKind::Takeover), summary: "仅按体检提示,确认后接管现有队伍", usage: "team-agent takeover [--workspace WORKSPACE] [--team TEAM] [--confirm] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
131
- CommandSpec { name: "attach-leader", tier: CommandTier::Guided, category: CommandCategory::GuidedRecovery, kind: CommandKind::Dispatch(DispatchKind::AttachLeader), summary: "仅按体检提示,将已核验的终端连接为主控", usage: "team-agent attach-leader [--workspace WORKSPACE] [--team TEAM] --pane PANE --provider TOOL [--confirm] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
132
- CommandSpec { name: "pi", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::LeaderPassthrough { provider: "pi" }, summary: "用 Pi 打开主控对话", usage: "team-agent pi [--attach-existing] [--confirm] [--attach-session SESSION] [--external-leader] [--allow-nested-attach] [--json] [-- TOOL_ARGS...]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
133
- CommandSpec { name: "codex", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::LeaderPassthrough { provider: "codex" }, summary: "用 Codex 打开主控对话", usage: "team-agent codex [--attach-existing] [--confirm] [--attach-session SESSION] [--external-leader] [--allow-nested-attach] [--json] [-- TOOL_ARGS...]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
134
- CommandSpec { name: "claude", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::LeaderPassthrough { provider: "claude" }, summary: "用 Claude Code 打开主控对话", usage: "team-agent claude [--attach-existing] [--confirm] [--attach-session SESSION] [--external-leader] [--allow-nested-attach] [--json] [-- TOOL_ARGS...]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
135
- CommandSpec { name: "copilot", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::LeaderPassthrough { provider: "copilot" }, summary: "用 Copilot 打开主控对话", usage: "team-agent copilot [--attach-existing] [--confirm] [--attach-session SESSION] [--external-leader] [--allow-nested-attach] [--json] [-- TOOL_ARGS...]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
136
- CommandSpec { name: "grok", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::LeaderPassthrough { provider: "grok" }, summary: "用 Grok 打开主控对话", usage: "team-agent grok [--attach-existing] [--confirm] [--attach-session SESSION] [--external-leader] [--allow-nested-attach] [--json] [-- TOOL_ARGS...]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
137
- CommandSpec { name: "cursor", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::LeaderPassthrough { provider: "cursor_agent" }, summary: "用 Cursor 的 agent 工具打开主控对话", usage: "team-agent cursor [--attach-existing] [--confirm] [--attach-session SESSION] [--external-leader] [--allow-nested-attach] [--json] [-- TOOL_ARGS...]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
113
+ CommandSpec { name: "quick-start", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::QuickStart), summary: "Create a team from role files; use restart for an initialized team", usage: "team-agent quick-start [TEAMDIR] [--workspace WORKSPACE] [--team TEAM] [--name NAME] [--team-id TEAM] [--yes] [--backend tmux|conpty] [--json] [--detail]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
114
+ CommandSpec { name: "send", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Send), summary: "Send a task to a specified agent", usage: "team-agent send <agent> MESSAGE... [--workspace WORKSPACE] [--team TEAM] [--mailbox] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: Some("a future compatibility release"), action: Some("Use team-agent send <agent> 'task message'; select scope with --workspace and --team"), governance: None },
115
+ CommandSpec { name: "status", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Status), summary: "Check agent status without reading conversation content", usage: "team-agent status [<agent>] [--workspace WORKSPACE] [--team TEAM] [--json] [--summary|--detail]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
116
+ CommandSpec { name: "models", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Models), summary: "Discover model names supported by the native provider", usage: "team-agent models [--provider pi|cursor_agent|codex|claude|claude_code|grok|kiro] [QUERY|--search TEXT] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
117
+ CommandSpec { name: "inbox", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Inbox), summary: "Read agent replies", usage: "team-agent inbox <agent> [-n N|--limit N] [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
118
+ CommandSpec { name: "restart", tier: CommandTier::Core, category: CommandCategory::TeamLifecycle, kind: CommandKind::Dispatch(DispatchKind::Restart), summary: "Restart an existing team using saved sessions when available", usage: "team-agent restart [WORKSPACE] [--team TEAM] [--allow-fresh] [--session-converge-deadline SECONDS] [--json] [--detail]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
119
+ CommandSpec { name: "shutdown", tier: CommandTier::Core, category: CommandCategory::TeamLifecycle, kind: CommandKind::Dispatch(DispatchKind::Shutdown), summary: "Shut down the selected team and report residual resources", usage: "team-agent shutdown [--workspace WORKSPACE] [--team TEAM] [--keep-logs] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
120
+ CommandSpec { name: "add-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::AddAgent), summary: "Add and start an agent", usage: "team-agent add-agent <agent> [--role-file FILE] [--provider TOOL] [--model MODEL] [--effort LEVEL] [--bypass true|false] [--prompt TEXT] [--profile NAME] [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
121
+ CommandSpec { name: "start-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::StartAgent), summary: "Start an existing team agent", usage: "team-agent start-agent <agent> [--provider TOOL] [--model MODEL] [--effort LEVEL] [--bypass true|false] [--prompt TEXT] [--profile NAME] [--workspace WORKSPACE] [--team TEAM] [--allow-fresh] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
122
+ CommandSpec { name: "stop-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::StopAgent), summary: "Stop an agent while retaining configuration and session history", usage: "team-agent stop-agent <agent> [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
123
+ CommandSpec { name: "reset-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::ResetAgent), summary: "Discard an agent's saved session association", usage: "team-agent reset-agent <agent> --discard-session [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
124
+ CommandSpec { name: "clone-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::CloneAgent), summary: "Clone agent configuration into a new agent", usage: "team-agent clone-agent <agent> --as NEW_AGENT [--label LABEL] [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
125
+ CommandSpec { name: "fork-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::ForkAgent), summary: "Fork an agent session where supported by the provider", usage: "team-agent fork-agent <agent> --as NEW_AGENT [--label LABEL] [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
126
+ CommandSpec { name: "remove-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::RemoveAgent), summary: "Remove an agent after confirmation", usage: "team-agent remove-agent <agent> --confirm [--workspace WORKSPACE] [--team TEAM] [--from-spec] [--force] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
127
+ CommandSpec { name: "leaders", tier: CommandTier::Core, category: CommandCategory::Observe, kind: CommandKind::Dispatch(DispatchKind::Leaders), summary: "List local leaders and their team scopes", usage: "team-agent leaders [QUERY|--search TEXT] [--all|--stale] [--json] | --prune [--dry-run] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
128
+ CommandSpec { name: "doctor", tier: CommandTier::Core, category: CommandCategory::Observe, kind: CommandKind::Dispatch(DispatchKind::Doctor), summary: "Diagnose a team and suggest recovery; read-only by default", usage: "team-agent doctor [SPEC] [--workspace WORKSPACE] [--team TEAM] [--comms] [--gate orphans|comms] [--fix] [--fix-schema] [--cleanup-orphans] [--confirm] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
129
+ CommandSpec { name: "approvals", tier: CommandTier::Core, category: CommandCategory::Observe, kind: CommandKind::Dispatch(DispatchKind::Approvals), summary: "List pending agent approvals", usage: "team-agent approvals [<agent>] [--workspace WORKSPACE] [--team TEAM] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
130
+ CommandSpec { name: "route", tier: CommandTier::Core, category: CommandCategory::Setup, kind: CommandKind::Dispatch(DispatchKind::Route), summary: "Configure additional provider launch arguments", usage: "team-agent route [status|enable|disable|show [TOOL]|set TOOL -- ARG...|add TOOL -- ARG...|clear TOOL] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
131
+ CommandSpec { name: "leader-prompt", tier: CommandTier::Core, category: CommandCategory::Setup, kind: CommandKind::Dispatch(DispatchKind::LeaderPrompt), summary: "Persist supplemental instructions for new Leaders only", usage: "team-agent leader-prompt [show|set|append|clear] [--json] [--file PATH | -- TEXT]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
132
+ CommandSpec { name: "profile", tier: CommandTier::Core, category: CommandCategory::Setup, kind: CommandKind::Dispatch(DispatchKind::Profile), summary: "Manage authentication and proxy profiles", usage: "team-agent profile init|doctor|show NAME [--workspace WORKSPACE] [--team TEAM] [--auth-mode MODE] [--proxy-mode direct|inherit] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
133
+ CommandSpec { name: "install-skill", tier: CommandTier::Core, category: CommandCategory::Setup, kind: CommandKind::Dispatch(DispatchKind::InstallSkill), summary: "Optionally install an existing public operation skill", usage: "team-agent install-skill (--source DIR|--uninstall) [--target codex|claude|copilot|all] [--dest DIR] [--dry-run] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
134
+ CommandSpec { name: "claim-leader", tier: CommandTier::Guided, category: CommandCategory::GuidedRecovery, kind: CommandKind::Dispatch(DispatchKind::ClaimLeader), summary: "Register the current terminal as leader only when diagnosis recommends it", usage: "team-agent claim-leader [--workspace WORKSPACE] [--team TEAM] [--confirm] [--json] [--detail]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
135
+ CommandSpec { name: "takeover", tier: CommandTier::Guided, category: CommandCategory::GuidedRecovery, kind: CommandKind::Dispatch(DispatchKind::Takeover), summary: "Take over an existing team only after diagnosis and confirmation", usage: "team-agent takeover [--workspace WORKSPACE] [--team TEAM] [--confirm] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
136
+ CommandSpec { name: "attach-leader", tier: CommandTier::Guided, category: CommandCategory::GuidedRecovery, kind: CommandKind::Dispatch(DispatchKind::AttachLeader), summary: "Attach a verified leader terminal only when diagnosis recommends it", usage: "team-agent attach-leader [--workspace WORKSPACE] [--team TEAM] --pane PANE --provider TOOL [--confirm] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
137
+ CommandSpec { name: "kiro", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::KiroLeader), summary: "Check Kiro leader launch admission (currently refused)", usage: "team-agent kiro [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
138
+ CommandSpec { name: "pi", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::LeaderPassthrough { provider: "pi" }, summary: "Open a leader session with Pi", usage: "team-agent pi [--attach-existing] [--confirm] [--attach-session SESSION] [--external-leader] [--allow-nested-attach] [--json] [-- TOOL_ARGS...]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
139
+ CommandSpec { name: "codex", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::LeaderPassthrough { provider: "codex" }, summary: "Open a leader session with Codex", usage: "team-agent codex [--attach-existing] [--confirm] [--attach-session SESSION] [--external-leader] [--allow-nested-attach] [--json] [-- TOOL_ARGS...]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
140
+ CommandSpec { name: "claude", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::LeaderPassthrough { provider: "claude" }, summary: "Open a leader session with Claude Code", usage: "team-agent claude [--attach-existing] [--confirm] [--attach-session SESSION] [--external-leader] [--allow-nested-attach] [--json] [-- TOOL_ARGS...]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
141
+ CommandSpec { name: "copilot", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::LeaderPassthrough { provider: "copilot" }, summary: "Open a leader session with Copilot", usage: "team-agent copilot [--attach-existing] [--confirm] [--attach-session SESSION] [--external-leader] [--allow-nested-attach] [--json] [-- TOOL_ARGS...]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
142
+ CommandSpec { name: "grok", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::LeaderPassthrough { provider: "grok" }, summary: "Open a leader session with Grok", usage: "team-agent grok [--attach-existing] [--confirm] [--attach-session SESSION] [--external-leader] [--allow-nested-attach] [--json] [-- TOOL_ARGS...]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
143
+ CommandSpec { name: "cursor", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::LeaderPassthrough { provider: "cursor_agent" }, summary: "Open a leader session with Cursor agent", usage: "team-agent cursor [--attach-existing] [--confirm] [--attach-session SESSION] [--external-leader] [--allow-nested-attach] [--json] [-- TOOL_ARGS...]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
138
144
  ];
139
145
 
140
146
  pub(crate) fn command_spec(name: &str) -> Option<&'static CommandSpec> {
@@ -209,7 +209,7 @@ fn csv_agent_status(
209
209
  health: Option<&serde_json::Map<String, Value>>,
210
210
  ) -> &'static str {
211
211
  if stale_agent_bucket(agent).is_some() {
212
- return "错误";
212
+ return "error";
213
213
  }
214
214
  let raw = agent
215
215
  .get("status")
@@ -226,7 +226,7 @@ fn csv_agent_status(
226
226
  || matches!(hstatus.as_str(), "failed" | "error" | "spawn_failed")
227
227
  || matches!(raw.as_str(), "stopped" | "done")
228
228
  {
229
- return "错误";
229
+ return "error";
230
230
  }
231
231
  let pane_present = agent
232
232
  .get("pane_id")
@@ -239,21 +239,21 @@ fn csv_agent_status(
239
239
  .filter(|pane| !pane.is_empty())
240
240
  .is_some();
241
241
  if matches!(raw.as_str(), "running" | "busy" | "working") && !pane_present {
242
- return "错误";
242
+ return "error";
243
243
  }
244
244
  // 0.5.35 R4: canonical UNKNOWN beats legacy WORKING in human CSV too.
245
245
  if canonical_worker_state_is_unknown(agent) {
246
- return "未知";
246
+ return "unknown";
247
247
  }
248
248
  if raw == "idle" || hstatus == "idle" {
249
- return "空闲";
249
+ return "idle";
250
250
  }
251
251
  if matches!(raw.as_str(), "running" | "busy" | "working")
252
252
  || matches!(hstatus.as_str(), "running" | "working" | "busy")
253
253
  {
254
- return "工作";
254
+ return "working";
255
255
  }
256
- "错误"
256
+ "error"
257
257
  }
258
258
 
259
259
  /// `_latest_result_line`(`commands.py:333-337`):agent_id/summary/created_at 渲染单行。