@team-agent/installer 0.5.27 → 0.5.28
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
CHANGED
package/Cargo.toml
CHANGED
|
@@ -672,9 +672,16 @@ pub(super) fn sync_restart_team_projections(state: &mut serde_json::Value, team_
|
|
|
672
672
|
else {
|
|
673
673
|
return;
|
|
674
674
|
};
|
|
675
|
+
// 0.5.28 (`.team/artifacts/0527-realfail-layer2-leader-locate.md` §3):
|
|
676
|
+
// 显式 team_key = 操作目标,始终允许覆盖 / 新建(该 helper 的正当职责)。
|
|
677
|
+
// active/derived/"current" 三种别名兜底 = alias-identity 家族第三例,只有
|
|
678
|
+
// 「盘上已有该 alias 条目」且「其身份与 compact 不冲突」时才允许写,
|
|
679
|
+
// 避免 0.5.26 起死 sibling 保留时被活队 compact 硬克隆。禁止 alias 新建条目。
|
|
675
680
|
let mut keys = Vec::new();
|
|
681
|
+
let mut explicit = false;
|
|
676
682
|
if !team_key.is_empty() {
|
|
677
683
|
keys.push(team_key.to_string());
|
|
684
|
+
explicit = true;
|
|
678
685
|
}
|
|
679
686
|
if let Some(active_key) = active_key {
|
|
680
687
|
keys.push(active_key);
|
|
@@ -688,8 +695,41 @@ pub(super) fn sync_restart_team_projections(state: &mut serde_json::Value, team_
|
|
|
688
695
|
keys.sort();
|
|
689
696
|
keys.dedup();
|
|
690
697
|
for key in keys {
|
|
691
|
-
|
|
698
|
+
let is_operation_target = explicit && key == team_key;
|
|
699
|
+
if is_operation_target {
|
|
700
|
+
teams.insert(key, compact.clone());
|
|
701
|
+
continue;
|
|
702
|
+
}
|
|
703
|
+
let Some(existing) = teams.get(&key) else {
|
|
704
|
+
// 别名条目不存在:不新建,避免把 hack alias 变成真队。
|
|
705
|
+
continue;
|
|
706
|
+
};
|
|
707
|
+
if json_team_identity_matches(existing, &compact) {
|
|
708
|
+
teams.insert(key, compact.clone());
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/// 0.5.28: 别名同步身份门。比较 existing 条目与 compact(即将写入)四个身份字段:
|
|
714
|
+
/// `team_key`/`session_name`/`team_dir`/`spec_path`。legacy 缺字段容忍(两侧任一
|
|
715
|
+
/// 缺则该字段不参与判定);已有字段必须相等,冲突即拒绝覆盖。
|
|
716
|
+
fn json_team_identity_matches(existing: &serde_json::Value, compact: &serde_json::Value) -> bool {
|
|
717
|
+
const FIELDS: &[&str] = &["team_key", "session_name", "team_dir", "spec_path"];
|
|
718
|
+
for field in FIELDS {
|
|
719
|
+
let lhs = existing
|
|
720
|
+
.get(field)
|
|
721
|
+
.and_then(serde_json::Value::as_str)
|
|
722
|
+
.filter(|s| !s.is_empty());
|
|
723
|
+
let rhs = compact
|
|
724
|
+
.get(field)
|
|
725
|
+
.and_then(serde_json::Value::as_str)
|
|
726
|
+
.filter(|s| !s.is_empty());
|
|
727
|
+
match (lhs, rhs) {
|
|
728
|
+
(Some(a), Some(b)) if a != b => return false,
|
|
729
|
+
_ => {}
|
|
730
|
+
}
|
|
692
731
|
}
|
|
732
|
+
true
|
|
693
733
|
}
|
|
694
734
|
|
|
695
735
|
pub(super) fn state_session_name(state: &serde_json::Value) -> SessionName {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@team-agent/installer",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.28",
|
|
4
4
|
"description": "npx installer for Team Agent",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codex",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"team-agent-installer": "npm/install.mjs"
|
|
21
21
|
},
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@team-agent/cli-darwin-arm64": "0.5.
|
|
24
|
-
"@team-agent/cli-darwin-x64": "0.5.
|
|
25
|
-
"@team-agent/cli-linux-x64": "0.5.
|
|
23
|
+
"@team-agent/cli-darwin-arm64": "0.5.28",
|
|
24
|
+
"@team-agent/cli-darwin-x64": "0.5.28",
|
|
25
|
+
"@team-agent/cli-linux-x64": "0.5.28"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"postinstall": "node npm/bincheck.mjs",
|