1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
use clap::{Args, Subcommand};
#[derive(Debug, Args)]
pub(crate) struct WorkflowArgs {
#[command(subcommand)]
pub command: WorkflowCommand,
}
#[derive(Debug, Subcommand)]
pub(crate) enum WorkflowCommand {
/// Validate a portable workflow bundle contract.
Validate(WorkflowValidateArgs),
/// Preview the normalized graph, triggers, policies, and requirements.
Preview(WorkflowPreviewArgs),
/// Materialize a deterministic local run receipt for a bundle.
Run(WorkflowRunArgs),
}
#[derive(Debug, Args)]
pub(crate) struct WorkflowValidateArgs {
/// Portable workflow bundle JSON path.
#[arg(long)]
pub bundle: String,
/// Emit JSON.
#[arg(long)]
pub json: bool,
}
#[derive(Debug, Args)]
pub(crate) struct WorkflowPreviewArgs {
/// Portable workflow bundle JSON path.
#[arg(long)]
pub bundle: String,
/// Emit Mermaid graph text for quick debugging.
#[arg(long)]
pub mermaid: bool,
/// Emit JSON.
#[arg(long)]
pub json: bool,
}
#[derive(Debug, Args)]
pub(crate) struct WorkflowRunArgs {
/// Portable workflow bundle JSON path.
#[arg(long)]
pub bundle: String,
/// Trigger id to attach to the deterministic local receipt.
#[arg(long)]
pub trigger_id: Option<String>,
/// Event id to attach to the deterministic local receipt.
#[arg(long)]
pub event_id: Option<String>,
/// Write the receipt JSON to this path as well as stdout.
#[arg(long)]
pub receipt_out: Option<String>,
/// Emit JSON.
#[arg(long)]
pub json: bool,
}