first pass of merging in warp (doesn't build)
This commit is contained in:
+18
-16
@@ -4,7 +4,6 @@ cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "local_fs")] {
|
||||
pub mod agent;
|
||||
mod block_list;
|
||||
mod cloud_objects;
|
||||
mod sqlite;
|
||||
pub mod commands;
|
||||
}
|
||||
@@ -17,30 +16,32 @@ pub use persistence::schema;
|
||||
#[cfg(feature = "integration_tests")]
|
||||
pub mod testing;
|
||||
|
||||
use instant::Instant;
|
||||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::mpsc::SyncSender;
|
||||
use std::sync::Arc;
|
||||
use std::thread::JoinHandle;
|
||||
|
||||
use crate::ai::persisted_workspace::EnablementState;
|
||||
use ai::project_context::model::ProjectRulePath;
|
||||
use ai::workspace::WorkspaceMetadata as CodeWorkspaceMetadata;
|
||||
use chrono::{DateTime, Local, Utc};
|
||||
use galaxy_core::command::ExitCode;
|
||||
use galaxy_graphql::scalars::time::ServerTimestamp;
|
||||
use galaxyui::{AppContext, Entity, SingletonEntity};
|
||||
use instant::Instant;
|
||||
use lsp::supported_servers::LSPServerType;
|
||||
#[cfg(any(feature = "local_fs", feature = "integration_tests"))]
|
||||
pub use sqlite::database_file_path_for_scope;
|
||||
#[cfg(any(feature = "local_fs", feature = "integration_tests"))]
|
||||
pub use sqlite::establish_ro_connection;
|
||||
use uuid::Uuid;
|
||||
use warp_multi_agent_api as api;
|
||||
|
||||
use self::model::{AgentConversation, AgentConversationData, Project};
|
||||
use crate::ai::blocklist::PersistedAIInput;
|
||||
use crate::ai::mcp::TemplatableMCPServerInstallation;
|
||||
use crate::ai::persisted_workspace::EnablementState;
|
||||
use crate::app_state::AppState;
|
||||
use crate::auth::auth_manager::PersistedCurrentUserInformation;
|
||||
use crate::cloud_object::model::actions::ObjectAction;
|
||||
use crate::cloud_object::model::generic_string_model::CloudStringObject;
|
||||
|
||||
use crate::cloud_object::{
|
||||
CloudObject, CloudObjectMetadata, ObjectIdType, RevisionAndLastEditor, ServerCreationInfo,
|
||||
};
|
||||
@@ -55,25 +56,26 @@ use crate::terminal::model::session::SessionId;
|
||||
use crate::workflows::CloudWorkflow;
|
||||
use crate::workspaces::user_profiles::UserProfileWithUID;
|
||||
use crate::workspaces::workspace::{Workspace as WorkspaceMetadata, WorkspaceUid};
|
||||
use ai::workspace::WorkspaceMetadata as CodeWorkspaceMetadata;
|
||||
|
||||
use self::model::{AgentConversation, AgentConversationData, Project};
|
||||
|
||||
#[cfg(any(feature = "local_fs", feature = "integration_tests"))]
|
||||
pub use sqlite::database_file_path;
|
||||
#[cfg(any(feature = "local_fs", feature = "integration_tests"))]
|
||||
pub use sqlite::establish_ro_connection;
|
||||
pub enum PersistenceScope {
|
||||
App,
|
||||
RemoteServerDaemon { identity_key: String },
|
||||
}
|
||||
|
||||
/// Initializes the persistence "subsystem".
|
||||
///
|
||||
/// Returns the previously-persisted data, if any, and handles for
|
||||
/// writing updated data to persist, if the persistence subsystem is
|
||||
/// available.
|
||||
#[tracing::instrument(name = "persistence::initialize", skip_all, fields(tags.cloud_agent = true))]
|
||||
#[cfg_attr(not(feature = "local_fs"), allow(unused_variables))]
|
||||
pub fn initialize(ctx: &mut AppContext) -> (Option<PersistedData>, Option<WriterHandles>) {
|
||||
pub fn initialize(
|
||||
ctx: &mut AppContext,
|
||||
scope: PersistenceScope,
|
||||
) -> (Option<Box<PersistedData>>, Option<WriterHandles>) {
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "local_fs")] {
|
||||
sqlite::initialize(ctx)
|
||||
sqlite::initialize(ctx, scope)
|
||||
} else {
|
||||
(None, None)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user