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

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