hm-plugin-protocol 0.0.1

Wire-level data types shared between the hm binary and hm plugins.
Documentation
//! Wire type for subcommand invocations.

use std::collections::BTreeMap;

use schemars::JsonSchema as DeriveJsonSchema;
use serde::{Deserialize, Serialize};

/// Carried into the plugin's subcommand entry point. The host has
/// already parsed argv on the plugin's behalf using the schema the
/// plugin declared in its manifest.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, DeriveJsonSchema)]
#[serde(deny_unknown_fields)]
pub struct SubcommandInput {
    /// Verb path: `["cloud", "org", "switch"]` for `hm cloud org switch`.
    pub verb_path: Vec<String>,
    /// Positional + option args, already parsed and JSON-encoded.
    pub args: serde_json::Value,
    /// `HARMONT_*` env vars + any vars the plugin declared interest in.
    pub env: BTreeMap<String, String>,
}