Skip to content

Commit ca607e8

Browse files
shankar-gpioclaude
andcommitted
Update dataflow-ui to ^2.0.18 and add workflow type-specific tracing
Use validate_with_trace and generate_with_trace methods based on workflow path prefix instead of always calling process_with_trace. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1fe7da2 commit ca607e8

3 files changed

Lines changed: 26 additions & 6 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"typecheck": "tsc --noEmit"
1111
},
1212
"dependencies": {
13-
"@goplasmatic/dataflow-ui": "^2.0.16",
13+
"@goplasmatic/dataflow-ui": "^2.0.18",
1414
"@goplasmatic/reframe-wasm": "^3.1.9",
1515
"react": "^18.3.1",
1616
"react-dom": "^18.3.1"

src/engines/ReframeEngineAdapter.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,30 @@ export class ReframeEngineAdapter implements DataflowEngine {
180180
? payload.payload
181181
: JSON.stringify(payload.payload);
182182

183-
const traceJson = await this.engine.process_with_trace(rawPayload);
183+
// Detect workflow type from the path prefix (e.g., "validate/...", "generate/...")
184+
const workflowType = this.getWorkflowType();
185+
let traceJson: string;
186+
switch (workflowType) {
187+
case 'validate':
188+
traceJson = await this.engine.validate_with_trace(rawPayload);
189+
break;
190+
case 'generate':
191+
traceJson = await this.engine.generate_with_trace(rawPayload);
192+
break;
193+
default:
194+
traceJson = await this.engine.process_with_trace(rawPayload);
195+
break;
196+
}
184197
return JSON.parse(traceJson) as ExecutionTrace;
185198
}
186199

200+
private getWorkflowType(): 'transform' | 'validate' | 'generate' {
201+
const path = this.workflows[0]?.path ?? '';
202+
if (path.startsWith('validate/') || path.startsWith('validate\\')) return 'validate';
203+
if (path.startsWith('generate/') || path.startsWith('generate\\')) return 'generate';
204+
return 'transform';
205+
}
206+
187207
dispose(): void {
188208
if (this.engine) {
189209
this.engine.free();

0 commit comments

Comments
 (0)