@capgo/cli
Version:
A CLI to upload to capgo servers
25 lines (24 loc) • 909 B
TypeScript
export type StepKind = 'auto' | 'human_gate' | 'choice' | 'info' | 'input' | 'done' | 'error';
export interface StepView {
kind: StepKind;
prompt: string;
options?: {
value: string;
label: string;
note?: string;
}[];
collect?: {
field: string;
desc: string;
secret?: boolean;
}[];
context?: Record<string, unknown>;
}
export interface PlatformFlow<Step extends string, Progress, Input> {
resumeStep: (progress: Progress | null) => Step;
viewForStep: (step: Step, progress: Progress, ctx?: Record<string, unknown>) => StepView;
applyInput: (step: Step, progress: Progress, input: Input) => Progress;
runEffect: (step: Step, progress: Progress, deps: unknown) => Promise<unknown>;
}
/** Runtime guard used by tests + frontends to validate a view-model. */
export declare function isStepView(v: unknown): v is StepView;