重构: df-core改名df-types(类型库语义准+全workspace机械改名54处)

This commit is contained in:
2026-06-17 02:44:34 +08:00
parent a19f535134
commit 4be15912cd
40 changed files with 90 additions and 90 deletions

View File

@@ -25,7 +25,7 @@ tracing.workspace = true
chrono.workspace = true
# 后端 crate
df-core = { path = "../crates/df-core" }
df-types = { path = "../crates/df-types" }
df-storage = { path = "../crates/df-storage" }
df-workflow = { path = "../crates/df-workflow" }
df-nodes = { path = "../crates/df-nodes" }

View File

@@ -12,7 +12,7 @@ use df_storage::crud::{AiToolExecutionRepo, ProjectRepo};
use df_storage::db::Database;
use df_storage::models::AiToolExecutionRecord;
use df_core::types::new_id;
use df_types::types::new_id;
use crate::state::AppState;

View File

@@ -8,7 +8,7 @@ use tauri::{AppHandle, Emitter, State};
use df_ai::provider::ChatMessage;
// df-ai 重导出 df_ai_core(供下游直接引用 trait/类型);src-tauri 不直接依赖 df-ai-core crate。
use df_ai::df_ai_core::model::ModelConfig;
use df_core::types::new_id;
use df_types::types::new_id;
use df_storage::models::AiProviderRecord;
use crate::state::AppState;

View File

@@ -16,7 +16,7 @@ use df_storage::crud::{AiConversationRepo, KnowledgeRepo};
use df_storage::db::Database;
use df_storage::models::{AiProviderRecord, KnowledgeRecord};
use df_core::types::new_id;
use df_types::types::new_id;
use crate::state::{AppState, ExtractTrigger, LlmConcurrency};

View File

@@ -11,7 +11,7 @@ use df_execute::shell::{execute, ShellRequest};
use df_storage::db::Database;
use df_storage::models::{ProjectRecord, TaskRecord, IdeaRecord};
use df_core::types::new_id;
use df_types::types::new_id;
use crate::commands::now_millis;

View File

@@ -6,7 +6,7 @@ use serde::Deserialize;
use tauri::State;
use df_ai::provider::LlmProvider;
use df_core::types::{new_id, Priority};
use df_types::types::{new_id, Priority};
use df_ideas::capture::Idea;
use df_storage::models::{IdeaRecord, ProjectRecord};
@@ -298,7 +298,7 @@ fn record_to_idea(record: &IdeaRecord) -> Idea {
id: record.id.clone(),
title: record.title.clone(),
description: record.description.clone(),
status: df_core::types::IdeaStatus::Draft,
status: df_types::types::IdeaStatus::Draft,
priority: priority_from_i32(record.priority),
scores: None,
tags,
@@ -309,7 +309,7 @@ fn record_to_idea(record: &IdeaRecord) -> Idea {
}
}
/// i32 优先级 → Priority 枚举(与 df-core 枚举值一致Low=0/Medium=1/High=2/Critical=3
/// i32 优先级 → Priority 枚举(与 df-types 枚举值一致Low=0/Medium=1/High=2/Critical=3
fn priority_from_i32(p: i32) -> Priority {
match p {
0 => Priority::Low,

View File

@@ -6,7 +6,7 @@
use serde::Deserialize;
use tauri::State;
use df_core::types::new_id;
use df_types::types::new_id;
use df_storage::models::{KnowledgeEventRecord, KnowledgeRecord};
use crate::state::{AppState, KnowledgeConfig};

View File

@@ -7,7 +7,7 @@
use std::sync::Arc;
use df_core::types::new_id;
use df_types::types::new_id;
use df_storage::crud::KnowledgeEventsRepo;
use df_storage::db::Database;
use df_storage::models::KnowledgeEventRecord;

View File

@@ -13,9 +13,9 @@ pub mod workflow;
/// 当前时间戳(毫秒字符串)— 与 df-storage 内部的时间格式保持一致
///
/// 转发 df_core::now_millis(DRY:时间获取统一入口在此 crate,避免 commands 层与 df-storage 各写一份 SystemTime 调用)。
/// 转发 df_types::now_millis(DRY:时间获取统一入口在此 crate,避免 commands 层与 df-storage 各写一份 SystemTime 调用)。
pub(crate) fn now_millis() -> String {
df_core::now_millis().to_string()
df_types::now_millis().to_string()
}
/// .map_err 错误格式化统一入口 — 当前行为零变化(仅 e.to_string()),

View File

@@ -11,7 +11,7 @@ use df_ai::provider::{ChatMessage, CompletionRequest};
use df_ai::router::{
select_model_id, IntelligenceTier, Modality, TaskRequirements,
};
use df_core::types::new_id;
use df_types::types::new_id;
use df_project::scan::{
collect_sample, detect_stack, discover_projects, extract_description, is_monorepo,
normalize_path, DiscoveredProject,

View File

@@ -3,7 +3,7 @@
use serde::Deserialize;
use tauri::State;
use df_core::types::{new_id, TaskStatus};
use df_types::types::{new_id, TaskStatus};
use df_storage::models::TaskRecord;
use crate::state::AppState;

View File

@@ -7,8 +7,8 @@ use serde::Serialize;
use tauri::{AppHandle, Emitter, State};
use tokio::sync::broadcast::error::RecvError;
use df_core::events::{WorkflowEvent, HumanApprovalResponse, SelectType};
use df_core::types::{new_id, NodeStatus};
use df_types::events::{WorkflowEvent, HumanApprovalResponse, SelectType};
use df_types::types::{new_id, NodeStatus};
use df_nodes::task_advance_node::advance_task_atomic;
// F-260616-06 ①-1: 空 dag + target_status 时按目标态自动选推进链模板
use df_nodes::task_workflow_templates::template_for;