yaml-flow 2.4.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,135 @@
1
+ import { G as GraphConfig, c as ExecutionState, T as TaskConfig, l as TaskState } from './types-DAI_a2as.cjs';
2
+
3
+ /**
4
+ * Continuous Event Graph — Types
5
+ *
6
+ * A long-lived, evolving event-graph where both config and state
7
+ * mutate over time. The single `LiveGraph` type bundles them.
8
+ *
9
+ * Events are shared with event-graph (task-started, task-completed, etc.).
10
+ * Graph mutations (addNode, removeNode, etc.) are unique to this mode.
11
+ */
12
+
13
+ /**
14
+ * The single evolving object for a continuous-mode graph.
15
+ * Bundles config + state so they can't get out of sync.
16
+ */
17
+ interface LiveGraph {
18
+ /** The current graph configuration (evolves as nodes are added/removed) */
19
+ config: GraphConfig;
20
+ /** The current execution state (evolves as events arrive) */
21
+ state: ExecutionState;
22
+ }
23
+ interface ScheduleResult {
24
+ /** Tasks ready to dispatch now — all requires satisfied */
25
+ eligible: string[];
26
+ /** Tasks waiting on tokens that some producer will eventually provide (normal) */
27
+ pending: PendingTask[];
28
+ /** Tasks waiting on tokens that NO task can produce (caller's problem) */
29
+ unresolved: UnresolvedDependency[];
30
+ /** Tasks waiting on tokens whose producer FAILED (caller's problem) */
31
+ blocked: BlockedTask[];
32
+ /** Token conflicts: multiple tasks produce the same token */
33
+ conflicts: Record<string, string[]>;
34
+ }
35
+ interface PendingTask {
36
+ taskName: string;
37
+ /** Tokens this task needs that haven't been produced yet but have a viable producer */
38
+ waitingOn: string[];
39
+ }
40
+ interface UnresolvedDependency {
41
+ taskName: string;
42
+ /** Tokens this task needs that no task in the graph can produce */
43
+ missingTokens: string[];
44
+ }
45
+ interface BlockedTask {
46
+ taskName: string;
47
+ /** Tokens this task needs whose only producer has failed */
48
+ failedTokens: string[];
49
+ /** The tasks that failed and would have produced those tokens */
50
+ failedProducers: string[];
51
+ }
52
+ interface LiveGraphHealth {
53
+ /** Total number of tasks in the graph */
54
+ totalNodes: number;
55
+ /** Task counts by status */
56
+ running: number;
57
+ completed: number;
58
+ failed: number;
59
+ waiting: number;
60
+ notStarted: number;
61
+ /** Number of disabled (inactivated) nodes */
62
+ disabled: number;
63
+ /** Number of tasks with unresolvable dependencies */
64
+ unresolvedCount: number;
65
+ /** Number of tasks whose producer has failed */
66
+ blockedCount: number;
67
+ /** Tokens that no task produces (open dependencies) */
68
+ openDependencies: string[];
69
+ /** Cycles detected in the current graph (if any) */
70
+ cycles: string[][];
71
+ /** Tokens produced by multiple tasks */
72
+ conflictTokens: string[];
73
+ }
74
+ interface NodeInfo {
75
+ /** Node name */
76
+ name: string;
77
+ /** The task configuration */
78
+ config: TaskConfig;
79
+ /** The current runtime state */
80
+ state: TaskState;
81
+ }
82
+ interface LiveGraphSnapshot {
83
+ /** Schema version for forward compatibility */
84
+ version: number;
85
+ /** The graph config at snapshot time */
86
+ config: GraphConfig;
87
+ /** The execution state at snapshot time */
88
+ state: ExecutionState;
89
+ /** ISO timestamp of when the snapshot was taken */
90
+ snapshotAt: string;
91
+ }
92
+ interface UnreachableTokensResult {
93
+ tokens: {
94
+ /** The token that cannot be produced */
95
+ token: string;
96
+ /** Why it's unreachable */
97
+ reason: 'no-producer' | 'all-producers-failed' | 'transitive';
98
+ /** Tasks that could produce it (but are themselves unreachable/failed) */
99
+ producers: string[];
100
+ }[];
101
+ }
102
+ interface UnreachableNodesResult {
103
+ nodes: {
104
+ /** The node that can never become eligible */
105
+ nodeName: string;
106
+ /** Unreachable tokens this node requires (empty if the node itself is failed/disabled) */
107
+ missingTokens: string[];
108
+ }[];
109
+ }
110
+ interface UpstreamResult {
111
+ /** The target node being inspected */
112
+ nodeName: string;
113
+ /** All upstream nodes that transitively feed into the target */
114
+ nodes: {
115
+ nodeName: string;
116
+ /** Tokens this node provides that are in the dependency chain */
117
+ providesTokens: string[];
118
+ }[];
119
+ /** All tokens in the upstream dependency chain */
120
+ tokens: string[];
121
+ }
122
+ interface DownstreamResult {
123
+ /** The target node being inspected */
124
+ nodeName: string;
125
+ /** All downstream nodes that transitively depend on the target */
126
+ nodes: {
127
+ nodeName: string;
128
+ /** Tokens this node requires that are in the dependency chain */
129
+ requiresTokens: string[];
130
+ }[];
131
+ /** All tokens in the downstream dependency chain */
132
+ tokens: string[];
133
+ }
134
+
135
+ export type { BlockedTask as B, DownstreamResult as D, LiveGraph as L, NodeInfo as N, PendingTask as P, ScheduleResult as S, UnreachableNodesResult as U, LiveGraphHealth as a, LiveGraphSnapshot as b, UnreachableTokensResult as c, UnresolvedDependency as d, UpstreamResult as e };
@@ -52,6 +52,17 @@ interface TaskConfig {
52
52
  circuit_breaker?: TaskCircuitBreakerConfig;
53
53
  /** Description */
54
54
  description?: string;
55
+ /** LLM inference hints — opt-in metadata for AI-assisted completion detection */
56
+ inference?: {
57
+ /** Human-readable completion criteria */
58
+ criteria?: string;
59
+ /** Keywords to help the LLM understand the domain */
60
+ keywords?: string[];
61
+ /** Suggested checks for verification */
62
+ suggestedChecks?: string[];
63
+ /** Whether the LLM should attempt to auto-detect completion (default: false) */
64
+ autoDetectable?: boolean;
65
+ };
55
66
  }
