@team-agent/installer 0.5.41 → 0.5.43
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 +27 -7
- 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 +47 -52
- 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/coordinator/tick.rs +19 -1
- 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 +52 -19
- package/crates/team-agent/src/leader/helpers.rs +7 -1
- package/crates/team-agent/src/leader/lease.rs +195 -82
- package/crates/team-agent/src/leader/owner_bind.rs +55 -22
- 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/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 +6 -1
- 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/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.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 +21 -22
- 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/repository.rs +27 -14
- 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 +27 -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
|
@@ -81,10 +81,7 @@ pub(crate) fn write_team_state(
|
|
|
81
81
|
let Some(id) = agent.get("id").and_then(YamlValue::as_str) else {
|
|
82
82
|
continue;
|
|
83
83
|
};
|
|
84
|
-
let role = agent
|
|
85
|
-
.get("role")
|
|
86
|
-
.and_then(YamlValue::as_str)
|
|
87
|
-
.unwrap_or(id);
|
|
84
|
+
let role = agent.get("role").and_then(YamlValue::as_str).unwrap_or(id);
|
|
88
85
|
let provider = agent
|
|
89
86
|
.get("provider")
|
|
90
87
|
.and_then(YamlValue::as_str)
|
|
@@ -108,17 +105,31 @@ pub(crate) fn write_team_state(
|
|
|
108
105
|
let title = task_field_str(task, "title");
|
|
109
106
|
let status = {
|
|
110
107
|
let s = task_field_str(task, "status");
|
|
111
|
-
if s.is_empty() {
|
|
108
|
+
if s.is_empty() {
|
|
109
|
+
"pending".to_string()
|
|
110
|
+
} else {
|
|
111
|
+
s
|
|
112
|
+
}
|
|
112
113
|
};
|
|
113
114
|
let assignee = {
|
|
114
115
|
let a = task_field_str(task, "assignee");
|
|
115
|
-
if a.is_empty() {
|
|
116
|
+
if a.is_empty() {
|
|
117
|
+
"unassigned".to_string()
|
|
118
|
+
} else {
|
|
119
|
+
a
|
|
120
|
+
}
|
|
116
121
|
};
|
|
117
122
|
let deps = {
|
|
118
123
|
let d = task_field_list(task, "deps");
|
|
119
|
-
if d.is_empty() {
|
|
124
|
+
if d.is_empty() {
|
|
125
|
+
"none".to_string()
|
|
126
|
+
} else {
|
|
127
|
+
d.join(", ")
|
|
128
|
+
}
|
|
120
129
|
};
|
|
121
|
-
lines.push(format!(
|
|
130
|
+
lines.push(format!(
|
|
131
|
+
"- {id} [{status}], assignee={assignee}, deps={deps}: {title}"
|
|
132
|
+
));
|
|
122
133
|
let summary = task_field_str(task, "last_result_summary");
|
|
123
134
|
if !summary.is_empty() {
|
|
124
135
|
lines.push(format!(" Summary: {summary}"));
|
|
@@ -136,7 +147,12 @@ pub(crate) fn write_team_state(
|
|
|
136
147
|
lines.push(String::new());
|
|
137
148
|
let blockers: Vec<&TeamStateTask> = tasks
|
|
138
149
|
.iter()
|
|
139
|
-
.filter(|t|
|
|
150
|
+
.filter(|t| {
|
|
151
|
+
matches!(
|
|
152
|
+
task_field_str(t, "status").as_str(),
|
|
153
|
+
"blocked" | "failed" | "needs_retry"
|
|
154
|
+
)
|
|
155
|
+
})
|
|
140
156
|
.collect();
|
|
141
157
|
if blockers.is_empty() {
|
|
142
158
|
lines.push("- None".to_string());
|
|
@@ -145,7 +161,11 @@ pub(crate) fn write_team_state(
|
|
|
145
161
|
let id = task_field_str(task, "id");
|
|
146
162
|
let summary = {
|
|
147
163
|
let s = task_field_str(task, "last_result_summary");
|
|
148
|
-
if s.is_empty() {
|
|
164
|
+
if s.is_empty() {
|
|
165
|
+
task_field_str(task, "title")
|
|
166
|
+
} else {
|
|
167
|
+
s
|
|
168
|
+
}
|
|
149
169
|
};
|
|
150
170
|
lines.push(format!("- {id}: {summary}"));
|
|
151
171
|
}
|
|
@@ -177,7 +197,9 @@ enum TeamStateTask {
|
|
|
177
197
|
|
|
178
198
|
/// golden `datetime.now(timezone.utc).isoformat()` analog (microseconds + `+00:00`).
|
|
179
199
|
fn team_state_now() -> String {
|
|
180
|
-
chrono::Utc::now()
|
|
200
|
+
chrono::Utc::now()
|
|
201
|
+
.format("%Y-%m-%dT%H:%M:%S%.6f+00:00")
|
|
202
|
+
.to_string()
|
|
181
203
|
}
|
|
182
204
|
|
|
183
205
|
fn team_state_tasks(spec: &YamlValue, state: &serde_json::Value) -> Vec<TeamStateTask> {
|
|
@@ -196,15 +218,27 @@ fn team_state_notes(state: &serde_json::Value) -> Option<Vec<String>> {
|
|
|
196
218
|
.get("notes")?
|
|
197
219
|
.as_array()?
|
|
198
220
|
.iter()
|
|
199
|
-
.filter_map(|note|
|
|
221
|
+
.filter_map(|note| {
|
|
222
|
+
note.as_str()
|
|
223
|
+
.filter(|text| !text.is_empty())
|
|
224
|
+
.map(str::to_string)
|
|
225
|
+
})
|
|
200
226
|
.collect(),
|
|
201
227
|
)
|
|
202
228
|
}
|
|
203
229
|
|
|
204
230
|
fn task_field_str(task: &TeamStateTask, key: &str) -> String {
|
|
205
231
|
match task {
|
|
206
|
-
TeamStateTask::Json(v) => v
|
|
207
|
-
|
|
232
|
+
TeamStateTask::Json(v) => v
|
|
233
|
+
.get(key)
|
|
234
|
+
.and_then(|v| v.as_str())
|
|
235
|
+
.unwrap_or("")
|
|
236
|
+
.to_string(),
|
|
237
|
+
TeamStateTask::Yaml(v) => v
|
|
238
|
+
.get(key)
|
|
239
|
+
.and_then(YamlValue::as_str)
|
|
240
|
+
.unwrap_or("")
|
|
241
|
+
.to_string(),
|
|
208
242
|
}
|
|
209
243
|
}
|
|
210
244
|
|
|
@@ -213,12 +247,22 @@ fn task_field_list(task: &TeamStateTask, key: &str) -> Vec<String> {
|
|
|
213
247
|
TeamStateTask::Json(v) => v
|
|
214
248
|
.get(key)
|
|
215
249
|
.and_then(|v| v.as_array())
|
|
216
|
-
.map(|items|
|
|
250
|
+
.map(|items| {
|
|
251
|
+
items
|
|
252
|
+
.iter()
|
|
253
|
+
.filter_map(|i| i.as_str().map(str::to_string))
|
|
254
|
+
.collect()
|
|
255
|
+
})
|
|
217
256
|
.unwrap_or_default(),
|
|
218
257
|
TeamStateTask::Yaml(v) => v
|
|
219
258
|
.get(key)
|
|
220
259
|
.and_then(YamlValue::as_list)
|
|
221
|
-
.map(|items|
|
|
260
|
+
.map(|items| {
|
|
261
|
+
items
|
|
262
|
+
.iter()
|
|
263
|
+
.filter_map(|i| i.as_str().map(str::to_string))
|
|
264
|
+
.collect()
|
|
265
|
+
})
|
|
222
266
|
.unwrap_or_default(),
|
|
223
267
|
}
|
|
224
268
|
}
|
|
@@ -250,7 +294,9 @@ fn task_artifact_refs(task: &TeamStateTask) -> Vec<String> {
|
|
|
250
294
|
Some(_) => format!(
|
|
251
295
|
" Artifact: {} - {}",
|
|
252
296
|
r.get("path").and_then(YamlValue::as_str).unwrap_or("None"),
|
|
253
|
-
r.get("description")
|
|
297
|
+
r.get("description")
|
|
298
|
+
.and_then(YamlValue::as_str)
|
|
299
|
+
.unwrap_or("")
|
|
254
300
|
),
|
|
255
301
|
None => format!(" Artifact: INVALID artifact ref {:?}", r),
|
|
256
302
|
})
|