chore: flatten src/ to root

This commit is contained in:
2026-03-31 20:55:13 +01:00
parent 51d3b7e05b
commit 0c1b7b051b
1902 changed files with 0 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
import { feature } from 'bun:bundle'
import type { Task, TaskType } from './Task.js'
import { DreamTask } from './tasks/DreamTask/DreamTask.js'
import { LocalAgentTask } from './tasks/LocalAgentTask/LocalAgentTask.js'
import { LocalShellTask } from './tasks/LocalShellTask/LocalShellTask.js'
import { RemoteAgentTask } from './tasks/RemoteAgentTask/RemoteAgentTask.js'
/* eslint-disable @typescript-eslint/no-require-imports */
const LocalWorkflowTask: Task | null = feature('WORKFLOW_SCRIPTS')
? require('./tasks/LocalWorkflowTask/LocalWorkflowTask.js').LocalWorkflowTask
: null
const MonitorMcpTask: Task | null = feature('MONITOR_TOOL')
? require('./tasks/MonitorMcpTask/MonitorMcpTask.js').MonitorMcpTask
: null
/* eslint-enable @typescript-eslint/no-require-imports */
/**
* Get all tasks.
* Mirrors the pattern from tools.ts
* Note: Returns array inline to avoid circular dependency issues with top-level const
*/
export function getAllTasks(): Task[] {
const tasks: Task[] = [
LocalShellTask,
LocalAgentTask,
RemoteAgentTask,
DreamTask,
]
if (LocalWorkflowTask) tasks.push(LocalWorkflowTask)
if (MonitorMcpTask) tasks.push(MonitorMcpTask)
return tasks
}
/**
* Get a task by its type.
*/
export function getTaskByType(type: TaskType): Task | undefined {
return getAllTasks().find(t => t.type === type)
}