Skip to main content

codewhale_command_contract/
config.rs

1//! Config-group command facets (FEAT-028 D3/D4).
2//!
3//! These traits let `/config`, `/settings`, `/mode`, `/theme`, `/verbose`,
4//! `/login`, `/logout`, `/pet` and `/trust` express their intent without naming
5//! `App`, a service locator, a callback, or any concrete host type. Hosts own
6//! persistence, services and I/O; the values here grant no terminal, TUI or
7//! runtime authority, and a missing facet must fail safely rather than panic.
8
9use crate::outcome::ConfigAction;
10use std::path::{Path, PathBuf};
11
12/// A message the host raises for the command to render.
13///
14/// The host never renders user-facing text for the config group: it returns a
15/// stable key plus named replacements (each replacement is itself a message,
16/// so a host never pre-renders a localized fragment), and the command resolves
17/// it through the `presentation` shape. Non-localized text (protocol/config/
18/// command names, computed values) stays a `Literal`.
19#[derive(Debug, Clone, PartialEq, Eq)]
20pub enum ConfigMessage {
21    /// Resolved by the presentation shape via its stable snake_case key.
22    Keyed {
23        key: String,
24        params: Vec<(String, ConfigMessage)>,
25    },
26    /// Non-localized text.
27    Literal(String),
28    /// A sequence rendered in order, for literal framing around keyed parts.
29    Concat(Vec<ConfigMessage>),
30}
31
32impl ConfigMessage {
33    pub fn keyed(key: impl Into<String>) -> Self {
34        Self::Keyed {
35            key: key.into(),
36            params: Vec::new(),
37        }
38    }
39    pub fn keyed_with(key: impl Into<String>, params: Vec<(String, ConfigMessage)>) -> Self {
40        Self::Keyed {
41            key: key.into(),
42            params,
43        }
44    }
45    pub fn literal(text: impl Into<String>) -> Self {
46        Self::Literal(text.into())
47    }
48    pub fn concat(parts: Vec<ConfigMessage>) -> Self {
49        Self::Concat(parts)
50    }
51}
52
53impl From<String> for ConfigMessage {
54    fn from(value: String) -> Self {
55        Self::Literal(value)
56    }
57}
58
59impl From<&str> for ConfigMessage {
60    fn from(value: &str) -> Self {
61        Self::Literal(value.to_string())
62    }
63}
64
65impl From<std::borrow::Cow<'_, str>> for ConfigMessage {
66    fn from(value: std::borrow::Cow<'_, str>) -> Self {
67        Self::Literal(value.into_owned())
68    }
69}
70
71/// Portable result of a config-group host operation.
72///
73/// The host raises a [`ConfigMessage`] and the single action the request
74/// implies; the command resolves the message through the presentation shape and
75/// maps the reply to `CommandResult<ConfigAction>` without touching `App`.
76#[derive(Debug, Clone, PartialEq, Eq)]
77pub struct ConfigReply {
78    pub message: Option<ConfigMessage>,
79    pub action: Option<ConfigAction>,
80    pub is_error: bool,
81}
82
83impl ConfigReply {
84    pub fn ok() -> Self {
85        Self {
86            message: None,
87            action: None,
88            is_error: false,
89        }
90    }
91    pub fn message(msg: impl Into<ConfigMessage>) -> Self {
92        Self {
93            message: Some(msg.into()),
94            action: None,
95            is_error: false,
96        }
97    }
98    pub fn error(msg: impl Into<ConfigMessage>) -> Self {
99        let msg = match msg.into() {
100            ConfigMessage::Literal(text) => ConfigMessage::Literal(format!("Error: {text}")),
101            other => other,
102        };
103        Self {
104            message: Some(msg),
105            action: None,
106            is_error: true,
107        }
108    }
109    pub fn action(action: ConfigAction) -> Self {
110        Self {
111            message: None,
112            action: Some(action),
113            is_error: false,
114        }
115    }
116    pub fn with_message_and_action(msg: impl Into<ConfigMessage>, action: ConfigAction) -> Self {
117        Self {
118            message: Some(msg.into()),
119            action: Some(action),
120            is_error: false,
121        }
122    }
123}
124
125/// One structured `/settings` row: the label, its column width and its value.
126#[derive(Debug, Clone, PartialEq, Eq)]
127pub struct CommandSettingsRow {
128    pub label: String,
129    pub value: String,
130    pub label_width: usize,
131}
132
133/// Typed `/settings text` report.
134///
135/// The host supplies display rows and the config-file path; the command owns
136/// the title, separator, footer and joining.
137#[derive(Debug, Clone, PartialEq, Eq)]
138pub struct CommandSettingsReport {
139    pub rows: Vec<CommandSettingsRow>,
140    pub config_file: String,
141    pub from_settings: Vec<String>,
142    pub session_overrides: Vec<String>,
143}
144
145/// Typed `/config subagents [status]` report.
146#[derive(Debug, Clone, PartialEq, Eq)]
147pub struct CommandSubagentsReport {
148    pub disabled_reason: Option<String>,
149    pub config_path: String,
150    pub provider_key: String,
151    pub provider_label: String,
152    pub explicit_enabled: Option<bool>,
153    pub limits: Vec<CommandSubagentsLimit>,
154    /// Per-provider override rows for the active provider, when configured.
155    pub provider_rows: Option<Vec<CommandSubagentsProviderRow>>,
156}
157
158/// One of the five sub-agent limits: raw, resolved global and active-provider.
159#[derive(Debug, Clone, PartialEq, Eq)]
160pub struct CommandSubagentsLimit {
161    pub key: &'static str,
162    pub raw: String,
163    pub global: String,
164    pub provider: String,
165}
166
167/// One per-provider override row (already display-formatted).
168#[derive(Debug, Clone, PartialEq, Eq)]
169pub struct CommandSubagentsProviderRow {
170    pub key: &'static str,
171    pub value: String,
172}
173
174/// One row of the `/config status` editability audit.
175///
176/// The host supplies typed facts; the command owns the table layout.
177#[derive(Debug, Clone, PartialEq, Eq)]
178pub struct CommandConfigAuditRow {
179    pub key: String,
180    pub current: String,
181    pub editability: String,
182    pub command: String,
183    /// Keyed when the note is localized, literal otherwise.
184    pub note: ConfigMessage,
185}
186
187/// Typed `/config status` audit: the resolved config path and its rows.
188#[derive(Debug, Clone, PartialEq, Eq)]
189pub struct CommandConfigAuditReport {
190    pub config_path: String,
191    pub rows: Vec<CommandConfigAuditRow>,
192}
193
194/// The complete reply contract for mutating config operations.
195///
196/// A mutating [`CommandConfigContext`] operation MUST return a [`ConfigReply`]
197/// whose keyed messages use only these keys, each with exactly these parameter
198/// names. The command validates every entry (and prepares the substituted
199/// template) *before* the effect, so rendering a mutating reply is pure
200/// substitution and never translates after the effect. A key or parameter set
201/// outside this contract is a host bug.
202pub const EFFECT_REPLY_TEMPLATES: &[(&str, &[&str])] = &[
203    ("config_command_invalid_value", &["key", "value", "choices"]),
204    ("config_notification_updated", &["key", "value", "scope"]),
205    ("config_notifications_set_hint", &[]),
206    ("config_prompt_suggestion_updated", &["value", "scope"]),
207    ("config_scope_saved", &[]),
208    ("config_scope_session", &[]),
209    ("config_search_updated", &["value", "scope"]),
210    ("contextual_tips_not_saved", &["error"]),
211    ("help_usage_label", &[]),
212    ("startup_default_not_saved", &["setting", "error"]),
213];
214
215/// Read/write configuration, presets, the editability audit, login state and
216/// the config-owned view/display commands (`/mode`, `/theme`, `/verbose`,
217/// `/fullscreen`, `/inline`, `/statusbar`, `/workbar`, `/import-claude`).
218///
219/// The host owns per-key validation, normalization, persistence and the exact
220/// message; the portable handler owns argument parsing and subcommand routing.
221/// A missing facet must fail safely rather than panic.
222pub trait CommandConfigContext {
223    /// Path of the active user configuration file, when one is resolved.
224    fn config_path(&self) -> Option<PathBuf>;
225    fn translation_enabled(&self) -> bool;
226    fn set_translation_enabled(&mut self, enabled: bool);
227
228    /// `/config status|audit|editability|editable` — typed audit rows.
229    fn audit(&mut self) -> Result<CommandConfigAuditReport, String>;
230    /// `/config workflow` / `/config goal` — typed effective facts.
231    fn workflow_summary(&mut self) -> CommandWorkflowSummary;
232    /// `/config subagents status` — typed subagent facts.
233    fn subagents_status(&mut self) -> Result<CommandSubagentsReport, String>;
234    /// `/config subagents <key>` — show one subagent setting.
235    fn subagent(&mut self, key: &str) -> ConfigReply;
236    /// `/config subagents <key> <value> [--save]`.
237    fn set_subagent(&mut self, key: &str, value: &str, persist: bool) -> ConfigReply;
238    /// `/config search.provider` — the current provider and source.
239    fn search_provider_status(&mut self) -> ConfigReply;
240    /// Accepted `search.provider` values, for the portable usage message.
241    fn search_provider_names(&self) -> &'static str;
242    /// `/config search.provider <value> [--save]`.
243    fn set_search_provider(&mut self, value: &str, persist: bool) -> ConfigReply;
244    /// `/config notifications` — the notifications report.
245    fn notifications_status(&mut self) -> ConfigReply;
246    /// `/config notifications <key>` — show one notification setting.
247    fn notification(&mut self, key: &str) -> ConfigReply;
248    /// `/config notifications <key> <value> [--save]`.
249    fn set_notification(&mut self, key: &str, value: &str, persist: bool) -> ConfigReply;
250    /// `/config preset <name> [--save]`.
251    fn apply_preset(&mut self, name: &str, persist: bool) -> ConfigReply;
252    /// `/config <key>` — show the current value.
253    fn get_value(&mut self, key: &str) -> ConfigReply;
254    /// `/config <key> <value> [--save]`.
255    fn set_value(&mut self, key: &str, value: &str, persist: bool) -> ConfigReply;
256    /// `/settings text` — typed settings facts.
257    fn show_settings(&mut self) -> Result<CommandSettingsReport, String>;
258    /// `/theme schema` — the user theme JSON schema.
259    fn theme_schema(&self) -> String;
260    /// `/theme path` — the user themes directory, rendered for display.
261    fn themes_dir(&self) -> Result<String, String>;
262    /// Current verbose-transcript flag.
263    fn verbose_enabled(&self) -> bool;
264    /// Set the verbose-transcript flag (the host also marks history updated).
265    fn set_verbose_enabled(&mut self, enabled: bool);
266    /// Current terminal screen mode, for `/fullscreen` and `/inline`.
267    fn screen_mode(&self) -> crate::types::CommandScreenMode;
268    /// `/import-claude` — build the plan from the host's home/workspace.
269    fn build_plan(&mut self) -> Option<CommandClaudePlan>;
270    /// `/import-claude` — persist the rendered report and optional bundle.
271    fn write_artifacts(&mut self, report: &str, bundle: Option<&str>) -> CommandClaudeArtifacts;
272    /// `/import-claude --apply` — carry over the standing instructions.
273    fn apply_import(
274        &mut self,
275        plan: &CommandClaudePlan,
276        report_path: &Path,
277        wrote_report: bool,
278    ) -> CommandClaudeApplyOutcome;
279    /// Host display form of a path.
280    fn display_path(&self, path: &Path) -> String;
281}
282
283/// Pet presence, mode, sound and habitat actions for `/pet`.
284///
285/// The command owns the verb parsing and message composition; the facet only
286/// observes and mutates the pet state and resolves the localized labels.
287#[derive(Debug, Clone, Copy, PartialEq, Eq)]
288pub enum CommandPetControl {
289    Sound,
290    Browser,
291    Select,
292    FocusAgents,
293    /// Body style for `/pet style`.
294    Appearance {
295        body: CommandPetBodyStyle,
296    },
297}
298
299/// Portable pet body style for `/pet style`.
300#[derive(Debug, Clone, Copy, PartialEq, Eq)]
301pub enum CommandPetBodyStyle {
302    Smooth,
303    Pixel,
304}
305
306impl CommandPetBodyStyle {
307    /// Canonical `pet_watch` token.
308    #[must_use]
309    pub fn as_str(self) -> &'static str {
310        match self {
311            Self::Smooth => "smooth",
312            Self::Pixel => "pixel",
313        }
314    }
315
316    #[must_use]
317    pub fn parse(value: &str) -> Option<Self> {
318        match value {
319            "smooth" => Some(Self::Smooth),
320            "pixel" => Some(Self::Pixel),
321            _ => None,
322        }
323    }
324}
325
326/// Localized pet labels the command composes into its messages.
327#[derive(Debug, Clone, Copy, PartialEq, Eq)]
328pub enum CommandPetLabel {
329    ModeOn,
330    ModeOff,
331    ModeOnLabel,
332    ModeOffLabel,
333    ViewOpen,
334    ViewClosed,
335    HabitatQueued,
336    ExportQueued,
337    ExportUnavailable,
338    SoundOn,
339    /// The habitat control could not be queued.
340    WatchUnavailable,
341}
342
343pub trait CommandPetContext {
344    fn enabled(&self) -> bool;
345    fn is_open(&self) -> bool;
346    fn status(&self) -> String;
347    fn avatar_choices(&self) -> String;
348    fn select_avatar(&mut self, key: &str) -> bool;
349    fn preview_avatar(&mut self, name: &str, view: bool) -> bool;
350    fn set_enabled(&mut self, enabled: bool, persist: bool);
351    fn set_sound(&mut self, enabled: bool);
352    fn sound_label(&self) -> String;
353    fn export(&mut self) -> bool;
354    fn open_habitat(&mut self);
355    /// Queue a habitat control; `false` when it could not be delivered.
356    fn queue(&mut self, control: CommandPetControl) -> bool;
357    fn label(&self, which: CommandPetLabel) -> String;
358}
359
360/// Account sign-in state for `/login`.
361#[derive(Debug, Clone, PartialEq, Eq)]
362pub enum CommandAccountState {
363    SignedOut,
364    Authenticated,
365    OfflineCached,
366    Expired,
367    Revoked,
368    Unavailable(String),
369}
370
371/// `/login` status projection (the command composes the report text).
372#[derive(Debug, Clone, PartialEq, Eq)]
373pub struct CommandLoginStatus {
374    pub account: CommandAccountState,
375    pub api_base: String,
376    pub provider: String,
377}
378
379/// Account/provider session state for `/login` and `/logout`.
380pub trait CommandLoginContext {
381    fn login_status(&self) -> CommandLoginStatus;
382    /// `/connect [<provider>]` — plugin provider sign-in.
383    fn connect(&mut self, provider: Option<&str>) -> ConfigReply;
384    /// `/disconnect <provider>` — plugin provider sign-out.
385    fn disconnect(&mut self, provider: &str) -> ConfigReply;
386}
387
388/// Workbar placement/panel observation and mutation for `/workbar`.
389pub trait CommandWorkSurfaceContext {
390    fn placement(&self) -> crate::types::CommandWorkSurfacePlacement;
391    fn panel(&self) -> crate::types::CommandRailPanel;
392    fn effective_placement(&self) -> crate::types::CommandWorkSurfacePlacement;
393    fn area_present(&self) -> bool;
394    fn panel_title(&self, panel: crate::types::CommandRailPanel) -> String;
395    /// Apply a placement; when `persist`, also writes the setting. The reply is
396    /// the key-engine result (ignored on success, returned on error).
397    fn set_placement(
398        &mut self,
399        placement: crate::types::CommandWorkSurfacePlacement,
400        persist: bool,
401    ) -> ConfigReply;
402    fn set_panel(&mut self, panel: crate::types::CommandRailPanel, persist: bool) -> ConfigReply;
403    fn mark_redraw(&mut self);
404}
405
406/// A path problem surfaced by `/trust add|remove`.
407#[derive(Debug, Clone, PartialEq, Eq)]
408pub enum TrustPathError {
409    /// The supplied path does not exist.
410    NotFound(PathBuf),
411    /// The allow-list could not be updated; carries the host error text.
412    UpdateFailed(String),
413}
414
415/// Workspace trust and the per-path allow-list for `/trust`.
416pub trait CommandTrustContext {
417    fn trust_mode(&self) -> bool;
418    fn trusted_paths(&self) -> Vec<PathBuf>;
419    /// Add a path (the host expands `~` and validates existence).
420    fn add_trusted_path(&mut self, raw: &str) -> Result<PathBuf, TrustPathError>;
421    /// Returns the resolved path and whether it was removed.
422    fn remove_trusted_path(&mut self, raw: &str) -> Result<(PathBuf, bool), TrustPathError>;
423    /// The localized `Usage:` label used by the `/trust on|off` usage error.
424    fn usage_label(&self) -> String;
425}
426
427// ---------------------------------------------------------------------------
428// Portable payloads for host effects that cross the config boundary (D5).
429//
430// The TUI conversion layer has no access to `App`, so engine-affecting actions
431// cannot be re-derived at conversion time. These mirrors carry the exact data
432// the host needs, and the host converts each direction faithfully.
433// ---------------------------------------------------------------------------
434
435/// Route capability fact, mirroring the config layer's `CapabilityState`.
436#[derive(Debug, Clone, Copy, PartialEq, Eq)]
437pub enum CommandCapabilityState {
438    Supported,
439    Unsupported,
440    Unknown,
441}
442
443/// Compaction configuration carried by `ConfigAction::CompactionChanged`.
444#[derive(Debug, Clone, PartialEq, Eq)]
445pub struct CommandCompactionConfig {
446    pub enabled: bool,
447    pub token_threshold: usize,
448    pub model: String,
449    pub image_input: CommandCapabilityState,
450    pub effective_context_window: Option<u32>,
451    pub cache_summary: bool,
452    pub focus: Option<String>,
453    pub runtime_cost_owner: Option<String>,
454    pub workspace: Option<PathBuf>,
455    pub summary_instructions: Option<String>,
456    pub retained_user_message_tokens: usize,
457}
458
459/// Subagent runtime configuration carried by `ConfigAction::SubagentRuntimeChanged`.
460#[derive(Debug, Clone, Copy, PartialEq, Eq)]
461pub struct CommandSubagentRuntimeConfig {
462    pub enabled: bool,
463    pub max_subagents: usize,
464    pub launch_concurrency: usize,
465    pub max_spawn_depth: u32,
466    pub api_timeout_secs: u64,
467    pub heartbeat_timeout_secs: u64,
468}
469
470/// Search provider carried by `ConfigAction::SearchProviderChanged`.
471#[derive(Debug, Clone, Copy, PartialEq, Eq)]
472pub enum CommandSearchProvider {
473    Bing,
474    DuckDuckGo,
475    Firecrawl,
476    Tavily,
477    Bocha,
478    Metaso,
479    Searxng,
480    Baidu,
481    Volcengine,
482    Sofya,
483    Serply,
484    DeepSeek,
485    SearchApi,
486}
487
488/// Operator-notification delivery method.
489#[derive(Debug, Clone, Copy, PartialEq, Eq)]
490pub enum CommandNotificationMethod {
491    Auto,
492    Osc9,
493    Bel,
494    Kitty,
495    Ghostty,
496    Off,
497}
498
499/// Turn-completion sound choice.
500#[derive(Debug, Clone, Copy, PartialEq, Eq)]
501pub enum CommandCompletionSound {
502    Off,
503    Beep,
504    Bell,
505    Whale,
506    File,
507}
508
509/// When operator notifications are allowed.
510#[derive(Debug, Clone, Copy, PartialEq, Eq)]
511pub enum CommandNotificationCondition {
512    Always,
513    Unfocused,
514    Never,
515}
516
517/// Subagent-completion notification policy.
518#[derive(Debug, Clone, Copy, PartialEq, Eq)]
519pub enum CommandSubagentCompletion {
520    Always,
521    FinalOnly,
522    Off,
523}
524
525/// One notification event kind.
526#[derive(Debug, Clone, Copy, PartialEq, Eq)]
527pub enum CommandNotificationEvent {
528    TurnComplete,
529    SubagentTerminal,
530    ApprovalNeeded,
531    InputNeeded,
532    ElevationNeeded,
533    ModelNotify,
534}
535
536/// One validated notification edit, mirroring `NotificationConfigUpdate`.
537#[derive(Debug, Clone, PartialEq, Eq)]
538pub enum CommandNotificationUpdate {
539    Method(CommandNotificationMethod),
540    ThresholdSecs(u64),
541    IncludeSummary(bool),
542    Quiet(bool),
543    Sound(Option<CommandCompletionSound>),
544    Condition(CommandNotificationCondition),
545    CompletionSound(CommandCompletionSound),
546    SubagentCompletion(CommandSubagentCompletion),
547    SoundFile(PathBuf),
548    Event(CommandNotificationEvent, bool),
549    EventSoundEnabled(bool),
550    EventSoundEvents(Vec<String>),
551    EventSoundMinIntervalMs(u64),
552    EventSoundQuiet(bool),
553}
554
555// ---------------------------------------------------------------------------
556// `/import-claude` plan model (portable). The host builds the plan from the
557// Claude sources and performs the writes/apply; the command renders it.
558// ---------------------------------------------------------------------------
559
560/// Effective `[workflow]`/`[goal]` facts for `/config workflow`.
561#[derive(Debug, Clone, Copy, PartialEq, Eq)]
562pub struct CommandWorkflowSummary {
563    pub automatic: bool,
564    pub auto_start_read_only: bool,
565    pub require_approval_for_writes: bool,
566    pub max_children: u32,
567    pub max_concurrent: u32,
568    pub max_depth: u32,
569    pub default_token_budget: u64,
570    pub goal_max_continuations: u32,
571    pub goal_enforce_token_budget: bool,
572}
573
574/// Outcome of reading one Claude source file.
575#[derive(Debug, Clone, PartialEq, Eq)]
576pub enum CommandSourceStatus {
577    Found,
578    NotFound,
579    Oversize(u64),
580    InvalidJson,
581    Unreadable(String),
582}
583
584impl CommandSourceStatus {
585    /// The one-line provenance entry used by the rendered plan and report.
586    ///
587    /// `display_path` is the host's display projection (for example `~/...`),
588    /// so the portable layer never leaks an absolute home path.
589    #[must_use]
590    pub fn describe(&self, display_path: &str) -> String {
591        match self {
592            Self::Found => format!("found: {display_path}"),
593            Self::NotFound => format!("not found: {display_path}"),
594            Self::Oversize(bytes) => {
595                format!("skipped, too large ({bytes} bytes): {display_path}")
596            }
597            Self::InvalidJson => format!("invalid JSON: {display_path}"),
598            Self::Unreadable(error) => format!("unreadable: {display_path} ({error})"),
599        }
600    }
601}
602
603/// One MCP server discovered in the Claude sources.
604#[derive(Debug, Clone, PartialEq, Eq)]
605pub struct CommandMcpCandidate {
606    pub name: String,
607    pub summary: String,
608    pub hard_blocked: bool,
609}
610
611/// The full `/import-claude` plan. Pure data: building it mutates nothing.
612#[derive(Debug, Clone, Default, PartialEq, Eq)]
613pub struct CommandClaudePlan {
614    pub sources: Vec<(PathBuf, CommandSourceStatus)>,
615    pub mcp_candidates: Vec<CommandMcpCandidate>,
616    pub per_project_mcp: Vec<String>,
617    /// Safe env entries proposed for the portable bundle, key-sorted.
618    pub env_safe: Vec<(String, String)>,
619    pub env_skipped: Vec<String>,
620    pub permissions_default_mode: Option<String>,
621    pub permissions_allow: Vec<String>,
622    pub permissions_ask: Vec<String>,
623    pub permissions_deny: Vec<String>,
624    pub hook_events: Vec<String>,
625    pub has_claude_md: bool,
626    pub claude_projects: Vec<String>,
627}
628
629impl CommandClaudePlan {
630    #[must_use]
631    pub fn is_empty(&self) -> bool {
632        self.mcp_candidates.is_empty()
633            && self.per_project_mcp.is_empty()
634            && self.env_safe.is_empty()
635            && self.env_skipped.is_empty()
636            && self.permissions_default_mode.is_none()
637            && self.permissions_allow.is_empty()
638            && self.permissions_ask.is_empty()
639            && self.permissions_deny.is_empty()
640            && self.hook_events.is_empty()
641            && !self.has_claude_md
642            && self.claude_projects.is_empty()
643    }
644}
645
646/// One typed `/import-claude --apply` follow-up.
647///
648/// The host supplies the facts; the command composes the sentences.
649#[derive(Debug, Clone, PartialEq, Eq)]
650pub enum CommandImportFollowUp {
651    InstructionsCopied { destination: String },
652    InstructionsKeptExisting { destination: String, source: String },
653    InstructionsCopyFailed { source: String, destination: String },
654    HomeUnresolved,
655    McpBlocked { name: String },
656    McpNeedsReview { name: String },
657    HookEvents { count: usize },
658    PermissionRules,
659}
660
661/// Paths and write outcomes from persisting the report/bundle.
662#[derive(Debug, Clone, PartialEq, Eq)]
663pub struct CommandClaudeArtifacts {
664    pub report_path: PathBuf,
665    pub bundle_path: PathBuf,
666    pub wrote_report: bool,
667    pub wrote_bundle: bool,
668}
669
670/// Typed `--apply` outcome; the command composes the final message.
671#[derive(Debug, Clone, Default, PartialEq, Eq)]
672pub struct CommandClaudeApplyOutcome {
673    pub done: Vec<CommandImportFollowUp>,
674    pub manual: Vec<CommandImportFollowUp>,
675    pub report_path: PathBuf,
676    pub wrote_report: bool,
677}