@team-agent/installer 0.5.126 → 0.5.128
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 +1 -1
- package/Cargo.toml +1 -1
- package/README.md +11 -0
- package/crates/team-agent/src/cli/adapters.rs +3 -13
- package/crates/team-agent/src/cli/arguments.rs +4 -0
- package/crates/team-agent/src/cli/diagnose.rs +68 -91
- package/crates/team-agent/src/cli/emit.rs +61 -28
- package/crates/team-agent/src/cli/grok_slot.rs +88 -3
- package/crates/team-agent/src/cli/intent/runtime.rs +38 -9
- package/crates/team-agent/src/cli/intent/runtime_tests.rs +147 -11
- package/crates/team-agent/src/cli/intent/tests.rs +10 -12
- package/crates/team-agent/src/cli/intent.rs +1 -1
- package/crates/team-agent/src/cli/mod.rs +38 -9
- package/crates/team-agent/src/cli/models.rs +789 -186
- package/crates/team-agent/src/cli/schedule.rs +175 -0
- package/crates/team-agent/src/cli/send/persist.rs +0 -36
- package/crates/team-agent/src/cli/send/presentation.rs +1 -1
- package/crates/team-agent/src/cli/send.rs +108 -110
- package/crates/team-agent/src/cli/spec.rs +6 -0
- package/crates/team-agent/src/cli/status_port/brief.rs +5 -67
- package/crates/team-agent/src/cli/tests/leader_watch.rs +12 -62
- package/crates/team-agent/src/cli/tests/mod.rs +3 -3
- package/crates/team-agent/src/cli/tests/named_address.rs +11 -10
- package/crates/team-agent/src/cli/tests/run_delegation.rs +12 -9
- package/crates/team-agent/src/cli/tests/status_send.rs +70 -273
- package/crates/team-agent/src/compiler/tests.rs +39 -27
- package/crates/team-agent/src/compiler.rs +206 -6
- package/crates/team-agent/src/contract_runtime/backend.rs +181 -11
- package/crates/team-agent/src/contract_runtime/commands.rs +338 -7
- package/crates/team-agent/src/contract_runtime/config.rs +30 -19
- package/crates/team-agent/src/contract_runtime/config_tests.rs +24 -4
- package/crates/team-agent/src/contract_runtime/discovery.rs +12 -1
- package/crates/team-agent/src/contract_runtime/fork.rs +3 -10
- package/crates/team-agent/src/contract_runtime/framework.rs +28 -14
- package/crates/team-agent/src/contract_runtime/mcp.rs +19 -24
- package/crates/team-agent/src/contract_runtime/prompt.rs +2 -2
- package/crates/team-agent/src/contract_runtime/registry.rs +93 -130
- package/crates/team-agent/src/coordinator/steps/abnormal.rs +45 -5
- package/crates/team-agent/src/coordinator/tests/api_error_recovery.rs +8 -29
- package/crates/team-agent/src/coordinator/tests/energy.rs +4 -4
- package/crates/team-agent/src/coordinator/tests/health_sync.rs +44 -2
- package/crates/team-agent/src/coordinator/tests/main_preserved.rs +2 -2
- package/crates/team-agent/src/coordinator/tests/spine.rs +1 -1
- package/crates/team-agent/src/coordinator/tests/takeover.rs +3 -3
- package/crates/team-agent/src/coordinator/tick.rs +1 -89
- package/crates/team-agent/src/db/message_store.rs +7 -65
- package/crates/team-agent/src/direct_delivery.rs +368 -0
- package/crates/team-agent/src/inbox_store.rs +169 -0
- package/crates/team-agent/src/leader/registry.rs +5 -0
- package/crates/team-agent/src/leader/start.rs +2 -1
- package/crates/team-agent/src/leader/tests/lease_api.rs +2 -2
- package/crates/team-agent/src/leader/tests/prompt_contract.rs +1 -0
- package/crates/team-agent/src/lib.rs +2 -0
- package/crates/team-agent/src/lifecycle/launch/add_agent.rs +33 -0
- package/crates/team-agent/src/lifecycle/launch/add_agent_state.rs +206 -1
- package/crates/team-agent/src/lifecycle/launch/clone_agent.rs +28 -2
- package/crates/team-agent/src/lifecycle/launch/fork_agent.rs +36 -179
- package/crates/team-agent/src/lifecycle/launch/fork_entry.rs +87 -6
- package/crates/team-agent/src/lifecycle/launch/mcp_config.rs +13 -488
- package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +351 -81
- package/crates/team-agent/src/lifecycle/launch/pi_mcp_extension.js +3 -4
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +26 -2
- package/crates/team-agent/src/lifecycle/launch/spawn.rs +41 -31
- package/crates/team-agent/src/lifecycle/launch.rs +27 -12
- package/crates/team-agent/src/lifecycle/profile_launch.rs +318 -64
- package/crates/team-agent/src/lifecycle/restart/agent.rs +1 -0
- package/crates/team-agent/src/lifecycle/restart/avatar.rs +1798 -0
- package/crates/team-agent/src/lifecycle/restart/claude_fork.rs +163 -0
- package/crates/team-agent/src/lifecycle/restart/common.rs +298 -133
- package/crates/team-agent/src/lifecycle/restart/remove.rs +129 -0
- package/crates/team-agent/src/lifecycle/restart/selection.rs +5 -5
- package/crates/team-agent/src/lifecycle/restart.rs +4 -0
- package/crates/team-agent/src/lifecycle/role_config.rs +79 -27
- package/crates/team-agent/src/lifecycle/tests/acceptance_b_batch_red.rs +1 -1
- package/crates/team-agent/src/lifecycle/tests/agent_ops.rs +8 -12
- package/crates/team-agent/src/lifecycle/tests/behavioral_diff_264_red.rs +37 -240
- package/crates/team-agent/src/lifecycle/tests/claude_compatible_config_red.rs +325 -0
- package/crates/team-agent/src/lifecycle/tests/claude_profile_launch_red.rs +320 -8
- package/crates/team-agent/src/lifecycle/tests/cli_argv_routing_red.rs +329 -70
- package/crates/team-agent/src/lifecycle/tests/clone_fork_copilot_perms_red.rs +378 -4
- package/crates/team-agent/src/lifecycle/tests/communication_mode_runtime_contract_red.rs +25 -39
- package/crates/team-agent/src/lifecycle/tests/copilot_provider_red.rs +7 -11
- package/crates/team-agent/src/lifecycle/tests/core.rs +39 -36
- package/crates/team-agent/src/lifecycle/tests/f032_startup_prompt_best_effort_red.rs +22 -8
- package/crates/team-agent/src/lifecycle/tests/fixtures/pi_native_mcp_host.mjs +2 -1
- package/crates/team-agent/src/lifecycle/tests/grok_require_explicit_model_red.rs +15 -133
- package/crates/team-agent/src/lifecycle/tests/harvest2_a_batch_red.rs +60 -20
- package/crates/team-agent/src/lifecycle/tests/host_cotenant_death_p0_contract.rs +30 -67
- package/crates/team-agent/src/lifecycle/tests/issue238_codex_effort_contract.rs +3 -31
- package/crates/team-agent/src/lifecycle/tests/lane_ops.rs +194 -169
- package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +164 -282
- package/crates/team-agent/src/lifecycle/tests/lifecycle_rollback_red.rs +15 -78
- package/crates/team-agent/src/lifecycle/tests/main_preserved.rs +7 -7
- package/crates/team-agent/src/lifecycle/tests/mcp_tool_name_format_red.rs +6 -6
- package/crates/team-agent/src/lifecycle/tests/phase_b_contracts.rs +75 -69
- package/crates/team-agent/src/lifecycle/tests/phase_golden.rs +2 -10
- package/crates/team-agent/src/lifecycle/tests/pi_catalog_red.rs +18 -6
- package/crates/team-agent/src/lifecycle/tests/pi_command_red.rs +70 -52
- package/crates/team-agent/src/lifecycle/tests/pi_compiler_red.rs +210 -0
- package/crates/team-agent/src/lifecycle/tests/pi_dual_entry_red.rs +157 -4
- package/crates/team-agent/src/lifecycle/tests/pi_executable_mcp_red.rs +526 -10
- package/crates/team-agent/src/lifecycle/tests/pi_fork_session_inheritance_red.rs +1419 -0
- package/crates/team-agent/src/lifecycle/tests/pi_lifecycle_doctor_red.rs +68 -1
- package/crates/team-agent/src/lifecycle/tests/pi_native_mcp_capability_red.rs +34 -12
- package/crates/team-agent/src/lifecycle/tests/pi_session_delivery_red.rs +94 -2
- package/crates/team-agent/src/lifecycle/tests/quick_start_worker_readiness_red.rs +14 -15
- package/crates/team-agent/src/lifecycle/tests/restart.rs +12 -153
- package/crates/team-agent/src/lifecycle/tests/restart_build_before_destroy_0540_contract.rs +27 -5
- package/crates/team-agent/src/lifecycle/tests/restart_liveness_red.rs +59 -10
- package/crates/team-agent/src/lifecycle/tests/restart_rebind_hotfix_252_red.rs +47 -6
- package/crates/team-agent/src/lifecycle/tests/restart_session_capture_red.rs +3 -1374
- package/crates/team-agent/src/lifecycle/tests/resume_recover_red.rs +27 -10
- package/crates/team-agent/src/lifecycle/tests/status_credential_redaction_contract.rs +7 -7
- package/crates/team-agent/src/lifecycle/tests/subprep_codex_trust_roundtrip_red.rs +67 -313
- package/crates/team-agent/src/lifecycle/tests/swallow_batch4_semantics_red.rs +254 -2
- package/crates/team-agent/src/lifecycle/tests/team_in_team_identity_scope_red.rs +2 -2
- package/crates/team-agent/src/lifecycle/tests/team_in_team_sibling_quick_start_red.rs +1 -1
- package/crates/team-agent/src/lifecycle/tests/team_in_team_state_scope_red.rs +2 -2
- package/crates/team-agent/src/lifecycle/tests/team_key_retirement_txn_red.rs +4 -4
- package/crates/team-agent/src/lifecycle/tests/upgrade_compat_0211_red.rs +74 -19
- package/crates/team-agent/src/lifecycle/tests/verify_rs031_window_consistency_red.rs +38 -39
- package/crates/team-agent/src/lifecycle/tests/worker_spawn_env_red.rs +51 -88
- package/crates/team-agent/src/lifecycle/tests.rs +3 -4
- package/crates/team-agent/src/lifecycle/types.rs +18 -5
- package/crates/team-agent/src/lifecycle/worker_command_context.rs +43 -50
- package/crates/team-agent/src/mcp_server/readiness.rs +130 -149
- package/crates/team-agent/src/mcp_server/readiness_tests.rs +86 -109
- package/crates/team-agent/src/mcp_server/tests/scoped.rs +21 -31
- package/crates/team-agent/src/mcp_server/tests/send.rs +72 -107
- package/crates/team-agent/src/mcp_server/tests/tools.rs +10 -12
- package/crates/team-agent/src/mcp_server/tools.rs +70 -196
- package/crates/team-agent/src/messaging/delivery.rs +143 -253
- package/crates/team-agent/src/messaging/delivery_consumption_tests.rs +5 -5
- package/crates/team-agent/src/messaging/helpers.rs +1 -19
- package/crates/team-agent/src/messaging/mod.rs +1 -0
- package/crates/team-agent/src/messaging/reminders.rs +316 -0
- package/crates/team-agent/src/messaging/scheduler.rs +7 -1
- package/crates/team-agent/src/messaging/tests/dup_inject.rs +255 -150
- package/crates/team-agent/src/messaging/tests/main_preserved.rs +2 -2
- package/crates/team-agent/src/messaging/tests/runtime.rs +9 -115
- package/crates/team-agent/src/messaging/tests/spine.rs +44 -24
- package/crates/team-agent/src/messaging/tests/wave2.rs +13 -20
- package/crates/team-agent/src/messaging/types.rs +1 -0
- package/crates/team-agent/src/provider/adapter.rs +208 -254
- package/crates/team-agent/src/provider/adapters/claude.rs +78 -0
- package/crates/team-agent/src/provider/adapters/claude_fork.rs +131 -0
- package/crates/team-agent/src/provider/adapters/mod.rs +7 -7
- package/crates/team-agent/src/provider/adapters/pi.rs +106 -0
- package/crates/team-agent/src/provider/classify.rs +1 -66
- package/crates/team-agent/src/provider/model_catalog.rs +201 -13
- package/crates/team-agent/src/provider/session/capture.rs +111 -111
- package/crates/team-agent/src/provider/session/context_fork/claude.rs +123 -0
- package/crates/team-agent/src/provider/session/context_fork/outcome.rs +10 -18
- package/crates/team-agent/src/provider/session/context_fork.rs +87 -74
- package/crates/team-agent/src/provider/session/mod.rs +2 -3
- package/crates/team-agent/src/provider/session_scan/claude.rs +523 -0
- package/crates/team-agent/src/provider/session_scan/common.rs +47 -47
- package/crates/team-agent/src/provider/session_scan/pi.rs +34 -1
- package/crates/team-agent/src/provider/session_scan.rs +13 -13
- package/crates/team-agent/src/provider/tests/adapter.rs +127 -121
- package/crates/team-agent/src/provider/tests/classify.rs +0 -53
- package/crates/team-agent/src/provider/tests/command_helpers.rs +11 -19
- package/crates/team-agent/src/provider/tests/idle.rs +13 -19
- package/crates/team-agent/src/provider/types.rs +0 -4
- package/crates/team-agent/src/provider/wire.rs +34 -20
- package/crates/team-agent/src/state/abnormal_watch/tests/mod.rs +1 -1
- package/crates/team-agent/src/state/persist.rs +6 -6
- package/crates/team-agent/src/state/projection.rs +1 -1
- package/crates/team-agent/src/state/repository/tests.rs +2 -2
- package/crates/team-agent/src/test_support/models_timeout_fixture.rs +144 -0
- package/crates/team-agent/src/tmux_backend/tests.rs +0 -151
- package/crates/team-agent/src/tmux_backend.rs +9 -43
- package/package.json +4 -4
- package/skills/team-agent/SKILL.md +7 -8
- package/skills/team-agent/command-coverage.json +15 -1
- package/skills/team-agent/docs/reference/team-agent-operator.md +5 -3
- package/skills/team-agent/references/team-agent-operator.md +5 -3
- package/crates/team-agent/src/lifecycle/launch/grok_per_seat.rs +0 -260
- package/crates/team-agent/src/lifecycle/tests/codex_weak_window_attribution_red.rs +0 -683
- package/crates/team-agent/src/lifecycle/tests/grok_effort_argv_red.rs +0 -247
- package/crates/team-agent/src/lifecycle/tests/grok_mcp_overlay_red.rs +0 -507
- package/crates/team-agent/src/lifecycle/tests/grok_restart_resume_red.rs +0 -300
- package/crates/team-agent/src/provider/adapters/codex.rs +0 -101
- package/crates/team-agent/src/provider/adapters/grok.rs +0 -67
- package/crates/team-agent/src/provider/session/context_fork/codex.rs +0 -514
- package/crates/team-agent/src/provider/session_scan/codex.rs +0 -326
- package/crates/team-agent/src/provider/session_scan/grok.rs +0 -288
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
//! Leader reminders use the existing coordinator timer and durable event queue.
|
|
2
|
+
use std::path::Path;
|
|
3
|
+
|
|
4
|
+
use serde_json::json;
|
|
5
|
+
|
|
6
|
+
use super::{CliError, CmdOutput, CmdResult};
|
|
7
|
+
use crate::messaging::reminders;
|
|
8
|
+
|
|
9
|
+
pub(super) fn run(args: &[String], cwd: &Path) -> Result<CmdResult, CliError> {
|
|
10
|
+
let mut workspace = cwd.to_path_buf();
|
|
11
|
+
let (mut team, mut after, mut every, mut text) = (None, None, None, None);
|
|
12
|
+
let mut positional = Vec::new();
|
|
13
|
+
let mut tokens = args.iter();
|
|
14
|
+
while let Some(token) = tokens.next() {
|
|
15
|
+
// arguments::parse normalizes valued flags to --flag=value, including payloads.
|
|
16
|
+
match token.split_once('=') {
|
|
17
|
+
Some(("--workspace", value)) => workspace = Path::new(value).to_path_buf(),
|
|
18
|
+
Some(("--team", value)) => team = Some(value),
|
|
19
|
+
Some(("--in", value)) => after = Some(value),
|
|
20
|
+
Some(("--every", value)) => every = Some(value),
|
|
21
|
+
Some(("--text", value)) => text = Some(value),
|
|
22
|
+
_ if token == "--json" => {}
|
|
23
|
+
_ if token == "--" => positional.extend(tokens.by_ref().map(String::as_str)),
|
|
24
|
+
_ => positional.push(token.as_str()),
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Validate the full request before touching the workspace or starting a daemon.
|
|
28
|
+
let duration = if positional.as_slice() == ["add"] {
|
|
29
|
+
let duration = match (after, every) {
|
|
30
|
+
(Some(value), None) | (None, Some(value)) => value,
|
|
31
|
+
_ => {
|
|
32
|
+
return Err(CliError::Usage(
|
|
33
|
+
"schedule add requires exactly one of --in or --every".into(),
|
|
34
|
+
))
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
if text.is_none_or(|text| text.trim().is_empty()) {
|
|
38
|
+
return Err(CliError::Usage(
|
|
39
|
+
"schedule add requires non-empty --text".into(),
|
|
40
|
+
));
|
|
41
|
+
}
|
|
42
|
+
reminders::parse_duration(duration).map_err(|error| CliError::Usage(error.to_string()))?;
|
|
43
|
+
Some(duration)
|
|
44
|
+
} else {
|
|
45
|
+
if after.is_some() || every.is_some() || text.is_some() {
|
|
46
|
+
return Err(CliError::Usage(
|
|
47
|
+
"--in, --every and --text are only valid with schedule add".into(),
|
|
48
|
+
));
|
|
49
|
+
}
|
|
50
|
+
match positional.as_slice() {
|
|
51
|
+
["list"] => {}
|
|
52
|
+
["cancel", id] if reminders::parse_id(id).is_some() => {}
|
|
53
|
+
_ => {
|
|
54
|
+
return Err(CliError::Usage(
|
|
55
|
+
"expected schedule add, schedule list or schedule cancel sched_<hex>".into(),
|
|
56
|
+
))
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
None
|
|
60
|
+
};
|
|
61
|
+
let selected = crate::state::selector::resolve_active_team_readonly(
|
|
62
|
+
&workspace,
|
|
63
|
+
team,
|
|
64
|
+
crate::state::selector::SelectorMode::RuntimeOnly,
|
|
65
|
+
)?;
|
|
66
|
+
let workspace = &selected.run_workspace;
|
|
67
|
+
let owner = selected.team_key.as_str();
|
|
68
|
+
let value = if let Some(duration) = duration {
|
|
69
|
+
let start = crate::coordinator::start_coordinator_with_team(
|
|
70
|
+
&crate::coordinator::WorkspacePath::new(workspace.clone()),
|
|
71
|
+
Some(owner),
|
|
72
|
+
)
|
|
73
|
+
.map_err(|error| CliError::Runtime(error.to_string()))?;
|
|
74
|
+
if !start.ok {
|
|
75
|
+
return Err(CliError::Runtime(format!(
|
|
76
|
+
"reminder timer unavailable: {:?}",
|
|
77
|
+
start.status
|
|
78
|
+
)));
|
|
79
|
+
}
|
|
80
|
+
reminders::add(
|
|
81
|
+
workspace,
|
|
82
|
+
owner,
|
|
83
|
+
text.unwrap_or_default(),
|
|
84
|
+
duration,
|
|
85
|
+
every.is_some(),
|
|
86
|
+
)?
|
|
87
|
+
} else if positional[0] == "list" {
|
|
88
|
+
json!({"ok": true, "schedules": reminders::list(workspace, owner)?})
|
|
89
|
+
} else {
|
|
90
|
+
let id = reminders::parse_id(positional[1])
|
|
91
|
+
.ok_or_else(|| CliError::Usage("invalid reminder id".into()))?;
|
|
92
|
+
if !reminders::cancel(workspace, owner, id)? {
|
|
93
|
+
return Err(CliError::Usage(format!(
|
|
94
|
+
"active reminder {} not found in team {owner}",
|
|
95
|
+
positional[1]
|
|
96
|
+
)));
|
|
97
|
+
}
|
|
98
|
+
json!({"ok": true, "cancelled": positional[1]})
|
|
99
|
+
};
|
|
100
|
+
let as_json = args.iter().any(|arg| arg == "--json");
|
|
101
|
+
let mut result = CmdResult::from_json(value.clone(), as_json);
|
|
102
|
+
if !as_json {
|
|
103
|
+
let human = if let Some(id) = value["cancelled"].as_str() {
|
|
104
|
+
format!("Cancelled scheduled reminder {id}.")
|
|
105
|
+
} else if let Some(schedules) = value["schedules"].as_array() {
|
|
106
|
+
let mut rows = vec!["ID\tTRIGGER\tTEXT\tSTATUS".to_string()];
|
|
107
|
+
rows.extend(schedules.iter().map(|row| {
|
|
108
|
+
format!(
|
|
109
|
+
"{}\t{}\t{}\tactive",
|
|
110
|
+
row["id"].as_str().unwrap_or_default(),
|
|
111
|
+
row["trigger"].as_str().unwrap_or_default(),
|
|
112
|
+
row["text"].as_str().unwrap_or_default()
|
|
113
|
+
)
|
|
114
|
+
}));
|
|
115
|
+
rows.join("\n")
|
|
116
|
+
} else {
|
|
117
|
+
format!(
|
|
118
|
+
"Scheduled reminder {} active ({}): {}",
|
|
119
|
+
value["id"].as_str().unwrap_or_default(),
|
|
120
|
+
value["trigger"].as_str().unwrap_or_default(),
|
|
121
|
+
value["text"].as_str().unwrap_or_default()
|
|
122
|
+
)
|
|
123
|
+
};
|
|
124
|
+
result.output = CmdOutput::Human(human);
|
|
125
|
+
}
|
|
126
|
+
Ok(result)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
#[cfg(test)]
|
|
130
|
+
mod tests {
|
|
131
|
+
use super::*;
|
|
132
|
+
|
|
133
|
+
fn checked(raw: &[&str]) -> Result<CmdResult, CliError> {
|
|
134
|
+
let args = raw.iter().map(|arg| arg.to_string()).collect::<Vec<_>>();
|
|
135
|
+
let checked = crate::cli::arguments::parse("schedule", &args)?;
|
|
136
|
+
run(&checked.tokens, Path::new("/unused-schedule-test"))
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
#[test]
|
|
140
|
+
fn rejects_invalid_schedule_requests_before_workspace_access() {
|
|
141
|
+
for args in [
|
|
142
|
+
vec![],
|
|
143
|
+
vec!["add", "--text", "hi"],
|
|
144
|
+
vec!["add", "--in", "1s", "--every", "1s", "--text", "hi"],
|
|
145
|
+
vec!["add", "--in", "0s", "--text", "hi"],
|
|
146
|
+
vec!["add", "--in", "1s"],
|
|
147
|
+
vec!["add", "--in", "1s", "--text", " "],
|
|
148
|
+
vec!["list", "--every", "1s"],
|
|
149
|
+
vec!["cancel"],
|
|
150
|
+
vec!["cancel", "sched_0"],
|
|
151
|
+
vec!["add", "--in", "1s", "--in", "2s", "--text", "hi"],
|
|
152
|
+
vec!["list", "--unknown"],
|
|
153
|
+
] {
|
|
154
|
+
assert!(
|
|
155
|
+
matches!(checked(&args), Err(CliError::Usage(_))),
|
|
156
|
+
"{args:?}"
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
#[test]
|
|
162
|
+
fn normalized_values_and_flag_shaped_text_reach_workspace_selection() {
|
|
163
|
+
for args in [
|
|
164
|
+
vec!["add", "--in", "1s", "--text", "message = value"],
|
|
165
|
+
vec!["add", "--every=2m", "--text=--json"],
|
|
166
|
+
vec!["list", "--json"],
|
|
167
|
+
vec!["cancel", "sched_a"],
|
|
168
|
+
] {
|
|
169
|
+
assert!(
|
|
170
|
+
matches!(checked(&args), Err(CliError::State(_))),
|
|
171
|
+
"{args:?}"
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -56,46 +56,10 @@ pub(super) fn persist_resolved_target(
|
|
|
56
56
|
};
|
|
57
57
|
let outcome = messaging::send_message(&selected.run_workspace, target, content, &opts)?;
|
|
58
58
|
let mut value = delivery_outcome_json(&outcome, target, content, &opts);
|
|
59
|
-
attach_mcp_handshake_wait(&mut value, &selected, target, &outcome);
|
|
60
59
|
append_loud_ensure_fields(&mut value, coordinator_ensure.as_ref());
|
|
61
60
|
Ok(value)
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
/// #372: name the readiness gate a queued worker message is waiting on.
|
|
65
|
-
/// Observation only; the coordinator owns retry, parking, and notice.
|
|
66
|
-
pub(super) fn attach_mcp_handshake_wait(
|
|
67
|
-
value: &mut Value,
|
|
68
|
-
selected: &crate::state::selector::SelectedTeam,
|
|
69
|
-
target: &MessageTarget,
|
|
70
|
-
outcome: &DeliveryOutcome,
|
|
71
|
-
) {
|
|
72
|
-
#[cfg(unix)]
|
|
73
|
-
if let (MessageTarget::Single(agent), DeliveryStatus::Queued, Some(object)) =
|
|
74
|
-
(target, outcome.status, value.as_object_mut())
|
|
75
|
-
{
|
|
76
|
-
// A contract seat's MCP binding is the framework's own; the legacy
|
|
77
|
-
// handshake gate does not apply and must not report a wait.
|
|
78
|
-
let contract = selected
|
|
79
|
-
.state
|
|
80
|
-
.get("agents")
|
|
81
|
-
.and_then(|agents| agents.get(agent.as_str()))
|
|
82
|
-
.is_some_and(crate::contract_runtime::framework::is_contract);
|
|
83
|
-
if contract {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if let Err(reason) = crate::mcp_server::readiness::preflight(
|
|
87
|
-
&selected.run_workspace,
|
|
88
|
-
Some(selected.team_key.as_str()),
|
|
89
|
-
agent,
|
|
90
|
-
&selected.state,
|
|
91
|
-
) {
|
|
92
|
-
object.insert("deferred_reason".to_string(), json!(reason));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
#[cfg(not(unix))]
|
|
96
|
-
let _ = (value, selected, target, outcome);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
63
|
pub(super) fn routing_ambiguous_value(
|
|
100
64
|
workspace: &Path,
|
|
101
65
|
args: &SendArgs,
|
|
@@ -236,7 +236,7 @@ pub(super) fn send_human_output(value: &Value) -> String {
|
|
|
236
236
|
.get("deferred_reason")
|
|
237
237
|
.and_then(Value::as_str)
|
|
238
238
|
.filter(|reason| reason.starts_with("mcp_handshake_"))
|
|
239
|
-
.map(|reason| format!(": {agent}'s MCP server has not completed its handshake ({reason});
|
|
239
|
+
.map(|reason| format!(": {agent}'s MCP server has not completed its handshake ({reason}); this diagnostic does not block delivery"))
|
|
240
240
|
.unwrap_or_default();
|
|
241
241
|
format!("Task accepted, but delivery to the agent's conversation is still pending{waiting}.\nNext: check team-agent status or team-agent doctor --workspace .; wait for an actual reply without repeated sends.")
|
|
242
242
|
}
|
|
@@ -17,7 +17,7 @@ use coordinator::{
|
|
|
17
17
|
};
|
|
18
18
|
pub use persist::send_options_from_args;
|
|
19
19
|
use persist::{
|
|
20
|
-
|
|
20
|
+
initial_delivery_allows_watch, observe_initial_delivery_for_watch,
|
|
21
21
|
routing_ambiguous_value,
|
|
22
22
|
};
|
|
23
23
|
use presentation::{
|
|
@@ -32,137 +32,132 @@ use resolve::{
|
|
|
32
32
|
/// `cmd_send`(`commands.py:164`)。解析 target(`--to` fanout / 单 target / `*`)→ [`MessageTarget`],
|
|
33
33
|
/// 拼 [`SendOptions`](no_ack→requires_ack 取反、no_wait→wait_visible 取反等)→ `messaging::send_message`。
|
|
34
34
|
pub fn cmd_send(args: &SendArgs) -> Result<CmdResult, CliError> {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
warn_send_alias("--pane");
|
|
39
|
-
if args.target.is_some()
|
|
40
|
-
|| args.targets.is_some()
|
|
41
|
-
|| args.to_name.is_some()
|
|
42
|
-
|| args.to_leader.is_some()
|
|
43
|
-
{
|
|
44
|
-
let message = if args.to_name.is_some() {
|
|
45
|
-
"An agent name cannot be combined with --to-name/--pane/--to; choose one addressing mode"
|
|
46
|
-
} else {
|
|
47
|
-
"--pane cannot be combined with an agent name, --to or --to-leader"
|
|
48
|
-
};
|
|
49
|
-
return Err(CliError::Usage(message.to_string()));
|
|
35
|
+
if args.pane.is_some() {
|
|
36
|
+
if args.target.is_some() || args.targets.is_some() || args.to_name.is_some() || args.to_leader.is_some() {
|
|
37
|
+
return Err(CliError::Usage("An agent name cannot be combined with --to-name/--pane/--to/--to-leader/--targets; choose one addressing mode".into()));
|
|
50
38
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return Err(CliError::Usage(
|
|
54
|
-
"Provide a task message; --pane cannot send an empty message".to_string(),
|
|
55
|
-
));
|
|
39
|
+
if args.message.join(" ").trim().is_empty() {
|
|
40
|
+
return Err(CliError::Usage("Provide a task message; --pane cannot send an empty message".into()));
|
|
56
41
|
}
|
|
57
|
-
return Err(CliError::Usage(
|
|
58
|
-
"--pane {pane_id} is no longer supported; use team-agent send <agent> 'task message' with --workspace/--team to select scope"
|
|
59
|
-
)));
|
|
60
|
-
}
|
|
61
|
-
if args.targets.is_some() {
|
|
62
|
-
warn_send_alias("--targets");
|
|
42
|
+
return Err(CliError::Usage("raw pane delivery requires --socket and --dialect".into()));
|
|
63
43
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if args.to_leader.is_some() {
|
|
68
|
-
warn_send_alias("--to-leader");
|
|
69
|
-
}
|
|
70
|
-
let host_leader_alias = if let Some(name) = args.to_leader.as_deref() {
|
|
71
|
-
match resolve_host_leader_alias(name) {
|
|
72
|
-
Ok(resolved) => Some(resolved),
|
|
73
|
-
Err(value) => return Ok(cmd_send_result(value, args.json)),
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
None
|
|
77
|
-
};
|
|
78
|
-
let logical_to = logical_to_from_args(
|
|
79
|
-
args,
|
|
80
|
-
host_leader_alias
|
|
81
|
-
.as_ref()
|
|
82
|
-
.map(|(logical_to, _)| logical_to.as_str()),
|
|
83
|
-
)?;
|
|
44
|
+
logical_to_from_args(args, args.to_leader.as_deref())?;
|
|
45
|
+
let alias = args.to_leader.as_deref().map(read_host_leader_alias).transpose()?;
|
|
46
|
+
let logical_to = logical_to_from_args(args, alias.as_ref().map(|_| "leader"))?;
|
|
84
47
|
let content = args.message.join(" ");
|
|
85
|
-
if
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
48
|
+
if content.is_empty() { return Err(CliError::Usage("empty_message: send requires a nonempty message".into())); }
|
|
49
|
+
let requested = logical_to.split(',').map(str::trim).filter(|target| !target.is_empty());
|
|
50
|
+
let mailbox = args.presentation.sink != crate::messaging::presentation::PresentationSink::Leader;
|
|
51
|
+
let mut results = Vec::new();
|
|
52
|
+
let mut destinations = Vec::new();
|
|
53
|
+
for target in requested {
|
|
54
|
+
let (workspace, team, agent) = if let Some(entry) = &alias {
|
|
55
|
+
(entry.workspace.clone(), Some(entry.team_key.clone()), "leader".to_string())
|
|
56
|
+
} else if target == "*" {
|
|
57
|
+
(args.workspace.clone(), args.team.clone(), target.to_string())
|
|
58
|
+
} else {
|
|
59
|
+
// A qualified address carries its own scope; only a bare name consumes --team.
|
|
60
|
+
let Ok(address) = crate::messaging::parse_logical_address(target) else {
|
|
61
|
+
return refuse(args, target, format!("invalid recipient name: {target}"));
|
|
62
|
+
};
|
|
63
|
+
let team = if address.workspace.is_some() { None } else { args.team.clone() };
|
|
64
|
+
let workspace = address.workspace.unwrap_or_else(|| args.workspace.clone());
|
|
65
|
+
match address.target {
|
|
66
|
+
crate::messaging::LogicalAddressTarget::Worker(agent) => (workspace, team, agent),
|
|
67
|
+
crate::messaging::LogicalAddressTarget::TeamEntity { team, entity } => (workspace, Some(team), entity),
|
|
68
|
+
crate::messaging::LogicalAddressTarget::SessionWindow { .. } => return Err(CliError::Usage(
|
|
69
|
+
"Terminal-window addressing is no longer supported; use an agent name or leader, with --workspace/--team to select scope".into(),
|
|
70
|
+
)),
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
let directory = match crate::direct_delivery::directory(&workspace, team.as_deref()) {
|
|
74
|
+
Ok(directory) => directory,
|
|
75
|
+
Err(error) => return refuse(args, target, error),
|
|
76
|
+
};
|
|
77
|
+
let agents: Vec<String> = if agent == "*" {
|
|
78
|
+
directory.agents().into_iter().filter(|agent| agent != args.sender.as_str()).collect()
|
|
79
|
+
} else { vec![agent] };
|
|
80
|
+
for agent in agents {
|
|
81
|
+
let raw = if target == "*" { agent.as_str() } else { target };
|
|
82
|
+
if agent != "leader" && !directory.agents().contains(&agent) {
|
|
83
|
+
return refuse(args, raw, format!("unknown recipient: {agent}"));
|
|
84
|
+
}
|
|
85
|
+
let endpoint = directory.endpoint(&agent);
|
|
86
|
+
if let (false, Err(error)) = (mailbox, &endpoint) {
|
|
87
|
+
if alias.is_some() { return Err(CliError::Runtime(error.clone())); }
|
|
88
|
+
return refuse(args, raw, error.clone());
|
|
89
|
+
}
|
|
90
|
+
let key = (directory.workspace.clone(), directory.team.clone(), agent);
|
|
91
|
+
if !destinations.iter().any(|(existing, _)| existing == &key) {
|
|
92
|
+
destinations.push((key, endpoint));
|
|
93
|
+
}
|
|
89
94
|
}
|
|
90
|
-
add_send_reminder_if_ok(&mut value);
|
|
91
|
-
return Ok(cmd_send_result(value, args.json));
|
|
92
|
-
}
|
|
93
|
-
let selected = crate::state::selector::resolve_active_team(
|
|
94
|
-
&args.workspace,
|
|
95
|
-
args.team.as_deref(),
|
|
96
|
-
crate::state::selector::SelectorMode::RuntimeOnly,
|
|
97
|
-
)?;
|
|
98
|
-
let target = send_target(None, Some(logical_to.as_str()));
|
|
99
|
-
let mut opts = send_options_from_args(args);
|
|
100
|
-
// `args.team` is a selector and may be a legacy session/team-dir alias.
|
|
101
|
-
// All downstream membership and DB scope must use the canonical key that
|
|
102
|
-
// resolve_active_team returned, never the original selector spelling.
|
|
103
|
-
opts.team = Some(TeamKey::new(selected.team_key.clone()));
|
|
104
|
-
// CR-061/N27 routing-ambiguous: a single positional with no `--to`/`--targets` and an
|
|
105
|
-
// empty message body is a prompt-only invocation (`team-agent send "fix the build"`).
|
|
106
|
-
// The lone positional is CONTENT, not a target — reject with `routing_ambiguous`
|
|
107
|
-
// (NOT `target_not_in_team`, which would lie that the user did pick a target).
|
|
108
|
-
if let Some(amb) =
|
|
109
|
-
routing_ambiguous_value(&selected.run_workspace, args, &target, &content, &opts)
|
|
110
|
-
{
|
|
111
|
-
return Ok(cmd_send_result(amb, args.json));
|
|
112
95
|
}
|
|
113
|
-
if
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
96
|
+
if destinations.is_empty() { return Err(CliError::Runtime("send has no recipients".into())); }
|
|
97
|
+
for ((workspace, team, agent), _endpoint) in destinations {
|
|
98
|
+
let mut inbox_id = None;
|
|
99
|
+
if mailbox || (agent == "leader" && !matches!(args.sender.as_str(), "human" | "leader")) {
|
|
100
|
+
let record = crate::inbox_store::record(args.sender.as_str(), &agent, &content, team.as_deref(), "message");
|
|
101
|
+
crate::inbox_store::append(&workspace, &agent, &record).map_err(CliError::Runtime)?;
|
|
102
|
+
inbox_id = Some(record["message_id"].clone());
|
|
103
|
+
}
|
|
104
|
+
let mut value = if mailbox {
|
|
105
|
+
serde_json::json!({"status": "stored", "recipient": agent, "mailbox": true})
|
|
119
106
|
} else {
|
|
120
|
-
|
|
107
|
+
let text = format!("Team Agent message from {}:\n\n{content}", args.sender.as_str());
|
|
108
|
+
crate::direct_delivery::directory(&workspace, team.as_deref())
|
|
109
|
+
.and_then(|directory| directory.send(&agent, &text)).map_err(CliError::Runtime)?
|
|
121
110
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
outcome = observe_initial_delivery_for_watch(&selected, &target, &outcome, &opts)?;
|
|
111
|
+
if let Some(id) = inbox_id { value["message_id"] = id; }
|
|
112
|
+
results.push(value);
|
|
125
113
|
}
|
|
126
|
-
let mut value =
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if
|
|
139
|
-
|
|
140
|
-
obj.insert("watch".to_string(), watch_notice_json(&target, &opts));
|
|
141
|
-
}
|
|
114
|
+
let mut value = if results.len() == 1 { results.remove(0) } else { serde_json::json!({"status": "sent", "results": results}) };
|
|
115
|
+
value["ok"] = serde_json::json!(true);
|
|
116
|
+
Ok(CmdResult::from_json(value, args.json))
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/// Refuse an unroutable recipient. The read-only named-address diagnosis only
|
|
120
|
+
/// explains the refusal (reason, scoped spelling suggestions); it never routes.
|
|
121
|
+
fn refuse(args: &SendArgs, raw: &str, cause: String) -> Result<CmdResult, CliError> {
|
|
122
|
+
let Err(mut error) = crate::cli::named_address::resolve_name_for_cli(&args.workspace, raw, args.team.as_deref()) else {
|
|
123
|
+
return Err(CliError::Runtime(cause));
|
|
124
|
+
};
|
|
125
|
+
resolve::adapt_positional_bare_error(args, raw, &mut error);
|
|
126
|
+
if args.json {
|
|
127
|
+
return Ok(CmdResult::from_json(error.to_json(), true));
|
|
142
128
|
}
|
|
143
|
-
|
|
144
|
-
|
|
129
|
+
let (message, action) = error.human_guidance(raw);
|
|
130
|
+
Err(CliError::AddressRefusal { audit: error.n38_message(), error: message, action })
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
fn read_host_leader_alias(name: &str) -> Result<crate::leader::registry::LeaderRegistryEntry, CliError> {
|
|
134
|
+
let candidates: Vec<_> = crate::leader::registry::snapshots().into_iter()
|
|
135
|
+
.filter(|entry| entry.delivery_name == name || entry.qualified_name == name
|
|
136
|
+
|| entry.stable_qualified_name == name || entry.aliases.iter().any(|alias| alias == name)).collect();
|
|
137
|
+
if candidates.len() != 1 {
|
|
138
|
+
return Err(CliError::Runtime(format!(
|
|
139
|
+
"leader name is unknown or ambiguous: {name}; refused, nothing was sent. List attached leader names with team-agent leaders; to leave the message for later, resend with --mailbox and read it with team-agent inbox leader"
|
|
140
|
+
)));
|
|
141
|
+
}
|
|
142
|
+
Ok(candidates.into_iter().next().unwrap())
|
|
145
143
|
}
|
|
146
144
|
|
|
147
145
|
/// Resolve a host-leader alias, send through the canonical persisted funnel,
|
|
148
146
|
/// then decorate the already-produced result for the host-leader surface.
|
|
149
147
|
pub fn send_to_canonical_leader_target(
|
|
150
|
-
|
|
148
|
+
_sender_workspace: &std::path::Path,
|
|
151
149
|
name: &str,
|
|
152
150
|
content: &str,
|
|
153
151
|
sender: &TrustedSender,
|
|
154
152
|
task_id: Option<&str>,
|
|
155
153
|
) -> Result<serde_json::Value, CliError> {
|
|
156
|
-
let
|
|
157
|
-
Ok(resolved) => resolved,
|
|
158
|
-
Err(value) => return Ok(value),
|
|
159
|
-
};
|
|
154
|
+
let entry = read_host_leader_alias(name)?;
|
|
160
155
|
let args = SendArgs {
|
|
161
|
-
target: Some(
|
|
156
|
+
target: Some("leader".to_string()),
|
|
162
157
|
message: vec![content.to_string()],
|
|
163
158
|
targets: None,
|
|
164
|
-
workspace:
|
|
165
|
-
team:
|
|
159
|
+
workspace: entry.workspace.clone(),
|
|
160
|
+
team: Some(entry.team_key.clone()),
|
|
166
161
|
task: task_id.map(str::to_string),
|
|
167
162
|
sender: sender.clone(),
|
|
168
163
|
no_ack: false,
|
|
@@ -177,7 +172,10 @@ pub fn send_to_canonical_leader_target(
|
|
|
177
172
|
to_name: None,
|
|
178
173
|
to_leader: None,
|
|
179
174
|
};
|
|
180
|
-
let mut value =
|
|
175
|
+
let mut value = match cmd_send(&args)?.output {
|
|
176
|
+
CmdOutput::Json(value) => value,
|
|
177
|
+
_ => unreachable!("JSON send requested"),
|
|
178
|
+
};
|
|
181
179
|
decorate_host_leader_alias(&mut value, &entry);
|
|
182
180
|
Ok(value)
|
|
183
181
|
}
|
|
@@ -38,10 +38,12 @@ pub(crate) enum DispatchKind {
|
|
|
38
38
|
Agent,
|
|
39
39
|
QuickStart,
|
|
40
40
|
Send,
|
|
41
|
+
Schedule,
|
|
41
42
|
Status,
|
|
42
43
|
Models,
|
|
43
44
|
KiroLeader,
|
|
44
45
|
Inbox,
|
|
46
|
+
Locate,
|
|
45
47
|
Restart,
|
|
46
48
|
Shutdown,
|
|
47
49
|
AddAgent,
|
|
@@ -69,10 +71,12 @@ pub(crate) const ALL_DISPATCH_KINDS: &[DispatchKind] = &[
|
|
|
69
71
|
DispatchKind::Agent,
|
|
70
72
|
DispatchKind::QuickStart,
|
|
71
73
|
DispatchKind::Send,
|
|
74
|
+
DispatchKind::Schedule,
|
|
72
75
|
DispatchKind::Status,
|
|
73
76
|
DispatchKind::Models,
|
|
74
77
|
DispatchKind::KiroLeader,
|
|
75
78
|
DispatchKind::Inbox,
|
|
79
|
+
DispatchKind::Locate,
|
|
76
80
|
DispatchKind::Restart,
|
|
77
81
|
DispatchKind::Shutdown,
|
|
78
82
|
DispatchKind::AddAgent,
|
|
@@ -124,8 +128,10 @@ pub(crate) const COMMAND_SPECS: &[CommandSpec] = &[
|
|
|
124
128
|
CommandSpec { name: "agent", tier: CommandTier::Core, category: CommandCategory::WorkerLifecycle, kind: CommandKind::Dispatch(DispatchKind::Agent), summary: "Explicit agent lifecycle operations", usage: "team-agent agent <start|stop|restart|add|remove|reset|clone|fork> AGENT [OPTIONS]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
|
|
125
129
|
CommandSpec { name: "quick-start", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::QuickStart), summary: "Compatibility creation bridge; prefer start for daily activation", 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 },
|
|
126
130
|
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 },
|
|
131
|
+
CommandSpec { name: "schedule", tier: CommandTier::Core, category: CommandCategory::Start, kind: CommandKind::Dispatch(DispatchKind::Schedule), summary: "Add, list or cancel durable leader reminders (durations: ms/s/m/h/d)", usage: "team-agent schedule add (--in DURATION | --every DURATION) --text MESSAGE [--workspace PATH] [--team KEY] [--json]\n team-agent schedule list [--workspace PATH] [--team KEY] [--json]\n team-agent schedule cancel sched_<hex> [--workspace PATH] [--team KEY] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::Conditional, sunset: None, action: None, governance: None },
|
|
127
132
|
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 },
|
|
128
133
|
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|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 },
|
|
134
|
+
CommandSpec { name: "locate", tier: CommandTier::Core, category: CommandCategory::Observe, kind: CommandKind::Dispatch(DispatchKind::Locate), summary: "List live endpoints from the read-only snapshot", usage: "team-agent locate [--workspace DIR] [--team NAME] [--json]", default_help: true, command_help: true, suggestion_index: true, token_usage: TokenUsage::No, sunset: None, action: None, governance: None },
|
|
129
135
|
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 },
|
|
130
136
|
CommandSpec { name: "restart", tier: CommandTier::Core, category: CommandCategory::TeamLifecycle, kind: CommandKind::Dispatch(DispatchKind::Restart), summary: "Restart one agent, or use the frozen bare/path team bridge", usage: "team-agent restart [AGENT|./WORKSPACE] [--workspace WORKSPACE] [--team TEAM] [--session auto|preserve] [--dry-run] [--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 },
|
|
131
137
|
CommandSpec { name: "shutdown", tier: CommandTier::Core, category: CommandCategory::TeamLifecycle, kind: CommandKind::Dispatch(DispatchKind::Shutdown), summary: "Compatibility: shut down the selected team; prefer stop", 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 },
|