@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.
- package/Cargo.lock +252 -84
- package/Cargo.toml +3 -1
- package/crates/team-agent/Cargo.toml +3 -0
- package/crates/team-agent/src/cli/adapters.rs +119 -50
- package/crates/team-agent/src/cli/diagnose.rs +36 -13
- package/crates/team-agent/src/cli/emit.rs +173 -109
- package/crates/team-agent/src/cli/leader.rs +16 -0
- package/crates/team-agent/src/cli/leader_prompt.rs +261 -0
- package/crates/team-agent/src/cli/leaders.rs +32 -32
- package/crates/team-agent/src/cli/mod.rs +158 -14
- package/crates/team-agent/src/cli/models.rs +68 -18
- package/crates/team-agent/src/cli/named_address.rs +17 -16
- package/crates/team-agent/src/cli/route.rs +4 -4
- package/crates/team-agent/src/cli/send/presentation.rs +19 -18
- package/crates/team-agent/src/cli/send/resolve.rs +11 -11
- package/crates/team-agent/src/cli/send.rs +4 -4
- package/crates/team-agent/src/cli/spec.rs +35 -29
- package/crates/team-agent/src/cli/status.rs +7 -7
- package/crates/team-agent/src/cli/status_port/brief.rs +268 -101
- package/crates/team-agent/src/cli/tests/base.rs +94 -6
- package/crates/team-agent/src/cli/tests/divergence.rs +3 -2
- package/crates/team-agent/src/cli/tests/lane_c.rs +1 -1
- package/crates/team-agent/src/cli/tests/named_address.rs +3 -3
- package/crates/team-agent/src/cli/tests/status_send.rs +9 -7
- package/crates/team-agent/src/cli/triage.rs +53 -2
- package/crates/team-agent/src/cli/types.rs +8 -8
- package/crates/team-agent/src/compiler/tests.rs +12 -0
- package/crates/team-agent/src/compiler.rs +65 -26
- package/crates/team-agent/src/contract_runtime/backend.rs +646 -0
- package/crates/team-agent/src/contract_runtime/config.rs +309 -0
- package/crates/team-agent/src/contract_runtime/discovery.rs +237 -0
- package/crates/team-agent/src/contract_runtime/forward.rs +229 -0
- package/crates/team-agent/src/contract_runtime/framework.rs +261 -0
- package/crates/team-agent/src/contract_runtime/mcp.rs +396 -0
- package/crates/team-agent/src/contract_runtime/mod.rs +14 -0
- package/crates/team-agent/src/contract_runtime/prompt.rs +216 -0
- package/crates/team-agent/src/contract_runtime/pump.rs +207 -0
- package/crates/team-agent/src/contract_runtime/registry.rs +30 -0
- package/crates/team-agent/src/coordinator/tick.rs +26 -8
- package/crates/team-agent/src/leader/mod.rs +1 -0
- package/crates/team-agent/src/leader/prompt.rs +906 -0
- package/crates/team-agent/src/leader/start.rs +265 -16
- package/crates/team-agent/src/leader/tests/identity.rs +21 -0
- package/crates/team-agent/src/leader/tests/mod.rs +2 -0
- package/crates/team-agent/src/leader/tests/prompt_contract.rs +268 -0
- package/crates/team-agent/src/leader/types.rs +6 -0
- package/crates/team-agent/src/lib.rs +4 -0
- package/crates/team-agent/src/lifecycle/launch/identity.rs +172 -13
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +760 -365
- package/crates/team-agent/src/lifecycle/launch/spawn.rs +38 -9
- package/crates/team-agent/src/lifecycle/launch/state_projection.rs +17 -0
- package/crates/team-agent/src/lifecycle/launch.rs +39 -28
- package/crates/team-agent/src/lifecycle/profile_launch.rs +58 -46
- package/crates/team-agent/src/lifecycle/restart/rebuild.rs +97 -52
- package/crates/team-agent/src/lifecycle/restart.rs +1 -1
- package/crates/team-agent/src/lifecycle/tests/stale_team_saveconflict_contract.rs +3 -2
- package/crates/team-agent/src/lifecycle/types.rs +4 -1
- package/crates/team-agent/src/lifecycle/worker_command_context.rs +37 -27
- package/crates/team-agent/src/main.rs +6 -0
- package/crates/team-agent/src/messaging/delivery.rs +50 -1
- package/crates/team-agent/src/messaging/send.rs +10 -0
- package/crates/team-agent/src/messaging/tests/leader_inject_acceptance.rs +131 -0
- package/crates/team-agent/src/model/spec.rs +24 -12
- package/crates/team-agent/src/provider/adapter.rs +8 -59
- package/crates/team-agent/src/provider/adapters/claude.rs +6 -14
- package/crates/team-agent/src/provider/adapters/codex.rs +8 -18
- package/crates/team-agent/src/provider/adapters/copilot.rs +5 -22
- package/crates/team-agent/src/provider/adapters/cursor_agent.rs +8 -45
- package/crates/team-agent/src/provider/adapters/grok.rs +7 -31
- package/crates/team-agent/src/provider/adapters/pi.rs +7 -18
- package/crates/team-agent/src/provider/command_helpers.rs +45 -0
- package/crates/team-agent/src/provider/mod.rs +1 -0
- package/crates/team-agent/src/provider/model_catalog.rs +21 -28
- package/crates/team-agent/src/provider/tests/adapter.rs +70 -0
- package/crates/team-agent/src/provider/tests/command_helpers.rs +55 -0
- package/crates/team-agent/src/state/persist.rs +73 -0
- 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": "
|
|
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
|
|
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
|
-
"\
|
|
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!("
|
|
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!("
|
|
233
|
+
format!("Delivered to {agent}. {}", crate::cli::SEND_REMINDER)
|
|
233
234
|
} else {
|
|
234
|
-
"
|
|
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(|| "
|
|
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
|
-
"
|
|
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
|
-
"
|
|
12
|
+
"Use team-agent send <agent> 'task message'; select the workspace and team with --workspace/--team",
|
|
13
13
|
);
|
|
14
|
-
eprintln!("
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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!("
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
44
|
+
"An agent name cannot be combined with --to-name/--pane/--to; choose one addressing mode"
|
|
45
45
|
} else {
|
|
46
|
-
"--pane
|
|
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
|
-
"
|
|
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}
|
|
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: "
|
|
110
|
-
CommandSpec { name: "send", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Send), summary: "
|
|
111
|
-
CommandSpec { name: "status", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Status), summary: "
|
|
112
|
-
CommandSpec { name: "models", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Models), summary: "
|
|
113
|
-
CommandSpec { name: "inbox", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Inbox), summary: "
|
|
114
|
-
CommandSpec { name: "restart", tier: CommandTier::Core, category: CommandCategory::TeamLifecycle, kind: CommandKind::Dispatch(DispatchKind::Restart), summary: "
|
|
115
|
-
CommandSpec { name: "shutdown", tier: CommandTier::Core, category: CommandCategory::TeamLifecycle, kind: CommandKind::Dispatch(DispatchKind::Shutdown), summary: "
|
|
116
|
-
CommandSpec { name: "add-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::AddAgent), summary: "
|
|
117
|
-
CommandSpec { name: "start-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::StartAgent), summary: "
|
|
118
|
-
CommandSpec { name: "stop-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::StopAgent), summary: "
|
|
119
|
-
CommandSpec { name: "reset-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::ResetAgent), summary: "
|
|
120
|
-
CommandSpec { name: "clone-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::CloneAgent), summary: "
|
|
121
|
-
CommandSpec { name: "fork-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::ForkAgent), summary: "
|
|
122
|
-
CommandSpec { name: "remove-agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::RemoveAgent), summary: "
|
|
123
|
-
CommandSpec { name: "leaders", tier: CommandTier::Core, category: CommandCategory::Observe, kind: CommandKind::Dispatch(DispatchKind::Leaders), summary: "
|
|
124
|
-
CommandSpec { name: "doctor", tier: CommandTier::Core, category: CommandCategory::Observe, kind: CommandKind::Dispatch(DispatchKind::Doctor), summary: "
|
|
125
|
-
CommandSpec { name: "approvals", tier: CommandTier::Core, category: CommandCategory::Observe, kind: CommandKind::Dispatch(DispatchKind::Approvals), summary: "
|
|
126
|
-
CommandSpec { name: "route", tier: CommandTier::Core, category: CommandCategory::Setup, kind: CommandKind::Dispatch(DispatchKind::Route), summary: "
|
|
127
|
-
CommandSpec { name: "
|
|
128
|
-
CommandSpec { name: "
|
|
129
|
-
CommandSpec { name: "
|
|
130
|
-
CommandSpec { name: "
|
|
131
|
-
CommandSpec { name: "
|
|
132
|
-
CommandSpec { name: "
|
|
133
|
-
CommandSpec { name: "
|
|
134
|
-
CommandSpec { name: "
|
|
135
|
-
CommandSpec { name: "
|
|
136
|
-
CommandSpec { name: "
|
|
137
|
-
CommandSpec { name: "
|
|
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 渲染单行。
|