Skip to content

dag-core / Exports

dag-core

Table of contents

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

TPortPrimitive

Ƭ TPortPrimitive: string | number | boolean | null

Primitive value types that can flow through node ports.

Defined in

interfaces/ports.ts:13


TPortBinaryKind

Ƭ TPortBinaryKind: "image" | "video" | "audio" | "file"

Kind of binary content carried in a port payload.

Defined in

interfaces/ports.ts:15


TBinaryReferenceType

Ƭ TBinaryReferenceType: "asset" | "uri"

Resolution strategy for binary references.

Defined in

interfaces/ports.ts:17


TPortObjectValue

Ƭ TPortObjectValue: Record<string, TPortPrimitive>

A flat key-value object within a port payload.

Defined in

interfaces/ports.ts:30


TPortArrayValue

Ƭ TPortArrayValue: TPortValue[]

An ordered list of port values.

Defined in

interfaces/ports.ts:32


TPortValue

Ƭ TPortValue: TPortPrimitive | IPortBinaryValue | TPortArrayValue | TPortObjectValue

Any value that can appear in a single port slot.

Defined in

interfaces/ports.ts:35


TPortPayload

Ƭ TPortPayload: Record<string, TPortValue>

Keyed collection of port values — the data flowing between DAG nodes.

Defined in

interfaces/ports.ts:42


TTaskExecutionResult

Ƭ TTaskExecutionResult: ITaskExecutionSuccess | ITaskExecutionFailure

Discriminated union of task execution outcomes.

Defined in

interfaces/ports.ts:140


TDagRunTransitionEvent

Ƭ TDagRunTransitionEvent: "QUEUE" | "START" | "COMPLETE_SUCCESS" | "COMPLETE_FAILURE" | "CANCEL"

Events that can trigger a DAG run state transition.

Defined in

state-machines/dag-run-state-machine.ts:7


TTaskRunTransitionEvent

Ƭ TTaskRunTransitionEvent: "QUEUE" | "START" | "COMPLETE_SUCCESS" | "COMPLETE_FAILURE" | "UPSTREAM_FAIL" | "SKIP" | "RETRY" | "CANCEL"

Events that can trigger a task run state transition.

Defined in

state-machines/task-run-state-machine.ts:7


TDagDefinitionStatus

Ƭ TDagDefinitionStatus: "draft" | "published" | "deprecated"

Publication state of a DAG definition.

Defined in

types/domain.ts:2


TPortValueType

Ƭ TPortValueType: "string" | "number" | "boolean" | "object" | "array" | "binary"

Supported value types for node port definitions.

Defined in

types/domain.ts:4


TBinaryKind

Ƭ TBinaryKind: "image" | "video" | "audio" | "file"

Kind of binary data a port can accept or produce.

Defined in

types/domain.ts:6


TNodeConfigPrimitive

Ƭ TNodeConfigPrimitive: string | number | boolean | null

Primitive values allowed in node configuration.

Defined in

types/domain.ts:8


TNodeConfigValue

Ƭ TNodeConfigValue: TNodeConfigPrimitive | INodeConfigObject | TNodeConfigValue[]

Any value that can appear inside a node's config.

Defined in

types/domain.ts:14


TNodeConfigRecord

Ƭ TNodeConfigRecord: INodeConfigObject

Top-level node configuration record. Alias for INodeConfigObject.

Defined in

types/domain.ts:16


TAssetReferenceType

Ƭ TAssetReferenceType: "asset" | "uri"

Discriminant for asset reference resolution strategy.

Defined in

types/domain.ts:19


TAssetReference

Ƭ TAssetReference: IAssetReferenceByAssetId | IAssetReferenceByUri

Discriminated union of asset references — either by asset ID or by URI.

Defined in

types/domain.ts:44


TDagRunStatus

Ƭ TDagRunStatus: "created" | "queued" | "running" | "success" | "failed" | "cancelled"

Lifecycle status of a DAG run. Terminal states: success, failed, cancelled.

Defined in

types/domain.ts:47


TTaskRunStatus

Ƭ TTaskRunStatus: "created" | "queued" | "running" | "success" | "failed" | "upstream_failed" | "skipped" | "cancelled"

Lifecycle status of a task run. Terminal states: success, failed, upstream_failed, skipped, cancelled.

Defined in

types/domain.ts:56


TDagTriggerType

Ƭ TDagTriggerType: "manual" | "scheduled" | "api"

