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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// SPDX-License-Identifier: Apache-2.0
//! `heddle spool` command arguments (Spool epic P9, weft#358).
//!
//! Child-edge management + facet-history inspection over a hosted spool. Thin
//! wrappers over the `HostedUserService` Spool RPCs. Each subcommand resolves
//! the hosted server from a named remote (default `origin`), mirroring the
//! `heddle thread approve/…` hosted surface.
use clap::{Args, Subcommand};
#[derive(Clone, Debug, Subcommand)]
pub enum SpoolCommands {
/// Attach a child spool under a parent at a mount point.
///
/// The child is anchored at its current content head. Only the parent's
/// children edge-set changes — never the parent's content.
Attach(SpoolAttachArgs),
/// Detach the child mounted at a mount point under a parent.
Detach(SpoolDetachArgs),
/// List the child edges of a spool, with each edge's anchored state.
Children(SpoolChildrenArgs),
/// Show a spool's governance-facet history (newest first).
Governance(SpoolHistoryArgs),
/// Show a spool's membership-facet history (newest first).
Membership(SpoolHistoryArgs),
}
#[derive(Clone, Debug, Args)]
pub struct SpoolAttachArgs {
/// Parent spool path (the monorepo container).
pub parent: String,
/// Child spool path to attach.
pub child: String,
/// Mount name for the child inside the parent (the SPOOLLINK entry name).
/// Defaults to the child path's last segment.
#[arg(long = "as", value_name = "MOUNT")]
pub mount_name: Option<String>,
/// Remote that maps to the hosted server (default: `origin`).
#[arg(long, default_value = "origin")]
pub remote: String,
}
#[derive(Clone, Debug, Args)]
pub struct SpoolDetachArgs {
/// Parent spool path.
pub parent: String,
/// Mount name of the child to detach.
pub mount_name: String,
/// Remote that maps to the hosted server (default: `origin`).
#[arg(long, default_value = "origin")]
pub remote: String,
}
#[derive(Clone, Debug, Args)]
pub struct SpoolChildrenArgs {
/// Parent spool path whose children to list.
pub parent: String,
/// Remote that maps to the hosted server (default: `origin`).
#[arg(long, default_value = "origin")]
pub remote: String,
}
#[derive(Clone, Debug, Args)]
pub struct SpoolHistoryArgs {
/// Spool path whose facet history to walk.
pub spool: String,
/// Max entries to walk (server default when unset).
#[arg(long)]
pub limit: Option<u32>,
/// Remote that maps to the hosted server (default: `origin`).
#[arg(long, default_value = "origin")]
pub remote: String,
}