ee1fa6bee5
- Create types/ directory with centralized domain types: session, tool-instance, tool-type, git-repository, config-folder, tool-config, project, user, api-response - Remove inline type definitions from API modules; re-export from types/ for backward compatibility - Update state/sessions.tsx to import Session from types/session.ts - Update all consumer components/pages to import from types/ - Extract seed_builtin_tool_types from main.py to seeds/builtin_tool_types.py - Create types/index.ts barrel export Quality gates: tsc (pass), eslint (pass), Python syntax (pass)
3.7 KiB
3.7 KiB
Task 1.1 Apply Report: Centralize Types and Extract Seed Data
Status: Success
Files Created (13):
apps/web/src/types/session.ts— Canonical Session interfaceapps/web/src/types/tool-instance.ts— Canonical ToolInstance interfaceapps/web/src/types/tool-type.ts— ToolType + ReadinessProbe + request typesapps/web/src/types/git-repository.ts— GitRepository + related types (GitStatus, CommitDetail, etc.)apps/web/src/types/config-folder.ts— ConfigFolder + request typesapps/web/src/types/tool-config.ts— ToolConfig + request typesapps/web/src/types/project.ts— Project typeapps/web/src/types/user.ts— SessionUser + SessionPayloadapps/web/src/types/api-response.ts— Generic ApiResponse + PaginatedResponseapps/web/src/types/index.ts— Barrel export for all domain typesapps/api/src/seeds/__init__.py— Package markerapps/api/src/seeds/builtin_tool_types.py— Extracted seed data + seed function
Files Modified (17):
apps/web/src/api/sessions.ts— Removed inline Session/ToolInstance, import + re-export from types/apps/web/src/api/tool_types.ts— Removed inline ToolType/ReadinessProbe/requests, import + re-export from types/apps/web/src/api/git_repositories.ts— Removed inline GitRepository + related types, import + re-export from types/apps/web/src/api/config_folders.ts— Removed inline ConfigFolder + requests, import + re-export from types/apps/web/src/api/tool_configs.ts— Removed inline ToolConfig + requests, import + re-export from types/apps/web/src/state/sessions.tsx— Removed inline Session, imports from types/session.tsapps/web/src/types.ts— Removed Project/User/SessionPayload (now re-export from types/)apps/web/src/components/app-shell.tsx— Updated Session import to types/session.tsapps/web/src/components/instance-list.tsx— Updated ToolInstance/ToolType imports to types/apps/web/src/components/repositories-settings-tab.tsx— Updated GitRepository import to types/apps/web/src/components/repository-create-dialog.tsx— Updated GitRepositoryCreate/URLParseResult imports to types/apps/web/src/pages/dashboard.tsx— Updated SessionApi/GitRepository/ToolType/Project imports to types/apps/web/src/pages/sessions.tsx— Updated Session/GitRepository/ToolType/Project imports to types/apps/web/src/pages/repo-workspace.tsx— Updated GitRepository/ToolType imports to types/apps/web/src/pages/tool-types.tsx— Updated ToolType/CreateToolTypeRequest/UpdateToolTypeRequest imports to types/apps/web/src/pages/tool-configs.tsx— Updated ToolType/ToolConfig imports to types/apps/web/src/pages/git-repositories.tsx— Updated GitRepository import to types/apps/api/src/main.py— Removed inline seed_builtin_tool_types, imports from seeds.builtin_tool_types
Files Deleted: None
Quality Gate Results:
npm run typecheck(frontend): PASS — zero errorsnpm run lint(frontend): PASS — zero warnings- Python syntax check (backend main.py + seeds): PASS — exit code 0
- Type uniqueness verification:
interface Sessionappears exactly once (in types/session.ts)interface ToolInstanceappears exactly once (in types/tool-instance.ts)interface ToolTypeappears exactly once (in types/tool-type.ts)interface GitRepositoryappears exactly once (in types/git-repository.ts)
Blockers/Deviations:
- None. All types successfully centralized with backward-compatible re-exports from API modules.
- The
types.tsfile atapps/web/src/types.tsstill exists as a legacy re-export file to avoid breaking any remaining consumers. It will be removed in a later phase once all imports are confirmed migrated.