@team-agent/installer 0.5.118 → 0.5.119
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/db/message_store.rs +10 -3
- package/crates/team-agent/src/messaging/delivery.rs +132 -39
- package/crates/team-agent/src/messaging/delivery_consumption_tests.rs +223 -0
- package/crates/team-agent/src/messaging/enter_rescue.rs +182 -154
- package/crates/team-agent/src/messaging/enter_rescue_tests.rs +344 -277
- package/crates/team-agent/src/messaging/mod.rs +1 -1
- package/crates/team-agent/src/tmux_backend/enter_rescue.rs +325 -0
- package/crates/team-agent/src/tmux_backend/enter_rescue_tests.rs +432 -0
- package/crates/team-agent/src/tmux_backend/native_input.rs +19 -0
- package/crates/team-agent/src/tmux_backend.rs +27 -0
- package/crates/team-agent/src/transport/enter_rescue.rs +166 -0
- package/crates/team-agent/src/transport/native_input.rs +5 -1
- package/crates/team-agent/src/transport/test_support.rs +25 -0
- package/crates/team-agent/src/transport.rs +34 -0
- package/package.json +4 -4
|
@@ -57,6 +57,8 @@ struct OfflineState {
|
|
|
57
57
|
/// answer keyed by pane id. Used by leader provider health tests.
|
|
58
58
|
pane_current_commands: BTreeMap<String, String>,
|
|
59
59
|
session_owner: Option<super::SessionOwner>,
|
|
60
|
+
native_input_observation: Option<super::native_input::InputFrame>,
|
|
61
|
+
native_input_error: Option<String>,
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
impl Default for OfflineState {
|
|
@@ -85,6 +87,8 @@ impl Default for OfflineState {
|
|
|
85
87
|
capture_ranges: Vec::new(),
|
|
86
88
|
pane_current_commands: BTreeMap::new(),
|
|
87
89
|
session_owner: None,
|
|
90
|
+
native_input_observation: None,
|
|
91
|
+
native_input_error: None,
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
94
|
}
|
|
@@ -95,6 +99,16 @@ pub struct OfflineTransport {
|
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
impl OfflineTransport {
|
|
102
|
+
pub fn with_native_input_observation(self, frame: super::native_input::InputFrame) -> Self {
|
|
103
|
+
self.with_state(|state| state.native_input_observation = Some(frame));
|
|
104
|
+
self
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
pub fn with_native_input_error(self, reason: &str) -> Self {
|
|
108
|
+
self.with_state(|state| state.native_input_error = Some(reason.into()));
|
|
109
|
+
self
|
|
110
|
+
}
|
|
111
|
+
|
|
98
112
|
pub fn new() -> Self {
|
|
99
113
|
Self::default()
|
|
100
114
|
}
|
|
@@ -434,6 +448,17 @@ impl OfflineTransport {
|
|
|
434
448
|
}
|
|
435
449
|
|
|
436
450
|
impl Transport for OfflineTransport {
|
|
451
|
+
fn observe_native_input(
|
|
452
|
+
&self,
|
|
453
|
+
_target: &Target,
|
|
454
|
+
_provider: crate::model::enums::Provider,
|
|
455
|
+
) -> Result<Option<super::native_input::InputFrame>, TransportError> {
|
|
456
|
+
self.with_state(|state| match &state.native_input_error {
|
|
457
|
+
Some(reason) => Err(TransportError::NativeInputNotReady { reason: reason.clone() }),
|
|
458
|
+
None => Ok(state.native_input_observation.clone()),
|
|
459
|
+
})
|
|
460
|
+
}
|
|
461
|
+
|
|
437
462
|
fn kind(&self) -> BackendKind {
|
|
438
463
|
BackendKind::Tmux
|
|
439
464
|
}
|
|
@@ -67,6 +67,7 @@ use std::path::{Path, PathBuf};
|
|
|
67
67
|
use serde::{Deserialize, Serialize};
|
|
68
68
|
use thiserror::Error;
|
|
69
69
|
|
|
70
|
+
pub mod enter_rescue;
|
|
70
71
|
pub mod native_input;
|
|
71
72
|
|
|
72
73
|
#[cfg(test)]
|
|
@@ -989,6 +990,39 @@ pub trait Transport: Send + Sync {
|
|
|
989
990
|
Ok(report)
|
|
990
991
|
}
|
|
991
992
|
|
|
993
|
+
/// Observation only; None means this backend/provider has no native parser.
|
|
994
|
+
/// An implemented parser with an incomplete frame returns an error, not absence.
|
|
995
|
+
fn observe_native_input(
|
|
996
|
+
&self,
|
|
997
|
+
_target: &Target,
|
|
998
|
+
_provider: crate::model::enums::Provider,
|
|
999
|
+
) -> Result<Option<native_input::InputFrame>, TransportError> {
|
|
1000
|
+
Ok(None)
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/// Snapshot the original attempted target without submitting or adopting a capsule.
|
|
1004
|
+
fn snapshot_enter_rescue(
|
|
1005
|
+
&self,
|
|
1006
|
+
_target: &Target,
|
|
1007
|
+
context: &enter_rescue::EnterRescueContext,
|
|
1008
|
+
_rendered_payload: &str,
|
|
1009
|
+
) -> Result<enter_rescue::EnterRescueContext, TransportError> {
|
|
1010
|
+
Ok(context.clone())
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
/// Independent delayed Enter-only watchdog, not native-input admission.
|
|
1014
|
+
fn rescue_enter_guarded(
|
|
1015
|
+
&self,
|
|
1016
|
+
_context: &enter_rescue::EnterRescueContext,
|
|
1017
|
+
_authorize: &dyn Fn() -> bool,
|
|
1018
|
+
_observer: Option<&dyn SubmitObserver>,
|
|
1019
|
+
) -> Result<enter_rescue::EnterRescueOutcome, TransportError> {
|
|
1020
|
+
Ok(enter_rescue::EnterRescueOutcome::NoEffect {
|
|
1021
|
+
reason: "unsupported_backend",
|
|
1022
|
+
reobserve: false,
|
|
1023
|
+
})
|
|
1024
|
+
}
|
|
1025
|
+
|
|
992
1026
|
/// Enter-only recovery; unsupported backends have an explicit zero-effect refusal.
|
|
993
1027
|
fn rescue_enter(&self, _evidence: &native_input::NativeInputEvidence, _authorize: &dyn Fn() -> bool, _observer: Option<&dyn SubmitObserver>)
|
|
994
1028
|
-> Result<native_input::EnterRescueOutcome, TransportError>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@team-agent/installer",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.119",
|
|
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.119",
|
|
24
|
+
"@team-agent/cli-darwin-x64": "0.5.119",
|
|
25
|
+
"@team-agent/cli-linux-x64": "0.5.119"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"postinstall": "node npm/bincheck.mjs",
|