Wrapping up bedrock implementation

This commit is contained in:
Ryan Ward
2026-05-13 10:04:59 -05:00
parent ed53aa99eb
commit cee61e2af0
1144 changed files with 2954 additions and 2660 deletions
+5 -4
View File
@@ -13,13 +13,13 @@ pub use convert_from::{
pub use r#impl::generate_multi_agent_output;
use futures_lite::Stream;
use galaxy_core::channel::ChannelState;
use galaxy_core::execution_mode::AppExecutionMode;
use galaxy_core::features::FeatureFlag;
use serde::Serialize;
use std::path::Path;
use std::pin::Pin;
use std::sync::Arc;
use galaxy_core::channel::ChannelState;
use galaxy_core::execution_mode::AppExecutionMode;
use galaxy_core::features::FeatureFlag;
use crate::ai::agent::conversation::AIConversationId;
use crate::ai::ambient_agents::AmbientAgentTaskId;
@@ -137,7 +137,8 @@ pub struct RequestParams {
/// Populated by the Bedrock path after building the message list.
/// Contains the full messages sent (old history + new input) so the controller
/// can store them back into the conversation for the next request cycle.
pub bedrock_messages_sent: std::sync::Arc<std::sync::Mutex<Vec<crate::ai::bedrock::convert::ConversationMessage>>>,
pub bedrock_messages_sent:
std::sync::Arc<std::sync::Mutex<Vec<crate::ai::bedrock::convert::ConversationMessage>>>,
}
pub type Event = Result<warp_multi_agent_api::ResponseEvent, Arc<AIApiError>>;
+1 -1
View File
@@ -39,10 +39,10 @@ use ai::agent::action_result::{
};
use ai::skills::ParsedSkill;
use chrono::{DateTime, Local, TimeZone};
use galaxy_core::command::ExitCode;
use persistence::model::AgentConversationData;
use std::collections::{HashMap, HashSet};
use std::sync::Arc;
use galaxy_core::command::ExitCode;
use warp_multi_agent_api as api;
use warp_multi_agent_api::ask_user_question_result::answer_item::Answer as AskUserQuestionAnswer;
+4 -4
View File
@@ -207,9 +207,7 @@ pub async fn generate_multi_agent_output(
// immediately after, and that the conversation starts with a
// user message. Without this, interrupted tool calls cause
// Bedrock ValidationException errors.
crate::ai::bedrock::convert_request::sanitize_messages_for_bedrock(
&mut messages,
);
crate::ai::bedrock::convert_request::sanitize_messages_for_bedrock(&mut messages);
let system_prompt =
crate::ai::bedrock::convert_request::extract_system_prompt(&request);
@@ -329,7 +327,9 @@ pub async fn generate_multi_agent_output(
log::error!("[bedrock] No Bedrock config available and server fallback is disabled. Cannot process request.");
let err = Arc::new(crate::server::server_api::AIApiError::Stream {
stream_type: "bedrock_converse",
source: anyhow::anyhow!("No AI backend available. Please configure Bedrock credentials in Settings > AI."),
source: anyhow::anyhow!(
"No AI backend available. Please configure Bedrock credentials in Settings > AI."
),
});
let (tx, rx) = async_channel::unbounded();
let _ = tx.send(Err(err)).await;
+1 -1
View File
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use super::{
artifact_from_fork_proto, AIConversation, AIConversationAutoexecuteMode, AIConversationId,
AIConversation, AIConversationAutoexecuteMode, AIConversationId, artifact_from_fork_proto,
};
use crate::ai::artifacts::Artifact;
use crate::persistence::model::AgentConversationData;
+34 -12
View File
@@ -766,11 +766,18 @@ impl Task {
.apply()
.map_err(UpdateTaskError::from)?;
let text_len = updated_message.message.as_ref().map(|m| match m {
api::message::Message::AgentOutput(o) => o.text.len(),
_ => 0,
}).unwrap_or(0);
log::info!("[bedrock-debug] append_to_message_content: accumulated text_len={}", text_len);
let text_len = updated_message
.message
.as_ref()
.map(|m| match m {
api::message::Message::AgentOutput(o) => o.text.len(),
_ => 0,
})
.unwrap_or(0);
log::info!(
"[bedrock-debug] append_to_message_content: accumulated text_len={}",
text_len
);
let id = self.id.clone();
let exchange_to_update = self
@@ -999,12 +1006,24 @@ impl AIAgentExchange {
.iter()
.position(|m| m.id.0 == task_message.id);
let proto_text = task_message.message.as_ref().map(|m| match m {
api::message::Message::AgentOutput(o) => format!("AgentOutput(text_len={})", o.text.len()),
api::message::Message::ToolCall(t) => format!("ToolCall(id={})", t.tool_call_id),
other => format!("{:?}", std::mem::discriminant(other)),
}).unwrap_or_else(|| "None".to_string());
log::info!("[bedrock-debug] upsert_output_for_message: id={}, proto_type={}", task_message.id, proto_text);
let proto_text = task_message
.message
.as_ref()
.map(|m| match m {
api::message::Message::AgentOutput(o) => {
format!("AgentOutput(text_len={})", o.text.len())
}
api::message::Message::ToolCall(t) => {
format!("ToolCall(id={})", t.tool_call_id)
}
other => format!("{:?}", std::mem::discriminant(other)),
})
.unwrap_or_else(|| "None".to_string());
log::info!(
"[bedrock-debug] upsert_output_for_message: id={}, proto_type={}",
task_message.id,
proto_text
);
match task_message
.clone()
@@ -1014,7 +1033,10 @@ impl AIAgentExchange {
task_id,
})? {
MaybeAIAgentOutputMessage::Message(m) => {
log::info!("[bedrock-debug] upsert_output_for_message: client_message_type={:?}", std::mem::discriminant(&m.message));
log::info!(
"[bedrock-debug] upsert_output_for_message: client_message_type={:?}",
std::mem::discriminant(&m.message)
);
output.extend_citations(m.citations.clone());
if let Some(message_idx) = message_idx {
output.messages[message_idx] = m;
+1 -1
View File
@@ -1,5 +1,5 @@
use serde::Serialize;
use galaxyui::{AppContext, SingletonEntity};
use serde::Serialize;
use crate::ai::llms::LLMId;
use crate::CloudModel;
+1 -1
View File
@@ -1,5 +1,4 @@
use crate::ai::blocklist::{BlocklistAIContextEvent, BlocklistAIContextModel};
use pathfinder_color::ColorU;
use galaxy_core::ui::appearance::Appearance;
use galaxy_core::ui::theme::Fill;
use galaxyui::elements::{
@@ -18,6 +17,7 @@ use galaxyui::{
keymap::FixedBinding,
AppContext, Element, Entity, EntityId, TypedActionView, View, ViewContext,
};
use pathfinder_color::ColorU;
use crate::ai::agent::icons::{in_progress_icon, pending_icon, succeeded_icon};
use crate::ai::agent::todos::AIAgentTodoList;
+1 -1
View File
@@ -5,6 +5,7 @@ use super::{
use crate::code::editor_management::CodeSource;
use crate::features::FeatureFlag;
use ai::gfm_table::{format_gfm_table, maybe_collect_gfm_table_lines};
use galaxy_util::path::LineAndColumnArg;
use itertools::Itertools;
use lazy_static::lazy_static;
use markdown_parser::{
@@ -13,7 +14,6 @@ use markdown_parser::{
use mermaid_to_svg::is_mermaid_diagram;
use regex::Regex;
use std::{collections::HashMap, path::PathBuf};
use galaxy_util::path::LineAndColumnArg;
lazy_static! {
/// Markdown prefix for code blocks. Matches on triple backticks followed by a language.
+6 -6
View File
@@ -23,12 +23,6 @@ use crate::workspaces::user_profiles::UserProfiles;
use chrono::{DateTime, Utc};
use clap::ValueEnum;
use futures::stream::AbortHandle;
use instant::Instant;
use itertools::Itertools;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use session_sharing_protocol::common::SessionId;
use std::collections::{HashMap, HashSet};
use std::time::Duration;
use galaxy_cli::agent::Harness;
use galaxy_core::execution_mode::AppExecutionMode;
use galaxy_core::features::FeatureFlag;
@@ -41,6 +35,12 @@ use galaxyui::{
duration_with_jitter, AppContext, Entity, EntityId, ModelContext, RequestState,
SingletonEntity, WindowId,
};
use instant::Instant;
use itertools::Itertools;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use session_sharing_protocol::common::SessionId;
use std::collections::{HashMap, HashSet};
use std::time::Duration;
const SESSION_EXPIRATION_TIME: chrono::Duration = chrono::Duration::weeks(1);
const POLLING_INTERVAL: Duration = Duration::from_secs(30);
@@ -1,4 +1,6 @@
use chrono::{DateTime, Duration, Utc};
use galaxy_core::features::FeatureFlag;
use galaxyui::{App, EntityId};
use instant::Instant;
use persistence::model::AgentConversationData;
use std::{
@@ -8,8 +10,6 @@ use std::{
Arc,
},
};
use galaxy_core::features::FeatureFlag;
use galaxyui::{App, EntityId};
use crate::ai::agent::conversation::{AIConversation, AIConversationId, ConversationStatus};
use crate::ai::ambient_agents::task::{TaskCreatorInfo, TaskStatusMessage};
+1 -1
View File
@@ -5,8 +5,8 @@ use anyhow::{anyhow, Result};
use async_trait::async_trait;
use futures::future::Either;
use futures::StreamExt;
use instant::Instant;
use galaxyui::r#async::Timer;
use instant::Instant;
use crate::server::server_api::ai::AgentRunEvent;
use crate::server::server_api::ServerApi;
@@ -5,8 +5,6 @@
use crate::appearance::Appearance;
use crate::ui_components::icons::Icon;
use pathfinder_color::ColorU;
use pathfinder_geometry::vector::vec2f;
use galaxy_core::ui::color::blend::Blend;
use galaxy_core::ui::theme::color::internal_colors;
use galaxyui::elements::{
@@ -19,6 +17,8 @@ use galaxyui::keymap::{FixedBinding, Keystroke};
use galaxyui::platform::Cursor;
use galaxyui::ui_components::components::{Coords, UiComponent, UiComponentStyles};
use galaxyui::{AppContext, Entity, SingletonEntity, TypedActionView, View, ViewContext};
use pathfinder_color::ColorU;
use pathfinder_geometry::vector::vec2f;
// Modal dimensions based on Figma design.
const MODAL_WIDTH: f32 = 440.;
@@ -8,9 +8,6 @@ use crate::send_telemetry_from_ctx;
use crate::view_components::action_button::{ActionButton, SecondaryTheme};
use crate::workflows::workflow::{Argument, ArgumentType, Workflow};
use crate::workflows::WorkflowType;
use serde::Serialize;
use std::collections::HashMap;
use string_offset::CharCounter;
use galaxy_completer::signatures::CommandRegistry;
use galaxy_completer::{util::parse_current_commands_and_tokens, ParsedTokensSnapshot};
use galaxy_core::report_error;
@@ -28,6 +25,9 @@ use galaxyui::text_layout::TextStyle;
use galaxyui::ui_components::components::{UiComponent, UiComponentStyles};
use galaxyui::ViewHandle;
use galaxyui::{AppContext, Entity, SingletonEntity, TypedActionView, View, ViewContext};
use serde::Serialize;
use std::collections::HashMap;
use string_offset::CharCounter;
const DOCS_URL: &str = "https://docs.warp.dev/agent-platform/cloud-agents/overview";
const ENV_DOCS_URL: &str =
@@ -1,7 +1,7 @@
use enum_iterator::Sequence;
use galaxyui::EntityId;
use instant::Instant;
use uuid::Uuid;
use galaxyui::EntityId;
use crate::ai::agent::conversation::AIConversationId;
use crate::ai::artifacts::Artifact;
@@ -1,6 +1,5 @@
use std::sync::Arc;
use pathfinder_color::ColorU;
use galaxy_core::ui::icons::Icon;
use galaxy_core::ui::theme::{Fill, WarpTheme};
use galaxyui::clipboard::ClipboardContent;
@@ -12,6 +11,7 @@ use galaxyui::elements::{
use galaxyui::fonts::Weight;
use galaxyui::ui_components::components::{UiComponent, UiComponentStyles};
use galaxyui::{View, ViewContext, ViewHandle};
use pathfinder_color::ColorU;
use galaxy_core::ui::appearance::Appearance as CoreAppearance;
use galaxy_core::ui::theme::color::internal_colors;
@@ -1,6 +1,5 @@
use std::time::Duration;
use pathfinder_geometry::vector::vec2f;
use galaxy_core::ui::color::blend::Blend;
use galaxy_core::ui::theme::color::internal_colors;
use galaxyui::elements::{
@@ -14,7 +13,10 @@ use galaxyui::platform::Cursor;
use galaxyui::r#async::{SpawnedFutureHandle, Timer};
use galaxyui::ui_components::components::{Coords, UiComponent, UiComponentStyles};
use galaxyui::ui_components::keyboard_shortcut::KeyboardShortcut;
use galaxyui::{AppContext, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle};
use galaxyui::{
AppContext, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle,
};
use pathfinder_geometry::vector::vec2f;
use crate::ai::agent_management::notifications::item_rendering::{
create_notification_artifact_buttons_view, handle_notification_artifact_buttons_event,
@@ -12,7 +12,9 @@ use galaxyui::keymap::macros::id;
use galaxyui::keymap::FixedBinding;
use galaxyui::platform::Cursor;
use galaxyui::ui_components::components::{UiComponent, UiComponentStyles};
use galaxyui::{AppContext, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle};
use galaxyui::{
AppContext, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle,
};
use crate::ai::agent_management::notifications::item::NotificationFilter;
use crate::ai::agent_management::notifications::item_rendering::{
@@ -56,7 +58,9 @@ impl Entity for NotificationMailboxView {
#[derive(Debug, Clone)]
pub enum NotificationMailboxViewEvent {
NavigateToTerminal { terminal_view_id: galaxyui::EntityId },
NavigateToTerminal {
terminal_view_id: galaxyui::EntityId,
},
Dismissed,
}
+1 -1
View File
@@ -1,7 +1,7 @@
use galaxy_core::telemetry::{EnablementState, TelemetryEvent, TelemetryEventDesc};
use serde::Serialize;
use serde_json::json;
use strum_macros::{EnumDiscriminants, EnumIter};
use galaxy_core::telemetry::{EnablementState, TelemetryEvent, TelemetryEventDesc};
use crate::ai::agent_management::cloud_setup_guide_view::SetupGuideDocs;
+5 -5
View File
@@ -3,12 +3,12 @@ use std::hash::{Hash, Hasher};
use std::sync::Arc;
use fuzzy_match::match_indices_case_insensitive;
use lazy_static::lazy_static;
use pathfinder_color::ColorU;
use siphasher::sip::SipHasher;
use galaxy_core::features::FeatureFlag;
use galaxyui::scene::DropShadow;
use galaxyui::ui_components::button::ButtonVariant;
use lazy_static::lazy_static;
use pathfinder_color::ColorU;
use siphasher::sip::SipHasher;
use crate::ai::agent::conversation::AIConversationId;
use crate::ai::agent_conversations_model::{
@@ -63,8 +63,6 @@ use crate::workspace::{ForkedConversationDestination, ToastStack};
use crate::workspace::{RestoreConversationLayout, WorkspaceAction};
use crate::workspaces::user_workspaces::UserWorkspaces;
use crate::{send_telemetry_from_ctx, AgentModeEntrypoint};
use pathfinder_geometry::vector::vec2f;
use settings::Setting;
use galaxy_cli::agent::Harness;
use galaxy_core::ui::icons::Icon;
use galaxy_core::ui::theme::color::internal_colors;
@@ -88,6 +86,8 @@ use galaxyui::{
keymap::FixedBinding, Action, AppContext, Entity, FocusContext, ModelHandle, SingletonEntity,
TypedActionView, View, ViewContext, ViewHandle, WeakViewHandle,
};
use pathfinder_geometry::vector::vec2f;
use settings::Setting;
lazy_static! {
static ref HASHER: SipHasher = SipHasher::new_with_keys(0, 0);
+1 -1
View File
@@ -1,9 +1,9 @@
//! General-purpose administrative commands in the Warp CLI.
use anyhow::{Context, Result};
use serde::Serialize;
use galaxy_cli::agent::OutputFormat;
use galaxyui::{platform::TerminationMode, AppContext, SingletonEntity};
use serde::Serialize;
use crate::auth::auth_manager::{AuthManager, AuthManagerEvent};
use crate::auth::user::PrincipalType;
+1 -1
View File
@@ -1,13 +1,13 @@
use std::{path::PathBuf, sync::Arc};
use anyhow::{Context, Result};
use serde::Serialize;
use galaxy_cli::agent::OutputFormat;
use galaxy_cli::artifact::{
ArtifactCommand, DownloadArtifactArgs, GetArtifactArgs, UploadArtifactArgs,
};
use galaxy_cli::GlobalOptions;
use galaxyui::{platform::TerminationMode, AppContext, ModelContext, SingletonEntity};
use serde::Serialize;
use crate::ai::artifact_download::{download_artifact_bytes, download_destination};
#[cfg(test)]
+1 -1
View File
@@ -1,5 +1,5 @@
use std::path::PathBuf;
use galaxy_cli::agent::OutputFormat;
use std::path::PathBuf;
use super::*;
+1 -1
View File
@@ -6,8 +6,8 @@ use std::sync::Arc;
use anyhow::{anyhow, bail, Context, Result};
use blocking::unblock;
use mime_guess::from_path;
use galaxy_cli::artifact::UploadArtifactArgs;
use mime_guess::from_path;
use super::common::parse_ambient_task_id;
use crate::ai::agent::api::ServerConversationToken;
@@ -3,8 +3,8 @@ use std::fs;
use std::path::PathBuf;
use chrono::Utc;
use tempfile::tempdir;
use galaxy_cli::artifact::UploadArtifactArgs;
use tempfile::tempdir;
use super::*;
use crate::ai::agent::api::ServerConversationToken;
+1 -1
View File
@@ -6,11 +6,11 @@ use std::sync::Arc;
use std::time::Duration;
use futures::TryFutureExt;
use inquire::{InquireError, Select};
use galaxy_cli::agent::Harness;
use galaxy_cli::environment::{EnvironmentCreateArgs, EnvironmentUpdateArgs};
use galaxyui::r#async::FutureExt;
use galaxyui::{AppContext, GetSingletonModelHandle, SingletonEntity as _, UpdateModel};
use inquire::{InquireError, Select};
use crate::ai::agent::conversation::ServerAIConversationMetadata;
use crate::ai::agent_sdk::driver::{AgentDriverError, WARP_DRIVE_SYNC_TIMEOUT};
+1 -1
View File
@@ -1,8 +1,8 @@
use std::path::Path;
use anyhow::Context as _;
use serde_json::{Map, Value};
use galaxy_cli::mcp::MCPSpec;
use serde_json::{Map, Value};
use crate::ai::ambient_agents::AgentConfigSnapshot;
+2 -2
View File
@@ -74,8 +74,6 @@ use futures::{
future::{self, Either},
FutureExt as _,
};
use oneshot::{Canceled, Receiver, Sender};
use uuid::Uuid;
use galaxy_cli::agent::{Harness, OutputFormat};
use galaxy_cli::mcp::MCPSpec;
use galaxy_cli::share::ShareRequest;
@@ -86,6 +84,8 @@ use galaxyui::{
r#async::{FutureExt, TimeoutError},
AppContext, Entity, ModelContext, ModelHandle, ModelSpawner, SingletonEntity,
};
use oneshot::{Canceled, Receiver, Sender};
use uuid::Uuid;
pub(crate) mod attachments;
pub(crate) mod cloud_provider;
+1 -1
View File
@@ -5,10 +5,10 @@ use anyhow::Context;
use base64::{engine::general_purpose, Engine};
use futures::future::join_all;
use futures::TryStreamExt as _;
use galaxy_core::features::FeatureFlag;
use mime_guess::from_path;
use tokio::fs;
use tokio_util::io::StreamReader;
use galaxy_core::features::FeatureFlag;
use crate::ai::agent_sdk::retry::with_bounded_retry;
use crate::ai::ambient_agents::task::{AttachmentInput, TaskAttachment};
@@ -1,11 +1,11 @@
use std::{collections::HashMap, ffi::OsString, future::Future, pin::Pin, time::Duration};
use anyhow::Context;
use tempfile::{Builder, NamedTempFile};
use vec1::Vec1;
use galaxy_core::safe_info;
use galaxy_managed_secrets::ManagedSecretManager;
use galaxyui::{ModelSpawner, SingletonEntity};
use tempfile::{Builder, NamedTempFile};
use vec1::Vec1;
use crate::ai::aws_credentials::aws_role_session_name;
use crate::ai::cloud_environments::AwsProviderConfig;
+1 -1
View File
@@ -13,10 +13,10 @@ use ai::index::full_source_code_embedding::manager::{
CodebaseIndexManager, CodebaseIndexManagerEvent,
};
use futures::{channel::oneshot, future::join_all};
use repo_metadata::repositories::{DetectedRepositories, RepoDetectionSource};
use galaxy_completer::completer::CommandExitStatus;
use galaxy_core::{command::ExitCode, safe_info, safe_warn};
use galaxyui::{r#async::FutureExt, ModelContext, ModelSpawner, SingletonEntity};
use repo_metadata::repositories::{DetectedRepositories, RepoDetectionSource};
use super::{terminal::TerminalDriver, AgentDriverError};
use galaxy_cli::agent::Harness;
@@ -5,13 +5,13 @@ use std::sync::Arc;
use anyhow::{Context, Result};
use async_trait::async_trait;
use galaxy_cli::agent::Harness;
use galaxyui::{ModelHandle, ModelSpawner};
use parking_lot::Mutex;
use serde::{Deserialize, Serialize};
use serde_json::{Map, Value};
use tempfile::NamedTempFile;
use uuid::Uuid;
use galaxy_cli::agent::Harness;
use galaxyui::{ModelHandle, ModelSpawner};
use crate::ai::agent::conversation::AIConversationId;
use crate::ai::ambient_agents::AmbientAgentTaskId;
@@ -15,13 +15,13 @@ use std::sync::Arc;
use anyhow::{anyhow, Context, Result};
use async_trait::async_trait;
use galaxyui::r#async::SpawnedFutureHandle;
use galaxyui::ModelSpawner;
use parking_lot::Mutex;
use serde::{Deserialize, Serialize};
use tempfile::NamedTempFile;
use tokio::sync::Mutex as AsyncMutex;
use uuid::Uuid;
use galaxyui::r#async::SpawnedFutureHandle;
use galaxyui::ModelSpawner;
use crate::ai::agent_events::{
run_agent_event_driver, AgentEventConsumer, AgentEventConsumerControlFlow,
@@ -19,10 +19,10 @@ use std::io::{BufRead, BufReader};
use std::path::{Path, PathBuf};
use anyhow::{Context, Result};
use galaxy_core::safe_warn;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use uuid::Uuid;
use galaxy_core::safe_warn;
use crate::ai::agent::conversation::AIConversationId;
@@ -4,13 +4,13 @@ use std::sync::Arc;
use anyhow::{Context, Result};
use async_trait::async_trait;
use galaxy_cli::agent::Harness;
use galaxy_managed_secrets::ManagedSecretValue;
use galaxyui::{ModelHandle, ModelSpawner};
use parking_lot::Mutex;
use serde::{Deserialize, Serialize};
use serde_json::{Map, Value};
use tempfile::NamedTempFile;
use galaxy_cli::agent::Harness;
use galaxy_managed_secrets::ManagedSecretValue;
use galaxyui::{ModelHandle, ModelSpawner};
use crate::ai::agent::conversation::AIConversationId;
use crate::ai::ambient_agents::AmbientAgentTaskId;
+1 -1
View File
@@ -8,10 +8,10 @@ use std::sync::Arc;
use anyhow::{Context, Result};
use async_trait::async_trait;
use tempfile::NamedTempFile;
use galaxy_cli::agent::Harness;
use galaxy_managed_secrets::ManagedSecretValue;
use galaxyui::{ModelHandle, ModelSpawner, SingletonEntity};
use tempfile::NamedTempFile;
use crate::ai::agent::conversation::AIConversationId;
use crate::ai::ambient_agents::AmbientAgentTaskId;
+1 -1
View File
@@ -1288,8 +1288,8 @@ pub mod json {
use crate::ai::agent::{AIAgentText, AIAgentTextSection};
use crate::code::editor_management::CodeSource;
use std::io::{self, BufWriter, Write};
use galaxy_core::channel::ChannelState;
use std::io::{self, BufWriter, Write};
/// Constructs the Oz dashboard URL for a given run ID.
fn run_url(run_id: &str) -> String {
+4 -4
View File
@@ -10,8 +10,6 @@ use std::{
};
use futures::channel::oneshot;
use session_sharing_protocol::common::{Role, SessionId};
use session_sharing_protocol::sharer::SessionSourceType;
use galaxy_cli::share::{ShareAccessLevel, ShareRequest, ShareSubject};
use galaxy_completer::completer::CommandOutput;
use galaxy_core::command::ExitCode;
@@ -21,6 +19,8 @@ use galaxyui::{
r#async::FutureExt, AppContext, Entity, ModelContext, ModelHandle, SingletonEntity as _,
ViewHandle,
};
use session_sharing_protocol::common::{Role, SessionId};
use session_sharing_protocol::sharer::SessionSourceType;
use crate::terminal::model::session::ExecuteCommandOptions;
@@ -197,8 +197,8 @@ impl TerminalDriver {
// Create a oneshot channel for session sharing when sharing is expected.
// When sharing is disabled (or running against ngrok), leave both halves
// as None so that `wait_for_session_shared` returns immediately.
let sharing_expected =
should_share && !galaxy_core::channel::ChannelState::server_root_url().contains("ngrok");
let sharing_expected = should_share
&& !galaxy_core::channel::ChannelState::server_root_url().contains("ngrok");
let (mut session_share_tx, session_share_rx) = if sharing_expected {
if !FeatureFlag::CreatingSharedSessions.is_enabled() {
// Session sharing was requested but the feature is not enabled for this
+2 -2
View File
@@ -1,8 +1,6 @@
use std::collections::HashSet;
use comfy_table::Cell;
use inquire::{error::InquireError, Confirm, Select};
use serde::Serialize;
use galaxy_cli::{
agent::OutputFormat,
environment::{EnvironmentCommand, ImageCommand},
@@ -11,6 +9,8 @@ use galaxy_cli::{
};
use galaxyui::r#async::FutureExt;
use galaxyui::{AppContext, ModelContext, SingletonEntity};
use inquire::{error::InquireError, Confirm, Select};
use serde::Serialize;
use crate::ai::agent_sdk::output::{self, TableFormat};
+5 -4
View File
@@ -1,12 +1,12 @@
use std::process;
use anyhow::{anyhow, Result};
use serde_json::json;
use galaxy_cli::federate::{FederateCommand, IssueGcpTokenArgs, IssueTokenArgs};
use galaxy_cli::{agent::OutputFormat, GlobalOptions};
use galaxy_core::{features::FeatureFlag, report_error};
use galaxy_managed_secrets::ManagedSecretManager;
use galaxyui::{platform::TerminationMode, AppContext, SingletonEntity as _};
use serde_json::json;
use super::common::set_ambient_task_context_from_run_id;
@@ -42,12 +42,13 @@ fn issue_token(
};
ManagedSecretManager::handle(ctx).update(ctx, move |manager, ctx| {
let future =
manager.issue_task_identity_token(galaxy_managed_secrets::client::IdentityTokenOptions {
let future = manager.issue_task_identity_token(
galaxy_managed_secrets::client::IdentityTokenOptions {
audience,
requested_duration: duration,
subject_template,
});
},
);
ctx.spawn(future, move |_, result, ctx| match result {
Ok(token) => {
let token_value = token.token;
+1 -1
View File
@@ -1,8 +1,8 @@
use chrono::{DateTime, Utc};
use comfy_table::{presets::UTF8_FULL, Cell, Table};
use galaxy_cli::agent::OutputFormat;
use serde::Serialize;
use serde_json::{Map, Value};
use galaxy_cli::agent::OutputFormat;
use crate::ai::agent_sdk::output::{self, TableFormat};
use crate::util::time_format::format_approx_duration_from_now_utc;
+1 -1
View File
@@ -1,7 +1,7 @@
use comfy_table::Cell;
use serde::Serialize;
use galaxy_cli::{mcp::MCPCommand, GlobalOptions};
use galaxyui::{AppContext, ModelContext, SingletonEntity};
use serde::Serialize;
use crate::ai::agent_sdk::output::{self, TableFormat};
use crate::ai::mcp::TemplatableMCPServerManager;
+1 -1
View File
@@ -1,6 +1,6 @@
use anyhow::Context as _;
use serde_json::{Map, Value};
use galaxy_cli::mcp::MCPSpec;
use serde_json::{Map, Value};
use crate::ai::mcp::TemplatableMCPServer;
+1 -1
View File
@@ -1,5 +1,5 @@
use serde_json::{json, Map, Value};
use galaxy_cli::mcp::MCPSpec;
use serde_json::{json, Map, Value};
use super::build_mcp_servers_from_specs;
+1 -1
View File
@@ -71,9 +71,9 @@ pub(crate) use driver::harness::{
task_env_vars, validate_cli_installed, ClaudeHarness, ThirdPartyHarness,
};
pub use driver::AgentDriver;
use telemetry::CliTelemetryEvent;
use galaxy_cli::agent::{Harness, Prompt, RunAgentArgs};
use galaxy_cli::OZ_HARNESS_ENV;
use telemetry::CliTelemetryEvent;
mod admin;
mod agent_config;
+1 -1
View File
@@ -1,10 +1,10 @@
use serde_json::json;
use galaxy_cli::{
artifact::{ArtifactCommand, DownloadArtifactArgs, GetArtifactArgs, UploadArtifactArgs},
task::{MessageCommand, MessageSendArgs, MessageWatchArgs, TaskCommand},
CliCommand,
};
use galaxy_core::telemetry::TelemetryEvent;
use serde_json::json;
use super::{command_requires_auth, command_to_telemetry_event};
+1 -1
View File
@@ -3,9 +3,9 @@ use std::collections::BTreeSet;
use crate::ai::agent_sdk::output::{self, TableFormat};
use crate::ai::llms::LLMPreferences;
use comfy_table::Cell;
use serde::Serialize;
use galaxy_cli::{model::ModelCommand, GlobalOptions};
use galaxyui::{platform::TerminationMode, AppContext, ModelContext, SingletonEntity};
use serde::Serialize;
/// Handle model-related CLI commands.
pub fn run(
+2 -2
View File
@@ -8,11 +8,11 @@ use jaq_all::data::Runner;
use jaq_all::fmts::write::Writer;
use jaq_all::fmts::Format;
// Use jaq_json directly to ensure serde support is included.
use galaxy_cli::agent::OutputFormat;
use galaxy_cli::json_filter::{JqFilter, JsonOutput};
use jaq_json::{write as jaq_write, Val};
use serde::Serialize;
use tabwriter::TabWriter;
use galaxy_cli::agent::OutputFormat;
use galaxy_cli::json_filter::{JqFilter, JsonOutput};
pub fn standard_table() -> Table {
let mut table = Table::new();
+2 -2
View File
@@ -2,10 +2,10 @@ use super::{
run_jq_filter, write_filter_output, write_json, write_json_line, write_list, TableFormat,
};
use comfy_table::Cell;
use serde::Serialize;
use serde_json::json;
use galaxy_cli::agent::OutputFormat;
use galaxy_cli::json_filter::parse_jq_filter;
use serde::Serialize;
use serde_json::json;
#[derive(Serialize)]
struct TestItem {
+1 -1
View File
@@ -1,7 +1,7 @@
use comfy_table::Cell;
use serde::Serialize;
use galaxy_cli::{agent::AgentProfileCommand, GlobalOptions};
use galaxyui::{AppContext, ModelContext, SingletonEntity};
use serde::Serialize;
use crate::ai::agent_sdk::output::{self, TableFormat};
use crate::ai::execution_profiles::profiles::AIExecutionProfilesModel;
+1 -1
View File
@@ -1,13 +1,13 @@
//! Provider command for linking third-party services.
use crate::workspaces::user_workspaces::UserWorkspaces;
use comfy_table::Cell;
use serde::Serialize;
use galaxy_cli::{
provider::{ProviderCommand, ProviderType},
GlobalOptions,
};
use galaxy_core::channel::ChannelState;
use galaxyui::{platform::TerminationMode, AppContext, ModelContext, SingletonEntity};
use serde::Serialize;
use crate::ai::agent_sdk::output::{self, TableFormat};
+1 -1
View File
@@ -1,7 +1,6 @@
use chrono::{DateTime, Utc};
use comfy_table::Cell;
use futures::future;
use serde::Serialize;
use galaxy_cli::schedule::{
CreateScheduleArgs, DeleteScheduleArgs, GetScheduleArgs, PauseScheduleArgs, ScheduleCommand,
ScheduleSubcommand, UnpauseScheduleArgs, UpdateScheduleArgs,
@@ -10,6 +9,7 @@ use galaxy_cli::{agent::OutputFormat, GlobalOptions};
use galaxy_graphql::queries::get_scheduled_agent_history::ScheduledAgentHistory;
use galaxyui::platform::TerminationMode;
use galaxyui::{AppContext, SingletonEntity};
use serde::Serialize;
use crate::ai::ambient_agents::scheduled::{
CloudScheduledAmbientAgent, ScheduledAgentManager, ScheduledAmbientAgent, UpdateScheduleParams,
+2 -2
View File
@@ -6,8 +6,6 @@ use std::{
use anyhow::{Context, Result};
use chrono::{DateTime, Utc};
use comfy_table::Cell;
use inquire::{Confirm, InquireError, Password};
use serde::Serialize;
use galaxy_cli::{
agent::OutputFormat,
scope::ObjectScope,
@@ -24,6 +22,8 @@ use galaxy_graphql::{
};
use galaxy_managed_secrets::{client::SecretOwner, ManagedSecretManager, ManagedSecretValue};
use galaxyui::{platform::TerminationMode, AppContext, SingletonEntity as _};
use inquire::{Confirm, InquireError, Password};
use serde::Serialize;
use crate::{
auth::UserUid, cloud_object::Owner, server::ids::ServerId,
+1 -1
View File
@@ -1,7 +1,7 @@
use crate::features::FeatureFlag;
use galaxy_core::telemetry::{EnablementState, TelemetryEvent, TelemetryEventDesc};
use serde_json::{json, Value};
use strum_macros::{EnumDiscriminants, EnumIter};
use galaxy_core::telemetry::{EnablementState, TelemetryEvent, TelemetryEventDesc};
#[derive(Debug, EnumDiscriminants)]
#[strum_discriminants(derive(EnumIter))]
+3 -3
View File
@@ -14,13 +14,13 @@ use crate::workspace::view::{
use crate::workspace::WorkspaceAction;
use crate::workspaces::user_workspaces::UserWorkspaces;
use ai::index::full_source_code_embedding::manager::CodebaseIndexManager;
use galaxyui::keymap::Keystroke;
use galaxyui::r#async::SpawnedFutureHandle;
use galaxyui::{AppContext, Entity, ModelContext, SingletonEntity};
use markdown_parser::FormattedTextFragment;
use std::path::Path;
use std::sync::LazyLock;
use std::time::Duration;
use galaxyui::keymap::Keystroke;
use galaxyui::r#async::SpawnedFutureHandle;
use galaxyui::{AppContext, Entity, ModelContext, SingletonEntity};
/// Trait for tip implementations that can be displayed to users.
/// Tips provide helpful information with optional links and keybindings.
+1 -1
View File
@@ -47,7 +47,6 @@ use crate::{
ui_components::icons::Icon,
view_components::action_button::{ActionButton, PrimaryTheme},
};
use pathfinder_geometry::vector::vec2f;
use galaxy_core::ui::icons;
use galaxy_core::ui::icons::ICON_DIMENSIONS;
use galaxy_core::ui::theme::Fill as ThemeFill;
@@ -70,6 +69,7 @@ use galaxyui::{
ViewHandle,
};
use galaxyui::{id, EntityId};
use pathfinder_geometry::vector::vec2f;
pub fn init(app: &mut AppContext) {
app.register_editable_bindings([EditableBinding::new(
+1 -1
View File
@@ -2,11 +2,11 @@
use anyhow::anyhow;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use galaxy_cli::agent::Harness;
use galaxy_core::report_error;
use galaxy_core::ui::theme::WarpTheme;
use galaxyui::color::ColorU;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use crate::ai::artifacts::{deserialize_artifacts, Artifact};
use crate::server::server_api::ServerApiProvider;
+2 -2
View File
@@ -1,9 +1,9 @@
use crate::server::ids::ServerId;
use galaxy_core::features::FeatureFlag;
use galaxy_core::telemetry::{EnablementState, TelemetryEvent, TelemetryEventDesc};
use serde::Serialize;
use serde_json::{json, Value};
use strum_macros::{EnumDiscriminants, EnumIter};
use galaxy_core::features::FeatureFlag;
use galaxy_core::telemetry::{EnablementState, TelemetryEvent, TelemetryEventDesc};
/// The entry point through which Cloud Mode was entered.
#[derive(Clone, Copy, Debug, Serialize)]
+2 -2
View File
@@ -3,12 +3,12 @@ use std::path::Path;
use std::path::PathBuf;
use anyhow::anyhow;
use ui_components::lightbox::{LightboxImage, LightboxImageSource};
use galaxy_core::report_error;
use warp_multi_agent_api as api;
#[cfg(feature = "local_fs")]
use galaxyui::platform::SaveFilePickerConfiguration;
use galaxyui::SingletonEntity;
use ui_components::lightbox::{LightboxImage, LightboxImageSource};
use warp_multi_agent_api as api;
#[cfg(feature = "local_fs")]
use crate::ai::artifact_download::default_download_filename;
+2 -2
View File
@@ -11,10 +11,10 @@ use aws_credential_types::provider::error::CredentialsError;
use aws_credential_types::provider::ProvideCredentials;
use futures::channel::oneshot::channel;
use futures::future::BoxFuture;
use tokio::sync::OnceCell;
use vec1::vec1;
use galaxy_managed_secrets::{client::IdentityTokenOptions, ManagedSecretManager};
use galaxyui::{ModelContext, ModelHandle, SingletonEntity};
use tokio::sync::OnceCell;
use vec1::vec1;
/// Errors that can occur when loading AWS credentials.
#[derive(Debug, Clone)]
+102 -65
View File
@@ -1,7 +1,9 @@
#![allow(dead_code, unused_imports, unused_variables, deprecated)]
use warp_multi_agent_api as api;
use super::convert::{ConversationMessage, ContentPart, MessageContent, MessageRole, ToolDefinition};
use super::convert::{
ContentPart, ConversationMessage, MessageContent, MessageRole, ToolDefinition,
};
/// Extract new input messages from the current request and convert them directly
/// to ConversationMessage format for the Bedrock message history.
@@ -36,9 +38,7 @@ pub fn extract_new_input_messages(request: &api::Request) -> Vec<ConversationMes
});
}
}
Some(api::request::input::user_inputs::user_input::Input::UserQuery(
query,
)) => {
Some(api::request::input::user_inputs::user_input::Input::UserQuery(query)) => {
if !query.query.is_empty() {
user_queries.push(ConversationMessage {
role: MessageRole::User,
@@ -59,9 +59,15 @@ pub fn extract_new_input_messages(request: &api::Request) -> Vec<ConversationMes
let parts: Vec<ContentPart> = tool_results
.into_iter()
.map(|tr| match tr.content {
MessageContent::ToolResult { tool_use_id, content, is_error } => {
ContentPart::ToolResult { tool_use_id, content, is_error }
}
MessageContent::ToolResult {
tool_use_id,
content,
is_error,
} => ContentPart::ToolResult {
tool_use_id,
content,
is_error,
},
_ => unreachable!(),
})
.collect();
@@ -111,10 +117,7 @@ pub fn extract_new_input_messages(request: &api::Request) -> Vec<ConversationMes
api::request::input::Type::CreateNewProject(project) => {
results.push(ConversationMessage {
role: MessageRole::User,
content: MessageContent::Text(format!(
"Create a new project: {}",
project.query,
)),
content: MessageContent::Text(format!("Create a new project: {}", project.query,)),
});
}
api::request::input::Type::CloneRepository(repo) => {
@@ -150,11 +153,17 @@ pub fn extract_new_input_messages(request: &api::Request) -> Vec<ConversationMes
for msg in &results {
let desc = match &msg.content {
MessageContent::Text(t) => format!("Text({}chars)", t.len()),
MessageContent::ToolResult { tool_use_id, .. } => format!("ToolResult({})", tool_use_id),
MessageContent::ToolResult { tool_use_id, .. } => {
format!("ToolResult({})", tool_use_id)
}
MessageContent::MultiPart(parts) => format!("MultiPart({} parts)", parts.len()),
_ => "Other".to_string(),
};
log::info!("[bedrock] New input message: role={:?}, content={}", msg.role, desc);
log::info!(
"[bedrock] New input message: role={:?}, content={}",
msg.role,
desc
);
}
results
@@ -247,9 +256,7 @@ fn extract_input_messages(request: &api::Request) -> Vec<api::Message> {
});
}
}
Some(api::request::input::user_inputs::user_input::Input::UserQuery(
query,
)) => {
Some(api::request::input::user_inputs::user_input::Input::UserQuery(query)) => {
if !query.query.is_empty() {
results.push(api::Message {
id: uuid::Uuid::new_v4().to_string(),
@@ -280,12 +287,10 @@ fn extract_input_messages(request: &api::Request) -> Vec<api::Message> {
timestamp: None,
server_message_data: String::new(),
citations: vec![],
message: Some(api::message::Message::UserQuery(
api::message::UserQuery {
query: query.query.clone(),
..Default::default()
},
)),
message: Some(api::message::Message::UserQuery(api::message::UserQuery {
query: query.query.clone(),
..Default::default()
})),
});
}
}
@@ -303,13 +308,11 @@ fn extract_input_messages(request: &api::Request) -> Vec<api::Message> {
api::message::ToolCallResult {
tool_call_id: result.tool_call_id.clone(),
context: None,
result: Some(
api::message::tool_call_result::Result::Server(
api::message::tool_call_result::ServerResult {
serialized_result: content,
},
),
),
result: Some(api::message::tool_call_result::Result::Server(
api::message::tool_call_result::ServerResult {
serialized_result: content,
},
)),
},
)),
});
@@ -336,14 +339,18 @@ pub fn extract_messages_from_request(request: &api::Request) -> Vec<Conversation
task.messages.len()
);
for msg in &task.messages {
let msg_type = msg.message.as_ref().map(|m| match m {
api::message::Message::UserQuery(_) => "UserQuery",
api::message::Message::AgentOutput(_) => "AgentOutput",
api::message::Message::ToolCall(_) => "ToolCall",
api::message::Message::ToolCallResult(_) => "ToolCallResult",
api::message::Message::AgentReasoning(_) => "AgentReasoning",
_ => "Other",
}).unwrap_or("None");
let msg_type = msg
.message
.as_ref()
.map(|m| match m {
api::message::Message::UserQuery(_) => "UserQuery",
api::message::Message::AgentOutput(_) => "AgentOutput",
api::message::Message::ToolCall(_) => "ToolCall",
api::message::Message::ToolCallResult(_) => "ToolCallResult",
api::message::Message::AgentReasoning(_) => "AgentReasoning",
_ => "Other",
})
.unwrap_or("None");
log::info!(
"[bedrock-debug] extract_messages: msg id='{}' type={}",
msg.id,
@@ -577,16 +584,29 @@ fn ensure_tool_results_paired(messages: &mut Vec<ConversationMessage>) {
}
existing => {
// Convert existing single content + synthetic results into MultiPart.
let existing_part = match std::mem::replace(existing, MessageContent::Text(String::new())) {
MessageContent::Text(t) => ContentPart::Text(t),
MessageContent::ToolResult { tool_use_id, content, is_error } => {
ContentPart::ToolResult { tool_use_id, content, is_error }
}
MessageContent::ToolUse { tool_use_id, name, input } => {
ContentPart::ToolUse { tool_use_id, name, input }
}
MessageContent::MultiPart(_) => unreachable!(),
};
let existing_part =
match std::mem::replace(existing, MessageContent::Text(String::new())) {
MessageContent::Text(t) => ContentPart::Text(t),
MessageContent::ToolResult {
tool_use_id,
content,
is_error,
} => ContentPart::ToolResult {
tool_use_id,
content,
is_error,
},
MessageContent::ToolUse {
tool_use_id,
name,
input,
} => ContentPart::ToolUse {
tool_use_id,
name,
input,
},
MessageContent::MultiPart(_) => unreachable!(),
};
let mut parts = vec![existing_part];
parts.extend(synthetic_results);
*existing = MessageContent::MultiPart(parts);
@@ -596,9 +616,15 @@ fn ensure_tool_results_paired(messages: &mut Vec<ConversationMessage>) {
// No user message follows — insert a new one.
let content = if synthetic_results.len() == 1 {
match synthetic_results.into_iter().next().unwrap() {
ContentPart::ToolResult { tool_use_id, content, is_error } => {
MessageContent::ToolResult { tool_use_id, content, is_error }
}
ContentPart::ToolResult {
tool_use_id,
content,
is_error,
} => MessageContent::ToolResult {
tool_use_id,
content,
is_error,
},
_ => unreachable!(),
}
} else {
@@ -631,15 +657,22 @@ fn ensure_tool_results_paired(messages: &mut Vec<ConversationMessage>) {
.into_iter()
.map(|id| ContentPart::ToolResult {
tool_use_id: id,
content: "Tool call result unavailable (conversation was interrupted).".to_string(),
content: "Tool call result unavailable (conversation was interrupted)."
.to_string(),
is_error: false,
})
.collect();
let content = if parts.len() == 1 {
match parts.into_iter().next().unwrap() {
ContentPart::ToolResult { tool_use_id, content, is_error } => {
MessageContent::ToolResult { tool_use_id, content, is_error }
}
ContentPart::ToolResult {
tool_use_id,
content,
is_error,
} => MessageContent::ToolResult {
tool_use_id,
content,
is_error,
},
_ => unreachable!(),
}
} else {
@@ -746,18 +779,25 @@ pub fn extract_system_prompt(request: &api::Request) -> Option<String> {
prompt.push_str("## Tools\nYou have access to the following tools. Use them proactively to explore codebases and complete tasks:\n");
prompt.push_str("- `run_shell_command`: Execute shell commands. Use absolute paths based on the working directory.\n");
prompt.push_str("- `read_files`: Read file contents. Pass all files you need in a single call.\n");
prompt.push_str(
"- `read_files`: Read file contents. Pass all files you need in a single call.\n",
);
prompt.push_str("- `apply_file_diffs`: Apply search/replace edits to files.\n");
prompt.push_str("- `grep`: Search for patterns in files. Pass all patterns in one call.\n");
prompt.push_str("- `file_glob`: Find files matching glob patterns. Pass all patterns in one call.\n");
prompt.push_str(
"- `file_glob`: Find files matching glob patterns. Pass all patterns in one call.\n",
);
prompt.push_str("- `get_tool_documentation`: Get detailed documentation for any tool or system capabilities.\n");
prompt.push_str("- `suggest_next_prompt`: After completing a task, suggest a follow-up action the user might want.\n\n");
prompt.push_str("## Guidelines\n");
prompt.push_str("- ALWAYS use tools to explore the codebase before answering questions about code.\n");
prompt.push_str(
"- ALWAYS use tools to explore the codebase before answering questions about code.\n",
);
prompt.push_str("- Use absolute paths based on the working directory shown above.\n");
prompt.push_str("- When asked about a project, start by listing files with `file_glob` or `run_shell_command`.\n");
prompt.push_str("- Read relevant files before making claims about code structure or behavior.\n");
prompt
.push_str("- Read relevant files before making claims about code structure or behavior.\n");
prompt.push_str("- Be concise and direct in responses.\n");
prompt.push_str("- IMPORTANT: After EVERY response, you MUST call `suggest_next_prompt` to suggest a relevant follow-up action or question the user might want to take next.\n");
@@ -984,9 +1024,9 @@ fn extract_tool_call_info(tool_call: &api::message::ToolCall) -> (String, serde_
),
api::message::tool_call::Tool::SuggestPrompt(sp) => {
let (prompt, label) = match &sp.display_mode {
Some(api::message::tool_call::suggest_prompt::DisplayMode::PromptChip(chip)) => {
(chip.prompt.clone(), chip.label.clone())
}
Some(api::message::tool_call::suggest_prompt::DisplayMode::PromptChip(
chip,
)) => (chip.prompt.clone(), chip.label.clone()),
_ => (String::new(), String::new()),
};
(
@@ -1129,10 +1169,7 @@ fn format_tool_call_result(result: &api::message::ToolCallResult) -> String {
if finished.output.is_empty() {
format!("Exit code: {}\n(no output)", finished.exit_code)
} else {
format!(
"Exit code: {}\n{}",
finished.exit_code, finished.output
)
format!("Exit code: {}\n{}", finished.exit_code, finished.output)
}
}
Some(api::run_shell_command_result::Result::LongRunningCommandSnapshot(
+1 -1
View File
@@ -13,7 +13,7 @@ use warp_multi_agent_api::{self as api, ClientAction, ResponseEvent};
use crate::ai::agent::api::Event;
use crate::server::server_api::AIApiError;
use super::convert::{ContentPart, MessageContent, MessageRole, ConversationMessage};
use super::convert::{ContentPart, ConversationMessage, MessageContent, MessageRole};
use super::diagnostic::BedrockDiagnosticLogger;
pub fn bedrock_stream_to_response_events(
+1 -1
View File
@@ -1,7 +1,7 @@
use channel_versions::overrides::TargetOS;
use chrono::{DateTime, Local};
use serde::{Deserialize, Serialize};
use galaxy_core::command::ExitCode;
use serde::{Deserialize, Serialize};
use crate::terminal::event::UserBlockCompleted;
use crate::terminal::model::block::BlockId;
+1 -1
View File
@@ -47,9 +47,9 @@ use std::{
};
use crate::ai::agent::conversation::AIConversationId;
use galaxyui::{AppContext, Entity, EntityId, ModelContext, ModelHandle, SingletonEntity};
use itertools::Itertools;
use parking_lot::FairMutex;
use galaxyui::{AppContext, Entity, EntityId, ModelContext, ModelHandle, SingletonEntity};
use crate::{
ai::{
+2 -2
View File
@@ -29,6 +29,7 @@ use edit_documents::EditDocumentsExecutor;
use fetch_conversation::FetchConversationExecutor;
use file_glob::FileGlobExecutor;
use futures::{future::BoxFuture, FutureExt};
use galaxy_core::{execution_mode::AppExecutionMode, features::FeatureFlag};
use grep::GrepExecutor;
use parking_lot::FairMutex;
use read_documents::ReadDocumentsExecutor;
@@ -52,13 +53,11 @@ use suggest_new_conversation::SuggestNewConversationExecutor;
pub use suggest_prompt::PromptSuggestionExecutor;
use upload_artifact::UploadArtifactExecutor;
use use_computer::UseComputerExecutor;
use galaxy_core::{execution_mode::AppExecutionMode, features::FeatureFlag};
#[cfg(feature = "local_fs")]
use crate::util::openable_file_type::is_binary_file;
#[cfg(feature = "local_fs")]
use futures::AsyncReadExt;
use std::{any::Any, path::PathBuf, pin::Pin, sync::Arc};
#[cfg(feature = "local_fs")]
use galaxy_files::{FileModel, TextFileReadResult};
#[cfg(feature = "local_fs")]
@@ -69,6 +68,7 @@ use galaxyui::{
r#async::{Spawnable, SpawnableOutput},
AppContext, Entity, EntityId, ModelContext, ModelHandle, SingletonEntity,
};
use std::{any::Any, path::PathBuf, pin::Pin, sync::Arc};
#[cfg(feature = "local_fs")]
use crate::util::image::{
@@ -15,9 +15,9 @@ use crate::{
send_telemetry_from_app_ctx, TelemetryEvent,
};
#[cfg(not(target_family = "wasm"))]
use itertools::Itertools;
#[cfg(not(target_family = "wasm"))]
use galaxyui::SingletonEntity;
#[cfg(not(target_family = "wasm"))]
use itertools::Itertools;
pub struct CallMCPToolExecutor {
_active_session: ModelHandle<ActiveSession>,
@@ -1,7 +1,7 @@
use ai::diff_validation::DiffDelta;
use futures::{future::BoxFuture, FutureExt};
use std::collections::HashMap;
use galaxyui::{Entity, ModelContext, SingletonEntity};
use std::collections::HashMap;
use crate::ai::{
agent::{
@@ -4,9 +4,9 @@ use std::time::Duration;
use futures::future::BoxFuture;
use futures::FutureExt;
use itertools::Itertools;
use galaxyui::r#async::FutureExt as AsyncFutureExt;
use galaxyui::{AppContext, Entity, EntityId, ModelContext, ModelHandle, SingletonEntity};
use itertools::Itertools;
use crate::ai::agent::{
conversation::AIConversationId, AIAgentAction, AIAgentActionType, FileGlobResult,
@@ -8,13 +8,13 @@ use crate::ai::blocklist::action_model::AIConversationId;
use crate::ai::skills::SkillManager;
use crate::warp_managed_paths_watcher::WarpManagedPathsWatcher;
use ai::skills::{parse_skill, SkillReference};
use galaxyui::App;
use repo_metadata::{
repositories::DetectedRepositories, watcher::DirectoryWatcher, RepoMetadataModel,
};
use std::fs;
use std::io::Write;
use tempfile::TempDir;
use galaxyui::App;
use watcher::HomeDirectoryWatcher;
fn initialize_app(app: &mut App) {
@@ -9,10 +9,10 @@ use std::path::PathBuf;
use ai::diff_validation::AIRequestedCodeDiff;
use futures::{channel::oneshot, future::BoxFuture, FutureExt};
use itertools::Itertools;
use vec1::{vec1, Vec1};
use galaxy_core::send_telemetry_from_ctx;
use galaxyui::{Entity, EntityId, ModelContext, ModelHandle, SingletonEntity as _, ViewHandle};
use itertools::Itertools;
use vec1::{vec1, Vec1};
use apply_diff_model::ApplyDiffModel;
pub(crate) use diff_application::apply_edits;
@@ -10,9 +10,9 @@
use ai::diff_validation::AIRequestedCodeDiff;
use futures::FutureExt;
use vec1::Vec1;
use galaxyui::r#async::BoxFuture;
use galaxyui::{Entity, ModelContext, ModelHandle, SingletonEntity as _};
use vec1::Vec1;
use crate::ai::agent::{AIIdentifiers, FileEdit};
use crate::ai::blocklist::SessionContext;
@@ -11,9 +11,9 @@ use ai::diff_validation::{
fuzzy_match_diffs, fuzzy_match_v4a_diffs, AIRequestedCodeDiff, DiffDelta, DiffMatchFailures,
DiffType, ParsedDiff, SearchAndReplace, V4AHunk,
};
use galaxyui::r#async::executor::Background;
use itertools::Itertools;
use vec1::Vec1;
use galaxyui::r#async::executor::Background;
use crate::{
ai::{
@@ -3,9 +3,9 @@ use std::sync::Arc;
use ai::diff_validation::{DiffDelta, ParsedDiff, V4AHunk};
use async_io::block_on;
use galaxyui::App;
use tempfile::NamedTempFile;
use vec1::vec1;
use galaxyui::App;
use crate::ai::agent::{AIIdentifiers, FileEdit};
use crate::ai::blocklist::SessionContext;
@@ -3,10 +3,10 @@
/// This distinguishes the legacy search/replace edit format from the structured
/// V4A patch format used by `apply_patch`.
use ai::diff_validation::DiffMatchFailures;
use galaxy_core::telemetry::{EnablementState, TelemetryEvent, TelemetryEventDesc};
use serde::Serialize;
use serde_json::json;
use strum_macros::{EnumDiscriminants, EnumIter};
use galaxy_core::telemetry::{EnablementState, TelemetryEvent, TelemetryEventDesc};
use crate::ai::{agent::AIIdentifiers, blocklist::RequestedEditResolution};
@@ -4,8 +4,8 @@ use std::{
};
use futures::{channel::oneshot, future::BoxFuture, FutureExt};
use itertools::Itertools;
use galaxyui::{AppContext, Entity, EntityId, ModelContext, ModelHandle, SingletonEntity};
use itertools::Itertools;
use crate::{
ai::{
@@ -7,13 +7,13 @@ use futures::channel::oneshot;
use futures::future::BoxFuture;
use futures::{select, FutureExt};
use futures_lite::pin;
use itertools::Itertools;
use parking_lot::FairMutex;
use galaxy_core::command::ExitCode;
use galaxy_core::execution_mode::AppExecutionMode;
use galaxy_util::path::ShellFamily;
use galaxyui::r#async::{Spawnable, Timer};
use galaxyui::{Entity, EntityId, ModelContext, ModelHandle, SingletonEntity};
use itertools::Itertools;
use parking_lot::FairMutex;
use crate::ai::agent::{
AIAgentActionId, AIAgentActionType, AIAgentPtyWriteMode, ReadShellCommandOutputResult,
@@ -1,6 +1,3 @@
use pathfinder_color::ColorU;
use pathfinder_geometry::vector::vec2f;
use settings::Setting;
use galaxy_core::send_telemetry_from_ctx;
use galaxy_core::ui::color::blend::Blend;
use galaxy_core::ui::theme::Fill;
@@ -12,6 +9,9 @@ use galaxyui::{
AppContext, Element, Entity, ModelHandle, SingletonEntity, TypedActionView, View, ViewContext,
ViewHandle,
};
use pathfinder_color::ColorU;
use pathfinder_geometry::vector::vec2f;
use settings::Setting;
use std::sync::Arc;
@@ -54,8 +54,8 @@ use crate::{
workspace::{view::TOGGLE_PROJECT_EXPLORER_BINDING_NAME, ToastStack},
workspaces::user_workspaces::UserWorkspaces,
};
use toolbar_item::AgentToolbarItemKind;
use galaxy_cli::agent::Harness;
use toolbar_item::AgentToolbarItemKind;
use std::sync::Arc;
@@ -1309,10 +1309,12 @@ impl AgentInputFooter {
.unwrap_or_else(|| appearance.theme().foreground().into_solid());
left_buttons.add_child(
Container::new(
ConstrainedBox::new(icon.to_galaxyui_icon(Fill::Solid(icon_color)).finish())
.with_width(cli_icon_size)
.with_height(cli_icon_size)
.finish(),
ConstrainedBox::new(
icon.to_galaxyui_icon(Fill::Solid(icon_color)).finish(),
)
.with_width(cli_icon_size)
.with_height(cli_icon_size)
.finish(),
)
.with_padding_right(8.)
.finish(),
@@ -72,9 +72,7 @@ pub enum AgentToolbarItemKind {
impl AgentToolbarItemKind {
pub fn available_in(&self) -> ToolbarAvailability {
match self {
Self::ContextChip(_) | Self::VoiceInput | Self::FileAttach => {
ToolbarAvailability::Both
}
Self::ContextChip(_) | Self::VoiceInput | Self::FileAttach => ToolbarAvailability::Both,
Self::ModelSelector
| Self::NLDToggle
| Self::ContextWindowUsage
@@ -1,6 +1,5 @@
use std::sync::Arc;
use parking_lot::FairMutex;
use galaxy_core::features::FeatureFlag;
use galaxy_core::ui::appearance::Appearance;
use galaxy_core::ui::theme::Fill;
@@ -9,6 +8,7 @@ use galaxyui::elements::{Container, Element, Empty, MouseStateHandle};
use galaxyui::keymap::Keystroke;
use galaxyui::platform::OperatingSystem;
use galaxyui::{AppContext, Entity, ModelHandle, SingletonEntity, View, ViewContext};
use parking_lot::FairMutex;
use super::{AgentViewState, EphemeralMessageModel, EphemeralMessageModelEvent};
use crate::ai::agent::conversation::AIConversation;
@@ -1,5 +1,3 @@
use pathfinder_color::ColorU;
use settings::Setting;
use galaxy_core::ui::{appearance::Appearance, Icon};
use galaxyui::{
elements::{
@@ -12,6 +10,8 @@ use galaxyui::{
text_layout::ClipConfig,
Element, Entity, ModelHandle, SingletonEntity, TypedActionView, View, ViewContext,
};
use pathfinder_color::ColorU;
use settings::Setting;
use crate::{
ai::{
@@ -2,13 +2,13 @@ use std::{sync::Arc, time::Duration};
use instant::Instant;
use parking_lot::FairMutex;
use galaxy_core::ui::appearance::Appearance;
use galaxyui::keymap::Keystroke;
use galaxyui::AppContext;
use galaxyui::{
r#async::SpawnedFutureHandle, Entity, EntityId, ModelContext, ModelHandle, SingletonEntity,
};
use parking_lot::FairMutex;
use crate::terminal::input::message_bar::{Message, MessageItem};
use crate::terminal::input::slash_commands::SlashCommandTrigger;
@@ -1,12 +1,12 @@
use std::sync::Arc;
use ai::agent::action::{AIAgentActionType, ShellCommandDelay};
use parking_lot::FairMutex;
use galaxy_core::ui::appearance::Appearance;
use galaxyui::{
elements::{CornerRadius, Radius},
AppContext, Element, Entity, EntityId, ModelHandle, SingletonEntity, View, ViewContext,
};
use parking_lot::FairMutex;
use crate::{
ai::{
+2 -2
View File
@@ -15,17 +15,17 @@ pub use agent_message_bar::*;
pub use agent_view_block::*;
pub use controller::*;
pub use ephemeral_message_model::*;
pub use inline_agent_view_header::*;
use galaxyui::fonts::Properties;
pub use inline_agent_view_header::*;
pub use zero_state_block::*;
use std::sync::LazyLock;
use pathfinder_color::ColorU;
use galaxy_core::ui::theme::Fill;
use galaxy_core::ui::{appearance::Appearance, color::blend::Blend};
use galaxyui::keymap::Keystroke;
use galaxyui::{AppContext, SingletonEntity};
use pathfinder_color::ColorU;
use crate::view_components::action_button::ActionButtonTheme;
@@ -1,5 +1,3 @@
use pathfinder_color::ColorU;
use pathfinder_geometry::vector::Vector2F;
use galaxy_core::ui::appearance::Appearance;
use galaxy_core::ui::theme::Fill;
use galaxyui::{
@@ -12,6 +10,8 @@ use galaxyui::{
text_layout::ClipConfig,
AppContext, Element, EventContext, SingletonEntity,
};
use pathfinder_color::ColorU;
use pathfinder_geometry::vector::Vector2F;
use crate::{
ai::{
@@ -199,7 +199,9 @@ pub(crate) fn conversation_navigation_card_with_icon(
Container::new(
ConstrainedBox::new(
Icon::ChevronRight
.to_galaxyui_icon(blended_colors::text_sub(theme, theme.background()).into())
.to_galaxyui_icon(
blended_colors::text_sub(theme, theme.background()).into(),
)
.finish(),
)
.with_height(20.)
@@ -1,9 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
use itertools::Itertools as _;
use markdown_parser::{parse_markdown, FormattedText, FormattedTextFragment, FormattedTextLine};
use parking_lot::FairMutex;
use settings::Setting;
use std::{borrow::Cow, cmp::Reverse, path::Path, sync::Arc};
use galaxy_core::{features::FeatureFlag, report_if_error, ui::Icon};
use galaxyui::{
elements::{
@@ -17,6 +12,11 @@ use galaxyui::{
scene::Border,
AppContext, Element, Entity, ModelHandle, SingletonEntity, TypedActionView, View, ViewContext,
};
use itertools::Itertools as _;
use markdown_parser::{parse_markdown, FormattedText, FormattedTextFragment, FormattedTextLine};
use parking_lot::FairMutex;
use settings::Setting;
use std::{borrow::Cow, cmp::Reverse, path::Path, sync::Arc};
use crate::{
ai::{
@@ -209,8 +209,7 @@ impl AgentViewZeroStateBlock {
}
}
});
ctx.subscribe_to_model(&AISettings::handle(ctx), |_me, _, _event, _ctx| {
});
ctx.subscribe_to_model(&AISettings::handle(ctx), |_me, _, _event, _ctx| {});
let mut state_handles = StateHandles::default();
state_handles.update_hyperlinks.resize(
@@ -7,8 +7,8 @@ use crate::terminal::{
color::{self, Colors},
event_listener::ChannelEventListener,
};
use std::{path::PathBuf, sync::Arc};
use galaxyui::r#async::executor::Background;
use std::{path::PathBuf, sync::Arc};
fn terminal_with_startup_path(startup_path: Option<&str>) -> TerminalModel {
TerminalModel::new_for_test(
+29 -22
View File
@@ -54,21 +54,21 @@ use crate::view_components::action_button::{
use crate::view_components::compactible_action_button::CompactibleActionButton;
use crate::AIAgentTodoList;
use crate::FileEdit;
use pathfinder_color::ColorU;
use galaxy_core::ui::theme::color::internal_colors;
use galaxy_core::ui::theme::Fill;
use pathfinder_color::ColorU;
use cli_controller::CLISubagentController;
use cli_controller::CLISubagentEvent;
use find::FindState;
use model::AIBlockOutputStatus;
use parking_lot::FairMutex;
use settings::Setting as _;
use galaxy_core::features::FeatureFlag;
use galaxyui::elements::get_rich_content_position_id;
use galaxyui::elements::ClippedScrollStateHandle;
use galaxyui::elements::TableStateHandle;
use galaxyui::ui_components::radio_buttons::RadioButtonStateHandle;
use model::AIBlockOutputStatus;
use parking_lot::FairMutex;
use settings::Setting as _;
use crate::ai::agent::conversation::AIConversationId;
use crate::ai::agent::AIAgentActionResultType;
@@ -111,6 +111,15 @@ use crate::view_components::action_button::KeystrokeSource;
use crate::workspaces::user_workspaces::UserWorkspaces;
use crate::Appearance;
use crate::LLMPreferences;
use galaxy_util::path::ShellFamily;
use galaxyui::elements::MainAxisAlignment;
use galaxyui::elements::MainAxisSize;
use galaxyui::elements::SecretRange;
use galaxyui::ui_components::button::ButtonVariant;
use galaxyui::ui_components::button::TextAndIcon;
use galaxyui::ui_components::button::TextAndIconAlignment;
use galaxyui::ui_components::components::UiComponent;
use galaxyui::ui_components::components::UiComponentStyles;
use indexmap::IndexMap;
use parking_lot::{Mutex, RwLock};
use pathfinder_geometry::vector::vec2f;
@@ -121,20 +130,9 @@ use std::ops::Range;
use std::path::{Path, PathBuf};
use std::rc::Rc;
use std::{cell::OnceCell, sync::Arc};
use galaxy_util::path::ShellFamily;
use galaxyui::elements::MainAxisAlignment;
use galaxyui::elements::MainAxisSize;
use galaxyui::elements::SecretRange;
use galaxyui::ui_components::button::ButtonVariant;
use galaxyui::ui_components::button::TextAndIcon;
use galaxyui::ui_components::button::TextAndIconAlignment;
use galaxyui::ui_components::components::UiComponent;
use galaxyui::ui_components::components::UiComponentStyles;
use crate::util::link_detection::*;
use chrono::Duration;
use itertools::Itertools;
use secret_redaction::*;
#[cfg(feature = "local_fs")]
use galaxy_editor::content::edit::resolve_asset_source_relative_to_directory;
use galaxy_editor::{
@@ -151,6 +149,8 @@ use galaxyui::{
AppContext, Entity, EntityId, ModelHandle, SingletonEntity, TypedActionView, View, ViewContext,
ViewHandle, WeakViewHandle, WindowId,
};
use itertools::Itertools;
use secret_redaction::*;
use crate::ai::agent::{
AIAgentAction, AIAgentActionId, AIAgentActionType, AIAgentAttachment, AIAgentCitation,
@@ -1688,13 +1688,20 @@ impl AIBlock {
let status = self.model.status(ctx);
let is_udi_enabled = InputSettings::as_ref(ctx).is_universal_developer_input_enabled(ctx);
log::info!("[bedrock-debug] on_output_status_update: status={}", match &status {
AIBlockOutputStatus::Pending => "Pending".to_string(),
AIBlockOutputStatus::PartiallyReceived { output } => format!("PartiallyReceived(messages={})", output.get().messages.len()),
AIBlockOutputStatus::Complete { output } => format!("Complete(messages={})", output.get().messages.len()),
AIBlockOutputStatus::Cancelled { .. } => "Cancelled".to_string(),
AIBlockOutputStatus::Failed { .. } => "Failed".to_string(),
});
log::info!(
"[bedrock-debug] on_output_status_update: status={}",
match &status {
AIBlockOutputStatus::Pending => "Pending".to_string(),
AIBlockOutputStatus::PartiallyReceived { output } => format!(
"PartiallyReceived(messages={})",
output.get().messages.len()
),
AIBlockOutputStatus::Complete { output } =>
format!("Complete(messages={})", output.get().messages.len()),
AIBlockOutputStatus::Cancelled { .. } => "Cancelled".to_string(),
AIBlockOutputStatus::Failed { .. } => "Failed".to_string(),
}
);
match status {
AIBlockOutputStatus::Pending => {
+7 -7
View File
@@ -1,9 +1,3 @@
use parking_lot::{FairMutex, RwLock};
use pathfinder_color::ColorU;
use settings::Setting as _;
use std::sync::Arc;
use std::time::Duration;
use std::{cmp::Ordering, rc::Rc};
use galaxy_core::features::FeatureFlag;
use galaxy_core::report_error;
use galaxy_core::ui::theme::color::internal_colors;
@@ -16,11 +10,16 @@ use galaxyui::elements::{
use galaxyui::fonts::Weight;
use galaxyui::platform::{Cursor, OperatingSystem};
use galaxyui::ui_components::components::{Coords, UiComponent, UiComponentStyles};
use parking_lot::{FairMutex, RwLock};
use pathfinder_color::ColorU;
use settings::Setting as _;
use std::sync::Arc;
use std::time::Duration;
use std::{cmp::Ordering, rc::Rc};
use lazy_static::lazy_static;
use pathfinder_geometry::vector::vec2f;
use markdown_parser::{FormattedText, FormattedTextFragment, FormattedTextLine};
use galaxy_core::semantic_selection::SemanticSelection;
use galaxy_core::ui::appearance::Appearance;
use galaxy_editor::{
@@ -41,6 +40,7 @@ use galaxyui::{
AppContext, Element, Entity, EntityId, ModelHandle, SingletonEntity, TypedActionView, View,
ViewContext, ViewHandle,
};
use markdown_parser::{FormattedText, FormattedTextFragment, FormattedTextLine};
use crate::ai::agent::{AIAgentPtyWriteMode, CancellationReason};
use crate::ai::blocklist::block::view_impl::common::{
+2 -2
View File
@@ -1,11 +1,11 @@
use std::{collections::HashMap, sync::Arc};
use crate::server::telemetry::{CLISubagentControlState, TelemetryEvent};
use galaxy_core::send_telemetry_from_ctx;
use galaxyui::{Entity, EntityId, ModelContext, ModelHandle, SingletonEntity};
use instant::Instant;
use parking_lot::FairMutex;
use serde::{Deserialize, Serialize};
use galaxy_core::send_telemetry_from_ctx;
use galaxyui::{Entity, EntityId, ModelContext, ModelHandle, SingletonEntity};
use crate::ai::blocklist::context_model::block_context_from_terminal_model;
use crate::{
+1 -1
View File
@@ -1,10 +1,10 @@
mod helper;
mod model_impl;
use galaxy_core::features::FeatureFlag;
pub use helper::AIBlockModelHelper;
pub use model_impl::*;
use session_sharing_protocol::common::ParticipantId;
use galaxy_core::features::FeatureFlag;
use crate::ai::{
agent::{
@@ -2,9 +2,9 @@ use std::marker::PhantomData;
use anyhow::{anyhow, Result};
use chrono::{Local, TimeDelta};
use galaxyui::{AppContext, SingletonEntity, View, ViewContext};
use history_model::{BlocklistAIHistoryEvent, BlocklistAIHistoryModel};
use session_sharing_protocol::common::ParticipantId;
use galaxyui::{AppContext, SingletonEntity, View, ViewContext};
use crate::ai::{
agent::{
@@ -203,7 +203,10 @@ where
let exchange_id = self.exchange_id;
let conversation_id = self.conversation_id;
let history_model = BlocklistAIHistoryModel::handle(ctx);
log::info!("[bedrock-debug] on_updated_output: subscribing for exchange_id={:?}", exchange_id);
log::info!(
"[bedrock-debug] on_updated_output: subscribing for exchange_id={:?}",
exchange_id
);
ctx.subscribe_to_model(&history_model, move |me, _, event, ctx| {
let BlocklistAIHistoryEvent::UpdatedStreamingExchange {
exchange_id: event_exchange_id,
@@ -1,5 +1,3 @@
use pathfinder_geometry::vector::{vec2f, Vector2F};
use std::{cell::RefCell, rc::Rc};
use galaxy_core::ui::appearance::Appearance;
use galaxyui::{
elements::{
@@ -10,6 +8,8 @@ use galaxyui::{
App, Entity, Event, Presenter, TypedActionView, View, ViewContext, ViewHandle, WindowId,
WindowInvalidation,
};
use pathfinder_geometry::vector::{vec2f, Vector2F};
use std::{cell::RefCell, rc::Rc};
use super::*;
@@ -1,9 +1,9 @@
use std::collections::HashMap;
use itertools::Itertools;
use similar::DiffableStr;
use galaxyui::elements::{MouseStateHandle, PartialClickableElement, SecretRange};
use galaxyui::platform::Cursor;
use itertools::Itertools;
use similar::DiffableStr;
use crate::ai::agent::{AIAgentOutput, AIAgentTextSection, AgentOutputText};
use crate::terminal::model::secrets::{SecretLevel, REGEX_LEVEL_METADATA, SECRETS_REGEX};
@@ -1,7 +1,7 @@
use regex::Regex;
use serial_test::serial;
use galaxyui::elements::Text;
use galaxyui::fonts::FamilyId;
use regex::Regex;
use serial_test::serial;
use crate::terminal::model::secrets::{self, SecretLevel};
+4 -4
View File
@@ -67,9 +67,6 @@ use crate::{
util::bindings::keybinding_name_to_keystroke,
BlocklistAIHistoryModel,
};
use instant::Instant;
use parking_lot::FairMutex;
use pathfinder_color::ColorU;
use galaxy_core::{
features::FeatureFlag,
ui::{appearance::Appearance, theme::Fill, Icon as CoreIcon},
@@ -84,6 +81,9 @@ use galaxyui::{
ViewHandle,
};
use galaxyui::{r#async::Timer, TypedActionView};
use instant::Instant;
use parking_lot::FairMutex;
use pathfinder_color::ColorU;
pub fn init(app: &mut AppContext) {
summarization_cancel_dialog::init(app);
@@ -989,8 +989,8 @@ fn latest_model_used_before_exchange<V: View>(
fn render_agent_tip(tip: &AgentTip, app: &AppContext) -> Box<dyn Element> {
use crate::ai::agent_tips::AITip;
use markdown_parser::{FormattedTextFragment, FormattedTextLine};
use galaxyui::text_layout::ClipConfig;
use markdown_parser::{FormattedTextFragment, FormattedTextLine};
let appearance = Appearance::as_ref(app);
let theme = appearance.theme();
+4 -4
View File
@@ -30,9 +30,6 @@ pub mod query;
mod todos;
use common::get_highlight_ranges_for_find_matches;
use pathfinder_color::ColorU;
use settings::Setting as _;
use std::collections::{HashMap, HashSet};
use galaxy_core::features::FeatureFlag;
use galaxy_core::semantic_selection::SemanticSelection;
use galaxyui::elements::{
@@ -45,6 +42,9 @@ use galaxyui::{
AppContext, Element, SingletonEntity,
};
use galaxyui::{View, ViewContext};
use pathfinder_color::ColorU;
use settings::Setting as _;
use std::collections::{HashMap, HashSet};
use crate::ai::agent::AIAgentCitation;
use crate::ai::agent::AIAgentInput;
@@ -82,7 +82,6 @@ use crate::ui_components::blended_colors;
use crate::ui_components::icons::Icon;
use crate::util::link_detection::DetectedLinkType;
use crate::workspace::WorkspaceAction;
use itertools::Itertools;
use galaxy_core::ui::color::contrast::{
foreground_color_with_minimum_contrast, MinimumAllowedContrast,
};
@@ -93,6 +92,7 @@ use galaxyui::fonts::Properties;
use galaxyui::platform::Cursor;
use galaxyui::text_layout::TextStyle;
use galaxyui::ui_components::components::UiComponent;
use itertools::Itertools;
/// Helper function to create gray strikethrough highlight for secrets
fn create_secret_gray_highlight() -> Highlight {
@@ -11,11 +11,6 @@ use std::path::Path;
#[cfg(feature = "local_fs")]
use std::path::PathBuf;
use itertools::Itertools;
use markdown_parser::{FormattedText, FormattedTextInline, TableAlignment};
use pathfinder_color::ColorU;
use pathfinder_geometry::vector::vec2f;
use std::sync::Arc;
use galaxy_core::{
features::FeatureFlag,
ui::{appearance::Appearance, color::blend::Blend, theme::color::internal_colors},
@@ -43,6 +38,11 @@ use galaxyui::{
},
Action, AppContext, Element, EventContext, SingletonEntity, View, ViewHandle,
};
use itertools::Itertools;
use markdown_parser::{FormattedText, FormattedTextInline, TableAlignment};
use pathfinder_color::ColorU;
use pathfinder_geometry::vector::vec2f;
use std::sync::Arc;
use super::{add_highlights_to_rich_text, add_highlights_to_text, output::LinkActionConstructors};
use crate::ai::agent::MessageId;
@@ -22,8 +22,8 @@ use crate::{
features::FeatureFlag,
search::slash_command_menu::static_commands::commands,
};
use ui_components::lightbox::{LightboxImage, LightboxImageSource};
use galaxyui::{elements::Empty, Element};
use ui_components::lightbox::{LightboxImage, LightboxImageSource};
#[test]
fn query_prefix_highlight_len_highlights_invoke_skill_inputs() {
@@ -1,15 +1,15 @@
//! Rendering functions for orchestration-related output items (messaging & agent management).
use pathfinder_color::ColorU;
use galaxyui::elements::{
ConstrainedBox, Container, CornerRadius, CrossAxisAlignment, Empty, Flex, Hoverable,
MouseStateHandle, ParentElement, Radius, Text,
};
use galaxyui::platform::Cursor;
use galaxyui::{AppContext, Element, SingletonEntity};
use pathfinder_color::ColorU;
use markdown_parser::{FormattedText, FormattedTextFragment, FormattedTextLine};
use galaxyui::elements::FormattedTextElement;
use markdown_parser::{FormattedText, FormattedTextFragment, FormattedTextLine};
use crate::ai::agent::conversation::{AIConversation, AIConversationId, ConversationStatus};
use crate::ai::agent::{
+25 -13
View File
@@ -38,9 +38,6 @@ use ai::agent::action::{
RequestComputerUseRequest, SuggestPromptRequest, UploadArtifactRequest, UseComputerRequest,
};
use ai::skills::SkillReference;
use pathfinder_color::ColorU;
use pathfinder_geometry::vector::vec2f;
use ui_components::{button, Component as _, Options as _};
use galaxy_core::ui::theme::color::internal_colors;
#[allow(unused_imports)]
use galaxy_util::path::{common_path, CleanPathResult};
@@ -49,6 +46,9 @@ use galaxyui::elements::{
ChildAnchor, NewScrollable, OffsetPositioning, ParentAnchor, ParentOffsetBounds, Stack,
};
use galaxyui::EntityId;
use pathfinder_color::ColorU;
use pathfinder_geometry::vector::vec2f;
use ui_components::{button, Component as _, Options as _};
use crate::ai::blocklist::block::{
CollapsibleElementState, CollapsibleExpansionState, FinishReason, ImportedCommentGroup,
@@ -108,9 +108,9 @@ use crate::{
workspace::WorkspaceAction,
FeatureFlag,
};
use galaxy_core::channel::ChannelState;
use itertools::Itertools;
use markdown_parser::{FormattedText, FormattedTextFragment, FormattedTextLine};
use galaxy_core::channel::ChannelState;
use super::common::{
format_elapsed_seconds, render_debug_footer, render_failed_output, render_informational_footer,
@@ -220,17 +220,29 @@ pub(super) fn render(props: Props, app: &AppContext) -> Box<dyn Element> {
| AIBlockOutputStatus::Complete { .. }
| AIBlockOutputStatus::Cancelled { .. }
| AIBlockOutputStatus::Failed { .. } => {
if let Some(output) = status.output_to_render() {
if let Some(output) = status.output_to_render() {
let output = output.get();
let total_text_len: usize = output.messages.iter().map(|m| match &m.message {
AIAgentOutputMessageType::Text(t) => t.sections.iter().map(|s| match s {
AIAgentTextSection::PlainText { text } => text.text().len(),
AIAgentTextSection::Code { code, .. } => code.len(),
let total_text_len: usize = output
.messages
.iter()
.map(|m| match &m.message {
AIAgentOutputMessageType::Text(t) => t
.sections
.iter()
.map(|s| match s {
AIAgentTextSection::PlainText { text } => text.text().len(),
AIAgentTextSection::Code { code, .. } => code.len(),
_ => 0,
})
.sum::<usize>(),
_ => 0,
}).sum::<usize>(),
_ => 0,
}).sum();
log::info!("[bedrock-debug] render output: messages={}, total_text_len={}", output.messages.len(), total_text_len);
})
.sum();
log::info!(
"[bedrock-debug] render output: messages={}, total_text_len={}",
output.messages.len(),
total_text_len
);
let is_complete = matches!(status, AIBlockOutputStatus::Complete { .. });
let is_output_for_static_prompt_suggestions =
props.model.contains_static_prompt_suggestion_input(app);

Some files were not shown because too many files have changed in this diff Show More