56
67
  interface TaskRetryConfig {
57
68
  max_attempts: number;
@@ -52,6 +52,17 @@ interface TaskConfig {
52
52
  circuit_breaker?: TaskCircuitBreakerConfig;
53
53
  /** Description */
54
54
  description?: string;
55
+ /** LLM inference hints — opt-in metadata for AI-assisted completion detection */
56
+ inference?: {
57
+ /** Human-readable completion criteria */
58
+ criteria?: string;
59
+ /** Keywords to help the LLM understand the domain */
60
+ keywords?: string[];
61
+ /** Suggested checks for verification */
62
+ suggestedChecks?: string[];
63
+ /** Whether the LLM should attempt to auto-detect completion (default: false) */
64
+ autoDetectable?: boolean;
65
+ };
55
66
  }
56
67
  interface TaskRetryConfig {
57
68
  max_attempts: number;
@@ -0,0 +1,135 @@
1
+ import { G as GraphConfig, c as ExecutionState, T as TaskConfig, l as TaskState } from './types-DAI_a2as.js';
2
+
3
+ /**
4
+ * Continuous Event Graph — Types
5
+ *
6
+ * A long-lived, evolving event-graph where both config and state
7
+ * mutate over time. The single `LiveGraph` type bundles them.
8
+ *
9
+ * Events are shared with event-graph (task-started, task-completed, etc.).
10
+ * Graph mutations (addNode, removeNode, etc.) are unique to this mode.
11
+ */
12
+
13
+ /**
14
+ * The single evolving object for a continuous-mode graph.
15
+ * Bundles config + state so they can't get out of sync.
16
+ */
17
+ interface LiveGraph {
18
+ /** The current graph configuration (evolves as nodes are added/removed) */
19
+ config: GraphConfig;
20
+ /** The current execution state (evolves as events arrive) */
21
+ state: ExecutionState;
22
+ }
23
+ interface ScheduleResult {
24
+ /** Tasks ready to dispatch now — all requires satisfied */
25
+ eligible: string[];
26
+ /** Tasks waiting on tokens that some producer will eventually provide (normal) */
27
+ pending: PendingTask[];
28
+ /** Tasks waiting on tokens that NO task can produce (caller's problem) */
29
+ unresolved: UnresolvedDependency[];
30
+ /** Tasks waiting on tokens whose producer FAILED (caller's problem) */
31
+ blocked: BlockedTask[];
32
+ /** Token conflicts: multiple tasks produce the same token */
33
+ conflicts: Record<string, string[]>;
34
+ }
35
+ interface PendingTask {
36
+ taskName: string;
37
+ /** Tokens this task needs that haven't been produced yet but have a viable producer */
38
+ waitingOn: string[];
39
+ }
40
+ interface UnresolvedDependency {
41
+ taskName: string;
42
+ /** Tokens this task needs that no task in the graph can produce */
43
+ missingTokens: string[];
44
+ }
45
+ interface BlockedTask {
46
+ taskName: string;
47
+ /** Tokens this task needs whose only producer has failed */
48
+ failedTokens: string[];
49
+ /** The tasks that failed and would have produced those tokens */
50
+ failedProducers: string[];
51
+ }
52
+ interface LiveGraphHealth {
53
+ /** Total number of tasks in the graph */
54
+ totalNodes: number;
55
+ /** Task counts by status */
56
+ running: number;
57
+ completed: number;
58
+ failed: number;
59
+ waiting: number;
60
+ notStarted: number;
61
+ /** Number of disabled (inactivated) nodes */
62
+ disabled: number;
63
+ /** Number of tasks with unresolvable dependencies */
64
+ unresolvedCount: number;
65
+ /** Number of tasks whose producer has failed */
66
+ blockedCount: number;
67
+ /** Tokens that no task produces (open dependencies) */
68
+ openDependencies: string[];
69
+ /** Cycles detected in the current graph (if any) */
70
+ cycles: string[][];
71
+ /** Tokens produced by multiple tasks */
72
+ conflictTokens: string[];
73
+ }
74
+ interface NodeInfo {
75
+ /** Node name */
76
+ name: string;
77
+ /** The task configuration */
78
+ config: TaskConfig;
79
+ /** The current runtime state */
80
+ state: TaskState;
81
+ }
82
+ interface LiveGraphSnapshot {
83
+ /** Schema version for forward compatibility */
84
+ version: number;
85
+ /** The graph config at snapshot time */
86
+ config: GraphConfig;
87
+ /** The execution state at snapshot time */
88
+ state: ExecutionState;
89
+ /** ISO timestamp of when the snapshot was taken */
90
+ snapshotAt: string;
91
+ }
92
+ interface UnreachableTokensResult {
93
+ tokens: {
94
+ /** The token that cannot be produced */
95
+ token: string;
96
+ /** Why it's unreachable */
97
+ reason: 'no-producer' | 'all-producers-failed' | 'transitive';
98
+ /** Tasks that could produce it (but are themselves unreachable/failed) */
99
+ producers: string[];
100
+ }[];
101
+ }
102
+ interface UnreachableNodesResult {
103
+ nodes: {
104
+ /** The node that can never become eligible */
105
+ nodeName: string;
106
+ /** Unreachable tokens this node requires (empty if the node itself is failed/disabled) */
107
+ missingTokens: string[];
108
+ }[];
109
+ }
110
+ interface UpstreamResult {
111
+ /** The target node being inspected */
112
+ nodeName: string;
113
+ /** All upstream nodes that transitively feed into the target */
114
+ nodes: {
115
+ nodeName: string;
116
+ /** Tokens this node provides that are in the dependency chain */
117
+ providesTokens: string[];
118
+ }[];
119
+ /** All tokens in the upstream dependency chain */
120
+ tokens: string[];
121
+ }
122
+ interface DownstreamResult {
123
+ /** The target node being inspected */
124
+ nodeName: string;
125
+ /** All downstream nodes that transitively depend on the target */
126
+ nodes: {
127
+ nodeName: string;
128
+ /** Tokens this node requires that are in the dependency chain */
129
+ requiresTokens: string[];
130
+ }[];
131
+ /** All tokens in the downstream dependency chain */
132
+ tokens: string[];
133
+ }
134
+
135
+ export type { BlockedTask as B, DownstreamResult as D, LiveGraph as L, NodeInfo as N, PendingTask as P, ScheduleResult as S, UnreachableNodesResult as U, LiveGraphHealth as a, LiveGraphSnapshot as b, UnreachableTokensResult as c, UnresolvedDependency as d, UpstreamResult as e };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaml-flow",
3
- "version": "2.4.0",
3
+ "version": "2.6.0",
4
4
  "description": "Unified workflow engine: step-machine (sequential) + event-graph (stateless DAG) with pluggable storage",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -58,6 +58,16 @@
58
58
  "types": "./dist/continuous-event-graph/index.d.ts",
59
59
  "import": "./dist/continuous-event-graph/index.js",
60
60
  "require": "./dist/continuous-event-graph/index.cjs"
61
+ },
62
+ "./inference": {
63
+ "types": "./dist/inference/index.d.ts",
64
+ "import": "./dist/inference/index.js",
65
+ "require": "./dist/inference/index.cjs"
66
+ },
67
+ "./card-compute": {
68
+ "types": "./dist/card-compute/index.d.ts",
69
+ "import": "./dist/card-compute/index.js",
70
+ "require": "./dist/card-compute/index.cjs"
61
71
  }
62
72
  },
63
73
  "browser": {
@@ -65,7 +75,8 @@
65
75
  },
66
76
  "files": [
67
77
  "dist",
68
- "schema"
78
+ "schema",
79
+ "browser"
69
80
  ],
70
81
  "scripts": {
71
82
  "build": "tsup",