How a DAG run was initiated.

Defined in

types/domain.ts:67


TErrorCategory

Ƭ TErrorCategory: "validation" | "state_transition" | "lease" | "dispatch" | "task_execution"

Classification of DAG errors by their origin and nature.

Defined in

types/error.ts:2


Ƭ TPromptLink: [string, number]

Link reference: [sourceNodeId, outputSlotIndex]

Defined in

types/prompt-types.ts:7


TPromptInputValue

Ƭ TPromptInputValue: string | number | boolean | TPromptLink

A single input value: scalar or link

Defined in

types/prompt-types.ts:10


TPrompt

Ƭ TPrompt: Record<string, IPromptNodeDef>

OpenAPI: Prompt schema — nodeId → node definition

Defined in

types/prompt-types.ts:20


THistory

Ƭ THistory: Record<string, IHistoryEntry>

Defined in

types/prompt-types.ts:88


TInputTypeSpec

Ƭ TInputTypeSpec: [string] | [string, Record<string, unknown>]

Defined in

types/prompt-types.ts:92


TObjectInfo

Ƭ TObjectInfo: Record<string, INodeObjectInfo>

Defined in

types/prompt-types.ts:112


TResult

Ƭ TResult<TValue, TError>: { ok: true ; value: TValue } | { ok: false ; error: TError }

Discriminated union representing either a successful value or an error.

Type parameters

Name
TValue
TError

Defined in

types/result.ts:2


TRunProgressEventType

Ƭ TRunProgressEventType: "execution.started" | "execution.completed" | "execution.failed" | "task.started" | "task.completed" | "task.failed"

Discriminant for run progress event types covering execution and task phases.

Defined in

types/run-progress.ts:5


TRunProgressEvent

Ƭ TRunProgressEvent: IExecutionStartedProgressEvent | IExecutionCompletedProgressEvent | IExecutionFailedProgressEvent | ITaskStartedProgressEvent | ITaskCompletedProgressEvent | ITaskFailedProgressEvent

Union of all run progress event types.

Defined in

types/run-progress.ts:67

Variables

RUN_EVENT_PREFIX

Const RUN_EVENT_PREFIX: "run"

Event name prefix for DAG run lifecycle events.

Defined in

constants/events.ts:2


TASK_EVENT_PREFIX

Const TASK_EVENT_PREFIX: "task"

Event name prefix for task lifecycle events.

Defined in

constants/events.ts:4


WORKER_EVENT_PREFIX

Const WORKER_EVENT_PREFIX: "worker"

Event name prefix for worker lifecycle events.

Defined in

constants/events.ts:6


SCHEDULER_EVENT_PREFIX

Const SCHEDULER_EVENT_PREFIX: "scheduler"

Event name prefix for scheduler lifecycle events.

Defined in

constants/events.ts:8


EXECUTION_EVENT_PREFIX

Const EXECUTION_EVENT_PREFIX: "execution"

Event name prefix for execution progress events.

Defined in

constants/events.ts:10


RUN_EVENTS

Const RUN_EVENTS: Object

DAG run lifecycle event names.

Type declaration

NameType
CREATED"created"
QUEUED"queued"
RUNNING"running"
SUCCESS"success"
FAILED"failed"
CANCELLED"cancelled"

Defined in

constants/events.ts:13


TASK_EVENTS

Const TASK_EVENTS: Object

Task lifecycle event names.

Type declaration

NameType
CREATED"created"
QUEUED"queued"
RUNNING"running"
SUCCESS"success"
FAILED"failed"
UPSTREAM_FAILED"upstream_failed"
SKIPPED"skipped"
CANCELLED"cancelled"

Defined in

constants/events.ts:23


WORKER_EVENTS

Const WORKER_EVENTS: Object

Worker lifecycle event names.

Type declaration

NameType
LEASE_ACQUIRED"lease_acquired"
HEARTBEAT"heartbeat"
LEASE_EXPIRED"lease_expired"
EXECUTION_COMPLETE"execution_complete"

Defined in

constants/events.ts:35


SCHEDULER_EVENTS

Const SCHEDULER_EVENTS: Object

Scheduler lifecycle event names.

Type declaration

NameType
EVALUATED"evaluated"
TRIGGERED"triggered"
SKIPPED"skipped"

Defined in

constants/events.ts:43


EXECUTION_PROGRESS_EVENTS

