@unlaxer/tramli 1.10.0 → 1.11.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.
@@ -11,6 +11,7 @@ export declare class FlowDefinition<S extends string> {
11
11
  readonly initialState: S | null;
12
12
  readonly terminalStates: Set<S>;
13
13
  readonly dataFlowGraph: DataFlowGraph<S> | null;
14
+ readonly warnings: string[];
14
15
  private constructor();
15
16
  transitionsFrom(state: S): Transition<S>[];
16
17
  externalFrom(state: S): Transition<S> | undefined;
@@ -13,6 +13,7 @@ class FlowDefinition {
13
13
  initialState;
14
14
  terminalStates;
15
15
  dataFlowGraph;
16
+ warnings;
16
17
  constructor(name, stateConfig, ttl, maxGuardRetries, transitions, errorTransitions) {
17
18
  this.name = name;
18
19
  this.stateConfig = stateConfig;
@@ -143,6 +144,14 @@ class Builder {
143
144
  result.dataFlowGraph = null;
144
145
  this.validate(result);
145
146
  result.dataFlowGraph = data_flow_graph_js_1.DataFlowGraph.build(result, this.initiallyAvailableKeys);
147
+ // Build warnings
148
+ const warnings = [];
149
+ const perpetual = terminals.size === 0;
150
+ const hasExternal = this.transitions.some(t => t.type === 'external');
151
+ if (perpetual && hasExternal) {
152
+ warnings.push(`Perpetual flow '${this.name}' has External transitions — ensure events are always delivered to avoid deadlock (liveness risk)`);
153
+ }
154
+ result.warnings = warnings;
146
155
  return result;
147
156
  }
148
157
  validate(def) {
@@ -11,6 +11,7 @@ export declare class FlowDefinition<S extends string> {
11
11
  readonly initialState: S | null;
12
12
  readonly terminalStates: Set<S>;
13
13
  readonly dataFlowGraph: DataFlowGraph<S> | null;
14
+ readonly warnings: string[];
14
15
  private constructor();
15
16
  transitionsFrom(state: S): Transition<S>[];
16
17
  externalFrom(state: S): Transition<S> | undefined;
@@ -10,6 +10,7 @@ export class FlowDefinition {
10
10
  initialState;
11
11
  terminalStates;
12
12
  dataFlowGraph;
13
+ warnings;
13
14
  constructor(name, stateConfig, ttl, maxGuardRetries, transitions, errorTransitions) {
14
15
  this.name = name;
15
16
  this.stateConfig = stateConfig;
@@ -139,6 +140,14 @@ export class Builder {
139
140
  result.dataFlowGraph = null;
140
141
  this.validate(result);
141
142
  result.dataFlowGraph = DataFlowGraph.build(result, this.initiallyAvailableKeys);
143
+ // Build warnings
144
+ const warnings = [];
145
+ const perpetual = terminals.size === 0;
146
+ const hasExternal = this.transitions.some(t => t.type === 'external');
147
+ if (perpetual && hasExternal) {
148
+ warnings.push(`Perpetual flow '${this.name}' has External transitions — ensure events are always delivered to avoid deadlock (liveness risk)`);
149
+ }
150
+ result.warnings = warnings;
142
151
  return result;
143
152
  }
144
153
  validate(def) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unlaxer/tramli",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "description": "Constrained flow engine — state machines that prevent invalid transitions at build time",
5
5
  "type": "module",
6
6
  "exports": {