コンテンツにスキップ

@alneas/task-graph API リファレンス

【未翻訳】Task Graph & Dependency Analysis Types

Common type definitions for DAG analysis, CPM calculation, and graph adapters.

interface TaskNode

【未翻訳】Dependency edge between tasks (predecessor -> successor).

interface TaskEdge

【未翻訳】Bottleneck / blocker analysis result for a task.

interface BlockerAnalysis

【未翻訳】Critical Path Method (CPM) schedule analysis result.

interface CriticalPathResult

【未翻訳】Delay simulation (What-If analysis) impact result.

interface DelayImpact

【未翻訳】Abstract task graph adapter interface.

Defines the contract shared across database adapters (OCI ADB, PostgreSQL, Neo4j) and the in-memory reference implementation.

interface TaskGraphAdapter

【未翻訳】Builds adjacency lists (successors and predecessors) from dependency edges.

export function buildAdjacencyList(edges: TaskEdge[]):
引数 型 必須 説明
edges TaskEdge[] 必須
  • Type: { successors: Map<string, Array<{ targetId: string; lag: number; }>>; predecessors: Map<string, Array<{ targetId: string; lag: number; }>>; }

【未翻訳】Detects whether circular references (cycles) exist in the dependency graph.

export function detectCycles(tasks: TaskNode[], edges: TaskEdge[]): string[][]
引数 型 必須 説明
tasks TaskNode[] 必須
edges TaskEdge[] 必須
  • Type: string[][]
  • Description: An array of detected cycle paths, or an empty array if acyclic.

【未翻訳】Executes topological sort on the task graph using Kahn’s algorithm.

export function topologicalSort(tasks: TaskNode[], edges: TaskEdge[]): string[]
引数 型 必須 説明
tasks TaskNode[] 必須
edges TaskEdge[] 必須
  • Type: string[]

【未翻訳】Schedules tasks and determines the critical path using the Critical Path Method (CPM).

export function calculateCriticalPath(
tasks: TaskNode[],
edges: TaskEdge[],
): CriticalPathResult
引数 型 必須 説明
tasks TaskNode[] 必須
edges TaskEdge[] 必須
  • Type: CriticalPathResult

【未翻訳】Analyzes blockers across tasks (centrality ranking by number of blocked downstream tasks).

export function analyzeBlockers(tasks: TaskNode[], edges: TaskEdge[]): BlockerAnalysis[]
引数 型 必須 説明
tasks TaskNode[] 必須
edges TaskEdge[] 必須
  • Type: BlockerAnalysis[]

【未翻訳】Simulates the project-wide ripple effect of delaying a specific task (What-If analysis).

export function simulateDelayImpact(
tasks: TaskNode[],
edges: TaskEdge[],
sourceTaskId: string,
delayHours: number,
): DelayImpact
引数 型 必須 説明
tasks TaskNode[] 必須
edges TaskEdge[] 必須
sourceTaskId string 必須
delayHours number 必須
  • Type: DelayImpact