Add shared types check in CI (#195)

* add check shared types check in CI

* regenerate shared types
This commit is contained in:
Anastasiia Solop
2025-07-15 18:35:02 +02:00
committed by GitHub
parent 5697cead32
commit 2aac31ac98
11 changed files with 84 additions and 63 deletions

View File

@@ -17,7 +17,6 @@ import type {
TaskWithAttemptStatus,
WorktreeDiff,
} from 'shared/types.ts';
import type { AttemptData } from './taskDetailsContext';
import { attemptsApi, executionProcessesApi } from '@/lib/api.ts';
import {
TaskAttemptDataContext,
@@ -30,6 +29,7 @@ import {
TaskExecutionStateContext,
TaskSelectedAttemptContext,
} from './taskDetailsContext.ts';
import { AttemptData } from '@/lib/types.ts';
const TaskDetailsProvider: FC<{
task: TaskWithAttemptStatus;

View File

@@ -5,17 +5,8 @@ import type {
TaskAttemptState,
TaskWithAttemptStatus,
WorktreeDiff,
TaskAttemptActivityWithPrompt,
ExecutionProcessSummary,
ExecutionProcess,
} from 'shared/types.ts';
// Frontend-only type for combining attempt data
export interface AttemptData {
activities: TaskAttemptActivityWithPrompt[];
processes: ExecutionProcessSummary[];
runningProcessDetails: Record<string, ExecutionProcess>;
}
import { AttemptData } from '@/lib/types.ts';
export interface TaskDetailsContextValue {
task: TaskWithAttemptStatus;

View File

@@ -1,8 +1,8 @@
import { Button } from '@/components/ui/button.tsx';
import { ChevronDown, ChevronUp } from 'lucide-react';
import type { DiffChunkType } from 'shared/types.ts';
import type { ProcessedSection } from './DiffFile';
import { Dispatch, SetStateAction } from 'react';
import { ProcessedSection } from '@/lib/types.ts';
type Props = {
section: ProcessedSection;

View File

@@ -1,23 +1,7 @@
import { Button } from '@/components/ui/button.tsx';
import { ChevronDown, ChevronUp, Trash2 } from 'lucide-react';
import DiffChunkSection from '@/components/tasks/TaskDetails/DiffChunkSection.tsx';
import { FileDiff, DiffChunkType } from 'shared/types.ts';
// Types for processing diff content in the frontend
export interface ProcessedLine {
content: string;
chunkType: DiffChunkType;
oldLineNumber?: number;
newLineNumber?: number;
}
export interface ProcessedSection {
type: 'context' | 'change' | 'expanded';
lines: ProcessedLine[];
expandKey?: string;
expandedAbove?: boolean;
expandedBelow?: boolean;
}
import { FileDiff } from 'shared/types.ts';
import {
Dispatch,
SetStateAction,
@@ -27,6 +11,7 @@ import {
useState,
} from 'react';
import { TaskDeletingFilesContext } from '@/components/context/taskDetailsContext.ts';
import { ProcessedLine, ProcessedSection } from '@/lib/types.ts';
type Props = {
collapsedFiles: Set<string>;

View File

@@ -7,6 +7,7 @@ import {
CreateTask,
CreateTaskAndStart,
CreateTaskAttempt,
DeviceStartResponse,
DirectoryEntry,
type EditorType,
ExecutionProcess,
@@ -15,7 +16,6 @@ import {
NormalizedConversation,
Project,
ProjectWithBranch,
DeviceStartResponse,
Task,
TaskAttempt,
TaskAttemptActivityWithPrompt,

27
frontend/src/lib/types.ts Normal file
View File

@@ -0,0 +1,27 @@
import {
DiffChunkType,
ExecutionProcess,
ExecutionProcessSummary,
TaskAttemptActivityWithPrompt,
} from 'shared/types.ts';
export type AttemptData = {
activities: TaskAttemptActivityWithPrompt[];
processes: ExecutionProcessSummary[];
runningProcessDetails: Record<string, ExecutionProcess>;
};
export interface ProcessedLine {
content: string;
chunkType: DiffChunkType;
oldLineNumber?: number;
newLineNumber?: number;
}
export interface ProcessedSection {
type: 'context' | 'change' | 'expanded';
lines: ProcessedLine[];
expandKey?: string;
expandedAbove?: boolean;
expandedBelow?: boolean;
}