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
//! Mode dispatcher trait for external shell integration (e.g., Shannon).
//!
//! When a host binary provides a `ModeDispatcher`, the REPL checks
//! `$env.SHANNON_MODE` each iteration. If the mode is not "nu", the
//! dispatcher handles the command instead of nushell's parser/evaluator.
use HashMap;
use PathBuf;
/// Trait for dispatching commands to non-nushell modes (e.g., brush, AI).
///
/// The dispatcher receives string env vars (already converted from nushell's
/// typed Values) and returns strings. The REPL handles conversion back to
/// nushell Values.
/// Result of a mode dispatch execution.