diff --git a/crates/db/src/models/project.rs b/crates/db/src/models/project.rs index 3def1a22..01a1fdc9 100644 --- a/crates/db/src/models/project.rs +++ b/crates/db/src/models/project.rs @@ -58,40 +58,6 @@ pub struct UpdateProject { pub copy_files: Option, } -#[derive(Debug, Serialize, TS)] -pub struct ProjectWithBranch { - pub id: Uuid, - pub name: String, - pub git_repo_path: PathBuf, - pub setup_script: Option, - pub dev_script: Option, - pub cleanup_script: Option, - pub copy_files: Option, - pub current_branch: Option, - - #[ts(type = "Date")] - pub created_at: DateTime, - #[ts(type = "Date")] - pub updated_at: DateTime, -} - -impl ProjectWithBranch { - pub fn from_project(project: Project, current_branch: Option) -> Self { - Self { - id: project.id, - name: project.name, - git_repo_path: project.git_repo_path, - setup_script: project.setup_script, - dev_script: project.dev_script, - cleanup_script: project.cleanup_script, - copy_files: project.copy_files, - current_branch, - created_at: project.created_at, - updated_at: project.updated_at, - } - } -} - #[derive(Debug, Serialize, TS)] pub struct SearchResult { pub path: String, diff --git a/crates/server/src/bin/generate_types.rs b/crates/server/src/bin/generate_types.rs index 179332a0..cfa7453e 100644 --- a/crates/server/src/bin/generate_types.rs +++ b/crates/server/src/bin/generate_types.rs @@ -13,12 +13,10 @@ fn generate_types_content() -> String { services::services::filesystem::DirectoryEntry::decl(), services::services::filesystem::DirectoryListResponse::decl(), db::models::project::Project::decl(), - db::models::project::ProjectWithBranch::decl(), db::models::project::CreateProject::decl(), db::models::project::UpdateProject::decl(), db::models::project::SearchResult::decl(), db::models::project::SearchMatchType::decl(), - services::services::file_search_cache::SearchMode::decl(), executors::actions::ExecutorAction::decl(), executors::mcp_config::McpConfig::decl(), executors::actions::ExecutorActionType::decl(), @@ -64,7 +62,6 @@ fn generate_types_content() -> String { services::services::git::GitBranch::decl(), utils::diff::Diff::decl(), utils::diff::DiffChangeKind::decl(), - utils::diff::FileDiffDetails::decl(), services::services::github_service::RepositoryInfo::decl(), executors::command::CommandBuilder::decl(), executors::profile::ExecutorProfileId::decl(), @@ -88,9 +85,7 @@ fn generate_types_content() -> String { server::routes::task_attempts::CreateTaskAttemptBody::decl(), server::routes::task_attempts::RebaseTaskAttemptRequest::decl(), server::routes::task_attempts::ReplaceProcessRequest::decl(), - server::routes::task_attempts::ReplaceProcessResult::decl(), server::routes::task_attempts::CommitInfo::decl(), - server::routes::task_attempts::CommitCompareResult::decl(), server::routes::task_attempts::BranchStatus::decl(), db::models::task_attempt::TaskAttempt::decl(), db::models::execution_process::ExecutionProcess::decl(), @@ -101,13 +96,9 @@ fn generate_types_content() -> String { db::models::merge::PrMerge::decl(), db::models::merge::MergeStatus::decl(), db::models::merge::PullRequestInfo::decl(), - services::services::events::EventPatch::decl(), - services::services::events::EventPatchInner::decl(), - services::services::events::RecordTypes::decl(), db::models::follow_up_draft::FollowUpDraft::decl(), executors::logs::CommandExitStatus::decl(), executors::logs::CommandRunResult::decl(), - executors::logs::NormalizedConversation::decl(), executors::logs::NormalizedEntry::decl(), executors::logs::NormalizedEntryType::decl(), executors::logs::FileChange::decl(), diff --git a/shared/types.ts b/shared/types.ts index 23c5c756..c500430c 100644 --- a/shared/types.ts +++ b/shared/types.ts @@ -10,8 +10,6 @@ export type DirectoryListResponse = { entries: Array, current_pa export type Project = { id: string, name: string, git_repo_path: string, setup_script: string | null, dev_script: string | null, cleanup_script: string | null, copy_files: string | null, created_at: Date, updated_at: Date, }; -export type ProjectWithBranch = { id: string, name: string, git_repo_path: string, setup_script: string | null, dev_script: string | null, cleanup_script: string | null, copy_files: string | null, current_branch: string | null, created_at: Date, updated_at: Date, }; - export type CreateProject = { name: string, git_repo_path: string, use_existing_repo: boolean, setup_script: string | null, dev_script: string | null, cleanup_script: string | null, copy_files: string | null, }; export type UpdateProject = { name: string | null, git_repo_path: string | null, setup_script: string | null, dev_script: string | null, cleanup_script: string | null, copy_files: string | null, }; @@ -20,8 +18,6 @@ export type SearchResult = { path: string, is_file: boolean, match_type: SearchM export type SearchMatchType = "FileName" | "DirectoryName" | "FullPath"; -export type SearchMode = "taskform" | "settings"; - export type ExecutorAction = { typ: ExecutorActionType, next_action: ExecutorAction | null, }; export type McpConfig = { servers: { [key in string]?: JsonValue }, servers_path: Array, template: JsonValue, preconfigured: JsonValue, is_toml_config: boolean, }; @@ -116,8 +112,6 @@ export type Diff = { change: DiffChangeKind, oldPath: string | null, newPath: st export type DiffChangeKind = "added" | "deleted" | "modified" | "renamed" | "copied" | "permissionChange"; -export type FileDiffDetails = { fileName: string | null, content: string | null, }; - export type RepositoryInfo = { id: bigint, name: string, full_name: string, owner: string, description: string | null, clone_url: string, ssh_url: string, default_branch: string, private: boolean, }; export type CommandBuilder = { @@ -212,12 +206,8 @@ force_when_dirty: boolean | null, */ perform_git_reset: boolean | null, }; -export type ReplaceProcessResult = { deleted_count: bigint, git_reset_needed: boolean, git_reset_applied: boolean, target_before_oid: string | null, new_execution_id: string | null, }; - export type CommitInfo = { sha: string, subject: string, }; -export type CommitCompareResult = { head_oid: string, target_oid: string, ahead_from_head: number, behind_from_head: number, is_linear: boolean, }; - export type BranchStatus = { commits_behind: number | null, commits_ahead: number | null, has_uncommitted_changes: boolean | null, head_oid: string | null, uncommitted_count: number | null, untracked_count: number | null, base_branch_name: string, remote_commits_behind: number | null, remote_commits_ahead: number | null, merges: Array, }; export type TaskAttempt = { id: string, task_id: string, container_ref: string | null, branch: string | null, base_branch: string, executor: string, worktree_deleted: boolean, setup_completed_at: string | null, created_at: string, updated_at: string, }; @@ -252,20 +242,12 @@ export type MergeStatus = "open" | "merged" | "closed" | "unknown"; export type PullRequestInfo = { number: bigint, url: string, status: MergeStatus, merged_at: string | null, merge_commit_sha: string | null, }; -export type EventPatch = { op: string, path: string, value: EventPatchInner, }; - -export type EventPatchInner = { db_op: string, record: RecordTypes, }; - -export type RecordTypes = { "type": "TASK", "data": Task } | { "type": "TASK_ATTEMPT", "data": TaskAttempt } | { "type": "EXECUTION_PROCESS", "data": ExecutionProcess } | { "type": "FOLLOW_UP_DRAFT", "data": FollowUpDraft } | { "type": "DELETED_TASK", "data": { rowid: bigint, project_id: string | null, task_id: string | null, } } | { "type": "DELETED_TASK_ATTEMPT", "data": { rowid: bigint, task_id: string | null, } } | { "type": "DELETED_EXECUTION_PROCESS", "data": { rowid: bigint, task_attempt_id: string | null, process_id: string | null, } } | { "type": "DELETED_FOLLOW_UP_DRAFT", "data": { rowid: bigint, task_attempt_id: string | null, } }; - export type FollowUpDraft = { id: string, task_attempt_id: string, prompt: string, queued: boolean, sending: boolean, variant: string | null, image_ids: Array | null, created_at: string, updated_at: string, version: bigint, }; export type CommandExitStatus = { "type": "exit_code", code: number, } | { "type": "success", success: boolean, }; export type CommandRunResult = { exit_status: CommandExitStatus | null, output: string | null, }; -export type NormalizedConversation = { entries: Array, session_id: string | null, executor_type: string, prompt: string | null, summary: string | null, }; - export type NormalizedEntry = { timestamp: string | null, entry_type: NormalizedEntryType, content: string, }; export type NormalizedEntryType = { "type": "user_message" } | { "type": "assistant_message" } | { "type": "tool_use", tool_name: string, action_type: ActionType, } | { "type": "system_message" } | { "type": "error_message" } | { "type": "thinking" } | { "type": "loading" };