@alneas/task-graph API リファレンス
@alneas/task-graph API リファレンス
Section titled “@alneas/task-graph API リファレンス”INTERFACE TaskNode
Section titled “INTERFACE TaskNode”【未翻訳】Task Graph & Dependency Analysis Types
Common type definitions for DAG analysis, CPM calculation, and graph adapters.
interface TaskNodeINTERFACE TaskEdge
Section titled “INTERFACE TaskEdge”【未翻訳】Dependency edge between tasks (predecessor -> successor).
interface TaskEdgeINTERFACE BlockerAnalysis
Section titled “INTERFACE BlockerAnalysis”【未翻訳】Bottleneck / blocker analysis result for a task.
interface BlockerAnalysisINTERFACE CriticalPathResult
Section titled “INTERFACE CriticalPathResult”【未翻訳】Critical Path Method (CPM) schedule analysis result.
interface CriticalPathResultINTERFACE DelayImpact
Section titled “INTERFACE DelayImpact”【未翻訳】Delay simulation (What-If analysis) impact result.
interface DelayImpactINTERFACE TaskGraphAdapter
Section titled “INTERFACE TaskGraphAdapter”【未翻訳】Abstract task graph adapter interface.
Defines the contract shared across database adapters (OCI ADB, PostgreSQL, Neo4j) and the in-memory reference implementation.
interface TaskGraphAdapterFUNCTION buildAdjacencyList
Section titled “FUNCTION buildAdjacencyList”【未翻訳】Builds adjacency lists (successors and predecessors) from dependency edges.
export function buildAdjacencyList(edges: TaskEdge[]):引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
edges |
TaskEdge[] |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
{ successors: Map<string, Array<{ targetId: string; lag: number; }>>; predecessors: Map<string, Array<{ targetId: string; lag: number; }>>; }
FUNCTION detectCycles
Section titled “FUNCTION detectCycles”【未翻訳】Detects whether circular references (cycles) exist in the dependency graph.
export function detectCycles(tasks: TaskNode[], edges: TaskEdge[]): string[][]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
TaskNode[] |
必須 | |
edges |
TaskEdge[] |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[][] - Description: An array of detected cycle paths, or an empty array if acyclic.
FUNCTION topologicalSort
Section titled “FUNCTION topologicalSort”【未翻訳】Executes topological sort on the task graph using Kahn’s algorithm.
export function topologicalSort(tasks: TaskNode[], edges: TaskEdge[]): string[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
TaskNode[] |
必須 | |
edges |
TaskEdge[] |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[]
FUNCTION calculateCriticalPath
Section titled “FUNCTION calculateCriticalPath”【未翻訳】Schedules tasks and determines the critical path using the Critical Path Method (CPM).
export function calculateCriticalPath( tasks: TaskNode[], edges: TaskEdge[],): CriticalPathResult引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
TaskNode[] |
必須 | |
edges |
TaskEdge[] |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
CriticalPathResult
FUNCTION analyzeBlockers
Section titled “FUNCTION analyzeBlockers”【未翻訳】Analyzes blockers across tasks (centrality ranking by number of blocked downstream tasks).
export function analyzeBlockers(tasks: TaskNode[], edges: TaskEdge[]): BlockerAnalysis[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
TaskNode[] |
必須 | |
edges |
TaskEdge[] |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
BlockerAnalysis[]
FUNCTION simulateDelayImpact
Section titled “FUNCTION simulateDelayImpact”【未翻訳】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引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
TaskNode[] |
必須 | |
edges |
TaskEdge[] |
必須 | |
sourceTaskId |
string |
必須 | |
delayHours |
number |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
DelayImpact