@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
|
@@ -450,7 +450,9 @@ pub enum AttachOutcome {
|
|
|
450
450
|
/// wezterm:GUI 启动即 attach,无独立动作。
|
|
451
451
|
GuiAttachIsImplicit,
|
|
452
452
|
/// conpty:无 attach 概念。
|
|
453
|
-
Unsupported {
|
|
453
|
+
Unsupported {
|
|
454
|
+
reason: String,
|
|
455
|
+
},
|
|
454
456
|
}
|
|
455
457
|
|
|
456
458
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -486,7 +488,10 @@ pub enum TransportError {
|
|
|
486
488
|
},
|
|
487
489
|
/// wezterm mux 连不上 / tmux server 不在。
|
|
488
490
|
#[error("mux unavailable on {backend:?}: {detail}")]
|
|
489
|
-
MuxUnavailable {
|
|
491
|
+
MuxUnavailable {
|
|
492
|
+
backend: BackendKind,
|
|
493
|
+
detail: String,
|
|
494
|
+
},
|
|
490
495
|
#[error("target not found: {target}")]
|
|
491
496
|
TargetNotFound { target: String },
|
|
492
497
|
#[error(transparent)]
|
|
@@ -695,15 +700,11 @@ pub trait Transport: Send + Sync {
|
|
|
695
700
|
|
|
696
701
|
fn send_keys(&self, target: &Target, keys: &[Key]) -> Result<(), TransportError>;
|
|
697
702
|
|
|
698
|
-
fn capture(
|
|
699
|
-
|
|
700
|
-
target: &Target,
|
|
701
|
-
range: CaptureRange,
|
|
702
|
-
) -> Result<CapturedText, TransportError>;
|
|
703
|
+
fn capture(&self, target: &Target, range: CaptureRange)
|
|
704
|
+
-> Result<CapturedText, TransportError>;
|
|
703
705
|
|
|
704
706
|
/// 非 tmux 后端无对应概念的字段返回 `Ok(None)`(typed「不适用」)。
|
|
705
|
-
fn query(&self, target: &Target, field: PaneField)
|
|
706
|
-
-> Result<Option<String>, TransportError>;
|
|
707
|
+
fn query(&self, target: &Target, field: PaneField) -> Result<Option<String>, TransportError>;
|
|
707
708
|
|
|
708
709
|
/// pane 存活三态(`PaneLiveness`,bug-085 穷尽 match;unknown ≠ dead ≠ live)。
|
|
709
710
|
fn liveness(&self, pane: &PaneId) -> Result<PaneLiveness, TransportError>;
|
|
@@ -723,10 +724,7 @@ pub trait Transport: Send + Sync {
|
|
|
723
724
|
|
|
724
725
|
fn has_session(&self, session: &SessionName) -> Result<bool, TransportError>;
|
|
725
726
|
|
|
726
|
-
fn list_windows(
|
|
727
|
-
&self,
|
|
728
|
-
session: &SessionName,
|
|
729
|
-
) -> Result<Vec<WindowName>, TransportError>;
|
|
727
|
+
fn list_windows(&self, session: &SessionName) -> Result<Vec<WindowName>, TransportError>;
|
|
730
728
|
|
|
731
729
|
fn configure_adaptive_pane_title(
|
|
732
730
|
&self,
|
|
@@ -765,10 +763,7 @@ pub trait Transport: Send + Sync {
|
|
|
765
763
|
|
|
766
764
|
/// 交互前台 attach(leader 用)。tmux=`attach-session`;wezterm=GUI 即 attach
|
|
767
765
|
/// (`GuiAttachIsImplicit`);conpty=typed 不支持(`Unsupported`)。
|
|
768
|
-
fn attach_session(
|
|
769
|
-
&self,
|
|
770
|
-
session: &SessionName,
|
|
771
|
-
) -> Result<AttachOutcome, TransportError>;
|
|
766
|
+
fn attach_session(&self, session: &SessionName) -> Result<AttachOutcome, TransportError>;
|
|
772
767
|
}
|
|
773
768
|
|
|
774
769
|
pub trait SubmitObserver {
|
|
@@ -268,16 +268,28 @@ pub fn resolve_transport(
|
|
|
268
268
|
}
|
|
269
269
|
// ── Layer 3: legacy tmux endpoint / socket ────────────────────
|
|
270
270
|
if let Some((_, _)) = crate::tmux_backend::runtime_tmux_endpoint_from_state_pub(input.state) {
|
|
271
|
-
return build_selected(
|
|
271
|
+
return build_selected(
|
|
272
|
+
&input,
|
|
273
|
+
RequestedTransportBackend::Tmux,
|
|
274
|
+
"legacy_tmux_endpoint",
|
|
275
|
+
);
|
|
272
276
|
}
|
|
273
277
|
// ── Layer 4: spec.runtime.backend literal ─────────────────────
|
|
274
278
|
if let Some(literal) = input.spec_backend_literal {
|
|
275
279
|
match literal.trim().to_ascii_lowercase().as_str() {
|
|
276
280
|
"tmux" => {
|
|
277
|
-
return build_selected(
|
|
281
|
+
return build_selected(
|
|
282
|
+
&input,
|
|
283
|
+
RequestedTransportBackend::Tmux,
|
|
284
|
+
"spec.runtime.backend",
|
|
285
|
+
);
|
|
278
286
|
}
|
|
279
287
|
"conpty" => {
|
|
280
|
-
return build_selected(
|
|
288
|
+
return build_selected(
|
|
289
|
+
&input,
|
|
290
|
+
RequestedTransportBackend::ConPty,
|
|
291
|
+
"spec.runtime.backend",
|
|
292
|
+
);
|
|
281
293
|
}
|
|
282
294
|
other => {
|
|
283
295
|
// C-1 ②: `pty` (and everything else) is NOT auto-mapped
|
|
@@ -343,8 +355,7 @@ fn build_conpty(
|
|
|
343
355
|
// NEVER silent-downgrade to tmux; that would violate MUST-NOT-13.
|
|
344
356
|
let Some(team_key) = input.team_key else {
|
|
345
357
|
return Err(TransportFactoryError::ConPtyPreconditionUnmet {
|
|
346
|
-
reason: "team_key required for conpty (design §Factory Design:159-163)"
|
|
347
|
-
.to_string(),
|
|
358
|
+
reason: "team_key required for conpty (design §Factory Design:159-163)".to_string(),
|
|
348
359
|
});
|
|
349
360
|
};
|
|
350
361
|
// Build a workspace hash from the canonical workspace path using
|
|
@@ -550,7 +561,8 @@ mod tests {
|
|
|
550
561
|
let input = TransportFactoryInput::new(&workspace, TransportPurpose::LifecycleWorker)
|
|
551
562
|
.with_team_key(Some("team-a"))
|
|
552
563
|
.with_explicit_backend(Some(RequestedTransportBackend::ConPty));
|
|
553
|
-
let resolved =
|
|
564
|
+
let resolved =
|
|
565
|
+
resolve_transport(input).expect("explicit conpty must succeed with team_key");
|
|
554
566
|
assert_eq!(resolved.kind, BackendKind::ConPty);
|
|
555
567
|
assert_eq!(resolved.source, "cli");
|
|
556
568
|
assert_eq!(resolved.team_key.as_deref(), Some("team-a"));
|
|
@@ -565,7 +577,10 @@ mod tests {
|
|
|
565
577
|
let err = resolve_transport(input).expect_err("conpty without team_key must refuse");
|
|
566
578
|
match err {
|
|
567
579
|
TransportFactoryError::ConPtyPreconditionUnmet { reason } => {
|
|
568
|
-
assert!(
|
|
580
|
+
assert!(
|
|
581
|
+
reason.contains("team_key"),
|
|
582
|
+
"reason must mention team_key: {reason}"
|
|
583
|
+
);
|
|
569
584
|
}
|
|
570
585
|
other => panic!("expected ConPtyPreconditionUnmet, got {other:?}"),
|
|
571
586
|
}
|
|
@@ -578,8 +593,8 @@ mod tests {
|
|
|
578
593
|
let input = TransportFactoryInput::new(&workspace, TransportPurpose::Launch)
|
|
579
594
|
.with_team_key(Some("team-a"))
|
|
580
595
|
.with_spec_backend_literal(Some("pty"));
|
|
581
|
-
let err =
|
|
582
|
-
.expect_err("pty literal must be refused, not auto-mapped");
|
|
596
|
+
let err =
|
|
597
|
+
resolve_transport(input).expect_err("pty literal must be refused, not auto-mapped");
|
|
583
598
|
match err {
|
|
584
599
|
TransportFactoryError::UnsupportedSpecBackendLiteral { literal } => {
|
|
585
600
|
assert_eq!(literal, "pty");
|
|
@@ -633,7 +648,10 @@ mod tests {
|
|
|
633
648
|
assert_eq!(resolved.source, "state.transport.kind");
|
|
634
649
|
// N38: one notice emitted.
|
|
635
650
|
assert_eq!(resolved.notices.len(), 1);
|
|
636
|
-
assert_eq!(
|
|
651
|
+
assert_eq!(
|
|
652
|
+
resolved.notices[0].event,
|
|
653
|
+
"transport.legacy_tmux_endpoint_ignored"
|
|
654
|
+
);
|
|
637
655
|
assert_eq!(
|
|
638
656
|
resolved.notices[0].payload["legacy_tmux_endpoint"],
|
|
639
657
|
serde_json::json!("default")
|
|
@@ -720,10 +738,7 @@ mod tests {
|
|
|
720
738
|
pipe_notices.is_empty(),
|
|
721
739
|
"CR C-5 fix: resolve must not emit pipe-client notices \
|
|
722
740
|
(connect deferred to backend lazy path). Found: {:?}",
|
|
723
|
-
pipe_notices
|
|
724
|
-
.iter()
|
|
725
|
-
.map(|n| &n.event)
|
|
726
|
-
.collect::<Vec<_>>()
|
|
741
|
+
pipe_notices.iter().map(|n| &n.event).collect::<Vec<_>>()
|
|
727
742
|
);
|
|
728
743
|
}
|
|
729
744
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@team-agent/installer",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.44",
|
|
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.44",
|
|
24
|
+
"@team-agent/cli-darwin-x64": "0.5.44",
|
|
25
|
+
"@team-agent/cli-linux-x64": "0.5.44"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"postinstall": "node npm/bincheck.mjs",
|