@team-agent/installer 0.5.42 → 0.5.44
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 +129 -54
- package/crates/team-agent/src/cli/diagnose.rs +1 -2
- package/crates/team-agent/src/cli/emit.rs +1 -7
- package/crates/team-agent/src/cli/helpers.rs +3 -1
- package/crates/team-agent/src/cli/leader.rs +2 -1
- package/crates/team-agent/src/cli/mod.rs +126 -16
- package/crates/team-agent/src/cli/named_address.rs +14 -5
- package/crates/team-agent/src/cli/profile.rs +19 -7
- package/crates/team-agent/src/cli/send.rs +9 -3
- package/crates/team-agent/src/cli/status.rs +8 -30
- package/crates/team-agent/src/cli/status_port.rs +1341 -1272
- package/crates/team-agent/src/cli/tests/base.rs +738 -660
- package/crates/team-agent/src/cli/tests/compile.rs +45 -18
- package/crates/team-agent/src/cli/tests/divergence.rs +462 -444
- package/crates/team-agent/src/cli/tests/lane_c.rs +365 -282
- package/crates/team-agent/src/cli/tests/leader_watch.rs +356 -329
- package/crates/team-agent/src/cli/tests/main_preserved.rs +672 -564
- package/crates/team-agent/src/cli/tests/missing_subcommands.rs +284 -224
- package/crates/team-agent/src/cli/tests/mod.rs +17 -7
- package/crates/team-agent/src/cli/tests/named_address.rs +8 -2
- package/crates/team-agent/src/cli/tests/peer_allow.rs +10 -2
- package/crates/team-agent/src/cli/tests/run_delegation.rs +314 -273
- package/crates/team-agent/src/cli/tests/shutdown_kill_plan.rs +26 -15
- package/crates/team-agent/src/cli/tests/status_send.rs +707 -629
- package/crates/team-agent/src/cli/tests/verb_install_skill.rs +20 -4
- package/crates/team-agent/src/cli/tests/verb_profile.rs +46 -17
- package/crates/team-agent/src/cli/tests/verb_validate.rs +15 -3
- package/crates/team-agent/src/codex_app_server.rs +2 -5
- package/crates/team-agent/src/compiler/tests.rs +139 -33
- package/crates/team-agent/src/compiler.rs +55 -22
- package/crates/team-agent/src/conpty/backend.rs +23 -33
- package/crates/team-agent/src/coordinator/backoff.rs +2 -7
- package/crates/team-agent/src/coordinator/conpty_shim.rs +55 -67
- package/crates/team-agent/src/coordinator/health.rs +46 -31
- package/crates/team-agent/src/coordinator/mod.rs +3 -3
- package/crates/team-agent/src/coordinator/orphan.rs +22 -10
- package/crates/team-agent/src/coordinator/steps/abnormal.rs +51 -56
- package/crates/team-agent/src/coordinator/tests/abnormal.rs +55 -19
- package/crates/team-agent/src/coordinator/tests/basics.rs +179 -41
- package/crates/team-agent/src/coordinator/tests/daemon.rs +53 -13
- package/crates/team-agent/src/coordinator/tests/health_sync.rs +78 -19
- package/crates/team-agent/src/coordinator/tests/main_preserved.rs +61 -11
- package/crates/team-agent/src/coordinator/tests/mod.rs +33 -39
- package/crates/team-agent/src/coordinator/tests/spine.rs +52 -12
- package/crates/team-agent/src/coordinator/tests/takeover.rs +73 -15
- package/crates/team-agent/src/coordinator/tests/tick_core.rs +50 -15
- package/crates/team-agent/src/coordinator/tests/watch.rs +74 -20
- package/crates/team-agent/src/db/message_store.rs +138 -30
- package/crates/team-agent/src/db/migration.rs +249 -61
- package/crates/team-agent/src/db/schema.rs +303 -82
- package/crates/team-agent/src/diagnose/comms.rs +9 -2
- package/crates/team-agent/src/diagnose/mod.rs +1 -3
- package/crates/team-agent/src/diagnose/orphans.rs +79 -61
- package/crates/team-agent/src/event_log.rs +70 -16
- package/crates/team-agent/src/layout/manager.rs +15 -4
- package/crates/team-agent/src/layout/mod.rs +4 -4
- package/crates/team-agent/src/layout/overlay.rs +10 -3
- package/crates/team-agent/src/layout/placement.rs +5 -1
- package/crates/team-agent/src/layout/recovery.rs +4 -2
- package/crates/team-agent/src/layout/runtime_sessions.rs +7 -7
- package/crates/team-agent/src/layout/sessions.rs +17 -9
- package/crates/team-agent/src/layout/tmux_endpoint.rs +1 -1
- package/crates/team-agent/src/layout/worker_env.rs +87 -19
- package/crates/team-agent/src/leader/helpers.rs +7 -1
- package/crates/team-agent/src/leader/lease.rs +199 -89
- package/crates/team-agent/src/leader/owner_bind.rs +55 -22
- package/crates/team-agent/src/leader/provider_attribution.rs +25 -6
- package/crates/team-agent/src/leader/rediscover/tests.rs +88 -24
- package/crates/team-agent/src/leader/rediscover.rs +74 -25
- package/crates/team-agent/src/leader/registry.rs +1 -1
- package/crates/team-agent/src/leader/start.rs +75 -54
- package/crates/team-agent/src/leader/takeover.rs +46 -11
- package/crates/team-agent/src/leader/tests/basics.rs +320 -167
- package/crates/team-agent/src/leader/tests/byte_findings.rs +361 -219
- package/crates/team-agent/src/leader/tests/identity.rs +428 -356
- package/crates/team-agent/src/leader/tests/idle.rs +285 -254
- package/crates/team-agent/src/leader/tests/lease_api.rs +338 -274
- package/crates/team-agent/src/leader/tests/lease_claim.rs +643 -593
- package/crates/team-agent/src/leader/tests/mod.rs +115 -99
- package/crates/team-agent/src/leader/tests/rediscover.rs +74 -22
- package/crates/team-agent/src/leader/tests/wake_start_owner.rs +237 -211
- package/crates/team-agent/src/lib.rs +4 -4
- package/crates/team-agent/src/lifecycle/display.rs +7 -3
- package/crates/team-agent/src/lifecycle/launch.rs +55 -15
- package/crates/team-agent/src/lifecycle/mod.rs +9 -1
- package/crates/team-agent/src/lifecycle/profile_launch.rs +77 -34
- package/crates/team-agent/src/lifecycle/profile_smoke.rs +3 -1
- package/crates/team-agent/src/lifecycle/restart/agent.rs +1 -6
- package/crates/team-agent/src/lifecycle/restart/common.rs +6 -2
- package/crates/team-agent/src/lifecycle/restart/orchestrator.rs +1 -4
- package/crates/team-agent/src/lifecycle/restart/preflight.rs +6 -5
- package/crates/team-agent/src/lifecycle/restart/rebuild.rs +26 -22
- package/crates/team-agent/src/lifecycle/restart/remove.rs +45 -35
- package/crates/team-agent/src/lifecycle/restart/team_state.rs +63 -17
- package/crates/team-agent/src/lifecycle/tests/agent_ops.rs +251 -84
- package/crates/team-agent/src/lifecycle/tests/lane_ops.rs +198 -48
- package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +2 -1
- package/crates/team-agent/src/lifecycle/tests/main_preserved.rs +152 -32
- package/crates/team-agent/src/lifecycle/tests/phase_b_contracts.rs +1 -5
- package/crates/team-agent/src/lifecycle/tests/phase_golden.rs +3 -0
- package/crates/team-agent/src/lifecycle/tests.rs +2 -2
- package/crates/team-agent/src/main.rs +4 -4
- package/crates/team-agent/src/mcp_server/lifecycle_tools/agent_ops.rs +47 -20
- package/crates/team-agent/src/mcp_server/mod.rs +11 -2
- package/crates/team-agent/src/mcp_server/types.rs +14 -3
- package/crates/team-agent/src/mcp_server/wire.rs +230 -68
- package/crates/team-agent/src/messaging/delivery.rs +20 -18
- package/crates/team-agent/src/messaging/helpers.rs +25 -4
- package/crates/team-agent/src/messaging/leader_receiver.rs +4 -5
- package/crates/team-agent/src/messaging/mod.rs +2 -3
- package/crates/team-agent/src/messaging/selftest.rs +46 -26
- package/crates/team-agent/src/messaging/tests/main_preserved.rs +47 -12
- package/crates/team-agent/src/messaging/tests/runtime.rs +57 -22
- package/crates/team-agent/src/messaging/tests/spine.rs +154 -40
- package/crates/team-agent/src/messaging/tests/wave2.rs +31 -32
- package/crates/team-agent/src/messaging/trust.rs +25 -2
- package/crates/team-agent/src/messaging/watchers.rs +37 -9
- package/crates/team-agent/src/model/enums.rs +65 -16
- package/crates/team-agent/src/model/ids.rs +12 -3
- package/crates/team-agent/src/model/paths.rs +28 -7
- package/crates/team-agent/src/model/permissions.rs +176 -33
- package/crates/team-agent/src/model/routing.rs +66 -20
- package/crates/team-agent/src/model/spec.rs +365 -69
- package/crates/team-agent/src/model/task_graph.rs +36 -9
- package/crates/team-agent/src/model/yaml/tests.rs +24 -6
- package/crates/team-agent/src/model/yaml.rs +7 -6
- package/crates/team-agent/src/packaging/install.rs +23 -9
- package/crates/team-agent/src/packaging/migrate.rs +5 -7
- package/crates/team-agent/src/packaging/mod.rs +9 -1
- package/crates/team-agent/src/packaging/repair.rs +13 -6
- package/crates/team-agent/src/packaging/tests.rs +63 -16
- package/crates/team-agent/src/packaging/types.rs +22 -7
- package/crates/team-agent/src/platform/argv.rs +4 -1
- package/crates/team-agent/src/platform/file_lock.rs +22 -8
- package/crates/team-agent/src/platform/process.rs +54 -24
- package/crates/team-agent/src/provider/adapters/claude.rs +1 -3
- package/crates/team-agent/src/provider/approvals/parsing.rs +134 -26
- package/crates/team-agent/src/provider/approvals/runtime_prompts.rs +13 -3
- package/crates/team-agent/src/provider/classify.rs +127 -42
- package/crates/team-agent/src/provider/faults.rs +17 -5
- package/crates/team-agent/src/provider/helpers.rs +6 -5
- package/crates/team-agent/src/provider/startup_prompt.rs +75 -27
- package/crates/team-agent/src/state/persist.rs +28 -0
- package/crates/team-agent/src/state/repository.rs +8 -3
- package/crates/team-agent/src/tmux_backend/tests.rs +1637 -1398
- package/crates/team-agent/src/tmux_backend.rs +80 -44
- package/crates/team-agent/src/topology.rs +40 -20
- package/crates/team-agent/src/transport/test_support.rs +20 -23
- package/crates/team-agent/src/transport/tests/behavior.rs +292 -293
- package/crates/team-agent/src/transport/tests/mod.rs +178 -187
- package/crates/team-agent/src/transport/tests/wire.rs +561 -525
- package/crates/team-agent/src/transport.rs +12 -17
- package/crates/team-agent/src/transport_factory.rs +29 -14
- package/package.json +4 -4
|
@@ -34,11 +34,17 @@ fn init_profile(args: &ProfileArgs) -> Result<Value, CliError> {
|
|
|
34
34
|
let mut obj = Map::new();
|
|
35
35
|
obj.insert("ok".to_string(), Value::Bool(true));
|
|
36
36
|
obj.insert("profile".to_string(), Value::String(args.name.clone()));
|
|
37
|
-
obj.insert(
|
|
37
|
+
obj.insert(
|
|
38
|
+
"auth_mode".to_string(),
|
|
39
|
+
Value::String(auth_mode.to_string()),
|
|
40
|
+
);
|
|
38
41
|
obj.insert("path".to_string(), path_value(&path));
|
|
39
42
|
obj.insert("template_path".to_string(), path_value(&template_path));
|
|
40
43
|
obj.insert("created_profile".to_string(), Value::Bool(created_profile));
|
|
41
|
-
obj.insert(
|
|
44
|
+
obj.insert(
|
|
45
|
+
"created_template".to_string(),
|
|
46
|
+
Value::Bool(created_template),
|
|
47
|
+
);
|
|
42
48
|
obj.insert("secret_written".to_string(), Value::Bool(created_profile));
|
|
43
49
|
obj.insert(
|
|
44
50
|
"safe_inspection_command".to_string(),
|
|
@@ -116,7 +122,10 @@ fn show_profile(args: &ProfileArgs) -> Result<Value, CliError> {
|
|
|
116
122
|
);
|
|
117
123
|
obj.insert("auth_mode".to_string(), Value::String(auth_mode));
|
|
118
124
|
obj.insert("values".to_string(), redacted_values(&values));
|
|
119
|
-
obj.insert(
|
|
125
|
+
obj.insert(
|
|
126
|
+
"keys_present".to_string(),
|
|
127
|
+
string_array(sorted_keys(&values)),
|
|
128
|
+
);
|
|
120
129
|
obj.insert("secret_keys_present".to_string(), string_array(secret_keys));
|
|
121
130
|
obj.insert("missing_common".to_string(), string_array(missing_common));
|
|
122
131
|
obj.insert("safe_for_agent_context".to_string(), Value::Bool(true));
|
|
@@ -134,7 +143,10 @@ fn show_profile(args: &ProfileArgs) -> Result<Value, CliError> {
|
|
|
134
143
|
|
|
135
144
|
fn profile_dir(args: &ProfileArgs) -> PathBuf {
|
|
136
145
|
let _ = &args.team;
|
|
137
|
-
args.workspace
|
|
146
|
+
args.workspace
|
|
147
|
+
.join(".team")
|
|
148
|
+
.join("current")
|
|
149
|
+
.join("profiles")
|
|
138
150
|
}
|
|
139
151
|
|
|
140
152
|
fn validate_auth_mode(auth_mode: &str) -> Result<(), CliError> {
|
|
@@ -274,9 +286,9 @@ fn secret_keys_present(values: &Map<String, Value>) -> Vec<String> {
|
|
|
274
286
|
}
|
|
275
287
|
|
|
276
288
|
fn credential_present(values: &Map<String, Value>) -> bool {
|
|
277
|
-
values
|
|
278
|
-
|
|
279
|
-
|
|
289
|
+
values
|
|
290
|
+
.iter()
|
|
291
|
+
.any(|(key, value)| is_secret_key(key) && value.as_str().is_some_and(|raw| !raw.is_empty()))
|
|
280
292
|
}
|
|
281
293
|
|
|
282
294
|
fn missing_common_keys(values: &Map<String, Value>, auth_mode: &str) -> Vec<String> {
|
|
@@ -375,9 +375,15 @@ fn coordinator_health_status_wire(
|
|
|
375
375
|
/// F1 (0.3.26): direct pane-id send — bypasses agent-name routing + team
|
|
376
376
|
/// membership check. Constructs `Target::Pane`, renders the message with
|
|
377
377
|
/// the standard protocol block (Team Agent message from sender + token),
|
|
378
|
-
/// injects via the
|
|
379
|
-
///
|
|
380
|
-
///
|
|
378
|
+
/// injects via the selected team's endpoint-local tmux transport, and
|
|
379
|
+
/// surfaces the inject report as a JSON result.
|
|
380
|
+
///
|
|
381
|
+
/// 0.5.43 debt-sweep (§6.2): the pre-0.5.43 comment overstated the
|
|
382
|
+
/// scope. pane_id is inherently endpoint-local —
|
|
383
|
+
/// `lifecycle_worker_tmux_backend_for_selected_state` below builds the
|
|
384
|
+
/// transport from the SELECTED team's persisted endpoint. For cross-
|
|
385
|
+
/// workspace delivery, use `--to-name` / `--to-leader` instead; there
|
|
386
|
+
/// is intentionally no `--socket` flag.
|
|
381
387
|
fn send_to_pane_direct(
|
|
382
388
|
workspace: &Path,
|
|
383
389
|
pane_id: &str,
|
|
@@ -9,8 +9,7 @@ use super::*;
|
|
|
9
9
|
pub fn classify_agent_bucket(raw_status: &str, health_status: &str) -> SummaryBucket {
|
|
10
10
|
let raw = raw_status.to_ascii_lowercase();
|
|
11
11
|
let health = health_status.to_ascii_lowercase();
|
|
12
|
-
if matches!(raw.as_str(), "failed" | "error") || matches!(health.as_str(), "failed" | "error")
|
|
13
|
-
{
|
|
12
|
+
if matches!(raw.as_str(), "failed" | "error") || matches!(health.as_str(), "failed" | "error") {
|
|
14
13
|
SummaryBucket::Failed
|
|
15
14
|
} else if matches!(raw.as_str(), "stopped" | "done") || health == "done" {
|
|
16
15
|
SummaryBucket::Stopped
|
|
@@ -43,10 +42,7 @@ pub fn agent_summary_counts(agents: &Value, health: &Value) -> SummaryCounts {
|
|
|
43
42
|
}
|
|
44
43
|
continue;
|
|
45
44
|
}
|
|
46
|
-
let raw = agent
|
|
47
|
-
.get("status")
|
|
48
|
-
.and_then(Value::as_str)
|
|
49
|
-
.unwrap_or("");
|
|
45
|
+
let raw = agent.get("status").and_then(Value::as_str).unwrap_or("");
|
|
50
46
|
let hstatus = health
|
|
51
47
|
.get(agent_id)
|
|
52
48
|
.and_then(|v| v.get("status"))
|
|
@@ -136,17 +132,13 @@ pub fn format_status_summary(data: &Value) -> String {
|
|
|
136
132
|
"stopped",
|
|
137
133
|
);
|
|
138
134
|
let schema_ok = python_truthy(
|
|
139
|
-
data
|
|
140
|
-
|
|
141
|
-
.and_then(|v| v.get("schema_ok"))
|
|
135
|
+
data.get("coordinator")
|
|
136
|
+
.and_then(|v| v.get("schema_ok"))
|
|
142
137
|
.unwrap_or(&Value::Null),
|
|
143
138
|
);
|
|
144
139
|
let tmux = python_truthy(data.get("tmux_session_present").unwrap_or(&Value::Null));
|
|
145
140
|
let receiver = data.get("leader_receiver").unwrap_or(&Value::Null);
|
|
146
|
-
let pane = non_empty_str(
|
|
147
|
-
receiver.get("pane_id").and_then(Value::as_str),
|
|
148
|
-
"-",
|
|
149
|
-
);
|
|
141
|
+
let pane = non_empty_str(receiver.get("pane_id").and_then(Value::as_str), "-");
|
|
150
142
|
let cmd = first_non_empty_str(
|
|
151
143
|
&[
|
|
152
144
|
receiver.get("pane_current_command").and_then(Value::as_str),
|
|
@@ -266,17 +258,8 @@ fn csv_agent_status(
|
|
|
266
258
|
/// `_latest_result_line`(`commands.py:333-337`):agent_id/summary/created_at 渲染单行。
|
|
267
259
|
/// summary `\n`→` ` 后 [:80] 截断、空 → `-`;agent_id 空 → `-`;created_at 经 age_text。
|
|
268
260
|
pub(crate) fn format_latest_result(value: &Value) -> String {
|
|
269
|
-
let agent = non_empty_str(
|
|
270
|
-
|
|
271
|
-
.get("agent_id")
|
|
272
|
-
.and_then(Value::as_str)
|
|
273
|
-
,
|
|
274
|
-
"-",
|
|
275
|
-
);
|
|
276
|
-
let raw_summary = value
|
|
277
|
-
.get("summary")
|
|
278
|
-
.and_then(Value::as_str)
|
|
279
|
-
.unwrap_or("");
|
|
261
|
+
let agent = non_empty_str(value.get("agent_id").and_then(Value::as_str), "-");
|
|
262
|
+
let raw_summary = value.get("summary").and_then(Value::as_str).unwrap_or("");
|
|
280
263
|
let summary_flat = raw_summary.replace('\n', " ");
|
|
281
264
|
let summary = prefix_chars(&summary_flat, 80);
|
|
282
265
|
let summary = if summary.is_empty() {
|
|
@@ -284,12 +267,7 @@ pub(crate) fn format_latest_result(value: &Value) -> String {
|
|
|
284
267
|
} else {
|
|
285
268
|
summary
|
|
286
269
|
};
|
|
287
|
-
let created = age_text(
|
|
288
|
-
value
|
|
289
|
-
.get("created_at")
|
|
290
|
-
.and_then(Value::as_str)
|
|
291
|
-
,
|
|
292
|
-
);
|
|
270
|
+
let created = age_text(value.get("created_at").and_then(Value::as_str));
|
|
293
271
|
format!("{agent} -> {summary} @ {created}")
|
|
294
272
|
}
|
|
295
273
|
|