@team-agent/installer 0.5.74 → 0.5.77

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 (45) 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 +23 -96
  6. package/crates/team-agent/src/cli/emit.rs +35 -7
  7. package/crates/team-agent/src/cli/mod.rs +63 -42
  8. package/crates/team-agent/src/cli/models.rs +138 -27
  9. package/crates/team-agent/src/cli/status_port/brief.rs +1137 -0
  10. package/crates/team-agent/src/cli/status_port.rs +8 -0
  11. package/crates/team-agent/src/cli/tests/mod.rs +1 -0
  12. package/crates/team-agent/src/cli/tests/run_delegation.rs +29 -24
  13. package/crates/team-agent/src/cli/tests/status_brief.rs +691 -0
  14. package/crates/team-agent/src/cli/tests/status_send.rs +8 -2
  15. package/crates/team-agent/src/layout/worker_env.rs +366 -0
  16. package/crates/team-agent/src/leader/lease.rs +274 -40
  17. package/crates/team-agent/src/leader/registry.rs +177 -19
  18. package/crates/team-agent/src/leader/types.rs +4 -0
  19. package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +93 -5
  20. package/crates/team-agent/src/lifecycle/launch/quick_start.rs +1820 -60
  21. package/crates/team-agent/src/lifecycle/launch/spawn.rs +4 -0
  22. package/crates/team-agent/src/lifecycle/launch/spec_state.rs +138 -13
  23. package/crates/team-agent/src/lifecycle/restart/common.rs +3 -0
  24. package/crates/team-agent/src/lifecycle/restart/rebuild.rs +11 -4
  25. package/crates/team-agent/src/lifecycle/tests/b0_reader_hideone_audit_contract.rs +45 -14
  26. package/crates/team-agent/src/lifecycle/tests/clone_agent_preserves_source_tools.rs +1 -0
  27. package/crates/team-agent/src/lifecycle/tests/harvest2_a_batch_red.rs +1 -1
  28. package/crates/team-agent/src/lifecycle/tests/phase_golden.rs +24 -28
  29. package/crates/team-agent/src/lifecycle/tests/upgrade_compat_0211_red.rs +22 -10
  30. package/crates/team-agent/src/lifecycle/tests/worker_spawn_env_red.rs +110 -31
  31. package/crates/team-agent/src/lifecycle/types.rs +4 -0
  32. package/crates/team-agent/src/messaging/delivery.rs +200 -29
  33. package/crates/team-agent/src/messaging/leader_channel.rs +12 -3
  34. package/crates/team-agent/src/messaging/watchers.rs +48 -4
  35. package/crates/team-agent/src/state/paths.rs +17 -2
  36. package/crates/team-agent/src/state/persist.rs +166 -6
  37. package/crates/team-agent/src/state/projection.rs +18 -2
  38. package/crates/team-agent/src/state/repository.rs +36 -0
  39. package/crates/team-agent/src/state/selector.rs +23 -3
  40. package/crates/team-agent/src/test_support/models_timeout_fixture.rs +122 -0
  41. package/crates/team-agent/src/tmux_backend/tests.rs +350 -7
  42. package/crates/team-agent/src/tmux_backend.rs +217 -26
  43. package/crates/team-agent/src/transport/test_support.rs +18 -3
  44. package/crates/team-agent/src/transport.rs +99 -0
  45. package/package.json +4 -4
@@ -34,6 +34,14 @@ use store::{
34
34
  mod compact;
35
35
  pub(super) use compact::*;
36
36
 
37
+ mod brief;
38
+ pub(crate) use brief::{format_status_brief, registered_agent_exists, status_brief_scoped};
39
+ #[cfg(test)]
40
+ pub(crate) use brief::{
41
+ with_test_nodeprobe, with_test_nodeprobe_candidates, with_test_nodeprobe_resolver_delay,
42
+ with_test_nodeprobe_unbound, ResolverDelaySignal,
43
+ };
44
+
37
45
  mod runtime;
38
46
  pub(super) use runtime::*;
39
47
 
@@ -133,6 +133,7 @@ mod named_address;
133
133
  mod peer_allow;
134
134
  mod run_delegation;
135
135
  mod shutdown_kill_plan;
136
+ mod status_brief;
136
137
  mod status_send;
137
138
  mod verb_install_skill;
138
139
  mod verb_profile;
@@ -335,13 +335,12 @@ fn cli_add_agent_duplicate_id_surfaces_real_error() {
335
335
  );
336
336
  }
337
337
 
338
- // 5 [P1] — cmd_status --json reflects the REAL coordinator_health + real DB message/result counts.
339
- // The placeholder status_port::status hardcodes coordinator={status:stopped, schema_ok:false} and
340
- // messages/results={count:0}. Seed: state.json + a real team.db (2 messages + 1 result) + a healthy
341
- // coordinator (this pid + metadata) -> the real path must surface running-coordinator + non-zero
342
- // counts. OS-safe (all reads/seeds, no spawn).
338
+ // 5 [P1] — cmd_status --json emits the concise seven-field node projection.
339
+ // Status must not leak coordinator/db/history diagnostics; missing exact nodeprobe evidence remains
340
+ // an explicit unknown projection. The fixture still seeds a real store to ensure the status path
341
+ // does not accidentally depend on coordinator or mailbox reads.
343
342
  #[test]
344
- fn cli_status_reflects_real_coordinator_health_and_db_counts() {
343
+ fn cli_status_emits_seven_field_brief_without_diagnostics() {
345
344
  let ws = seed_status_workspace(); // writes .team/runtime/state.json
346
345
  let store = crate::message_store::MessageStore::open(&ws).unwrap();
347
346
  let _ = store
@@ -386,25 +385,31 @@ fn cli_status_reflects_real_coordinator_health_and_db_counts() {
386
385
  CmdOutput::Json(v) => v,
387
386
  other => panic!("status --json must yield a Json CmdOutput; got {other:?}"),
388
387
  };
389
- assert_ne!(
390
- value["coordinator"],
391
- json!({"status": "stopped", "schema_ok": false}),
392
- "status `coordinator` must reflect the REAL coordinator_health (seeded running), not the \
393
- placeholder's hardcoded {{status:stopped, schema_ok:false}}; got {}",
394
- value["coordinator"]
388
+ let nodes = value
389
+ .get("nodes")
390
+ .and_then(serde_json::Value::as_array)
391
+ .expect("status brief must expose a nodes array");
392
+ assert_eq!(nodes.len(), 1);
393
+ let fields: std::collections::BTreeSet<&str> = nodes[0]
394
+ .as_object()
395
+ .expect("status brief node must be an object")
396
+ .keys()
397
+ .map(String::as_str)
398
+ .collect();
399
+ assert_eq!(
400
+ fields,
401
+ [
402
+ "name",
403
+ "provider",
404
+ "runtime_status",
405
+ "activity",
406
+ "health",
407
+ "session_name",
408
+ "tmux_command",
409
+ ]
410
+ .into_iter()
411
+ .collect()
395
412
  );
396
- assert_ne!(
397
- value["messages"],
398
- json!({"count": 0}),
399
- "status `messages` must reflect the REAL DB rows (2 seeded), not the placeholder's {{count:0}}; got {}",
400
- value["messages"]
401
- );
402
- assert_ne!(
403
- value["results"],
404
- json!({"count": 0}),
405
- "status `results` must reflect the REAL DB result row, not the placeholder's {{count:0}}; got {}",
406
- value["results"]
407
- );
408
413
  }
409
414
 
410
415
  // 6 [P1] — cmd_shutdown delegates to the REAL crate::coordinator::stop_coordinator (+ tmux