@team-agent/installer 0.3.2 → 0.3.4
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 +34 -1
- package/Cargo.toml +1 -1
- package/crates/team-agent/Cargo.toml +1 -1
- package/crates/team-agent/src/cli/adapters.rs +196 -19
- package/crates/team-agent/src/cli/diagnose.rs +145 -11
- package/crates/team-agent/src/cli/emit.rs +287 -53
- package/crates/team-agent/src/cli/leader.rs +37 -8
- package/crates/team-agent/src/cli/mod.rs +807 -316
- package/crates/team-agent/src/cli/status_port.rs +25 -2
- package/crates/team-agent/src/cli/tests/divergence.rs +1 -2
- package/crates/team-agent/src/cli/tests/lane_c.rs +23 -13
- package/crates/team-agent/src/cli/tests/main_preserved.rs +2 -0
- package/crates/team-agent/src/cli/tests/run_delegation.rs +57 -3
- package/crates/team-agent/src/cli/types.rs +17 -0
- package/crates/team-agent/src/compiler/tests.rs +2 -2
- package/crates/team-agent/src/compiler.rs +16 -6
- package/crates/team-agent/src/coordinator/health.rs +89 -20
- package/crates/team-agent/src/coordinator/mod.rs +4 -0
- package/crates/team-agent/src/coordinator/runtime_detectors.rs +500 -0
- package/crates/team-agent/src/coordinator/runtime_observation.rs +58 -0
- package/crates/team-agent/src/coordinator/tests/watch.rs +4 -2
- package/crates/team-agent/src/coordinator/tick.rs +222 -69
- package/crates/team-agent/src/coordinator/types.rs +15 -3
- package/crates/team-agent/src/db/schema.rs +37 -2
- package/crates/team-agent/src/diagnose/comms.rs +226 -0
- package/crates/team-agent/src/diagnose/mod.rs +45 -0
- package/crates/team-agent/src/diagnose/orphans.rs +658 -0
- package/crates/team-agent/src/fake_worker.rs +146 -3
- package/crates/team-agent/src/leader/start.rs +121 -23
- package/crates/team-agent/src/leader/types.rs +44 -1
- package/crates/team-agent/src/lib.rs +3 -0
- package/crates/team-agent/src/lifecycle/display.rs +648 -50
- package/crates/team-agent/src/lifecycle/launch.rs +1048 -264
- package/crates/team-agent/src/lifecycle/mod.rs +3 -0
- package/crates/team-agent/src/lifecycle/profile_launch.rs +810 -0
- package/crates/team-agent/src/lifecycle/profile_smoke.rs +522 -0
- package/crates/team-agent/src/lifecycle/restart/agent.rs +113 -26
- package/crates/team-agent/src/lifecycle/restart/common.rs +189 -102
- package/crates/team-agent/src/lifecycle/restart/rebuild.rs +465 -25
- package/crates/team-agent/src/lifecycle/restart/remove.rs +22 -6
- package/crates/team-agent/src/lifecycle/restart/team_state.rs +19 -0
- package/crates/team-agent/src/lifecycle/restart.rs +4 -1
- package/crates/team-agent/src/lifecycle/tests/core.rs +4 -4
- package/crates/team-agent/src/lifecycle/tests/lane_ops.rs +5 -5
- package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +39 -9
- package/crates/team-agent/src/lifecycle/types.rs +23 -0
- package/crates/team-agent/src/lifecycle/worker_command_context.rs +326 -0
- package/crates/team-agent/src/mcp_server/helpers.rs +1 -0
- package/crates/team-agent/src/mcp_server/lifecycle_tools/agent_ops.rs +341 -0
- package/crates/team-agent/src/mcp_server/lifecycle_tools/mod.rs +10 -0
- package/crates/team-agent/src/mcp_server/lifecycle_tools/state_status.rs +158 -0
- package/crates/team-agent/src/mcp_server/mod.rs +3 -74
- package/crates/team-agent/src/mcp_server/tests/scoped.rs +1 -1
- package/crates/team-agent/src/mcp_server/tests/send.rs +6 -5
- package/crates/team-agent/src/mcp_server/tools.rs +312 -111
- package/crates/team-agent/src/mcp_server/types.rs +6 -4
- package/crates/team-agent/src/mcp_server/wire.rs +19 -7
- package/crates/team-agent/src/message_store.rs +21 -4
- package/crates/team-agent/src/messaging/delivery.rs +87 -37
- package/crates/team-agent/src/messaging/mod.rs +9 -6
- package/crates/team-agent/src/messaging/results.rs +153 -16
- package/crates/team-agent/src/messaging/selftest.rs +199 -12
- package/crates/team-agent/src/messaging/send.rs +35 -3
- package/crates/team-agent/src/messaging/tests/runtime.rs +19 -4
- package/crates/team-agent/src/messaging/types.rs +11 -3
- package/crates/team-agent/src/os_probe.rs +119 -0
- package/crates/team-agent/src/packaging/migrate.rs +10 -2
- package/crates/team-agent/src/packaging/tests.rs +23 -0
- package/crates/team-agent/src/provider/adapter.rs +483 -67
- package/crates/team-agent/src/provider/approvals/runtime_prompts.rs +1 -7
- package/crates/team-agent/src/provider/classify.rs +51 -4
- package/crates/team-agent/src/provider/startup_prompt.rs +94 -0
- package/crates/team-agent/src/provider/types.rs +47 -0
- package/crates/team-agent/src/session_capture.rs +616 -0
- package/crates/team-agent/src/state/persist.rs +57 -0
- package/crates/team-agent/src/state/projection.rs +32 -23
- package/crates/team-agent/src/state/selector.rs +5 -2
- package/crates/team-agent/src/tmux_backend.rs +151 -60
- package/crates/team-agent/src/transport/test_support.rs +9 -0
- package/crates/team-agent/src/transport/tests/wire.rs +4 -0
- package/crates/team-agent/src/transport.rs +13 -2
- package/package.json +4 -4
|
@@ -47,21 +47,48 @@ pub fn leader_launcher_args(values: &[String]) -> Result<LeaderLauncherArgs, Cli
|
|
|
47
47
|
Ok(out)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
fn leader_launcher_json(values: &[String]) -> bool {
|
|
51
|
+
values
|
|
52
|
+
.iter()
|
|
53
|
+
.take_while(|arg| arg.as_str() != "--")
|
|
54
|
+
.any(|arg| arg == "--json")
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
fn without_leader_json(values: &[String]) -> Vec<String> {
|
|
58
|
+
let mut out = Vec::with_capacity(values.len());
|
|
59
|
+
let mut provider_remainder = false;
|
|
60
|
+
for value in values {
|
|
61
|
+
if provider_remainder || value != "--json" {
|
|
62
|
+
out.push(value.clone());
|
|
63
|
+
}
|
|
64
|
+
if value == "--" {
|
|
65
|
+
provider_remainder = true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
out
|
|
69
|
+
}
|
|
70
|
+
|
|
50
71
|
/// `codex`/`claude` passthrough(`parser.py:86`/`_run_leader_passthrough`):leader 早返回,
|
|
51
72
|
/// **不**进 subparser。`-h`/`--help` 打 usage 直接返回 [`CmdResult::none`]。否则解析 attach
|
|
52
|
-
/// 旗标 + `lifecycle_port::start_leader`。`command` ∈ {codex,
|
|
53
|
-
pub fn cmd_leader_passthrough(
|
|
73
|
+
/// 旗标 + `lifecycle_port::start_leader`。`command` ∈ {codex, claude}。
|
|
74
|
+
pub fn cmd_leader_passthrough(
|
|
75
|
+
command: &str,
|
|
76
|
+
provider_args: &[String],
|
|
77
|
+
cwd: &Path,
|
|
78
|
+
) -> Result<CmdResult, CliError> {
|
|
54
79
|
if provider_args == ["-h"] || provider_args == ["--help"] {
|
|
55
80
|
return Ok(CmdResult::none());
|
|
56
81
|
}
|
|
57
|
-
let
|
|
82
|
+
let as_json = leader_launcher_json(provider_args);
|
|
83
|
+
let launcher_args = without_leader_json(provider_args);
|
|
84
|
+
let attach = leader_launcher_args(&launcher_args)?;
|
|
58
85
|
let provider = if command == "codex" {
|
|
59
86
|
crate::model::enums::Provider::Codex
|
|
60
87
|
} else {
|
|
61
88
|
crate::model::enums::Provider::ClaudeCode
|
|
62
89
|
};
|
|
63
90
|
let value = lifecycle_port::start_leader(provider, &attach.provider_args, cwd, &attach)?;
|
|
64
|
-
Ok(CmdResult::from_json(value,
|
|
91
|
+
Ok(CmdResult::from_json(value, as_json))
|
|
65
92
|
}
|
|
66
93
|
|
|
67
94
|
// =============================================================================
|
|
@@ -143,7 +170,11 @@ fn parse_inbox_entries(text: impl AsRef<str>) -> Vec<String> {
|
|
|
143
170
|
}
|
|
144
171
|
|
|
145
172
|
fn render_inbox_summary(entries: &[String], budget: usize) -> String {
|
|
146
|
-
let noun = if entries.len() == 1 {
|
|
173
|
+
let noun = if entries.len() == 1 {
|
|
174
|
+
"entry"
|
|
175
|
+
} else {
|
|
176
|
+
"entries"
|
|
177
|
+
};
|
|
147
178
|
let header = format!("Leader inbox: {} new fallback {noun}", entries.len());
|
|
148
179
|
let hint = "Hint: team-agent inbox leader";
|
|
149
180
|
let footer = "Truncated: more fallback entries available; run team-agent inbox leader";
|
|
@@ -173,9 +204,7 @@ fn render_inbox_summary(entries: &[String], budget: usize) -> String {
|
|
|
173
204
|
};
|
|
174
205
|
if char_len(&summary) > budget {
|
|
175
206
|
let keep = budget.saturating_sub(char_len(footer)).saturating_sub(6);
|
|
176
|
-
let body = prefix_chars(&lines.join("\n"), keep)
|
|
177
|
-
.trim_end()
|
|
178
|
-
.to_string();
|
|
207
|
+
let body = prefix_chars(&lines.join("\n"), keep).trim_end().to_string();
|
|
179
208
|
summary = format!("{body} ...\n{footer}");
|
|
180
209
|
}
|
|
181
210
|
summary
|