@team-agent/installer 0.5.75 → 0.5.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/Cargo.lock +1 -1
  2. package/Cargo.toml +1 -1
  3. package/README.md +9 -0
  4. package/README.zh.md +8 -0
  5. package/crates/team-agent/src/cli/adapters.rs +184 -125
  6. package/crates/team-agent/src/cli/diagnose.rs +333 -68
  7. package/crates/team-agent/src/cli/emit.rs +59 -15
  8. package/crates/team-agent/src/cli/mod.rs +600 -134
  9. package/crates/team-agent/src/cli/models.rs +485 -44
  10. package/crates/team-agent/src/cli/named_address.rs +19 -5
  11. package/crates/team-agent/src/cli/profile.rs +35 -4
  12. package/crates/team-agent/src/cli/spec.rs +7 -2
  13. package/crates/team-agent/src/cli/status_port/brief.rs +1137 -0
  14. package/crates/team-agent/src/cli/status_port/compact.rs +12 -8
  15. package/crates/team-agent/src/cli/status_port/snapshot.rs +15 -12
  16. package/crates/team-agent/src/cli/status_port/store.rs +1 -1
  17. package/crates/team-agent/src/cli/status_port.rs +8 -0
  18. package/crates/team-agent/src/cli/tests/missing_subcommands.rs +62 -8
  19. package/crates/team-agent/src/cli/tests/mod.rs +1 -0
  20. package/crates/team-agent/src/cli/tests/named_address.rs +70 -0
  21. package/crates/team-agent/src/cli/tests/run_delegation.rs +29 -24
  22. package/crates/team-agent/src/cli/tests/status_brief.rs +691 -0
  23. package/crates/team-agent/src/cli/tests/status_send.rs +8 -2
  24. package/crates/team-agent/src/cli/tests/verb_profile.rs +81 -6
  25. package/crates/team-agent/src/cli/types.rs +1 -0
  26. package/crates/team-agent/src/leader/lease.rs +538 -41
  27. package/crates/team-agent/src/leader/owner_bind.rs +40 -12
  28. package/crates/team-agent/src/leader/rediscover/tests.rs +65 -0
  29. package/crates/team-agent/src/leader/rediscover.rs +36 -6
  30. package/crates/team-agent/src/leader/start.rs +151 -14
  31. package/crates/team-agent/src/leader/tests/wake_start_owner.rs +15 -9
  32. package/crates/team-agent/src/leader/types.rs +4 -0
  33. package/crates/team-agent/src/lifecycle/launch/add_agent.rs +28 -227
  34. package/crates/team-agent/src/lifecycle/launch/add_agent_state.rs +0 -18
  35. package/crates/team-agent/src/lifecycle/launch/cursor_mcp.rs +94 -227
  36. package/crates/team-agent/src/lifecycle/launch/mcp_config.rs +59 -10
  37. package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +138 -14
  38. package/crates/team-agent/src/lifecycle/launch/quick_start.rs +1449 -282
  39. package/crates/team-agent/src/lifecycle/launch/readiness.rs +349 -4
  40. package/crates/team-agent/src/lifecycle/launch/spawn.rs +11 -11
  41. package/crates/team-agent/src/lifecycle/launch/spec_state.rs +35 -3
  42. package/crates/team-agent/src/lifecycle/launch/worker_env.rs +16 -0
  43. package/crates/team-agent/src/lifecycle/launch.rs +30 -7
  44. package/crates/team-agent/src/lifecycle/profile_launch.rs +37 -3
  45. package/crates/team-agent/src/lifecycle/restart/agent.rs +112 -100
  46. package/crates/team-agent/src/lifecycle/restart/common.rs +82 -52
  47. package/crates/team-agent/src/lifecycle/restart/rebuild.rs +1002 -65
  48. package/crates/team-agent/src/lifecycle/restart.rs +2 -2
  49. package/crates/team-agent/src/lifecycle/tests/acceptance_b_batch_red.rs +3 -0
  50. package/crates/team-agent/src/lifecycle/tests/b0_reader_hideone_audit_contract.rs +45 -14
  51. package/crates/team-agent/src/lifecycle/tests/behavioral_diff_264_red.rs +15 -0
  52. package/crates/team-agent/src/lifecycle/tests/claude_compatible_config_red.rs +5 -0
  53. package/crates/team-agent/src/lifecycle/tests/claude_profile_launch_red.rs +11 -13
  54. package/crates/team-agent/src/lifecycle/tests/clone_agent_preserves_source_tools.rs +119 -3
  55. package/crates/team-agent/src/lifecycle/tests/communication_mode_runtime_contract_red.rs +12 -0
  56. package/crates/team-agent/src/lifecycle/tests/copilot_provider_red.rs +22 -0
  57. package/crates/team-agent/src/lifecycle/tests/core_034_real_red.rs +12 -0
  58. package/crates/team-agent/src/lifecycle/tests/cursor_mcp_overlay.rs +265 -198
  59. package/crates/team-agent/src/lifecycle/tests/cursor_require_explicit_model_red.rs +14 -30
  60. package/crates/team-agent/src/lifecycle/tests/cursor_restart_resume_red.rs +3 -0
  61. package/crates/team-agent/src/lifecycle/tests/g1_silent_faces.rs +2 -5
  62. package/crates/team-agent/src/lifecycle/tests/grok_effort_argv_red.rs +10 -0
  63. package/crates/team-agent/src/lifecycle/tests/grok_mcp_overlay_red.rs +58 -35
  64. package/crates/team-agent/src/lifecycle/tests/grok_require_explicit_model_red.rs +10 -0
  65. package/crates/team-agent/src/lifecycle/tests/grok_restart_resume_red.rs +9 -0
  66. package/crates/team-agent/src/lifecycle/tests/harvest2_a_batch_red.rs +4 -3
  67. package/crates/team-agent/src/lifecycle/tests/lane_ops.rs +0 -168
  68. package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +145 -212
  69. package/crates/team-agent/src/lifecycle/tests/phase_b_contracts.rs +16 -2
  70. package/crates/team-agent/src/lifecycle/tests/phase_golden.rs +69 -28
  71. package/crates/team-agent/src/lifecycle/tests/pi_dual_entry_red.rs +78 -0
  72. package/crates/team-agent/src/lifecycle/tests/team_in_team_identity_scope_red.rs +3 -0
  73. package/crates/team-agent/src/lifecycle/tests/test_isolation_escape_contract.rs +51 -10
  74. package/crates/team-agent/src/lifecycle/tests/upgrade_compat_0211_red.rs +22 -10
  75. package/crates/team-agent/src/lifecycle/tests/verify_rs031_window_consistency_red.rs +50 -7
  76. package/crates/team-agent/src/lifecycle/tests/worker_spawn_env_red.rs +137 -0
  77. package/crates/team-agent/src/lifecycle/types.rs +12 -0
  78. package/crates/team-agent/src/mcp_server/wire.rs +140 -11
  79. package/crates/team-agent/src/messaging/delivery.rs +67 -8
  80. package/crates/team-agent/src/messaging/leader_channel.rs +56 -0
  81. package/crates/team-agent/src/messaging/tests/runtime.rs +10 -2
  82. package/crates/team-agent/src/messaging/watchers.rs +48 -4
  83. package/crates/team-agent/src/provider/adapters/cursor_agent.rs +2 -5
  84. package/crates/team-agent/src/state/paths.rs +17 -2
  85. package/crates/team-agent/src/state/persist.rs +97 -1
  86. package/crates/team-agent/src/state/projection.rs +18 -2
  87. package/crates/team-agent/src/state/repository.rs +29 -0
  88. package/crates/team-agent/src/state/selector.rs +23 -3
  89. package/crates/team-agent/src/test_support/models_timeout_fixture.rs +144 -0
  90. package/crates/team-agent/src/tmux_backend/tests.rs +121 -4
  91. package/crates/team-agent/src/tmux_backend.rs +208 -118
  92. package/crates/team-agent/src/transport.rs +72 -0
  93. package/crates/team-agent/src/transport_factory.rs +53 -0
  94. package/package.json +4 -5
  95. package/skills/team-agent/SKILL.md +45 -17
  96. package/skills/team-agent/command-coverage.json +4 -29
  97. package/npm/check-skill-links.mjs +0 -88
  98. package/skills/team-agent/references/team-agent-operator.md +0 -672
