pub struct MeshSessionOpenArgs {
pub session: String,
pub client: Option<String>,
pub worker: Option<String>,
pub intent: Option<String>,
pub task: Option<String>,
pub issue: Option<String>,
pub milestone: Option<String>,
pub branch: Option<String>,
pub head: Option<String>,
pub query: MeshQueryArgs,
}Expand description
mesh session open: everything a session says about itself, so that another runtime’s
operator can tell who is here and what they are doing. Only --session is required;
the rest — client, worker, intent, task, issue, milestone, branch, head — are what the
session knows about its own work, and opening the same id twice updates the record
rather than refusing, which is what makes this usable from a hook that cannot know
whether it has run before.
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, MeshCommand, MeshSessionCommand, MeshSessionOpenArgs};
let cli = Cli::try_parse_from([
"majordomus", "mesh", "session", "open", "--session", "s1",
"--worker", "documenter", "--branch", "feature/mesh-cooperation",
])
.unwrap();
let Command::Mesh(mesh) = cli.command else { panic!("expected `mesh`") };
let MeshCommand::Session(session) = mesh.command else { panic!("expected `session`") };
let MeshSessionCommand::Open(open) = session.command else { panic!("expected `open`") };
let open: MeshSessionOpenArgs = open;
assert_eq!(open.session, "s1");
assert_eq!(open.worker.as_deref(), Some("documenter"));
assert_eq!(open.branch.as_deref(), Some("feature/mesh-cooperation"));
assert_eq!(open.task, None, "what the session does not say stays unsaid");
// a session without an id is not a session
assert!(Cli::try_parse_from(["majordomus", "mesh", "session", "open"]).is_err());Fields§
§session: StringThe session’s id within this runtime
client: Option<String>The client (claude-code, codex, cli)
worker: Option<String>The worker’s name for itself
intent: Option<String>What the session is doing
task: Option<String>The task id
issue: Option<String>The issue
milestone: Option<String>The milestone
branch: Option<String>The branch
head: Option<String>The head commit
query: MeshQueryArgsWhere the repository is and how to answer.
Trait Implementations§
Source§impl Args for MeshSessionOpenArgs
impl Args for MeshSessionOpenArgs
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
Report the [
ArgGroup::id][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to [
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§impl Debug for MeshSessionOpenArgs
impl Debug for MeshSessionOpenArgs
Source§impl FromArgMatches for MeshSessionOpenArgs
impl FromArgMatches for MeshSessionOpenArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Auto Trait Implementations§
impl Freeze for MeshSessionOpenArgs
impl RefUnwindSafe for MeshSessionOpenArgs
impl Send for MeshSessionOpenArgs
impl Sync for MeshSessionOpenArgs
impl Unpin for MeshSessionOpenArgs
impl UnsafeUnpin for MeshSessionOpenArgs
impl UnwindSafe for MeshSessionOpenArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more