mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-04 22:49:41 +02:00
refactor: split types.ts into domain modules (phase 4, step 1)
Split 1,443-line types.ts into 14 focused domain files under src/types/: common.ts, session.ts, task.ts, app-state.ts, respawn.ts, ralph.ts, api.ts, lifecycle.ts, run-summary.ts, tools.ts, teams.ts, push.ts, plan.ts, and index.ts barrel. Moved PlanItem interface from plan-orchestrator.ts into types/plan.ts to break circular dependency. Original types.ts replaced with barrel re-export — zero changes to 36 import sites. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* @fileoverview Task queue type definitions
|
||||
*/
|
||||
|
||||
/** Status of a task in the queue */
|
||||
export type TaskStatus = 'pending' | 'running' | 'completed' | 'failed';
|
||||
|
||||
/**
|
||||
* Definition of a task to be executed
|
||||
*/
|
||||
export interface TaskDefinition {
|
||||
/** Unique task identifier */
|
||||
id: string;
|
||||
/** Prompt to send to Claude */
|
||||
prompt: string;
|
||||
/** Working directory for task execution */
|
||||
workingDir: string;
|
||||
/** Priority level (higher = processed first) */
|
||||
priority: number;
|
||||
/** IDs of tasks that must complete first */
|
||||
dependencies: string[];
|
||||
/** Custom phrase to detect task completion */
|
||||
completionPhrase?: string;
|
||||
/** Timeout in milliseconds */
|
||||
timeoutMs?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Full state of a task including execution details
|
||||
*/
|
||||
export interface TaskState {
|
||||
/** Unique task identifier */
|
||||
id: string;
|
||||
/** Prompt sent to Claude */
|
||||
prompt: string;
|
||||
/** Working directory for task execution */
|
||||
workingDir: string;
|
||||
/** Priority level (higher = processed first) */
|
||||
priority: number;
|
||||
/** IDs of tasks that must complete first */
|
||||
dependencies: string[];
|
||||
/** Custom phrase to detect task completion */
|
||||
completionPhrase?: string;
|
||||
/** Timeout in milliseconds */
|
||||
timeoutMs?: number;
|
||||
/** Current task status */
|
||||
status: TaskStatus;
|
||||
/** ID of session running this task, null if not assigned */
|
||||
assignedSessionId: string | null;
|
||||
/** Timestamp when task was created */
|
||||
createdAt: number;
|
||||
/** Timestamp when task started executing */
|
||||
startedAt: number | null;
|
||||
/** Timestamp when task completed */
|
||||
completedAt: number | null;
|
||||
/** Captured output from Claude */
|
||||
output: string;
|
||||
/** Error message if task failed */
|
||||
error: string | null;
|
||||
}
|
||||
Reference in New Issue
Block a user