Import
import {
deriveTaskId,
discoverProjectTaskRuntime,
discoverTasks,
findProjectRuntimeTask,
findTaskById,
formatProjectRuntimeDiscoveryErrors,
} from "veryfront/task";
Examples
Define a task in tasks/sync-data.ts
import type { TaskContext } from "veryfront/task";
export default {
name: "Sync external data",
async run(ctx: TaskContext) {
return { synced: 42 };
},
};
Exports
Functions
| Name | Description | Source |
|---|---|---|
deriveTaskId | Derive task ID from file path (e.g., “tasks/sync-data.ts” -> “sync-data”). | source |
discoverProjectTaskRuntime | Discover project tasks and the colocated runtime primitives they may use. | source |
discoverTasks | Discover all tasks in a project with the legacy file-based path. | source |
findProjectRuntimeTask | Find one task by its stable project-runtime ID. | source |
findTaskById | Find a specific task by ID through the legacy file-based path. | source |
formatProjectRuntimeDiscoveryErrors | Format project-runtime discovery failures for CLI and operator diagnostics. | source |
isTaskDefinition | Return true only when the runnable and every declared task metadata field match the public TaskDefinition contract. | source |
listProjectRuntimeTasks | List project-runtime tasks in deterministic ID order. | source |
runTask | Run a task with the given options | source |
Types
| Name | Description | Source |
|---|---|---|
DiscoveredTask | Discovered task info. | source |
ProjectTaskRuntimeDiscovery | Project runtime discovery result used by task lookup and execution helpers. | source |
ProjectTaskRuntimeOptions | Options for discovering tasks through the unified project runtime. | source |
RunnableTask | source | |
RunTaskOptions | Options for running a task | source |
TaskContext | Context passed to task run() function | source |
TaskDefinition | Task definition exported from a tasks/ file | source |
TaskDiscoveryOptions | Options for file-based task discovery. | source |
TaskDiscoveryResult | Result of file-based task discovery. | source |
TaskRunResult | Result of running a task | source |