@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
|
@@ -1,203 +1,194 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
|
|
2
|
+
use super::*;
|
|
3
|
+
use std::collections::BTreeMap;
|
|
4
|
+
use std::path::Path;
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
// —— 每个 daemon 可达方法 `unimplemented!()` 的 stub:驱动 trait 即 RED ——
|
|
7
|
+
struct StubBackend(BackendKind);
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
9
|
+
impl Transport for StubBackend {
|
|
10
|
+
fn kind(&self) -> BackendKind {
|
|
11
|
+
self.0
|
|
12
|
+
}
|
|
13
|
+
fn spawn_first(
|
|
14
|
+
&self,
|
|
15
|
+
session: &SessionName,
|
|
16
|
+
window: &WindowName,
|
|
17
|
+
argv: &[String],
|
|
18
|
+
cwd: &Path,
|
|
19
|
+
env: &BTreeMap<String, String>,
|
|
20
|
+
) -> Result<SpawnResult, TransportError> {
|
|
21
|
+
let _ = (argv, cwd, env);
|
|
22
|
+
Ok(SpawnResult {
|
|
23
|
+
pane_id: PaneId::new(format!("%{}-{}", session.as_str(), window.as_str())),
|
|
24
|
+
session: session.clone(),
|
|
25
|
+
window: window.clone(),
|
|
26
|
+
child_pid: Some(1000),
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
fn spawn_into(
|
|
30
|
+
&self,
|
|
31
|
+
session: &SessionName,
|
|
32
|
+
window: &WindowName,
|
|
33
|
+
argv: &[String],
|
|
34
|
+
cwd: &Path,
|
|
35
|
+
env: &BTreeMap<String, String>,
|
|
36
|
+
) -> Result<SpawnResult, TransportError> {
|
|
37
|
+
let _ = (argv, cwd, env);
|
|
38
|
+
Ok(SpawnResult {
|
|
39
|
+
pane_id: PaneId::new(format!("%{}-{}", session.as_str(), window.as_str())),
|
|
40
|
+
session: session.clone(),
|
|
41
|
+
window: window.clone(),
|
|
42
|
+
child_pid: Some(1001),
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
fn inject(
|
|
46
|
+
&self,
|
|
47
|
+
target: &Target,
|
|
48
|
+
payload: &InjectPayload,
|
|
49
|
+
submit: Key,
|
|
50
|
+
bracketed: bool,
|
|
51
|
+
) -> Result<InjectReport, TransportError> {
|
|
52
|
+
let _ = (target, bracketed);
|
|
53
|
+
let (inject_verification, turn_verification) = match payload {
|
|
54
|
+
InjectPayload::Empty => (
|
|
55
|
+
InjectVerification::EmptyTextSendKeys,
|
|
56
|
+
TurnVerification::NotRequired,
|
|
57
|
+
),
|
|
58
|
+
InjectPayload::Text(text) | InjectPayload::TextSkipConsumptionPoll(text)
|
|
59
|
+
if text.contains("[team-agent-token:") =>
|
|
60
|
+
{
|
|
60
61
|
(
|
|
61
62
|
InjectVerification::CaptureContainsToken,
|
|
62
63
|
TurnVerification::NotYetObserved,
|
|
63
|
-
)
|
|
64
|
-
InjectPayload::Text(_) | InjectPayload::TextSkipConsumptionPoll(_) => (
|
|
65
|
-
InjectVerification::NoToken,
|
|
66
|
-
TurnVerification::NotYetObserved,
|
|
67
|
-
),
|
|
68
|
-
};
|
|
69
|
-
let submit_verification = match submit {
|
|
70
|
-
Key::Enter => SubmitVerification::EnterSentWithoutPlaceholderCheck,
|
|
71
|
-
key => SubmitVerification::KeySentAfterVisibleToken { key },
|
|
72
|
-
};
|
|
73
|
-
Ok(InjectReport {
|
|
74
|
-
stage_reached: InjectStage::Submit,
|
|
75
|
-
inject_verification,
|
|
76
|
-
submit_verification,
|
|
77
|
-
turn_verification,
|
|
78
|
-
attempts: 1,
|
|
79
|
-
submit_diagnostics: None,
|
|
80
|
-
})
|
|
81
|
-
}
|
|
82
|
-
fn send_keys(&self, _target: &Target, _keys: &[Key]) -> Result<(), TransportError> {
|
|
83
|
-
Ok(())
|
|
84
|
-
}
|
|
85
|
-
fn capture(
|
|
86
|
-
&self,
|
|
87
|
-
target: &Target,
|
|
88
|
-
range: CaptureRange,
|
|
89
|
-
) -> Result<CapturedText, TransportError> {
|
|
90
|
-
let _ = target;
|
|
91
|
-
Ok(CapturedText {
|
|
92
|
-
text: normalize_capture("line one \nbusy\u{a0}marker \n \n"),
|
|
93
|
-
range,
|
|
94
|
-
})
|
|
95
|
-
}
|
|
96
|
-
fn query(
|
|
97
|
-
&self,
|
|
98
|
-
_target: &Target,
|
|
99
|
-
field: PaneField,
|
|
100
|
-
) -> Result<Option<String>, TransportError> {
|
|
101
|
-
if self.0 != BackendKind::Tmux && field == PaneField::PaneMode {
|
|
102
|
-
return Ok(None);
|
|
103
|
-
}
|
|
104
|
-
let value = match field {
|
|
105
|
-
PaneField::PaneId => "%7",
|
|
106
|
-
PaneField::PaneMode => "0",
|
|
107
|
-
PaneField::PaneWidth => "120",
|
|
108
|
-
PaneField::PaneCurrentCommand => "sh",
|
|
109
|
-
PaneField::PaneCurrentPath => "/tmp/ws",
|
|
110
|
-
PaneField::SessionName => "team-sess",
|
|
111
|
-
PaneField::PaneTty => "/dev/ttys000",
|
|
112
|
-
};
|
|
113
|
-
Ok(Some(value.to_string()))
|
|
114
|
-
}
|
|
115
|
-
fn liveness(&self, pane: &PaneId) -> Result<PaneLiveness, TransportError> {
|
|
116
|
-
if self.0 == BackendKind::ConPty && pane.as_str() == "foreign-leader" {
|
|
117
|
-
return Ok(PaneLiveness::Unknown);
|
|
64
|
+
)
|
|
118
65
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
fn list_windows(
|
|
155
|
-
&self,
|
|
156
|
-
_session: &SessionName,
|
|
157
|
-
) -> Result<Vec<WindowName>, TransportError> {
|
|
158
|
-
Ok(vec![WindowName::new("win-1"), WindowName::new("worker-2")])
|
|
159
|
-
}
|
|
160
|
-
fn set_session_env(
|
|
161
|
-
&self,
|
|
162
|
-
_session: &SessionName,
|
|
163
|
-
_key: &str,
|
|
164
|
-
_value: &str,
|
|
165
|
-
) -> Result<SetEnvOutcome, TransportError> {
|
|
166
|
-
match self.0 {
|
|
167
|
-
BackendKind::Tmux => Ok(SetEnvOutcome::Applied),
|
|
168
|
-
BackendKind::WezTerm | BackendKind::ConPty => Ok(SetEnvOutcome::InternalizedAtSpawn),
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
fn kill_session(&self, _session: &SessionName) -> Result<(), TransportError> {
|
|
172
|
-
Ok(())
|
|
66
|
+
InjectPayload::Text(_) | InjectPayload::TextSkipConsumptionPoll(_) => (
|
|
67
|
+
InjectVerification::NoToken,
|
|
68
|
+
TurnVerification::NotYetObserved,
|
|
69
|
+
),
|
|
70
|
+
};
|
|
71
|
+
let submit_verification = match submit {
|
|
72
|
+
Key::Enter => SubmitVerification::EnterSentWithoutPlaceholderCheck,
|
|
73
|
+
key => SubmitVerification::KeySentAfterVisibleToken { key },
|
|
74
|
+
};
|
|
75
|
+
Ok(InjectReport {
|
|
76
|
+
stage_reached: InjectStage::Submit,
|
|
77
|
+
inject_verification,
|
|
78
|
+
submit_verification,
|
|
79
|
+
turn_verification,
|
|
80
|
+
attempts: 1,
|
|
81
|
+
submit_diagnostics: None,
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
fn send_keys(&self, _target: &Target, _keys: &[Key]) -> Result<(), TransportError> {
|
|
85
|
+
Ok(())
|
|
86
|
+
}
|
|
87
|
+
fn capture(
|
|
88
|
+
&self,
|
|
89
|
+
target: &Target,
|
|
90
|
+
range: CaptureRange,
|
|
91
|
+
) -> Result<CapturedText, TransportError> {
|
|
92
|
+
let _ = target;
|
|
93
|
+
Ok(CapturedText {
|
|
94
|
+
text: normalize_capture("line one \nbusy\u{a0}marker \n \n"),
|
|
95
|
+
range,
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
fn query(&self, _target: &Target, field: PaneField) -> Result<Option<String>, TransportError> {
|
|
99
|
+
if self.0 != BackendKind::Tmux && field == PaneField::PaneMode {
|
|
100
|
+
return Ok(None);
|
|
173
101
|
}
|
|
174
|
-
|
|
175
|
-
|
|
102
|
+
let value = match field {
|
|
103
|
+
PaneField::PaneId => "%7",
|
|
104
|
+
PaneField::PaneMode => "0",
|
|
105
|
+
PaneField::PaneWidth => "120",
|
|
106
|
+
PaneField::PaneCurrentCommand => "sh",
|
|
107
|
+
PaneField::PaneCurrentPath => "/tmp/ws",
|
|
108
|
+
PaneField::SessionName => "team-sess",
|
|
109
|
+
PaneField::PaneTty => "/dev/ttys000",
|
|
110
|
+
};
|
|
111
|
+
Ok(Some(value.to_string()))
|
|
112
|
+
}
|
|
113
|
+
fn liveness(&self, pane: &PaneId) -> Result<PaneLiveness, TransportError> {
|
|
114
|
+
if self.0 == BackendKind::ConPty && pane.as_str() == "foreign-leader" {
|
|
115
|
+
return Ok(PaneLiveness::Unknown);
|
|
176
116
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
117
|
+
Ok(PaneLiveness::Live)
|
|
118
|
+
}
|
|
119
|
+
fn list_targets(&self) -> Result<Vec<PaneInfo>, TransportError> {
|
|
120
|
+
Ok(vec![
|
|
121
|
+
PaneInfo {
|
|
122
|
+
pane_id: PaneId::new("%team-sess-win-1"),
|
|
123
|
+
session: SessionName::new("team-sess"),
|
|
124
|
+
window_index: Some(0),
|
|
125
|
+
window_name: Some(WindowName::new("win-1")),
|
|
126
|
+
pane_index: Some(0),
|
|
127
|
+
tty: Some("/dev/ttys001".to_string()),
|
|
128
|
+
current_command: Some("sh".to_string()),
|
|
129
|
+
current_path: Some(PathBuf::from("/tmp/ws")),
|
|
130
|
+
active: true,
|
|
131
|
+
pane_pid: Some(1000),
|
|
132
|
+
leader_env: BTreeMap::new(),
|
|
133
|
+
},
|
|
134
|
+
PaneInfo {
|
|
135
|
+
pane_id: PaneId::new("%team-sess-worker-2"),
|
|
136
|
+
session: SessionName::new("team-sess"),
|
|
137
|
+
window_index: Some(1),
|
|
138
|
+
window_name: Some(WindowName::new("worker-2")),
|
|
139
|
+
pane_index: Some(0),
|
|
140
|
+
tty: Some("/dev/ttys002".to_string()),
|
|
141
|
+
current_command: Some("sh".to_string()),
|
|
142
|
+
current_path: Some(PathBuf::from("/tmp/ws")),
|
|
143
|
+
active: true,
|
|
144
|
+
pane_pid: Some(1001),
|
|
145
|
+
leader_env: BTreeMap::new(),
|
|
146
|
+
},
|
|
147
|
+
])
|
|
148
|
+
}
|
|
149
|
+
fn has_session(&self, _session: &SessionName) -> Result<bool, TransportError> {
|
|
150
|
+
Ok(true)
|
|
151
|
+
}
|
|
152
|
+
fn list_windows(&self, _session: &SessionName) -> Result<Vec<WindowName>, TransportError> {
|
|
153
|
+
Ok(vec![WindowName::new("win-1"), WindowName::new("worker-2")])
|
|
154
|
+
}
|
|
155
|
+
fn set_session_env(
|
|
156
|
+
&self,
|
|
157
|
+
_session: &SessionName,
|
|
158
|
+
_key: &str,
|
|
159
|
+
_value: &str,
|
|
160
|
+
) -> Result<SetEnvOutcome, TransportError> {
|
|
161
|
+
match self.0 {
|
|
162
|
+
BackendKind::Tmux => Ok(SetEnvOutcome::Applied),
|
|
163
|
+
BackendKind::WezTerm | BackendKind::ConPty => Ok(SetEnvOutcome::InternalizedAtSpawn),
|
|
188
164
|
}
|
|
189
165
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
StubBackend(BackendKind::Tmux)
|
|
166
|
+
fn kill_session(&self, _session: &SessionName) -> Result<(), TransportError> {
|
|
167
|
+
Ok(())
|
|
193
168
|
}
|
|
194
|
-
fn
|
|
195
|
-
|
|
169
|
+
fn kill_window(&self, _target: &Target) -> Result<(), TransportError> {
|
|
170
|
+
Ok(())
|
|
196
171
|
}
|
|
197
|
-
fn
|
|
198
|
-
|
|
172
|
+
fn attach_session(&self, _session: &SessionName) -> Result<AttachOutcome, TransportError> {
|
|
173
|
+
match self.0 {
|
|
174
|
+
BackendKind::Tmux => Ok(AttachOutcome::Attached),
|
|
175
|
+
BackendKind::WezTerm => Ok(AttachOutcome::GuiAttachIsImplicit),
|
|
176
|
+
BackendKind::ConPty => Ok(AttachOutcome::Unsupported {
|
|
177
|
+
reason: "conpty has no attach concept".to_string(),
|
|
178
|
+
}),
|
|
179
|
+
}
|
|
199
180
|
}
|
|
181
|
+
}
|
|
200
182
|
|
|
183
|
+
fn tmux() -> StubBackend {
|
|
184
|
+
StubBackend(BackendKind::Tmux)
|
|
185
|
+
}
|
|
186
|
+
fn wezterm() -> StubBackend {
|
|
187
|
+
StubBackend(BackendKind::WezTerm)
|
|
188
|
+
}
|
|
189
|
+
fn conpty() -> StubBackend {
|
|
190
|
+
StubBackend(BackendKind::ConPty)
|
|
191
|
+
}
|
|
201
192
|
|
|
202
|
-
mod wire;
|
|
203
193
|
mod behavior;
|
|
194
|
+
mod wire;
|