@team-agent/installer 0.5.98 → 0.5.100
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/adapters.rs +1 -163
- package/crates/team-agent/src/cli/diagnose.rs +3 -19
- package/crates/team-agent/src/cli/emit.rs +20 -204
- package/crates/team-agent/src/cli/mod.rs +138 -205
- package/crates/team-agent/src/cli/send/coordinator.rs +2 -2
- package/crates/team-agent/src/cli/spec.rs +41 -67
- package/crates/team-agent/src/cli/tests/main_preserved.rs +2 -186
- package/crates/team-agent/src/cli/tests/missing_subcommands.rs +9 -10
- package/crates/team-agent/src/cli/tests/run_delegation.rs +0 -3
- package/crates/team-agent/src/cli/tests/verb_validate.rs +0 -1
- package/crates/team-agent/src/cli/triage.rs +1 -1
- package/crates/team-agent/src/cli/types.rs +0 -55
- package/crates/team-agent/src/compiler/tests.rs +5 -8
- package/crates/team-agent/src/compiler.rs +6 -14
- package/crates/team-agent/src/leader/lease.rs +1 -1
- package/crates/team-agent/src/lifecycle/launch/add_agent.rs +1 -1
- package/crates/team-agent/src/lifecycle/launch/add_agent_state.rs +1 -1
- package/crates/team-agent/src/lifecycle/launch/agent_state.rs +5 -25
- package/crates/team-agent/src/lifecycle/launch/identity.rs +2 -18
- package/crates/team-agent/src/lifecycle/launch/layout.rs +7 -29
- package/crates/team-agent/src/lifecycle/launch/leader_context.rs +1 -1
- package/crates/team-agent/src/lifecycle/launch/mcp_config.rs +1 -1
- package/crates/team-agent/src/lifecycle/launch/ownership.rs +1 -1
- package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +7 -7
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +12 -49
- package/crates/team-agent/src/lifecycle/launch/quick_start_transport.rs +3 -9
- package/crates/team-agent/src/lifecycle/launch/readiness.rs +1 -1
- package/crates/team-agent/src/lifecycle/launch/spawn.rs +2 -61
- package/crates/team-agent/src/lifecycle/launch/spec_state.rs +2 -15
- package/crates/team-agent/src/lifecycle/launch/state_projection.rs +3 -7
- package/crates/team-agent/src/lifecycle/launch/worker_env.rs +1 -1
- package/crates/team-agent/src/lifecycle/launch.rs +3 -4
- package/crates/team-agent/src/lifecycle/mod.rs +0 -8
- package/crates/team-agent/src/lifecycle/restart/agent.rs +62 -8
- package/crates/team-agent/src/lifecycle/restart/common.rs +0 -32
- package/crates/team-agent/src/lifecycle/restart/rebuild.rs +6 -15
- package/crates/team-agent/src/lifecycle/tests/b0_reader_hideone_audit_contract.rs +2 -2
- package/crates/team-agent/src/lifecycle/tests/claude_profile_launch_red.rs +1 -1
- package/crates/team-agent/src/lifecycle/tests/clone_agent_preserves_source_tools.rs +1 -2
- package/crates/team-agent/src/lifecycle/tests/clone_fork_copilot_perms_red.rs +0 -1
- package/crates/team-agent/src/lifecycle/tests/core.rs +0 -213
- package/crates/team-agent/src/lifecycle/tests/issue238_codex_effort_contract.rs +96 -0
- package/crates/team-agent/src/lifecycle/tests/lane_ops.rs +1 -0
- package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +31 -77
- package/crates/team-agent/src/lifecycle/tests/main_preserved.rs +2 -2
- package/crates/team-agent/src/lifecycle/tests/phase_b_contracts.rs +4 -8
- package/crates/team-agent/src/lifecycle/tests/phase_golden.rs +16 -9
- package/crates/team-agent/src/lifecycle/tests/pi_executable_mcp_red.rs +1 -1
- package/crates/team-agent/src/lifecycle/tests/realmachine_clusters_1_6_red.rs +0 -60
- package/crates/team-agent/src/lifecycle/tests/startup_latency_contract.rs +3 -4
- package/crates/team-agent/src/lifecycle/tests/team_in_team_identity_scope_red.rs +2 -2
- package/crates/team-agent/src/lifecycle/tests.rs +1 -2
- package/crates/team-agent/src/lifecycle/types.rs +3 -133
- package/crates/team-agent/src/messaging/send.rs +2 -2
- package/crates/team-agent/src/model/enums.rs +21 -71
- package/crates/team-agent/src/model/spec.rs +5 -20
- package/crates/team-agent/src/provider/adapters/codex.rs +2 -2
- package/crates/team-agent/src/provider/types.rs +7 -6
- package/crates/team-agent/src/state/repository.rs +0 -5
- package/examples/team.spec.yaml +0 -1
- package/package.json +4 -4
- package/schemas/team.schema.json +2 -2
- package/skills/team-agent/SKILL.md +1 -1
- package/skills/team-agent/references/recovery-runbook.md +2 -2
- package/skills/team-agent/references/team-agent-operator.md +3 -10
- package/skills/team-agent/references/team-in-team.md +0 -6
- package/crates/team-agent/src/lifecycle/display.rs +0 -550
- package/crates/team-agent/src/lifecycle/tests/core_034_real_red.rs +0 -884
- package/crates/team-agent/src/lifecycle/tests/display_adaptive_red.rs +0 -481
package/Cargo.lock
CHANGED
package/Cargo.toml
CHANGED
|
@@ -6,100 +6,6 @@
|
|
|
6
6
|
use super::*;
|
|
7
7
|
use crate::transport::Transport;
|
|
8
8
|
|
|
9
|
-
const INIT_SPEC_TEMPLATE: &str = include_str!("../model/testdata/team.spec.yaml");
|
|
10
|
-
const INIT_STATE_TEMPLATE: &str = r#"# Team State
|
|
11
|
-
|
|
12
|
-
Updated: not launched
|
|
13
|
-
|
|
14
|
-
## Objective
|
|
15
|
-
|
|
16
|
-
Pending.
|
|
17
|
-
|
|
18
|
-
## Team
|
|
19
|
-
|
|
20
|
-
- Name: pending
|
|
21
|
-
- Runtime session: pending
|
|
22
|
-
|
|
23
|
-
## Agents
|
|
24
|
-
|
|
25
|
-
- Pending launch.
|
|
26
|
-
|
|
27
|
-
## Task Graph
|
|
28
|
-
|
|
29
|
-
- Pending task graph.
|
|
30
|
-
|
|
31
|
-
## Latest Results
|
|
32
|
-
|
|
33
|
-
- None.
|
|
34
|
-
|
|
35
|
-
## Blockers
|
|
36
|
-
|
|
37
|
-
- None.
|
|
38
|
-
|
|
39
|
-
## Next Step
|
|
40
|
-
|
|
41
|
-
- Run `team-agent validate team.spec.yaml`, review permissions, then run `team-agent launch team.spec.yaml --yes`.
|
|
42
|
-
"#;
|
|
43
|
-
|
|
44
|
-
pub fn cmd_init(args: &InitArgs) -> Result<CmdResult, CliError> {
|
|
45
|
-
let team_root = args.workspace.join(".team");
|
|
46
|
-
let spec_path = team_root.join("current").join("team.spec.yaml");
|
|
47
|
-
let state_path = args.workspace.join("team_state.md");
|
|
48
|
-
let team_md_path = args.workspace.join("TEAM.md");
|
|
49
|
-
let agents_dir = args.workspace.join("agents");
|
|
50
|
-
let default_agent_path = agents_dir.join("worker.md");
|
|
51
|
-
if spec_path.exists() && !args.force {
|
|
52
|
-
return Err(CliError::Runtime(format!(
|
|
53
|
-
"{} already exists; pass --force to overwrite",
|
|
54
|
-
spec_path.display()
|
|
55
|
-
)));
|
|
56
|
-
}
|
|
57
|
-
for dir in [
|
|
58
|
-
team_root.clone(),
|
|
59
|
-
team_root.join("current"),
|
|
60
|
-
team_root.join("runtime"),
|
|
61
|
-
team_root.join("logs"),
|
|
62
|
-
team_root.join("messages"),
|
|
63
|
-
team_root.join("artifacts"),
|
|
64
|
-
agents_dir.clone(),
|
|
65
|
-
] {
|
|
66
|
-
std::fs::create_dir_all(&dir)?;
|
|
67
|
-
}
|
|
68
|
-
std::fs::write(&spec_path, INIT_SPEC_TEMPLATE)?;
|
|
69
|
-
if args.force || !team_md_path.exists() {
|
|
70
|
-
std::fs::write(
|
|
71
|
-
&team_md_path,
|
|
72
|
-
"---\nname: current\nobjective: Pending.\nprovider: fake\n---\n\nPending.\n",
|
|
73
|
-
)?;
|
|
74
|
-
}
|
|
75
|
-
if args.force || !default_agent_path.exists() {
|
|
76
|
-
std::fs::write(
|
|
77
|
-
&default_agent_path,
|
|
78
|
-
"---\nname: worker\nrole: Worker\nprovider: fake\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nWait for instructions.\n",
|
|
79
|
-
)?;
|
|
80
|
-
}
|
|
81
|
-
if args.force || !state_path.exists() {
|
|
82
|
-
std::fs::write(&state_path, INIT_STATE_TEMPLATE)?;
|
|
83
|
-
}
|
|
84
|
-
crate::event_log::EventLog::new(&args.workspace)
|
|
85
|
-
.write(
|
|
86
|
-
"init",
|
|
87
|
-
json!({
|
|
88
|
-
"spec_path": spec_path.to_string_lossy().to_string(),
|
|
89
|
-
"state_path": state_path.to_string_lossy().to_string(),
|
|
90
|
-
}),
|
|
91
|
-
)
|
|
92
|
-
.map_err(|e| CliError::Runtime(e.to_string()))?;
|
|
93
|
-
Ok(CmdResult::from_json(
|
|
94
|
-
json!({
|
|
95
|
-
"ok": true,
|
|
96
|
-
"spec": spec_path.to_string_lossy().to_string(),
|
|
97
|
-
"state": state_path.to_string_lossy().to_string(),
|
|
98
|
-
}),
|
|
99
|
-
args.json,
|
|
100
|
-
))
|
|
101
|
-
}
|
|
102
|
-
|
|
103
9
|
/// `cmd_quick_start`(`commands.py:18`)。`--json` 或 `!ok` → 整 dict;否则 `result["summary"]`。
|
|
104
10
|
pub fn cmd_quick_start(args: &QuickStartArgs) -> Result<CmdResult, CliError> {
|
|
105
11
|
let mut value = lifecycle_port::quick_start(
|
|
@@ -108,7 +14,6 @@ pub fn cmd_quick_start(args: &QuickStartArgs) -> Result<CmdResult, CliError> {
|
|
|
108
14
|
args.name.as_deref(),
|
|
109
15
|
args.team_id.as_deref(),
|
|
110
16
|
args.yes,
|
|
111
|
-
!args.no_display,
|
|
112
17
|
args.backend.as_deref(),
|
|
113
18
|
)?;
|
|
114
19
|
append_send_guidance(&mut value, &args.workspace, args.team_id.as_deref());
|
|
@@ -438,24 +343,6 @@ pub fn cmd_allow_peer_talk(args: &AllowPeerTalkArgs) -> Result<CmdResult, CliErr
|
|
|
438
343
|
Ok(CmdResult::from_json(value, args.json))
|
|
439
344
|
}
|
|
440
345
|
|
|
441
|
-
/// `diagnose` is the permanent compatibility spelling for `doctor`.
|
|
442
|
-
/// Keep this wrapper free of probing/reporting logic so direct Rust callers and
|
|
443
|
-
/// the CLI both converge on the canonical handler.
|
|
444
|
-
pub fn cmd_diagnose(args: &DiagnoseArgs) -> Result<CmdResult, CliError> {
|
|
445
|
-
cmd_doctor(&DoctorArgs {
|
|
446
|
-
spec: None,
|
|
447
|
-
workspace: args.workspace.clone(),
|
|
448
|
-
gate: None,
|
|
449
|
-
comms: false,
|
|
450
|
-
team: args.team.clone(),
|
|
451
|
-
fix: false,
|
|
452
|
-
fix_schema: false,
|
|
453
|
-
cleanup_orphans: false,
|
|
454
|
-
confirm: false,
|
|
455
|
-
json: args.json,
|
|
456
|
-
})
|
|
457
|
-
}
|
|
458
|
-
|
|
459
346
|
/// `cmd_preflight`(`parser.py:160`)。
|
|
460
347
|
pub fn cmd_preflight(args: &PreflightArgs) -> Result<CmdResult, CliError> {
|
|
461
348
|
let report = build_preflight_report(&args.team)?;
|
|
@@ -871,7 +758,6 @@ communication:
|
|
|
871
758
|
mirror_files: ".team/messages"
|
|
872
759
|
runtime:
|
|
873
760
|
backend: "tmux"
|
|
874
|
-
display_backend: "none"
|
|
875
761
|
session_name: "team-agent-fake-e2e"
|
|
876
762
|
auto_launch: true
|
|
877
763
|
require_user_approval_before_launch: false
|
|
@@ -1212,7 +1098,6 @@ pub fn cmd_start_agent(args: &StartAgentArgs) -> Result<CmdResult, CliError> {
|
|
|
1212
1098
|
&args.workspace,
|
|
1213
1099
|
&args.agent,
|
|
1214
1100
|
args.force,
|
|
1215
|
-
!args.no_display,
|
|
1216
1101
|
args.allow_fresh,
|
|
1217
1102
|
args.team.as_deref(),
|
|
1218
1103
|
)?;
|
|
@@ -1243,7 +1128,6 @@ pub fn cmd_reset_agent(args: &ResetAgentArgs) -> Result<CmdResult, CliError> {
|
|
|
1243
1128
|
&args.workspace,
|
|
1244
1129
|
&args.agent,
|
|
1245
1130
|
args.discard_session,
|
|
1246
|
-
!args.no_display,
|
|
1247
1131
|
args.team.as_deref(),
|
|
1248
1132
|
)?,
|
|
1249
1133
|
args.json,
|
|
@@ -1256,7 +1140,6 @@ pub fn cmd_add_agent(args: &AddAgentArgs) -> Result<CmdResult, CliError> {
|
|
|
1256
1140
|
&args.workspace,
|
|
1257
1141
|
&args.agent,
|
|
1258
1142
|
&args.role_file,
|
|
1259
|
-
!args.no_display,
|
|
1260
1143
|
args.team.as_deref(),
|
|
1261
1144
|
args.force,
|
|
1262
1145
|
)?;
|
|
@@ -1280,7 +1163,6 @@ pub fn cmd_fork_agent(args: &ForkAgentArgs) -> Result<CmdResult, CliError> {
|
|
|
1280
1163
|
&args.source_agent,
|
|
1281
1164
|
&args.as_agent,
|
|
1282
1165
|
args.label.as_deref(),
|
|
1283
|
-
!args.no_display,
|
|
1284
1166
|
args.team.as_deref(),
|
|
1285
1167
|
)?,
|
|
1286
1168
|
args.json,
|
|
@@ -1294,7 +1176,6 @@ pub fn cmd_clone_agent(args: &CloneAgentArgs) -> Result<CmdResult, CliError> {
|
|
|
1294
1176
|
&args.source_agent,
|
|
1295
1177
|
&args.as_agent,
|
|
1296
1178
|
args.label.as_deref(),
|
|
1297
|
-
!args.no_display,
|
|
1298
1179
|
args.team.as_deref(),
|
|
1299
1180
|
)?,
|
|
1300
1181
|
args.json,
|
|
@@ -1316,50 +1197,7 @@ pub fn cmd_remove_agent(args: &RemoveAgentArgs) -> Result<CmdResult, CliError> {
|
|
|
1316
1197
|
))
|
|
1317
1198
|
}
|
|
1318
1199
|
|
|
1319
|
-
/// `
|
|
1320
|
-
pub fn cmd_stuck_list(args: &StuckListArgs) -> Result<CmdResult, CliError> {
|
|
1321
|
-
let selected = crate::state::selector::resolve_active_team(
|
|
1322
|
-
&args.workspace,
|
|
1323
|
-
args.team.as_deref(),
|
|
1324
|
-
crate::state::selector::SelectorMode::RuntimeOnly,
|
|
1325
|
-
)
|
|
1326
|
-
.map_err(|e| CliError::Runtime(e.to_string()))?;
|
|
1327
|
-
let suppressed = selected
|
|
1328
|
-
.state
|
|
1329
|
-
.get("coordinator")
|
|
1330
|
-
.and_then(|v| v.get("suppressed_idle_alerts"))
|
|
1331
|
-
.and_then(|v| v.get(&selected.team_key))
|
|
1332
|
-
.cloned()
|
|
1333
|
-
.unwrap_or_else(|| json!({}));
|
|
1334
|
-
Ok(CmdResult::from_json(
|
|
1335
|
-
json!({"ok": true, "suppressed_idle_alerts": suppressed}),
|
|
1336
|
-
args.json,
|
|
1337
|
-
))
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
/// `cmd_stuck_cancel`(`commands.py:409`)。REUSE `messaging::stuck_cancel`(suppressed_by="leader")。
|
|
1341
|
-
pub fn cmd_stuck_cancel(args: &StuckCancelArgs) -> Result<CmdResult, CliError> {
|
|
1342
|
-
if args.team.is_some() {
|
|
1343
|
-
return Err(CliError::Usage(
|
|
1344
|
-
"stuck-cancel --team is not supported yet because stuck suppression storage is not team-scoped".to_string(),
|
|
1345
|
-
));
|
|
1346
|
-
}
|
|
1347
|
-
Ok(CmdResult::from_json(
|
|
1348
|
-
messaging::stuck_cancel(&args.workspace, &args.agent, args.alert_type, "leader")?,
|
|
1349
|
-
args.json,
|
|
1350
|
-
))
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
/// `cmd_acknowledge_idle`(`commands.py:418`)。
|
|
1354
|
-
pub fn cmd_acknowledge_idle(args: &AcknowledgeIdleArgs) -> Result<CmdResult, CliError> {
|
|
1355
|
-
Ok(CmdResult::from_json(
|
|
1356
|
-
lifecycle_port::acknowledge_idle(&args.workspace, args.team.as_deref())?,
|
|
1357
|
-
args.json,
|
|
1358
|
-
))
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
|
-
/// `doctor` is the single health/diagnostic pipeline. `diagnose` enters here
|
|
1362
|
-
/// through the compatibility wrapper above; it never gets a second facts engine.
|
|
1200
|
+
/// `doctor` is the single health/diagnostic pipeline.
|
|
1363
1201
|
pub fn cmd_doctor(args: &DoctorArgs) -> Result<CmdResult, CliError> {
|
|
1364
1202
|
if let Some(DoctorGate::Unknown(raw)) = &args.gate {
|
|
1365
1203
|
let value = json!({
|
|
@@ -144,7 +144,7 @@ pub(crate) fn diagnose_runtime(state: &Value, backend: &dyn Transport) -> (Value
|
|
|
144
144
|
let error_str = error.to_string();
|
|
145
145
|
let issue_id = classify_tmux_server_error(&error_str);
|
|
146
146
|
issues.push(json!(issue_id));
|
|
147
|
-
let mut hint = recovery_hint(session_name, issue_id, "team-agent
|
|
147
|
+
let mut hint = recovery_hint(session_name, issue_id, "team-agent doctor");
|
|
148
148
|
if let Some(obj) = hint.as_object_mut() {
|
|
149
149
|
obj.insert("reason".to_string(), Value::String(error_str));
|
|
150
150
|
}
|
|
@@ -947,7 +947,7 @@ fn topology_repair_hint(issue: &str) -> Value {
|
|
|
947
947
|
"action_required": true,
|
|
948
948
|
"advisory": true,
|
|
949
949
|
"broken_class": issue,
|
|
950
|
-
"hint_action": "team-agent
|
|
950
|
+
"hint_action": "team-agent doctor --json",
|
|
951
951
|
"dedupe_key": issue,
|
|
952
952
|
"action": "repair the tmux topology mismatch, then rerun team-agent restart",
|
|
953
953
|
})
|
|
@@ -1319,22 +1319,6 @@ pub(crate) fn build_preflight_report(team: &std::path::Path) -> Result<Value, Cl
|
|
|
1319
1319
|
next_actions.push(json!("install tmux or add it to PATH"));
|
|
1320
1320
|
}
|
|
1321
1321
|
|
|
1322
|
-
let display_backend = compiled
|
|
1323
|
-
.as_ref()
|
|
1324
|
-
.and_then(|spec| yaml_path_str(spec, &["runtime", "display_backend"]))
|
|
1325
|
-
.unwrap_or("none");
|
|
1326
|
-
let ghostty_required = display_backend == "ghostty_window" || display_backend == "ghostty";
|
|
1327
|
-
let ghostty_path = command_path("ghostty");
|
|
1328
|
-
checks.push(json!({
|
|
1329
|
-
"name": "ghostty",
|
|
1330
|
-
"ok": !ghostty_required || ghostty_path.is_some(),
|
|
1331
|
-
"path": ghostty_path,
|
|
1332
|
-
"required": ghostty_required,
|
|
1333
|
-
}));
|
|
1334
|
-
if ghostty_required && ghostty_path.is_none() {
|
|
1335
|
-
next_actions.push(json!("install Ghostty or choose another display_backend"));
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
1322
|
let workspace = crate::model::paths::team_workspace(team)
|
|
1339
1323
|
.map_err(|error| CliError::Runtime(error.to_string()))?;
|
|
1340
1324
|
let profile_dir_exists = workspace
|
|
@@ -1621,7 +1605,7 @@ pub(crate) fn build_wait_ready_report(
|
|
|
1621
1605
|
"workers_not_ready",
|
|
1622
1606
|
"workers not ready before timeout",
|
|
1623
1607
|
vec![json!(
|
|
1624
|
-
"inspect team-agent
|
|
1608
|
+
"inspect team-agent doctor output and worker terminals"
|
|
1625
1609
|
)],
|
|
1626
1610
|
)
|
|
1627
1611
|
};
|