@team-agent/installer 0.5.114 → 0.5.115
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/crates/team-agent/src/cli/emit.rs +2 -2
- package/crates/team-agent/src/cli/mod.rs +12 -7
- package/crates/team-agent/src/cli/models.rs +52 -1
- package/crates/team-agent/src/cli/spec.rs +1 -1
- package/crates/team-agent/src/contract_runtime/backend.rs +408 -95
- package/crates/team-agent/src/contract_runtime/commands.rs +245 -0
- package/crates/team-agent/src/contract_runtime/config.rs +39 -8
- package/crates/team-agent/src/contract_runtime/config_tests.rs +56 -0
- package/crates/team-agent/src/contract_runtime/discovery.rs +186 -40
- package/crates/team-agent/src/contract_runtime/framework.rs +38 -5
- package/crates/team-agent/src/contract_runtime/mod.rs +2 -0
- package/crates/team-agent/src/contract_runtime/pump.rs +95 -33
- package/crates/team-agent/src/contract_runtime/registry.rs +171 -4
- package/crates/team-agent/src/contract_runtime/workspace.rs +160 -0
- package/crates/team-agent/src/leader/start.rs +93 -5
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +99 -1
- package/crates/team-agent/src/lifecycle/launch/state_projection.rs +3 -5
- package/crates/team-agent/src/lifecycle/launch.rs +6 -0
- package/crates/team-agent/src/lifecycle/restart/rebuild.rs +23 -1
- package/crates/team-agent/src/lifecycle/restart/selection.rs +34 -0
- package/crates/team-agent/src/lifecycle/role_config.rs +17 -1
- package/package.json +4 -4
package/Cargo.lock
CHANGED
package/Cargo.toml
CHANGED
|
@@ -448,8 +448,8 @@ pub(super) fn command_help(command: Option<&str>) -> String {
|
|
|
448
448
|
"team-agent inbox leader -n 3\nteam-agent inbox worker --limit 5\nteam-agent inbox leader --workspace . --team help-demo --json", "Wait for a natural reply, then check team-agent status if needed. Do not inspect worker terminal content."),
|
|
449
449
|
"status" => ("Optional <agent> selects one agent. --summary/--detail retain compatibility and do not add fields.\nNine fields: name/provider/model/effort/runtime_status/activity/health/session_name/tmux_command.\nRuntime, activity and health are distinct. unknown means insufficient evidence; null means unset. No default model is guessed.",
|
|
450
450
|
"team-agent status\nteam-agent status worker\nteam-agent status --workspace . --team help-demo --json", "Read replies with team-agent inbox leader -n 3; diagnose problems with team-agent doctor --workspace ."),
|
|
451
|
-
"models" => ("--provider selects the provider, default pi. QUERY or --search performs keyword search; they are mutually exclusive.\nUse
|
|
452
|
-
"team-agent models --provider pi\nteam-agent models --provider pi --search luna\nteam-agent models --provider
|
|
451
|
+
"models" => ("--provider selects the provider, default pi. QUERY or --search performs keyword search; they are mutually exclusive.\nUse cursor for the contract-native Cursor catalog; cursor_agent retains the legacy entrypoint. Copilot has no model discovery entrypoint here. Results come from the native catalog, not guesses.",
|
|
452
|
+
"team-agent models --provider pi\nteam-agent models --provider pi --search luna\nteam-agent models --provider cursor --json", "Use the exact returned model name in a role file or add-agent --model before launch."),
|
|
453
453
|
"restart" => ("WORKSPACE defaults to the current project; saved sessions are preferred.\nUse --allow-fresh only after explicit authorization to lose saved context. --session-converge-deadline sets the wait in seconds.",
|
|
454
454
|
"team-agent restart .\nteam-agent restart . --team help-demo --json", "Check status after restart. Obtain authorization before creating a fresh session; takeover is not a substitute for restart."),
|
|
455
455
|
"shutdown" => ("Shuts down only the selected workspace/team. Logs are retained by default; --keep-logs remains compatible.\n--json reports scope, degradation and owned residuals. Success does not mean other teams were shut down.",
|
|
@@ -3126,9 +3126,9 @@ pub mod lifecycle_port {
|
|
|
3126
3126
|
session_converge_deadline_ms: Option<u64>,
|
|
3127
3127
|
) -> Result<Value, CliError> {
|
|
3128
3128
|
#[cfg(unix)]
|
|
3129
|
-
crate::contract_runtime::
|
|
3130
|
-
|
|
3131
|
-
|
|
3129
|
+
if let Some(receipt) = crate::contract_runtime::commands::restart(workspace, team)? {
|
|
3130
|
+
return Ok(receipt);
|
|
3131
|
+
}
|
|
3132
3132
|
match crate::lifecycle::restart_with_session_convergence_deadline(
|
|
3133
3133
|
workspace,
|
|
3134
3134
|
allow_fresh,
|
|
@@ -3149,6 +3149,10 @@ pub mod lifecycle_port {
|
|
|
3149
3149
|
team: Option<&str>,
|
|
3150
3150
|
role_config: &crate::lifecycle::role_config::RoleConfigPatch,
|
|
3151
3151
|
) -> Result<Value, CliError> {
|
|
3152
|
+
#[cfg(unix)]
|
|
3153
|
+
if let Some(receipt) = crate::contract_runtime::commands::start_agent(workspace, team, agent, role_config)? {
|
|
3154
|
+
return Ok(receipt);
|
|
3155
|
+
}
|
|
3152
3156
|
#[cfg(unix)]
|
|
3153
3157
|
{
|
|
3154
3158
|
crate::contract_runtime::framework::require_legacy_lifecycle(
|
|
@@ -3228,13 +3232,14 @@ pub mod lifecycle_port {
|
|
|
3228
3232
|
agent: &str,
|
|
3229
3233
|
team: Option<&str>,
|
|
3230
3234
|
) -> Result<Value, CliError> {
|
|
3235
|
+
#[cfg(unix)]
|
|
3236
|
+
if let Some(receipt) = crate::contract_runtime::commands::stop_agent(workspace, team, agent)? {
|
|
3237
|
+
return Ok(receipt);
|
|
3238
|
+
}
|
|
3231
3239
|
let agent_id = crate::model::ids::AgentId::new(agent);
|
|
3232
3240
|
#[cfg(unix)]
|
|
3233
3241
|
crate::contract_runtime::framework::require_legacy_lifecycle(
|
|
3234
|
-
workspace,
|
|
3235
|
-
team,
|
|
3236
|
-
Some(agent),
|
|
3237
|
-
"stop-agent",
|
|
3242
|
+
workspace, team, Some(agent), "stop-agent",
|
|
3238
3243
|
)?;
|
|
3239
3244
|
match crate::lifecycle::stop_agent(workspace, &agent_id, team) {
|
|
3240
3245
|
Ok(report) => Ok(json!({"ok": true, "agent_id": agent, "stopped": report.stopped})),
|
|
@@ -438,6 +438,57 @@ mod tests {
|
|
|
438
438
|
assert_eq!(models[0]["default"], true);
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
+
#[cfg(unix)]
|
|
442
|
+
#[test]
|
|
443
|
+
fn cursor_contract_catalog_uses_public_launcher_metadata_then_exact_ids() {
|
|
444
|
+
let program = fixture_program("cursor-agent", r#"
|
|
445
|
+
test "$#" = 1 || exit 9
|
|
446
|
+
case "$1" in
|
|
447
|
+
--version) printf '%s\n' '2026.10.01-a1b2c3' ;;
|
|
448
|
+
--list-models) exec /bin/cat "$TEAM_AGENT_MODELS_FIXTURE" ;;
|
|
449
|
+
*) exit 9 ;;
|
|
450
|
+
esac"#);
|
|
451
|
+
let mut cursor = CliFixture::new(program);
|
|
452
|
+
let response = cursor.program.with_extension("stdout");
|
|
453
|
+
std::fs::write(&response, include_bytes!("../provider/testdata/cursor-list-models-native.stdout")).unwrap();
|
|
454
|
+
cursor.response = Some(response);
|
|
455
|
+
let output = run_public_models_cli(&cursor.program, cursor.response.as_deref(),
|
|
456
|
+
&["models", "--provider", "cursor", "--search", "gpt-5.6-luna-xhigh", "--json"]);
|
|
457
|
+
let text = public_cli_text(&output);
|
|
458
|
+
let calls = std::fs::read_to_string(cursor.program.with_extension("count")).unwrap();
|
|
459
|
+
assert!(output.status.success(), "{text}");
|
|
460
|
+
assert_eq!(calls, "1:--version\n1:--list-models\n");
|
|
461
|
+
let value: Value = serde_json::from_str(text.trim()).unwrap();
|
|
462
|
+
assert_eq!(value["provider"], "cursor");
|
|
463
|
+
assert_eq!(value["auth"], "unknown");
|
|
464
|
+
assert_eq!(value["source"]["schema"], "cursor-list-models-text-v1");
|
|
465
|
+
assert_eq!(value["source"]["identity_scope"], "catalog_only");
|
|
466
|
+
assert!(value["models"].as_array().unwrap().iter().any(|row| row["model_id"] == "gpt-5.6-luna-xhigh"));
|
|
467
|
+
assert!(value["models"].as_array().unwrap().iter().all(|row| row["role_model"] == row["model_id"]));
|
|
468
|
+
assert!(value["current_role_model"].is_null());
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
#[cfg(unix)]
|
|
472
|
+
#[test]
|
|
473
|
+
fn cursor_contract_bad_version_has_no_legacy_entrypoint_fallback() {
|
|
474
|
+
use std::os::unix::fs::PermissionsExt;
|
|
475
|
+
let cursor = CliFixture::new(fixture_program("cursor-agent", "printf '%s\\n' 'Cursor release unknown'"));
|
|
476
|
+
let legacy = cursor.program.parent().unwrap().join("agent");
|
|
477
|
+
std::fs::write(&legacy, "#!/bin/sh\nprintf 'called' > \"$0.called\"\nexit 9\n").unwrap();
|
|
478
|
+
std::fs::set_permissions(&legacy, std::fs::Permissions::from_mode(0o700)).unwrap();
|
|
479
|
+
let output = run_public_models_cli(&cursor.program, None,
|
|
480
|
+
&["models", "--provider", "cursor", "--json"]);
|
|
481
|
+
let text = public_cli_text(&output);
|
|
482
|
+
assert!(!output.status.success(), "{text}");
|
|
483
|
+
assert_eq!(std::fs::read_to_string(cursor.program.with_extension("count")).unwrap(), "1:--version\n");
|
|
484
|
+
assert!(!legacy.with_extension("called").exists());
|
|
485
|
+
let value: Value = serde_json::from_str(text.trim()).unwrap();
|
|
486
|
+
assert_eq!(value["provider"], "cursor");
|
|
487
|
+
assert_eq!(value["ok"], false);
|
|
488
|
+
assert_eq!(value["models"], json!([]));
|
|
489
|
+
assert!(value["error"].as_str().unwrap().contains("Cursor release unknown"));
|
|
490
|
+
}
|
|
491
|
+
|
|
441
492
|
#[cfg(unix)]
|
|
442
493
|
#[test]
|
|
443
494
|
fn grok_public_cli_uses_native_catalog_and_keeps_shared_projection() {
|
|
@@ -1322,7 +1373,7 @@ mod tests {
|
|
|
1322
1373
|
),
|
|
1323
1374
|
ExitCode::Error
|
|
1324
1375
|
);
|
|
1325
|
-
let usage = "team-agent models [--provider pi|cursor_agent|codex|claude|claude_code|grok|kiro] [QUERY|--search TEXT] [--json]";
|
|
1376
|
+
let usage = "team-agent models [--provider pi|cursor|cursor_agent|codex|claude|claude_code|grok|kiro] [QUERY|--search TEXT] [--json]";
|
|
1326
1377
|
assert_eq!(crate::cli::spec::command_spec("models").unwrap().usage, usage);
|
|
1327
1378
|
assert!(crate::cli::emit::command_help(Some("models")).contains(usage));
|
|
1328
1379
|
}
|
|
@@ -113,7 +113,7 @@ pub(crate) const COMMAND_SPECS: &[CommandSpec] = &[
|
|
|
113
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
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
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 },
|
|
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|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
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
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
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 },
|