@@ -345,7 +345,7 @@ fn status_compact_reports_identity_slot_health_on_grok_identity_slot_ok() {
345
345
  }
346
346
 
347
347
  #[test]
348
- fn cmd_status_human_appends_harness_reminder() {
348
+ fn cmd_status_human_is_seven_field_brief_without_diagnostics() {
349
349
  let ws = seed_status_workspace();
350
350
  let args = StatusArgs {
351
351
  agent: None,
@@ -362,7 +362,13 @@ fn cmd_status_human_appends_harness_reminder() {
362
362
  other => panic!("expected human status output, got {other:?}"),
363
363
  };
364
364
 
365
- assert!(text.ends_with(crate::cli::STATUS_REMINDER), "{text}");
365
+ assert!(
366
+ text.contains(
367
+ "name: a1 provider: unknown runtime_status: unknown activity: unknown health: unknown session_name: null tmux_command: null"
368
+ ),
369
+ "{text}"
370
+ );
371
+ assert!(!text.contains(crate::cli::STATUS_REMINDER));
366
372
  let _ = std::fs::remove_dir_all(&ws);
367
373
  }
368
374
 
@@ -35,7 +35,7 @@ fn seed_official_api_profile(ws: &std::path::Path) {
35
35
 
36
36
  // Golden source:
37
37
  // - cli/parser.py:131-150 registers `profile {init,doctor,show}`:
38
- // * init NAME --workspace . --team TEAM --auth-mode choices(sorted AUTH_MODES) --json
38
+ // * init NAME --workspace . --team TEAM --auth-mode choices(sorted AUTH_MODES) --proxy-mode direct|inherit --json
39
39
  // * doctor NAME --workspace . --team TEAM --json
40
40
  // * show NAME --workspace . --team TEAM --json
41
41
  // - cli/commands.py:47-67 resolves scope then delegates to profiles.init_profile/
@@ -52,7 +52,7 @@ fn seed_official_api_profile(ws: &std::path::Path) {
52
52
  // PYTHONPATH=/Users/alauda/Documents/code/team-agent-public/src \
53
53
  // python3 /tmp/probe_profile_cli.py
54
54
  // profile init codex_sub --auth-mode subscription --json rc=0 and creates:
55
- // codex_sub.env = "AUTH_MODE=subscription\nPROFILE_NAME=codex_sub\n" (mode 0600),
55
+ // codex_sub.env = "AUTH_MODE=subscription\nPROFILE_NAME=codex_sub\nPROXY_MODE=inherit\n" (mode 0600),
56
56
  // codex_sub.example.env with same body, plus AGENTS.md/CLAUDE.md secret boundary files.
57
57
  #[test]
58
58
  fn profile_init_routes_and_creates_secret_boundary_files() {
@@ -87,12 +87,12 @@ fn profile_init_routes_and_creates_secret_boundary_files() {
87
87
  );
88
88
  assert_eq!(
89
89
  std::fs::read_to_string(dir.join("codex_sub.env")).unwrap(),
90
- "AUTH_MODE=subscription\nPROFILE_NAME=codex_sub\n",
90
+ "AUTH_MODE=subscription\nPROFILE_NAME=codex_sub\nPROXY_MODE=inherit\n",
91
91
  "subscription profile template body must match golden"
92
92
  );
93
93
  assert_eq!(
94
94
  std::fs::read_to_string(dir.join("codex_sub.example.env")).unwrap(),
95
- "AUTH_MODE=subscription\nPROFILE_NAME=codex_sub\n",
95
+ "AUTH_MODE=subscription\nPROFILE_NAME=codex_sub\nPROXY_MODE=inherit\n",
96
96
  "subscription example template body must match golden"
97
97
  );
98
98
 
@@ -116,7 +116,7 @@ fn profile_init_routes_and_creates_secret_boundary_files() {
116
116
  );
117
117
  assert_eq!(
118
118
  std::fs::read_to_string(dir.join("codex_sub.env")).unwrap(),
119
- "AUTH_MODE=subscription\nPROFILE_NAME=codex_sub\n",
119
+ "AUTH_MODE=subscription\nPROFILE_NAME=codex_sub\nPROXY_MODE=inherit\n",
120
120
  "idempotent init must not rewrite existing profile bytes"
121
121
  );
122
122
  let _ = std::fs::remove_dir_all(&ws);
@@ -145,7 +145,7 @@ fn compatible_api_profile_init_template_contains_common_five_fields() {
145
145
  );
146
146
 
147
147
  let expected =
148
- "AUTH_MODE=compatible_api\nPROFILE_NAME=compat\nBASE_URL=\nAPI_KEY=\nMODEL=\n";
148
+ "AUTH_MODE=compatible_api\nPROFILE_NAME=compat\nPROXY_MODE=inherit\nBASE_URL=\nAPI_KEY=\nMODEL=\n";
149
149
  let dir = profiles_dir(&ws);
150
150
  assert_eq!(
151
151
  std::fs::read_to_string(dir.join("compat.env")).unwrap(),
@@ -160,6 +160,81 @@ fn compatible_api_profile_init_template_contains_common_five_fields() {
160
160
  let _ = std::fs::remove_dir_all(&ws);
161
161
  }
162
162
 
163
+ #[test]
164
+ fn profile_init_accepts_local_proxy_mode_and_rejects_unknown_values() {
165
+ let ws = tmp_workspace();
166
+ let direct = run(
167
+ &profile_argv(&[
168
+ "profile",
169
+ "init",
170
+ "cursor_sub",
171
+ "--workspace",
172
+ ".",
173
+ "--auth-mode",
174
+ "subscription",
175
+ "--proxy-mode=direct",
176
+ "--json",
177
+ ]),
178
+ &ws,
179
+ );
180
+ assert_eq!(direct, ExitCode::Ok, "direct proxy mode must be accepted");
181
+ let body = std::fs::read_to_string(profiles_dir(&ws).join("cursor_sub.env")).unwrap();
182
+ assert!(body.contains("PROXY_MODE=direct\n"));
183
+
184
+ let invalid = run(
185
+ &profile_argv(&[
186
+ "profile",
187
+ "init",
188
+ "bad_proxy",
189
+ "--workspace",
190
+ ".",
191
+ "--proxy-mode",
192
+ "sideways",
193
+ "--json",
194
+ ]),
195
+ &ws,
196
+ );
197
+ assert_eq!(invalid, ExitCode::Error, "unknown proxy mode must fail");
198
+ let _ = std::fs::remove_dir_all(&ws);
199
+ }
200
+
201
+ #[test]
202
+ fn profile_init_existing_profile_reports_actual_mode_and_show_matches() {
203
+ let ws = tmp_workspace();
204
+ let make_args = |command: &str, mode: Option<&str>| ProfileArgs {
205
+ command: command.to_string(),
206
+ name: "cursor_sub".to_string(),
207
+ workspace: ws.clone(),
208
+ team: None,
209
+ auth_mode: Some("subscription".to_string()),
210
+ proxy_mode: mode.map(str::to_string),
211
+ json: true,
212
+ };
213
+ let first = cmd_profile(&make_args("init", Some("direct"))).unwrap();
214
+ let first = match first.output {
215
+ CmdOutput::Json(value) => value,
216
+ other => panic!("expected json output, got {other:?}"),
217
+ };
218
+ assert_eq!(first["proxy_mode"], "direct");
219
+ assert_eq!(first["proxy_mode_changed"], true);
220
+
221
+ let repeat = cmd_profile(&make_args("init", Some("inherit"))).unwrap();
222
+ let repeat = match repeat.output {
223
+ CmdOutput::Json(value) => value,
224
+ other => panic!("expected json output, got {other:?}"),
225
+ };
226
+ assert_eq!(repeat["proxy_mode"], "direct");
227
+ assert_eq!(repeat["proxy_mode_changed"], false);
228
+
229
+ let shown = cmd_profile(&make_args("show", None)).unwrap();
230
+ let shown = match shown.output {
231
+ CmdOutput::Json(value) => value,
232
+ other => panic!("expected json output, got {other:?}"),
233
+ };
234
+ assert_eq!(shown["proxy_mode"], "direct");
235
+ let _ = std::fs::remove_dir_all(&ws);
236
+ }
237
+
163
238
  // Golden source:
164
239
  // - profiles/core.py:95-119 doctor_profile returns ok=true for existing profiles and
165
240
  // ok=false for missing profiles; parser.py:506-508 maps result.ok false to exit 1.
@@ -667,6 +667,7 @@ pub struct ProfileArgs {
667
667
  pub workspace: PathBuf,
668
668
  pub team: Option<String>,
669
669
  pub auth_mode: Option<String>,
670
+ pub proxy_mode: Option<String>,
670
671
  pub json: bool,
671
672
  }
672
673