forked from boos/BoosAPI
feat(desktop): embed BoosAPI Desktop client as a subproject
Vendor the rebranded BoosAPI Desktop client (Tauri + Vue) into metapi as a monorepo subdirectory under desktop/. Source only — node_modules, dist, Cargo target and the upstream .git history are excluded. desktop/ keeps its own independent Cargo workspace (desktop/src-tauri with crates/*); it is not part of the backend boosapi crate, so a `cargo check` at the metapi root still compiles only the backend. Build the desktop app from desktop/src-tauri per desktop/README.md. Note: app icons are still placeholder assets pending the final BoosAPI logo. The updater signing keys live outside the repo and are not included.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "agent_sessions")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub conversation_id: String,
|
||||
pub cwd: Option<String>,
|
||||
pub permission_mode: String,
|
||||
pub runtime_status: String,
|
||||
pub sdk_context_json: Option<String>,
|
||||
pub sdk_context_backup_json: Option<String>,
|
||||
pub total_tokens: i32,
|
||||
pub total_cost_usd: f64,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,22 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "artifacts")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub conversation_id: String,
|
||||
pub kind: String,
|
||||
pub title: String,
|
||||
#[sea_orm(column_type = "Text")]
|
||||
pub content: String,
|
||||
pub format: String,
|
||||
pub pinned: i32,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,23 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "backup_manifests")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub version: String,
|
||||
pub created_at: String,
|
||||
pub encrypted: i32,
|
||||
pub checksum: String,
|
||||
#[sea_orm(column_type = "Text")]
|
||||
pub object_counts_json: String,
|
||||
pub source_app_version: String,
|
||||
pub file_path: Option<String>,
|
||||
pub file_size: i64,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,17 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "backup_targets")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub kind: String,
|
||||
#[sea_orm(column_type = "Text")]
|
||||
pub config_json: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,17 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "builtin_model_deletions")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub builtin_id: String,
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub model_id: String,
|
||||
pub deleted_at: i64,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,23 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "context_sources")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub conversation_id: String,
|
||||
pub message_id: Option<String>,
|
||||
#[sea_orm(column_name = "type")]
|
||||
pub source_type: String,
|
||||
pub ref_id: String,
|
||||
pub title: String,
|
||||
pub enabled: i32,
|
||||
#[sea_orm(column_type = "Text", nullable)]
|
||||
pub summary: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,21 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "conversation_branches")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub conversation_id: String,
|
||||
pub parent_message_id: String,
|
||||
pub branch_label: String,
|
||||
pub branch_index: i32,
|
||||
#[sea_orm(column_type = "Text", nullable)]
|
||||
pub compared_message_ids_json: Option<String>,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,28 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "conversation_categories")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub icon_type: Option<String>,
|
||||
pub icon_value: Option<String>,
|
||||
pub system_prompt: Option<String>,
|
||||
pub default_provider_id: Option<String>,
|
||||
pub default_model_id: Option<String>,
|
||||
pub default_temperature: Option<f64>,
|
||||
pub default_max_tokens: Option<i64>,
|
||||
pub default_top_p: Option<f64>,
|
||||
pub default_frequency_penalty: Option<f64>,
|
||||
pub sort_order: i32,
|
||||
pub is_collapsed: i32,
|
||||
pub created_at: i64,
|
||||
pub updated_at: i64,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,34 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "conversation_summaries")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub conversation_id: String,
|
||||
pub summary_text: String,
|
||||
pub compressed_until_message_id: Option<String>,
|
||||
pub token_count: Option<i64>,
|
||||
pub model_used: Option<String>,
|
||||
pub created_at: i64,
|
||||
pub updated_at: i64,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::conversations::Entity",
|
||||
from = "Column::ConversationId",
|
||||
to = "super::conversations::Column::Id"
|
||||
)]
|
||||
Conversation,
|
||||
}
|
||||
|
||||
impl Related<super::conversations::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Conversation.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,51 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "conversations")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub title: String,
|
||||
pub model_id: String,
|
||||
pub provider_id: String,
|
||||
pub system_prompt: Option<String>,
|
||||
pub temperature: Option<f64>,
|
||||
pub max_tokens: Option<i64>,
|
||||
pub top_p: Option<f64>,
|
||||
pub frequency_penalty: Option<f64>,
|
||||
pub search_enabled: i32,
|
||||
pub search_provider_id: Option<String>,
|
||||
pub thinking_budget: Option<i64>,
|
||||
pub thinking_level: Option<String>,
|
||||
pub enabled_mcp_server_ids: String,
|
||||
pub enabled_knowledge_base_ids: String,
|
||||
pub enabled_memory_namespace_ids: String,
|
||||
pub message_count: i32,
|
||||
pub created_at: i64,
|
||||
pub updated_at: i64,
|
||||
pub is_pinned: i32,
|
||||
pub is_archived: i32,
|
||||
pub workspace_snapshot_json: String,
|
||||
pub active_branch_id: Option<String>,
|
||||
pub active_artifact_id: Option<String>,
|
||||
pub research_mode: i32,
|
||||
pub context_compression: i32,
|
||||
pub category_id: Option<String>,
|
||||
pub parent_conversation_id: Option<String>,
|
||||
pub mode: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(has_many = "super::messages::Entity")]
|
||||
Messages,
|
||||
}
|
||||
|
||||
impl Related<super::messages::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Messages.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,20 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "desktop_state")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub window_key: String,
|
||||
pub width: i32,
|
||||
pub height: i32,
|
||||
pub x: Option<i64>,
|
||||
pub y: Option<i64>,
|
||||
pub maximized: i32,
|
||||
pub visible: i32,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,31 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "drawing_generations")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub parent_generation_id: Option<String>,
|
||||
pub provider_id: String,
|
||||
pub key_id: String,
|
||||
pub model_id: String,
|
||||
pub api_kind: String,
|
||||
pub action: String,
|
||||
pub prompt: String,
|
||||
pub parameters_json: String,
|
||||
pub reference_file_ids_json: String,
|
||||
pub source_image_ids_json: String,
|
||||
pub mask_file_id: Option<String>,
|
||||
pub status: String,
|
||||
pub error_message: Option<String>,
|
||||
pub response_id: Option<String>,
|
||||
pub usage_json: Option<String>,
|
||||
pub created_at: i64,
|
||||
pub completed_at: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,22 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "drawing_images")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub generation_id: String,
|
||||
pub stored_file_id: String,
|
||||
pub storage_path: String,
|
||||
pub mime_type: String,
|
||||
pub width: Option<i32>,
|
||||
pub height: Option<i32>,
|
||||
pub revised_prompt: Option<String>,
|
||||
pub created_at: i64,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,18 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "gateway_diagnostics")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub category: String,
|
||||
pub status: String,
|
||||
pub message: String,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,31 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "gateway_keys")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
#[sea_orm(unique)]
|
||||
pub key_hash: String,
|
||||
pub key_prefix: String,
|
||||
pub enabled: i32,
|
||||
pub created_at: i64,
|
||||
pub last_used_at: Option<i64>,
|
||||
pub encrypted_key: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(has_many = "super::gateway_usage::Entity")]
|
||||
GatewayUsage,
|
||||
}
|
||||
|
||||
impl Related<super::gateway_usage::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::GatewayUsage.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,26 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "gateway_request_logs")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub key_id: String,
|
||||
pub key_name: String,
|
||||
pub method: String,
|
||||
pub path: String,
|
||||
pub model: Option<String>,
|
||||
pub provider_id: Option<String>,
|
||||
pub status_code: i32,
|
||||
pub duration_ms: i32,
|
||||
pub request_tokens: i32,
|
||||
pub response_tokens: i32,
|
||||
pub error_message: Option<String>,
|
||||
pub created_at: i64,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,33 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "gateway_usage")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: i64,
|
||||
pub key_id: String,
|
||||
pub provider_id: String,
|
||||
pub model_id: Option<String>,
|
||||
pub request_tokens: i32,
|
||||
pub response_tokens: i32,
|
||||
pub created_at: i64,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::gateway_keys::Entity",
|
||||
from = "Column::KeyId",
|
||||
to = "super::gateway_keys::Column::Id"
|
||||
)]
|
||||
GatewayKeys,
|
||||
}
|
||||
|
||||
impl Related<super::gateway_keys::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::GatewayKeys.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,20 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "import_jobs")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub source_type: String,
|
||||
pub status: String,
|
||||
#[sea_orm(column_type = "Text", nullable)]
|
||||
pub summary_json: Option<String>,
|
||||
pub conflict_count: i32,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,42 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "knowledge_bases")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
#[sea_orm(column_type = "Text", nullable)]
|
||||
pub description: Option<String>,
|
||||
pub embedding_provider: Option<String>,
|
||||
pub enabled: i32,
|
||||
pub icon_type: Option<String>,
|
||||
pub icon_value: Option<String>,
|
||||
pub sort_order: i32,
|
||||
pub embedding_dimensions: Option<i32>,
|
||||
pub retrieval_threshold: Option<f32>,
|
||||
pub retrieval_top_k: Option<i32>,
|
||||
pub rerank_provider: Option<String>,
|
||||
pub rerank_candidate_k: Option<i32>,
|
||||
pub chunk_size: Option<i32>,
|
||||
pub chunk_overlap: Option<i32>,
|
||||
#[sea_orm(column_type = "Text", nullable)]
|
||||
pub separator: Option<String>,
|
||||
pub index_concurrency: Option<i32>,
|
||||
pub index_interval_ms: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(has_many = "super::knowledge_documents::Entity")]
|
||||
KnowledgeDocuments,
|
||||
}
|
||||
|
||||
impl Related<super::knowledge_documents::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::KnowledgeDocuments.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,36 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "knowledge_documents")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub knowledge_base_id: String,
|
||||
pub title: String,
|
||||
pub source_path: String,
|
||||
pub mime_type: String,
|
||||
pub size_bytes: i64,
|
||||
pub indexing_status: String,
|
||||
pub doc_type: String,
|
||||
pub index_error: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::knowledge_bases::Entity",
|
||||
from = "Column::KnowledgeBaseId",
|
||||
to = "super::knowledge_bases::Column::Id",
|
||||
on_delete = "Cascade"
|
||||
)]
|
||||
KnowledgeBase,
|
||||
}
|
||||
|
||||
impl Related<super::knowledge_bases::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::KnowledgeBase.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,37 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "mcp_servers")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub transport: String,
|
||||
pub command: Option<String>,
|
||||
pub args_json: Option<String>,
|
||||
pub endpoint: Option<String>,
|
||||
pub env_json: Option<String>,
|
||||
pub enabled: i32,
|
||||
pub permission_policy: String,
|
||||
pub source: String,
|
||||
pub discover_timeout_secs: Option<i32>,
|
||||
pub execute_timeout_secs: Option<i32>,
|
||||
pub headers_json: Option<String>,
|
||||
pub icon_type: Option<String>,
|
||||
pub icon_value: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(has_many = "super::tool_descriptors::Entity")]
|
||||
ToolDescriptors,
|
||||
}
|
||||
|
||||
impl Related<super::tool_descriptors::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::ToolDescriptors.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,36 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "memory_items")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub namespace_id: String,
|
||||
pub title: String,
|
||||
#[sea_orm(column_type = "Text")]
|
||||
pub content: String,
|
||||
pub source: String,
|
||||
pub index_status: String,
|
||||
pub index_error: Option<String>,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::memory_namespaces::Entity",
|
||||
from = "Column::NamespaceId",
|
||||
to = "super::memory_namespaces::Column::Id",
|
||||
on_delete = "Cascade"
|
||||
)]
|
||||
MemoryNamespace,
|
||||
}
|
||||
|
||||
impl Related<super::memory_namespaces::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::MemoryNamespace.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,32 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "memory_namespaces")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub scope: String,
|
||||
pub embedding_provider: Option<String>,
|
||||
pub embedding_dimensions: Option<i32>,
|
||||
pub retrieval_threshold: Option<f32>,
|
||||
pub retrieval_top_k: Option<i32>,
|
||||
pub icon_type: Option<String>,
|
||||
pub icon_value: Option<String>,
|
||||
pub sort_order: i32,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(has_many = "super::memory_items::Entity")]
|
||||
MemoryItems,
|
||||
}
|
||||
|
||||
impl Related<super::memory_items::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::MemoryItems.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,48 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "messages")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub conversation_id: String,
|
||||
pub role: String,
|
||||
pub content: String,
|
||||
pub provider_id: Option<String>,
|
||||
pub model_id: Option<String>,
|
||||
pub token_count: Option<i64>,
|
||||
pub prompt_tokens: Option<i64>,
|
||||
pub completion_tokens: Option<i64>,
|
||||
pub attachments: String,
|
||||
pub thinking: Option<String>,
|
||||
pub created_at: i64,
|
||||
pub branch_id: Option<String>,
|
||||
pub parent_message_id: Option<String>,
|
||||
pub version_index: i32,
|
||||
pub is_active: i32,
|
||||
pub tool_calls_json: Option<String>,
|
||||
pub tool_call_id: Option<String>,
|
||||
#[sea_orm(default_value = "complete")]
|
||||
pub status: String,
|
||||
pub tokens_per_second: Option<f64>,
|
||||
pub first_token_latency_ms: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::conversations::Entity",
|
||||
from = "Column::ConversationId",
|
||||
to = "super::conversations::Column::Id"
|
||||
)]
|
||||
Conversation,
|
||||
}
|
||||
|
||||
impl Related<super::conversations::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Conversation.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,44 @@
|
||||
//! SeaORM entity definitions for BoosApi database tables.
|
||||
|
||||
pub mod builtin_model_deletions;
|
||||
pub mod conversation_categories;
|
||||
pub mod conversation_summaries;
|
||||
pub mod conversations;
|
||||
pub mod desktop_state;
|
||||
pub mod drawing_generations;
|
||||
pub mod drawing_images;
|
||||
pub mod gateway_diagnostics;
|
||||
pub mod gateway_keys;
|
||||
pub mod gateway_request_logs;
|
||||
pub mod gateway_usage;
|
||||
pub mod mcp_servers;
|
||||
pub mod messages;
|
||||
pub mod models;
|
||||
pub mod program_policies;
|
||||
pub mod provider_keys;
|
||||
pub mod providers;
|
||||
pub mod search_citations;
|
||||
pub mod search_providers;
|
||||
pub mod settings;
|
||||
pub mod skill_states;
|
||||
pub mod tool_descriptors;
|
||||
pub mod tool_executions;
|
||||
|
||||
// Wave 2+ entities
|
||||
pub mod artifacts;
|
||||
pub mod backup_manifests;
|
||||
pub mod backup_targets;
|
||||
pub mod context_sources;
|
||||
pub mod conversation_branches;
|
||||
pub mod import_jobs;
|
||||
pub mod knowledge_bases;
|
||||
pub mod knowledge_documents;
|
||||
pub mod memory_items;
|
||||
pub mod memory_namespaces;
|
||||
pub mod retrieval_hits;
|
||||
|
||||
pub mod stored_files;
|
||||
|
||||
pub mod agent_sessions;
|
||||
|
||||
pub use sea_orm;
|
||||
@@ -0,0 +1,36 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "models")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub provider_id: String,
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub model_id: String,
|
||||
pub name: String,
|
||||
pub group_name: Option<String>,
|
||||
pub model_type: String,
|
||||
pub capabilities: String,
|
||||
pub max_tokens: Option<i64>,
|
||||
pub enabled: i32,
|
||||
pub param_overrides: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::providers::Entity",
|
||||
from = "Column::ProviderId",
|
||||
to = "super::providers::Column::Id"
|
||||
)]
|
||||
Provider,
|
||||
}
|
||||
|
||||
impl Related<super::providers::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Provider.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,21 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "program_policies")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
#[sea_orm(unique)]
|
||||
pub program_name: String,
|
||||
pub allowed_provider_ids_json: String,
|
||||
pub allowed_model_ids_json: String,
|
||||
pub default_provider_id: Option<String>,
|
||||
pub default_model_id: Option<String>,
|
||||
pub rate_limit_per_minute: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,35 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "provider_keys")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub provider_id: String,
|
||||
pub key_encrypted: String,
|
||||
pub key_prefix: String,
|
||||
pub enabled: i32,
|
||||
pub last_validated_at: Option<i64>,
|
||||
pub last_error: Option<String>,
|
||||
pub rotation_index: i32,
|
||||
pub created_at: i64,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::providers::Entity",
|
||||
from = "Column::ProviderId",
|
||||
to = "super::providers::Column::Id"
|
||||
)]
|
||||
Provider,
|
||||
}
|
||||
|
||||
impl Related<super::providers::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Provider.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,43 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "providers")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub provider_type: String,
|
||||
pub api_host: String,
|
||||
pub api_path: Option<String>,
|
||||
pub enabled: i32,
|
||||
pub proxy_config: Option<String>,
|
||||
pub custom_headers: Option<String>,
|
||||
pub icon: Option<String>,
|
||||
pub builtin_id: Option<String>,
|
||||
pub sort_order: i32,
|
||||
pub created_at: i64,
|
||||
pub updated_at: i64,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(has_many = "super::provider_keys::Entity")]
|
||||
ProviderKeys,
|
||||
#[sea_orm(has_many = "super::models::Entity")]
|
||||
Models,
|
||||
}
|
||||
|
||||
impl Related<super::provider_keys::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::ProviderKeys.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl Related<super::models::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Models.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,22 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "retrieval_hits")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub conversation_id: String,
|
||||
pub message_id: String,
|
||||
pub knowledge_base_id: String,
|
||||
pub document_id: String,
|
||||
pub chunk_ref: String,
|
||||
pub score: f64,
|
||||
#[sea_orm(column_type = "Text")]
|
||||
pub preview: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,21 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "search_citations")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub conversation_id: String,
|
||||
pub message_id: String,
|
||||
pub title: String,
|
||||
pub url: String,
|
||||
pub snippet: Option<String>,
|
||||
pub provider_id: String,
|
||||
pub rank: i32,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,24 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "search_providers")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub provider_type: String,
|
||||
pub endpoint: Option<String>,
|
||||
pub api_key_ref: Option<String>,
|
||||
pub enabled: i32,
|
||||
pub region: Option<String>,
|
||||
pub language: Option<String>,
|
||||
pub safe_search: Option<i64>,
|
||||
pub result_limit: i32,
|
||||
pub timeout_ms: i32,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,16 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "settings")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub key: String,
|
||||
#[sea_orm(column_type = "Text")]
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,16 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "skill_states")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub name: String,
|
||||
pub enabled: i32,
|
||||
pub updated_at: i64,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,21 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "stored_files")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub hash: String,
|
||||
pub original_name: String,
|
||||
pub mime_type: String,
|
||||
pub size_bytes: i64,
|
||||
pub storage_path: String,
|
||||
pub conversation_id: Option<String>,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,31 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "tool_descriptors")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub server_id: String,
|
||||
pub name: String,
|
||||
pub description: Option<String>,
|
||||
pub input_schema_json: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::mcp_servers::Entity",
|
||||
from = "Column::ServerId",
|
||||
to = "super::mcp_servers::Column::Id"
|
||||
)]
|
||||
McpServers,
|
||||
}
|
||||
|
||||
impl Related<super::mcp_servers::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::McpServers.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -0,0 +1,25 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "tool_executions")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: String,
|
||||
pub conversation_id: String,
|
||||
pub message_id: Option<String>,
|
||||
pub server_id: String,
|
||||
pub tool_name: String,
|
||||
pub status: String,
|
||||
pub input_preview: Option<String>,
|
||||
pub output_preview: Option<String>,
|
||||
pub error_message: Option<String>,
|
||||
pub duration_ms: Option<i64>,
|
||||
pub created_at: String,
|
||||
pub approval_status: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
Reference in New Issue
Block a user