Complete agent monitoring and Galaxy Control integration

- expose command-monitor conversations and preserve visible agent transcripts
- add bounded polling and a dedicated shell interrupt tool
- improve direct-provider images, skills, tool history, and usage handling
- package and brand Galaxy Control across releases, installers, persistence, and docs
This commit is contained in:
2026-07-29 15:04:58 -05:00
parent 100f1eff1c
commit dbfa8bcd48
172 changed files with 6357 additions and 3825 deletions
+24
View File
@@ -314,6 +314,20 @@ impl AIAgentActionType {
matches!(self, Self::WriteToLongRunningShellCommand { .. })
}
/// Returns whether this action represents an exact terminal interrupt (Ctrl+C).
///
/// Direct AI providers expose a typed `interrupt_shell_command` tool, but encode it through
/// the existing write-to-PTY protobuf for backwards compatibility. Keeping this predicate on
/// the shared action type lets execution and UI code distinguish that typed operation from
/// ordinary process input without relying on printable escape spellings from the model.
pub fn is_shell_command_interrupt(&self) -> bool {
matches!(
self,
Self::WriteToLongRunningShellCommand { input, mode, .. }
if mode.is_shell_interrupt(input)
)
}
pub fn cancelled_result(&self) -> AIAgentActionResultType {
match self {
Self::RequestCommandOutput { .. } => AIAgentActionResultType::RequestCommandOutput(
@@ -802,6 +816,12 @@ pub enum AIAgentPtyWriteMode {
}
impl AIAgentPtyWriteMode {
pub fn is_shell_interrupt(self, bytes: &[u8]) -> bool {
use galaxy_terminal::model::escape_sequences;
self == Self::Raw && bytes == [escape_sequences::C0::ETX]
}
/// Decorates input bytes according to the write mode.
pub fn decorate_bytes(
self,
@@ -928,3 +948,7 @@ impl FileEdit {
}
}
}
#[cfg(test)]
#[path = "mod_tests.rs"]
mod tests;
+12
View File
@@ -0,0 +1,12 @@
use galaxy_terminal::model::escape_sequences;
use super::AIAgentPtyWriteMode;
#[test]
fn raw_etx_is_the_only_shell_interrupt_payload() {
assert!(AIAgentPtyWriteMode::Raw.is_shell_interrupt(&[escape_sequences::C0::ETX]));
assert!(!AIAgentPtyWriteMode::Raw.is_shell_interrupt(b"C-c"));
assert!(!AIAgentPtyWriteMode::Raw.is_shell_interrupt(br"\u0003"));
assert!(!AIAgentPtyWriteMode::Line.is_shell_interrupt(&[escape_sequences::C0::ETX]));
assert!(!AIAgentPtyWriteMode::Block.is_shell_interrupt(&[escape_sequences::C0::ETX]));
}