Const EXECUTION_PROGRESS_EVENTS: Object

Execution-level progress event names.

Type declaration

NameType
STARTED"execution.started"
COMPLETED"execution.completed"
FAILED"execution.failed"

Defined in

constants/events.ts:50


TASK_PROGRESS_EVENTS

Const TASK_PROGRESS_EVENTS: Object

Task-level progress event names.

Type declaration

NameType
STARTED"task.started"
COMPLETED"task.completed"
FAILED"task.failed"

Defined in

constants/events.ts:57


DAG_DEFINITION_STATUS

Const DAG_DEFINITION_STATUS: Object

Constant enum for DAG definition publication statuses.

Type declaration

NameType
DRAFT"draft"
PUBLISHED"published"
DEPRECATED"deprecated"

Defined in

constants/status.ts:2


DAG_RUN_STATUS

Const DAG_RUN_STATUS: Object

Constant enum for DAG run lifecycle statuses.

Type declaration

NameType
CREATED"created"
QUEUED"queued"
RUNNING"running"
SUCCESS"success"
FAILED"failed"
CANCELLED"cancelled"

Defined in

constants/status.ts:9


TASK_RUN_STATUS

Const TASK_RUN_STATUS: Object

Constant enum for task run lifecycle statuses.

Type declaration

NameType
CREATED"created"
QUEUED"queued"
RUNNING"running"
SUCCESS"success"
FAILED"failed"
UPSTREAM_FAILED"upstream_failed"
SKIPPED"skipped"
CANCELLED"cancelled"

Defined in

constants/status.ts:19


DAG_CORE_PACKAGE_NAME

Const DAG_CORE_PACKAGE_NAME: "@robota-sdk/dag-core"

Defined in

index.ts:39

Functions

validateEdgesAndBindings

validateEdgesAndBindings(definition, nodeIdSet, nodeById): IDagError[]

Validates edges, bindings, cross-edge input key conflicts, and cycle detection for a DAG definition.

Parameters

NameType
definitionIDagDefinition
nodeIdSetSet<string>
nodeByIdMap<string, IDagNode>

Returns

IDagError[]

Defined in

services/definition-edge-validator.ts:76


buildListPortHandleKey

buildListPortHandleKey(portKey, index): string

Build a handle key for an indexed list port element, e.g. "images[0]".

Parameters

NameType
portKeystring
indexnumber

Returns

string

Defined in

types/domain.ts:126


parseListPortHandleKey

parseListPortHandleKey(handleKey): { portKey: string ; index: number } | undefined

Parse a list port handle key back into its port key and index. Returns undefined if the key is not a valid list handle.

Parameters

NameType
handleKeystring

Returns

{ portKey: string ; index: number } | undefined

Defined in

types/domain.ts:131


isPromptLink(value): value is TPromptLink

Parameters

NameType
valueTPromptInputValue

Returns

value is TPromptLink

Defined in

types/prompt-types.ts:132


buildDagError

buildDagError(category, code, message, retryable, context?): IDagError

Create a structured IDagError with all required fields.

Parameters

NameType
categoryTErrorCategory
codestring
messagestring
retryableboolean
context?Record<string, string | number | boolean>

Returns

IDagError

Defined in

utils/error-builders.ts:4


buildValidationError

buildValidationError(code, message, context?): IDagError

Shorthand for creating a non-retryable validation error.

Parameters

NameType
codestring
messagestring
context?Record<string, string | number | boolean>

Returns

IDagError

Defined in

utils/error-builders.ts:21


buildDispatchError

buildDispatchError(code, message, context?): IDagError

Shorthand for creating a retryable dispatch error.

Parameters

NameType
codestring
messagestring
context?Record<string, string | number | boolean>

Returns

IDagError

Defined in

utils/error-builders.ts:30


buildLeaseError

buildLeaseError(code, message, context?): IDagError

Shorthand for creating a non-retryable lease error.

Parameters

NameType
codestring
messagestring
context?Record<string, string | number | boolean>

Returns

IDagError

Defined in

utils/error-builders.ts:39


buildTaskExecutionError

buildTaskExecutionError(code, message, retryable, context?): IDagError

Shorthand for creating a task execution error with configurable retryability.

Parameters

NameType
codestring
messagestring
retryableboolean
context?Record<string, string | number | boolean>

Returns

IDagError

Defined in

utils/error-builders.ts:48

Released under the MIT License.