awaitly-visualizer 7.0.1 → 8.0.1
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.
- package/README.md +201 -0
- package/dist/devtools.cjs +6 -6
- package/dist/devtools.cjs.map +1 -1
- package/dist/devtools.js +5 -5
- package/dist/devtools.js.map +1 -1
- package/dist/index.browser.cjs +13 -13
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +13 -13
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +1005 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +135 -1
- package/dist/index.d.ts +135 -1
- package/dist/index.js +1005 -33
- package/dist/index.js.map +1 -1
- package/index.js +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -50,6 +50,140 @@ interface ExportContext {
|
|
|
50
50
|
*/
|
|
51
51
|
declare function toExportUrl(diagram: DiagramSource, format: ExportFormat, options: ExportOptions, ctx?: ExportContext): Result<string, ExportUrlError>;
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Interactive Mermaid CDN HTML Generator
|
|
55
|
+
*
|
|
56
|
+
* Generates a self-contained HTML file that uses Mermaid CDN to render
|
|
57
|
+
* workflow diagrams with click-to-inspect interactivity, 6 themes,
|
|
58
|
+
* and a theme picker.
|
|
59
|
+
*
|
|
60
|
+
* Moved from awaitly-analyze so the template is reusable across packages.
|
|
61
|
+
*
|
|
62
|
+
* Pipeline:
|
|
63
|
+
* mermaidText + WorkflowMetadata → generateInteractiveHTML() → .html file
|
|
64
|
+
*/
|
|
65
|
+
/** Source location for a node in the analyzed source. */
|
|
66
|
+
interface MermaidHTMLSourceLocation {
|
|
67
|
+
filePath: string;
|
|
68
|
+
line: number;
|
|
69
|
+
column: number;
|
|
70
|
+
}
|
|
71
|
+
/** Retry configuration for display in the inspector panel. */
|
|
72
|
+
interface MermaidHTMLRetryConfig {
|
|
73
|
+
attempts?: number | string;
|
|
74
|
+
backoff?: string;
|
|
75
|
+
baseDelay?: number | string;
|
|
76
|
+
retryOn?: string;
|
|
77
|
+
}
|
|
78
|
+
/** Timeout configuration for display in the inspector panel. */
|
|
79
|
+
interface MermaidHTMLTimeoutConfig {
|
|
80
|
+
ms?: number | string;
|
|
81
|
+
}
|
|
82
|
+
interface NodeMetadata {
|
|
83
|
+
/** Mermaid node ID (matches the ID in the rendered diagram) */
|
|
84
|
+
mermaidId: string;
|
|
85
|
+
/** Node type from the IR */
|
|
86
|
+
type: string;
|
|
87
|
+
/** Human-readable name */
|
|
88
|
+
name: string;
|
|
89
|
+
/** Step ID (for step nodes) */
|
|
90
|
+
stepId?: string;
|
|
91
|
+
/** Function callee */
|
|
92
|
+
callee?: string;
|
|
93
|
+
/** Description */
|
|
94
|
+
description?: string;
|
|
95
|
+
/** Source location */
|
|
96
|
+
location?: MermaidHTMLSourceLocation;
|
|
97
|
+
/** Retry configuration */
|
|
98
|
+
retry?: MermaidHTMLRetryConfig;
|
|
99
|
+
/** Timeout configuration */
|
|
100
|
+
timeout?: MermaidHTMLTimeoutConfig;
|
|
101
|
+
/** Condition expression (for decisions/conditionals) */
|
|
102
|
+
condition?: string;
|
|
103
|
+
/** Helper used (when/unless) */
|
|
104
|
+
helper?: string;
|
|
105
|
+
/** Error tags */
|
|
106
|
+
errors?: string[];
|
|
107
|
+
/** Input type */
|
|
108
|
+
inputType?: string;
|
|
109
|
+
/** Output type */
|
|
110
|
+
outputType?: string;
|
|
111
|
+
/** Output key */
|
|
112
|
+
out?: string;
|
|
113
|
+
/** Keys this step reads */
|
|
114
|
+
reads?: string[];
|
|
115
|
+
/** Parallel mode */
|
|
116
|
+
mode?: string;
|
|
117
|
+
/** Children count */
|
|
118
|
+
childCount?: number;
|
|
119
|
+
/** Loop type */
|
|
120
|
+
loopType?: string;
|
|
121
|
+
/** Iteration source */
|
|
122
|
+
iterSource?: string;
|
|
123
|
+
/** Bound count for loops */
|
|
124
|
+
boundCount?: number;
|
|
125
|
+
/** Stream type */
|
|
126
|
+
streamType?: string;
|
|
127
|
+
/** Stream namespace */
|
|
128
|
+
namespace?: string;
|
|
129
|
+
/** Referenced workflow name */
|
|
130
|
+
workflowName?: string;
|
|
131
|
+
/** Whether reference is resolved */
|
|
132
|
+
resolved?: boolean;
|
|
133
|
+
/** Has compensation (saga steps) */
|
|
134
|
+
hasCompensation?: boolean;
|
|
135
|
+
/** Compensation callee */
|
|
136
|
+
compensationCallee?: string;
|
|
137
|
+
/** Switch expression */
|
|
138
|
+
expression?: string;
|
|
139
|
+
/** Switch cases */
|
|
140
|
+
cases?: Array<{
|
|
141
|
+
value?: string;
|
|
142
|
+
isDefault: boolean;
|
|
143
|
+
}>;
|
|
144
|
+
/** Connected incoming edges */
|
|
145
|
+
incomingFrom?: string[];
|
|
146
|
+
/** Connected outgoing edges */
|
|
147
|
+
outgoingTo?: string[];
|
|
148
|
+
}
|
|
149
|
+
interface WorkflowMetadata {
|
|
150
|
+
/** Workflow name */
|
|
151
|
+
workflowName: string;
|
|
152
|
+
/** Workflow description */
|
|
153
|
+
description?: string;
|
|
154
|
+
/** Source file */
|
|
155
|
+
filePath: string;
|
|
156
|
+
/** Analysis stats */
|
|
157
|
+
stats: {
|
|
158
|
+
totalSteps: number;
|
|
159
|
+
conditionalCount: number;
|
|
160
|
+
parallelCount: number;
|
|
161
|
+
raceCount: number;
|
|
162
|
+
loopCount: number;
|
|
163
|
+
};
|
|
164
|
+
/** Node metadata keyed by Mermaid node ID */
|
|
165
|
+
nodes: Record<string, NodeMetadata>;
|
|
166
|
+
}
|
|
167
|
+
interface InteractiveHTMLOptions {
|
|
168
|
+
/** Page title (defaults to workflow name) */
|
|
169
|
+
title?: string;
|
|
170
|
+
/** Initial theme name (defaults to system preference auto-detection) */
|
|
171
|
+
theme?: string;
|
|
172
|
+
/** Mermaid CDN URL (defaults to latest) */
|
|
173
|
+
mermaidCdnUrl?: string;
|
|
174
|
+
/** Diagram direction for display */
|
|
175
|
+
direction?: "TB" | "LR" | "BT" | "RL";
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Generate a self-contained interactive HTML file.
|
|
179
|
+
*
|
|
180
|
+
* @param mermaidText - Mermaid flowchart text from renderStaticMermaid()
|
|
181
|
+
* @param metadata - Workflow metadata from extractNodeMetadata()
|
|
182
|
+
* @param options - HTML generation options
|
|
183
|
+
*/
|
|
184
|
+
declare function generateInteractiveHTML(mermaidText: string, metadata: WorkflowMetadata, options?: InteractiveHTMLOptions): string;
|
|
185
|
+
declare function escapeHtml(str: string): string;
|
|
186
|
+
|
|
53
187
|
/**
|
|
54
188
|
* Workflow Visualization Module
|
|
55
189
|
*
|
|
@@ -239,4 +373,4 @@ declare function createEventCollector(options?: VisualizerOptions): {
|
|
|
239
373
|
visualizeAs: (format: OutputFormat) => string;
|
|
240
374
|
};
|
|
241
375
|
|
|
242
|
-
export { type CollectableEvent, DecisionBranchEvent, DecisionEndEvent, DecisionStartEvent, DiagramSource, ExportFormat, ExportOptions, OutputFormat, ScopeEndEvent, ScopeStartEvent, VisualizerOptions, WorkflowIR, type WorkflowVisualizer, combineEventHandlers, createEventCollector, createVisualizer, toExportUrl, visualizeEvents };
|
|
376
|
+
export { type CollectableEvent, DecisionBranchEvent, DecisionEndEvent, DecisionStartEvent, DiagramSource, ExportFormat, ExportOptions, type InteractiveHTMLOptions, type MermaidHTMLRetryConfig, type MermaidHTMLSourceLocation, type MermaidHTMLTimeoutConfig, type NodeMetadata, OutputFormat, ScopeEndEvent, ScopeStartEvent, VisualizerOptions, WorkflowIR, type WorkflowMetadata, type WorkflowVisualizer, combineEventHandlers, createEventCollector, createVisualizer, escapeHtml, generateInteractiveHTML, toExportUrl, visualizeEvents };
|
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,140 @@ interface ExportContext {
|
|
|
50
50
|
*/
|
|
51
51
|
declare function toExportUrl(diagram: DiagramSource, format: ExportFormat, options: ExportOptions, ctx?: ExportContext): Result<string, ExportUrlError>;
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Interactive Mermaid CDN HTML Generator
|
|
55
|
+
*
|
|
56
|
+
* Generates a self-contained HTML file that uses Mermaid CDN to render
|
|
57
|
+
* workflow diagrams with click-to-inspect interactivity, 6 themes,
|
|
58
|
+
* and a theme picker.
|
|
59
|
+
*
|
|
60
|
+
* Moved from awaitly-analyze so the template is reusable across packages.
|
|
61
|
+
*
|
|
62
|
+
* Pipeline:
|
|
63
|
+
* mermaidText + WorkflowMetadata → generateInteractiveHTML() → .html file
|
|
64
|
+
*/
|
|
65
|
+
/** Source location for a node in the analyzed source. */
|
|
66
|
+
interface MermaidHTMLSourceLocation {
|
|
67
|
+
filePath: string;
|
|
68
|
+
line: number;
|
|
69
|
+
column: number;
|
|
70
|
+
}
|
|
71
|
+
/** Retry configuration for display in the inspector panel. */
|
|
72
|
+
interface MermaidHTMLRetryConfig {
|
|
73
|
+
attempts?: number | string;
|
|
74
|
+
backoff?: string;
|
|
75
|
+
baseDelay?: number | string;
|
|
76
|
+
retryOn?: string;
|
|
77
|
+
}
|
|
78
|
+
/** Timeout configuration for display in the inspector panel. */
|
|
79
|
+
interface MermaidHTMLTimeoutConfig {
|
|
80
|
+
ms?: number | string;
|
|
81
|
+
}
|
|
82
|
+
interface NodeMetadata {
|
|
83
|
+
/** Mermaid node ID (matches the ID in the rendered diagram) */
|
|
84
|
+
mermaidId: string;
|
|
85
|
+
/** Node type from the IR */
|
|
86
|
+
type: string;
|
|
87
|
+
/** Human-readable name */
|
|
88
|
+
name: string;
|
|
89
|
+
/** Step ID (for step nodes) */
|
|
90
|
+
stepId?: string;
|
|
91
|
+
/** Function callee */
|
|
92
|
+
callee?: string;
|
|
93
|
+
/** Description */
|
|
94
|
+
description?: string;
|
|
95
|
+
/** Source location */
|
|
96
|
+
location?: MermaidHTMLSourceLocation;
|
|
97
|
+
/** Retry configuration */
|
|
98
|
+
retry?: MermaidHTMLRetryConfig;
|
|
99
|
+
/** Timeout configuration */
|
|
100
|
+
timeout?: MermaidHTMLTimeoutConfig;
|
|
101
|
+
/** Condition expression (for decisions/conditionals) */
|
|
102
|
+
condition?: string;
|
|
103
|
+
/** Helper used (when/unless) */
|
|
104
|
+
helper?: string;
|
|
105
|
+
/** Error tags */
|
|
106
|
+
errors?: string[];
|
|
107
|
+
/** Input type */
|
|
108
|
+
inputType?: string;
|
|
109
|
+
/** Output type */
|
|
110
|
+
outputType?: string;
|
|
111
|
+
/** Output key */
|
|
112
|
+
out?: string;
|
|
113
|
+
/** Keys this step reads */
|
|
114
|
+
reads?: string[];
|
|
115
|
+
/** Parallel mode */
|
|
116
|
+
mode?: string;
|
|
117
|
+
/** Children count */
|
|
118
|
+
childCount?: number;
|
|
119
|
+
/** Loop type */
|
|
120
|
+
loopType?: string;
|
|
121
|
+
/** Iteration source */
|
|
122
|
+
iterSource?: string;
|
|
123
|
+
/** Bound count for loops */
|
|
124
|
+
boundCount?: number;
|
|
125
|
+
/** Stream type */
|
|
126
|
+
streamType?: string;
|
|
127
|
+
/** Stream namespace */
|
|
128
|
+
namespace?: string;
|
|
129
|
+
/** Referenced workflow name */
|
|
130
|
+
workflowName?: string;
|
|
131
|
+
/** Whether reference is resolved */
|
|
132
|
+
resolved?: boolean;
|
|
133
|
+
/** Has compensation (saga steps) */
|
|
134
|
+
hasCompensation?: boolean;
|
|
135
|
+
/** Compensation callee */
|
|
136
|
+
compensationCallee?: string;
|
|
137
|
+
/** Switch expression */
|
|
138
|
+
expression?: string;
|
|
139
|
+
/** Switch cases */
|
|
140
|
+
cases?: Array<{
|
|
141
|
+
value?: string;
|
|
142
|
+
isDefault: boolean;
|
|
143
|
+
}>;
|
|
144
|
+
/** Connected incoming edges */
|
|
145
|
+
incomingFrom?: string[];
|
|
146
|
+
/** Connected outgoing edges */
|
|
147
|
+
outgoingTo?: string[];
|
|
148
|
+
}
|
|
149
|
+
interface WorkflowMetadata {
|
|
150
|
+
/** Workflow name */
|
|
151
|
+
workflowName: string;
|
|
152
|
+
/** Workflow description */
|
|
153
|
+
description?: string;
|
|
154
|
+
/** Source file */
|
|
155
|
+
filePath: string;
|
|
156
|
+
/** Analysis stats */
|
|
157
|
+
stats: {
|
|
158
|
+
totalSteps: number;
|
|
159
|
+
conditionalCount: number;
|
|
160
|
+
parallelCount: number;
|
|
161
|
+
raceCount: number;
|
|
162
|
+
loopCount: number;
|
|
163
|
+
};
|
|
164
|
+
/** Node metadata keyed by Mermaid node ID */
|
|
165
|
+
nodes: Record<string, NodeMetadata>;
|
|
166
|
+
}
|
|
167
|
+
interface InteractiveHTMLOptions {
|
|
168
|
+
/** Page title (defaults to workflow name) */
|
|
169
|
+
title?: string;
|
|
170
|
+
/** Initial theme name (defaults to system preference auto-detection) */
|
|
171
|
+
theme?: string;
|
|
172
|
+
/** Mermaid CDN URL (defaults to latest) */
|
|
173
|
+
mermaidCdnUrl?: string;
|
|
174
|
+
/** Diagram direction for display */
|
|
175
|
+
direction?: "TB" | "LR" | "BT" | "RL";
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Generate a self-contained interactive HTML file.
|
|
179
|
+
*
|
|
180
|
+
* @param mermaidText - Mermaid flowchart text from renderStaticMermaid()
|
|
181
|
+
* @param metadata - Workflow metadata from extractNodeMetadata()
|
|
182
|
+
* @param options - HTML generation options
|
|
183
|
+
*/
|
|
184
|
+
declare function generateInteractiveHTML(mermaidText: string, metadata: WorkflowMetadata, options?: InteractiveHTMLOptions): string;
|
|
185
|
+
declare function escapeHtml(str: string): string;
|
|
186
|
+
|
|
53
187
|
/**
|
|
54
188
|
* Workflow Visualization Module
|
|
55
189
|
*
|
|
@@ -239,4 +373,4 @@ declare function createEventCollector(options?: VisualizerOptions): {
|
|
|
239
373
|
visualizeAs: (format: OutputFormat) => string;
|
|
240
374
|
};
|
|
241
375
|
|
|
242
|
-
export { type CollectableEvent, DecisionBranchEvent, DecisionEndEvent, DecisionStartEvent, DiagramSource, ExportFormat, ExportOptions, OutputFormat, ScopeEndEvent, ScopeStartEvent, VisualizerOptions, WorkflowIR, type WorkflowVisualizer, combineEventHandlers, createEventCollector, createVisualizer, toExportUrl, visualizeEvents };
|
|
376
|
+
export { type CollectableEvent, DecisionBranchEvent, DecisionEndEvent, DecisionStartEvent, DiagramSource, ExportFormat, ExportOptions, type InteractiveHTMLOptions, type MermaidHTMLRetryConfig, type MermaidHTMLSourceLocation, type MermaidHTMLTimeoutConfig, type NodeMetadata, OutputFormat, ScopeEndEvent, ScopeStartEvent, VisualizerOptions, WorkflowIR, type WorkflowMetadata, type WorkflowVisualizer, combineEventHandlers, createEventCollector, createVisualizer, escapeHtml, generateInteractiveHTML, toExportUrl, visualizeEvents };
|