veryfront/task

Import

TypeScript
import {  discoverProjectTaskRuntime,  findProjectRuntimeTask,  formatProjectRuntimeDiscoveryErrors,  isTaskDefinition,  listProjectRuntimeTasks,  runTask,} from "veryfront/task";

Examples

Define a task in tasks/sync-data.ts

TypeScript
import type { TaskContext } from "veryfront/task"; export default {  name: "Sync external data",  async run(ctx: TaskContext) {    return { synced: 42 };  },};

Exports

Functions

NameDescriptionSource
deriveTaskIdDerive task ID from file path (e.g., "tasks/sync-data.ts" -> "sync-data").source
discoverProjectTaskRuntimeDiscover project tasks and the colocated runtime primitives they may use.source
discoverTasksDiscover all tasks in a project with the legacy file-based path.source
findProjectRuntimeTaskFind one task by its stable project-runtime ID.source
findTaskByIdFind a specific task by ID through the legacy file-based path.source
formatProjectRuntimeDiscoveryErrorsFormat project-runtime discovery failures for CLI and operator diagnostics.source
isTaskDefinitionReturn true only when the runnable and every declared task metadata field match the public TaskDefinition contract.source
listProjectRuntimeTasksList project-runtime tasks in deterministic ID order.source
runTaskRun a task with the given optionssource

Classes

NameDescriptionSource
RetryableErrorThrow from a task to ask the platform to run it again.source

Types

NameDescriptionSource
DiscoveredTaskDiscovered task info.source
ProjectTaskRuntimeDiscoveryProject runtime discovery result used by task lookup and execution helpers.source
ProjectTaskRuntimeOptionsOptions for discovering tasks through the unified project runtime.source
RunnableTasksource
RunTaskOptionsOptions for running a tasksource
TaskChildRequestA durable child invocation under the current project Task.source
TaskContextContext passed to a task run function.source
TaskDefinitionTask definition exported from a tasks/ filesource
TaskDiscoveryOptionsOptions for file-based task discovery.source
TaskDiscoveryResultResult of file-based task discovery.source
TaskRunResultResult of running a tasksource