@team-agent/installer 0.5.125 → 0.5.126
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/diagnose.rs +0 -68
- package/crates/team-agent/src/cli/emit.rs +6 -2
- package/crates/team-agent/src/cli/intent/runtime_tests.rs +10 -10
- package/crates/team-agent/src/cli/mod.rs +22 -28
- package/crates/team-agent/src/cli/models.rs +7 -764
- package/crates/team-agent/src/cli/tests/mod.rs +1 -1
- package/crates/team-agent/src/cli/tests/run_delegation.rs +5 -4
- package/crates/team-agent/src/compiler/tests.rs +18 -3
- package/crates/team-agent/src/compiler.rs +4 -203
- package/crates/team-agent/src/contract_runtime/backend.rs +61 -38
- package/crates/team-agent/src/contract_runtime/config.rs +7 -4
- package/crates/team-agent/src/contract_runtime/fork.rs +368 -0
- package/crates/team-agent/src/contract_runtime/framework.rs +8 -10
- package/crates/team-agent/src/contract_runtime/mod.rs +1 -0
- package/crates/team-agent/src/contract_runtime/registry.rs +60 -19
- package/crates/team-agent/src/coordinator/tests/api_error_recovery.rs +29 -8
- package/crates/team-agent/src/coordinator/tests/health_sync.rs +0 -42
- package/crates/team-agent/src/leader/start.rs +1 -1
- package/crates/team-agent/src/lifecycle/launch/add_agent_state.rs +2 -195
- package/crates/team-agent/src/lifecycle/launch/clone_agent.rs +11 -27
- package/crates/team-agent/src/lifecycle/launch/fork_agent.rs +18 -28
- package/crates/team-agent/src/lifecycle/launch/fork_entry.rs +6 -87
- package/crates/team-agent/src/lifecycle/launch/mcp_config.rs +1 -9
- package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +74 -244
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +0 -24
- package/crates/team-agent/src/lifecycle/launch/role_source.rs +5 -0
- package/crates/team-agent/src/lifecycle/launch/spawn.rs +21 -33
- package/crates/team-agent/src/lifecycle/launch.rs +0 -23
- package/crates/team-agent/src/lifecycle/profile_launch.rs +18 -317
- package/crates/team-agent/src/lifecycle/restart/common.rs +42 -315
- package/crates/team-agent/src/lifecycle/restart/selection.rs +5 -5
- package/crates/team-agent/src/lifecycle/restart.rs +0 -2
- package/crates/team-agent/src/lifecycle/tests/behavioral_diff_264_red.rs +11 -6
- package/crates/team-agent/src/lifecycle/tests/claude_profile_launch_red.rs +8 -320
- package/crates/team-agent/src/lifecycle/tests/cli_argv_routing_red.rs +22 -138
- package/crates/team-agent/src/lifecycle/tests/clone_fork_copilot_perms_red.rs +4 -334
- package/crates/team-agent/src/lifecycle/tests/communication_mode_runtime_contract_red.rs +30 -11
- package/crates/team-agent/src/lifecycle/tests/copilot_provider_red.rs +2 -2
- package/crates/team-agent/src/lifecycle/tests/core.rs +17 -16
- package/crates/team-agent/src/lifecycle/tests/grok_require_explicit_model_red.rs +12 -12
- package/crates/team-agent/src/lifecycle/tests/harvest2_a_batch_red.rs +3 -51
- package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +26 -28
- package/crates/team-agent/src/lifecycle/tests/pi_catalog_red.rs +6 -18
- package/crates/team-agent/src/lifecycle/tests/pi_command_red.rs +52 -70
- package/crates/team-agent/src/lifecycle/tests/pi_dual_entry_red.rs +4 -157
- package/crates/team-agent/src/lifecycle/tests/pi_executable_mcp_red.rs +10 -302
- package/crates/team-agent/src/lifecycle/tests/pi_lifecycle_doctor_red.rs +1 -68
- package/crates/team-agent/src/lifecycle/tests/pi_native_mcp_capability_red.rs +1 -19
- package/crates/team-agent/src/lifecycle/tests/pi_session_delivery_red.rs +2 -100
- package/crates/team-agent/src/lifecycle/tests/quick_start_worker_readiness_red.rs +11 -10
- package/crates/team-agent/src/lifecycle/tests/restart_session_capture_red.rs +2 -106
- package/crates/team-agent/src/lifecycle/tests/status_credential_redaction_contract.rs +2 -2
- package/crates/team-agent/src/lifecycle/tests/swallow_batch4_semantics_red.rs +2 -254
- package/crates/team-agent/src/lifecycle/tests/upgrade_compat_0211_red.rs +4 -4
- package/crates/team-agent/src/lifecycle/tests/verify_rs031_window_consistency_red.rs +6 -5
- package/crates/team-agent/src/lifecycle/tests/worker_spawn_env_red.rs +7 -16
- package/crates/team-agent/src/lifecycle/tests.rs +0 -3
- package/crates/team-agent/src/lifecycle/types.rs +2 -18
- package/crates/team-agent/src/mcp_server/readiness_tests.rs +1 -1
- package/crates/team-agent/src/messaging/delivery.rs +12 -141
- package/crates/team-agent/src/messaging/delivery_consumption_tests.rs +5 -5
- package/crates/team-agent/src/messaging/tests/dup_inject.rs +3 -3
- package/crates/team-agent/src/messaging/tests/spine.rs +26 -32
- package/crates/team-agent/src/provider/adapter.rs +35 -238
- package/crates/team-agent/src/provider/adapters/mod.rs +4 -4
- package/crates/team-agent/src/provider/model_catalog.rs +13 -201
- package/crates/team-agent/src/provider/session/capture.rs +6 -106
- package/crates/team-agent/src/provider/session/context_fork/outcome.rs +0 -4
- package/crates/team-agent/src/provider/session/context_fork.rs +15 -107
- package/crates/team-agent/src/provider/session_scan/common.rs +10 -34
- package/crates/team-agent/src/provider/session_scan/pi.rs +1 -34
- package/crates/team-agent/src/provider/session_scan.rs +4 -10
- package/crates/team-agent/src/provider/tests/adapter.rs +34 -91
- package/crates/team-agent/src/provider/tests/command_helpers.rs +3 -12
- package/crates/team-agent/src/provider/tests/idle.rs +0 -25
- package/crates/team-agent/src/provider/wire.rs +51 -23
- package/crates/team-agent/src/state/abnormal_watch/tests/mod.rs +1 -1
- package/crates/team-agent/src/state/persist.rs +6 -6
- package/crates/team-agent/src/state/repository/tests.rs +2 -2
- package/package.json +4 -4
- package/skills/team-agent/SKILL.md +6 -4
- package/skills/team-agent/command-coverage.json +15 -1
- package/skills/team-agent/docs/reference/team-agent-operator.md +5 -3
- package/skills/team-agent/references/team-agent-operator.md +5 -3
- package/crates/team-agent/src/lifecycle/restart/avatar.rs +0 -1805
- package/crates/team-agent/src/lifecycle/tests/claude_compatible_config_red.rs +0 -325
- package/crates/team-agent/src/lifecycle/tests/pi_compiler_red.rs +0 -210
- package/crates/team-agent/src/lifecycle/tests/pi_fork_session_inheritance_red.rs +0 -1409
- package/crates/team-agent/src/provider/adapters/claude.rs +0 -78
- package/crates/team-agent/src/provider/adapters/claude_fork.rs +0 -131
- package/crates/team-agent/src/provider/adapters/pi.rs +0 -100
- package/crates/team-agent/src/provider/session/context_fork/claude.rs +0 -123
- package/crates/team-agent/src/provider/session_scan/claude.rs +0 -523
- package/crates/team-agent/src/test_support/models_timeout_fixture.rs +0 -144
package/Cargo.lock
CHANGED
package/Cargo.toml
CHANGED
|
@@ -9,74 +9,6 @@ use crate::model::pane_authority_refusal::{
|
|
|
9
9
|
use crate::provider::wire::{command_name, parse_provider, provider_wire};
|
|
10
10
|
use crate::transport::Transport;
|
|
11
11
|
|
|
12
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)]
|
|
13
|
-
#[serde(rename_all = "snake_case")]
|
|
14
|
-
pub(crate) enum PiBackingStatus {
|
|
15
|
-
Pending,
|
|
16
|
-
Captured,
|
|
17
|
-
Missing,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)]
|
|
21
|
-
#[serde(rename_all = "snake_case")]
|
|
22
|
-
pub(crate) enum PiMcpStatus {
|
|
23
|
-
Unavailable,
|
|
24
|
-
ConfiguredLazy,
|
|
25
|
-
RoundtripVerified,
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
pub(crate) struct PiDoctorInput {
|
|
29
|
-
pub executable_chain_verified: bool,
|
|
30
|
-
pub pi_version: Option<String>,
|
|
31
|
-
pub adapter_version: Option<String>,
|
|
32
|
-
pub catalog_sha256: Option<String>,
|
|
33
|
-
pub selected_model: Option<String>,
|
|
34
|
-
pub candidate_executable: Option<std::path::PathBuf>,
|
|
35
|
-
pub wrapper: Option<std::path::PathBuf>,
|
|
36
|
-
pub mcp_roundtrip_at: Option<String>,
|
|
37
|
-
pub backing: PiBackingStatus,
|
|
38
|
-
pub activity: crate::provider::TurnState,
|
|
39
|
-
pub activity_source: crate::provider::ClassifySource,
|
|
40
|
-
pub env_key_names: Vec<String>,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize)]
|
|
44
|
-
pub(crate) struct PiDoctorFacts {
|
|
45
|
-
pub mcp: PiMcpStatus,
|
|
46
|
-
pub mcp_connected: bool,
|
|
47
|
-
pub backing: PiBackingStatus,
|
|
48
|
-
pub activity: crate::provider::TurnState,
|
|
49
|
-
pub activity_source: crate::provider::ClassifySource,
|
|
50
|
-
pub auth_hint: crate::provider::AuthHintStatus,
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
pub(crate) fn pi_doctor_facts(input: PiDoctorInput) -> PiDoctorFacts {
|
|
54
|
-
let mcp = if input.mcp_roundtrip_at.is_some() {
|
|
55
|
-
PiMcpStatus::RoundtripVerified
|
|
56
|
-
} else if input.wrapper.is_some() {
|
|
57
|
-
PiMcpStatus::ConfiguredLazy
|
|
58
|
-
} else {
|
|
59
|
-
PiMcpStatus::Unavailable
|
|
60
|
-
};
|
|
61
|
-
let _ = (
|
|
62
|
-
input.executable_chain_verified,
|
|
63
|
-
input.pi_version,
|
|
64
|
-
input.adapter_version,
|
|
65
|
-
input.catalog_sha256,
|
|
66
|
-
input.selected_model,
|
|
67
|
-
input.candidate_executable,
|
|
68
|
-
input.env_key_names,
|
|
69
|
-
);
|
|
70
|
-
PiDoctorFacts {
|
|
71
|
-
mcp,
|
|
72
|
-
mcp_connected: mcp == PiMcpStatus::RoundtripVerified,
|
|
73
|
-
backing: input.backing,
|
|
74
|
-
activity: input.activity,
|
|
75
|
-
activity_source: input.activity_source,
|
|
76
|
-
auth_hint: crate::provider::AuthHintStatus::Unknown,
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
12
|
/// 0.5.39 Slice 1 (tmux-server-death-locate §11.1 B): classify a tmux
|
|
81
13
|
/// transport error string into a diagnose issue id. When the underlying
|
|
82
14
|
/// tmux subprocess stderr contains `server exited unexpectedly`, the
|
|
@@ -1643,10 +1643,11 @@ fn role_agent_args(
|
|
|
1643
1643
|
}
|
|
1644
1644
|
match flag {
|
|
1645
1645
|
"--provider" => {
|
|
1646
|
-
// A contract name
|
|
1646
|
+
// A contract name is written as the leaf's public name (`agent` →
|
|
1647
|
+
// `cursor`, `claude_code` → `claude`); it declares the same leaf.
|
|
1647
1648
|
#[cfg(unix)]
|
|
1648
1649
|
let contract = crate::contract_runtime::registry::declared(&value, false)
|
|
1649
|
-
.map(
|
|
1650
|
+
.map(crate::contract_runtime::registry::public_name);
|
|
1650
1651
|
#[cfg(not(unix))]
|
|
1651
1652
|
let contract: Option<&str> = None;
|
|
1652
1653
|
let provider = match contract {
|
|
@@ -1749,6 +1750,9 @@ mod role_cli_tests {
|
|
|
1749
1750
|
for (name, leaf) in [
|
|
1750
1751
|
("cursor", "cursor"), ("cursor-agent", "cursor"), ("agent", "cursor"),
|
|
1751
1752
|
("cursor_agent", "cursor"), ("kiro", "kiro"), ("codex_tui", "codex_tui"),
|
|
1753
|
+
// Claude Code and Pi keep their public command names, which declare the leaf.
|
|
1754
|
+
("claude", "claude"), ("claude_code", "claude"), ("claude-code", "claude"),
|
|
1755
|
+
("claude_tui", "claude"), ("pi", "pi"), ("pi_tui", "pi"),
|
|
1752
1756
|
] {
|
|
1753
1757
|
let (_, patch) = role_agent_args(
|
|
1754
1758
|
&strings(&["w", "--provider", name, "--bypass", "true"]), true,
|
|
@@ -20,10 +20,10 @@ fn fixture(ids: &[&str]) -> (Sandbox, Intent) {
|
|
|
20
20
|
(root, intent)
|
|
21
21
|
}
|
|
22
22
|
fn write_role(root: &Path, id: &str) {
|
|
23
|
-
std::fs::write(root.join("agents").join(format!("{id}.md")),format!("---\nname: {id}\nprovider:
|
|
23
|
+
std::fs::write(root.join("agents").join(format!("{id}.md")),format!("---\nname: {id}\nprovider: copilot\nmodel: gpt-6-luna\neffort: high\ndangerously_skip_permissions: true\n---\nFixture\n")).unwrap();
|
|
24
24
|
}
|
|
25
25
|
fn install(root: &Path, ids: &[(&str, &str, bool)]) {
|
|
26
|
-
let agents:serde_json::Map<String,Value>=ids.iter().map(|(id,status,explicit)|((*id).into(),json!({"provider":"
|
|
26
|
+
let agents:serde_json::Map<String,Value>=ids.iter().map(|(id,status,explicit)|((*id).into(),json!({"provider":"copilot","status":status,"explicit_stop":explicit,"pane_pid":std::process::id(),"pane_id":format!("%{id}"),"window":id}))).collect();
|
|
27
27
|
let entry = json!({"team_key":"fixture","team_dir":root,"status":"alive","session_name":"team-fixture","agents":agents,"tasks":{}});
|
|
28
28
|
let mut raw = entry.clone();
|
|
29
29
|
raw["active_team_key"] = json!("fixture");
|
|
@@ -427,14 +427,14 @@ fn preserve_rejects_known_missing_backing_before_stop_auto_uses_existing_decisio
|
|
|
427
427
|
let selected =
|
|
428
428
|
resolve_active_team_readonly(root.path(), Some("fixture"), SelectorMode::RuntimeOnly)
|
|
429
429
|
.unwrap();
|
|
430
|
-
let row = json!({"provider":"
|
|
430
|
+
let row = json!({"provider":"copilot","session_id":"missing-session","rollout_path":root.path().join("missing.jsonl"),"spawn_cwd":root.path()});
|
|
431
431
|
assert!(preflight_start(&selected, "one", &row, SessionPolicy::Preserve).is_err());
|
|
432
432
|
assert!(preflight_start(&selected, "one", &row, SessionPolicy::Auto).is_ok());
|
|
433
433
|
assert!(
|
|
434
434
|
preflight_start(
|
|
435
435
|
&selected,
|
|
436
436
|
"one",
|
|
437
|
-
&json!({"provider":"
|
|
437
|
+
&json!({"provider":"copilot"}),
|
|
438
438
|
SessionPolicy::Preserve
|
|
439
439
|
)
|
|
440
440
|
.is_ok(),
|
|
@@ -488,7 +488,7 @@ fn stopped_text_without_physical_identity_is_unknown_and_standalone_source_keeps
|
|
|
488
488
|
observe(
|
|
489
489
|
&selected,
|
|
490
490
|
"one",
|
|
491
|
-
&json!({"status":"stopped","provider":"
|
|
491
|
+
&json!({"status":"stopped","provider":"copilot"})
|
|
492
492
|
)
|
|
493
493
|
.unwrap(),
|
|
494
494
|
Observation::Unknown
|
|
@@ -497,7 +497,7 @@ fn stopped_text_without_physical_identity_is_unknown_and_standalone_source_keeps
|
|
|
497
497
|
observe(
|
|
498
498
|
&selected,
|
|
499
499
|
"one",
|
|
500
|
-
&json!({"status":"stopped","provider":"
|
|
500
|
+
&json!({"status":"stopped","provider":"copilot","pane_pid":std::process::id()})
|
|
501
501
|
)
|
|
502
502
|
.unwrap(),
|
|
503
503
|
Observation::Unknown
|
|
@@ -701,7 +701,7 @@ fn preserve_context_preflight_and_corrupt_metadata_refuse_before_stop() {
|
|
|
701
701
|
json!({"task_prompt_delivered":true}),
|
|
702
702
|
json!({"last_result_at":"2026-10-19T00:00:00Z"}),
|
|
703
703
|
] {
|
|
704
|
-
let mut row = json!({"provider":"
|
|
704
|
+
let mut row = json!({"provider":"copilot"});
|
|
705
705
|
row.as_object_mut()
|
|
706
706
|
.unwrap()
|
|
707
707
|
.extend(signal.as_object().unwrap().clone());
|
|
@@ -716,7 +716,7 @@ fn preserve_context_preflight_and_corrupt_metadata_refuse_before_stop() {
|
|
|
716
716
|
"first_send_at",
|
|
717
717
|
"task_prompt_delivered",
|
|
718
718
|
] {
|
|
719
|
-
let mut row = json!({"provider":"
|
|
719
|
+
let mut row = json!({"provider":"copilot"});
|
|
720
720
|
row[field] = json!([]);
|
|
721
721
|
for policy in [SessionPolicy::Auto, SessionPolicy::Preserve] {
|
|
722
722
|
assert!(
|
|
@@ -729,14 +729,14 @@ fn preserve_context_preflight_and_corrupt_metadata_refuse_before_stop() {
|
|
|
729
729
|
assert!(preflight_start(
|
|
730
730
|
&selected,
|
|
731
731
|
"one",
|
|
732
|
-
&json!({"provider":"
|
|
732
|
+
&json!({"provider":"copilot", "spawn_cwd":outside.path()}),
|
|
733
733
|
SessionPolicy::Auto
|
|
734
734
|
)
|
|
735
735
|
.is_err());
|
|
736
736
|
assert!(preflight_start(
|
|
737
737
|
&selected,
|
|
738
738
|
"one",
|
|
739
|
-
&json!({"provider":"
|
|
739
|
+
&json!({"provider":"copilot", "session_id":"captured"}),
|
|
740
740
|
SessionPolicy::Auto
|
|
741
741
|
)
|
|
742
742
|
.is_err());
|
|
@@ -3319,10 +3319,12 @@ pub mod lifecycle_port {
|
|
|
3319
3319
|
Some(agent),
|
|
3320
3320
|
"start-agent",
|
|
3321
3321
|
)?;
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
)
|
|
3322
|
+
// Only an explicit override can move this legacy seat onto a leaf.
|
|
3323
|
+
// An omitted provider keeps the existing role's provider; it is not
|
|
3324
|
+
// a new role defaulting to `pi`.
|
|
3325
|
+
if let Some(provider) = role_config.provider.as_deref() {
|
|
3326
|
+
crate::contract_runtime::framework::require_legacy_role(None, Some(provider))?;
|
|
3327
|
+
}
|
|
3326
3328
|
}
|
|
3327
3329
|
let _ = force; // Never grants authority to stop an already-running seat.
|
|
3328
3330
|
let agent_id = crate::model::ids::AgentId::new(agent);
|
|
@@ -3533,6 +3535,14 @@ pub mod lifecycle_port {
|
|
|
3533
3535
|
) -> Result<Value, CliError> {
|
|
3534
3536
|
let source = crate::model::ids::AgentId::new(source_agent);
|
|
3535
3537
|
let dest = crate::model::ids::AgentId::new(as_agent_id);
|
|
3538
|
+
// A contract seat forks through the generic contract pipeline; every
|
|
3539
|
+
// leaf's descriptor decides admission. No legacy fallback is taken.
|
|
3540
|
+
#[cfg(unix)]
|
|
3541
|
+
if let Some(receipt) =
|
|
3542
|
+
crate::contract_runtime::fork::fork_agent(workspace, team, source_agent, as_agent_id, label)?
|
|
3543
|
+
{
|
|
3544
|
+
return Ok(receipt);
|
|
3545
|
+
}
|
|
3536
3546
|
#[cfg(unix)]
|
|
3537
3547
|
crate::contract_runtime::framework::require_legacy_lifecycle(
|
|
3538
3548
|
workspace,
|
|
@@ -3541,30 +3551,14 @@ pub mod lifecycle_port {
|
|
|
3541
3551
|
"fork-agent",
|
|
3542
3552
|
)?;
|
|
3543
3553
|
match crate::lifecycle::fork_agent(workspace, &source, &dest, label, true, team) {
|
|
3544
|
-
Ok(report) => {
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
});
|
|
3553
|
-
if let (Some(details), Some(object)) = (report.pi_fork, value.as_object_mut()) {
|
|
3554
|
-
object.insert("status".to_string(), json!("forked"));
|
|
3555
|
-
object.insert("target".to_string(), json!(report.new_agent_id.as_str()));
|
|
3556
|
-
object.insert(
|
|
3557
|
-
"source_session_id".to_string(),
|
|
3558
|
-
json!(details.source_session_id.as_str()),
|
|
3559
|
-
);
|
|
3560
|
-
object.insert("session_id".to_string(), json!(details.session_id.as_str()));
|
|
3561
|
-
object.insert(
|
|
3562
|
-
"backing_path".to_string(),
|
|
3563
|
-
json!(details.backing_path.0.to_string_lossy().to_string()),
|
|
3564
|
-
);
|
|
3565
|
-
}
|
|
3566
|
-
Ok(value)
|
|
3567
|
-
}
|
|
3554
|
+
Ok(report) => Ok(json!({
|
|
3555
|
+
"ok": true,
|
|
3556
|
+
"source_agent_id": report.source_agent_id.as_str(),
|
|
3557
|
+
"new_agent_id": report.new_agent_id.as_str(),
|
|
3558
|
+
"session_id": report.session_id.as_ref().map(|session| session.as_str()),
|
|
3559
|
+
"new_session_id": report.session_id.as_ref().map(|session| session.as_str()),
|
|
3560
|
+
"backing_state": report.backing_state,
|
|
3561
|
+
})),
|
|
3568
3562
|
Err(e) => Ok(error_value(e)),
|
|
3569
3563
|
}
|
|
3570
3564
|
}
|