Files
xo-cli/src/tui/screens/action-wizard/flows/DataWizardFlow.ts

41 lines
1.1 KiB
TypeScript

import type { FlowContext, StepType } from "../types.js";
import { WizardFlow } from "./WizardFlow.js";
/**
* Flow strategy for data-only actions (e.g. sign, verify).
*
* These actions produce computed data rather than a transaction.
* No invitation, UTXOs, or fees are involved — just variables in,
* data result out.
*
* NOTE: Engine-level data action execution is not yet implemented.
* The result step is currently stubbed.
*/
export class DataWizardFlow extends WizardFlow {
readonly type = "data" as const;
/** The data field identifiers this action produces (from action.data). */
readonly dataOutputs: string[];
constructor(dataOutputs: string[]) {
super();
this.dataOutputs = dataOutputs;
}
getStepTypes(context: FlowContext): StepType[] {
const steps: StepType[] = [];
if (context.availableRoles.length > 1) steps.push("role-select");
if (context.hasVariables) steps.push("variables");
steps.push("result");
return steps;
}
canFinalize(): boolean {
return false;
}
getFinalActionLabel(): string {
return "Done";
}
}