eggsact 1.2.7

Deterministic MCP and in-process utility tools for coding agents
Documentation
use crate::mcp::registry::{ToolCost, ToolExposure, ToolSpec, ToolStability};
use crate::mcp::schemas::*;
use crate::tools::*;

pub const SHELL_TOOLS: &[ToolSpec] = &[
    ToolSpec {
        name: "shell_split",
        description: "Parse a shell-like command string into argv tokens and report risky lexical features (pipes, redirections, command substitution, variable expansion, globs, control operators). Lexical POSIX-like parsing only, not full shell evaluation.",
        handler: shell_split,
        input_schema: shell_split_input,
        output_schema: shell_split_output,
        category: "shell",
        tier: 2,
        profiles: &["full", "codegg_preflight", "codegg_shell"],
        tags: &["shell", "argv", "parsing", "security", "sanity"],
        exposure: ToolExposure::HarnessOnly,
        harness_use: &["command_preflight"],
        aliases: &[],
        cost: ToolCost::Cheap,
        stability: ToolStability::Stable,
        composite: false,
    },
    ToolSpec {
        name: "shell_quote_join",
        description: "Safely quote a list of argv tokens into a POSIX-like shell string. Verifies round-trip safety with shell_split.",
        handler: shell_quote_join,
        input_schema: shell_quote_join_input,
        output_schema: shell_quote_join_output,
        category: "shell",
        tier: 2,
        profiles: &["full", "codegg_shell"],
        tags: &["shell", "argv", "quoting", "safety"],
        exposure: ToolExposure::Contextual,
        harness_use: &["none"],
        aliases: &[],
        cost: ToolCost::Cheap,
        stability: ToolStability::Stable,
        composite: false,
    },
    ToolSpec {
        name: "argv_compare",
        description: "Compare two command strings or argv lists by parsed argv tokens rather than raw text. Supports command strings, pre-parsed argv lists, or both.",
        handler: argv_compare,
        input_schema: argv_compare_input,
        output_schema: argv_compare_output,
        category: "shell",
        tier: 2,
        profiles: &["full", "codegg_shell"],
        tags: &["shell", "argv", "comparison", "sanity"],
        exposure: ToolExposure::Contextual,
        harness_use: &["command_preflight"],
        aliases: &[],
        cost: ToolCost::Cheap,
        stability: ToolStability::Stable,
        composite: false,
    },
    ToolSpec {
        name: "command_preflight",
        description: "Review a shell command against an allow/review/block policy before approval or execution and return a verdict with parsed argv and risk findings. Prefer over shell_split for approval decisions and over argv_compare for single-command review. Analyzes only; never executes.",
        handler: command_preflight,
        input_schema: command_preflight_input,
        output_schema: command_preflight_output,
        category: "shell",
        tier: 1,
        profiles: &["full", "codegg_core", "codegg_core_min", "codegg_preflight", "codegg_shell"],
        tags: &["shell", "command", "preflight", "composite", "security"],
        exposure: ToolExposure::Default,
        harness_use: &["command_preflight"],
        aliases: &[],
        cost: ToolCost::Heavy,
        stability: ToolStability::Stable,
        composite: true,
    },
];